[
  {
    "path": ".gitignore",
    "content": "*.mof\n.vscode\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: generic\n\nbranches:\n  only:\n    - master\n\nenv:\n  global:\n    - PSDS_CODECOVERAGE_RESULTFILE='psdsTestsCoverage'\n\njobs:\n  include:\n    - stage: VMware.PSDesiredStateConfigurationTests\n      os: linux\n      dist: bionic\n      addons:\n        apt:\n          sources:\n            - sourceline: \"deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main\"\n              key_url: \"https://packages.microsoft.com/keys/microsoft.asc\"\n          packages:\n            - powershell\n      workspaces:\n        create:\n          name: coverageWorkspace\n          paths:\n            - psdsTestsCoverage\n      script:\n        - pwsh -File './Build/enableExperimentalFeature.ps1'\n        - pwsh -File './Build/VMware.PSDSCUnitTestsRunner.ps1'\n    - stage: Build\n      os: linux\n      dist: trusty\n      addons:\n        apt:\n          sources:\n            - sourceline: \"deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main\"\n              key_url: \"https://packages.microsoft.com/keys/microsoft.asc\"\n          packages:\n            - powershell\n      workspaces:\n        use: coverageWorkspace\n      before_install:\n        - chmod +x Build/travis-push.sh\n      script:\n        - pwsh -File './Build/build.ps1'\n      after_success:\n        - '[ \"${TRAVIS_EVENT_TYPE}\" = \"push\" ] && [ \"${TRAVIS_BRANCH}\" = \"master\" ] && Build/travis-push.sh'\n"
  },
  {
    "path": "Build/VMware.PSDSCUnitTestsRunner.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.NOTES\nThe Unit tests for VMware.PSDesiredStateConfiguration get executed in a Ubuntu 18.04 build because\nthey depend on PowerShell 7.0.\n#>\n\n<#\n.SYNOPSIS\nRuns the unit tests for the VMware.PSDesiredStateConfiguration module and returns code coverage percent.\n.DESCRIPTION\nRuns the unit tests for the VMware.PSDesiredStateConfiguration module and returns code coverage percent\nBefore the tests are run it adds the required DSC resource to the PSModulePath\n#>\nfunction Invoke-PsDesiredStateConfigurationTests {\n    $moduleName = 'VMware.PSDesiredStateConfiguration'\n    $moduleRoot = Join-Path $Script:SourceRoot $moduleName\n    $configPath = Join-Path (Join-Path (Join-Path $moduleRoot 'Tests') 'Required Dsc Resources') 'MyDscResource'\n\n    # add the required DSC Resource for unit tests\n    $env:PSModulePath += \"$([System.IO.Path]::PathSeparator)$configPath\"\n\n    # sets ProgressPreference to ignore text because it breaks the travisCI console output\n    $Global:ProgressPreference = 'SilentlyContinue'\n\n    # run unit tests\n    $coveragePercent = Invoke-UnitTests $moduleName\n\n    $Global:ProgressPreference = 'Continue'\n\n    $coveragePercent\n}\n\n# add common utilities\n. (Join-Path $PSScriptRoot 'common.ps1')\n\n$flagResult = Set-BuildFlags\n\nif (Test-Flag -InputFlag $flagResult -DesiredFlag Tests_PSDSC) {\n    $coveragePercent = Invoke-PsDesiredStateConfigurationTests\n\n    # save result in shared travis workspace file\n    $resultPath = Join-Path $env:TRAVIS_BUILD_DIR $env:PSDS_CODECOVERAGE_RESULTFILE\n    $coveragePercent | Out-File $resultPath\n}\n"
  },
  {
    "path": "Build/build.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.SYNOPSIS\nRetrieves the Module Version from the passed psd1 file.\n\n.DESCRIPTION\nGets the content of the passed psd1 file.\nUsing a regex pattern retrieves the Module Version from the content of the psd1 file.\nReturns the Module Version.\n\n.PARAMETER PsdPath\nSpecifies the path to the psd1 file where the Module Version is located.\n#>\nfunction Get-ModuleVersion {\n    [CmdletBinding()]\n    [OutputType([string])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [string] $PsdPath\n    )\n\n    $psdFileContent = Get-Content -Path $PsdPath\n\n    $moduleVersionPattern = \"(?<=ModuleVersion = ')(\\d*.\\d*.\\d*.\\d*)\"\n    $moduleVersionMatch = $psdFileContent | Select-String -Pattern $moduleVersionPattern\n\n    return $moduleVersionMatch.Matches[0].Value\n}\n\n<#\n.SYNOPSIS\nRetrieves the description of the merged Pull Request via the GitHub API.\n\n.DESCRIPTION\nConstructs a query using the current commit 'sha' to retrieve the Pull Request information\nvia the GitHub API using the 'Auth Token' and returns the description of the found pull request.\nThe 'Auth Token' and current commit 'sha' are available through Travis CI environment variables.\n#>\nfunction Get-PullRequestDescription {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $repository = 'vmware/dscr-for-vmware'\n    $searchType = 'pr'\n    $pullRequestState = 'closed'\n\n    $base64Token = [System.Convert]::ToBase64String([char[]] $env:GH_TOKEN)\n    $uri = \"https://api.github.com/search/issues?q=repo:$repository+type:$searchType+state:$pullRequestState+$env:TRAVIS_COMMIT is:merged\"\n    $method = 'Get'\n    $headers = @{\n        Authorization = \"Basic $base64Token\"\n    }\n\n    try {\n        $pullRequestsInfo = Invoke-RestMethod -Uri $uri -Method $method -Headers $headers\n    }\n    catch {\n        throw \"An error occurred while retrieving the Pull Request information: $($_.Exception.Message)\"\n    }\n\n    $pullRequest = $pullRequestsInfo.items[0]\n    if ($null -eq $pullRequest) {\n        <#\n        Here the build was triggered without a Pull Request so the description should be\n        retrieved from the commit body.\n        #>\n        $commitUri = \"https://api.github.com/repos/$repository/commits/$env:TRAVIS_COMMIT\"\n        try {\n            $commitInfo = Invoke-RestMethod -Uri $commitUri -Method $method -Headers $headers\n        }\n        catch {\n            throw \"An error occurred while retrieving the Commit information: $($_.Exception.Message)\"\n        }\n\n        return $commitInfo.commit.message\n    }\n\n    return $pullRequest.body\n}\n\n<#\n.SYNOPSIS\nUpdates the Changelog document with the changes mentioned in the Pull Request description.\n\n.DESCRIPTION\nUpdates the content of the Changelog document adding a new section containing\nthe new module version and the changes made with the Pull Request which are mentioned in the description.\n\n.PARAMETER ChangelogDocumentPath\nSpecifies the path to the Changelog document which is going to be updated.\n\n.PARAMETER PullRequestDescription\nSpecifies the description of the changes made in the Pull Request.\n\n.PARAMETER ModuleVersion\nSpecifies the new Module Version that is going to be added to the new section in the document.\n#>\nfunction Update-ChangelogDocument {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [string] $ChangelogDocumentPath,\n\n        [Parameter(Mandatory = $true)]\n        [string] $PullRequestDescription,\n\n        [Parameter(Mandatory = $false)]\n        [string] $ModuleName,\n\n        [Parameter(Mandatory = $false)]\n        [string] $ModuleVersion\n    )\n\n    $changelogDocument = Get-Content -Path $ChangelogDocumentPath\n\n    # To find the first section in CHANGELOG.md we need to find the first occurence of a date in the document which is part of the section.\n    $datePattern = \"\\d{4}-\\d{2}-\\d{2}\"\n    $firstDateInFile = $changelogDocument | Select-String -Pattern $datePattern | Select-Object -First 1\n\n    <#\n    To find the Header length in CHANGELOG.md we need to substract two fron the found date line number because the header end is on the\n    previous line and also because LineNumber starts from 1 and the array indices start from 0.\n    #>\n    $headerLength = $firstDateInFile.LineNumber - 2\n\n    $changelogHeader = $changelogDocument[0..$headerLength]\n    $changelogSections = $changelogDocument[($headerLength + 1)..$changelogDocument.Length]\n\n    $currentDate = Get-Date -Format yyyy-MM-dd\n    $newSectionHeader = [string]::Empty\n\n    if ([string]::IsNullOrEmpty($ModuleName) -or [string]::IsNullOrEmpty($ModuleVersion)) {\n        # generic header for project level changes\n        $newSectionHeader = \"## $currentDate\"\n    } else {\n        # specific header for model changes\n        $newSectionHeader = \"## $ModuleName $ModuleVersion - $currentDate\"\n    }\n\n    # assemble CHANGELOG.md content\n    $changelogDocumentNewContent = $changelogHeader + $newSectionHeader + $PullRequestDescription + $changelogSections\n    $changelogDocumentNewContent | Set-Content -Path $ChangelogDocumentPath\n}\n\n<#\n.SYNOPSIS\nUpdates the Code Coverage badge with the new percent from the unit tests.\n\n.DESCRIPTION\nUpdates the content of the passed text file by modifying the Code Coverage badge\nwith the specified percent from the unit tests.\n\n.PARAMETER TextFilePath\nThe path to the file containing the Code Coverage badge.\n\n.PARAMETER ModuleName\nName of the module whose Code Coverage badge gets updated.\n\n.PARAMETER CodeCoveragePercent\nThe new value in percents from the Code Coverage of the unit tests. Default value is 0.\n#>\nfunction Update-CodeCoveragePercentInTextFile {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [string] $TextFilePath,\n\n        [Parameter(Mandatory = $true)]\n        [string] $ModuleName,\n\n        [Parameter(Mandatory = $false)]\n        [int] $CodeCoveragePercent = 0\n    )\n\n    if ($CodeCoveragePercent -lt 90) {\n        throw \"The Code Coverage is $CodeCoveragePercent which is below 90 percent.\"\n    }\n\n    $badgeColor = switch ($CodeCoveragePercent) {\n        {$_ -in 90..100} { 'brightgreen' }\n        {$_ -in 75..89}  { 'yellow' }\n        {$_ -in 60..74}  { 'orange' }\n        default          { 'red' }\n    }\n\n    $readMeContent = Get-Content $TextFilePath\n    $readMeContent = $readMeContent -replace \"\\*\\*$ModuleName\\*\\* !\\[Coverage\\].+\\)\", \"**$ModuleName** ![Coverage](https://img.shields.io/badge/coverage-$CodeCoveragePercent%25-$badgeColor.svg?maxAge=60)\"\n    $readMeContent | Set-Content -Path $TextFilePath\n}\n\n<#\n.SYNOPSIS\nGets the range between the start and the end line of the specified line pattern.\n\n.DESCRIPTION\nGets the range between the start and the end line of the specified line pattern.\nThe returned hashtable contains the start line and the end line of the specified line pattern.\n\n.PARAMETER FileContent\nThe content of the file in which the line pattern is going to be searched.\n\n.PARAMETER StartLinePattern\nThe start of the searched line pattern.\n\n.PARAMETER EndLinePattern\nThe end of the searched line pattern.\n#>\nfunction Get-LinesRange {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Object[]]\n        $FileContent,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $StartLinePattern,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $EndLinePattern\n    )\n\n    $range = @{}\n\n    $index = 1\n    $startLine = 0\n    $endLine = 0\n\n    foreach ($line in $FileContent) {\n        if ($line -Like $StartLinePattern) {\n            $startLine = $index\n        }\n\n        if ($line.Trim().EndsWith($EndLinePattern) -and $startLine -ne 0) {\n            $endLine = $index\n            break\n        }\n\n        $index++\n    }\n\n    $range.StartLine = $startLine\n    $range.EndLine = $endLine\n\n    $range\n}\n\n<#\n.SYNOPSIS\nGets the 'RequiredModules' array for the VMware.vSphereDSC module from the specified RequiredModules file.\n\n.DESCRIPTION\nGets the 'RequiredModules' array for the VMware.vSphereDSC module from the specified RequiredModules file.\nThe RequiredModules file contains the array of 'RequiredModules' that the VMware.vSphereDSC module depends on.\n\n.PARAMETER RequiredModulesContent\nThe content of the RequiredModules file which contains the array of 'RequiredModules' that the VMware.vSphereDSC module depends on.\n#>\nfunction Get-RequiredModules {\n    [CmdletBinding()]\n    [OutputType([string[]])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Object[]]\n        $RequiredModulesContent\n    )\n\n    $licenseRange = Get-LinesRange -FileContent $RequiredModulesContent -StartLinePattern '*Copyright*' -EndLinePattern '#>'\n    $licenseEndLine = $licenseRange.EndLine + 1\n\n    # We skip the comment lines for the License and the License text for the RequiredModules file.\n    $requiredModules = $RequiredModulesContent[$licenseEndLine..($RequiredModulesContent.Length - 1)]\n    $requiredModules\n}\n\n<#\n.SYNOPSIS\nUpdates the 'RequiredModules' array in the specified module manifest file with the specified 'RequiredModules' array.\n\n.DESCRIPTION\nUpdates the 'RequiredModules' array in the specified module manifest file with the specified RequiredModules array.\nThe 'RequiredModules' array contains the modules that the VMware.vSphereDSC module depends on.\n\n.PARAMETER ModuleManifestContent\nThe content of the module manifest file which should be updated with the 'RequiredModules' array.\n\n.PARAMETER RequiredModules\nThe array of required modules that the VMware.vSphereDSC module depends on.\n#>\nfunction Update-RequiredModules {\n    [CmdletBinding()]\n    [OutputType([System.Object[]])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Object[]]\n        $ModuleManifestContent,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $RequiredModules\n    )\n\n    $requiredModulesInModuleManifestRange = Get-LinesRange -FileContent $ModuleManifestContent -StartLinePattern \"*RequiredModules*\" -EndLinePattern \")\"\n    $requiredModulesStartLine = $requiredModulesInModuleManifestRange.StartLine\n    $requiredModulesEndLine = $requiredModulesInModuleManifestRange.EndLine\n\n    $moduleManifestUpdatedContent = @()\n    for ($i = 0; $i -le $requiredModulesStartLine - 2; $i++) {\n        $moduleManifestUpdatedContent += $ModuleManifestContent[$i]\n    }\n\n    $moduleManifestUpdatedContent += $RequiredModules\n\n    for ($i = $requiredModulesEndLine; $i -le $ModuleManifestContent.Length - 1; $i++) {\n        $moduleManifestUpdatedContent += $ModuleManifestContent[$i]\n    }\n\n    $moduleManifestUpdatedContent\n}\n\n<#\n.DESCRIPTION\nStart the building process for the VMware.PSDesiredStateConfiguration module and\nreturns the updated module version\n#>\nfunction Start-PSDesiredStateConfigurationBuild {\n    [CmdletBinding()]\n    [OutputType([string])]\n    Param()\n\n    # run the specific module build file\n    $moduleName = 'VMware.PSDesiredStateConfiguration'\n    $moduleRoot = Join-Path -Path $script:SourceRoot -ChildPath $moduleName\n    $buildModuleFilePath = Join-Path -Path $moduleRoot -ChildPath \"$moduleName.build.ps1\"\n    . $buildModuleFilePath\n\n    $psdPath = Join-Path -Path $moduleRoot -ChildPath \"$($moduleName).psd1\"\n\n    # return module version\n    Get-ModuleVersion -psdPath $psdPath\n}\n\n<#\n.DESCRIPTION\nStart the building process for the VMware.vSphereDsc module and\nreturns the updated module version\n#>\nfunction Start-vSphereDSCBuild {\n    [CmdletBinding()]\n    [OutputType([string])]\n    Param()\n\n    # Updating the content of the psm1 and psd1 files via the build module file.\n    $moduleName = 'VMware.vSphereDSC'\n    $moduleRoot = Join-Path $Script:SourceRoot $moduleName\n    $buildModuleFilePath = Join-Path -Path $moduleRoot -ChildPath \"$moduleName.build.ps1\"\n    . $buildModuleFilePath\n\n    $psdPath = Join-Path -Path $moduleRoot -ChildPath \"$($moduleName).psd1\"\n    $psdContent = Get-Content -Path $psdPath\n\n    if ($env:TRAVIS_EVENT_TYPE -eq 'push' -and $env:TRAVIS_BRANCH -eq 'master') {\n        # Retrieving the 'RequiredModules' array from the RequiredModules file.\n        $requiredModulesFilePath = Join-Path -Path $ModuleRoot -ChildPath 'RequiredModules.ps1'\n        $requiredModulesContent = Get-Content -Path $requiredModulesFilePath\n        $requiredModules = Get-RequiredModules -RequiredModulesContent $requiredModulesContent\n    \n        # Updating the required modules array in the psd1 file.\n        $psdContent = Update-RequiredModules -ModuleManifestContent $psdContent -RequiredModules $requiredModules\n        $psdContent | Out-File -FilePath $psdPath -Encoding Default\n    }\n\n    # return module version\n    Get-ModuleVersion -psdPath $psdPath\n}\n\n<#\n.DESCRIPTION\nInvokes the VMware.vSphereDSC unit tests and updates the code coverage percent\nin the README.md file\n#>\nfunction Invoke-vSphereDSCTests {\n    $moduleName = 'VMware.vSphereDSC'\n    $moduleRoot = Join-Path -Path $script:SourceRoot -ChildPath $moduleName\n    $psdPath = Join-Path -Path $moduleRoot -ChildPath \"$($moduleName).psd1\"\n    $originalPsdContent = Get-Content -Path $psdPath\n\n    # The 'RequiredModules' array needs to be empty before the Unit tests are executed because 'VMware.PowerCLI' is not installed during the build procedure.\n    $emptyRequiredModulesArray = @(\"RequiredModules = @()\")\n    $psdContent = Update-RequiredModules -ModuleManifestContent $originalPsdContent -RequiredModules $emptyRequiredModulesArray\n    $psdContent | Out-File -FilePath $psdPath -Encoding Default\n\n    # run tests and calculate coverage percent\n    $coveragePercent = Invoke-UnitTests $moduleName\n\n    # revert 'RequiredModules' array changes\n    $originalPsdContent | Out-File -FilePath $psdPath -Encoding Default\n\n    $updateCodeCoveragePercentInTextFileParams = @{\n        CodeCoveragePercent = $coveragePercent\n        TextFilePath = $Script:ReadMePath\n        ModuleName = $moduleName\n    }\n\n    # update coverage in README.md\n    Update-CodeCoveragePercentInTextFile @updateCodeCoveragePercentInTextFileParams\n}\n\n<#\n.SYNOPSIS\nSets the result from the VMware.PSDesiredStateConfiugration unit tests into the README.md file.\n.DESCRIPTION\nSets the result from the VMware.PSDesiredStateConfiugration unit tests\ninto the README.md file. The tests result gets retrieved from a Travis workspace file\nthat gets populated from a different Travis job.\n#>\nfunction Set-PSDesiredStateConfigurationTestsResults {\n    $moduleName = 'PSDesiredStateConfiguration'\n\n    # get code coverage result from shared travis workspace file\n    $coveragePath = Join-Path $env:TRAVIS_BUILD_DIR $env:PSDS_CODECOVERAGE_RESULTFILE\n    $coveragePercent = [int] (Get-Content $coveragePath -Raw)\n\n\t# remove travis workspace file\n    Remove-Item -Path $coveragePath -Force\n\n    $updateCodeCoveragePercentInTextFileParams = @{\n        CodeCoveragePercent = $coveragePercent\n        TextFilePath = $Script:ReadMePath\n        ModuleName = $moduleName\n    }\n\n    Update-CodeCoveragePercentInTextFile @updateCodeCoveragePercentInTextFileParams\n}\n\n# add common functions, script variables and perform common logic\n. (Join-Path $PSScriptRoot 'common.ps1')\n\n# flags for which steps to be executed\n$flagChanges = Set-BuildFlags\n\n# will contain modules that are changed and their updated versions\n$changedModulesInfo = @{}\n\nif (Test-Flag -InputFlag $flagChanges -DesiredFlag Update_PSDSC) {\n    Write-Host '---------VMware.PSDesiredStateConfiguration build started'\n\n    $version = Start-PSDesiredStateConfigurationBuild\n    $changedModulesInfo['VMware.PSDesiredStateConfiguration'] = $version\n\n    Write-Host '---------VMware.PSDesiredStateConfiguration build ended'\n}\n\nif (Test-Flag -InputFlag $flagChanges -DesiredFlag Tests_PSDSC) {\n    Write-Host '---------VMware.PSDesiredStateConfiguration tests started'\n\n    Set-PSDesiredStateConfigurationTestsResults\n\n    Write-Host '---------VMware.PSDesiredStateConfiguration tests ended'\n}\n\nif (Test-Flag -InputFlag $flagChanges -DesiredFlag Update_VSDSC) {\n    Write-Host '---------VMware.vSphereDSC build started'\n\n    $version = Start-vSphereDSCBuild\n    $changedModulesInfo['VMware.vSphereDSC'] = $version\n\n    Write-Host '---------VMware.vSphereDSC build ended'\n}\n\nif (Test-Flag -InputFlag $flagChanges -DesiredFlag Tests_VSDSC) {\n    Write-Host '---------VMware.vSphereDSC tests started'\n\n    Invoke-vSphereDSCTests\n\n    Write-Host '---------VMware.vSphereDSC tests ended'\n}\n\nif ($env:TRAVIS_EVENT_TYPE -eq 'push' -and $env:TRAVIS_BRANCH -eq 'master') {\n    # get request description\n    $pullRequestDescription = Get-PullRequestDescription\n\n    # check if there is a change in the modules\n    if ($changedModulesInfo.Count -eq 0) {\n        # when no change in the modules is found then\n        # a generic entry with only a date gets generated in the CHANGELOG.md\n        $updateChangeLogParams = @{\n            ChangelogDocumentPath = $Script:ChangelogDocumentPath\n            PullRequestDescription = $pullRequestDescription\n        }\n\n        Update-ChangelogDocument @updateChangeLogParams  \n    } else {\n        # generates an entry for each changed module in the CHANGELOG.md\n        foreach ($changedModuleKey in $changedModulesInfo.Keys) {\n            $updateChangeLogParams = @{\n                ChangelogDocumentPath = $Script:ChangelogDocumentPath\n                PullRequestDescription = $pullRequestDescription\n                ModuleName = $changedModuleKey\n                ModuleVersion = $changedModulesInfo[$changedModuleKey]\n            }\n\n            Update-ChangelogDocument @updateChangeLogParams  \n        }\n    }\n}\n"
  },
  {
    "path": "Build/common.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nBuildFlags defines operations which the build should perform.\nUpdate_PSDSC flag runs the build process for VMware.PSDesiredStateConfiguration.\nUpdate_VSDSC flag runs the build process for VMware.vSphereDSC.\nTests_VSDSC flag runs the VMware.vSphereDSC unit tests.\nTests_PSDSC flag runs the VMware.PSDesiredStateConfiguration unit tests.\nNone is the defaut value for not running any additional steps.\n#>\n[Flags()] enum BuildFlags {\n    Update_PSDSC = 1\n    Update_VSDSC = 2\n    Tests_VSDSC = 4\n    Tests_PSDSC = 8\n    None = 16\n}\n\n<#\n.SYNOPSIS\nChecks if a certain DesiredFlag is included in the InputFlag.\n.DESCRIPTION\nChecks if a certain DesiredFlag is included in the InputFlag.\nThe check is performed using a binary and on flags.\n.PARAMETER InputFlag\nContains all the flags for the current build.\n.PARAMETER DesiredFlag\nThe flag that gets checked if it's contained the current build flags.\n#>\nfunction Test-Flag {\n    [OutputType([bool])]\n    Param (\n        [BuildFlags]\n        $InputFlag,\n\n        [BuildFlags]\n        $DesiredFlag\n    )\n\n    ($InputFlag -band $DesiredFlag) -ne 0\n}\n\n<#\n.SYNOPSIS\nFinds and returns a list of file paths that have been changed since last build\n.DESCRIPTION\nFinds and returns a list of file paths that have been changed since last build.\nThe changes are searched in the .git HEAD from the current commit to the last travis commit or DSCAutomation commit.\n#>\nfunction Get-ChangedFiles {\n    [OutputType([System.String[]])]\n    Param()\n\n    $lastTravisCommit = 1\n\n    # stops at first found travis commit or DSCAutomation commit\n    while ($true) {\n        $commitInfo = git show HEAD~$lastTravisCommit\n        $author = $commitInfo[1]\n\n        if ($author.Contains('travis@travis-ci.org') -or $author.Contains('DSCAutomation')) {\n            break\n        }\n\n        $lastTravisCommit += 1\n    }\n\n    # extract names of changed files from HEAD history\n    $changedFiles = git diff --name-only HEAD..HEAD~$lastTravisCommit\n\n    $changedFiles\n}\n\n<#\n.SYNOPSIS\nDepending on the changes made in the project [BuildFlags] get set and returned.\n.DESCRIPTION\nDepending on the changes made in the project [BuildFlags] get set and returned.\nThe returned value contains all steps that should be perfomred depending on build change.\nIf there is change in the any of the modules in Source then the changed module build + unit tests get run.\nIf there is change in the build process or in .travis.yml the unit tests for all modules get run.\n#>\nfunction Set-BuildFlags {\n    # retrieve a list of changed files\n    $changedFiles = Get-ChangedFiles\n\n    $flagResult = 0\n\n    foreach ($changedFile in $changedFiles) {\n        if ($changedFile.Contains('Source')) {\n            # module change triggers the it's build and tests to run\n            if ($changedFile.Contains('VMware.PSDesiredStateConfiguration')) {\n                $flagResult = $flagResult -bor [BuildFlags]::Update_PSDSC\n                $flagResult = $flagResult -bor [BuildFlags]::Tests_PSDSC\n            } elseif ($changedFile.Contains('VMware.vSphereDSC')) {\n                $flagResult = $flagResult -bor [BuildFlags]::Update_VSDSC\n                $flagResult = $flagResult -bor [BuildFlags]::Tests_VSDSC\n            }\n        } elseif ($changedFile.Contains('Build') -or $changedFiles.Contains('.travis.yml')) {\n            # build change triggers unit tests to be run\n            $flagResult = $flagResult -bor [BuildFlags]::Tests_PSDSC\n            $flagResult = $flagResult -bor [BuildFlags]::Tests_VSDSC\n        }\n    }\n\n    # no major changes have been made\n    if ($flagResult -eq 0) {\n        $flagResult = [BuildFlags]::None\n    }\n\n    $flagResult\n}\n\n<#\n.SYNOPSIS\nRuns the unit tests for the specified module and returns code coverage percentage.\n\n.DESCRIPTION\nRuns the unit tests for the specified module and returns code coverage percentage. \nThe tests should be located in a Tests\\Unit location in the modules directory.\nThe code coverage result of the tests gets updated in the README.md document.\nThis function relies on Pester for running the unit tests. If the module is not found it gets installed.\n\n.NOTES\nThe code coverage logic leads to the unit tests running slower.\nBug link: https://github.com/pester/Pester/issues/1318\n\n.PARAMETER ModuleName\nName of the module whose unit tests should be run\n\n.PARAMETER DisableCodeCoverage\nDisables code coverage for the unit tests.\nWith this flag turned on the function does not return a result.\n#>\nfunction Invoke-UnitTests {\n    [CmdletBinding()]\n    [OutputType([int])]\n    Param (\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ModuleName,\n\n        [switch]\n        $DisableCodeCoverage\n    )\n\n    if ($null -eq (Get-Module -Name 'Pester' -ListAvailable)) {\n        # Install Pester.\n        Write-Host 'Installing Pester'\n\n        # suppress progress messages during installation due\n        # to broken display on Travis console\n        $oldProgressPreference = $ProgressPreference\n        $Global:ProgressPreference = 'SilentlyContinue'\n\n        Install-Module -Name Pester -RequiredVersion 4.10.1 -Scope CurrentUser -Force -SkipPublisherCheck\n\n        $Global:ProgressPreference = $oldProgressPreference\n\n        Write-Host 'Pester Installed'   \n    }\n\n    # Runs all unit tests in the module.\n    $moduleFolderPath = (Get-Module $ModuleName -ListAvailable).ModuleBase\n    $unitTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Unit'\n\n    $invokePesterSplatParams = @{\n        Path = \"$unitTestsFolderPath\\*\"\n        PassThru = $true\n        EnableExit = $true\n    }\n\n    if($DisableCodeCoverage) {\n        Invoke-Pester @invokePesterSplatParams\n    } else {\n        $invokePesterSplatParams['CodeCoverage'] = @{ Path = \"$ModuleFolderPath\\$ModuleName.psm1\" }\n\n        $moduleUnitTestsResult = Invoke-Pester @invokePesterSplatParams\n\n        $numberOfCommandsAnalyzed = $moduleUnitTestsResult.CodeCoverage.NumberOfCommandsAnalyzed\n        $numberOfCommandsMissed = $moduleUnitTestsResult.CodeCoverage.NumberOfCommandsMissed\n\n        # Gets the coverage percent from the unit tests that were ran.\n        $coveragePercent = [math]::Floor(100 - (($numberOfCommandsMissed / $numberOfCommandsAnalyzed) * 100))\n\n        return $coveragePercent\n    }\n}\n\n# Define script variables\n$script:ProjectRoot = (Get-Item -Path $PSScriptRoot).Parent.FullName\n$script:SourceRoot = Join-Path -Path $script:ProjectRoot -ChildPath 'Source'\n$script:ReadMePath = Join-Path -Path $script:ProjectRoot -ChildPath 'README.md'\n$Script:ChangelogDocumentPath = Join-Path -Path $Script:ProjectRoot -ChildPath 'CHANGELOG.md'\n\n# Adds the Source directory from the repository to the list of modules directories.\n$env:PSModulePath += \"$([System.IO.Path]::PathSeparator)$script:SourceRoot\"\n\n# Registeres default PSRepository.\nRegister-PSRepository -Default -ErrorAction SilentlyContinue\n"
  },
  {
    "path": "Build/enableExperimentalFeature.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.NOTES\nThe code for enabling the experimental feature is in a separate file\nbecause the powershell session must be restarted when it is enabled\n#>\n\nWrite-Host ('-------PS VERSION IS:' + $PSVersionTable['psversion'])\n\nif ($PSVersionTable['PsEdition'] -eq 'Core') {\n    # check if the Invoke-DscResource emperimental feature is enabled\n    if (-not [ExperimentalFeature]::IsEnabled('PSDesiredStateConfiguration.InvokeDscResource')) {\n        Enable-ExperimentalFeature PSDesiredStateConfiguration.InvokeDscResource\n        Write-Host ('-------InvokeDscResource is enabled')\n    }\n}\n"
  },
  {
    "path": "Build/travis-push.sh",
    "content": "#!/bin/sh\n\nsetup_git() {\n    git config --global user.email \"travis@travis-ci.org\"\n    git config --global user.name \"Travis CI\"\n}\n\ncommit_updated_module_files() {\n    git checkout master\n\n    # Stage the modified module files\n    git add -f .\n\n    # Create a new commit with a custom build message\n    # with \"[skip ci]\" to avoid a build loop\n    # and Travis build number for reference\n    git commit -s -m \"Travis update: (Build $TRAVIS_BUILD_NUMBER)\" -m \"[skip ci]\"\n}\n\nupload_files() {\n    # Remove existing \"origin\"\n    git remote rm origin\n\n    # Add new \"origin\" with the access token\n    git remote add origin https://${GH_TOKEN}@github.com/vmware/dscr-for-vmware.git > /dev/null 2>&1\n    git push origin master --quiet\n}\n\nsetup_git\n\ncommit_updated_module_files\n\n# Attempt to commit to git only if \"git commit\" succeeded\nif [ $? -eq 0 ]; then\n    echo \"A new commit with changed module files exists. Uploading to GitHub.\"\n    upload_files\nelse\n    echo \"No changes in module files. Nothing to do.\"\nfi\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\nAll notable changes to this project will be documented in this file.\n\n## VMware.PSDesiredStateConfiguration 1.0.0.17 - 2021-04-28\n### Changed\r\n- Fix bug with **`Test-VmwDscConfiguration`** cmdlet on **`PowerShell 5.1`** that occurred due to **`NodeResult`** being **`PSObject`** instead of **`PSCustomObject`**. **`Select-Object -ExpandProperty InvokeResult`** doesn't work on **`PSObject`** on **`PowerShell 5.1`**.\r\n\n## 2021-03-08\n### Added\n- Added installation guide for **VMware.PSDesiredStateConfiguration** module.\n\n### Changed\n- Updated the **VMHostVssNic DSC Resource** documentation to be the same as the one in the [Wiki](https://github.com/vmware/dscr-for-vmware/wiki).\n\n## VMware.vSphereDSC 2.2.0.84 - 2021-02-24\n### Added\n- Added **DatastoreCluster DSC Resource** that is used to create, modify and remove **Datastore Clusters** in the specified **Datacenter** on the specified **vCenter Server**.\n- Added **DRSRule DSC Resource** that is used to create, modify and remove **DRS rules** for the specified **Cluster**.\n- Added **DatastoreClusterAddDatastore DSC Resource** that is used to add **Datastores** to the specified **Datastore Cluster**.\n- Added **VMHostVdsNic DSC Resource** that is used to modify the settings or remove **VMKernel NICs** connected to the specified **Distributed Port Group** on the specified **VDSwitch**.\n- Added **VMHostStorage DSC Resource** that is used to enable or disable the **software iSCSI support** for the specified **VMHost**.\n- Added **VMHostIScsiHbaVMKernelNic DSC Resource** that is used to **bind/unbind VMKernel Network Adapters** to/from the specified **iSCSI Host Bus Adapter**.\n\n### Changed\n- **VMHostVDSwitchMigration DSC Resource**: Added a new **MigratePhysicalNicsOnly** parameter to allow the user to choose to migrate only **Physical Network Adapters**. Extended the **DSC Resource** to create **distributed port groups** with **VLAN ID**.\n- **VMHostIScsiHba DSC Resource**: Added **IScsiName** property to configure the **IScsiName** of the **IScsiHba**.\n- **VDPortGroup DSC Resource**: Added **VLanId** property to configure the **VLanId** for a **Distributed Port Group**.\n- **VMHostAccount DSC Resource**: Fixed the bug with determiting the desired state, when the **ESXi account password** should be changed.\n- **VMHostVDSwitchMigration DSC Resource**: Fixed the bug with migrating **Physical Network Adapters** to **VDSwitch**. The **Physical Network Adapters** should be migrated with the **VMKernel Network Adapters** to avoid connectivity loss for the **ESXi** during the migration.\n- **VMHostVssTeaming DSC Resource**: Fixed bugs with **physical network adapters** when updating the **teaming policy** of the **standard switch**.\n- **NfsDatastore DSC Resource**: Moved name validation to **VmfsDatastore DSC Resource** due to not being applicable for **NfsDatastores**.\n\n## VMware.PSDesiredStateConfiguration 1.0.0.16 - 2021-02-24\n### Added\n- Added **New-VmwDscConfiguration** cmdlet which compiles a **DSC Configuration** into a **VmwDscConfiguration** object, which contains the name of the **DSC Configuration** and the **DSC Resources** defined in it.\n- Added **Start**, **Test** and **Get-VmwDscConfiguration** cmdlets which work with the **VmwDscConfiguration** object created by the **New-VmwDscConfiguration** cmdlet and apply the **Set**, **Test**, **Get** methods to the compiled **DSC Configuration**.\n- Added **vSphereNode** which is a special dynamic keyword that represents a connection to a **VIServer**. Each **vSphereNode** can contain **DSC Resources** from the module **VMware.vSphereDSC**. The **vSphere Nodes** along with the new execution engine allow the user to bundle **DSC Resources** and specify a common **VIServer** connection which gets reused.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.16 - 2021-02-19\n### Changed\n- Modified the **VMware.PSDesiredStateConfiguration** module manifest to contain the **FunctionsToExport** to allow using the cmdlets without invoking **Import-Module** every time.\n\n## VMware.vSphereDSC 2.1.0.84 - 2021-02-15\n### Changed\n- Modified the **VMware.vSphereDSC** and **VMware.PSDesiredStateConfiguration** module manifests to contain the **CompatiblePSEditions** module manifest key with both values: **Desktop** and **Core**.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.15 - 2021-02-15\n### Changed\n- Modified the **VMware.vSphereDSC** and **VMware.PSDesiredStateConfiguration** module manifests to contain the **CompatiblePSEditions** module manifest key with both values: **Desktop** and **Core**.\n\n## 2021-02-15\n### Changed\n- Modified the documentation of the **VMware.PSDesiredStateConfiguration** module to reflect the changes made in the **New-VmwDscConfiguration** cmdlet.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.14 - 2021-02-14\n### Added\n- Added additional **DSC Configurations** with **ConfigurationData** for the **Unit Tests** in the **VMware.PSDesiredStateConfiguration** module.\n- Added additional **Unit Tests** for the **ConfigurationName** parameter of the **New-VmwDscConfiguration** cmdlet.\n\n### Changed\n- Fixed bug with retrieving dynamic keywords from a **DSC Configuration Script Block**.\n- Refactored the **New-VmwDscConfiguration Unit Tests** to work with the new cmdlet parameters.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.13 - 2021-02-14\n### Added\n- Implemented ordering of public classes when importing the **VMware.PSDesiredStateConfiguration** module.\n\n### Changed\n- Extracted all classes in the **VMware.PSDesiredStateConfiguration** module in separate files.\n- Extracted all functions in the **VMware.PSDesiredStateConfiguration** module in separate files.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.12 - 2021-02-14\n### Added\n- Added a new **Path** parameter for the **New-VmwDscConfiguration** cmdlet which specifies a file path to file containing **DSC Configurations**.\n- Added a new **ConfigurationName** parameter for the **New-VmwDscConfiguration** cmdlet which specifies the **DSC Configuration** to compile from the specified **DSC Configurations** file.\n\n### Changed\n- Renamed the **CustomParams** parameter of the **New-VmwDscConfiguration** cmdlet to **Parameters** which works with script parameters instead of configuration parameters only.\n\n### Removed\n- Removed the **ConfigName** parameter from the  **New-VmwDscConfiguration** cmdlet.\n- Removed the **ConfigurationData** parameter from the  **New-VmwDscConfiguration** cmdlet.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.11 - 2021-01-25\n### Changed\n- Extended the validation of the key properties of a **DSC Resource** in the **VMware.PSDesiredStateConfiguration** module to throw an exception when a key property is **$null**.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.10 - 2021-01-25\n### Changed\n- Modified the **License** logic in the **VMware.PSDesiredStateConfiguration** build to cut the first two lines of the **License** in **License.txt**.\n- Moved the **error constants** and the **Get-KeyPropertyResourceCheckDotNetHashCode** function to the **DscItems** file because on **PowerShell 5.1** they're not visible and are missing due to the **DscItems** being imported first.\n-  Fixed the **error** and **verbose** output for all cmdlets in the **VMware.PSDesiredStateConfiguration** module.\n- Fix **logs** property bug for **PowerShell 5.1** - the **logs** can't be serialized into a **CimInstance**.\n\n### Removed\n- Removed unused **ExperimentalEnabled** script.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.9 - 2021-01-23\n### Changed\n- Fix bug with exceptions not being thrown when an error occurs in a **DSC Resource** when invoking the **DSC Configuration** through the **VMware.PSDesiredStateConfiguration** module.\n- Fix bug when connection is not established and the **DisconnectVIServer** method is called.\n- Extract exceptions for base classes to constants in **VMware.vSphereDSC** module.\n\n## VMware.vSphereDSC 2.1.0.83 - 2021-01-23\n### Changed\n- Fix bug with exceptions not being thrown when an error occurs in a **DSC Resource** when invoking the **DSC Configuration** through the **VMware.PSDesiredStateConfiguration** module.\n- Fix bug when connection is not established and the **DisconnectVIServer** method is called.\n- Extract exceptions for base classes to constants in **VMware.vSphereDSC** module.\n\n## VMware.vSphereDSC 2.1.0.82 - 2021-01-18\n### Changed\n- Bumped **License.txt**.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.8 - 2021-01-18\n### Changed\n- Bumped **License.txt**.\n\n## 2021-01-18\n### Added\n- Added **Getting Started** sections for **VMware.vSphereDSC** and **VMware.PSDesiredStateConfiguration** modules in **README.md**.\n\n## VMware.vSphereDSC 2.1.0.81 - 2021-01-15\n### Added\n- Added **VMHostIScsiHbaVMKernelNic** DSC Resource.\n- Added Unit Tests for **VMHostIScsiHbaVMKernelNic** DSC Resource.\n- Added Integration Tests for **VMHostIScsiHbaVMKernelNic** DSC Resource.\n- Added Documentation and example Configurations for **VMHostIScsiHbaVMKernelNic** DSC Resource.\n\n## VMware.vSphereDSC 2.1.0.80 - 2021-01-15\n### Added\n- Added **VMHostStorage** DSC Resource.\n- Added Unit Tests for **VMHostStorage** DSC Resource.\n- Added Integration Tests for **VMHostStorage** DSC Resource.\n- Added Documentation and example Configurations for **VMHostStorage** DSC Resource.\n\n## VMware.vSphereDSC 2.1.0.79 - 2021-01-15\n### Added\n- Added **VLanId** property of **VDPortGroup DSC Resource**.\n- Added Unit Tests for **VLanId** property of **VDPortGroup DSC Resource**.\n- Added Integration Tests for **VLanId** property of **VDPortGroup DSC Resource**.\n- Added Documentation and example Configuration for **VLanId** property of **VDPortGroup DSC Resource**.\n\n## VMware.vSphereDSC 2.1.0.78 - 2021-01-15\n### Changed\n- Extended **VMHostVDSwitchMigration DSC Resource** to create distributed port groups with **VLAN ID**.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.7 - 2020-12-18\n### Added\n- Added integration tests for **VMware.PSDesiredStateConfiguration** module.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.6 - 2020-12-18\n### Changed\n- Fixed the bug with the same references for **DSC Resources** when multiple **vSphereNodes** are passed as array in a **DSC Configuration**.\n\n## VMware.vSphereDSC 2.1.0.77 - 2020-12-17\n### Added\n- Added additional logic for **Verbose** and **Warning** outputs which enables printing the output when the **DSC Resource** is invoked via the **Invoke-DscResource** cmdlet.\n\n### Changed\n- Fixed the bug with redundant **Server**  DSC key property in the **BasevSphereConnection** class.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.5 - 2020-12-17\n### Added\n- Added additional logic for **Verbose** and **Warning** outputs which enables printing the output when the **DSC Resource** is invoked via the **Invoke-DscResource** cmdlet.\n\n### Changed\n- Fixed the bug with redundant **Server**  DSC key property in the **BasevSphereConnection** class.\n\n## VMware.vSphereDSC 2.1.0.76 - 2020-12-14\n### Added\n- Added **IScsiName** property of **VMHostIScsiHba DSC Resource**.\n- Added Unit Tests for **IScsiName** property of **VMHostIScsiHba DSC Resource**.\n- Added Integration Tests for **IScsiName** property of **VMHostIScsiHba DSC Resource**.\n- Added Documentation and example Configuration for **IScsiName** property of **VMHostIScsiHba DSC Resource**.\n\n## VMware.vSphereDSC 2.1.0.75 - 2020-12-14\n### Changed\n- Moved name validation to **VmfsDatastore DSC Resource** due to not being applicable for **NfsDatastores**.\n\n## VMware.vSphereDSC 2.1.0.74 - 2020-12-09\n### Changed\n- Fixed bugs with physical network adapters when updating the teaming policy of the standard switch.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.4 - 2020-12-07\n### Added\n- **ConnectionFilter** parameter was added to the **Start, Test and Get-VmwDscConfiguration** cmdlets, which gives the option to choose the **vSphere Nodes** on which the configuration will be executed.\n\n### Changed\n- Extend the **New-VmwDscConfiguration** cmdlet to have **Verbose** output.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.3 - 2020-11-30\n### Changed\n- Extend ***-VmwDscConfiguration** cmdlets vaildation to check for **DSC Resources** with duplicate key properties.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.2 - 2020-11-24\n### Added\n- Added a special **vSphereNode** dynamic keyword that represents a connection to a **VIServer** and allows reusing **vSphere** connections via the new execution engine.\n- Added documentation for new **vSphere Node** feature.\n\n### Changed\n- The **DSC Resources** in the **VMware.vSphereDSC** module now have the **Server** and **Credential** properties set as optional as they're not mandatory when using **vSphereNodes**.\n- **Test** and **Get-VmwDscConfiguration** cmdlets are extended with additional parameter sets to execute the latest applied configuration.\n\n## VMware.vSphereDSC 2.1.0.73 - 2020-11-24\n### Added\n- Added a special **vSphereNode** dynamic keyword that represents a connection to a **VIServer** and allows reusing **vSphere** connections via the new execution engine.\n- Added documentation for new **vSphere Node** feature.\n\n### Changed\n- The **DSC Resources** in the **VMware.vSphereDSC** module now have the **Server** and **Credential** properties set as optional as they're not mandatory when using **vSphereNodes**.\n- **Test** and **Get-VmwDscConfiguration** cmdlets are extended with additional parameter sets to execute the latest applied configuration.\n\n## 2020-11-03\n### Added\n- Added **BuildFlags** enumeration that tracks the steps which need to be performed during the build process.\n\n### Changed\n- The build now detects what changes have been made in order to run the tests and build functions only when a module code is changed.\n\n## VMware.PSDesiredStateConfiguration 0.0.0.1 - 2020-10-21\n### Added\n- Introduced a new module **VMware.PSDesiredStateConfiguration** for compiling and executing DSC Configurations without the use of MOF or LCM.\n- Added separate documentation files for both modules (**VMware.PSDesiredStateConfiguration.md** and **VMware.vSphereDSC.md**).\n- Added **EnableExperimentalFeature.ps1** to enable **Invoke-DscResource** cmdlet on non-windows Operating Systems.\n- Added a documentation file: **Limitations.md** for listing known issues and limitations.\n\n### Changed\n- Updated the build procedure in **build.ps1** to now work with both modules (**VMware.PSDesiredStateConfiguration** and **VMware.vSphereDSC**).\n- Updated **README.md** with common information and links to the new documentation files for both modules (**VMware.PSDesiredStateConfiguration** and **VMware.vSphereDSC**) .\n- **.travis.yml** now works with both **Ubuntu 14.04** and **Ubuntu 18.04** due to **Ubuntu 14.04** not supporting **Powershell Core 7.0.3**.\n\n## VMware.vSphereDSC 2.1.0.72 - 2020-10-13\n### Added\n- Added new **MigratePhysicalNicsOnly** parameter to **VMHostVDSwitchMigration** DSC Resource.\n\n### Changed\n- Fixed the bug with migrating Physical Network Adapters to VDSwitch. The Physical Network Adapters should be migrated with the VMKernel Network Adapters to avoid connectivity loss for the ESXi during the migration.\n\n## VMware.vSphereDSC 2.1.0.71 - 2020-09-24\n### Changed\n- Fixed the bug with determiting the desired state, when the **ESXi** account password should be changed.\n\n## VMware.vSphereDSC 2.1.0.70 - 2020-09-23\n### Changed\n- Moved comment section, explaining the dependencies of the **VMware.vSphereDSC** module from **RequiredModules.ps1** to **VMware.vSphereDSC.psd1**.\n\n## VMware.vSphereDSC 2.1.0.69 - 2020-09-18\n### Changed\n- Changed the implementation of the **New-DscResourceBlock()** in **VMware.vSphereDSC.CompositeResourcesHelper.ps1** to return the created **DscResourceBlock** instead of invoking it inside the function.\n\n## VMware.vSphereDSC 2.1.0.68 - 2020-09-14\n### Changed\n- Updated **VMware.vSphereDSC** module manifest contents by removing **FunctionsToExport**, **CmdletsToExport** and **AliasesToExport**.\n\n### Removed\n- Removed the required **PowerCLI** modules that are dependencies of the **VMware.vSphereDSC** module from RequiredModules.ps1\n\n## VMware.vSphereDSC 2.1.0.67 - 2020-06-19\n### Added\n- Added **VMHostVdsNic** DSC Resource.\n- Added Unit Tests for **VMHostVdsNic** DSC Resource.\n- Added Integration Tests for **VMHostVdsNic** DSC Resource.\n- Added Documentation and example Configurations for **VMHostVdsNic** DSC Resource.\n\n### Changed\n- Extended **InventoryUtil** class with **GetVDSwitch()**.\n- Updated the build procedure to install the latest **Pester v4** released version.\n\n## VMware.vSphereDSC 2.1.0.66 - 2020-05-13\n### Added\n- Added **DatastoreClusterAddDatastore** DSC Resource.\n- Added Unit Tests for **DatastoreClusterAddDatastore** DSC Resource.\n- Added Integration Tests for **DatastoreClusterAddDatastore** DSC Resource.\n- Added Documentation and example Configurations for **DatastoreClusterAddDatastore** DSC Resource.\n\n### Changed\n- Extended **InventoryUtil** class with **GetDatastoreCluster()**.\n\n## VMware.vSphereDSC 2.1.0.65 - 2020-05-07\n### Added\n- Introduced **InventoryUtil** class.\n- Added **DRSRule** DSC Resource.\n- Added Unit Tests for **DRSRule** DSC Resource.\n- Added Integration Tests for **DRSRule** DSC Resource.\n- Added Documentation and example Configurations for **DRSRule** DSC Resource.\n\n## VMware.vSphereDSC 2.1.0.64 - 2020-05-07\n### Changed\n- Extended **BaseDSC** class with helper methods that determine if a DSC Resource is in a _desired state_.\n- Refactored the **Test()** method of each DSC Resource in the **VMware.vSphereDSC** module to use the helper methods from the **BaseDSC** class.\n\n## VMware.vSphereDSC 2.1.0.63 - 2020-04-15\n### Added\n- Added **DatastoreCluster** DSC Resource.\n- Added Unit Tests for **DatastoreCluster** DSC Resource.\n- Added Integration Tests for **DatastoreCluster** DSC Resource.\n- Added Documentation and example Configurations for **DatastoreCluster** DSC Resource.\n\n### Changed\n- Extended **TestUtils** with helper function for importing the **VMware.vSphereDSC** module.\n\n## VMware.vSphereDSC 2.1.0.62 - 2020-03-31\n### Changed\n- Fixed bug with running Unit Tests locally.\n\n## VMware.vSphereDSC 2.1.0.61 - 2020-03-19\n### Added\n- Added support for specifying which VMHost DSC Resources to export in ExportVMHostConfiguration script.\n\n## VMware.vSphereDSC 2.1.0.60 - 2020-03-19\n### Changed\n- Fixed bugs with multiple dependencies for StandardSwitch, VMHostDnsSettings and VMHostPermission DSC Resources in ExportVMHostConfiguration script.\n\n## VMware.vSphereDSC 2.1.0.59 - 2020-03-19\n### Added\n- Added example DSC Configurations for VMHost Authentication, Storage and Network.\n\n## VMware.vSphereDSC 2.1.0.58 - 2020-03-06\n### Added\n- **NfsDatastore**: DSC Resource that is used to create, update and delete NFS Datastores on the VMHost.\n- **NfsUser**: DSC Resource that is used to create, change the password and delete Nfs Users on the VMHost.\n- **StandardPortGroup**: Composite DSC Resource that is used to create, update and delete Standard Port Groups which are associated with a Standard Switch. The resource also modifies the different policies of the Standard Port Group - Security, Shaping and Teaming policies.\n- **StandardSwitch**: Composite DSC Resource that is used to create, update and delete Standard Switches on the VMHost. The resource also modifies the different policies of the Standard Switch - Security, Shaping and Teaming policies as well as creating a bridge to connect the Standard Switch to Physical Network Adapters.\n- **VDPortGroup**: DSC Resource that is used to create, update and delete vSphere Distributed Port Groups.\n- **VDSwitch**: DSC Resource that is used to create, update and delete vSphere Distributed Switches.\n- **VDSwitchVMHost**: DSC Resource that is used to add/remove VMHosts to/from vSphere Distributed Switches.\n- **VMHostAcceptanceLevel**: DSC Resource that is used to modify the acceptance level of the VMHost.\n- **VMHostAdvancedSettings**: DSC Resource that is used to modify the Advanced Settings of the VMHost.\n- **VMHostAgentVM**: DSC Resource that is used to modify the configuration of Agent Virtual Machine resources on the VMHost.\n- **VMHostAuthentication**: DSC Resource that is used to include/exclude VMHosts in/from Domains.\n- **VMHostCache**: DSC Resource that is used to configure the host cache/swap performance enhancement.\n- **VMHostConfiguration**: DSC Resource that is used to modify the configuration of the VMHost.\n- **VMHostDCUIKeyboard**: DSC Resource that is used to modify the Direct Console User Interface Keyboard Layout.\n- **VMHostFirewallRuleset**: DSC Resource that is used to enable/disable firewall rulesets on the VMHost.\n- **VMHostGraphics**: DSC Resource that is used to modify the Graphics configuration on the VMHost.\n- **VMHostGraphicsDevice**: DSC Resource that is used to modify the Graphics Type of the Graphics Device.\n- **VMHostIPRoute**: DSC Resource that is used to create and delete IPv4/IPv6 routes on the VMHost.\n- **VMHostIScsiHba**: DSC Resource that is used to modify the CHAP settings of the iSCSI Host Bus Adapters on the VMHost.\n- **VMHostIScsiHbaTarget**: DSC Resource that is used to create, modify the CHAP settings and delete iSCSI Host Bus Adapter targets from iSCSI Host Bus Adapters.\n- **VMHostNetworkCoreDump**: DSC Resource that is used to modify the network coredump configuration of the VMHost.\n- **VMHostPciPassthrough**: DSC Resource that is used to modify the PciPassthru configuration of the PCI Device on the VMHost.\n- **VMHostPermission**: DSC Resource that is used to create, update and delete Permissions for Entity, Principal and Role on the VMHost.\n- **VMHostPhysicalNic**: DSC Resource that is used to modify the speed and duplex settings of the Physical Network Adapter.\n- **VMHostPowerPolicy**: DSC Resource that is used to modify the Power Management Policy of the VMHost.\n- **VMHostRole**: DSC Resource that is used to create, update and delete Roles on the VMHost.\n- **VMHostSNMPAgent**: DSC Resource that is used to modify the SNMP agent configuration on the VMHost.\n- **VMHostScsiLun**: DSC Resource that is used to modify the configuration of SCSI Luns on the VMHost.\n- **VMHostScsiLunPath**: DSC Resource that is used to configure SCSI Lun paths to SCSI devices on the VMHost.\n- **VMHostSharedSwapSpace**: DSC Resource that is used to modify the configuration of system-wide shared swap space on the VMHost.\n- **VMHostSoftwareDevice**: DSC Resource that is used to add a device to enable a software device driver or to remove a software device on the VMHost.\n- **VMHostVDSwitchMigration**: DSC Resource that is used to migrate Physical Network Adapters and VMKernel Network Adapters attached to Standard Port Groups to vSphere Distributed Switches.\n- **VMHostVMKernelActiveDumpFile**: DSC Resource that is used to enable/disable the VMKernel dump file on the VMHost.\n- **VMHostVMKernelActiveDumpPartition**: DSC Resource that is used to enable/disable the VMKernel dump partition on the VMHost.\n- **VMHostVMKernelDumpFile**: DSC Resource that is used to create and delete VMKernel dump files on a Datastore on the VMHost.\n- **VMHostVMKernelModule**: DSC Resource that is used to enable/disable VMKernel modules on the VMHost.\n- **VMHostVssMigration**: DSC Resource that is used to migrate Physical Network Adapters and VMKernel Network Adapters attached to Standard Port Groups to Standard Switches.\n- **VMHostVssNic**: DSC Resource that is used to create, update and delete VMKernel Network Adapters added to Standard Switch and Standard Port Group.\n- **VMHostVssPortGroup**: DSC Resource that is used to create, update and delete Standard Port Groups which are associated with a Standard Switch.\n- **VMHostVssPortGroupSecurity**: DSC Resource that is used to modify the Security Policy of the Standard Port Group.\n- **VMHostVssPortGroupShaping**: DSC Resource that is used to modify the Shaping Policy of the Standard Port Group.\n- **VMHostVssPortGroupTeaming**: DSC Resource that is used to modify the Teaming Policy of the Standard Port Group.\n- **VMHostvSANNetworkConfiguration**: DSC Resource that is used to add and remove vSAN network configuration IP Interfaces on the VMHost.\n- **VmfsDatastore**: DSC Resource that is used to create, update and delete VMFS Datastores on the VMHost.\n- **vCenterVMHost**: DSC Resource that is used to add, move to another location or remove VMHosts on the vCenter Server.\n\n## VMware.vSphereDSC 2.0.0.58 - 2020-03-06\n### Added\n- Added VMware.VimAutomation.Storage as dependency of VMware.vSphereDSC.\n\n## VMware.vSphereDSC 2.0.0.57 - 2020-03-05\n### Added\n- Added **VMware.VimAutomation.Vds** as dependency in module manifest.\n\n### Changed\n- Updated README.md section for available DSC Resources.\n- Fixed bug with Tps setting not exposed in VMHostTpsSettings DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.56 - 2020-02-27\n### Added\n- Added a script that exports the VMHost state as a DSC Configuration.\n\n### Changed\n- Modified DatastoreName and FileName properties of VMHostVMKernelDumpFile to be **Key** instead of **Mandatory**.\n- Renamed Datastore property of VMHostCache DSC Resource to DatastoreName.\n- Fixed bug with nullable NoTraps property of VMHostSNMPAgent DSC Resource.\n- Fixed bug with nullable properties for VMHostSyslog DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.55 - 2020-02-27\n### Changed\n- Fixed bugs with nullable properties for all Standard Switch DSC Resources.\n\n## VMware.vSphereDSC 2.0.0.54 - 2020-02-14\n### Added\n- Introduced VMHostRestartBaseDSC class.\n\n### Changed\n- Extended VMHostVssNic DSC Resource to perform Update operation after the VMKernel Network Adapter is created, if needed.\n- Extracted VMHost restart logic from VMHostBaseDSC class to VMHostRestartBaseDSC class.\n- Fixed bug with HAEnabled set to $false when creating or modifying HA Cluster in HACluster DSC Resource.\n- Fixed bug for creating Datastores when connected to vCenter Server when there is existing Datastore with the same name.\n- Updated License.txt.\n\n## VMware.vSphereDSC 2.0.0.53 - 2020-02-12\n### Added\n- Introduced VMHostIScsiHbaBaseDSC class.\n- Added VMHostIScsiHba DSC Resource.\n- Added VMHostIScsiHbaTarget DSC Resource.\n- Added Unit Tests for VMHostIScsiHbaBaseDSC class.\n- Added Unit Tests for VMHostIScsiHba DSC Resource.\n- Added Unit Tests for VMHostIScsiHbaTarget DSC Resource.\n- Added Integration Tests for VMHostIScsiHba DSC Resource.\n- Added Integration Tests for VMHostIScsiHbaTarget DSC Resource.\n- Added Documentation and example Configurations for VMHostIScsiHba DSC Resource.\n- Added Documentation and example Configurations for VMHostIScsiHbaTarget DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.52 - 2020-02-12\n### Added\n- Added StandardSwitch Composite DSC Resource.\n- Added Documentation and example Configuration for StandardSwitch Composite DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.51 - 2020-02-12\n### Added\n- Added VMHostFirewallRuleset DSC Resource.\n- Added Unit Tests for VMHostFirewallRuleset DSC Resource.\n- Added Integration Tests for VMHostFirewallRuleset DSC Resource.\n- Added Documentation and example Configuration for VMHostFirewallRuleset DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.50 - 2020-02-12\n### Added\n- Added VMHostScsiLun DSC Resource.\n- Added Unit Tests for VMHostScsiLun DSC Resource.\n- Added Integration Tests for VMHostScsiLun DSC Resource.\n- Added Documentation and example Configurations for VMHostScsiLun DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.49 - 2020-02-11\n### Added\n- Added VMHostScsiLunPath DSC Resource.\n- Added Unit Tests for VMHostScsiLunPath DSC Resource.\n- Added Integration Tests for VMHostScsiLunPath DSC Resource.\n- Added Documentation and example Configuration for VMHostScsiLunPath DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.48 - 2020-02-11\n### Added\n- Added VMHostvSANNetworkConfiguration DSC Resource.\n- Added Unit Tests for VMHostvSANNetworkConfiguration DSC Resource.\n- Added Integration Tests for VMHostvSANNetworkConfiguration DSC Resource.\n- Added Documentation and example Configurations for VMHostvSANNetworkConfiguration DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.47 - 2020-02-11\n### Added\n- Added VMHostAcceptanceLevel DSC Resource.\n- Added Unit Tests for VMHostAcceptanceLevel DSC Resource.\n- Added Integration Tests for VMHostAcceptanceLevel DSC Resource.\n- Added Documentation and example Configuration for VMHostAcceptanceLevel DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.46 - 2020-02-11\n### Added\n- Added VMHostNetworkCoreDump DSC Resource.\n- Added Unit Tests for VMHostNetworkCoreDump DSC Resource.\n- Added Integration Tests for VMHostNetworkCoreDump DSC Resource.\n- Added Documentation and example Configuration for VMHostNetworkCoreDump DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.45 - 2020-02-11\n### Added\n- Added VMHostVMKernelModule DSC Resource.\n- Added VMHostSNMPAgent DSC Resource.\n- Added VMHostSoftwareDevice DSC Resource.\n- Added VMHostSharedSwapSpace DSC Resource.\n- Added Unit Tests for VMHostVMKernelModule DSC Resource.\n- Added Unit Tests for VMHostSNMPAgent DSC Resource.\n- Added Unit Tests for VMHostSoftwareDevice DSC Resource.\n- Added Unit Tests for VMHostSharedSwapSpace DSC Resource.\n- Added Integration Tests for VMHostVMKernelModule DSC Resource.\n- Added Integration Tests for VMHostSNMPAgent DSC Resource.\n- Added Integration Tests for VMHostSoftwareDevice DSC Resource.\n- Added Integration Tests for VMHostSharedSwapSpace DSC Resource.\n- Added Documentation and example Configuration for VMHostVMKernelModule DSC Resource.\n- Added Documentation and example Configurations for VMHostSNMPAgent DSC Resource.\n- Added Documentation and example Configurations for VMHostSoftwareDevice DSC Resource.\n- Added Documentation and example Configuration for VMHostSharedSwapSpace DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.44 - 2020-02-11\n### Added\n- Added VMHostVMKernelActiveDumpPartition DSC Resource.\n- Added VMHostVMKernelDumpFile DSC Resource.\n- Added VMHostVMKernelActiveDumpFile DSC Resource.\n- Added Unit Tests for VMHostVMKernelActiveDumpPartition DSC Resource.\n- Added Unit Tests for VMHostVMKernelDumpFile DSC Resource.\n- Added Unit Tests for VMHostVMKernelActiveDumpFile DSC Resource.\n- Added Integration Tests for VMHostVMKernelActiveDumpPartition DSC Resource.\n- Added Integration Tests for VMHostVMKernelDumpFile DSC Resource.\n- Added Integration Tests for VMHostVMKernelActiveDumpFile DSC Resource.\n- Added Documentation and example Configuration for VMHostVMKernelActiveDumpPartition DSC Resource.\n- Added Documentation and example Configurations for VMHostVMKernelDumpFile DSC Resource.\n- Added Documentation and example Configuration for VMHostVMKernelActiveDumpFile DSC Resource.\n\n### Changed\n- Extended ExecuteEsxCliModifyMethod() with support for method arguments.\n\n### Removed\n- Removed NoPersist property from VMHostDCUIKeyboard DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.43 - 2020-02-11\n### Added\n- Added VMHostIPRoute DSC Resource.\n- Added Unit Tests for VMHostIPRoute DSC Resource.\n- Added Integration Tests for VMHostIPRoute DSC Resource.\n- Added Documentation and example Configurations for VMHostIPRoute DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.42 - 2020-01-09\n### Added\n- Added VMHostDCUIKeyboard DSC Resource.\n- Added Unit Tests for VMHostDCUIKeyboard DSC Resource.\n- Added Integration Tests for VMHostDCUIKeyboard DSC Resource.\n- Added Documentation and example Configuration for VMHostDCUIKeyboard DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.41 - 2020-01-08\n### Added\n- Introduced EsxCliBaseDSC class.\n- Added Unit Tests for EsxCliBaseDSC class.\n\n## VMware.vSphereDSC 2.0.0.40 - 2020-01-08\n### Added\n- Added VMHostConfiguration DSC Resource.\n- Added Unit Tests for VMHostConfiguration DSC Resource.\n- Added Integration Tests for VMHostConfiguration DSC Resource.\n- Added Documentation and example Configurations for VMHostConfiguration DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.39 - 2020-01-08\n### Added\n- Added vCenterVMHost DSC Resource.\n- Added Unit Tests for vCenterVMHost DSC Resource.\n- Added Integration Tests for vCenterVMHost DSC Resource.\n- Added Documentation and example Configurations for vCenterVMHost DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.38 - 2020-01-08\n### Added\n- Added NfsUser DSC Resource.\n- Added Unit Tests for NfsUser DSC Resource.\n- Added Integration Tests for NfsUser DSC Resource.\n- Added Documentation and example Configurations for NfsUser DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.37 - 2019-12-05\n### Added\n- Introduced DatastoreBaseDSC class.\n- Added VmfsDatastore and NfsDatastore DSC Resources.\n- Added Unit Tests for DatastoreBaseDSC class, VmfsDatastore and NfsDatastore DSC Resources.\n- Added Integration Tests for VmfsDatastore and NfsDatastore DSC Resources.\n- Added Documentation and example Configurations for VmfsDatastore and NfsDatastore DSC Resources.\n\n## VMware.vSphereDSC 2.0.0.36 - 2019-12-05\n### Added\n- Added VMHostPermission DSC Resource.\n- Added Unit Tests for VMHostPermission DSC Resource.\n- Added Integration Tests for VMHostPermission DSC Resource.\n- Added Documentation and example Configurations for VMHostPermission DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.35 - 2019-12-04\n### Added\n- Added VMHostRole DSC Resource.\n- Added Unit Tests for VMHostRole DSC Resource.\n- Added Integration Tests for VMHostRole DSC Resource.\n- Added Documentation and example Configurations for VMHostRole DSC Resource.\n\n### Changed\n- Moved EnsureConnectionIsESXi method from VMHostAccount DSC Resource to BaseDSC class and added WriteDscResourceState method to BaseDSC class.\n\n## VMware.vSphereDSC 2.0.0.34 - 2019-11-15\n### Added\n- Introduced VMHostNetworkMigrationBaseDSC class.\n- Added VMHostVssMigration DSC Resource.\n- Added Unit Tests for VMHostVssMigration DSC Resource.\n- Added Integration Tests for VMHostVssMigration DSC Resource.\n- Added Documentation and example Configurations for VMHostVssMigration DSC Resource.\n\n### Changed\n- Modified Get() method of VMHostVDSwitchMigration DSC Resource to retrieve only the passed VMKernel Network Adapters connected to the VDSwitch.\n\n### Removed\n- Removed filtration of Physical Network Adapters in VMHostVDSwitchMigration DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.33 - 2019-11-15\n### Added\n- Added VMHostAuthentication DSC Resource.\n- Added Unit Tests for VMHostAuthentication DSC Resource.\n- Added Integration Tests for VMHostAuthentication DSC Resource.\n- Added Documentation and example Configurations for VMHostAuthentication DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.32 - 2019-11-15\n### Added\n- Added VMware.vSphereDSC.CompositeResourcesHelper script with utility functions for Composite DSC Resources.\n- Added StandardPortGroup Composite DSC Resource.\n- Added Documentation and example Configuration for StandardPortGroup Composite DSC Resource.\n\n### Changed\n- Refactored Cluster Composite DSC Resource to use the utility functions from VMware.vSphereDSC.CompositeResourcesHelper script.\n- Rename MakeNicActive, MakeNicStandby and MakeNicUnused properties of VMHostVssPortGroupTeaming DSC Resource to ActiveNic, StandbyNic and UnusedNic.\n\n## VMware.vSphereDSC 2.0.0.31 - 2019-11-15\n### Added\n- Added VMHostVDSwitchMigration DSC Resource.\n- Added Unit Tests for VMHostVDSwitchMigration DSC Resource.\n- Added Integration Tests for VMHostVDSwitchMigration DSC Resource.\n- Added Documentation and example Configurations for VMHostVDSwitchMigration DSC Resource.\n\n### Changed\n- Modified description of properties in VMHostVssNic DSC Resource Documentation.\n\n## VMware.vSphereDSC 2.0.0.30 - 2019-10-30\n### Added\n- Added VDSwitchVMHost DSC Resource.\n- Added Unit Tests for VDSwitchVMHost DSC Resource.\n- Added Integration Tests for VDSwitchVMHost DSC Resource.\n- Added Documentation and example Configuration for VDSwitchVMHost DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.29 - 2019-10-30\n### Added\n- Added VDPortGroup DSC Resource.\n- Added Unit Tests for VDPortGroup DSC Resource.\n- Added Integration Tests for VDPortGroup DSC Resource.\n- Added Documentation and example Configurations for VDPortGroup DSC Resource.\n\n### Changed\n- Changed ReferenceVDSwitch property of VDSwitch DSC Resource to ReferenceVDSwitchName.\n\n## VMware.vSphereDSC 2.0.0.28 - 2019-10-21\n### Changed\n- Changed **DefaultRotateSize** to **DefaultSize** in VMHostSyslog DSC Resource Documentation.\n\n## VMware.vSphereDSC 2.0.0.27 - 2019-10-21\n### Changed\n- Fixed spacing around **Description** in all DSC Resources Documentation.\n\n## VMware.vSphereDSC 2.0.0.26 - 2019-10-18\n### Added\n- Added Tips & Tricks page from Wiki to Documentation.\n\n### Changed\n- Extend README.md with how to install VMware.vSphereDSC Module from PowerShell Gallery.\n\n## VMware.vSphereDSC 2.0.0.25 - 2019-10-09\n### Added\n- Added DisconnectVIServer logic in BaseDSC class.\n- Added Unit Tests for DisconnectVIServer() in BaseDSC class.\n\n### Changed\n- Refactored all existing DSC Resources to use DisconnectVIServer() from BaseDSC.\n- Updated CODING_GUIDELINES section for creating new DSC Resources.\n\n## VMware.vSphereDSC 2.0.0.24 - 2019-10-02\n### Added\n- Added VDSwitch DSC Resource.\n- Added Unit Tests for VDSwitch DSC Resource.\n- Added Integration Tests for VDSwitch DSC Resource.\n- Added Documentation and example Configuration for VDSwitch DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.23 - 2019-10-01\n### Added\n- Added Unit Tests for BaseDSC class.\n- Added VMHostNicBaseDSC class.\n- Added Unit Tests for VMHostNicBaseDSC class.\n- Added VMHostVssNic DSC Resource.\n- Added Unit Tests for VMHostVssNic DSC Resource.\n- Added Integration Tests for VMHostVssNic DSC Resource.\n- Added Documentation and example Configuration for VMHostVssNic DSC Resource.\n\n### Changed\n- Extended BaseDSC class with ShouldUpdateArrayProperty method.\n\n## VMware.vSphereDSC 2.0.0.22 - 2019-10-01\n### Added\n- Added VMHostPhysicalNic DSC Resource.\n- Added Unit Tests for VMHostPhysicalNic DSC Resource.\n- Added Integration Tests for VMHostPhysicalNic DSC Resource.\n- Added Documentation and example Configuration for VMHostPhysicalNic DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.21 - 2019-10-01\n### Added\n- Added VMHostVssPortGroupShaping DSC Resource.\n- Added Unit Tests for VMHostVssPortGroupShaping DSC Resource.\n- Added Integration Tests for VMHostVssPortGroupShaping DSC Resource.\n- Added Documentation and example Configuration for VMHostVssPortGroupShaping DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.20 - 2019-10-01\n### Added\n- Added VMHostVssPortGroupTeaming DSC Resource.\n- Added Unit Tests for VMHostVssPortGroupTeaming DSC Resource.\n- Added Integration Tests for VMHostVssPortGroupTeaming DSC Resource.\n- Added Documentation and example Configuration for VMHostVssPortGroupTeaming DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.19 - 2019-10-01\n### Added\n- Added VMHostVssPortGroupBaseDSC class.\n- Added VMHostVssPortGroupSecurity DSC Resource.\n- Added Unit Tests for VMHostVssPortGroupSecurity DSC Resource.\n- Added Integration Tests for VMHostVssPortGroupSecurity DSC Resource.\n- Added Documentation and example Configuration for VMHostVssPortGroupSecurity DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.18 - 2019-09-30\n### Added\n- Added VMHostEntityBaseDSC class.\n- Added VMHostVssPortGroup DSC Resource.\n- Added Unit Tests for VMHostVssPortGroup DSC Resource.\n- Added Integration Tests for VMHostVssPortGroup DSC Resource.\n- Added Documentation and example Configuration for VMHostVssPortGroup DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.17 - 2019-09-03\n### Added\n- VMware.vSphereDSC.Logging module is introduced.\n- Added Write-VerboseLog and Write-WarningLog functions to Logging module.\n\n### Changed\n- Changed logging mechanism from Write-Verbose to Write-VerboseLog and Write-Warning to Write-WarningLog.\n\n## VMware.vSphereDSC 2.0.0.16 - 2019-09-03\n### Added\n- Added VMHostCache DSC Resource.\n- Added Unit Tests for VMHostCache DSC Resource.\n- Added Integration Tests for VMHostCache DSC Resource.\n- Added Documentation and example Configuration for VMHostCache DSC Resource.\n- Added missing TaskImpl type to PowerCLITypes.\n\n## VMware.vSphereDSC 2.0.0.15 - 2019-08-30\n### Added\n- Added VMHostPowerPolicy DSC Resource.\n- Added Unit Tests for VMHostPowerPolicy DSC Resource.\n- Added Integration Tests for VMHostPowerPolicy DSC Resource.\n- Added Documentation and example Configuration for VMHostPowerPolicy DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.14 - 2019-08-30\n### Added\n- Added VMHostGraphics DSC Resource.\n- Added Unit Tests for VMHostGraphics DSC Resource.\n- Added Integration Tests for VMHostGraphics DSC Resource.\n- Added Documentation and example Configuration for VMHostGraphics DSC Resource.\n- Added VMHostGraphicsDevice DSC Resource.\n- Added Unit Tests for VMHostGraphicsDevice DSC Resource.\n- Added Integration Tests for VMHostGraphicsDevice DSC Resource.\n- Added Documentation and example Configuration for VMHostGraphicsDevice DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.13 - 2019-08-30\n### Added\n- Added VMHostPciPassthrough DSC Resource.\n- Added Unit Tests for VMHostPciPassthrough DSC Resource.\n- Added Integration Tests for VMHostPciPassthrough DSC Resource.\n- Added Documentation and example Configuration for VMHostPciPassthrough DSC Resource.\n\n### Changed\n- Extended VMHostBaseDSC with method for restarting the specified VMHost.\n- Introduced RestartTimeoutMinutes optional parameter for VMHostBaseDSC.\n\n## VMware.vSphereDSC 2.0.0.12 - 2019-08-28\n### Changed\n- The Id property was changed from 'Mandatory' to 'Key' for VMHostAccount Resource.\n\n## VMware.vSphereDSC 2.0.0.11 - 2019-08-28\n### Changed\n- The RuleName property was changed from 'Mandatory' to 'Key' for VMHostSatpClaimRule Resource.\n\n## VMware.vSphereDSC 2.0.0.10 - 2019-08-28\n### Changed\n- The Key property was changed from 'Mandatory' to 'Key' for VMHostService Resource.\n\n## VMware.vSphereDSC 2.0.0.9 - 2019-08-28\n### Changed\n- The VssName property was changed from 'Mandatory' to 'Key' in the Standard Switch Resources Documentation.\n\n## VMware.vSphereDSC 2.0.0.8 - 2019-08-20\n### Added\n- Added VMHostAgentVM DSC Resource.\n- Added Unit Tests for VMHostAgentVM DSC Resource.\n- Added Integration Tests for VMHostAgentVM DSC Resource.\n- Added Documentation and example Configuration for VMHostAgentVM DSC Resource.\n\n### Changed\n- Moved vCenterProductId Constant to BaseDSC class.\n\n## VMware.vSphereDSC 2.0.0.7 - 2019-08-02\n### Changed\n- Fix bug with '?' character in Build.ps1.\n\n## VMware.vSphereDSC 2.0.0.6 - 2019-08-02\n### Added\n- Added VMHostAdvancedSettings DSC Resource.\n- Added Unit Tests for VMHostAdvancedSettings DSC Resource.\n- Added Integration Tests for VMHostAdvancedSettings DSC Resource.\n- Added Documentation and example Configuration for VMHostAdvancedSettings DSC Resource.\n\n## VMware.vSphereDSC 2.0.0.5 - 2019-08-02\n### Added\n- Added CHANGELOG.md document to the repository.\n- Added CHANGELOG_TEMPLATE.md document to the repository.\n\n### Changed\n- Updated the Pull Request description section in CONTRIBUTING.md.\n- Extended the build to update the content of the CHANGELOG.md with the Pull Request description.\n\n### Removed\n- Removed the 'dev' branch from .travis.yml.\n\n## VMware.vSphereDSC 2.0.0.4 - 2019-07-19\n### Added\n- Added VMHostSyslog example in Configurations.\n- Introduced TestSetup for VMHostSyslog Integration Tests.\n\n## VMware.vSphereDSC 2.0.0.3 - 2019-07-19\n### Changed\n- Updated documentation for Unit and Integration Tests.\n\n## VMware.vSphereDSC 2.0.0.2 - 2019-06-14\n### Added\n- Example Configuration File with the Inventory Resources: **DatacenterFolder**, **Datacenter**, **Folder**, **Cluster**.\n- Example Configuration File with the VSS Resources: **VMHostVss**, **VMHostVssSecurity**, **VMHostVssShaping**, **VMHostVssBridge**, **VMHostVssTeaming**.\n- Introduced Integration Tests Constants for Inventory Tests.\n- Added more Integration Tests when removing DatacenterFolder.\n- Introduced TestSetup for VMHostVssBridge Integration Tests.\n- Introduced TestSetup for VMHostVssTeaming Integration Tests.\n\n## Changed\n- In the vCenter example Configuration File, **Cluster** Composite Resource was substituted with **HACluster** and **DrsCluster** Resources.\n- Extended Configurations of Folder Integration Tests with DatacenterFolder and Datacenter Resources.\n- Extended Configurations of Datacenter Integration Tests with DatacenterFolder Resource.\n- Extended Configurations of HACluster Integration Tests with DatacenterFolder, Datacenter and Folder Resources.\n- Extended Configurations of DrsCluster Integration Tests with DatacenterFolder, Datacenter and Folder Resources.\n- Extended Configurations for VMHostVss Resources.\n\n## VMware.vSphereDSC 2.0.0.1 - 2019-06-07\n### Changed\n- Bump module version to 2.0.0.0.\n\n## VMware.vSphereDSC 2.0.0.0 - 2019-06-07\n### Added\n- **Cluster**: Composite Resource used to create, update and delete Clusters in a specified Datacenter. The resource also takes care to configure Cluster's High Availability (HA) and Drs settings.\n- **HACluster**: Used to create, update and delete Clusters in a specified Datacenter. The resource also takes care to configure Cluster's High Availability (HA) settings.\n- **DrsCluster**: Used to create, update and delete Clusters in a specified Datacenter. The resource also takes care to configure Cluster's Drs settings.\n- **DatacenterFolder**: Used to create and delete Folders in a specified Inventory.\n- **Datacenter**: Used to create and delete Datacenters in a specified Inventory.\n- **Folder**: Used to create and delete Folders in a specified Datacenter.\n- **PowerCLISettings**: Used to Update the PowerCLI Configuration settings of the LCM. User Scope PowerCLI Configuration settings are updated with this resource. The LCM runs with Windows System account, so the settings will be stored for the user that runs LCM PowerShell. If a user runs a Configuration with this resource, the settings will be preserved for all future Configurations that run on that LCM.\n- **VMHostAccount**: Used to create, update and delete VMHost Accounts in the specified VMHost we are connected to.\n- **VMHostService**: Used to configure the host services on an ESXi host.\n- **VMHostSettings**: Used to Update Motd Setting and Issue Setting of the passed ESXi host.\n- **VMHostSyslog**: Used to configure the syslog settings on an ESXi node.\n- **VMHostVss**: Used to configure the basic properties of a Virtual Switch (VSS) on an ESXi node.\n- **VMHostVssBridge**: A bridge connecting a virtual switch (VSS) to (a) physical network adapter(s).\n- **VMHostVssSecurity**: Used to configure the security policy governing ports of a Virtual Switch (VSS).\n- **VMHostVssShaping**: Used to configure the traffic shaping policy for ports of a Virtual Switch (VSS).\n- **VMHostVssTeaming**: Used to configure the network adapter teaming policy of a Virtual Switch (VSS).\n\n### Changed\n- **vCenterSettings**: Extended to configure Motd and Issue Advanced Settings as well.\n"
  },
  {
    "path": "CHANGELOG_TEMPLATE.md",
    "content": "## Module Name Module Version - Date in the following format: yyyy-mm-dd\n### Added\n- Description of the new things added for this version. For example new DSC Resources, new Unit and Integration Tests, TestSetup, Configurations, Documentation and so on.\n\n### Changed\n- Description of the things updated for this version. For example extending existing DSC Resource, Configuration or Tests (Unit or Integration). All bug fixes should be documented in this section as well. Documentation fixes and updates.\n\n### Removed\n- Description of the things removed for this version. For example if a part of the Documentation was removed, or some of the Tests (Unit or Integration) were removed.\n"
  },
  {
    "path": "CODING_GUIDELINES.md",
    "content": "# Coding guidelines\n\nWhen writing code for any new DSC Resource, you need to inherit from BaseDSC or VMHostBaseDSC.\n\nIf you are configuring ESXi settings you need to inherit from VMHostBaseDSC.\n ```powershell\n  [DscResource()]\n  MyResource : VMHostBaseDSC\n ```\nFor any other resource you need to inherit from BaseDSC.\n ```powershell\n  [DscResource()]\n  MyResource : BaseDSC\n ```\nYou need to implement your new resource in separate file in the [DSCResources Folder](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/DSCResources). In the Set(), Test() and Get() methods of your resource, you need to call ConnectVIServer() method from the base class to establish a connection either to  a vCenter or an ESXi. In the finally block of each of the methods(Set, Test and Get), you need to call DisconnectVIServer() method from the base class to close the last open connection to the server.\n ```powershell\n  [void] Set() {\n      try {\n          $this.ConnectVIServer()\n          ...\n      }\n      finally {\n          $this.DisconnectVIServer()\n      }\n  }\n\n  [bool] Test() {\n      try {\n          $this.ConnectVIServer()\n          ...\n      }\n      finally {\n          $this.DisconnectVIServer()\n      }\n  }\n\n  [MyResource] Get() {\n      try {\n          $this.ConnectVIServer()\n          ...\n      }\n      finally {\n          $this.DisconnectVIServer()\n      }\n  }\n ```\n\nFor every property and helper method in your resource, you need to add brief description about what it is in the format:\n ```powershell\n  <#\n  .DESCRIPTION\n\n  YOUR DESCRIPTION.\n  #>\n ```\n\nAfter you implement it, you need to run the build script [VMware.vSphereDSC.build.ps1](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/VMware.vSphereDSC.build.ps1), which updates the psm1 and psd1 content with your new resource (**When submitting a pull request you do not need to do it as Travis CI will run it for you. This step is only needed if you test it locally**).\n\nYou need to write example configuration to show how your resource works. You can look at the [Configurations Folder](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations) to see other example configurations.\n\n### Write Tests\nAll DSC Resources in the module should have tests written using [Pester](https://github.com/pester/Pester) included in the Tests folder.\nYou are required to provide adequate test coverage for the code you change and have both Unit and Integration tests.\n\nThe tests in the module provide examples on how to structure your tests:\n* [Unit](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Tests/Unit)\n* [Integration](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Tests/Integration)\n\nTests should currently be structured like so:\n\n* Root folder of module\n    * Tests\n        * Unit\n            * TestHelpers\n                * Mocks\n                    * MyResourceMocks.ps1\n            * MyResource.Unit.Tests.ps1\n        * Integration\n            * MyResource.Integration.Tests.ps1\n            * Configurations\n                * MyResource\n                    * MyResource_Config.ps1\n\nBasically for the unit tests, you need to test the Set(), Test() and Get() methods of your resource with the different use cases. When developing the unit tests you can run only the tests for a specific method of the **Resource** - for example if you want to run the tests for the **Set** method of **MyResource** you can do the following:\n\n```\n Invoke-Pester -Path ./MyResource.Unit.Tests.ps1 -Tag 'Set'\n```\n\nCurrently the coverage of the module should be at least **90 percent**, so when writing the unit tests, keep in mind for different use cases (for example if a value is passed/not passed, for array values - null, empty or with multiple elements and so on.).\n\n ```powershell\n  Describe 'MyResource\\Set' -Tag 'Set' {\n    ...\n  }\n\n  Describe 'MyResource\\Test' -Tag 'Test' {\n    ...\n  }\n\n  Describe 'MyResource\\Get' -Tag 'Get' {\n    ...\n  }\n ```\n\nIn your unit test file you need to replace VMware PowerCLI modules with the script module that allows PowerCLI cmdlets and types to be mocked. This can be achieved with the helper function **Invoke-TestSetup** located [here](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/TestUtils.ps1). The mock data needed for the Unit Tests should be defined [here](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/MockData.ps1). Keep in mind that there could be data already defined you can reuse. A good example is the ```$script:viServer``` variable which can be used when mocking the Connect-VIServer cmdlet. The mocks for the Tests should be defined in this [folder](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks). For every use case a separate function defining the mocks should be created. For examples you can check the other mock files like [InventoryBaseDSCMocks](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/InventoryBaseDSCMocks.ps1). The Unit Tests file should look like this:\n ```powershell\n   using module VMware.vSphereDSC\n\n   $script:moduleName = 'VMware.vSphereDSC'\n\n   InModuleScope -ModuleName $script:moduleName {\n       try {\n           $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n           $modulePath = $env:PSModulePath\n           $resourceName = 'MyResource'\n\n           . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n           # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n           Invoke-TestSetup\n\n           . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n           . \"$unitTestsFolder\\TestHelpers\\Mocks\\MyResourceMocks.ps1\"\n\n           Describe 'MyResource\\Set' -Tag 'Set' {\n               # Define a Context block for each possible use case.\n               Context '<Use case description>' {\n                   ...\n               }\n           }\n\n           Describe 'MyResource\\Test' -Tag 'Test' {\n               # Define a Context block for each possible case.\n               Context '<Use case description>' {\n                   ...\n               }\n           }\n\n           Describe 'MyResource\\Get' -Tag 'Get' {\n               # Define a Context block for each possible case.\n               Context '<Use case description>' {\n                   ...\n               }\n           }\n       }\n       finally {\n           # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n           Invoke-TestCleanup -ModulePath $modulePath\n       }\n   }\n ```\n\n Basically for the integration tests, you need to test that when invoking [Start-DscConfiguration](https://docs.microsoft.com/en-us/powershell/module/psdesiredstateconfiguration/start-dscconfiguration?view=powershell-5.1) your configuration is applied, [Test-DscConfiguration](https://docs.microsoft.com/en-us/powershell/module/psdesiredstateconfiguration/test-dscconfiguration?view=powershell-5.1) to check if the configuration is in the desired state and [Get-DscConfiguration](https://docs.microsoft.com/en-us/powershell/module/psdesiredstateconfiguration/get-dscconfiguration?view=powershell-5.1) to check the currently applied configuration on the machine.\n ```powershell\n  try {\n      Describe 'MyResource' {\n          Context 'Testing one use case' {\n              BeforeAll {\n                  ...\n                  Start-DscConfiguration <DSC Config parameters>\n                  ...\n              }\n\n              It 'Should compile and apply the MOF without throwing' {\n                  # Make sure the configuration did not fail when being applied.\n                  ...\n              }\n\n              It 'Should be able to call Get-DscConfiguration without throwing' {\n                  # Make sure getting the configuration did not fail.\n                  ...\n              }\n\n              It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                  # Make sure the returned configuration is the desired one.\n                  ...\n              }\n\n              It 'Should return $true when Test-DscConfiguration is run' {\n                  # Make sure the configuration is in the desired state.\n                  ...\n              }\n          }\n      }\n  }\n  finally {\n      # Perform some cleanup like disconnecting from a server.\n  }\n ```\n\n Additionally if you have [DependsOn](https://docs.microsoft.com/en-us/powershell/dsc/configurations/resource-depends-on) in your Configurations, it is recommended to add this test:\n ```powershell\n  It 'Should have the following dependency: Resource <my resource name> should depend on Resource <resource name>' {\n      # Make sure that the my resource is depending on the right resource.\n      $myResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq '<my resource id>' }\n\n      $myResource.DependsOn | Should -Be '<resource id>'\n  }\n ```\n\nThe needed Configurations for the Integration Tests should be located in the [Configurations Folder](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Tests/Integration/Configurations)\n\nRunning the tests:\n1. Go to the Tests folder:\n ```powershell\n  cd (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests')\n ```\n\n2. The [Test Runner](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/Tests/TestRunner.ps1) script gives you the ability to:\n   Run both Unit and Integration Tests:\n    ```powershell\n     .\\TestRunner.ps1 -Integration -Unit\n     .\\TestRunner.ps1\n    ```\n\n   Only Unit Tests\n    ```powershell\n     .\\TestRunner.ps1 -Unit\n    ```\n\n   Only Integration Tests\n    ```powershell\n    .\\TestRunner.ps1 -Integration\n    ```\n\n### Write Documentation\n\nFor every developed resource, there should be a documentation showing how to use the resource and **at least 1** example configuration.\nDocumentation for every resource should currently be structured like so:\n\n* Root folder of repository\n    * Documentation\n        * DSCResources\n            * MyResource\n                * `MyResources.md`\n\n### Writing Composite Resources\n\nThere are many vSphere objects that can be present in different variations. For example we can create a HA Cluster, Drs Cluster or a Cluster that has both HA and Drs settings specified. Another good example is the Virtual Switch (VSS) which has Security, Shaping, Teaming and Bridge settings.\n\nSo for each complex vSphere object, separate DSC Resources should be created and then a Composite Resource should be created that wraps all other Resources into one. You can find more information [here](https://docs.microsoft.com/en-us/powershell/dsc/resources/authoringresourcecomposite) on how to write Composite Resources.\n\nFor every complex vSphere object, separate Folder needs to be created that consists of the DSC Resources and the Composite Resource. The folder structure should look like this:\n\n* Root folder of module\n    * DSCResources\n        * MyResource\n            * MyResource.psd1\n            * MyResource.schema.psm1\n            * MyResourceOne.ps1\n            * MyResourceTwo.ps1\n\nTo use the Composite Resource it is required to place the **vSphere object folder** below the DSCResources folder. Also the **psd1** and **schema.psm1** should have the same name as the **vSphere object folder** otherwise the Resource would not be found. The different Resources should also be created in the **vSphere object folder**. You can check how the [Cluster Resource](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/DSCResources/Cluster) was implemented for reference.\n\n**Issue** should be created first to discuss if a vSphere object should be separated into multiple DSC Resources and one Composite on the top of it. If the object is found to be too complex for one Resource, the guideline is to separate it into multiple Resources for better maintainability. With this only parts of the object can be configured and if needed with the Composite Resource the whole vSphere object can be configured.\n\nFor Composite Resources no Unit and Integration Tests are needed because the different DSC Resources that when combined create the Composite Resource are already tested with both Unit and Integration Tests.\n\n### Style Guidelines\n\nIt is recommended to read the [Style Guidelines](https://github.com/vmware/dscr-for-vmware/blob/master/STYLE_GUIDELINES.md) before writing new DSC Resources.\n"
  },
  {
    "path": "COMMITTING_GUIDELINES.md",
    "content": "# Committing Guidelines\n\nBy **default** when committing to the repository you need to Sign-Off all your commits.\n\nYou can use the following template via the command line when committing to the repository:\n\n```\n git add .\n git commit -s -m <Your commit message>\n git push origin <Your working branch>\n```\n\nThe '-s' flag automatically adds the following line to the commit message:\n\n```\n Signed-off-by: <Your Name> <Your Email>\n```\n\nYou can set your name and email with the following template:\n\n```\n git config --global user.name <Your Name>\n git config --global user.email <Your Email>\n```\n\n## Keeping a fork up to date\n\n### 1. Clone your fork:\n```\ngit clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git\n```\n\n### 2. Add remote from original repository in your forked repository:\n```\ncd into/cloned/fork-repo\ngit remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git\ngit fetch upstream\n```\n\n### 3. Updating your fork from original repo to keep up with their changes:\n\n#### 3.1 Keep your master branch up to date:\n```\ngit rebase upstream/master\n```\n\n#### 3.2 Keep your feature branch up to date:\n```\ngit stash\ngit checkout master\ngit rebase upstream/master\ngit checkout <your-feature-branch>\ngit rebase master\n```\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Desired State Configuration Resources for VMware\n\nWelcome to Desired State Configuration Resources for VMware! We're thrilled that you'd like to contribute!\n\nThere are a few different ways you can contribute:\n\n* [Submit an issue](#submitting-an-issue)\n* [Fix an issue](#fixing-an-issue)\n* [Review pull requests](#reviewing-pull-requests)\n* [Proposing DSC Resources](#proposing-dsc-resources)\n\n## Submitting an Issue\nSubmitting an issue to Desired State Configuration Resources for VMware is easy!\n\nHere are the steps:\n\n1. Make sure the issue is not open already.\n2. Open a new issue.\n3. Fill in the issue title.\n4. Fill in the issue description.\n5. Submit the issue.\n\n### Open an Issue\nGo to the Issues tab.\n\n**Ensure that the issue you are about to file is not already open.**\nIf someone has already opened a similar issue, please leave a comment or add a GitHub reaction to the top comment to **express your interest**. You can also offer help and use the issue to coordinate your efforts in fixing the issue.\n\nIf you cannot find an issue that matches the one you are about to file, click the New Issue button.\nA new, blank issue should open up.\n\n### Fill in Issue Title\nThe issue title should be a brief summary of your issue in one sentence.\n\n### Fill in Issue Description\nThe issue description should contain a **detailed** report of the issue you are submitting.\nIf you are submitting a bug, please include any error messages or stack traces caused by the problem.\n\nPlease reference any related issues or pull requests by a pound sign followed by the issue or pull request number (e.g. #11, #72). GitHub will automatically link the number to the corresponding issue or pull request.\n\nPlease also tag any GitHub users you would like to notice this issue. You can tag someone on GitHub with the @ symbol followed by their username.(e.g. @sgerginov)\n\n### Submit an Issue\nOnce you have filled out the issue title and description, click the submit button at the bottom of the issue.\n\n## Fixing an Issue\nHere's the general process of fixing an issue in Desired State Configuration Resources for VMware:\n1. Pick out the issue you'd like to work on.\n2. Create a fork of the repository that contains the issue.\n3. Clone your fork to your machine.\n4. Create a working branch where you can store your updates to the code.\n5. Make changes in your working branch to solve the issue.\n6. Write Unit and Integration tests to ensure that the issue is fixed.\n7. Submit a pull request to the master branch of the official repository for review.\n8. Make sure all tests are passing in Travis CI for your pull request.\n9. Make sure your code does not contain merge conflicts.\n10. Address any comments brought up by the reviewer.\n\nFor more information about Github Issues, please read [here](https://help.github.com/articles/creating-an-issue/).\n\n### Fork a Respository\nA 'fork' on GitHub is your own personal copy of a repository.\nGitHub's guide to forking a repository is available [here](https://help.github.com/articles/fork-a-repo/).\nYou will need a fork to contribute to Desired State Configuration Resources for VMware since only the maintainers have the ability to push to the official repositories.\n\n### Clone your Fork\nYou will want to clone your fork so that you can edit code locally on your machine.\nGitHub's guide to cloning is available [here](https://help.github.com/articles/cloning-a-repository/).\n\n### Create a Working Branch\nYour fork is your personal territory.\nYou may set it up however best suits your workflow, but we recommend that you set up a working branch separate from the default master branch.\nCreating a working branch separate from the default master branch will allow you to create other working branches off of master later while your original working branch is still open for code reviews.\nLimiting your current working branch to a single issue will also both streamline the code review and reduce the possibility of merge conflicts.\n\nThe Git guide to branching is available [here](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging).\n\n### Make Code Changes\nIf you are creating new DSC Resource for VMware, you need to get familiar with the following guidelines: [Coding Guidelines](https://github.com/vmware/dscr-for-vmware/blob/master/CODING_GUIDELINES.md)\nPay attention to any new code merged into the master branch of the official repository. If this occurs, you will need to pick-up these changes in your fork.\n\n### Submit a Pull Request\nA [pull request](https://help.github.com/articles/using-pull-requests/) (PR) allows you to submit the changes you made in your fork to the official repository.\n\nTo open a pull request, go to the Pull Requests tab of either your fork or the official repository.\n\nClick the New Pull Request button.\n\nThe base is the repository and branch the pull request will be merging **into**.\nThe target is the repository and branch the pull request will be merging **from**.\nFor Desired State Configuration Resources for VMware, always create a pull request with the base as the **master** branch of the official repository.\nThe target should be your working branch in your fork.\n\nOnce you select the correct base and target, you can review the file and commits that will be included in the pull request by selecting the tabs below the Create Pull Requests Button.\n\nIf GitHub tells you that your branches cannot automatically be merged, you probably have merge conflicts. These should be fixed before you submit your pull request.\n\nOnce you are ready to submit your pull request, click the Create Pull Request button.\n\n#### Pull Request Title\nThe title of your PR should *describe* the changes it includes in one line.\nSimply putting the issue number that the PR fixes is not acceptable.\nIf your PR deals with *one* specific resource, please prefix the title with the resource name followed by a colon.\nIf your PR fixes an issue please do still include \"(Fixes #issue number)\" in the title.\nFor example, if a PR fixes issues number 11 and 16 which adds the Ensure parameter to the VMHostTpsSettings resource, the title should be something like:\n\"VMHostTpsSettings: Added Ensure parameter (Fixes #11, #16)\".\n\nIf you open a pull request with the wrong title, you can easily edit it by clicking the Edit button.\n\n#### Pull Request Description\nThe description of your PR should include a detailed report of all the changes you made.\nIf your PR fixes an issue please include the number in the description.\nPlease tag anyone you would specifically like to see this PR with the @ symbol followed by their GitHub username (e.g. @sgerginov).\n\nThe description of your PR should follow the [template](https://github.com/vmware/dscr-for-vmware/blob/master/CHANGELOG_TEMPLATE.md). The Pull Request description should have one new line at the end so that in the [CHANGELOG.md](https://github.com/vmware/dscr-for-vmware/blob/master/CHANGELOG.md) each section is separated from the others with one empty line. The description will go through review as well because its content will go to the [CHANGELOG.md](https://github.com/vmware/dscr-for-vmware/blob/master/CHANGELOG.md) after merging the Pull Request and it is important to follow the desired structure. From the [template](https://github.com/vmware/dscr-for-vmware/blob/master/CHANGELOG_TEMPLATE.md) the first line with the module version and the date will be populated by the build and does not need to be part of the Pull Request description.\n\nOnce you are satisfied with the title, description and file changes included, submit the pull request.\n\n### Get your Code Reviewed\nOnly maintainers can *review* your code and only maintainers can *merge* your code.\nIf you have specific maintainers you want to review your code, be sure to tag them in your pull request.\n\n## Reviewing Pull Requests\n**Pull requests should not be reviewed while tests are failing.**\nIf you are confused why tests are failing, tag a maintainer or ask the community for help.\n\n### Making Review Comments\nSome things to pay attention to while reviewing:\n\n* Does the code logic make sense?\n* Does the code structure make sense?\n* Does this make the resource better?\n* Is the code easy to read?\n* Do all variables, parameters, and functions have **descriptive** names? (e.g. no $params, $args, $i, $a, etc.)\n* Does every function have a help comment?\n* Does the code follow the [Coding Guidelines](https://github.com/vmware/dscr-for-vmware/blob/master/CODING_GUIDELINES.md)?\n* Has the author included test coverage for their changes?\n\n## Proposing DSC Resources\nEach proposed new **DSC Resource** should be announced via an **Issue**. The proposed resources will be reviewed by the maintainers of the repository. The person who proposes the new resource can start developing it right after it is approved by the maintainers of the repository or leave it to other contributors who want to work on the new resource.\n\nFor more complex resources it may be neccessary to have more than one contributor working on it - this will be reviewed by the maintainers: how many people are needed for the development of the resource.\n\nEveryone who wants to contribute to new resources can volunteer - For example if the person who submitted the issue needs assistance or does not have time to continue working on the resource.\n\nIf the assignee of the **Issue** has any questions, they can ask a maintainer or other members from the community.\n\nWhen the assignee is ready with the new Resource, **PR** should be opened which will then be reviewed by the maintainers.\n"
  },
  {
    "path": "Documentation/DSCResources/Cluster/Cluster.md",
    "content": "# Cluster\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Cluster located in the Datacenter specified in 'DatacenterName' key property. ||\n| **Location** | Key | string | Location of the Cluster with name specified in 'Name' key property in the Datacenter specified in the 'DatacenterName' key property. Location consists of 0 or more Inventory Items. Empty Location means that the Cluster is in the Host Folder of the Datacenter. The Root Folders of the Datacenter are not part of the Location. Inventory Item names in Location are separated by \"/\". Example Location for a Cluster Inventory Item: \"MyClusters/DrsClusters\". ||\n| **DatacenterName** | Key | string | Name of the Datacenter we will use from the specified Inventory. ||\n| **DatacenterLocation** | Key | string | Location of the Datacenter we will use from the Inventory. Root Folder of the Inventory is not part of the Location. Empty Location means that the Datacenter is in the Root Folder of the Inventory. Folder names in Location are separated by \"/\". Example Location: \"MyDatacentersFolder\". ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Cluster should be Present or Absent. | Present, Absent |\n| **HAEnabled** | Optional | bool | Indicates that VMware HA (High Availability) is enabled. ||\n| **HAAdmissionControlEnabled** | Optional | bool | Indicates that virtual machines cannot be powered on if they violate availability constraints. ||\n| **HAFailoverLevel** | Optional | int | Specifies a configured failover level. This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines. The valid values range from 1 to 4. ||\n| **HAIsolationResponse** | Optional | HAIsolationResponse | Indicates that the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. | PowerOff, DoNothing, Shutdown, Unset |\n| **HARestartPriority** | Optional | HARestartPriority | Specifies the cluster HA restart priority. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts. | Disabled, Low, Medium, High, Unset |\n| **DrsEnabled** | Optional | bool | Indicates that VMware DRS (Distributed Resource Scheduler) is enabled. ||\n| **DrsAutomationLevel** | Optional | DrsAutomationLevel | Specifies a DRS (Distributed Resource Scheduler) automation level. | FullyAutomated, Manual, PartiallyAutomated, Disabled, Unset |\n| **DrsMigrationThreshold** | Optional | int | Threshold for generated ClusterRecommendations. DRS generates only those recommendations that are above the specified vmotionRate. Ratings vary from 1 to 5. This setting applies to Manual, PartiallyAutomated, and FullyAutomated DRS Clusters. ||\n| **DrsDistribution** | Optional | int | For availability, distributes a more even number of virtual machines across hosts. ||\n| **MemoryLoadBalancing** | Optional | int | Load balance based on consumed memory of virtual machines rather than active memory. This setting is recommended for clusters where host memory is not over-committed. ||\n| **CPUOverCommitment** | Optional | int | Controls CPU over-commitment in the cluster. Min value is 0 and Max value is 500. ||\n\n## Description\n\nThe resource is used to create, update and delete Clusters in a specified Datacenter. The resource also takes care to configure Cluster's High Availability (HA) and Drs settings.\n\n## Examples\n\n### Example 1\n\nCreates a new Cluster in the specified Datacenter. The new Cluster has HAEnabled and HAAdmissionControlEnabled set to 'true', HAFailoverLevel is set to '3', HAIsolationResponse is 'DoNothing' and HARestartPriority is set to 'Low'. The new Cluster also has DrsEnabled set to 'true', DrsAutomationLevel is 'FullyAutomated', DrsMigrationThreshold is set to '5'. It has the following options specified: DrsDistribution is set to '0', MemoryLoadBalancing is set to '100' and CPUOverCommitment is set to '500'.\n\n```powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration Cluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Cluster cluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            Location = [string]::Empty\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            Name = 'MyCluster'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/DRSRule/DRSRule.md",
    "content": "# DRSRule\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter Server. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the DRS rule for Cluster specified in **ClusterName** key property. ||\n| **DatacenterName** | Key | string | The name of the Datacenter where the Cluster, for which the DRS rule applies, is located. ||\n| **DatacenterLocation** | Key | string | The location of the Datacenter where the Cluster, for which the DRS rule applies, is located. The Root Folder of the Inventory is not part of the location. Empty location means that the Datacenter is located in the Root Folder of the Inventory. The Folder names in the location are separated by '/'. Example Datacenter location: **MyDatacentersFolderOne/MyDatacentersFolderTwo**. ||\n| **ClusterName** | Key | string | The name of the Cluster for which the DRS rule applies. ||\n| **ClusterLocation** | Key | string | The location of the Cluster, for which the DRS rule applies, located in the Datacenter specified in **DatacenterName** key property. The Root Folders of the Datacenter are not part of the location. Empty location means that the Cluster is located in the Host Folder of the Datacenter. The Folder names in the location are separated by '/'. Example Cluster location: **MyClusterFolderOne/MyClusterFolderTwo**. ||\n| **DRSRuleType** | Key | DRSRuleType | Specifies the type of the DRS rule - affinity or anti-affinity. | VMAffinity, VMAntiAffinity |\n| **VMNames**| Mandatory | string[] | The names of the virtual machines that are referenced by the DRS rule. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the DRS rule should be present or absent. | Present, Absent |\n| **Enabled** | Optional | bool | Whether the DRS rule is enabled or disabled for the specified Cluster. ||\n\n## Description\n\nThe resource is used to create, modify and remove DRS rules for the specified Cluster.\n\n## Examples\n\n### Example 1\n\nCreates and enables **VMAffinity** DRS rule **DscDrsRule** for Cluster **DscCluster**. Virtual Machines **DscVM1** and **DscVM2** are referenced by the DRS rule **DscDrsRule**.\n\n```powershell\nConfiguration DRSRule_CreateDRSRule_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DRSRule DRSRule {\n            Server = $Server\n            Credential = $Credential\n            Name = 'DscDrsRule'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            ClusterName = 'DscCluster'\n            ClusterLocation = ''\n            DRSRuleType = 'VMAffinity'\n            VMNames = @('DscVM1', 'DscVM2')\n            Ensure = 'Present'\n            Enabled = $true\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves **VMAffinity** DRS rule **DscDrsRule** for Cluster **DscCluster**.\n\n```powershell\nConfiguration DRSRule_RemoveDRSRule_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DRSRule DRSRule {\n            Server = $Server\n            Credential = $Credential\n            Name = 'DscDrsRule'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            ClusterName = 'DscCluster'\n            ClusterLocation = ''\n            DRSRuleType = 'VMAffinity'\n            VMNames = @('DscVM1', 'DscVM2')\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/Datacenter/Datacenter.md",
    "content": "# Datacenter\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Datacenter located in the Folder specified in the 'Location' property. ||\n| **Location** | Key | string | Location of the Datacenter with name specified in 'Name' key property in the specified Inventory. Location consists of 0 or more Folders. Empty Location means that the Datacenter is in the Root Folder of the specified Inventory. The Root Folder of the Inventory is not part of the Location. Folder names in Location are separated by \"/\". Example Location for a Datacenter Inventory Item: \"MyFolder/MyDatacentersFolder\". ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Datacenter should be Present or Absent. | Present, Absent |\n\n## Description\n\nThe resource is used to create and delete Datacenters in a specified Inventory.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Folder 'MyFolder' in the Root Folder of the specified Inventory. The second Resource in the Configuration creates a new Folder 'MyDatacentersFolder' in the 'MyFolder' Folder. The third Resource in the Configuration creates a new Datacenter 'MyDatacenter' in the 'MyDatacentersFolder' Folder.\n\n```powershell\nConfiguration Datacenter_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Present'\n            DependsOn = \"[DatacenterFolder]MyFolder\"\n        }\n\n        Datacenter MyDatacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = 'MyFolder/MyDatacentersFolder'\n            Ensure = 'Present'\n            DependsOn = \"[DatacenterFolder]MyDatacentersFolder\"\n        }\n    }\n}\n```\n\n### Example 2\n\nThe first Resource in the Configuration removes the Datacenter 'MyDatacenter' in the 'MyDatacentersFolder' Folder. The second Resource in the Configuration removes the Folder 'MyDatacentersFolder' in the 'MyFolder' Folder. The third Resource in the Configuration removes the Folder 'MyFolder' in the Root Folder of the Inventory.\n\n```powershell\nConfiguration DatacenterFolder_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Datacenter MyDatacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = 'MyFolder/MyDatacentersFolder'\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Absent'\n            DependsOn = \"[Datacenter]MyDatacenter\"\n        }\n\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Absent'\n            DependsOn = \"[DatacenterFolder]MyDatacentersFolder\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/DatacenterFolder/DatacenterFolder.md",
    "content": "# DatacenterFolder\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Folder located in the Folder specified in the 'Location' property. ||\n| **Location** | Key | string | Location of the Folder with name specified in 'Name' key property in the specified Inventory. Location consists of 0 or more Folders. Empty Location means that the Folder is in the Root Folder of the specified Inventory. The Root Folder of the Inventory is not part of the Location. Folder names in Location are separated by \"/\". Example Location for a Folder Inventory Item: \"MyFolder/MyDatacentersFolder\". ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Folder should be Present or Absent. | Present, Absent |\n\n## Description\n\nThe resource is used to create and delete Folders in a specified Inventory.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Folder 'MyFolder' in the Root Folder of the specified Inventory. The second Resource in the Configuration creates a new Folder 'MyDatacentersFolder' in the 'MyFolder' Folder.\n\n```powershell\nConfiguration DatacenterFolder_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Present'\n            DependsOn = \"[DatacenterFolder]MyFolder\"\n        }\n    }\n}\n```\n\n### Example 2\n\nThe first Resource in the Configuration removes the Folder 'MyDatacentersFolder' in the 'MyFolder' Folder. The second Resource in the Configuration removes the Folder 'MyFolder' in the Root Folder of the Inventory.\n\n```powershell\nConfiguration DatacenterFolder_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Absent'\n            DependsOn = \"[DatacenterFolder]MyDatacentersFolder\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/DatastoreCluster/DatastoreCluster.md",
    "content": "# DatastoreCluster\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter Server. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the Datastore Cluster located in the Datacenter specified in **DatacenterName** key property. ||\n| **Location** | Key | string | The location of the Datastore Cluster with name specified in **Name** key property in the Datacenter specified in **DatacenterName** key property. Location consists of 0 or more Folders. Empty location means that the Datastore Cluster is located in the Datastore Folder of the Datacenter. The Root Folders of the Datacenter are not part of the location. Folder names in the location are separated by '/'. Example location for a Datastore Cluster: **MyDatastoreClusterFolderOne/MyDatastoreClusterFolderTwo**. ||\n| **DatacenterName** | Key | string | The name of the Datacenter where the Datastore Cluster is located. ||\n| **DatacenterLocation** | Key | string | The location of the Datacenter where the Datastore Cluster is located. The Root Folder of the Inventory is not part of the location. Empty location means that the Datacenter is in the Root Folder of the Inventory. The Folder names in the location are separated by '/'. Example Datacenter location: **MyDatacentersFolderOne/MyDatacentersFolderTwo**. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Datastore Cluster should be present or absent. | Present, Absent |\n| **IOLatencyThresholdMillisecond** | Optional | int | The maximum I/O latency in milliseconds allowed before Storage DRS is triggered for the Datastore Cluster. Valid values are in the range of **5** to **100**. If the value of IOLoadBalancing is **$false**, the setting for the I/O latency threshold is not applied. ||\n| **IOLoadBalanceEnabled** | Optional | bool | Whether I/O load balancing is enabled for the Datastore Cluster. If the value is **$false**, I/O load balancing is disabled and the settings for the I/O latency threshold and utilized space threshold are not applied. ||\n| **SdrsAutomationLevel** | Optional | DrsAutomationLevel | The Storage DRS automation level for the Datastore Cluster. | FullyAutomated, Manual, Disabled |\n| **SpaceUtilizationThresholdPercent** | Optional | int | The maximum percentage of consumed space allowed before Storage DRS is triggered for the Datastore Cluster. Valid values are in the range of **50** to **100**. If the value of IOLoadBalancing is **$false**, the setting for the utilized space threshold is not applied. ||\n\n## Description\n\nThe resource is used to create, modify and remove Datastore Clusters in the specified Datacenter on the specified vCenter Server.\n\n## Examples\n\n### Example 1\n\nCreates a Datastore Cluster **DscDatastoreCluster** in the **Datastore Folder** of Datacenter **Datacenter**. The IOLoadBalanceEnabled is set to **$true**, the SdrsAutomationLevel is set to **FullyAutomated** and the IOLatencyThresholdMillisecond and SpaceUtilizationThresholdPercent are set to **50**.\n\n```powershell\nConfiguration DatastoreCluster_CreateDatastoreCluster_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DatastoreCluster DatastoreCluster {\n            Server = $Server\n            Credential = $Credential\n            Name = 'DscDatastoreCluster'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            IOLatencyThresholdMillisecond = 50\n            IOLoadBalanceEnabled = $true\n            SdrsAutomationLevel = 'FullyAutomated'\n            SpaceUtilizationThresholdPercent = 50\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the Datastore Cluster **DscDatastoreCluster** located in the **Datastore Folder** of Datacenter **Datacenter**.\n\n```powershell\nConfiguration DatastoreCluster_RemoveDatastoreCluster_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DatastoreCluster DatastoreCluster {\n            Server = $Server\n            Credential = $Credential\n            Name = 'DscDatastoreCluster'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            IOLatencyThresholdMillisecond = 50\n            IOLoadBalanceEnabled = $true\n            SdrsAutomationLevel = 'FullyAutomated'\n            SpaceUtilizationThresholdPercent = 50\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore.md",
    "content": "# DatastoreClusterAddDatastore\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter Server. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **DatacenterName** | Key | string | The name of the Datacenter where the specified Datastore Cluster and Datastores are located. ||\n| **DatacenterLocation** | Key | string | The location of the Datacenter where the specified Datastore Cluster and Datastores are located. The Root Folder of the Inventory is not part of the location. Empty location means that the Datacenter is in the Root Folder of the Inventory. The Folder names in the location are separated by '/'. Example Datacenter location: **MyDatacentersFolderOne/MyDatacentersFolderTwo**. ||\n| **DatastoreClusterName** | Key | string | The name of the Datastore Cluster located in the Datacenter specified in **DatacenterName** key property. ||\n| **DatastoreClusterLocation** | Key | string | The location of the Datastore Cluster with name specified in **DatastoreClusterName** key property in the Datacenter specified in **DatacenterName** key property. Location consists of 0 or more Folders. Empty location means that the Datastore Cluster is located in the Datastore Folder of the Datacenter. The Root Folders of the Datacenter are not part of the location. Folder names in the location are separated by '/'. Example location for a Datastore Cluster: **MyDatastoreClusterFolderOne/MyDatastoreClusterFolderTwo**. ||\n| **DatastoreNames**| Mandatory | string[] | The names of the Datastores that should be located in the specified Datastore Cluster. ||\n\n## Description\n\nThe resource is used to add Datastores to the specified Datastore Cluster.\n\n## Examples\n\n### Example 1\n\nAdds Datastores **DscDatastoreOne** and **DscDatastoreTwo** to Datastore Cluster **DscDatastoreCluster** located in Datacenter **Datacenter**.\n\n```powershell\nConfiguration DatastoreClusterAddDatastore_AddDatastoresToDatastoreCluster_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        DatastoreClusterAddDatastore DatastoreClusterAddDatastore {\n            Server = $Server\n            Credential = $Credential\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            DatastoreClusterName = 'DscDatastoreCluster'\n            DatastoreClusterLocation = ''\n            DatastoreNames = @('DscDatastoreOne', 'DscDatastoreTwo')\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/DrsCluster/DrsCluster.md",
    "content": "# DrsCluster\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Cluster located in the Datacenter specified in 'DatacenterName' key property. ||\n| **Location** | Key | string | Location of the Cluster with name specified in 'Name' key property in the Datacenter specified in the 'DatacenterName' key property. Location consists of 0 or more Inventory Items. Empty Location means that the Cluster is in the Host Folder of the Datacenter. The Root Folders of the Datacenter are not part of the Location. Inventory Item names in Location are separated by \"/\". Example Location for a Cluster Inventory Item: \"MyClusters/DrsClusters\". ||\n| **DatacenterName** | Key | string | Name of the Datacenter we will use from the specified Inventory. ||\n| **DatacenterLocation** | Key | string | Location of the Datacenter we will use from the Inventory. Root Folder of the Inventory is not part of the Location. Empty Location means that the Datacenter is in the Root Folder of the Inventory. Folder names in Location are separated by \"/\". Example Location: \"MyDatacentersFolder\". ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Cluster should be Present or Absent. | Present, Absent |\n| **DrsEnabled** | Optional | bool | Indicates that VMware DRS (Distributed Resource Scheduler) is enabled. ||\n| **DrsAutomationLevel** | Optional | DrsAutomationLevel | Specifies a DRS (Distributed Resource Scheduler) automation level. | FullyAutomated, Manual, PartiallyAutomated, Disabled, Unset |\n| **DrsMigrationThreshold** | Optional | int | Threshold for generated ClusterRecommendations. DRS generates only those recommendations that are above the specified vmotionRate. Ratings vary from 1 to 5. This setting applies to Manual, PartiallyAutomated, and FullyAutomated DRS Clusters. ||\n| **DrsDistribution** | Optional | int | For availability, distributes a more even number of virtual machines across hosts. ||\n| **MemoryLoadBalancing** | Optional | int | Load balance based on consumed memory of virtual machines rather than active memory. This setting is recommended for clusters where host memory is not over-committed. ||\n| **CPUOverCommitment** | Optional | int | Controls CPU over-commitment in the cluster. Min value is 0 and Max value is 500. ||\n\n## Description\n\nThe resource is used to create, update and delete Clusters in a specified Datacenter. The resource also takes care to configure Cluster's Drs settings.\n\n## Examples\n\n### Example 1\n\nCreates a new Cluster in the specified Datacenter. The new Cluster has DrsEnabled set to 'true', DrsAutomationLevel is 'FullyAutomated', DrsMigrationThreshold is set to '5'. The new Cluster also has the following options specified: DrsDistribution is set to '0', MemoryLoadBalancing is set to '100' and CPUOverCommitment is set to '500'.\n\n```powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration DrsCluster_WithClusterToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DrsCluster drsCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            Location = [string]::Empty\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            Name = 'MyCluster'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the Cluster from the specified Datacenter.\n\n```powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration DrsCluster_WithClusterToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DrsCluster drsCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Absent'\n            Location = [string]::Empty\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            Name = 'MyCluster'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/Folder/Folder.md",
    "content": "# Folder\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Folder located in the Datacenter specified in 'DatacenterName' key property. ||\n| **Location** | Key | string | Location of the Folder with name specified in 'Name' key property in the Datacenter specified in the 'DatacenterName' key property. Location consists of 0 or more Folders. Empty Location means that the Folder is in the Root Folder of the Datacenter specified in the 'FolderType' property. The Root Folders of the Datacenter are not part of the Location. Folder names in Location are separated by \"/\". Example Location for a Folder Inventory Item: \"MyFolder/MyClustersFolder\". ||\n| **DatacenterName** | Key | string | Name of the Datacenter we will use from the specified Inventory. ||\n| **DatacenterLocation** | Key | string | Location of the Datacenter we will use from the Inventory. Root Folder of the Inventory is not part of the Location. Empty Location means that the Datacenter is in the Root Folder of the Inventory. Folder names in Location are separated by \"/\". Example Location: \"MyDatacentersFolder\". ||\n| **FolderType** | Key | FolderType | The type of Root Folder in the Datacenter in which the Folder is located. Possible values are VM, Network, Datastore, Host. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Folder should be Present or Absent. | Present, Absent |\n\n## Description\n\nThe resource is used to create and delete Folders in a specified Datacenter.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Folder 'MyFolder' in the Datacenter 'Datacenter' in the Host Folder of the Datacenter. The second Resource in the Configuration creates a new Folder 'MyClustersFolder' in the Datacenter 'Datacenter' in 'MyFolder' Folder. The third Resource in the Configuration creates a new Folder 'MyHAClustersFolder' in the Datacenter 'Datacenter' in 'MyClustersFolder' Folder.\n\n```powershell\nConfiguration Folder_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Folder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n        }\n\n        Folder MyClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyClustersFolder'\n            Location = 'MyFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyFolder\"\n        }\n\n        Folder MyHAClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyHAClustersFolder'\n            Location = 'MyFolder/MyClustersFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyClustersFolder\"\n        }\n    }\n}\n```\n\n### Example 2\n\nThe first Resource in the Configuration removes the Folder 'MyHAClustersFolder' in the Datacenter 'Datacenter' in the 'MyClustersFolder' Folder. The second Resource in the Configuration removes the Folder 'MyClustersFolder' in the Datacenter 'Datacenter' in 'MyFolder' Folder. The third Resource in the Configuration removes the Folder 'MyFolder' in the Datacenter 'Datacenter' in the Host Folder of the Datacenter.\n\n```powershell\nConfiguration Folder_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Folder MyHAClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyHAClustersFolder'\n            Location = 'MyFolder/MyClustersFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            FolderType = 'Host'\n        }\n\n        Folder MyClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyClustersFolder'\n            Location = 'MyFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyHAClustersFolder\"\n        }\n\n        Folder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyClustersFolder\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/HACluster/HACluster.md",
    "content": "# HACluster\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Cluster located in the Datacenter specified in 'DatacenterName' key property. ||\n| **Location** | Key | string | Location of the Cluster with name specified in 'Name' key property in the Datacenter specified in the 'DatacenterName' key property. Location consists of 0 or more Inventory Items. Empty Location means that the Cluster is in the Host Folder of the Datacenter. The Root Folders of the Datacenter are not part of the Location. Inventory Item names in Location are separated by \"/\". Example Location for a Cluster Inventory Item: \"MyClusters/DrsClusters\". ||\n| **DatacenterName** | Key | string | Name of the Datacenter we will use from the specified Inventory. ||\n| **DatacenterLocation** | Key | string | Location of the Datacenter we will use from the Inventory. Root Folder of the Inventory is not part of the Location. Empty Location means that the Datacenter is in the Root Folder of the Inventory. Folder names in Location are separated by \"/\". Example Location: \"MyDatacentersFolder\". ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Cluster should be Present or Absent. | Present, Absent |\n| **HAEnabled** | Optional | bool | Indicates that VMware HA (High Availability) is enabled. ||\n| **HAAdmissionControlEnabled** | Optional | bool | Indicates that virtual machines cannot be powered on if they violate availability constraints. ||\n| **HAFailoverLevel** | Optional | int | Specifies a configured failover level. This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines. The valid values range from 1 to 4. ||\n| **HAIsolationResponse** | Optional | HAIsolationResponse | Indicates that the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. | PowerOff, DoNothing, Shutdown, Unset |\n| **HARestartPriority** | Optional | HARestartPriority | Specifies the cluster HA restart priority. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts. | Disabled, Low, Medium, High, Unset |\n\n## Description\n\nThe resource is used to create, update and delete Clusters in a specified Datacenter. The resource also takes care to configure Cluster's High Availability (HA) settings.\n\n## Examples\n\n### Example 1\n\nCreates a new Cluster in the specified Datacenter. The new Cluster has HAEnabled and HAAdmissionControlEnabled set to 'true', HAFailoverLevel is set to '3', HAIsolationResponse is 'DoNothing' and HARestartPriority is set to 'Low'.\n\n```powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration HACluster_WithClusterToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        HACluster haCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            Location = [string]::Empty\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            Name = 'MyCluster'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the Cluster from the specified Datacenter.\n\n```powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration HACluster_WithClusterToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        HACluster haCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Absent'\n            Location = [string]::Empty\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            Name = 'MyCluster'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/NfsDatastore/NfsDatastore.md",
    "content": "# NfsDatastore\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The name of the Nfs Datastore. ||\n| **Path** | Mandatory | string | The remote path of the Nfs mount point. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Nfs Datastore should be present or absent. | Present, Absent |\n| **NfsHost** | Mandatory | string[] | The Nfs Host for the Datastore. ||\n| **FileSystemVersion** | Optional | string | The file system that is used on the Nfs Datastore. ||\n| **AccessMode** | Optional | AccessMode | The access mode for the Nfs Datastore. The default access mode is **ReadWrite**. | ReadWrite, ReadOnly |\n| **AuthenticationMethod** | Optional | AuthenticationMethod | The authentication method for the Nfs Datastore. The default authentication method is **AUTH_SYS**. | AUTH_SYS, Kerberos |\n| **CongestionThresholdMillisecond** | Optional | int | The latency period beyond which the storage array is considered congested. The range of this value is between 10 to 100 milliseconds. ||\n| **StorageIOControlEnabled** | Optional | bool | Indicates whether the IO control is enabled. ||\n\n## Description\n\nThe resource is used to create, modify and remove Nfs Datastores on the specified Nfs Host and VMHost.\n\n## Examples\n\n### Example 1\n\nCreates Nfs Datastore **MyNfsDatastore** with **version 3** File System on the specified Nfs Host and VMHost. The access mode is **ReadOnly** and the Authentication method is **AUTH_SYS**.\n\n```powershell\nConfiguration NfsDatastore_CreateNfsDatastoreWithReadOnlyAccessMode_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $NfsHost,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $NfsPath\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        NfsDatastore NfsDatastore {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $NfsPath\n            Ensure = 'Present'\n            NfsHost = $NfsHost\n            FileSystemVersion = '3'\n            AccessMode = 'ReadOnly'\n            AuthenticationMethod = 'AUTH_SYS'\n        }\n    }\n}\n```\n\n### Example 2\n\nCreates or modifies Nfs Datastore **MyNfsDatastore** with **version 3** File System on the specified Nfs Host and VMHost. The access mode is **ReadWrite** and the Authentication method is **AUTH_SYS**. The StorageIOControl is **enabled** and the latency period beyond which the storage array is considered congested is **10 milliseconds**.\n\n```powershell\nConfiguration NfsDatastore_CreateNfsDatastoreWithReadWriteAccessMode_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $NfsHost,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $NfsPath\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        NfsDatastore NfsDatastore {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $NfsPath\n            Ensure = 'Present'\n            NfsHost = $NfsHost\n            FileSystemVersion = '3'\n            AccessMode = 'ReadWrite'\n            AuthenticationMethod = 'AUTH_SYS'\n            StorageIOControlEnabled = $true\n            CongestionThresholdMillisecond = 10\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves Nfs Datastore **MyNfsDatastore** from the specified Nfs Host and VMHost.\n\n```powershell\nConfiguration NfsDatastore_RemoveNfsDatastore_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $NfsHost,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $NfsPath\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        NfsDatastore NfsDatastore {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $NfsPath\n            Ensure = 'Absent'\n            NfsHost = $NfsHost\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/NfsUser/NfsUser.md",
    "content": "# NfsUser\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The Nfs User name used for Kerberos authentication. ||\n| **Password** | Optional | string | The Nfs User password used for Kerberos authentication. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Nfs User should be present or absent. | Present, Absent |\n| **Force** | Optional | bool | Specifies whether to change the password of the Nfs User. When the property is not specified or is $false, it is ignored. If the property is $true and the Nfs User exists, the password of the Nfs User is changed. ||\n\n## Description\n\nThe resource is used to create, change the password and remove Nfs Users on the specified VMHost. The VMHost must be in Active Directory domain.\n\n## Examples\n\n### Example 1\n\nCreates Nfs User **MyNfsUser** with password **MyNfsUserPassword1!** on the specified VMHost. The VMHost must be in Active Directory domain for the Nfs User to be created.\n\n```powershell\nConfiguration NfsUser_CreateNfsUser_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        NfsUser NfsUser {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyNfsUser'\n            Password = 'MyNfsUserPassword1!'\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 2\n\nChanges the password of Nfs User **MyNfsUser** to **MyNfsUserPassword2!** on the specified VMHost.\n\n```powershell\nConfiguration NfsUser_ChangeNfsUserPassword_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        NfsUser NfsUser {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyNfsUser'\n            Password = 'MyNfsUserPassword2!'\n            Ensure = 'Present'\n            Force = $true\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves Nfs User **MyNfsUser** from the specified VMHost.\n\n```powershell\nConfiguration NfsUser_RemoveNfsUser_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        NfsUser NfsUser {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyNfsUser'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/PowerCLISettings/PowerCLISettings.md",
    "content": "# PowerCLISettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **SettingsScope** | Key | PowerCLISettingsScope | Specifies the scope on which the PowerCLI Settings will be applied. |LCM|\n| **CEIPDataTransferProxyPolicy** | Optional | ProxyPolicy | Specifies the proxy policy for the connection through which Customer Experience Improvement Program (CEIP) data is sent to VMware. |NoProxy, UseSystemProxy, Unset|\n| **DefaultVIServerMode** | Optional | DefaultVIServerMode | Specifies the server connection mode. |Single, Multiple, Unset|\n| **DisplayDeprecationWarnings** | Optional | bool | Indicates whether you want to see warnings about deprecated elements. ||\n| **InvalidCertificateAction** | Optional | BadCertificateAction | Define the action to take when an attempted connection to a server fails due to a certificate error. |Ignore, Warn, Prompt, Fail, Unset|\n| **ParticipateInCeip** | Optional | bool | Specifies if PowerCLI should send anonymous usage information to VMware. ||\n| **ProxyPolicy** | Optional | ProxyPolicy | Specifies whether VMware PowerCLI uses a system proxy server to connect to the vCenter Server system. |NoProxy, UseSystemProxy, Unset|\n| **WebOperationTimeoutSeconds** | Optional | int | Defines the timeout for Web operations. The default value is 300 sec. ||\n\n## Description\n\nThe resource is used to Update the PowerCLI Configuration settings of the LCM. **User Scope** PowerCLI Configuration settings are updated with this resource. The LCM runs with Windows System account, so the settings will be stored for the user that runs LCM PowerShell. If a user runs a Configuration with this resource, the settings will be preserved for all future Configurations that run on that LCM.\n\n## Examples\n\n### Example 1\n\nUpdates the ParticipateInCeip, InvalidCertificateAction, DefaultVIServerMode and DisplayDeprecationWarnings PowerCLI Configuration settings.\n\n````powershell\nConfiguration PowerCLISettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        PowerCLISettings powerCLISettings {\n            SettingsScope = 'LCM'\n            ParticipateInCeip = $false\n            InvalidCertificateAction = 'Warn'\n            DefaultVIServerMode = 'Multiple'\n            DisplayDeprecationWarnings = $false\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/StandardPortGroup/StandardPortGroup.md",
    "content": "# StandardPortGroup\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The name of the Standard Port Group. ||\n| **VssName** | Mandatory | string | The name of the Standard Switch to which the Standard Port Group belongs to. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Standard Port Group should be Present or Absent. | Present, Absent |\n| **VLanId** | Optional | int | The VLanId for ports using this Standard Port Group. | 0 - 4095 |\n| **Enabled** | Optional | bool | The flag to indicate whether or not traffic shaper is enabled on the port. ||\n| **AverageBandwidth** | Optional | long | The average bandwidth in bits per second if shaping is enabled on the port. ||\n| **PeakBandwidth** | Optional | long | The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port. ||\n| **BurstSize** | Optional | long | The maximum burst size allowed in bytes if shaping is enabled on the port. ||\n| **AllowPromiscuous** | Optional | bool | Specifies whether promiscuous mode is enabled for the corresponding Standard Port Group. ||\n| **AllowPromiscuousInherited** | Optional | bool | Specifies whether the AllowPromiscuous setting is inherited from the parent Standard Switch. ||\n| **ForgedTransmits** | Optional | bool | Specifies whether forged transmits are enabled for the corresponding Standard Port Group. ||\n| **ForgedTransmitsInherited** | Optional | bool | Specifies whether the ForgedTransmits setting is inherited from the parent Standard Switch. ||\n| **MacChanges** | Optional | bool | Specifies whether MAC address changes are enabled for the corresponding Standard Port Group. ||\n| **MacChangesInherited** | Optional | bool | Specifies whether the MacChanges setting is inherited from the parent Standard Switch. ||\n| **FailbackEnabled** | Optional | bool | Specifies how a Physical Adapter is returned to active duty after recovering from a failure. ||\n| **LoadBalancingPolicy** | Optional | LoadBalancingPolicy | Determines how network traffic is distributed between the network Adapters assigned to a Switch. | LoadBalanceIP, LoadBalanceSrcMac, LoadBalanceSrcId, ExplicitFailover |\n| **ActiveNic** | Optional | string[] | The Adapters you want to continue to use when the network Adapter connectivity is available and active. ||\n| **StandbyNic** | Optional | string[] | The Adapters you want to use if one of the active Adapter's connectivity is unavailable. ||\n| **UnusedNic** | Optional | string[] | The Adapters you do not want to use. ||\n| **NetworkFailoverDetectionPolicy** | Optional | NetworkFailoverDetectionPolicy | Specifies how to reroute traffic in the event of an Adapter failure. | LinkStatus, BeaconProbing |\n| **NotifySwitches** | Optional | bool | Indicates that whenever a virtual NIC is connected to the Standard Switch or whenever that virtual NIC's traffic is routed over a different physical NIC in the team because of a failover event, a notification is sent over the network to update the lookup tables on the physical Switches. ||\n| **InheritFailback** | Optional | bool | Indicates that the value of the FailbackEnabled parameter is inherited from the Standard Switch. ||\n| **InheritFailoverOrder** | Optional | bool | Indicates that the values of the ActiveNic, StandbyNic, and UnusedNic parameters are inherited from the Standard Switch. ||\n| **InheritLoadBalancingPolicy** | Optional | bool | Indicates that the value of the LoadBalancingPolicy parameter is inherited from the Standard Switch. ||\n| **InheritNetworkFailoverDetectionPolicy** | Optional | bool | Indicates that the value of the NetworkFailoverDetectionPolicy parameter is inherited from the Standard Switch. ||\n| **InheritNotifySwitches** | Optional | bool | Indicates that the value of the NotifySwitches parameter is inherited from the Standard Switch. ||\n\n## Description\n\nThe resource is used to create, modify and remove Port Groups which are associated with the specified Standard Switch. If Ensure is 'Absent', all VMs connected to the Port Group must be **PoweredOff** and no VMKernel Network Adapters should be connected to it to successfully remove the Port Group. If one or more of the VMs are **PoweredOn** and at least one VMKernel Network Adapter is connected to the Port Group, the removal would not be successful because the Port Group is used by the VMs and there are connected VMKernel Network Adapters to it.\n\n## Examples\n\n### Example 1\n\nThe Configuration does the following:\n\n1. Creates/Updates Port Group **MyStandardPortGroup** which belongs to Standard Switch **MyStandardSwitch** with VLanId set to **1**.\n2. Enables the Shaping Policy and sets the **BurstSize**, **Average** and **Peak bandwidth** values.\n3. Enables **Promiscuous mode**, **Forged Transmits** and **Mac Changes**. The Security Policy settings are not inherited from the parent Standard Switch **MyStandardSwitch**.\n4. Sets the active Nics to be **vmnic2** and **vmnnic3**, the LoadBalancing Policy to **LoadBalanceIP** and the NetworkFailover Policy to **LinkStatus**.\nThe Teaming Policy settings are not inherited from the parent Standard Switch **MyStandardSwitch**.\n\n```powershell\nConfiguration StandardPortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        StandardPortGroup StandardPortGroup {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyStandardPortGroup'\n            VssName = 'MyStandardSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            AllowPromiscuous = $true\n            AllowPromiscuousInherited = $false\n            ForgedTransmits = $true\n            ForgedTransmitsInherited = $false\n            MacChanges = $true\n            MacChangesInherited = $false\n            FailbackEnabled = $false\n            LoadBalancingPolicy = 'LoadBalanceIP'\n            ActiveNic = @('vmnic2', 'vmnic3')\n            StandbyNic = @()\n            UnusedNic = @()\n            NetworkFailoverDetectionPolicy = 'LinkStatus'\n            NotifySwitches = $false\n            InheritFailback = $false\n            InheritFailoverOrder = $false\n            InheritLoadBalancingPolicy = $false\n            InheritNetworkFailoverDetectionPolicy = $false\n            InheritNotifySwitches = $false\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/StandardSwitch/StandardSwitch.md",
    "content": "# StandardSwitch\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **Name** | Key | string | The name of the Standard Switch. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Standard Switch should be present or absent. | Present, Absent |\n| **Mtu** | Optional | int | The maximum transmission unit (MTU) in bytes associated with the Standard Switch. ||\n| **NicDevice** | Optional | string[] | The names of the Physical Network Adapters that are bridged to the Standard Switch. ||\n| **BeaconInterval** | Optional | int | Determines how often, in seconds, a beacon should be sent. ||\n| **LinkDiscoveryProtocolType** | Optional | string | The discovery protocol type. Standard Switches support only CDP (Cisco Discovery Protocol). | CDP |\n| **LinkDiscoveryProtocolOperation** | Optional | string | Specifies whether to advertise or listen. | Advertise, Both, Listen, None |\n| **AllowPromiscuous** | Optional | bool | A flag indicating whether or not all traffic is seen on the port. ||\n| **ForgedTransmits** | Optional | bool | A flag indicating whether or not the Virtual Network Adapter should be allowed to send network traffic with a different MAC address. ||\n| **MacChanges** | Optional | bool | A flag indicating whether or not the Media Access Control (MAC) address can be changed. ||\n| **Enabled** | Optional | bool | A flag indicating whether or not traffic shaper is enabled on the port. ||\n| **AverageBandwidth** | Optional | long | The average bandwidth in bits per second if shaping is enabled on the port. ||\n| **PeakBandwidth** | Optional | long | The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port. ||\n| **BurstSize** | Optional | long | The maximum burst size allowed in bytes if shaping is enabled on the port. ||\n| **CheckBeacon** | Optional | bool | A flag indicating whether or not to enable beacon probing as a method to validate the link status of a Physical Network Adapter. ||\n| **ActiveNic** | Optional | string[] | List of active Network Adapters used for load balancing. ||\n| **StandbyNic** | Optional | string[] | Standby Network Adapters used for failover. ||\n| **NotifySwitches** | Optional | bool | A flag specifying whether or not to notify the Physical Switch if a link fails. ||\n| **Policy** | Optional | NicTeamingPolicy | The Network adapter teaming policy. |  LoadBalance_IP, LoadBalance_SrcMAC, LoadBalance_SrcId, Failover_Explicit |\n| **RollingOrder** | Optional | bool | A flag indicating whether or not to use a rolling policy when restoring links. ||\n\n## Description\n\nThe resource is used to create, modify and remove Standard Switches on the specified VMHost. The resource also modifies the different policies of the Standard Switch - Security, Shaping and Teaming policies as well as creating a bridge to connect the Standard Switch to Physical Network Adapters.\n\n## Examples\n\n### Example 1\n\nCreates/modifies Standard Switch **MyStandardSwitch** with maximum transmission unit **1500 bytes**. Physical Network Adapters **vmnic2** and **vmnic3** are bridged to Standard Switch **MyStandardSwitch** with configured beacon probing and link discovery protocol type **CDP** and operation **Listen**. **Promiscuous mode**, **Forged Transmits** and **Mac Changes** are enabled for Standard Switch **MyStandardSwitch**. The shaping policy for Standard Switch **MyStandardSwitch** is **enabled** with average bandwidth in bits per second **104857600000**, peak bandwidth during bursts in bits per second **104857600000** and the maximum burst size allowed in bytes **107374182400**. The active Nic is **vmnic2**, the standby Nic is **vmnnic3**, the Network Adapter teaming policy is **LoadBalanceSrcId**. The Physical Network Adapters are notified if a link fails. Rolling policy when restoring links is not used. Beacon probing as a method to validate the link status of a Physical Network Adapter is not enabled.\n\n```powershell\nConfiguration StandardSwitch_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        StandardSwitch StandardSwitch {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyStandardSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n            NicDevice = @('vmnic2', 'vmnic3')\n            BeaconInterval = 1\n            LinkDiscoveryProtocolType = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Listen'\n            AllowPromiscuous = $true\n            ForgedTransmits = $true\n            MacChanges = $true\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            CheckBeacon = $false\n            ActiveNic = @('vmnic2')\n            StandbyNic = @('vmnic3')\n            NotifySwitches = $true\n            Policy = 'Loadbalance_srcid'\n            RollingOrder = $false\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VDPortGroup/VDPortGroup.md",
    "content": "# VDPortGroup\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the Distributed Port Group. ||\n| **VdsName** | Mandatory | string | The name of the vSphere Distributed Switch associated with the Distributed Port Group. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Distributed Port Group should be Present or Absent. | Present, Absent |\n| **Notes** | Optional | string | The description for the Distributed Port Group. ||\n| **NumPorts** | Optional | int | The number of ports that the Distributed Port Group will have. If the parameter is not specified, the number of ports for the Distributed Port Group is 128. ||\n| **PortBinding** | Optional | PortBinding | The port binding setting for the Distributed Port Group. | Static, Dynamic, Ephemeral |\n| **VLanId** | Optional | int | The VLAN ID for the Distributed Port Group. Valid values are integers in the range of **1** to **4094**. If **0** is specified, the VLAN type is **None**. ||\n| **ReferenceVDPortGroupName** | Optional | string | The name for the reference Distributed Port Group. The properties of the new Distributed Port Group will be cloned from the reference Distributed Port Group. ||\n\n## Description\n\nThe resource is used to create, modify the configuration or remove the specified Distributed Port Group.\n\n## Examples\n\n### Example 1\n\nCreates a new Datacenter **Datacenter** in the **Root Folder** of the Inventory. Creates a new vSphere Distributed Switch **MyVDSwitch** in the **Network Folder** of Datacenter **Datacenter**. Creates a new Distributed Port Group **MyVDPortGroup** on vSphere Distributed Switch **MyVDSwitch** with **Static** Port Binding, **128** Ports and VLAN ID **1**.\n\n```powershell\nConfiguration VDPortGroup_CreateVDPortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Datacenter Datacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'Datacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        VDPortGroup VDPortGroup {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            NumPorts = 128\n            Notes = 'MyVDPortGroup Notes'\n            PortBinding = 'Static'\n            VLanId = 1\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n    }\n}\n```\n\n### Example 2\n\nCreates a new Datacenter **Datacenter** in the **Root Folder** of the Inventory. Creates a new vSphere Distributed Switch **MyVDSwitch** in the **Network Folder** of Datacenter **Datacenter**. Creates a new Distributed Port Group **MyVDPortGroup** on vSphere Distributed Switch **MyVDSwitch** with **Static** Port Binding and **128** Ports. Creates a new Distributed Port Group **MyVDPortGroupViaReferenceVDPortGroup** on vSphere Distributed Switch **MyVDSwitch**. The properties of the new Distributed Port Group will be cloned from the Reference Distributed Port Group **MyVDPortGroup**.\n\n```powershell\nConfiguration VDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Datacenter Datacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'Datacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        VDPortGroup VDPortGroup {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            NumPorts = 128\n            Notes = 'MyVDPortGroup Notes'\n            PortBinding = 'Static'\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n\n        VDPortGroup VDPortGroupViaReferenceVDPortGroup {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyVDPortGroupViaReferenceVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            ReferenceVDPortGroupName = 'MyVDPortGroup'\n            DependsOn = '[VDPortGroup]VDPortGroup'\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves Distributed Port Group **MyVDPortGroup** on vSphere Distributed Switch **MyVDSwitch**.\n\n```powershell\nConfiguration VDPortGroup_RemoveVDPortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDPortGroup VDPortGroup {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VDSwitch/VDSwitch.md",
    "content": "# VDSwitch\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | Name of the Distributed Switch located in the Datacenter specified in 'DatacenterName' key property. ||\n| **Location** | Key | string | Location of the Distributed Switch with name specified in 'Name' key property in the Datacenter specified in the 'DatacenterName' key property. Location consists of 0 or more Inventory Items. Empty Location means that the Distributed Switch is in the Network Folder of the Datacenter. The Root Folders of the Datacenter are not part of the Location. Inventory Item names in Location are separated by \"/\". Example Location for a Distributed Switch: \"MySwitches/MyDistributedSwitches\". ||\n| **DatacenterName** | Key | string | Name of the Datacenter we will use from the specified Inventory. ||\n| **DatacenterLocation** | Key | string | Location of the Datacenter we will use from the Inventory. Root Folder of the Inventory is not part of the Location. Empty Location means that the Datacenter is in the Root Folder of the Inventory. Folder names in Location are separated by \"/\". Example Location: \"MyDatacentersFolder\". ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Distributed Switch should be Present or Absent. | Present, Absent |\n| **ContactDetails** | Optional | string | The contact details of the vSphere Distributed Switch administrator. ||\n| **ContactName** | Optional | string | The name of the vSphere Distributed Switch administrator. ||\n| **LinkDiscoveryProtocol** | Optional | LinkDiscoveryProtocolProtocol | The discovery protocol type of the vSphere Distributed Switch that you want to configure. If you do not set a value for this parameter, the default server setting is used. | CDP, LLDP, Unset |\n| **LinkDiscoveryProtocolOperation** | Optional | LinkDiscoveryProtocolOperation | The link discovery protocol operation for the vSphere Distributed Switch that you want to configure. If you do not set a value for this parameter, the default server setting is used. | Advertise, Both, Listen, None, Unset |\n| **MaxPorts** | Optional | int | The maximum number of ports allowed on the vSphere Distributed Switch that you want to configure. ||\n| **Mtu** | Optional | int | The maximum MTU size for the vSphere Distributed Switch that you want to configure. Valid values are positive integers only. ||\n| **Notes** | Optional | string | The description for the vSphere Distributed Switch that you want to configure. ||\n| **NumUplinkPorts** | Optional | int | The number of uplink ports on the vSphere Distributed Switch that you want to configure. ||\n| **ReferenceVDSwitchName** | Optional | string | The Name for the reference vSphere Distributed Switch. The properties of the new vSphere Distributed Switch will be cloned from the reference vSphere Distributed Switch. ||\n| **Version** | Optional | string | The version of the vSphere Distributed Switch that you want to configure. You cannot specify a version that is incompatible with the version of the vCenter Server system you are connected to. ||\n| **WithoutPortGroups** | Optional | bool | Indicates whether the new vSphere Distributed Switch will be created without importing the port groups from the specified reference vSphere Distributed Switch. ||\n\n## Description\n\nThe resource is used to create, update and remove vSphere Distributed Switches.\n\n## Examples\n\n### Example 1\n\nCreates a new Distributed Switch **MyDistributedSwitch** with the specified settings in the **Network** folder of Datacenter **Datacenter**.\n\n```powershell\nConfiguration VDSwitch_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ContactDetails = 'My Contact Details'\n            ContactName = 'My Contact Name'\n            LinkDiscoveryProtocol = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Advertise'\n            MaxPorts = 100\n            Mtu = 2000\n            Notes = 'My Notes for Distributed Switch'\n            NumUplinkPorts = 10\n            Version = '6.6.0'\n        }\n    }\n}\n```\n\n### Example 2\n\nCreates a new Distributed Switch **MyDistributedSwitch** with the specified settings in the **Network** folder of Datacenter **Datacenter**. It also creates a new Distributed Switch **MyDistributedSwitchViaReferenceVDSwitch** with the settings from the Distributed Switch **MyDistributedSwitch** in the **Network** folder of Datacenter **Datacenter**. The new vSphere Distributed Switch will be created without importing the port groups from the specified reference vSphere Distributed Switch.\n\n```powershell\nConfiguration VDSwitch_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ContactDetails = 'My Contact Details'\n            ContactName = 'My Contact Name'\n            LinkDiscoveryProtocol = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Advertise'\n            MaxPorts = 100\n            Mtu = 2000\n            Notes = 'My Notes for Distributed Switch'\n            NumUplinkPorts = 10\n            Version = '6.6.0'\n        }\n\n        VDSwitch VDSwitchViaReferenceVDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDistributedSwitchViaReferenceVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ReferenceVDSwitchName = 'MyDistributedSwitch'\n            WithoutPortGroups = $true\n            DependsOn = \"[VDSwitch]VDSwitch\"\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves the Distributed Switch **MyDistributedSwitch** from the **Network** folder of Datacenter **Datacenter**.\n\n```powershell\nConfiguration VDSwitch_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VDSwitchVMHost/VDSwitchVMHost.md",
    "content": "# VDSwitchVMHost\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The Name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **VdsName** | Key | string | The Name of the vSphere Distributed Switch to/from which you want to add/remove the specified VMHosts. ||\n| **VMHostNames** | Mandatory | string[] | The Names of the VMHosts that you want to add/remove to/from the specified vSphere Distributed Switch. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VMHosts should be Present/Absent to/from the specified vSphere Distributed Switch. | Present, Absent |\n\n## Description\n\nThe resource is used to add/remove VMHosts to/from the specified vSphere Distributed Switch.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Distributed Switch **MyDistributedSwitch** in the **Network** folder of Datacenter **Datacenter**. The second Resource in the Configuration adds the specified VMHosts to Distributed Switch **MyDistributedSwitch**.\n\n```powershell\nConfiguration VDSwitchVMHost_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $VMHostNames\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitchVMHost VDSwitchVMHost {\n            Server = $Server\n            Credential = $Credential\n            VdsName = 'MyDistributedSwitch'\n            VMHostNames = $VMHostNames\n            Ensure = 'Present'\n            DependsOn = \"[VDSwitch]VDSwitch\"\n        }\n    }\n}\n```\n\n### Example 2\n\nThe first Configuration creates a new Distributed Switch **MyDistributedSwitch** in the **Network** folder of Datacenter **Datacenter** and adds the specified VMHosts to Distributed Switch **MyDistributedSwitch**. The second Configuration removes the specified VMHosts from Distributed Switch **MyDistributedSwitch**.\n\n```powershell\nConfiguration VDSwitchVMHost_WhenAddingVMHostsToDistributedSwitch_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $VMHostNames\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDSwitch VDSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitchVMHost VDSwitchVMHost {\n            Server = $Server\n            Credential = $Credential\n            VdsName = 'MyDistributedSwitch'\n            VMHostNames = $VMHostNames\n            Ensure = 'Present'\n            DependsOn = \"[VDSwitch]VDSwitch\"\n        }\n    }\n}\n\nConfiguration VDSwitchVMHost_WhenRemovingVMHostsFromDistributedSwitch_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $VMHostNames\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VDSwitchVMHost VDSwitchVMHost {\n            Server = $Server\n            Credential = $Credential\n            VdsName = 'MyDistributedSwitch'\n            VMHostNames = $VMHostNames\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostAcceptanceLevel/VMHostAcceptanceLevel.md",
    "content": "# VMHostAcceptanceLevel\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Level** | Mandatory | AcceptanceLevel | The acceptance level of the VMHost. | VMwareCertified, VMwareAccepted, PartnerSupported, CommunitySupported |\n\n## Description\n\nThe resource is used to modify the acceptance level of the specified VMHost.\n\n## Examples\n\n### Example 1\n\nModifies the VMHost acceptance level by setting it to **CommunitySupported**.\n\n```powershell\nConfiguration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAcceptanceLevel VMHostAcceptanceLevel {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Level = 'CommunitySupported'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostAccount/VMHostAccount.md",
    "content": "# VMHostAccount\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can only be ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Id** | Key | string | Specifies the ID for the host account. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Resource should be Present or Absent. |Present, Absent|\n| **Role** | Mandatory | string | Permission on the VMHost entity is created for the specified User Id with the specified Role. ||\n| **AccountPassword** | Optional | string | Specifies the Password for the host account. ||\n| **Description** | Optional | string | Provides a description for the host account. The maximum length of the text is 255 symbols. ||\n\n## Description\n\nThe resource is used to create, update and delete VMHost Accounts in the specified VMHost we are connected to.\n\n## Examples\n\n### Example 1\n\nCreates a new VMHostAccount in the specified VMHost we are connected to. The Resource also creates new 'Admin' Role Permission for the newly created VMHostAccount.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostAccount_WithAccountToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $Credential\n            Id = 'MyVMHostAccount'\n            Ensure = 'Present'\n            Role = 'Admin'\n            AccountPassword = 'MyAccountPass1!'\n            Description = 'MyVMHostAccount Description'\n        }\n    }\n}\n````\n\n### Example 2\n\nRemoves the VMHost Account in the specified VMHost we are connected to.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostAccount_WithAccountToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $Credential\n            Id = 'MyVMHostAccount'\n            Ensure = 'Absent'\n            Role = 'Admin'\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostAdvancedSettings/VMHostAdvancedSettings.md",
    "content": "# VMHostAdvancedSettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **AdvancedSettings** | Mandatory | hashtable | Hashtable containing the advanced settings of the specified VMHost, where each key-value pair represents one advanced setting - the key is the name of the setting and the value is the desired value for the setting. ||\n\n## Description\n\nThe resource is used to update the Advanced Settings of the specified VMHost. If the hashtable contains an invalid Advanced Setting, it is ignored. Values of type 'System.Int32' are not allowed in the hashtable and need to be cast to 'long'.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation on the values of the Advanced Settings specified in the hashtable.\n\n```powershell\nConfiguration VMHostAdvancedSettings_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAdvancedSettings VMHostAdvancedSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AdvancedSettings = @{\n                'Annotations.WelcomeMessage' = 'Hello from DSC'\n                'BufferCache.FlushInterval' = [long] 20000\n                'BufferCache.HardMaxDirty' = [long] 50\n                'CBRC.Enable' = $true\n                'Cpu.UseMwait' = [long] 1\n                'Config.Etc.issue' = 'Contents of /etc/issue'\n                'Config.HostAgent.plugins.solo.enableMob' = $true\n                'DataMover.MaxHeapSize' = [long] 32\n                'HBR.HbrBitmapVMMaxStorageGB' = [long] 65500\n                'HBR.HbrMinExtentSizeKB' = [long] 4\n                'Misc.WorldletLoadType' = 'low'\n                'VMkernel.Boot.useReliableMem' = $false\n                'Vpx.Vpxa.config.workingDir' = '/var/log/vmware'\n                'UserVars.ProductLockerLocation' = '/locker/packages/vmtoolsRepo/'\n            }\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostAgentVM/VMHostAgentVM.md",
    "content": "# VMHostAgentVM\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **AgentVmDatastore** | Optional | string | The Datastore used for deploying Agent VMs on this VMHost. ||\n| **AgentVmNetwork** | Optional | string | The Management Network used for Agent VMs on this VMHost. ||\n\n## Description\n\nThe resource is used to update the configuration of Agent Virtual Machine resources of the specified VMHost. If the AgentVm settings are not passed or set to $null, the values are cleared on the VMHost. The entire configuration is set each time since all values are overwritten.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation on the configuration of Agent Virtual Machine resources of the specified VMHost by setting the Datastore and Network to $null. The behaviour will be the same if AgentVmDatastore and AgentVmNetwork are not passed at all here. So to clear the values both cases are valid - Not passing them at all or setting them to $null.\n\n```powershell\nConfiguration VMHostAgentVM_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAgentVM VMHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AgentVmDatastore = $null\n            AgentVmNetwork = $null\n        }\n    }\n}\n```\n\n### Example 2\n\nPerforms an Update operation on the configuration of Agent Virtual Machine resources of the specified VMHost by setting the Datastore to 'MyDatastore' and Network to $null.\n\n```powershell\nConfiguration VMHostAgentVM_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAgentVM VMHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AgentVmDatastore = 'MyDatastore'\n            AgentVmNetwork = $null\n        }\n    }\n}\n```\n\n### Example 3\n\nPerforms an Update operation on the configuration of Agent Virtual Machine resources of the specified VMHost by setting the Datastore to $null and Network to 'MyNetwork'.\n\n```powershell\nConfiguration VMHostAgentVM_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAgentVM VMHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AgentVmDatastore = $null\n            AgentVmNetwork = 'MyNetwork'\n        }\n    }\n}\n```\n\n### Example 4\n\nPerforms an Update operation on the configuration of Agent Virtual Machine resources of the specified VMHost by setting the Datastore to 'MyDatastore' and Network to 'MyNetwork'.\n\n```powershell\nConfiguration VMHostAgentVM_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAgentVM VMHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AgentVmDatastore = 'MyDatastore'\n            AgentVmNetwork = 'MyNetwork'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostAuthentication/VMHostAuthentication.md",
    "content": "# VMHostAuthentication\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost which is going to join/leave the specified domain. The name should be the fully qualified domain name (FQDN). ||\n| **DomainName** | Mandatory | string | The name of the domain to join/leave. ||\n| **DomainAction** | Mandatory | DomainAction | Value indicating if the specified VMHost should join/leave the specified domain. | Join, Leave |\n| **DomainCredential** | Optional | PSCredential | The credentials needed for joining the specified domain. ||\n\n## Description\n\nThe resource is used to include/exclude the specified VMHost in/from the specified domain. When the DomainAction is **Leave**, the VMHost is excluded from the specified domain and all existing permissions on the Managed Objects for Active Directory users are deleted without confirmation.\n\n## Examples\n\n### Example 1\n\nIncludes the specified **VMHost** in the specified **domain**.\n\n```powershell\nConfiguration VMHostAuthentication_JoinDomain_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DomainName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $DomainCredential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAuthentication VMHostAuthentication {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DomainName = $DomainName\n            DomainAction = 'Join'\n            DomainCredential = $DomainCredential\n        }\n    }\n}\n```\n\n### Example 2\n\nExcludes the specified **VMHost** from the specified **domain**. All existing permissions on the Managed Objects for Active Directory users are deleted without confirmation.\n\n```powershell\nConfiguration VMHostAuthentication_LeaveDomain_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DomainName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAuthentication VMHostAuthentication {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DomainName = $DomainName\n            DomainAction = 'Leave'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostCache/VMHostCache.md",
    "content": "# VMHostCache\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **DatastoreName** | Key | string | The name of the Datastore used for swap performance enhancement. ||\n| **SwapSizeGB** | Mandatory | double | The space to allocate on the specified Datastore to implement swap performance enhancements, in GB. This value should be less than or equal to the free space capacity of the Datastore. ||\n\n## Description\n\nThe resource is used to Configure the host cache/swap performance enhancement by setting the Space to allocate on the specified SSD based Datastore.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation by setting the Space to allocate on the specified SSD based Datastore to **1 GB**.\n\n```powershell\nConfiguration VMHostCache_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostCache VMHostCache {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            DatastoreName = 'MyDatastore'\n            SwapSizeGB = 1\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostConfiguration/VMHostConfiguration.md",
    "content": "# VMHostConfiguration\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **State** | Optional | VMHostState | The state of the VMHost. If there are powered on VMs on the VMHost, the VMHost can be set into Maintenance mode, only if it is a part of a Drs-enabled Cluster. Before entering Maintenance mode, if the VMHost is fully automated, all powered on VMs are relocated. If the VMHost is not fully automated, a Drs recommendation is generated and all powered on VMs are relocated or powered off. | Connected, Disconnected, Maintenance |\n| **Evacuate** | Optional | bool | If the value is $true, vCenter Server system automatically reregisters the VMs that are compatible for reregistration. If they are not compatible, they remain on the VMHost. The Evacuate property is valid only when the connection is to a vCenter Server system and the State property is **Maintenance**. Also, the VMHost must be in a Drs-enabled Cluster. ||\n| **VsanDataMigrationMode** | Optional | VsanDataMigrationMode | The special action to take regarding Virtual SAN data when moving in Maintenance mode. The VsanDataMigrationMode property is valid only when the connection is to a vCenter Server system and the State property is **Maintenance**. | Full, EnsureAccessibility, NoDataMigration |\n| **LicenseKey** | Optional | string | The license key to be used by the VMHost. You can set the VMHost to evaluation mode by passing the **00000-00000-00000-00000-00000** evaluation key. ||\n| **TimeZoneName** | Optional | string | The name of the Time Zone for the VMHost. ||\n| **VMSwapfileDatastoreName** | Optional | string | The name of the Datastore that is visible to the VMHost and can be used for storing swapfiles for the VMs that run on the VMHost. Using a VMHost-specific swap location might degrade the VMotion performance. ||\n| **VMSwapfilePolicy** | Optional | VMSwapfilePolicy | The swapfile placement policy. | InHostDatastore, WithVM |\n| **HostProfileName** | Optional | string | The name of the host profile associated with the VMHost. If the value is an empty string, the current profile association should not exist. ||\n| **KmsClusterName** | Optional | string | The name of the KmsCluster which is used to generate a key to set the VMHost. If the property is passed and the VMHost is not in CryptoSafe state, the DSC Resource makes the VMHost CryptoSafe. If the property is passed and the VMHost is already in CryptoSafe state, the DSC Resource resets the CryptoKey in the VMHost. ||\n\n## Description\n\nThe resource is used to modify the configuration of the specified VMHost.\n\n## Examples\n\n### Example 1\n\nCreates Vmfs Datastore **MyVmfsDatastore** on the specified VMHost. Sets the VMHost to evaluation mode by passing the **00000-00000-00000-00000-00000** evaluation key. Modifies the Time Zone to be **UTC**, and the VM swapfile settings - uses Datastore **MyVmfsDatastore** for storing the swapfiles and **InHostDatastore** for swapfile placement policy.\n\n```powershell\nConfiguration VMHostConfiguration_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VmfsDatastore VmfsDatastore {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $ScsiLunCanonicalName\n            Ensure = 'Present'\n        }\n\n        VMHostConfiguration VMHostConfiguration {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            LicenseKey = '00000-00000-00000-00000-00000'\n            TimeZoneName = 'UTC'\n            VMSwapfileDatastoreName = 'MyVmfsDatastore'\n            VMSwapfilePolicy = 'InHostDatastore'\n            DependsOn = '[VmfsDatastore]VmfsDatastore'\n        }\n    }\n}\n```\n\n### Example 2\n\nSets the VMHost into **Maintenance** mode. The vCenter Server system automatically reregisters the VMs that are compatible for reregistration. If they are not compatible, they remain on the VMHost. The special action to take regarding Virtual SAN data when moving in **Maintenance** mode is **Full**.\n\n```powershell\nConfiguration VMHostConfiguration_ModifyVMHostState_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostConfiguration VMHostConfiguration {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            State = 'Maintenance'\n            Evacuate = $true\n            VsanDataMigrationMode = 'Full'\n        }\n    }\n}\n```\n\n### Example 3\n\nAssociates the specified Host Profile with the specified VMHost.\n\n```powershell\nConfiguration VMHostConfiguration_ModifyVMHostHostProfileAssociation_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $HostProfileName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostConfiguration VMHostConfiguration {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            HostProfileName = $HostProfileName\n        }\n    }\n}\n```\n\n### Example 4\n\nIf the VMHost is not in **CryptoSafe** state, the DSC Resource makes the VMHost **CryptoSafe**. If the VMHost is already in **CryptoSafe** state, the DSC Resource resets the **CryptoKey** in the VMHost.\n\n```powershell\nConfiguration VMHostConfiguration_ModifyVMHostCryptoKey_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $KmsClusterName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostConfiguration VMHostConfiguration {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            KmsClusterName = $KmsClusterName\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostDCUIKeyboard/VMHostDCUIKeyboard.md",
    "content": "# VMHostDCUIKeyboard\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Layout** | Mandatory | string | The name of the Direct Console User Interface Keyboard Layout. ||\n\n## Description\n\nThe resource is used to modify the Direct Console User Interface Keyboard Layout.\n\n## Examples\n\n### Example 1\n\nModifies the Direct Console User Interface Keyboard Layout to be **US Default**.\n\n```powershell\nConfiguration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostDCUIKeyboard VMHostDCUIKeyboard {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Layout = 'US Default'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostDnsSettings/VMHostDnsSettings.md",
    "content": "# VMHostDnsSettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Address** | Optional | string[] | List of domain name or IP address of the DNS Servers. ||\n| **Dhcp** | Mandatory | bool | Indicates whether DHCP is used to determine DNS configuration. ||\n| **DomainName** | Mandatory | string | Domain Name portion of the DNS name. For example, \"vmware.com\". ||\n| **HostName** | Mandatory | string | Host Name portion of DNS name. For example, \"esx01\". ||\n| **Ipv6VirtualNicDevice** | Optional | string | Desired value for the VMHost DNS Ipv6VirtualNicDevice. ||\n| **SearchDomain** | Optional | string[] | Domain in which to search for hosts, placed in order of preference. ||\n| **VirtualNicDevice** | Optional | string | Desired value for the VMHost DNS VirtualNicDevice. ||\n\n## Description\n\nThe resource is used to configure the DNS Settings of a ESXi host.\n\n## Examples\n\n### Example 1\n\nUpdates the DNS Config of the passed ESXi host.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostDnsSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostDnsSettings vmHostDnsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            HostName = \"esx-server1\"\n            DomainName = \"eng.vmware.com\"\n            Dhcp = $false\n            Address = @(\"10.23.83.229\", \"10.23.108.1\")\n            SearchDomain = @(\"eng.vmware.com\")\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostFirewallRuleset/VMHostFirewallRuleset.md",
    "content": "# VMHostFirewallRuleset\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **Name** | Key | string | The name of the firewall ruleset. ||\n| **Enabled** | Optional | bool | Specifies whether the firewall ruleset should be enabled or disabled. ||\n| **AllIP** | Optional | bool | Specifies whether the firewall ruleset allows connections from any IP address. ||\n| **IPAddresses** | Optional | string[] | The list of IP addresses. All IPv4 addresses are specified using dotted decimal format. For example **192.0.20.10**. IPv6 addresses are 128-bit addresses represented as eight fields of up to four hexadecimal digits. A colon separates each field (**:**). For example **2001:DB8:101::230:6eff:fe04:d9ff**. The address can also consist of symbol **'::'** to represent multiple 16-bit groups of contiguous 0's only once in an address. ||\n\n## Description\n\nThe resource is used to enable/disable the specified firewall ruleset from the VMHost. It also modifies the allowed IP addresses list of the firewall ruleset.\n\n## Examples\n\n### Example 1\n\nEnables the specified VMHost firewall ruleset and modifies the allowed IP addresses list to be: **192.0.20.10**, **192.0.20.11**, **192.0.20.12**, **10.20.120.12/22**, **10.20.120.12/23**, **10.20.120.12/24**.\nAll IPs for the firewall ruleset are **disabled**.\n\n```powershell\nConfiguration VMHostFirewallRuleset_EnableVMHostFirewallRulesetAndModifyTheAllowedIPAddressesList_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostFirewallRulesetName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostFirewallRuleset VMHostFirewallRuleset {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $VMHostFirewallRulesetName\n            Enabled = $true\n            AllIP = $false\n            IPAddresses = @('192.0.20.10', '192.0.20.11', '192.0.20.12', '10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/24')\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostGraphics/VMHostGraphics.md",
    "content": "# VMHostGraphics\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **GraphicsType** | Mandatory | GraphicsType | The default graphics type for the specified VMHost. | Shared, SharedDirect |\n| **SharedPassthruAssignmentPolicy** | Mandatory | SharedPassthruAssignmentPolicy | The policy for assigning shared passthrough VMs to a host graphics device. | Performance, Consolidation |\n| **RestartTimeoutMinutes** | Optional | int | The time in minutes to wait for the VMHost to restart before timing out and aborting the operation. The default value is 5 minutes. ||\n\n## Prerequisite\n\nThe specified VMHost must be in **Maintenance** mode.\n\n## Description\n\nThe resource is used to update the Graphics configuration by changing the DefaultGraphicsType and SharedPassthruAssignmentPolicy values. The resource also restarts the VMHost after a successful Update operation.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation by setting the DefaultGraphicsType to **Shared** and SharedPassthruAssignmentPolicy to **Performance**. After that it restarts the specified VMHost to apply the changes.\n\n```powershell\nConfiguration VMHostGraphics_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostGraphics VMHostGraphics {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            GraphicsType = 'Shared'\n            SharedPassthruAssignmentPolicy = 'Performance'\n            RestartTimeoutMinutes = 10\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostGraphicsDevice/VMHostGraphicsDevice.md",
    "content": "# VMHostGraphicsDevice\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Id** | Key | string | The Graphics device identifier (ex. PCI ID). ||\n| **GraphicsType** | Mandatory | GraphicsType | The graphics type for the specified Device in 'Id' property. | Shared, SharedDirect |\n| **RestartTimeoutMinutes** | Optional | int | The time in minutes to wait for the VMHost to restart before timing out and aborting the operation. The default value is 5 minutes. ||\n\n## Prerequisite\n\nThe specified VMHost must be in **Maintenance** mode.\n\n## Description\n\nThe resource is used to update the Graphics Type of the specified Graphics Device. The resource also restarts the VMHost after a successful Update operation.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation by setting the Graphics Type for the specified device to **SharedDirect**. After that it restarts the specified VMHost to apply the changes.\n\n```powershell\nConfiguration VMHostGraphicsDevice_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostGraphicsDevice VMHostGraphicsDevice {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Id = '0000:00:00.0'\n            GraphicsType = 'SharedDirect'\n            RestartTimeoutMinutes = 10\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostIPRoute/VMHostIPRoute.md",
    "content": "# VMHostIPRoute\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Gateway** | Key | string | The gateway IPv4/IPv6 address of the route. ||\n| **Destination** | Key | string | The destination IPv4/IPv6 address of the route. ||\n| **PrefixLength** | Key | int | The prefix length of the destination IP address. For IPv4, the valid values are from 0 to 32, and for IPv6 - from 0 to 128. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the IPv4/IPv6 route should be present or absent. | Present, Absent |\n\n## Description\n\nThe resource is used to create and remove IPv4/IPv6 routes on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nCreates a new IPv4 route with the specified gateway address and destination address **192.168.100.0/24** on the specified VMHost.\n\n```powershell\nConfiguration VMHostIPRoute_CreateVMHostIPRoute_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DefaultGateway\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIPRoute VMHostIPRoute {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Gateway = $VMHostDefaultGateway\n            Destination = '192.168.100.0'\n            PrefixLength = 24\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the IPv4 route with the specified gateway address and destination address **192.168.100.0/24** from the specified VMHost.\n\n```powershell\nConfiguration VMHostIPRoute_RemoveVMHostIPRoute_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DefaultGateway\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIPRoute VMHostIPRoute {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Gateway = $VMHostDefaultGateway\n            Destination = '192.168.100.0'\n            PrefixLength = 24\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostIScsiHba/VMHostIScsiHba.md",
    "content": "# VMHostIScsiHba\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **Name** | Key | string | The name of the iSCSI Host Bus Adapter. ||\n| **IScsiName** | Optional | string | The name for the VMHost Host Bus Adapter device. ||\n| **ChapType** | Optional | ChapType | The type of the CHAP (Challenge Handshake Authentication Protocol). | Prohibited, Discouraged, Preferred, Required |\n| **ChapName** | Optional | string | The CHAP authentication name. ||\n| **ChapPassword** | Optional | string | The CHAP authentication password. ||\n| **MutualChapEnabled** | Optional | bool | Indicates that Mutual CHAP is enabled. ||\n| **MutualChapName** | Optional | string | The Mutual CHAP authentication name. ||\n| **MutualChapPassword** | Optional | string | The Mutual CHAP authentication password. ||\n| **Force** | Optional | bool | Specifies whether to change the password for CHAP, Mutual CHAP or both. When the property is not specified or its value is **$false**, it is ignored. If the property is **$true** the passwords for CHAP and Mutual CHAP are changed to their desired values. ||\n\n## Description\n\nThe resource is used to modify the CHAP settings and the iSCSI name of the specified iSCSI Host Bus Adapter on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nConfigures the CHAP settings of the specified iSCSI Host Bus Adapter by specifiying the CHAP type as **Required** with CHAP name **AdminOne** and CHAP password **AdminPasswordOne**.\nAlso the Mutual CHAP is enabled with Mutual CHAP name **AdminTwo** and Mutual CHAP password **AdminPasswordTwo**.\n\n```powershell\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $IScsiHbaName\n            ChapType = 'Required'\n            ChapName = 'AdminOne'\n            ChapPassword = 'AdminPasswordOne'\n            MutualChapEnabled = $true\n            MutualChapName = 'AdminTwo'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n    }\n}\n```\n\n### Example 2\n\nConfigures the CHAP settings of the specified iSCSI Host Bus Adapter by specifiying the CHAP type as **Prohibited**.\n\n```powershell\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapType_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $IScsiHbaName\n            ChapType = 'Prohibited'\n        }\n    }\n}\n```\n\n### Example 3\n\nModifies the **iSCSI name** of the specified iSCSI Host Bus Adapter to **iqn.1998-01.com.vmware:esx-server1**.\n\n```powershell\nConfiguration VMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapter_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $IScsiHbaName\n            IScsiName = 'iqn.1998-01.com.vmware:esx-server1'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget.md",
    "content": "# VMHostIScsiHbaTarget\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **Address** | Key | string | The address of the iSCSI Host Bus Adapter target. ||\n| **Port** | Key | int | The TCP port of the iSCSI Host Bus Adapter target. ||\n| **IScsiHbaName** | Key | string | The name of the iSCSI Host Bus Adapter of the iSCSI Host Bus Adapter target. ||\n| **TargetType** | Key | IScsiHbaTargetType | The type of the iSCSI Host Bus Adapter target. | Static, Send |\n| **Ensure** | Mandatory | Ensure | Specifies whether the iSCSI Host Bus Adapter target should be present or absent. | Present, Absent |\n| **IScsiName** | Optional | string | The iSCSI name of the iSCSI Host Bus Adapter target. It is required for Static iSCSI Host Bus Adapter targets. ||\n| **ChapType** | Optional | ChapType | The type of the CHAP (Challenge Handshake Authentication Protocol). | Prohibited, Discouraged, Preferred, Required |\n| **InheritChap** | Optional | bool | Indicates that the CHAP setting is inherited from the iSCSI Host Bus Adapter. ||\n| **ChapName** | Optional | string | The CHAP authentication name. ||\n| **ChapPassword** | Optional | string | The CHAP authentication password. ||\n| **InheritMutualChap** | Optional | bool | Indicates that the Mutual CHAP setting is inherited from the iSCSI Host Bus Adapter. ||\n| **MutualChapEnabled** | Optional | bool | Indicates that Mutual CHAP is enabled. ||\n| **MutualChapName** | Optional | string | The Mutual CHAP authentication name. ||\n| **MutualChapPassword** | Optional | string | The Mutual CHAP authentication password. ||\n| **Force** | Optional | bool | Specifies whether to change the password for CHAP, Mutual CHAP or both. When the property is not specified or its value is **$false**, it is ignored. If the property is **$true** the passwords for CHAP and Mutual CHAP are changed to their desired values. ||\n\n## Description\n\nThe resource is used to create, modify the CHAP settings and remove iSCSI Host Bus Adapter targets from the specified iSCSI Host Bus Adapter.\n\n## Examples\n\n### Example 1\n\nCreates a new iSCSI Host Bus Adapter Send target with address **10.23.84.73** on port **3260** for the specified iSCSI Host Bus Adapter. Also it configures the CHAP settings of the iSCSI Host Bus Adapter target by specifiying the CHAP type as **Required** with CHAP name **AdminOne** and CHAP password **AdminPasswordOne**. The Mutual CHAP is enabled with Mutual CHAP name **AdminTwo** and Mutual CHAP password **AdminPasswordTwo**. CHAP and Mutual CHAP settings are not inherited from the iSCSI Host Bus Adapter.\n\n```powershell\nConfiguration VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHbaTarget VMHostIScsiHbaTarget {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $IScsiHbaName\n            TargetType = 'Send'\n            Ensure = 'Present'\n            InheritChap = $false\n            ChapType = 'Required'\n            ChapName = 'AdminOne'\n            ChapPassword = 'AdminPasswordOne'\n            InheritMutualChap = $false\n            MutualChapEnabled = $true\n            MutualChapName = 'AdminTwo'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n    }\n}\n```\n\n### Example 2\n\nCreates a new iSCSI Host Bus Adapter Static target with address **10.23.84.73** on port **3260** with the specified iSCSI name for the specified iSCSI Host Bus Adapter. CHAP and Mutual CHAP settings are inherited from the iSCSI Host Bus Adapter.\n\n```powershell\nConfiguration VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHbaTarget VMHostIScsiHbaTarget {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $IScsiHbaName\n            TargetType = 'Static'\n            Ensure = 'Present'\n            IScsiName = $IScsiName\n            InheritChap = $true\n            InheritMutualChap = $true\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves the iSCSI Host Bus Adapter Send target with address **10.23.84.73** on port **3260** from the specified iSCSI Host Bus Adapter.\n\n```powershell\nConfiguration VMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterSendTarget_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHbaTarget VMHostIScsiHbaTarget {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $IScsiHbaName\n            TargetType = 'Send'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic.md",
    "content": "# VMHostIScsiHbaVMKernelNic\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **IScsiHbaName** | Key | string | The name of the iSCSI Host Bus Adapter. ||\n| **VMKernelNicNames** | Mandatory | string[] | The names of the VMKernel Network Adapters that should be bound/unbound to/from the specified iSCSI Host Bus Adapter. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VMKernel Network Adapters should be bound/unbound to/from the specified iSCSI Host Bus Adapter. | Present, Absent |\n| **Force** | Optional | bool | Whether to bind VMKernel Network Adapters to iSCSI Host Bus Adapter when VMKernel Network Adapters aren't compatible for iSCSI multipathing. Whether to unbind VMKernel Network Adapters from iSCSI Host Bus Adapter when there're active sessions using the VMKernel Network Adapters. ||\n\n## Description\n\nThe resource is used to bind/unbind VMKernel Network Adapters to/from the specified iSCSI Host Bus Adapter.\n\n## Examples\n\n### Example 1\n\nBinds the specified VMKernel Network Adapters to the specified iSCSI Host Bus Adapter.\n\n```powershell\nConfiguration VMHostIScsiHbaVMKernelNic_BindVMKernelNicsToIscsiHba_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $VMKernelNicNames\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHbaVMKernelNic VMHostIScsiHbaVMKernelNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n            VMKernelNicNames = $VMKernelNicNames\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 2\n\nUnbinds the specified VMKernel Network Adapters from the specified iSCSI Host Bus Adapter.\n\n```powershell\nConfiguration VMHostIScsiHbaVMKernelNic_UnbindVMKernelNicsToIscsiHba_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string[]]\n        $VMKernelNicNames\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostIScsiHbaVMKernelNic VMHostIScsiHbaVMKernelNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n            VMKernelNicNames = $VMKernelNicNames\n            Ensure = 'Absent'\n            Force = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostNetworkCoreDump/VMHostNetworkCoreDump.md",
    "content": "# VMHostNetworkCoreDump\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Enable** | Optional | bool | Specifies whether to enable network coredump. ||\n| **InterfaceName** | Optional | string | The active interface to be used for the network coredump. ||\n| **ServerIp** | Optional | string | The IP address of the coredump server (IPv4 or IPv6). ||\n| **ServerPort** | Optional | long | The port on which the coredump server is listening. ||\n\n## Description\n\nThe resource is used to modify the network coredump configuration of the specified VMHost.\n\n## Examples\n\n### Example 1\n\nModifies the configuration of the network coredump of the VMHost by setting the active interface to be the passed VMKernel Network Adapter, the IP address of the coredump server is **10.11.12.13**\nand the port on which the coredump server is listening is **6500**. It also enables the network coredump.\n\n```powershell\nConfiguration VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostVMKernelNetworkAdapterName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNetworkCoreDump VMHostNetworkCoreDump {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Enable = $true\n            InterfaceName = $VMHostVMKernelNetworkAdapterName\n            ServerIp = '10.11.12.13'\n            ServerPort = 6500\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostNtpSettings/VMHostNtpSettings.md",
    "content": "# VMHostNtpSettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **NtpServer** | Optional | string[] | List of domain name or IP address of the desired NTP Servers. ||\n| **NtpServicePolicy** | Optional | ServicePolicy | Desired Policy of the VMHost 'ntpd' service activation. |Unset, On, Off, Automatic|\n\n## Description\n\nThe resource is used to configure NTP Server property and the Service Policy of the 'ntpd' Service of a ESXi host.\n\n## Examples\n\n### Example 1\n\nUpdates the NTP Server array with the desired values and changes the 'ntpd' Service Policy to 'automatic' of the passed ESXi host.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostNtpSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            NtpServer = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\", \"2.bg.pool.ntp.org\")\n            NtpServicePolicy = \"automatic\"\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostPciPassthrough/VMHostPciPassthrough.md",
    "content": "# VMHostPciPassthrough\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Id** | Key | string | The Id of the PCI Device, composed of \"bus:slot.function\". ||\n| **Enabled** | Mandatory | bool | Value indicating whether passThru has been configured for this device. ||\n| **RestartTimeoutMinutes** | Optional | int | The time in minutes to wait for the VMHost to restart before timing out and aborting the operation. The default value is 5 minutes. ||\n\n## Prerequisite\n\nThe specified VMHost must be in **Maintenance** mode.\n\n## Description\n\nThe resource is used to update the PciPassthru configuration by changing the Passthrough enabled value of the specified PCI Device on the specified VMHost. The resource also restarts the VMHost after a successful Update operation.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation by enabling Passthrough on the specified PCI Device. After that it restarts the specified VMHost to apply the changes.\n\n```powershell\nConfiguration VMHostPciPassthrough_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPciPassthrough VMHostPciPassthrough {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Id = '0000:00:00.0'\n            Enabled = $true\n            RestartTimeoutMinutes = 10\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostPermission/VMHostPermission.md",
    "content": "# VMHostPermission\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be an ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **EntityName** | Key | string | The name of the Entity to which the Permission applies. ||\n| **EntityLocation** | Key | string | The location of the Entity with name specified in **EntityName** key property. Location consists of 0 or more Inventory Items. When the Entity is a **Datacenter**, a **VMHost** or a **Datastore**, the property is ignored. If the Entity is a **Virtual Machine**, a **Resource Pool** or a **vApp** and empty location is passed, the Entity should be located in the Root Resource Pool of the VMHost. Inventory Item names in the location are separated by '/'. Example location for a **Datastore** Inventory Item: ''. Example location for a **Virtual Machine** Inventory Item: 'MyResourcePoolOne/MyResourcePoolTwo/MyvApp'. ||\n| **EntityType** | Key | EntityType | The type of the Entity of the Permission. | Datacenter, VMHost, Datastore, VM, ResourcePool, VApp |\n| **PrincipalName** | Key | string | The name of the User to which the Permission applies. If the User is a **Domain User**, the Principal name should be in one of the following formats: `<Domain Name>`/`<User name>` or `<User name>`@`<Domain Name>`. Example Principal name for Domain User: **MyDomain/MyDomainUser** or **MyDomainUser@MyDomain**. ||\n| **RoleName** | Key | string | The name of the Role to which the Permission applies. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Permission should be present or absent. | Present, Absent |\n| **Propagate** | Optional | bool | Specifies whether to propagate the Permission to the child Inventory Items. ||\n\n## Description\n\nThe resource is used to create, modify and remove Permissions for the specified Entity, Principal and Role on the specified VMHost. If the **Propagate** property is not specified, the Permission is propagated to the child Inventory Items of the specified Entity.\n\n## Examples\n\n### Example 1\n\nCreates or modifies the Permission for Datacenter Entity **ha-datacenter**, Principal **MyDscPrincipal** and Role **MyDscRole** on the specified VMHost. The Permission is propagated to the child Inventory Items of Datacenter Entity **ha-datacenter**.\n\n```powershell\nConfiguration VMHostPermission_CreateVMHostPermissionForDatacenterEntity_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPermission VMHostPermission {\n            Server = $Server\n            Credential = $Credential\n            EntityName = 'ha-datacenter'\n            EntityLocation = ''\n            EntityType = 'Datacenter'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n            Propagate = $true\n        }\n    }\n}\n```\n\n### Example 2\n\nCreates or modifies the Permission for VMHost Entity, Principal **MyDscPrincipal** and Role **MyDscRole** on the specified VMHost. The Permission is not propagated to the child Inventory Items of VMHost Entity.\n\n```powershell\nConfiguration VMHostPermission_CreateVMHostPermissionForVMHostEntity_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPermission VMHostPermission {\n            Server = $Server\n            Credential = $Credential\n            EntityName = $Server\n            EntityLocation = ''\n            EntityType = 'VMHost'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n            Propagate = $false\n        }\n    }\n}\n```\n\n### Example 3\n\nCreates or modifies the Permission for Datastore Entity **MyDscDatastore**, Principal **MyDscPrincipal** and Role **MyDscRole** on the specified VMHost.\n\n```powershell\nConfiguration VMHostPermission_CreateVMHostPermissionForDatastoreEntity_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPermission VMHostPermission {\n            Server = $Server\n            Credential = $Credential\n            EntityName = 'MyDscDatastore'\n            EntityLocation = ''\n            EntityType = 'Datastore'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 4\n\nCreates or modifies the Permission for Resource Pool Entity **MyDscResourcePool**, Principal **MyDscPrincipal** and Role **MyDscRole** on the specified VMHost. The Resource Pool Entity **MyDscResourcePool** is located in the Root Resource Pool of the specified VMHost.\n\n```powershell\nConfiguration VMHostPermission_CreateVMHostPermissionForResourcePoolEntity_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPermission VMHostPermission {\n            Server = $Server\n            Credential = $Credential\n            EntityName = 'MyDscResourcePool'\n            EntityLocation = ''\n            EntityType = 'ResourcePool'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 5\n\nCreates or modifies the Permission for Virtual Machine Entity **MyDscVM**, Principal **MyDscPrincipal** and Role **MyDscRole** on the specified VMHost. The Virtual Machine Entity **MyDscVM** is located in the **MyDscvApp** vApp which is located in **MyDscResourcePool** Resource Pool of the specified VMHost.\n\n```powershell\nConfiguration VMHostPermission_CreateVMHostPermissionForVMEntity_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPermission VMHostPermission {\n            Server = $Server\n            Credential = $Credential\n            EntityName = 'MyDscVM'\n            EntityLocation = 'MyDscResourcePool/MyDscvApp'\n            EntityType = 'VM'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 6\n\nRemoves the Permission for Virtual Machine Entity **MyDscVM**, Principal **MyDscPrincipal** and Role **MyDscRole** from the specified VMHost.\n\n```powershell\nConfiguration VMHostPermission_RemoveVMHostPermission_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPermission VMHostPermission {\n            Server = $Server\n            Credential = $Credential\n            EntityName = 'MyDscVM'\n            EntityLocation = 'MyDscResourcePool/MyDscvApp'\n            EntityType = 'VM'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostPhysicalNic/VMHostPhysicalNic.md",
    "content": "# VMHostPhysicalNic\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The Name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The Name of the Physical Network Adapter which is going to be configured. ||\n| **Duplex** | Optional | Duplex | Indicates whether the link is capable of full-duplex. | Full, Half, Unset |\n| **BitRatePerSecMb** | Optional | int | Specifies the bit rate of the link. ||\n| **AutoNegotiate** | Optional | bool | Indicates that the host network adapter speed/duplex settings are configured automatically. If the property is passed, the Duplex and BitRatePerSecMb properties will be ignored. ||\n\n## Description\n\nThe resource is used to update the speed and duplex settings of the specified Physical Network Adapter.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation on Physical Network Adapter **vmnic0** by setting the **BitRatePerSec** to **1000 Mb** and the **Duplex** to **Full**.\n\n```powershell\nConfiguration VMHostPhysicalNic_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPhysicalNic VMHostPhysicalNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'vmnic0'\n            Duplex = 'Full'\n            BitRatePerSecMb = 1000\n        }\n    }\n}\n```\n\n### Example 2\n\nPerforms an Update operation on Physical Network Adapter **vmnic0** by automatically configuring the **Duplex** and **Speed** settings.\n\n```powershell\nConfiguration VMHostPhysicalNic_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPhysicalNic VMHostPhysicalNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'vmnic0'\n            AutoNegotiate = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostPowerPolicy/VMHostPowerPolicy.md",
    "content": "# VMHostPowerPolicy\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **PowerPolicy** | Mandatory | PowerPolicy | The Power Management Policy for the specified VMHost. | HighPerformance, Balanced, LowPower, Custom |\n\n## Description\n\nThe resource is used to update the Power Management Policy of the specified VMHost.\n\n## Examples\n\n### Example 1\n\nPerforms an Update operation by setting the Power Management Policy of the specified VMHost to **Balanced**.\n\n```powershell\nConfiguration VMHostPowerPolicy_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostPowerPolicy VMHostPowerPolicy {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            PowerPolicy = 'Balanced'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostRole/VMHostRole.md",
    "content": "# VMHostRole\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be an ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the Role on the VMHost. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Role on the VMHost should be present or absent. | Present, Absent |\n| **PrivilegeIds** | Optional | string[] | The ids of the Privileges for the Role on the VMHost. The Privilege ids should be in the following format: `<Privilege Group id>`.`<Privilege Item id>`. Exampe Privilege id: 'VirtualMachine.Inventory.Create' where 'VirtualMachine.Inventory' is the Privilege Group id and 'Create' is the id of the Privilege item. ||\n\n## Description\n\nThe resource is used to create, modify and remove Roles on the specified VMHost. If Ensure is **Absent**, all Permissions associated with the Role will be removed as well.\n\n## Examples\n\n### Example 1\n\nCreates or modifies Role **MyDscRole** on the specified VMHost. The applied Privileges of Role **MyDscRole** should be: **Host.Inventory.AddStandaloneHost**, **Host.Inventory.CreateCluster**, **Host.Inventory.MoveHost**, **System.Anonymous**, **System.Read** and **System.View**.\n\n```powershell\nConfiguration VMHostRole_CreateRoleWithPrivileges_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostRole VMHostRole {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDscRole'\n            Ensure = 'Present'\n            PrivilegeIds = @(\n                'Host.Inventory.AddStandaloneHost',\n                'Host.Inventory.CreateCluster',\n                'Host.Inventory.MoveHost',\n                'System.Anonymous',\n                'System.Read',\n                'System.View'\n            )\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves Role **MyDscRole** from the specified VMHost. All Permissions associated with Role **MyDscRole** will be removed as well.\n\n```powershell\nConfiguration VMHostRole_RemoveRole_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostRole VMHostRole {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDscRole'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostSNMPAgent/VMHostSNMPAgent.md",
    "content": "# VMHostSNMPAgent\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Authentication** | Optional | string | The default authentication protocol. | MD5, SHA1, none |\n| **Communities** | Optional | string | Specifies up to ten communities each no more than 64 characters. Format is: **community1[,community2,...]**. This overwrites previous settings. ||\n| **Enable** | Optional | bool | Specifies whether to start or stop the SNMP service. ||\n| **EngineId** | Optional | string | The SNMPv3 engine id. Must be between 10 and 32 hexadecimal characters. 0x or 0X are stripped if found as well as colons (:). ||\n| **Hwsrc** | Optional | string | Specifies where to source hardware events - IPMI sensors or CIM Indications. | indications, sensors |\n| **LargeStorage** | Optional | bool | Specifies whether to support large storage for **hrStorageAllocationUnits** * **hrStorageSize**. Controls how the agent reports **hrStorageAllocationUnits**, **hrStorageSize** and **hrStorageUsed** in **hrStorageTable**. Setting this directive to **$true** to support large storage with small allocation units, the agent re-calculates these values so they all fit into **int** and **hrStorageAllocationUnits** * **hrStorageSize** gives real size of the storage. Setting this directive to **$false** turns off this calculation and the agent reports real **hrStorageAllocationUnits**, but it might report wrong **hrStorageSize** for large storage because the value won't fit into **int**. ||\n| **LogLevel** | Optional | string | The SNMP agent syslog logging level. | debug, info, warning, error |\n| **NoTraps** | Optional | string | Specifies a comma separated list of trap oids for traps not to be sent by the SNMP agent. Use the property **reset** to clear this setting. ||\n| **Port** | Optional | long | The UDP port to poll SNMP agent on. The default is **udp/161**. May not use ports 32768 to 40959. ||\n| **Privacy** | Optional | string | The default privacy protocol. | AES128, none |\n| **RemoteUsers** | Optional | string | Specifies up to five inform user ids. Format is: **user/auth-proto/-\\|auth-hash/priv-proto/-\\|priv-hash/engine-id[,...]**, where user is 32 chars max. **auth-proto** is **none**, **MD5** or **SHA1**, **priv-proto** is **none** or **AES**. '-' indicates no hash. **engine-id** is hex string '0x0-9a-f' up to 32 chars max. ||\n| **SysContact** | Optional | string | The System contact as presented in **sysContact.0**. Up to 255 characters. ||\n| **SysLocation** | Optional | string | The System location as presented in **sysLocation.0**. Up to 255 characters. ||\n| **Targets** | Optional | string | Specifies up to three targets to send SNMPv1 traps to. Format is: **ip-or-hostname[@port]/community[,...]**. The default port is **udp/162**. ||\n| **Users** | Optional | string | Specifies up to five local users. Format is: **user/-\\|auth-hash/-\\|priv-hash/model[,...]**, where user is 32 chars max. '-' indicates no hash. Model is one of **none**, **auth** or **priv**. ||\n| **V3Targets** | Optional | string | Specifies up to three SNMPv3 notification targets. Format is: **ip-or-hostname[@port]/remote-user/security-level/trap\\|inform[,...]**. ||\n| **Reset** | Optional | bool | Specifies whether to return SNMP agent configuration to factory defaults. ||\n\n## Description\n\nThe resource is used to modify the SNMP agent configuration on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nModifies the configuration of the SNMP agent of the VMHost by setting the authentication protocol to **SHA1**, the privacy protocol to **AES128**, the log level to **info** and the UDP port to poll SNMP agent on to **161**. It also starts the SNMP service, **CIM Indications** to source hardware events from and supports large storage.\n\n```powershell\nConfiguration VMHostSNMPAgent_ModifyVMHostSNMPAgentConfiguration_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSNMPAgent VMHostSNMPAgent {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Authentication = 'SHA1'\n            Enable = $true\n            Hwsrc = 'indications'\n            LargeStorage = $true\n            LogLevel = 'info'\n            Port = 161\n            Privacy = 'AES128'\n        }\n    }\n}\n```\n\n### Example 2\n\nReturns the SNMP agent configuration on the VMHost to factory defaults.\n\n```powershell\nConfiguration VMHostSNMPAgent_ResetVMHostSNMPAgentConfiguration_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSNMPAgent VMHostSNMPAgent {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Reset = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostSatpClaimRule/VMHostSatpClaimRule.md",
    "content": "# VMHostSatpClaimRule\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the SATP Claim Rule should be Present or Absent. |Present, Absent|\n| **RuleName** | Key | string | Name of the SATP Claim Rule. ||\n| **PSPOptions** | Optional | string | PSP options for the SATP Claim Rule. ||\n| **Transport** | Optional | string | Transport Property of the Satp Claim Rule. ||\n| **Description** | Optional | string | Description string to set when adding the SATP Claim Rule. ||\n| **Vendor** | Optional | string | Vendor string to set when adding the SATP Claim Rule. ||\n| **Boot** | Optional | bool | System default rule added at boot time. ||\n| **Type** | Optional | string | Claim type for the SATP Claim Rule. ||\n| **Device** | Optional | string | Device of the SATP Claim Rule. ||\n| **Driver** | Optional | string | Driver string for the SATP Claim Rule. ||\n| **ClaimOptions** | Optional | string | Claim option string for the SATP Claim Rule. ||\n| **Psp** | Optional | string | Default PSP for the SATP Claim Rule. ||\n| **Options** | Optional | string | Option string for the SATP Claim Rule. ||\n| **Model** | Optional | string | Model string for the SATP Claim Rule. ||\n| **Force** | Optional | bool | Value, which ignores validity checks and install the rule anyway. ||\n\n## Description\n\nThe resource is used to create or remove SATP Claim Rules of a ESXi host.\n\n## Examples\n\n### Example 1\n\nCreates new SATP Claim Rule for the passed ESXi host.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSatpClaimRule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSatpClaimRule vmHostSatpClaimRule {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = \"Present\"\n            RuleName = \"VMW_SATP_LOCAL\"\n            Transport = \"VMW_SATP_LOCAL Transport\"\n            Description = \"Description of VMW_SATP_LOCAL Claim Rule.\"\n            Type = \"transport\"\n            Psp = \"VMW_PSP_MRU\"\n        }\n    }\n}\n````\n\n### Example 2\n\nRemoves SATP Claim Rule for the passed ESXi host.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSatpClaimRule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSatpClaimRule vmHostSatpClaimRule {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = \"Absent\"\n            RuleName = \"VMW_SATP_LOCAL\"\n            Transport = \"VMW_SATP_LOCAL Transport\"\n            Description = \"Description of VMW_SATP_LOCAL Claim Rule.\"\n            Type = \"transport\"\n            Psp = \"VMW_PSP_MRU\"\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostScsiLun/VMHostScsiLun.md",
    "content": "# VMHostScsiLun\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **CanonicalName** | Key | string | The canonical name of the SCSI device. An example of a SCSI canonical name is **vmhba0:0:0:0**. ||\n| **MultipathPolicy** | Optional | MultipathPolicy | The policy that the Lun must use when choosing a path. **Fixed** - uses the preferred SCSI Lun path whenever possible. **RoundRobin** - load balance. **MostRecentlyUsed** - uses the most recently used SCSI Lun path. | Fixed, RoundRobin, MostRecentlyUsed, Unknown |\n| **PreferredScsiLunPathName** | Optional | string | The name of the preferred SCSI Lun path to access the SCSI Lun. ||\n| **BlocksToSwitchPath** | Optional | int | The maximum number of I/O blocks to be issued on a given path before the system tries to select a different path. Modifying this setting affects all SCSI Lun devices that are connected to the same VMHost. The default value is **2048**. Setting this parameter to **zero (0)** disables switching based on blocks. ||\n| **CommandsToSwitchPath** | Optional | int | The maximum number of I/O requests to be issued on a given path before the system tries to select a different path. Modifying this setting affects all SCSI Lun devices that are connected to the same VMHost. The default value is **50**. Setting this parameter to **zero (0)** disables switching based on commands. This parameter is not supported on vCenter Server **4.x.** ||\n| **DeletePartitions** | Optional | bool | Specifies whether to remove all partitions from the SCSI disk. ||\n| **IsLocal** | Optional | bool | Marks the SCSI disk as **local** or **remote**. If the value is **$true**, the SCSI disk is local. If the value is **$false**, the SCSI disk is remote. ||\n| **IsSsd** | Optional | bool | Marks the SCSI disk as an **SSD** or **HDD**. If the value is **$true**, the SCSI disk is **SSD** type. If the value is **$false**, the SCSI disk is **HDD** type. ||\n\n## Description\n\nThe resource is used to modify the configuration of the specified SCSI Lun on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nModifies the configuration of the specified SCSI device by changing the Multipath policy to **RoundRobin**, the maximum number of I/O blocks to be issued on a given path to **2048**, the maximum number of I/O requests to be issued on a given path to **50**. The SCSI disk is marked as **local** and **SSD**.\n\n```powershell\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostScsiLun VMHostScsiLun {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            CanonicalName = $ScsiLunCanonicalName\n            MultipathPolicy = 'RoundRobin'\n            BlocksToSwitchPath = 2048\n            CommandsToSwitchPath = 50\n            IsLocal = $true\n            IsSsd = $true\n        }\n    }\n}\n```\n\n### Example 2\n\nModifies the configuration of the specified SCSI device by changing the Multipath policy to **Fixed** and setting the preferred SCSI Lun path to access the SCSI Lun to be the specified SCSI Lun path.\n\n```powershell\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunPathName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostScsiLun VMHostScsiLun {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            CanonicalName = $ScsiLunCanonicalName\n            MultipathPolicy = 'Fixed'\n            PreferredScsiLunPathName = $ScsiLunPathName\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves all partitions from the specified SCSI disk.\n\n```powershell\nConfiguration VMHostScsiLun_RemoveScsiDiskPartitions_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostScsiLun VMHostScsiLun {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            CanonicalName = $ScsiLunCanonicalName\n            DeletePartitions = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostScsiLunPath/VMHostScsiLunPath.md",
    "content": "# VMHostScsiLunPath\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **Name** | Key | string | The name of the SCSI Lun path to the specified SCSI device in **ScsiLunCanonicalName** key property. ||\n| **ScsiLunCanonicalName** | Key | string | The canonical name of the SCSI device for the specified SCSI Lun path in **Name** key property. ||\n| **Active** | Optional | bool | Specifies whether the SCSI Lun path should be active. ||\n| **Preferred** | Optional | bool | Specifies whether the SCSI Lun path should be preferred. Only one SCSI Lun path can be preferred, so when a SCSI Lun path is made preferred, the preference is removed from the previously preferred SCSI Lun path. ||\n\n## Description\n\nThe resource is used to configure the specified SCSI Lun path to the specified SCSI device on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nConfigures the specified SCSI Lun path to the specified SCSI device to be **Active** and **Preferred**.\n\n```powershell\nConfiguration VMHostScsiLunPath_ConfigureScsiLunPathToBeActiveAndPreferred_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunPathName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostScsiLunPath VMHostScsiLunPath {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $ScsiLunPathName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n            Active = $true\n            Preferred = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostService/VMHostService.md",
    "content": "# VMHostService\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Key** | Key | string | The key value of the service. ||\n| **Policy** | Optional | ServicePolicy | The state of the service after a VMHost reboot. |Unset, On, Off, Automatic|\n| **Running** | Optional | bool | The current state of the service. ||\n\n## Description\n\nThe resource is used to configure the host services on an ESXi host.\n\n## Examples\n\n### Example 1\n\nUpdates the Policy and Running state of the SSH service on the passed ESXi host.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostService_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostService vmHostService {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Key = 'TSM-SSH'\n            Policy = 'On'\n            Running = $true\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostSettings/VMHostSettings.md",
    "content": "# VMHostSettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Motd** | Optional | string | Motd Advanced Setting value. ||\n| **MotdClear** | Optional | bool | Indicates whether the Motd content should be cleared. ||\n| **Issue** | Optional | string | Issue Advanced Setting value. ||\n| **IssueClear** | Optional | bool | Indicates whether the Issue content should be cleared. ||\n\n## Description\n\nThe resource is used to Update Motd Setting and Issue Setting of the passed ESXi host.\n\n## Examples\n\n### Example 1\n\nUpdates the Motd Setting and Issue Setting of the passed ESXi host.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSettings vmHostSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Motd = 'Hello World from motd!'\n            Issue = 'Hello World from issue!'\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostSharedSwapSpace/VMHostSharedSwapSpace.md",
    "content": "# VMHostSharedSwapSpace\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **DatastoreEnabled** | Optional | bool | Specifies if the Datastore option should be enabled or not. ||\n| **DatastoreName** | Optional | string | The name of the Datastore used by the Datastore option. ||\n| **DatastoreOrder** | Optional | long | The order of the Datastore option in the preference of the options of the system-wide shared swap space. ||\n| **HostCacheEnabled** | Optional | bool | Specifies if the host cache option should be enabled or not. ||\n| **HostCacheOrder** | Optional | long | The order of the host cache option in the preference of the options of the system-wide shared swap space. ||\n| **HostLocalSwapEnabled** | Optional | bool | Specifies if the host local swap option should be enabled or not. ||\n| **HostLocalSwapOrder** | Optional | long | The order of the host local swap option in the preference of the options of the system-wide shared swap space. ||\n\n## Description\n\nThe resource is used to modify the configuration of system-wide shared swap space on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nEnables the Datastore option and uses the Datastore with the specified name. Disables the host cache option. Disabled the host local swap option. The preference of the options is: 0. host local swap option, 1. Datastore option, 2. host cache option.\n\n```powershell\nConfiguration VMHostSharedSwapSpace_ModifySharedSwapSpaceConfiguration_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [[Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DatastoreName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSharedSwapSpace VMHostSharedSwapSpace {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DatastoreEnabled = $true\n            DatastoreName = $DatastoreName\n            DatastoreOrder = 1\n            HostCacheEnabled = $false\n            HostCacheOrder = 2\n            HostLocalSwapEnabled = $false\n            HostLocalSwapOrder = 0\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostSoftwareDevice/VMHostSoftwareDevice.md",
    "content": "# VMHostSoftwareDevice\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **DeviceIdentifier** | Key | string | The device identifier from the device specification for the software device driver. Valid input is in reverse domain name format (e.g. com.company.device...). ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the software device should be present or absent. | Present, Absent |\n| **InstanceAddress** | Optional | long | Specifies the unique number to address this instance of the device, if multiple instances of the same device identifier are added. Valid values are integer in the range 0-31. Default is 0. ||\n\n## Description\n\nThe resource is used to add a device to enable a software device driver or to remove a software device on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nAdds the device with the specified id to enable the software device driver. **0** is used to address this instance of the device.\n\n```powershell\nConfiguration VMHostSoftwareDevice_AddSoftwareDevice_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DeviceId\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSoftwareDevice VMHostSoftwareDevice {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DeviceIdentifier = $DeviceId\n            Ensure = 'Present'\n            InstanceAddress = 0\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the software device with the specified id.\n\n```powershell\nConfiguration VMHostSoftwareDevice_RemoveSoftwareDevice_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DeviceId\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSoftwareDevice VMHostSoftwareDevice {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DeviceIdentifier = $DeviceId\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostStorage/VMHostStorage.md",
    "content": "# VMHostStorage\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Enabled** | Mandatory | bool | Whether the software iSCSI is enabled on the VMHost storage. ||\n\n## Description\n\nThe resource is used to enable or disable the software iSCSI support for the specified VMHost.\n\n## Examples\n\n### Example 1\n\nEnables the software iSCSI for the specified VMHost.\n\n```powershell\nConfiguration VMHostStorage_EnableSoftwareIscsi_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostStorage VMHostStorage {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Enabled = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostSyslog/VMHostSyslog.md",
    "content": "# VMHostSyslog\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **LogHost** | Optional | string | The remote host(s) to send logs to. ||\n| **CheckSslCerts** | Optional | bool | Verify remote SSL certificates against the local CA Store. ||\n| **DefaultTimeout** | Optional | long | Default network retry timeout in seconds if a remote server fails to respond. ||\n| **QueueDropMark** | Optional | long | Message queue capacity after which messages are dropped. ||\n| **LogDir** | Optional | string | The directory to output local logs to. ||\n| **LogDirUnique** | Optional | bool | Place logs in a unique subdirectory of logdir, based on hostname. ||\n| **DefaultRotate** | Optional | long | Default number of rotated local logs to keep. ||\n| **DefaultSize** | Optional | long | Default size of local logs before rotation, in KiB. ||\n| **DropLogRotate** | Optional | long | Number of rotated dropped log files to keep. ||\n| **DropLogSize** | Optional | long | Size of dropped log file before rotation, in KiB. ||\n\n## Description\n\nThe resource is used to configure the syslog settings on an ESXi node.\n\n## Examples\n\n### Example 1\n\nUpdates the syslog settings of the passed ESXi host.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSyslog_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSyslog vmHostSyslog {\n            Name           = $Name\n            Server         = $Server\n            Credential     = $Credential\n            Loghost        = 'udp:://syslog.domain:514' # RemoteHost\n            CheckSslCerts  = $true                      # EnforceSSLCertificates\n            DefaultRotate  = 10                         # LocalLoggingDefaultRotations\n            DefaultSize    = 100                        # LocalLoggingDefaultRotationSize\n            DefaultTimeout = 180                        # DefaultNetworkRetryTimeout\n            Logdir         = '/scratch/log'             # LocalLogOutput\n            LogdirUnique   = $false                     # LogToUniqueSubdirectory\n            DropLogRotate  = 8                          # DroppedLogFileRotations\n            DropLogSize    = 50                         # DroppedLogFileRotationSize\n            QueueDropMark  = 90                         # MessageQueueDropMark\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostTpsSettings/VMHostTpsSettings.md",
    "content": "# VMHostTpsSettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **ShareScanTime** | Optional | int | Share Scan Time Advanced Setting value. ||\n| **ShareScanGHz** | Optional | int | Share Scan GHz Advanced Setting value. ||\n| **ShareRateMax** | Optional | int | Share Rate Max Advanced Setting value. ||\n| **ShareForceSalting** | Optional | int | Share Force Salting Advanced Setting value. ||\n\n## Description\n\nThe resource is used to configure TPS Settings of a ESXi host.\n\n## Examples\n\n### Example 1\n\nUpdates the ShareScanTime and ShareForceSalting Advanced Settings values of the passed ESXi host.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostTpsSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostTpsSettings vmHostTpsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            ShareScanTime = 50\n            ShareForceSalting = 1\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVDSwitchMigration/VMHostVDSwitchMigration.md",
    "content": "# VMHostVDSwitchMigration\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **VdsName** | Key | string | The name of the vSphere Distributed Switch to which the VMHost and its Network should be part of. VMHost Network consists of the passed Physical Network Adapters, VMKernel Network Adapters and Port Groups. ||\n| **PhysicalNicNames** | Mandatory | string[] | The names of the Physical Network Adapters that should be part of the vSphere Distributed Switch. ||\n| **VMKernelNicNames** | Optional | string[] | The names of the VMKernel Network Adapters that should be part of the vSphere Distributed Switch. ||\n| **PortGroupNames** | Optional | string[] | The names of the Port Groups to which the specified VMKernel Network Adapters should be attached. Accepts either one Port Group or the same number of Port Groups as the number of VMKernel Network Adapters specified. If one Port Group is specified, all Adapters are attached to that Port Group. If the same number of Port Groups as the number of VMKernel Network Adapters are specified, the first Adapter is attached to the first Port Group, the second Adapter to the second Port Group, and so on. ||\n| **MigratePhysicalNicsOnly** | Optional | bool | Specifies whether the user wants to migrate only the Physical Network Adapters when no VMKernel Network Adapters are specified. Migrating a Physical Network Adapter that takes care of the Management traffic without a VMKernel Network Adapter could result in an ESXi network connectivity loss. ||\n\n## Description\n\nThe resource is used to migrate Physical Network Adapters and VMKernel Network Adapters attached to the specified Port Groups to the specified vSphere Distributed Switch. If the specified VMHost is not part of the vSphere Distributed Switch, the DSC Resource takes care to add it before performing the migration process. If the specified Port Groups are not present on the vSphere Distributed Switch, they are created before performing the migration process.\n\n## Examples\n\n### Example 1\n\nMigrates Physical Network Adapters **vmnic0** and **vmnic1** to vSphere Distributed Switch **MyVDSwitch**. The **MigratePhysicalNicsOnly** parameter is specified to ensure that the user allows the migration to occur without passing any VMKernel Network Adapters which can result in an ESXi network connectivity loss.\n\n```powershell\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNics_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            MigratePhysicalNicsOnly = $true\n        }\n    }\n}\n```\n\n### Example 2\n\nMigrates Physical Network Adapters **vmnic0** and **vmnic1** to vSphere Distributed Switch **MyVDSwitch**. Migrates VMKernel Network Adapters **vmk0** and **vmk1** to vSphere Distributed Switch **MyVDSwitch** and attaches them to Port Group **Management Network**.\n\n```powershell\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToTheSamePortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n            PortGroupNames = @('Management Network')\n        }\n    }\n}\n```\n\n### Example 3\n\nMigrates Physical Network Adapters **vmnic0** and **vmnic1** to vSphere Distributed Switch **MyVDSwitch**. Migrates VMKernel Network Adapters **vmk0** and **vmk1** to vSphere Distributed Switch **MyVDSwitch** and attaches them to Port Groups **Management Network** and **VM Network** respectively.\n\n```powershell\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToDifferentPortGroups_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n            PortGroupNames = @('Management Network', 'VM Network')\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVMKernelActiveDumpFile/VMHostVMKernelActiveDumpFile.md",
    "content": "# VMHostVMKernelActiveDumpFile\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Enable** | Optional | bool | Specifies whether the VMKernel dump file should be enabled or disabled. ||\n| **Smart** | Optional | bool | Specifies whether to select the best available file using the smart selection algorithm. Can only be used when **Enabled** property is specified with **$true** value. ||\n\n## Description\n\nThe resource is used to enable and disable the VMKernel dump file on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nEnables the VMKernel dump file on the specified VMHost by selecting the best available file using the smart selection algorithm.\n\n```powershell\nConfiguration VMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVMKernelActiveDumpFile VMHostVMKernelActiveDumpFile {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Enable = $true\n            Smart = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVMKernelActiveDumpPartition/VMHostVMKernelActiveDumpPartition.md",
    "content": "# VMHostVMKernelActiveDumpPartition\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Enable** | Optional | bool | Specifies whether the VMKernel dump partition should be enabled or disabled. ||\n| **Smart** | Optional | bool | Specifies whether to select the best available partition using the smart selection algorithm. Can only be used when **Enabled** property is specified with **$true** value. ||\n\n## Description\n\nThe resource is used to enable and disable the VMKernel dump partition on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nEnables the VMKernel dump partition on the specified VMHost by selecting the best available partition using the smart selection algorithm.\n\n```powershell\nConfiguration VMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVMKernelActiveDumpPartition VMHostVMKernelActiveDumpPartition {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Enable = $true\n            Smart = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile.md",
    "content": "# VMHostVMKernelDumpFile\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **DatastoreName** | Key | string | The name of the datastore for the dump file. ||\n| **FileName** | Key | string | The file name of the dump file. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the VMKernel dump Vmfs file should be present or absent. ||\n| **Size** | Optional | long | The size in MB of the dump file. If not provided, a default size for the current machine is calculated. ||\n| **Force** | Optional | bool | Specifies whether to deactivate and unconfigure the dump file being removed. This option is required if the file is active. ||\n\n## Description\n\nThe resource is used to create and remove VMKernel dump files on the specified Datastore on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nCreates VMKernel dump file **MyDumpFile** with size **1181 MB** on Datastore **MyDatastore** on the specified VMHost.\n\n```powershell\nConfiguration VMHostVMKernelDumpFile_CreateVMKernelDumpFile_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVMKernelDumpFile VMHostVMKernelDumpFile {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DatastoreName = 'MyDatastore'\n            FileName = 'MyDumpFile'\n            Size = 1181\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the VMKernel dump file **MyDumpFile** on Datastore **MyDatastore** on the specified VMHost.\n\n```powershell\nConfiguration VMHostVMKernelDumpFile_RemoveVMKernelDumpFile_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVMKernelDumpFile VMHostVMKernelDumpFile {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DatastoreName = 'MyDatastore'\n            FileName = 'MyDumpFile'\n            Ensure = 'Absent'\n            Force = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVMKernelModule/VMHostVMKernelModule.md",
    "content": "# VMHostVMKernelModule\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Module** | Key | string | The name of the VMKernel module. ||\n| **Enabled** | Mandatory | bool | Specifies whether the module should be enabled or disabled. ||\n| **Force** | Optional | bool | Specifies whether to skip the VMkernel module validity checks. ||\n\n## Description\n\nThe resource is used to enable and disable the specified VMKernel module on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nEnables the specified VMKernel module on the specified VMHost and skips the module validity checks.\n\n```powershell\nConfiguration VMHostVMKernelModule_EnableVMKernelModule_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMKernelModule\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVMKernelModule VMHostVMKernelModule {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            Module = $VMKernelModule\n            Enabled = $true\n            Force = $true\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVdsNic/VMHostVdsNic.md",
    "content": "# VMHostVdsNic\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMKernel NIC connected to the specified Distributed Port Group on the specified VDSwitch. ||\n| **VMHostName** | Key | string | The name of the VMHost. ||\n| **VdsName** | Key | string | The name of the VDSwitch to which the VMKernel NIC is added. ||\n| **PortGroupName** | Key | string | The name of the Distributed Port Group to which the VMKernel NIC is connected. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the VMKernel NIC should be present or absent. | Present, Absent |\n| **Dhcp** | Optional | bool | Specifies whether the VMKernel NIC uses a Dhcp server. ||\n| **IP** | Optional | string | The IP address for the VMKernel NIC. All IP addresses are specified using IPv4 dot notation. If IP is not specified, DHCP mode is enabled. ||\n| **SubnetMask** | Optional | string | The Subnet Mask for the VMKernel NIC. ||\n| **Mac** | Optional | string | The media access control (MAC) address for the VMKernel NIC. ||\n| **AutomaticIPv6** | Optional | bool | Indicates that the IPv6 address is obtained through a router advertisement. ||\n| **IPv6** | Optional | string[] | Specifies multiple static addresses using the following format: `<IPv6>`/<subnet_prefix_length> or `<IPv6>`. If you skip <subnet_prefix_length>, the default value of 64 is used. ||\n| **IPv6ThroughDhcp** | Optional | bool | Indicates that the IPv6 address is obtained through DHCP. ||\n| **Mtu** | Optional | int | The MTU size. ||\n| **IPv6Enabled** | Optional | bool | Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables all IPv6-related parameters. If the value is $true, you need to provide values for at least one of the IPv6 parameters. ||\n| **ManagementTrafficEnabled** | Optional | bool | Indicates that you want to enable the VMKernel NIC for management traffic. ||\n| **FaultToleranceLoggingEnabled** | Optional | bool | Indicates that the VMKernel NIC is enabled for Fault Tolerance (FT) logging. ||\n| **VMotionEnabled** | Optional | bool | Indicates that you want to use the VMKernel NIC for VMotion. ||\n| **VsanTrafficEnabled** | Optional | bool | Indicates that Virtual SAN traffic is enabled on this VMKernel NIC. ||\n\n## Description\n\nThe resource is used to modify the settings or remove VMKernel NICs connected to the specified Distributed Port Group on the specified VDSwitch. The resource can't be used to create VMKernel NICs connected to Distributed Port Groups. This limitation is due to the fact that more than one VMKernel NIC can be created and connected to the same Distributed Port Group. This way the created VMKernel NIC can't be uniquely identified via the specified VDSwitch and Distributed Port Group. The VMKernel NIC's name can't be used as an identifier because it can't be specified when the VMKernel NIC's is being created, it is assigned automatically by the server. The solution is to create a VMKernel NIC on a Standard Switch with the [VMHostVssNic DSC Resource](https://github.com/vmware/dscr-for-vmware/wiki/VMHostVssNic) and then migrate it to the desired VDSwitch and connect it to the desired Distributed Port Group via the [VMHostVDSwitchMigration DSC Resource](https://github.com/vmware/dscr-for-vmware/wiki/VMHostVDSwitchMigration). Then the VMKernel NIC can be configured via the current DSC Resource by specifying its' name to uniquely identify it.\n\n## Examples\n\n### Example 1\n\nEnables all available services (VMotion, Vsan traffic, Management traffic and Fault Tolerance logging) for VMKernel NIC **vmk0** connected to Distributed Port Group **DscVDPortGroup** on VDSwitch **DscVDSwitch**.\n\n```powershell\nConfiguration VMHostVdsNic_EnableAvailableServices_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVdsNic VMHostVdsNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'vmk0'\n            VdsName = 'DscVDSwitch'\n            PortGroupName = 'DscVDPortGroup'\n            Ensure = 'Present'\n            ManagementTrafficEnabled = $true\n            FaultToleranceLoggingEnabled = $true\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves VMKernel NIC **vmk0** connected to Distributed Port Group **DscVDPortGroup** on VDSwitch **DscVDSwitch**.\n\n```powershell\nConfiguration VMHostVdsNic_RemoveVMKernelNic_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVdsNic VMHostVdsNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'vmk0'\n            VdsName = 'DscVDSwitch'\n            PortGroupName = 'DscVDPortGroup'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVss/VMHostVss.md",
    "content": "# VMHostVss\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VSS should be Present or Absent. | Present, Absent |\n| **VssName** | Key | string | The name of the VSS. ||\n| **Mtu** | Optional | int | The maximum transmission unit (MTU) associated with this virtual switch in bytes. ||\n\n## Description\n\nThe resource is used to configure the basic properties of a Virtual Switch (VSS) on an ESXi node.\n\n## Notes\n\n* The **NumPorts** property is not included. From ESXi 5.5 onwards, ports on standard virtual switches are always **elastic**. The NumPorts value is ignored.\n\n## Examples\n\n### Example 1\n\nCreates a new VSS on an ESXi node.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVss_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVSS {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = [Ensure]::Present\n            VssName = 'VSS1'\n            Mtu = 1500\n        }\n    }\n}\n````\n\n### Example 2\n\nRemoves a VSS from an ESXi node.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVss_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVSS {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = [Ensure]::Absent\n            VssName = 'VSS2'\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssBridge/VMHostVssBridge.md",
    "content": "# VMHostVssBridge\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VSS should be Present or Absent. | Present, Absent |\n| **VssName** | Key | string | The name of the VSS. ||\n| **NicDevice** | Optional | string[] | The list of keys of the physical network adapters to be bridged. ||\n| **BeaconInterval** | Optional | int | Determines how often, in seconds, a beacon should be sent. ||\n| **LinkDiscoveryProtocolType** | Optional | string | The discovery protocol type. VSS only supports CDP. | CDP |\n| **LinkDiscoveryProtocolOperation** | Optional | string | Whether to advertise or listen. | Advertise, Both, Listen, None |\n\n## Description\n\nA bridge connects a virtual switch (VSS) to (a) physical network adapter(s). The VSS needs to exist.\n\n## Examples\n\n### Example 1\n\nConfigures the teaming settings of the specified Virtual Switch.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssBridge_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            VssName = 'VSS1'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssBridge vmHostVssBridge {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            VssName = 'VSS1'\n            Ensure = 'Present'\n            NicDevice = @('vmnic1','vmnic2')\n            BeaconInterval = 1\n            LinkDiscoveryProtocolType = [LinkDiscoveryProtocolProtocol]::CDP\n            LinkDiscoveryProtocolOperation = [LinkDiscoveryProtocolOperation]::Listen\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssMigration/VMHostVssMigration.md",
    "content": "# VMHostVssMigration\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **VssName** | Key | string | The name of the Standard Switch to which the passed Physical Network Adapters, VMKernel Network Adapters and Port Groups should be part of. ||\n| **PhysicalNicNames** | Mandatory | string[] | The names of the Physical Network Adapters that should be part of the Standard Switch. ||\n| **VMKernelNicNames** | Optional | string[] | The names of the VMKernel Network Adapters that should be part of the Standard Switch. ||\n| **PortGroupNames** | Optional | string[] | The names of the Port Groups to which the specified VMKernel Network Adapters should be attached. Accepts the same number of Port Groups as the number of VMKernel Network Adapters specified. The first Adapter is attached to the first Port Group, the second Adapter to the second Port Group, and so on. ||\n\n## Description\n\nThe resource is used to migrate Physical Network Adapters and VMKernel Network Adapters attached to the specified Port Groups to the specified Standard Switch. If the specified Port Groups are not present on the Standard Switch, they are created before performing the migration process.\n\n## Examples\n\n### Example 1\n\nMigrates Physical Network Adapters **vmnic0** and **vmnic1** to Standard Switch **MyStandardSwitch**.\n\n```powershell\nConfiguration VMHostVssMigration_MigratePhysicalNics_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssMigration VMHostVssMigration {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyStandardSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n        }\n    }\n}\n```\n\n### Example 2\n\nMigrates Physical Network Adapters **vmnic0** and **vmnic1** to Standard Switch **MyStandardSwitch**. Migrates VMKernel Network Adapters **vmk0** and **vmk1** to Standard Switch **MyStandardSwitch** and attaches them to Port Groups **Management Network** and **VM Network** respectively.\n\n```powershell\nConfiguration VMHostVssMigration_MigratePhysicalNicsAndVMKernelNicsWithPortGroups_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssMigration VMHostVssMigration {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyStandardSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n            PortGroupNames = @('Management Network', 'VM Network')\n        }\n    }\n}\n```\n\n### Example 3\n\nMigrates Physical Network Adapters **vmnic0** and **vmnic1** to Standard Switch **MyStandardSwitch**. Migrates VMKernel Network Adapters **vmk0** and **vmk1** to Standard Switch **MyStandardSwitch**. The VMKernel Network Adapters are attached to newly created Port Groups which name has the **VMKernel** prefix.\n\n```powershell\nConfiguration VMHostVssMigration_MigratePhysicalNicsAndVMKernelNics_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssMigration VMHostVssMigration {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyStandardSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssNic/VMHostVssNic.md",
    "content": "# VMHostVssNic\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **VssName** | Key | string | The name of the Virtual Switch to which the VMKernel Network Adapter should be connected. The Switch must be a Standard Switch. ||\n| **PortGroupName** | Key | string | The name of the Port Group to which the VMKernel Network Adapter should be connected. If the Port Group is non-existent, a new Port Group with the specified name will be created and the VMKernel Network Adapter will be connected to it. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VMKernel Network Adapter should be Present or Absent. | Present, Absent |\n| **Dhcp** | Optional | bool | Indicates whether the VMKernel Network Adapter uses a Dhcp server. ||\n| **IP** | Optional | string | The IP address for the VMKernel Network Adapter. All IP addresses are specified using IPv4 dot notation. If IP is not specified, DHCP mode is enabled. ||\n| **SubnetMask** | Optional | string | The Subnet Mask for the VMKernel Network Adapter. ||\n| **Mac** | Optional | string | The media access control (MAC) address for the VMKernel Network Adapter. ||\n| **AutomaticIPv6** | Optional | bool | Indicates that the IPv6 address is obtained through a router advertisement. ||\n| **IPv6** | Optional | string[] | Specifies multiple static addresses using the following format: `<IPv6>`/<subnet_prefix_length> or `<IPv6>`. If you skip <subnet_prefix_length>, the default value of 64 is used. ||\n| **IPv6ThroughDhcp** | Optional | bool | Indicates that the IPv6 address is obtained through DHCP. ||\n| **Mtu** | Optional | int | The MTU size. ||\n| **IPv6Enabled** | Optional | bool | Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables all IPv6-related parameters. If the value is $true, you need to provide values for at least one of the IPv6 parameters. ||\n| **ManagementTrafficEnabled** | Optional | bool | Indicates that you want to enable the VMKernel Network Adapter for management traffic. ||\n| **FaultToleranceLoggingEnabled** | Optional | bool | Indicates that the VMKernel Network Adapter is enabled for Fault Tolerance (FT) logging. ||\n| **VMotionEnabled** | Optional | bool | Indicates that you want to use the VMKernel Network Adapter for VMotion. ||\n| **VsanTrafficEnabled** | Optional | bool | Indicates that Virtual SAN traffic is enabled on this VMKernel Network Adapter. ||\n\n## Description\n\nThe resource is used to create, update and remove VMKernel Network Adapters added to the specified Standard Switch and Port Group. If the Port Group is not existing, it will be created and the VMKernel Network Adapter will be connected to it. If the Port Groupd exists, the resource updates the associated VMKernel Network Adapter. There could be only one VMKernel Network Adapter into a Port Group, thus the resource identifies the VMKernel Network Adapter by the Port Group Name.\n\n## Examples\n\n### Example 1\n\nCreates a new VMKernel Network Adapter with the specified settings adding it to Standard Switch **MyVirtualSwitch** and Port Group **MyVirtualPortGroup**.\n\n```powershell\nConfiguration VMHostVssNic_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssNic VMHostVssNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            PortGroupName = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            IP = '192.168.0.1'\n            SubnetMask = '255.255.255.0'\n            Mac = '00:50:56:63:5b:0e'\n            AutomaticIPv6 = $true\n            IPv6 = @('fe80::250:56ff:fe63:5b0e/64', '200:2342::1/32')\n            IPv6ThroughDhcp = $true\n            Mtu = 4000\n            ManagementTrafficEnabled = $true\n            FaultToleranceLoggingEnabled = $true\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n        }\n    }\n}\n```\n\n### Example 2\n\nThe first Configuration creates a new VMKernel Network Adapter with the specified settings adding it to Standard Switch **MyVirtualSwitch** and Port Group **MyVirtualPortGroup**. The second Configuration updates the VMKernel Network Adapter added to Standard Switch **MyVirtualSwitch** and Port Group **MyVirtualPortGroup** by disabling IPv6 and enabling DHCP.\n\n```powershell\nConfiguration VMHostVssNic_WhenAddingVMKernelNetworkAdapter_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssNic VMHostVssNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            PortGroupName = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            IP = '192.168.0.1'\n            SubnetMask = '255.255.255.0'\n            Mac = '00:50:56:63:5b:0e'\n            AutomaticIPv6 = $true\n            IPv6 = @('fe80::250:56ff:fe63:5b0e/64', '200:2342::1/32')\n            IPv6ThroughDhcp = $true\n            Mtu = 4000\n            ManagementTrafficEnabled = $true\n            FaultToleranceLoggingEnabled = $true\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenUpdatingVMKernelNetworkAdapter_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssNic VMHostVssNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            PortGroupName = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            IPv6Enabled = $false\n            Dhcp = $true\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves the VMKernel Network Adapter added to Standard Switch **MyVirtualSwitch** and Port Group **MyVirtualPortGroup**.\n\n```powershell\nConfiguration VMHostVssNic_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssNic VMHostVssNic {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            PortGroupName = 'MyVirtualPortGroup'\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssPortGroup/VMHostVssPortGroup.md",
    "content": "# VMHostVssPortGroup\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The Name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The Name for the Port Group. ||\n| **VssName** | Mandatory | string | The Name of the Virtual Switch associated with the Port Group. The Virtual Switch must be a Standard Virtual Switch. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Port Group should be Present or Absent. | Present, Absent |\n| **VLanId** | Optional | int | The VLAN ID for ports using this Port Group. | 0 - 4095 |\n\n## Description\n\nThe resource is used to create, update and delete Port Groups which are associated with the specified Virtual Switch. If Ensure is 'Absent', all VMs connected to the Port Group must be **PoweredOff** to successfully remove the Port Group. If one or more of the VMs are **PoweredOn**, the removal would not be successful because the Port Group is used by the VMs.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Virtual Switch **MyVirtualSwitch** with Mtu **1500**. The second Resource in the Configuration creates a new Port Group **MyVirtualPortGroup** which is associated with Virtual Switch **MyVirtualSwitch** with VLanId set to **1**.\n\n```powershell\nConfiguration VMHostVssPortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss VMHostVss {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 1\n            DependsOn = \"[VMHostVss]VMHostVss\"\n        }\n    }\n}\n```\n\n### Example 2\n\nThe first Resource in the Configuration removes the Port Group **MyVirtualPortGroup** which is associated with Virtual Switch **MyVirtualSwitch**. The second Resource in the Configuration removes the Virtual Switch **MyVirtualSwitch** with Mtu **1500**.\n\n```powershell\nConfiguration VMHostVirtualPortGroup_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Absent'\n        }\n\n        VMHostVss VMHostVss {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Absent'\n            Mtu = 1500\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssPortGroupSecurity/VMHostVssPortGroupSecurity.md",
    "content": "# VMHostVssPortGroupSecurity\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The Name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The Name for the Port Group. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Port Group should be Present or Absent. | Present, Absent |\n| **AllowPromiscuous** | Optional | bool | Specifies whether promiscuous mode is enabled for the corresponding Virtual Port Group. ||\n| **AllowPromiscuousInherited** | Optional | bool | Specifies whether the AllowPromiscuous setting is inherited from the parent Standard Virtual Switch. ||\n| **ForgedTransmits** | Optional | bool | Specifies whether forged transmits are enabled for the corresponding Virtual Port Group. ||\n| **ForgedTransmitsInherited** | Optional | bool | Specifies whether the ForgedTransmits setting is inherited from the parent Standard Virtual Switch. ||\n| **MacChanges** | Optional | bool | Specifies whether MAC address changes are enabled for the corresponding Virtual Port Group. ||\n| **MacChangesInherited** | Optional | bool | Specifies whether the MacChanges setting is inherited from the parent Standard Virtual Switch. ||\n\n## Description\n\nThe resource is used to update the Security Policy of the specified Virtual Port Group.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Standard Virtual Switch **MyVirtualSwitch** with MTU **1500**. The second Resource in the Configuration creates a new Virtual Port Group **MyVirtualPortGroup** which is associated with the Virtual Switch **MyVirtualSwitch** with VLanId set to **1**. The third Resource in the Configuration updates the Security Policy of Virtual Port Group **MyVirtualPortGroup** by enabling Promiscuous mode, Forged Transmits and Mac Changes. The Security Policy settings are not inherited from the parent Standard Virtual Switch.\n\n```powershell\nConfiguration VMHostVssPortGroupSecurity_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss VMHostStandardSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 1\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n\n        VMHostVssPortGroupSecurity VMHostVssPortGroupSecurity {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            AllowPromiscuous = $true\n            AllowPromiscuousInherited = $false\n            ForgedTransmits = $true\n            ForgedTransmitsInherited = $false\n            MacChanges = $true\n            MacChangesInherited = $false\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssPortGroupShaping/VMHostVssPortGroupShaping.md",
    "content": "# VMHostVssPortGroupShaping\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The Name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The Name for the Port Group. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Port Group should be Present or Absent. | Present, Absent |\n| **Enabled** | Optional | bool | The flag to indicate whether or not traffic shaper is enabled on the port. ||\n| **AverageBandwidth** | Optional | long | The average bandwidth in bits per second if shaping is enabled on the port. ||\n| **PeakBandwidth** | Optional | long | The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port. ||\n| **BurstSize** | Optional | long | The maximum burst size allowed in bytes if shaping is enabled on the port. ||\n\n## Description\n\nThe resource is used to update the Shaping Policy of the specified Virtual Port Group.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Standard Virtual Switch **MyVirtualSwitch** with MTU **1500**. The second Resource in the Configuration creates a new Virtual Port Group **MyVirtualPortGroup** which is associated with the Virtual Switch **MyVirtualSwitch** with VLanId set to **1**. The third Resource in the Configuration updates the Shaping Policy of Virtual Port Group **MyVirtualPortGroup** by enabling it and setting the **BurstSize**, **Average** and **Peak** bandwidths values.\n\n```powershell\nConfiguration VMHostVssPortGroupShaping_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss VMHostStandardSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n\n        VMHostVssPortGroupShaping VMHostVssPortGroupShaping {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssPortGroupTeaming/VMHostVssPortGroupTeaming.md",
    "content": "# VMHostVssPortGroupTeaming\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The Name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The Name for the Port Group. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the Port Group should be Present or Absent. | Present, Absent |\n| **FailbackEnabled** | Optional | bool | Specifies how a Physical Adapter is returned to active duty after recovering from a failure. ||\n| **LoadBalancingPolicy** | Optional | LoadBalancingPolicy | Determines how network traffic is distributed between the network Adapters assigned to a Switch. | LoadBalanceIP, LoadBalanceSrcMac, LoadBalanceSrcId, ExplicitFailover |\n| **ActiveNic** | Optional | string[] | The Adapters you want to continue to use when the network Adapter connectivity is available and active. ||\n| **StandbyNic** | Optional | string[] | The Adapters you want to use if one of the active Adapter's connectivity is unavailable. ||\n| **UnusedNic** | Optional | string[] | The Adapters you do not want to use. ||\n| **NetworkFailoverDetectionPolicy** | Optional | NetworkFailoverDetectionPolicy | Specifies how to reroute traffic in the event of an Adapter failure. | LinkStatus, BeaconProbing |\n| **NotifySwitches** | Optional | bool | Indicates that whenever a virtual NIC is connected to the Virtual Switch or whenever that virtual NIC's traffic is routed over a different physical NIC in the team because of a failover event, a notification is sent over the network to update the lookup tables on the physical Switches. ||\n| **InheritFailback** | Optional | bool | Indicates that the value of the FailbackEnabled parameter is inherited from the Virtual Switch. ||\n| **InheritFailoverOrder** | Optional | bool | Indicates that the values of the ActiveNic, StandbyNic, and UnusedNic parameters are inherited from the Virtual Switch. ||\n| **InheritLoadBalancingPolicy** | Optional | bool | Indicates that the value of the LoadBalancingPolicy parameter is inherited from the Virtual Switch. ||\n| **InheritNetworkFailoverDetectionPolicy** | Optional | bool | Indicates that the value of the NetworkFailoverDetectionPolicy parameter is inherited from the Virtual Switch. ||\n| **InheritNotifySwitches** | Optional | bool | Indicates that the value of the NotifySwitches parameter is inherited from the Virtual Switch. ||\n\n## Description\n\nThe resource is used to update the Teaming Policy of the specified Virtual Port Group.\n\n## Examples\n\n### Example 1\n\nThe first Resource in the Configuration creates a new Standard Virtual Switch **MyVirtualSwitch** with MTU **1500**. The second Resource in the Configuration connects Standard Virtual Switch **MyVirtualSwitch** to **vmnic2** and **vmnic3** Physical Network Adapters. The third Resource in the Configuration updates the Teaming Policy of Standard Virtual Switch **MyVirtualSwitch**. The fourth Resource in the Configuration creates a new Virtual Port Group **MyVirtualPortGroup** which is associated with the Virtual Switch **MyVirtualSwitch** with VLanId set to **1**. The fifth Resource in the Configuration updates the Teaming Policy of Virtual Port Group **MyVirtualPortGroup**. The Teaming Policy settings are not inherited from the parent Standard Virtual Switch.\n\n```powershell\nConfiguration VMHostVssPortGroupTeaming_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss VMHostStandardSwitch {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssBridge VMHostVssBridge {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            NicDevice = @('vmnic2', 'vmnic3')\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n\n        VMHostVssTeaming VMHostVssTeaming {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            CheckBeacon = $true\n            ActiveNic = @('vmnic2', 'vmnic3')\n            StandbyNic = @()\n            NotifySwitches = $false\n            Policy = 'Loadbalance_ip'\n            RollingOrder = $true\n            DependsOn = \"[VMHostVssBridge]VMHostVssBridge\"\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            DependsOn = \"[VMHostVssTeaming]VMHostVssTeaming\"\n        }\n\n        VMHostVssPortGroupTeaming VMHostVssPortGroupTeaming {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            FailbackEnabled = $false\n            LoadBalancingPolicy = 'LoadBalanceIP'\n            ActiveNic = @('vmnic2', 'vmnic3')\n            StandbyNic = @()\n            UnusedNic = @()\n            NetworkFailoverDetectionPolicy = 'LinkStatus'\n            NotifySwitches = $false\n            InheritFailback = $false\n            InheritFailoverOrder = $false\n            InheritLoadBalancingPolicy = $false\n            InheritNetworkFailoverDetectionPolicy = $false\n            InheritNotifySwitches = $false\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssSecurity/VMHostVssSecurity.md",
    "content": "# VMHostVssSecurity\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VSS should be Present or Absent. | Present, Absent |\n| **VssName** | Key | string | The name of the VSS. ||\n| **AllowPromiscuous** | Optional | boolean | The flag to indicate whether or not all traffic is seen on the port. ||\n| **ForgedTransmits** | Optional | boolean | The flag to indicate whether or not the virtual network adapter should be allowed to send network traffic with a different MAC address. ||\n| **MacChanges** | Optional | boolean | The flag to indicate whether or not the Media Access Control (MAC) address can be changed. ||\n\n## Description\n\nThe resource is used to configure the security policy governing ports of a Virtual Switch.\n\n## Examples\n\n### Example 1\n\nConfigures the security settings of the specified Virtual Switch.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssSecurity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVssSecurity vmHostVSSSecurity {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            VssName = 'VSS1'\n            AllowPromiscuous = $true\n            ForgedTransmits = $true\n            MacChanges = $true\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssShaping/VMHostVssShaping.md",
    "content": "# VMHostVssShaping\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VSS should be Present or Absent. | Present, Absent |\n| **VssName** | Key | string | The name of the VSS. ||\n| **AverageBandwidth** | Optional | long | The average bandwidth in bits per second if shaping is enabled on the port. ||\n| **BurstSize** | Optional | long | The maximum burst size allowed in bytes if shaping is enabled on the port. ||\n| **Enabled** | Optional | boolean | The flag to indicate whether or not traffic shaper is enabled on the port. ||\n| **PeakBandwidth** | Optional | long | The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port. ||\n\n## Description\n\nThe resource is used to configure the traffic shaping policy for ports of a Virtual Switch (VSS). The VSS needs to exist.\n\n## Examples\n\n### Example 1\n\nConfigures the security settings of the specified Virtual Switch.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssShaping_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $vmHostCredential\n            VssName = 'VSS1'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssShaping vmHostVSSShaping {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            VssName = 'VSS1'\n            Ensure = 'Present'\n            AverageBandwidth = 100000\n            BurstSize = 100000\n            Enabled = $true\n            PeakBandwidth = 100000\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostVssTeaming/VMHostVssTeaming.md",
    "content": "# VMHostVssTeaming\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Name** | Key | string | Name of the VMHost to configure. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Ensure** | Mandatory | Ensure | Value indicating if the VSS should be Present or Absent. | Present, Absent |\n| **VssName** | Key | string | The name of the VSS. ||\n| **CheckBeacon** | Optional | Boolean | The flag to indicate whether or not to enable beacon probing as a method to validate the link status of a physical network adapter. ||\n| **ActiveNic** | Optional | string[] | List of active network adapters used for load balancing. ||\n| **StandbyNic** | Optional | string[] | Standby network adapters used for failover. ||\n| **NotifySwitches** | Optional | Boolean | Flag to specify whether or not to notify the physical switch if a link fails. ||\n| **Policy** | Optional | NicTeamingPolicy | Network adapter teaming policy. |  LoadBalance_IP, LoadBalance_SrcMAC, LoadBalance_SrcId, Failover_Explicit |\n| **RollingOrder** | Optional | Boolean | The flag to indicate whether or not to use a rolling policy when restoring links. ||\n\n## Description\n\nThe resource is used to configure the network adapter teaming policy of a Virtual Switch (VSS). The VSS needs to exist.\n\n## Examples\n\n### Example 1\n\nConfigures the teaming settings of the specified Virtual Switch.\n\n````powershell\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssTeaming_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $vmHostCredential\n            VssName = 'VSS1'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssTeaming vmHostVSSTeaming {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            VssName = 'VSS1'\n            CheckBeacon = $false\n            ActiveNic = @('vmnic0','vmnic1')\n            StandbyNic = @()\n            NotifySwitches = $true\n            Policy = [NicTeamingPolicy]::LoadBalance_SrcId\n            RollingOrder = $false\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration.md",
    "content": "# VMHostvSANNetworkConfiguration\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **InterfaceName** | Key | string | The name of the interface. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the IP interface of the vSAN network configuration should be present or absent. ||\n| **AgentMcAddr** | Optional | string | The IPv4 multicast address for the agent group. ||\n| **AgentV6McAddr** | Optional | string | The IPv6 multicast address for the agent group. ||\n| **AgentMcPort** | Optional | long | The multicast address port for the agent group. ||\n| **HostUcPort** | Optional | long | The unicast address port for the VMHost unicast channel. ||\n| **MasterMcAddr** | Optional | string | The IPv4 multicast address for the master group. ||\n| **MasterV6McAddr** | Optional | string | The IPv6 multicast address for the master group. ||\n| **MasterMcPort** | Optional | long | The multicast address port for the master group. ||\n| **MulticastTtl** | Optional | long | The time-to-live for multicast packets. ||\n| **TrafficType** | Optional | string[] | The network transmission type of the vSAN traffic through a virtual network adapter. Supported values are vsan and witness. Type **vsan** means general vSAN transmission, which is used for both data and witness transmission, if there is no virtual adapter configured with **witness** traffic type; Type **witness** indicates that, vSAN vmknic is used for vSAN witness transmission. Once a virtual adapter is configured with **witness** traffic type, vSAN witness data transmission will stop using virtual adapter with **vsan** traffic type, and use first dicovered virtual adapter with **witness** traffic type. Multiple traffic types can be provided in format -T type1 -T type2. Default value is **vsan**, if the property is not specified. ||\n| **Force** | Optional | bool | Specifies whether to notify vSAN subsystem of the removal of the IP Interface, even if is not configured. ||\n\n## Description\n\nThe resource is used to add and remove vSAN network configuration IP Interfaces on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nAdds a new vSAN network configuration IP Interface where the interface name is the specified VMKernel Network Adapter name. The time-to-live for multicast packets is **5** and the traffic type is **vsan**. Also specified are the settings for the **Agent** and **Master** groups as well as the unicast address port for the VMHost unicast channel: **12321**.\n\n```powershell\nConfiguration VMHostvSANNetworkConfiguration_AddVMHostvSANNetworkConfigurationIPInterface_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostVMKernelNetworkAdapterName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostvSANNetworkConfiguration VMHostvSANNetworkConfiguration {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            InterfaceName = $VMHostVMKernelNetworkAdapterName\n            Ensure = 'Present'\n            AgentV6McAddr = 'ff19::2:3:4'\n            AgentMcAddr = '224.2.3.4'\n            AgentMcPort = 23451\n            HostUcPort = 12321\n            MasterV6McAddr = 'ff19::1:2:3'\n            MasterMcAddr = '224.1.2.3'\n            MasterMcPort = 12345\n            MulticastTtl = 5\n            TrafficType = 'vsan'\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves the vSAN network configuration IP Interface where the interface name is the specified VMKernel Network Adapter name. The vSAN subsystem is notified of the removal of the IP Interface.\n\n```powershell\nConfiguration VMHostvSANNetworkConfiguration_RemoveVMHostvSANNetworkConfigurationIPInterface_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostVMKernelNetworkAdapterName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostvSANNetworkConfiguration VMHostvSANNetworkConfiguration {\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            InterfaceName = $VMHostVMKernelNetworkAdapterName\n            Ensure = 'Absent'\n            Force = $true\n            AgentV6McAddr = 'ff19::2:3:4'\n            AgentMcAddr = '224.2.3.4'\n            AgentMcPort = 23451\n            HostUcPort = 12321\n            MasterV6McAddr = 'ff19::1:2:3'\n            MasterMcAddr = '224.1.2.3'\n            MasterMcPort = 12345\n            MulticastTtl = 5\n            TrafficType = 'vsan'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/VmfsDatastore/VmfsDatastore.md",
    "content": "# VmfsDatastore\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **VMHostName** | Key | string | The name of the VMHost which is going to be used. ||\n| **Name** | Key | string | The name of the Vmfs Datastore. ||\n| **Path** | Mandatory | string | The canonical name of the Scsi logical unit that contains the Vmfs Datastore. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the Vmfs Datastore should be present or absent. | Present, Absent |\n| **FileSystemVersion** | Optional | string | The file system that is used on the Vmfs Datastore. ||\n| **BlockSizeMB** | Optional | int | The maximum file size of Vmfs in megabytes (MB). If no value is specified, the maximum file size for the current system platform is used. ||\n| **CongestionThresholdMillisecond** | Optional | int | The latency period beyond which the storage array is considered congested. The range of this value is between 10 to 100 milliseconds. ||\n| **StorageIOControlEnabled** | Optional | bool | Indicates whether the IO control is enabled. ||\n\n## Description\n\nThe resource is used to create, modify and remove Vmfs Datastores on the specified VMHost.\n\n## Examples\n\n### Example 1\n\nCreates or modifies Vmfs Datastore **MyVmfsDatastore** with **version 5** File System and maximum file size of Vmfs: **1MB** on the specified VMHost. The StorageIOControl is **enabled** and the latency period beyond which the storage array is considered congested is **100 milliseconds**.\n\n```powershell\nConfiguration VmfsDatastore_CreateVmfsDatastore_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VmfsDatastore VmfsDatastore {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $ScsiLunCanonicalName\n            Ensure = 'Present'\n            FileSystemVersion = '5'\n            BlockSizeMB = 1\n            StorageIOControlEnabled = $true\n            CongestionThresholdMillisecond = 100\n        }\n    }\n}\n```\n\n### Example 2\n\nRemoves Vmfs Datastore **MyVmfsDatastore** from the specified VMHost.\n\n```powershell\nConfiguration VmfsDatastore_RemoveVmfsDatastore_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ScsiLunCanonicalName\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VmfsDatastore VmfsDatastore {\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $ScsiLunCanonicalName\n            Ensure = 'Absent'\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/DSCResources/vCenterSettings/vCenterSettings.md",
    "content": "# vCenterSettings\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **LoggingLevel** | Optional | LoggingLevel | Logging Level Advanced Setting value. |Unset, None, Error, Warning, Info, Verbose, Trivia|\n| **EventMaxAgeEnabled** | Optional | bool | Event Max Age Enabled Advanced Setting value. ||\n| **EventMaxAge** | Optional | int | Event Max Age Advanced Setting value. ||\n| **TaskMaxAgeEnabled** | Optional | bool | Task Max Age Enabled Advanced Setting value. ||\n| **TaskMaxAge** | Optional | int | Task Max Age Advanced Setting value. ||\n| **Motd** | Optional | string | Motd Advanced Setting value. ||\n| **MotdClear** | Optional | bool | Indicates whether the Motd content should be cleared. ||\n| **Issue** | Optional | string | Issue Advanced Setting value. ||\n| **IssueClear** | Optional | bool | Indicates whether the Issue content should be cleared. ||\n\n## Description\n\nThe resource is used to Update EventMaxAge Settings, TaskMaxAge Settings, Motd Setting, Issue Setting and the Logging Level of a vCenter.\n\n## Examples\n\n### Example 1\n\nUpdates the EventMaxAge Settings, TaskMaxAge Settings and the Logging Level of the passed vCenter.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration vCenterSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $Credential\n            LoggingLevel = 'Warning'\n            EventMaxAgeEnabled = $false\n            EventMaxAge = 40\n            TaskMaxAgeEnabled = $false\n            TaskMaxAge = 40\n        }\n    }\n}\n````\n\n### Example 2\n\nUpdates the Motd and Issue Settings of the passed vCenter.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration vCenterSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $Credential\n            Motd = 'Hello World from motd!'\n            Issue = 'Hello World from issue!'\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/vCenterStatistics/vCenterStatistics.md",
    "content": "# vCenterStatistics\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. ||\n| **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. ||\n| **Period** | Key | Period | The unit of period. Statistics can be stored separatelly for each of the {Day, Week, Month, Year} period units. |Day, Week, Month, Year|\n| **PeriodLength** | Optional | long | Period for which the statistics are saved. ||\n| **Level** | Optional | int | Specified Level value for the vCenter Statistics. ||\n| **Enabled** | Optional | bool | If collecting statistics for the specified period unit is enabled. ||\n| **IntervalMinutes** | Optional | long | Interval in Minutes, indicating the period for collecting statistics. ||\n\n## Description\n\nThe resource is used to configure the Statistics Settings of a vCenter.\n\n## Examples\n\n### Example 1\n\nUpdates the Statistics settings of the passed vCenter by changing the level to 2 for the Day period.\n\n````powershell\nparam(\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $true)]\n        [string]\n        $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration vCenterStatistics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        vCenterStatistics vCenterStatistics {\n            Server = $Server\n            Credential = $Credential\n            Period = \"Day\"\n            Level = 2\n        }\n    }\n}\n````\n"
  },
  {
    "path": "Documentation/DSCResources/vCenterVMHost/vCenterVMHost.md",
    "content": "# vCenterVMHost\n\n## Parameters\n\n| Parameter | Attribute | DataType | Description | Allowed Values |\n| --- | --- | --- | --- | --- |\n| **Server** | Key | string | The name of the Server we are trying to connect to. The Server can only be a vCenter. ||\n| **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. ||\n| **Name** | Key | string | The name of the VMHost. ||\n| **Location** | Key | string | The location in the vCenter Server system of the VMHost with name specified in **Name** key property in Datacenter specified in **DatacenterName** key property. Location consists of 0 or more Inventory Items. Empty location means that the VMHost is located in the Host Folder of the Datacenter. The Root Folders of the Datacenter are not part of the location. Inventory Item names in location are separated by '/'. Example location for the VMHost: 'MyFolder/MyCluster'. ||\n| **DatacenterName** | Key | string | The name of the Datacenter where the VMHost is located. ||\n| **DatacenterLocation** | Key | string | The location in the vCenter Server system of the Datacenter with name specified in **DatacenterName** key property. Location consists of 0 or more Folders. Empty location means that the Datacenter is located in the Root Folder of the Inventory. The Root Folder of the Inventory is not part of the location. Folder names in location are separated by '/'. Example location for Datacenter: 'MyDatacentersFolder'. ||\n| **Ensure** | Mandatory | Ensure | Specifies whether the VMHost should be present or absent from the vCenter Server system. | Present, Absent |\n| **VMHostCredential** | Mandatory | PSCredential | The credentials needed for authenticating with the VMHost. ||\n| **ResourcePoolLocation** | Optional | string | The location of the Resource Pool in the Cluster. Location consists of 0 or more Resource Pools. The Root Resource Pool of the Cluster is not part of the location. If '/' location is passed, the Resource Pool is the Root Resource Pool of the Cluster. Resource Pools names in the location are separated by '/'. The VMHost's Root Resource Pool becomes the last Resource Pool specified in the location and the VMHost Resource Pool hierarchy is imported into the new nested Resource Pool. Example location for a Resource Pool: 'MyResourcePoolOne/MyResourcePoolTwo'. ||\n| **Port** | Optional | int | The port on the VMHost used for the connection. ||\n| **Force** | Optional | bool | Indicates whether the VMHost is added to the vCenter if the authenticity of the VMHost SSL certificate cannot be verified. ||\n\n## Description\n\nThe resource is used to add, move to another location or remove VMHosts on the specified vCenter Server system.\n\n## Examples\n\n### Example 1\n\nCreates Datacenter **MyDatacenter** in the Root Folder of the specified Inventory. Creates Folder **MyFolder** in the Host Folder of Datacenter **MyDatacenter**. Creates Cluster **MyCluster** located in Folder **MyFolder** in Datacenter **MyDatacenter**. Adds the specified VMHost to Cluster **MyCluster**. The port for connecting to the VMHost is specified to be **443**. **Force** is used to ignore the invalid SSL certificate of the VMHost.\n\n```powershell\nConfiguration vCenterVMHost_AddVMHostTovCenter_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $VMHostCredential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Datacenter Datacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        Folder Folder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        Cluster Cluster {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyCluster'\n            Location = 'MyFolder'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DependsOn = '[Folder]Folder'\n        }\n\n        vCenterVMHost vCenterVMHost {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Location = 'MyFolder/MyCluster'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            VMHostCredential = $VMHostCredential\n            Port = 443\n            Force = $true\n            DependsOn = '[Cluster]Cluster'\n        }\n    }\n}\n```\n\n### Example 2\n\nCreates Datacenter **MyDatacenter** in the Root Folder of the specified Inventory. Creates Folder **MyFolder** in the Host Folder of Datacenter **MyDatacenter**. Creates Cluster **MyCluster** located in Folder **MyFolder** in Datacenter **MyDatacenter** and enables Drs. Adds the specified VMHost to Cluster **MyCluster**. The port for connecting to the VMHost is specified to be **443**. **Force** is used to ignore the invalid SSL certificate of the VMHost. The VMHost's Root Resource Pool becomes the Resource Pool **Resources** that is the Root Resource Pool of Cluster **MyCluster** and the VMHost Resource Pool hierarchy is imported into the new nested Resource Pool.\n\n```powershell\nConfiguration vCenterVMHost_AddVMHostTovCenterAndImportResourcePoolHierarchy_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $VMHostCredential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Datacenter Datacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        Folder Folder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        Cluster Cluster {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyCluster'\n            Location = 'MyFolder'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DrsEnabled = $true\n            DependsOn = '[Folder]Folder'\n        }\n\n        vCenterVMHost vCenterVMHost {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Location = 'MyFolder/MyCluster'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            VMHostCredential = $VMHostCredential\n            ResourcePoolLocation = '/'\n            Port = 443\n            Force = $true\n            DependsOn = '[Cluster]Cluster'\n        }\n    }\n}\n```\n\n### Example 3\n\nRemoves the specified VMHost located in Datacenter **Datacenter** from the specified vCenter Server.\n\n```powershell\nConfiguration vCenterVMHost_RemoveVMHostFromvCenter_Config {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $VMHostCredential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterVMHost vCenterVMHost {\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            VMHostCredential = $VMHostCredential\n        }\n    }\n}\n```\n"
  },
  {
    "path": "Documentation/Tips-&-Tricks.md",
    "content": "# Tips & Tricks\n\n## Tools\n### Editor\nYou can choose any editor that you prefer to work with PowerShell code. I personally prefer an use [Visual Studio Code](https://code.visualstudio.com) with the [PowerShell Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell).\n\n### Git\nSince you will be working with a **GitHub** repository, you will need to know how to use **Git**. A good starting point will be the [Official Git Documentation](https://git-scm.com/docs). You can download **Git** from [here](https://git-scm.com/downloads).\n\n## Formatting Guidelines\nWhen developing new **VMware DSC Resources** you should follow the [Formatting Guidelines](https://github.com/vmware/dscr-for-vmware/blob/master/FORMATTING_GUIDELINES.md). This is the content of the **settings.json** file in [Visual Studio Code](https://code.visualstudio.com) which we use. In **VSC** you just need to place the settings from the [Formatting Guidelines](https://github.com/vmware/dscr-for-vmware/blob/master/FORMATTING_GUIDELINES.md) file into your **settings.json** and this way the rules will be applied for your code.\n\nBasic **formatting rules** if you are using another editor:\n* Open brace should be on the same line.\n* After a closing brace there should be a new line.\n* The tab size should be equal to 4 spaces.\n* Trailing whitespaces should be trimmed.\n\n## Guidelines for working with the repository and Git\nContributions to the repository are only available through **Pull Requests**. They are **reviewed** and **merged** by the maintainers of the repository.\n\nTo add content to the repository via **PR** requires basic **Git** knowledge. Here is a list of **git** commands that you will need to use on a daily basis:\n\n**git status** - Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git.\n\n**git log** - Shows the commit logs.\n\n**git checkout `<branch>`** - To prepare for working on `<branch>`, switch to it by updating the index and the files in the working tree, and by pointing HEAD at the branch. Local modifications to the files in the working tree are kept, so that they can be committed to the `<branch>`.\n\n**git add `<files>`** - Updates the index using the current content found in the working tree, to prepare the content staged for the next commit.\n\n**git commit -s -m `<your message>`** - Stores the current contents of the index in a new commit along with a log message from the user describing the changes and adds Signed-off-by line by the committer at the end of the commit log message.\n\n**git push** - Updates remote refs using local refs, while sending objects necessary to complete the given refs.\n\n**git pull** - Incorporates changes from a remote repository into the current branch.\n\n**git merge** - Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch.\n\n## Writing VMware DSC Resources\nIn the implementation of **VMware DSC Resources** you can use one of the following depending on the **Resource**:\n\n* **PowerCLI** Cmdlets\n* **vSphere API** through **PowerCLI Views Layer**\n* **ESXCLI** Commands through **Get-EsxCli** cmdlet\n\nThe prefered option is to use **PowerCLI** cmdlets if the functionality is covered by a **cmdlet**. For example if you want to update the **log.level** Advanced Setting value of a vCenter you can use the following cmdlet from **PowerCLI**:\n```powershell\n Set-AdvancedSetting -AdvancedSetting 'log.level' -Value <desired value>\n```\n\nIf **PowerCLI** cmdlet is not available to cover the functionality you are developing you can use the **vSphere API** through **PowerCLI Views Layer**. The tricky part here is that you need to define separate wrapper function in the [VMware.vSphereDSC Helper](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/VMware.vSphereDSC.Helper.psm1) that inside calls the method from the API. This way we enable testability and we can easily mock the wrapper function in the Unit Tests. For example if we want to update some Service Policy, we can define the following function that inside calls the **vSphere API**:\n```powershell\n function Update-ServicePolicy {\n     [CmdletBinding()]\n     param(\n         [VMware.Vim.HostServiceSystem] $ServiceSystem,\n         [string] $ServiceId,\n         [string] $ServicePolicyValue\n     )\n\n     $ServiceSystem.UpdateServicePolicy($ServiceId, $ServicePolicyValue)\n }\n```\n\nThe third option is using **ESXCLI** Commands through **Get-EsxCli** cmdlet which is not so common but there are special cases where the first two options are not applicable. Like the case of adding and removing **SATP Claim Rules**. Here we need to again define separate wrapper function in the [VMware.vSphereDSC Helper](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/VMware.vSphereDSC.Helper.psm1) that inside calls the **ESXCLI** Command. This way we again enable testability and we can easily mock the wrapper function in the Unit Tests. For example if we want to add new **SATP Claim Rule**, we can define the following function that inside calls the **ESXCLI** Command:\n```powershell\n # Example how to retrieve the EsxCli\n Get-EsxCli -Server <Specify the Server here> -VMHost <Specify the VMHost here> -V2\n\n function Add-SATPClaimRule {\n     [CmdletBinding()]\n     param(\n         [PSObject] $EsxCli,\n         [Hashtable] $SatpArgs\n     )\n\n     $EsxCli.storage.nmp.satp.rule.add.Invoke($SatpArgs)\n }\n```\n\n## Writing Unit Tests for VMware DSC Resources\nUnit Tests for **VMware.vSphereDSC Resources** should follow the following template:\n```powershell\n using module VMware.vSphereDSC\n\n $script:moduleName = 'VMware.vSphereDSC'\n\n InModuleScope -ModuleName $script:moduleName {\n     try {\n         $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n         $modulePath = $env:PSModulePath\n         $resourceName = 'MyResource'\n\n         . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n         # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n         Invoke-TestSetup\n\n         . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n         . \"$unitTestsFolder\\TestHelpers\\Mocks\\MyResourceMocks.ps1\"\n\n         Describe 'MyResource\\Set' -Tag 'Set' {\n             # Define separate context for every usecase your resource covers.\n             Context '<Usecase description>' {\n                 BeforeAll {\n                     # Here you should mock all cmdlets and function you are going to use in the Set method.\n                     # Arrange\n                     $resourceProperties = New-MocksForCurrentUsecase\n                     $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                 }\n\n                 It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                 }\n\n                 # Here the mock is the executed operation (cmdlet or PowerShell function) in the Set() method (New, Remove, Update, etc)\n                 It 'Should call the mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = '<Operation Name>'\n                        ParameterFilter = {<All parameters comparison>}\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                 }\n             }\n         }\n         \n         Describe 'MyResource\\Test' -Tag 'Test' {\n             # Define separate context for every usecase your resource covers.\n             Context '<Usecase description>' {\n                 BeforeAll {\n                     # Here you should mock all cmdlets and function you are going to use in the Test method.\n                     # Arrange\n                     $resourceProperties = New-MocksForCurrentUsecase\n                     $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                 }\n\n                 It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                 }\n\n                 # Depending on the use case the result should be either true or false.\n                 It 'Should return $true/$false when ...' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                 }\n             }\n         }\n\n         Describe 'MyResource\\Get' -Tag 'Get' {\n             # Define separate context for every usecase your resource covers.\n             Context '<Usecase description>' {\n                 BeforeAll {\n                     # Here you should mock all cmdlets and function you are going to use in the Get method.\n                     # Arrange\n                     $resourceProperties = New-MocksForCurrentUsecase\n                     $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                 }\n\n                 It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                 }\n\n                 It 'Should retrieve the correct settings from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    # For each property of the result verify that it is the correct value.\n                    $resuly.Name | Should -Be '<expected Name>'\n                }\n             }\n         }\n     }\n  }\n```\n\n## Writing Integration Tests for VMware DSC Resources\nIntegration Tests for **VMware.vSphereDSC Resources** should follow the following template:\n```powershell\n param(\n     [Parameter(Mandatory = $true)]\n     [string]\n     $Name,\n\n     [Parameter(Mandatory = $true)]\n     [string]\n     $Server,\n\n     [Parameter(Mandatory = $true)]\n     [string]\n     $User,\n\n     [Parameter(Mandatory = $true)]\n     [string]\n     $Password\n )\n\n script:dscResourceName = 'Name of the resource'\n $script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n $script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n $script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n # Compile the configuration file to mof.\n . $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n Describe \"$($script:dscResourceName)_Integration\" {\n     # Define separate Context for every Usecase(You also need separate Configuration for every Usecase).\n     Context \"When using configuration <Configuration Name>\" {\n         BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = '<Path to the mof file for the current Usecase>'\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = '<Path to the mof file for the current Usecase>'\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            # Assert that every property returned from the Get() method is the expected one.\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n     }\n }\n```\n\nBoth templates(**Unit** and **Integration**) contain the basic things you need to write your tests. Depending on the case you will need to add more lines of code(Like connection to the server in the case of **Integration** tests).\n"
  },
  {
    "path": "Documentation/vSphereNodes.md",
    "content": "# vSphere Nodes\n\nInside a **DSC Configuration** a **vSphereNode** is a special dynamic keyword that represents a connection to a **VIServer**. Each **vSphereNode** can contain **DSC Resources** from the module **VMware.vSphereDSC**. Currently **vSphere Nodes** only work on **PowerShell 7**.\n\nWith standard DSC we need to supply each **DSC Resource** with a **Server** and **Credential** properties so that they can establish a connection to the specified **VIServer** because the **LCM** runs the **DSC Resources** in different runspaces and a common connection cannot be reused.\n\nThe **vSphere Nodes** along with the new execution engine allow the user to bundle **DSC Resources** and specify a common **VIServer** connection which gets reused.\n\n## **DSC Configuration** with a standard **Node**\n\n```powershell\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [System.Management.Automation.PSCredential]\n    $Credential\n)\n\nConfiguration Datacenter_Config {\n    Param(\n        [string]\n        $Server,\n\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node 'localhost' {\n        Datacenter 'MyDatacenter' {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\n## **DSC Configuration** with a **vSphere Node**\n\n```powershell\nConfiguration Datacenter_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    vSphereNode '10.23.112.235' {\n        Datacenter 'MyDatacenter' {\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n}\n\n$dscConfiguration = New-VmwDscConfiguration -Path '.\\Datacenter_Config.ps1'\n```\n\nHere each **VMware.vSphere DSC Resource** loses the previously mandatory **Server** and **Credential** properties and instead the connection is retrieved from the **vSphereNode** name. Note that the **vSphereNode** keyword opening bracket **'{'** must be placed on the same row as the keyword or else a parsing error is triggered.\n\n## **DSC Configuration** with multiple **vSphere Nodes**\n\n```powershell\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = '10.23.112.235'\n        },\n        @{\n            NodeName = '10.23.112.236'\n        }\n    )\n}\n\nConfiguration Datacenter_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    vSphereNode $AllNodes.NodeName {\n        Datacenter 'MyDatacenter' {\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n}\n\n$dscConfiguration = New-VmwDscConfiguration -Path '.\\Datacenter_Config.ps1'\n```\n\nHere **AllNodes** can contain multiple **VIServer** connections that can be specified via the **NodeName** property and a separate **Node** object will be generated for each connection.\n\nCommon properties for all nodes can be specified with a **$AllNodes** entry that has a **NodeName** property that equals **'*'**. This value will be applied to all other **Nodes**. **Nodes** with duplicate **NodeName** properties will result in a exception.\n\n```powershell\nConfigurationData = @{\n        AllNodes = @(\n            @{\n                NodeName = '<Connection>' # Example: 10.10.10.10\n            },\n            @{\n                NodeName = '<Connection>'\n            },\n            @{\n                NodeName = '*'\n                VMHostName = '10.23.112.237'\n            }\n        )\n    }\n```\n---\n\nAfter the **DSC Configuration** is compiled the user needs to establish a connection to the **VIServers** specified in the **vSphereNodes** before executing the **DSC Configuration**. This can be done using the PowerCLI cmdlet **Connect-VIServer**. This gives more freedom in terms of ways to connect to a server instead of only supporting connectons via username and password.\n\n### Example **VIServer** connection before calling **Start-VmwDscConfiguration** cmdlet\n\n```powershell\n$connection = Connect-ViServer -User '<Username here>' -Password '<Password here>' -Server '<vSphereNode server name here>'\n\n$dscConfiguration | Start-VmwDscConfiguration\n```\n\nWhen invoking a **VmwDscConfiguration** object that contains **vSphereNodes** but connections to those nodes are not established then a warning is printed to the console and those **Nodes** get skipped during execution.\n"
  },
  {
    "path": "Examples/Inventory_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            VCenters = @(\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                },\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                }\n            )\n        }\n    )\n}\n\nConfiguration Inventory_WhenAddingInventoryItems_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($vCenter in $AllNodes.VCenters) {\n            $Server = $vCenter.Server\n            $User = $vCenter.User\n            $Password = $vCenter.Password | ConvertTo-SecureString -asPlainText -Force\n            $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n            DatacenterFolder \"MyDatacentersFolder_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyDatacentersFolder'\n                Location = ''\n                Ensure = 'Present'\n            }\n\n            Datacenter \"MyDatacenter_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyDatacenter'\n                Location = 'MyDatacentersFolder'\n                Ensure = 'Present'\n                DependsOn = \"[DatacenterFolder]MyDatacentersFolder_$($Server)\"\n            }\n\n            Folder \"MyFolder_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyFolder'\n                Location = ''\n                DatacenterName = 'MyDatacenter'\n                DatacenterLocation = 'MyDatacentersFolder'\n                Ensure = 'Present'\n                FolderType = 'Host'\n                DependsOn = \"[Datacenter]MyDatacenter_$($Server)\"\n            }\n\n            Folder \"MyClustersFolder_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyClustersFolder'\n                Location = 'MyFolder'\n                DatacenterName = 'MyDatacenter'\n                DatacenterLocation = 'MyDatacentersFolder'\n                Ensure = 'Present'\n                FolderType = 'Host'\n                DependsOn = \"[Folder]MyFolder_$($Server)\"\n            }\n\n            Cluster \"MyCluster_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyCluster'\n                Location = 'MyFolder/MyClustersFolder'\n                DatacenterName = 'MyDatacenter'\n                DatacenterLocation = 'MyDatacentersFolder'\n                Ensure = 'Present'\n                HAEnabled = $true\n                HAAdmissionControlEnabled = $true\n                HAFailoverLevel = 3\n                HAIsolationResponse = 'DoNothing'\n                HARestartPriority = 'Low'\n                DrsEnabled = $true\n                DrsAutomationLevel = 'FullyAutomated'\n                DrsMigrationThreshold = 5\n                DrsDistribution = 0\n                MemoryLoadBalancing = 100\n                CPUOverCommitment = 500\n                DependsOn = \"[Folder]MyClustersFolder_$($Server)\"\n            }\n        }\n    }\n}\n\nConfiguration Inventory_WhenRemovingInventoryItems_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($vCenter in $AllNodes.VCenters) {\n            $Server = $vCenter.Server\n            $User = $vCenter.User\n            $Password = $vCenter.Password | ConvertTo-SecureString -asPlainText -Force\n            $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n            Cluster \"MyCluster_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyCluster'\n                Location = 'MyFolder/MyClustersFolder'\n                DatacenterName = 'MyDatacenter'\n                DatacenterLocation = 'MyDatacentersFolder'\n                Ensure = 'Absent'\n                HAEnabled = $true\n                HAAdmissionControlEnabled = $true\n                HAFailoverLevel = 3\n                HAIsolationResponse = 'DoNothing'\n                HARestartPriority = 'Low'\n                DrsEnabled = $true\n                DrsAutomationLevel = 'FullyAutomated'\n                DrsMigrationThreshold = 5\n                DrsDistribution = 0\n                MemoryLoadBalancing = 100\n                CPUOverCommitment = 500\n            }\n\n            Folder \"MyClustersFolder_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyClustersFolder'\n                Location = 'MyFolder'\n                DatacenterName = 'MyDatacenter'\n                DatacenterLocation = 'MyDatacentersFolder'\n                Ensure = 'Absent'\n                FolderType = 'Host'\n                DependsOn = \"[Cluster]MyCluster_$($Server)\"\n            }\n\n            Folder \"MyFolder_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyFolder'\n                Location = ''\n                DatacenterName = 'MyDatacenter'\n                DatacenterLocation = 'MyDatacentersFolder'\n                Ensure = 'Absent'\n                FolderType = 'Host'\n                DependsOn = \"[Folder]MyClustersFolder_$($Server)\"\n            }\n\n            Datacenter \"MyDatacenter_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyDatacenter'\n                Location = 'MyDatacentersFolder'\n                Ensure = 'Absent'\n                DependsOn = \"[Folder]MyFolder_$($Server)\"\n            }\n\n            DatacenterFolder \"MyDatacentersFolder_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyDatacentersFolder'\n                Location = ''\n                Ensure = 'Absent'\n                DependsOn = \"[Datacenter]MyDatacenter_$($Server)\"\n            }\n        }\n    }\n}\n\nInventory_WhenAddingInventoryItems_Config -ConfigurationData $script:configurationData\nInventory_WhenRemovingInventoryItems_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/VMHost_Authentication_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = '<server>'\n            User = '<user>'\n            Password = '<password>'\n            VMHostName = '<vmhost name>'\n            DomainName = '<domain name>'\n            DomainUsername = '<domain username>'\n            DomainPassword = '<domain password>'\n            DatastoreName = '<datastore name>'\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nIncludes the specified VMHost in the specified domain.\n\nCreates Nfs User 'MyNfsUser' with password 'MyNfsUserPassword1!' on the specified VMHost.\n\nCreates/modifies Role 'MyDscRole' on the specified VMHost. The applied Privileges of Role 'MyDscRole' should be: 'Host.Inventory.AddStandaloneHost',\n    'Host.Inventory.CreateCluster', 'Host.Inventory.MoveHost', 'System.Anonymous', 'System.Read' and 'System.View'.\n\nCreates VMHostAccount 'MyVMHostAccount' on the specified VMHost with password 'MyAccountPass1!'. The DSC Resource also creates Permission\n    for Principal 'MyVMHostAccount' and Role 'MyDscRole'.\n\nCreates/modifies Permission for the specified Datastore Entity, Principal 'MyVMHostAccount' and Role 'Admin' on the specified VMHost.\n    The Permission is not propagated to the child Inventory Items of Datastore Entity.\n#>\nConfiguration VMHost_Authentication_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.User, (ConvertTo-SecureString -String $AllNodes.Password -AsPlainText -Force)\n        $DomainCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.DomainUsername, (ConvertTo-SecureString -String $AllNodes.DomainPassword -AsPlainText -Force)\n\n        VMHostAuthentication VMHostAuthentication {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = $AllNodes.VMHostName\n            DomainName = $AllNodes.DomainName\n            DomainAction = 'Join'\n            DomainCredential = $DomainCredential\n        }\n\n        NfsUser NfsUser {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsUser'\n            Password = 'MyNfsUserPassword1!'\n            Ensure = 'Present'\n            DependsOn = '[VMHostAuthentication]VMHostAuthentication'\n        }\n\n        VMHostRole VMHostRole {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = 'MyDscRole'\n            Ensure = 'Present'\n            PrivilegeIds = @(\n                'Host.Inventory.AddStandaloneHost',\n                'Host.Inventory.CreateCluster',\n                'Host.Inventory.MoveHost',\n                'System.Anonymous',\n                'System.Read',\n                'System.View'\n            )\n        }\n\n        VMHostAccount VMHostAccount {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Id = 'MyVMHostAccount'\n            Ensure = 'Present'\n            Role = 'MyDscRole'\n            AccountPassword = 'MyAccountPass1!'\n            Description = 'MyVMHostAccount Description'\n            DependsOn = '[VMHostRole]VMHostRole'\n        }\n\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            EntityName = $AllNodes.DatastoreName\n            EntityLocation = ''\n            EntityType = 'Datastore'\n            PrincipalName = 'MyVMHostAccount'\n            RoleName = 'Admin'\n            Ensure = 'Present'\n            Propagate = $false\n            DependsOn = '[VMHostAccount]VMHostAccount'\n        }\n    }\n}\n\nVMHost_Authentication_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/VMHost_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            VMHosts = @(\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                },\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                }\n            )\n        }\n    )\n}\n\nConfiguration VMHostSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($vmHost in $AllNodes.VMHosts) {\n            $Server = $vmHost.Server\n            $User = $vmHost.User\n            $Password = $vmHost.Password | ConvertTo-SecureString -asPlainText -Force\n            $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n            VMHostNtpSettings \"VMHostNtpSettings_$($Server)\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                NtpServer = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org', '2.bg.pool.ntp.org')\n                NtpServicePolicy = 'automatic'\n            }\n\n            VMHostTpsSettings \"VMHostTpsSettings_$($Server)\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                ShareScanTime = 50\n                ShareScanGHz = 2\n                ShareRateMax = 1000\n                ShareForceSalting = 1\n            }\n\n            VMHostSettings \"VMHostSettings_$($Server)\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Motd = 'Hello World from motd!'\n                Issue = 'Hello World from issue!'\n            }\n\n            VMHostService \"VMHostService_$($Server)\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Key = 'TSM-SSH'\n                Policy = 'On'\n                Running = $true\n            }\n        }\n    }\n}\n\nVMHostSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/VMHost_IScsiHba_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = '<server>'\n            User = '<user>'\n            Password = '<password>'\n            VMHostName = '<vmhost name>'\n            IScsiHbaName = '<iscsi hba name>'\n            IScsiName = '<iscsi name>'\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nConfigures the CHAP settings of the specified iSCSI Host Bus Adapter by specifiying the CHAP type as 'Required' with CHAP name 'AdminOne' and CHAP password 'AdminPasswordOne'.\n    Also the Mutual CHAP is enabled with Mutual CHAP name 'AdminTwo' and Mutual CHAP password 'AdminPasswordTwo'.\n\nCreates a new iSCSI Host Bus Adapter Send target with address '10.23.84.73' on port '3260' for the specified iSCSI Host Bus Adapter. Also it configures the CHAP settings of the iSCSI Host Bus Adapter target\n    by specifiying the CHAP type as 'Required' with CHAP name 'AdminOne' and CHAP password 'AdminPasswordOne'. The Mutual CHAP is enabled with Mutual CHAP name 'AdminTwo' and Mutual CHAP password 'AdminPasswordTwo'.\n    CHAP and Mutual CHAP settings are not inherited from the iSCSI Host Bus Adapter.\n\nCreates a new iSCSI Host Bus Adapter Static target with address '10.23.84.73' on port '3260' with the specified iSCSI name for the specified iSCSI Host Bus Adapter.\n    CHAP and Mutual CHAP settings are inherited from the iSCSI Host Bus Adapter.\n#>\nConfiguration VMHost_IScsiHba_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.User, (ConvertTo-SecureString -String $AllNodes.Password -AsPlainText -Force)\n\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = 'Required'\n            ChapName = 'AdminOne'\n            ChapPassword = 'AdminPasswordOne'\n            MutualChapEnabled = $true\n            MutualChapName = 'AdminTwo'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n\n        VMHostIScsiHbaTarget VMHostIScsiHbaSendTarget {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = 'Send'\n            Ensure = 'Present'\n            InheritChap = $false\n            ChapType = 'Required'\n            ChapName = 'AdminOne'\n            ChapPassword = 'AdminPasswordOne'\n            InheritMutualChap = $false\n            MutualChapEnabled = $true\n            MutualChapName = 'AdminTwo'\n            MutualChapPassword = 'AdminPasswordTwo'\n            DependsOn = '[VMHostIScsiHba]VMHostIScsiHba'\n        }\n\n        VMHostIScsiHbaTarget VMHostIScsiHbaStaticTarget {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = 'Static'\n            Ensure = 'Present'\n            IScsiName = $AllNodes.IScsiName\n            InheritChap = $true\n            InheritMutualChap = $true\n            DependsOn = '[VMHostIScsiHba]VMHostIScsiHba'\n        }\n    }\n}\n\nVMHost_IScsiHba_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/VMHost_NetworkMigrationToDistributedSwitch_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = '<server>'\n            User = '<user>'\n            Password = '<password>'\n            VMHostName = '<vmhost name>'\n            PhysicalNicNames = @('<physical nic name 1>', '<physical nic name 2>')\n            VMKernelNicNames = @('<vmkernel nic name 1>', '<vmkernel nic name 2>')\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates Datacenter 'Datacenter' in the 'root' folder of the Inventory.\n\nCreates Distributed Switch 'MyVDSwitch' with the specified version, maximum number of ports and link discovery protocol settings in the\n    'network' folder of Datacenter 'Datacenter'.\n\nCreates two Distributed Port Groups 'Management Network' and 'VM Network' on vSphere Distributed Switch 'MyVDSwitch' with 'Static' Port Binding and '8' Ports.\n\nAdds the specified VMHost to vSphere Distributed Switch 'MyVDSwitch'.\n\nMigrates the specified Physical Network Adapters to vSphere Distributed Switch 'MyVDSwitch'. Migrates the specified VMKernel Network Adapters to\n    vSphere Distributed Switch 'MyVDSwitch' and attaches them to Port Groups 'Management Network' and 'VM Network' respectively.\n#>\nConfiguration VMHost_NetworkMigrationToDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.User, (ConvertTo-SecureString -String $AllNodes.Password -AsPlainText -Force)\n\n        Datacenter Datacenter {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = 'Datacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = 'MyVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ContactDetails = 'My Contact Details'\n            ContactName = 'My Contact Name'\n            LinkDiscoveryProtocol = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Advertise'\n            MaxPorts = 100\n            Mtu = 2000\n            Notes = 'My Notes for Distributed Switch'\n            NumUplinkPorts = 10\n            Version = '6.6.0'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        VDPortGroup VDPortGroupManagementNetwork {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = 'Management Network'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            NumPorts = 8\n            Notes = 'Management Network Notes'\n            PortBinding = 'Static'\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n\n        VDPortGroup VDPortGroupVMNetwork {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = 'VM Network'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            NumPorts = 8\n            Notes = 'VM Network Notes'\n            PortBinding = 'Static'\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n\n        VDSwitchVMHost VDSwitchVMHost {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VdsName = 'MyVDSwitch'\n            VMHostNames = @($AllNodes.VMHostName)\n            Ensure = 'Present'\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = $AllNodes.PhysicalNicNames\n            VMKernelNicNames = $AllNodes.VMKernelNicNames\n            PortGroupNames = @('Management Network', 'VM Network')\n            DependsOn = @('[VDPortGroup]VDPortGroupManagementNetwork', '[VDPortGroup]VDPortGroupVMNetwork', '[VDSwitchVMHost]VDSwitchVMHost')\n        }\n    }\n}\n\nVMHost_NetworkMigrationToDistributedSwitch_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/VMHost_Network_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = '<server>'\n            User = '<user>'\n            Password = '<password>'\n            VMHostName = '<vmhost name>'\n            VMHostUser = '<vmhost user>'\n            VMHostPassword = '<vmhost password>'\n            NicDevice = @('<physical nic name 1>', '<physical nic name 2>')\n            ActiveNic = @('<physical nic name 1>')\n            StandbyNic = @('<physical nic name 2>')\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates Datacenter 'Datacenter' in the 'root' folder of the Inventory.\n\nAdds the specified VMHost to Datacenter 'Datacenter'. The port for connecting to the VMHost is specified to be '443'.\n    Force is used to ignore the invalid SSL certificate of the VMHost.\n\nCreates/modifies Standard Switch 'MyStandardSwitch' with maximum transmission unit '1500' bytes. The specified Physical Network Adapters are bridged to\n    Standard Switch 'MyStandardSwitch' with configured beacon probing and link discovery protocol type 'CDP' and operation 'Listen'.\n    'Promiscuous mode', 'Forged Transmits' and 'Mac Changes' are enabled for Standard Switch 'MyStandardSwitch'.\n    The shaping policy for Standard Switch 'MyStandardSwitch' is 'enabled' with average bandwidth in bits per second '104857600000',\n    peak bandwidth during bursts in bits per second '104857600000' and the maximum burst size allowed in bytes '107374182400'.\n    The active and standby Nics are the specified ones, the Network Adapter teaming policy is 'LoadBalanceSrcId'. The Physical Network Adapters are notified\n    if a link fails. Rolling policy when restoring links is not used. Beacon probing as a method to validate the link status of a Physical Network Adapter is not enabled.\n\nCreates/modifies Standard Port Group 'MyStandardPortGroup' which belongs to Standard Switch 'MyStandardSwitch' with VLanId set to '1'.\n    Enables the Shaping Policy and sets the 'BurstSize', 'Average' and 'Peak bandwidth' values.\n    Enables 'Promiscuous mode', 'Forged Transmits' and 'Mac Changes'. The Security Policy settings are not inherited from the parent Standard Switch 'MyStandardSwitch'.\n    Sets the active Nics to be the specified ones, the LoadBalancing Policy to 'LoadBalanceIP' and the NetworkFailover Policy to 'LinkStatus'. The Teaming Policy\n    settings are not inherited from the parent Standard Switch 'MyStandardSwitch'.\n\nCreates VMKernel Network Adapter with the the specified IPv4 and IPv6 addresses adding it to Standard Switch 'MyStandardSwitch' and\n    Standard Port Group 'MyStandardPortGroup'. vMotion is 'enabled' for the created VMKernel Network Adapter.\n#>\nConfiguration VMHost_Network_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.User, (ConvertTo-SecureString -String $AllNodes.Password -AsPlainText -Force)\n        $VMHostCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.VMHostUser, (ConvertTo-SecureString -String $AllNodes.VMHostPassword -AsPlainText -Force)\n\n        Datacenter Datacenter {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = 'Datacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        vCenterVMHost vCenterVMHost {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            Name = $AllNodes.VMHostName\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            VMHostCredential = $VMHostCredential\n            Port = 443\n            Force = $true\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        StandardSwitch StandardSwitch {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyStandardSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n            NicDevice = $AllNodes.NicDevice\n            BeaconInterval = 1\n            LinkDiscoveryProtocolType = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Listen'\n            AllowPromiscuous = $true\n            ForgedTransmits = $true\n            MacChanges = $true\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            CheckBeacon = $false\n            ActiveNic = $AllNodes.ActiveNic\n            StandbyNic = $AllNodes.StandbyNic\n            NotifySwitches = $true\n            Policy = 'Loadbalance_srcid'\n            RollingOrder = $false\n            DependsOn = '[vCenterVMHost]vCenterVMHost'\n        }\n\n        StandardPortGroup StandardPortGroup {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyStandardPortGroup'\n            VssName = 'MyStandardSwitch'\n            Ensure = 'Present'\n            VLanId = 1\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            AllowPromiscuous = $true\n            AllowPromiscuousInherited = $false\n            ForgedTransmits = $true\n            ForgedTransmitsInherited = $false\n            MacChanges = $true\n            MacChangesInherited = $false\n            FailbackEnabled = $false\n            LoadBalancingPolicy = 'LoadBalanceIP'\n            ActiveNic = $AllNodes.ActiveNic\n            StandbyNic = $AllNodes.StandbyNic\n            UnusedNic = @()\n            NetworkFailoverDetectionPolicy = 'LinkStatus'\n            NotifySwitches = $false\n            InheritFailback = $false\n            InheritFailoverOrder = $false\n            InheritLoadBalancingPolicy = $false\n            InheritNetworkFailoverDetectionPolicy = $false\n            InheritNotifySwitches = $false\n            DependsOn = '[StandardSwitch]StandardSwitch'\n        }\n\n        VMHostVssNic VMHostVssNic {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = 'MyStandardSwitch'\n            PortGroupName = 'MyStandardPortGroup'\n            Ensure = 'Present'\n            IP = '192.168.0.1'\n            SubnetMask = '255.255.255.0'\n            Mac = '00:50:56:63:5b:0e'\n            AutomaticIPv6 = $true\n            IPv6 = @('fe80::250:56ff:fe63:5b0e/64', '200:2342::1/32')\n            IPv6ThroughDhcp = $true\n            Mtu = 4000\n            ManagementTrafficEnabled = $false\n            FaultToleranceLoggingEnabled = $false\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $false\n            DependsOn = '[StandardPortGroup]StandardPortGroup'\n        }\n    }\n}\n\nVMHost_Network_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/VMHost_Storage_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = '<server>'\n            User = '<user>'\n            Password = '<password>'\n            VMHostName = '<vmhost name>'\n            ScsiLunCanonicalName = '<scsi lun canonical name>'\n            ScsiLunPathName = '<scsi lun path name>'\n            NfsPath = '<nfs path>'\n            NfsHost = '<nfs host>'\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the configuration of the specified SCSI device by changing the Multipath policy to 'Fixed'. The SCSI disk is marked as 'local' and 'SSD'.\n\nConfigures the specified SCSI Lun path to the specified SCSI device to be 'Active' and 'Preferred'.\n\nCreates or modifies Vmfs Datastore 'MyVmfsDatastore' with 'version 5' File System and maximum file size of Vmfs: '1MB' on the specified VMHost. The StorageIOControl is 'enabled' and\n    the latency period beyond which the storage array is considered congested is '100 milliseconds'.\n\nCreates or modifies Nfs Datastore 'MyNfsDatastore' with 'version 3' File System on the specified Nfs Host and VMHost. The access mode is 'ReadOnly' and the Authentication method is 'AUTH_SYS'.\n#>\nConfiguration VMHost_Storage_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AllNodes.User, (ConvertTo-SecureString -String $AllNodes.Password -AsPlainText -Force)\n\n        VMHostScsiLun VMHostScsiLun {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            MultipathPolicy = 'Fixed'\n            IsLocal = $true\n            IsSsd = $true\n        }\n\n        VMHostScsiLunPath VMHostScsiLunPath {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ScsiLunPathName\n            ScsiLunCanonicalName = $AllNodes.ScsiLunCanonicalName\n            Active = $true\n            Preferred = $true\n            DependsOn = '[VMHostScsiLun]VMHostScsiLun'\n        }\n\n        VmfsDatastore VmfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n            FileSystemVersion = '5'\n            BlockSizeMB = 1\n            StorageIOControlEnabled = $true\n            CongestionThresholdMillisecond = 100\n            DependsOn = '[VMHostScsiLun]VMHostScsiLun'\n        }\n\n        NfsDatastore NfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $AllNodes.NfsPath\n            Ensure = 'Present'\n            NfsHost = $AllNodes.NfsHost\n            FileSystemVersion = '3'\n            AccessMode = 'ReadOnly'\n            AuthenticationMethod = 'AUTH_SYS'\n        }\n    }\n}\n\nVMHost_Storage_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/Vss_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            VMHosts = @(\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                },\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                }\n            )\n        }\n    )\n}\n\nConfiguration Vss_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($vmHost in $AllNodes.VMHosts) {\n            $Server = $vmHost.Server\n            $User = $vmHost.User\n            $Password = $vmHost.Password | ConvertTo-SecureString -asPlainText -Force\n            $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n            VMHostVss \"VMHostVSS_$Server\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Ensure = 'Present'\n                VssName = 'VSSDSC'\n                Mtu = 1500\n            }\n\n            VMHostVssSecurity \"VMHostVSSSecurity_$Server\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Ensure = 'Present'\n                VssName = 'VSSDSC'\n                AllowPromiscuous = $true\n                ForgedTransmits = $true\n                MacChanges = $true\n                DependsOn = \"[VMHostVss]VMHostVSS_$Server\"\n            }\n\n            VMHostVssShaping \"VMHostVSSShaping_$Server\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Ensure = 'Present'\n                VssName = 'VSSDSC'\n                AverageBandwidth = 100000\n                BurstSize = 100000\n                Enabled = $true\n                PeakBandwidth = 100000\n                DependsOn = \"[VMHostVss]VMHostVSS_$Server\"\n            }\n\n            VMHostVssBridge \"VMHostVSSBridge_$Server\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Ensure = 'Present'\n                VssName = 'VSSDSC'\n                BeaconInterval = 1\n                LinkDiscoveryProtocolOperation = 'Listen'\n                LinkDiscoveryProtocolProtocol = 'CDP'\n                NicDevice = @('vmnic2', 'vmnic3')\n                DependsOn = \"[VMHostVss]VMHostVSS_$Server\"\n            }\n\n            VMHostVssTeaming \"VMHostVSSTeaming_$Server\" {\n                Name = $Server\n                Server = $Server\n                Credential = $Credential\n                Ensure = 'Present'\n                VssName = 'VSSDSC'\n                CheckBeacon = $false\n                ActiveNic = @('vmnic2')\n                StandbyNic = @('vmnic3')\n                NotifySwitches = $true\n                Policy = 'Loadbalance_srcid'\n                RollingOrder = $false\n                DependsOn = \"[VMHostVssBridge]VMHostVSSBridge_$Server\"\n            }\n        }\n    }\n}\n\nVss_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Examples/vCenter_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            VCenters = @(\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                },\n                @{\n                    Server = '<server>'\n                    User = '<user>'\n                    Password = '<password>'\n                }\n            )\n        }\n    )\n}\n\nConfiguration vCenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($vCenter in $AllNodes.VCenters) {\n            $Server = $vCenter.Server\n            $User = $vCenter.User\n            $Password = $vCenter.Password | ConvertTo-SecureString -asPlainText -Force\n            $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n            HACluster \"HACluster_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyHACluster'\n                Location = ''\n                DatacenterName = 'Datacenter'\n                DatacenterLocation = ''\n                Ensure = 'Present'\n                HAEnabled = $true\n                HAAdmissionControlEnabled = $true\n                HAFailoverLevel = 3\n                HAIsolationResponse = 'DoNothing'\n                HARestartPriority = 'Low'\n            }\n\n            DrsCluster \"DrsCluster_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Name = 'MyDrsCluster'\n                Location = ''\n                DatacenterName = 'Datacenter'\n                DatacenterLocation = ''\n                Ensure = 'Present'\n                DrsEnabled = $true\n                DrsAutomationLevel = 'FullyAutomated'\n                DrsMigrationThreshold = 5\n                DrsDistribution = 0\n                MemoryLoadBalancing = 100\n                CPUOverCommitment = 500\n            }\n\n            vCenterSettings \"vCenterSettings_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                LoggingLevel = 'Warning'\n                EventMaxAgeEnabled = $false\n                EventMaxAge = 40\n                TaskMaxAgeEnabled = $false\n                TaskMaxAge = 40\n                Motd = 'Hello World from motd!'\n                Issue = 'Hello World from issue!'\n            }\n\n            vCenterStatistics \"vCenterStatistics_$($Server)\" {\n                Server = $Server\n                Credential = $Credential\n                Period = 'Day'\n                PeriodLength = 3\n                Level = 2\n                Enabled = $true\n                IntervalMinutes = 3\n            }\n        }\n    }\n}\n\nvCenter_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "FORMATTING_GUIDELINES.md",
    "content": "# Formatting Guidelines\n\nYou can use the following settings when implementing your resources (The example is with [VS Code](https://code.visualstudio.com/)):\n\n```\n {\n    \"powershell.codeFormatting.openBraceOnSameLine\": true,\n    \"powershell.codeFormatting.whitespaceBeforeOpenParen\": true,\n    \"powershell.codeFormatting.whitespaceAroundOperator\": true,\n    \"powershell.codeFormatting.whitespaceAfterSeparator\": true,\n    \"powershell.codeFormatting.newLineAfterCloseBrace\": true,\n    \"editor.tabSize\": 4,\n    \"editor.insertSpaces\": true,\n    \"editor.detectIndentation\": false,\n    \"files.trimTrailingWhitespace\": true\n }\n```\n\nVS Code formatting file is available in the .vscode folder (settings.json File).\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "Desired State Configuration Resources for VMware\n\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "LIMITATIONS.md",
    "content": "# List of known limitations\nThis is is a list of known problems and limitations regarding Microsoft PowerShell Desired State Configuration and PowerShell.\n\n## PowerShell 7.0 limitations\n- Paths used for modules containing DSC resources must not have a space in them, because the path gets cut. Bug: [PowerShell repo](https://github.com/PowerShell/PowerShell/issues/13250)\n- The **Get-DscResource** used in **New-VmwDscConfiguration** sometimes fails to retrieve composite dsc resources and results in an exception when using composite resources in configurations. \n- In Linux distributions Composite Resources are not discoverable due to a bug in PowerShell Core for finding DscResources directory. The resource not being discoverable leads to a ParseException when using a Configuration with it.\n- In some cases in linux the dsc resources don't get imported properly and the following command needs to be run preemptively in order for the dsc resources to be imported\n   ```\n    Get-DscResources -Module '$modulename'\n   ``` \n- **Invoke-DscResource** is currently having performance issues and will potentially get fixed in PowerShell 7.2\nIssue link: [PowerShell repo](https://github.com/PowerShell/PowerShell/issues/13996)\n"
  },
  {
    "path": "NOTICE.txt",
    "content": "Desired State Configuration Resources for VMware\n\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThis product is licensed to you under the BSD-2 license (the \"License\").  You may not use this product except in compliance with the BSD-2 License.\n\nThis product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.\n"
  },
  {
    "path": "README.md",
    "content": "\n\n# Desired State Configuration for VMware\n\n## Overview\nThe **Desired State Configuration for VMware** project contains **VMware.vSphereDSC** and **VMware.PSDesiredStateConfiguration** PowerShell modules.\n\nThe **VMware.vSphereDSC** module is a collection of DSC Resources. This module includes DSC resources that simplify the management of vCenter and ESXi settings, with a simple declarative language.\n\nThe **VMware.vSphereDSC** module contains resources for:\n\n- **Datacenters**, **Folders** and **Clusters**\n- **Standard** and **distributed switches** and **portgroups** and **network migration** between them\n- **Host network adapters**\n- **Datastores** (**VMFS** and **NFS**) and **storage adapters**\n- **Host accounts**, **roles** and **permissions**\n- **vCenter** and **Host** settings\n\nThe **VMware.PSDesiredStateConfiguration** module provides an alternative in-language way to compile and execute DSC Configurations. It does not require the use of LCM and supports PowerShell 7.0.\n\n## VMware.vSphereDSC\n[Getting Started with VMware.vSphereDSC](https://github.com/vmware/dscr-for-vmware/blob/master/VMware.vSphereDSC.md)<br/>\n[DSC Resources Documentation](https://github.com/vmware/dscr-for-vmware/wiki)<br/>\n\n## VMware.PSDesiredStateConfiguration\n[Getting Started with VMware.PSDesiredStateConfiguration](https://github.com/vmware/dscr-for-vmware/blob/master/VMware.PSDesiredStateConfiguration.md)<br/>\n[Known Limitations](https://github.com/vmware/dscr-for-vmware/blob/master/LIMITATIONS.md)<br/>\n\n## Branches\n\n### master\n\n[![Build Status](https://travis-ci.org/vmware/dscr-for-vmware.svg?branch=master)](https://travis-ci.org/vmware/dscr-for-vmware)\n\n**VMware.vSphereDSC** ![Coverage](https://img.shields.io/badge/coverage-91%25-brightgreen.svg?maxAge=60)\n\n**VMware.PSDesiredStateConfiguration** ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?maxAge=60)\n\nThis is the branch to which contributions should be proposed by contributors as pull requests. The content of the module releases will be from the master branch.\n\n## Contributing\n\nThe Desired State Configuration Resources for VMware project team welcomes contributions from the community. For more detailed information, refer to [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Join us on Slack\n\nIf you have any questions about the project you can join us on Slack:\n\n1. Join [VMware Code](https://code.vmware.com/web/code/join)\n2. Join the following channel:\n    ```\n    powercli-dsc-contrib\n    ```\n\n## License\n\nThe Desired State Configuration Resources for VMware is distributed under the [BSD-2](https://github.com/vmware/dscr-for-vmware/blob/master/LICENSE.txt).\n\nFor more details, please refer to the [BSD-2 License File](https://github.com/vmware/dscr-for-vmware/blob/master/LICENSE.txt).\n"
  },
  {
    "path": "STYLE_GUIDELINES.md",
    "content": "# Desired State Configuration Resources for VMware Style Guidelines & Best Practices\n\nIn order to provide clean and consistent code, please follow the [style guidelines](#style-guidelines) listed below when contributing to the repository.\n\n## Table of Contents\n\n- [Style Guidelines](#style-guidelines)\n  - [General](#general)\n    - [Descriptive Names](#descriptive-names)\n    - [Correct Parameter Usage in Function and Cmdlet Calls](#correct-parameter-usage-in-function-and-cmdlet-calls)\n    - [Correct Format for Arrays](#correct-format-for-arrays)\n    - [Correct Format for Hashtables or Objects](#correct-format-for-hashtables-or-objects)\n    - [Correct use of single and double quotes](#correct-use-of-single-and-double-quotes)\n    - [Correct Format for Comments](#correct-format-for-comments)\n    - [Correct Format for Keywords](#correct-format-for-keywords)\n  - [Whitespace](#whitespace)\n    - [No Trailing Whitespace After Backticks](#no-trailing-whitespace-after-backticks)\n    - [Newline at End of File](#newline-at-end-of-file)\n    - [No More Than Two Consecutive Newlines](#no-more-than-two-consecutive-newlines)\n    - [Two Newlines After Closing Brace](#two-newlines-after-closing-brace)\n    - [One Space Between Type and Variable Name](#one-space-between-type-and-variable-name)\n    - [One Space on Either Side of Operators](#one-space-on-either-side-of-operators)\n    - [One Space Between Keyword and Parenthesis](#one-space-between-keyword-and-parenthesis)\n  - [Functions](#functions)\n    - [Function Names Use Pascal Case](#function-names-use-pascal-case)\n    - [Function Names Use Verb-Noun Format](#function-names-use-verb-noun-format)\n    - [Function Names Use Approved Verbs](#function-names-use-approved-verbs)\n    - [Functions Have Comment-Based Help](#functions-have-comment-based-help)\n  - [Parameters](#parameters)\n    - [Parameter Names Use Pascal Case](#parameter-names-use-pascal-case)\n  - [Variables](#variables)\n    - [Variable Names Use Camel Case](#variable-names-use-camel-case)\n    - [Script, Environment and Global Variable Names Include Scope](#script-environment-and-global-variable-names-include-scope)\n- [Best Practices](#best-practices)\n  - [General Best Practices](#general-best-practices)\n    - [Avoid Using Hardcoded Computer Name](#avoid-using-hardcoded-computer-name)\n    - [Avoid Empty Catch Blocks](#avoid-empty-catch-blocks)\n    - [Ensure Null is on Left Side of Comparisons](#ensure-null-is-on-left-side-of-comparisons)\n    - [Avoid Global Variables](#avoid-global-variables)\n    - [Use Declared Local and Script Variables More Than Once](#use-declared-local-and-script-variables-more-than-once)\n    - [Use PSCredential for All Credentials](#use-pscredential-for-all-credentials)\n  - [Pester Tests](#pester-tests)\n    - [Capitalized Pester Assertions](#capitalized-pester-assertions)\n\n\n## Style Guidelines\n\n### General\n\n#### Descriptive Names\n\nUse descriptive, clear, and full names for all variables, parameters, and functions.\nAll names must be at least more than **2** characters.\nNo abbreviations should be used.\n\n**Bad:**\n\n```powershell\n$vmh = Get-VMHost\n```\n\n**Bad:**\n\n```powershell\n$sixty = 60\n```\n\n**Bad:**\n\n```powershell\nfunction Get-Something {\n    ...\n}\n```\n\n**Bad:**\n\n```powershell\nfunction Set-VMHost {\n    param (\n        $myVMH\n    )\n    ...\n}\n```\n\n**Good:**\n\n```powershell\n$vmHost = Get-VMHost\n```\n\n**Good:**\n\n```powershell\n$secondsInAMinute = 60\n```\n\n**Good:**\n\n```powershell\nfunction New-DNSConfig {\n    ...\n}\n```\n\n**Good:**\n\n```powershell\nfunction Update-DNSConfig {\n    param (\n        [VMware.Vim.HostNetworkSystem] $NetworkSystem\n    )\n    ...\n}\n```\n\n#### Correct Parameter Usage in Function and Cmdlet Calls\n\nUse named parameters for function and cmdlet calls rather than positional parameters.\nNamed parameters help other developers who are unfamiliar with your code to better\nunderstand it.\n\nWhen calling a function with many long parameters, use parameter splatting. If\nsplatting is used, then all the parameters should be in the splat.\nMore help on splatting can be found in the article\n[About Splatting](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_splatting).\n\n**Bad:**\n\nNot using named parameters.\n\n```powershell\nGet-VMHost MyVM\n```\n\n**Good:**\n\n```powershell\nGet-VMHost -Name MyVM\n```\n\n#### Correct Format for Arrays\n\nArrays should be written in one of the following formats.\n\nIf an array is declared on a single line, then there should be a single space\nbetween each element in the array. If arrays written on a single line tend to be\nlong, please consider using one of the alternative ways of writing the array.\n\n**Bad:**\n\nArray elements are not format consistently.\n\n```powershell\n$ntpServer = @( 'ntp server 1', `\n'ntp server 2', `\n'ntp server 3'\n)\n```\n\n**Bad:**\n\nThere are no single space beetween the elements in the array.\n\n```powershell\n$ntpServer = @('ntp server 1','ntp server 2','ntp server 3')\n```\n\n**Bad:**\n\nThere are multiple array elements on the same row.\n\n```powershell\n$ntpServer = @(\n    'ntp server 1', 'ntp server 2', `\n    'ntp server 3', `\n    'ntp server 4', 'ntp server 5'\n)\n```\n\n**Good:**\n\n```powershell\n$ntpServer = @('ntp server 1', 'ntp server 2', 'ntp server 3')\n```\n\n**Good:**\n\n```powershell\n$ntpServer = @(\n    'ntp server 1',\n    'ntp server 2',\n    'ntp server 3'\n)\n```\n\n**Good:**\n\n```powershell\n$ntpServer = @(\n    'ntp server 1'\n    'ntp server 2'\n    'ntp server 3'\n    'ntp server 4'\n    'ntp server 5'\n)\n```\n\n#### Correct Format for Hashtables or Objects\n\nHashtables and Objects should be written in the following format.\nEach property should be on its own line indented once.\n\n**Bad:**\n\n```powershell\n$performanceIntervalArgs = @{ Key = $currentPerformanceInterval.Key\nName = $currentPerformanceInterval.Name\nEnabled = $this.SpecifiedOrCurrentValue($this.Enabled, $currentPerformanceInterval.Enabled)\nLevel = $this.SpecifiedOrCurrentValue($this.Level, $currentPerformanceInterval.Level)\nSamplingPeriod = $this.SpecifiedOrCurrentValue($this.IntervalMinutes * $this.SecondsInAMinute, $currentPerformanceInterval.SamplingPeriod)\nLength = $this.SpecifiedOrCurrentValue($this.PeriodLength * $this.Period, $currentPerformanceInterval.Length)\n}\n```\n\n**Good:**\n\n```powershell\n$performanceIntervalArgs = @{\n    Key = $currentPerformanceInterval.Key\n    Name = $currentPerformanceInterval.Name\n    Enabled = $this.SpecifiedOrCurrentValue($this.Enabled, $currentPerformanceInterval.Enabled)\n    Level = $this.SpecifiedOrCurrentValue($this.Level, $currentPerformanceInterval.Level)\n    SamplingPeriod = $this.SpecifiedOrCurrentValue($this.IntervalMinutes * $this.SecondsInAMinute, $currentPerformanceInterval.SamplingPeriod)\n    Length = $this.SpecifiedOrCurrentValue($this.PeriodLength * $this.Period, $currentPerformanceInterval.Length)\n}\n```\n\n#### Correct use of single and double quotes\n\nSingle quotes should always be used to delimit string literals wherever possible.\nDouble quoted string literals may only be used when it contains ($) expressions\nthat need to be evaluated.\n\n**Bad:**\n\n```powershell\n$vmhost = \"VMHost with name was not found.\"\n```\n\n**Good:**\n\n```powershell\n$vmhost = 'VMHost with name was not found.'\n```\n\n**Good:**\n\n```powershell\n$vmhost = 'VMHost with name $($this.Name) was not found.'\n```\n\n#### Correct Format for Comments\n\nThere should not be any commented-out code in checked-in files.\nThe first letter of the comment should be capitalized.\n\nSingle line comments should be on their own line and start with a single pound-sign followed by a single space.\nThe comment should be indented the same amount as the following line of code.\n\nComments that are more than one line should use the ```<# #>``` format rather than the single pound-sign.\nThe opening and closing brackets should be on their own lines.\nThe brackets should be indented the same amount as the following line of code.\n\n**Bad:**\n\n```powershell\n <#\n    .DESCRIPTION\n    Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi.\n    #>\n    [DscProperty(Key)]\n    [string] $Server\n```\n\n**Bad:**\n\n```powershell\n    # Empty array specified as desired, but current is not an empty array, so update VMHost NTP Server.\n return $true\n```\n\n**Good:**\n\n```powershell\n <#\n .DESCRIPTION\n\n Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi.\n #>\n [DscProperty(Key)]\n [string] $Server\n```\n\n**Good:**\n\n```powershell\n # Empty array specified as desired, but current is not an empty array, so update VMHost NTP Server.\n return $true\n```\n\n#### Correct Format for Keywords\n\nPowerShell reserved Keywords should be in all lower case and should\nbe immediately followed by a space if there is non-whitespace characters\nfollowing (for example, an open brace).\n\nThe following is the current list of PowerShell reserved keywords in\nPowerShell 5.1:\n\n```powershell\nbegin, break, catch, class, continue, data, define do, dynamicparam, else,\nelseif, end, enum, exit, filter, finally, for, foreach, from, function\nhidden, if, in, inlinescript, param, process, return, static, switch,\nthrow, trap, try, until, using, var, while\n```\n\nThis list may change in newer versions of PowerShell.\n\nThe latest list of PowerShell reserved keywords can also be found\non [this page](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_keywords?view=powershell-5.1).\n\n**Bad:**\n\n```powershell\n# Missing space after keyword and before open bracket\nforeach($item in $list)\n```\n\n**Bad:**\n\n```powershell\n# Capital letters in keyword\nTRY\n```\n\n**Bad:**\n\n```powershell\n# Capital letters in 'in' and 'foreach' keyword\nForEach ($item In $list)\n```\n\n**Bad:**\n\n```powershell\ntry\n{\n    # Do some work\n}\n```\n\n**Good:**\n\n```powershell\nforeach ($item in $list)\n```\n\n**Good:**\n\n```powershell\ntry {\n    # Do some work\n}\n```\n\n### Whitespace\n\n#### No Trailing Whitespace After Backticks\n\nBackticks should always be directly followed by a newline.\n\n#### Newline at End of File\n\nAll files must end with a newline, see [StackOverflow.](http://stackoverflow.com/questions/5813311/no-newline-at-end-of-file)\n\n#### No More Than Two Consecutive Newlines\n\nCode should not contain more than two consecutive newlines unless they are contained in a here-string.\n\n**Bad:**\n\n```powershell\nfunction Get-VMHost {\n    Write-Verbose -Message 'Getting VMHost'\n\n\n    return $vmHost\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-VMHost {\n    Write-Verbose -Message 'Getting VMHost'\n    return $vmHost\n}\n```\n\n#### Two Newlines After Closing Brace\n\nEach closing curly brace **ending** a function, conditional block, loop, etc. should be followed by exactly two newlines unless it is directly followed by another closing brace.\nIf the closing brace is followed by another closing brace or continues a conditional or switch block, there should be only one newline after the closing brace.\n\n**Bad:**\n\n```powershell\nfunction Get-VMHost {\n    Write-Verbose -Message 'Getting VMHost'\n    return $vmHost\n} Get-VMHost\n```\n\n**Bad:**\n\n```powershell\nfunction Get-VMHost {\n    Write-Verbose -Message 'Getting VMHost'\n\n    if ($myBoolean) {\n        return $vmHost\n    }\n\n    else {\n        return 0\n    }\n\n}\nGet-VMHost\n```\n\n**Good:**\n\n```powershell\nfunction Get-VMHost {\n    Write-Verbose -Message 'Getting VMHost'\n\n    if ($myBoolean) {\n        return $vmHost\n    }\n    else {\n        return 0\n    }\n}\n\nGet-VMHost\n```\n\n#### One Space Between Type and Variable Name\n\nIf you must declare a variable type, type declarations should be separated from the variable name by a single space.\n\n**Bad:**\n\n```powershell\nfunction Get-VMHost {\n    [CmdletBinding()]\n    param ()\n\n    [VMHost]$vmHost = <VMHost>\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-VMHost {\n    [CmdletBinding()]\n    param ()\n\n    [VMHost] $vmHost = <VMHost>\n}\n```\n\n#### One Space on Either Side of Operators\n\nThere should be one blank space on either side of all operators.\n\n**Bad:**\n\n```powershell\nfunction Get-Number {\n    [CmdletBinding()]\n    param ()\n\n    $number=2+4-5*9/6\n}\n```\n\n**Bad:**\n\n```powershell\nfunction Get-Message {\n    [CmdletBinding()]\n    param ()\n\n    if ('example'-eq'example'-or'magic') {\n        Write-Verbose -Message 'Example found.'\n    }\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-Number {\n    [CmdletBinding()]\n    param ()\n\n    $number = 2 + 4 - 5 * 9 / 6\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-Message {\n    [CmdletBinding()]\n    param ()\n\n    if ('example' -eq 'example' -or 'magic') {\n        Write-Verbose -Message 'Example found.'\n    }\n}\n```\n\n#### One Space Between Keyword and Parenthesis\n\nIf a keyword is followed by a parenthesis, there should be single space between the keyword and the parenthesis.\n\n**Bad:**\n\n```powershell\nfunction Get-Message {\n    [CmdletBinding()]\n    param ()\n\n    if('example' -eq 'example' -or 'magic'){\n        Write-Verbose -Message 'Example found.'\n    }\n\n    foreach($example in $examples){\n        Write-Verbose -Message $example\n    }\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-Message {\n    [CmdletBinding()]\n    param ()\n\n    if ('example' -eq 'example' -or 'magic') {\n        Write-Verbose -Message 'Example found.'\n    }\n\n    foreach ($example in $examples) {\n        Write-Verbose -Message $example\n    }\n}\n```\n\n### Functions\n\n#### Function Names Use Pascal Case\n\nFunction names must use PascalCase. This means that each concatenated word is capitalized.\n\n**Bad:**\n\n```powershell\nfunction get-vmhost {\n    # ...\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-VMHost {\n    # ...\n}\n```\n\n#### Function Names Use Verb-Noun Format\n\nAll function names must follow the standard PowerShell Verb-Noun format.\n\n**Bad:**\n\n```powershell\nfunction VMHostGetter {\n    # ...\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-VMHost {\n    # ...\n}\n```\n\n#### Function Names Use Approved Verbs\n\nAll function names must use [approved verbs](https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx).\n\n**Bad:**\n\n```powershell\nfunction Normalize-String {\n    # ...\n}\n```\n\n**Good:**\n\n```powershell\nfunction ConvertTo-NormalizedString {\n    # ...\n}\n```\n\n#### Functions Have Comment-Based Help\n\nAll functions should have comment-based help with the correct syntax directly above the function.\nComment-help should include at least the SYNOPSIS section and a PARAMETER section for each parameter.\n\n**Bad:**\n\n```powershell\n# Creates an event\nfunction New-Event {\n    param (\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [String]\n        $Message,\n\n        [Parameter()]\n        [ValidateSet('operational', 'debug', 'analytic')]\n        [String]\n        $Channel = 'operational'\n    )\n    # Implementation...\n}\n```\n\n**Good:**\n\n```powershell\n<#\n    .SYNOPSIS\n        Creates an event\n\n    .PARAMETER Message\n        Message to write\n\n    .PARAMETER Channel\n        Channel where message should be stored\n\n    .EXAMPLE\n        New-Event -Message 'Attempting to connect to server' -Channel 'debug'\n#>\nfunction New-Event {\n    param (\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [String]\n        $Message,\n\n        [Parameter()]\n        [ValidateSet('operational', 'debug', 'analytic')]\n        [String]\n        $Channel = 'operational'\n    )\n    # Implementation\n}\n```\n\n### Parameters\n\n#### Parameter Names Use Pascal Case\n\nAll parameters must use PascalCase.  This means that each concatenated word is capitalized.\n\n**Bad:**\n\n```powershell\nfunction Get-VMHost {\n    [CmdletBinding()]\n    param (\n        $VMHOSTNAME\n    )\n}\n```\n\n**Bad:**\n\n```powershell\nfunction Get-VMHost {\n    [CmdletBinding()]\n    param (\n        $vmhost\n    )\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-VMHost {\n    [CmdletBinding()]\n    param (\n        [Parameter()]\n        $VMHost\n    )\n}\n```\n\n### Variables\n\n#### Variable Names Use Camel Case\n\nVariable names should use camelCase.\n\n**Bad:**\n\n```powershell\nfunction Write-Log {\n    $VerboseMessage = 'New log message'\n    Write-Verbose $VerboseMessage\n}\n```\n\n**Bad:**\n\n```powershell\nfunction Write-Log {\n    $verbosemessage = 'New log message'\n    Write-Verbose $verbosemessage\n}\n```\n\n**Good:**\n\n```powershell\nfunction Write-Log {\n    $verboseMessage = 'New log message'\n    Write-Verbose $verboseMessage\n}\n```\n\n#### Script, Environment and Global Variable Names Include Scope\n\nScript, environment, and global variables must always include their scope in the variable name unless the 'using' scope is needed.\nThe script and global scope specifications should be all in lowercase.\nScript and global variable names following the scope should use camelCase.\n\n**Bad:**\n\n```powershell\n$fileCount = 0\n$GLOBAL:MYRESOURCENAME = 'MyResource'\n\nfunction New-File {\n    $fileCount++\n    Write-Verbose -Message \"Adding file to $MYRESOURCENAME to $ENV:COMPUTERNAME.\"\n}\n```\n\n**Good:**\n\n```powershell\n$script:fileCount = 0\n$global:myResourceName = 'MyResource'\n\nfunction New-File {\n    $script:fileCount++\n    Write-Verbose -Message \"Adding file to $global:myResourceName to $env:computerName.\"\n}\n```\n\n## Best Practices\n\n### General Best Practices\n\n#### Avoid Using Hardcoded Computer Name\n\nUsing hardcoded computer names exposes sensitive information on your machine.\nUse a parameter or environment variable instead if a computer name is necessary.\n\n**Bad:**\n\n```powershell\nInvoke-Command -Port 0 -ComputerName 'hardcodedName'\n```\n\n**Good:**\n\n```powershell\nInvoke-Command -Port 0 -ComputerName $env:computerName\n```\n\n#### Avoid Empty Catch Blocks\n\nEmpty catch blocks are not necessary.\nMost errors should be thrown or at least acted upon in some way.\nIf you really don't want an error to be thrown or logged at all, use the ErrorAction parameter with the SilentlyContinue value instead.\n\n**Bad:**\n\n```powershell\ntry {\n    Get-Command -Name Invoke-NotACommand\n}\ncatch {}\n```\n\n**Good:**\n\n```powershell\nGet-Command -Name Invoke-NotACommand -ErrorAction SilentlyContinue\n```\n\n#### Ensure Null is on Left Side of Comparisons\n\nWhen comparing a value to ```$null```, ```$null``` should be on the left side of the comparison.\nThis is due to an issue in PowerShell.\nIf ```$null``` is on the right side of the comparison and the value you are comparing it against happens to be a collection, PowerShell will return true if the collection *contains* ```$null``` rather than if the entire collection actually *is* ```$null```.\nEven if you are sure your variable will never be a collection, for consistency, please ensure that ```$null``` is on the left side of all comparisons.\n\n**Bad:**\n\n```powershell\nif ($myArray -eq $null) {\n    Remove-AllItems\n}\n```\n\n**Good:**\n\n```powershell\nif ($null -eq $myArray) {\n    Remove-AllItems\n}\n```\n\n#### Avoid Global Variables\n\nAvoid using global variables whenever possible.\nThese variables can be edited by any other script that ran before your script or is running at the same time as your script.\nUse them only with extreme caution, and try to use parameters or script/local variables instead.\n\n**Bad:**\n\n```powershell\n$global:configurationName = 'MyConfigurationName'\n...\nSet-MyConfiguration -ConfigurationName $global:configurationName\n```\n\n**Good:**\n\n```powershell\n$script:configurationName = 'MyConfigurationName'\n...\nSet-MyConfiguration -ConfigurationName $script:configurationName\n```\n\n#### Use Declared Local and Script Variables More Than Once\n\nDon't declare a local or script variable if you're not going to use it.\nThis creates excess code that isn't needed\n\n#### Use PSCredential for All Credentials\n\nPSCredentials are more secure than using plaintext username and passwords.\n\n**Bad:**\n\n```powershell\nfunction Get-Settings {\n    param (\n        [String]\n        $Username\n\n        [String]\n        $Password\n    )\n    ...\n}\n```\n\n**Good:**\n\n```powershell\nfunction Get-Settings {\n    param (\n        [PSCredential]\n        [Credential()]\n        $UserCredential\n    )\n}\n```\n\n### Pester Tests\n\n#### Capitalized Pester Assertions\n\nPester assertions should all start with capital letters. This makes the code easier to read.\n\n**Bad:**\n\n```powershell\nit 'Should return something' {\n    get-targetresource @testParameters | should -be 'something'\n}\n```\n\n**Good:**\n\n```powershell\nIt 'Should return something' {\n    Get-TargetResource @testParameters | Should -Be 'something'\n}\n```\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Private/ClassNode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that defines each class in the VMware.PSDesiredStateConfiguration module as a\nNode with Edges and Dependencies - other classes with which the class interacts.\n#>\nclass ClassNode {\n    [string] $Name\n\n    [string] $FileName\n\n    [string[]] $Dependencies\n\n    [ClassNode[]] $Edge\n\n    <#\n    .DESCRIPTION\n\n    Adds the specified dependency class name to the list of dependencies\n    for the current ClassNode.\n    #>\n    [void] AddDependency([string] $dependency) {\n        if ($null -eq $this.Dependencies) {\n            $this.Dependencies = @()\n        }\n\n        $this.Dependencies += $dependency\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the specified edge ClassNode to the list of edges\n    for the current ClassNode.\n    #>\n    [void] AddEdge([ClassNode] $edge) {\n        if ($null -eq $this.Edge) {\n            $this.Edge = @()\n        }\n\n        $this.Edge += $edge\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Private/ClassResolver.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that resolves the dependencies between the classes in the VMware.PSDesiredStateConfiguration\nmodule - the order of importing each class when the module is loaded.\n#>\nclass ClassResolver {\n    [System.IO.FileInfo[]] $ClassFiles\n\n    ClassResolver([System.IO.FileInfo[]] $classFiles) {\n        $this.ClassFiles = $classFiles\n    }\n\n    <#\n    .DESCRIPTION\n\n    Orders the specified class files depending on the other classes that they depend on. A dependency of a class\n    can be inheriting another class, property or method type or method argument. Each dependency class is added\n    before the class that depends on it.\n    #>\n    [System.IO.FileInfo[]] OrderClassFiles() {\n        $orderedFiles = @()\n        $resolvedClasses = New-Object System.Collections.Generic.List[ClassNode]\n\n        $classNodes = $this.AddDependenciesBetweenClasses()\n\n        foreach ($classNode in $classNodes) {\n            $this.GetOrderedClasses($classNode, ([ref] $resolvedClasses))\n        }\n\n        foreach ($class in $resolvedClasses) {\n            $containedFile = $orderedFiles | Where-Object -FilterScript { $_.Name -eq $class.FileName }\n            if ($null -eq $containedFile) {\n                $file = $this.ClassFiles | Where-Object -FilterScript { $_.Name -eq $class.FileName }\n                $orderedFiles += $file\n            }\n        }\n\n        return $orderedFiles\n    }\n\n    hidden [ClassNode[]] AddDependenciesBetweenClasses() {\n        $classNodes = @()\n        $classNames = $this.ClassFiles.BaseName\n\n        foreach ($file in $this.ClassFiles) {\n            $classNode = [ClassNode]::new()\n            $classNode.Name = $file.BaseName\n            $classNode.FileName = $file.Name\n\n            $classContentRaw = Get-Content -Path $file.FullName -Raw\n            $tokens = [System.Management.Automation.PSParser]::Tokenize($classContentRaw, [ref]$null)\n\n            $typesUsedInClass = $tokens | Where-Object -FilterScript { $_.Type -eq 'Type' }\n            foreach ($type in $typesUsedInClass) {\n                <#\n                    When the class is a property or method type or array of the specified type,\n                    the brackets '[' and ']' must be removed to retrieve the correct type.\n                #>\n                $typeName = $null\n                if ($type.Content -Match '\\[') {\n                    $splittedTypeContent = $type.Content.Split('[').Split(']')\n                    $typeName = $splittedTypeContent[1]\n                }\n                else {\n                    $typeName = $type.Content\n                }\n\n                if ($typeName -ne $classNode.Name) {\n                    if ($classNames -Contains $typeName -and $classNode.Dependencies -NotContains $typeName) {\n                        $classNode.AddDependency($typeName)\n                    }\n                }\n            }\n\n            $classNodes += $classNode\n        }\n\n        foreach ($classNode in $classNodes) {\n            foreach ($classNodeDependency in $classNode.Dependencies) {\n                $edge = $classNodes | Where-Object -FilterScript { $_.Name -eq $classNodeDependency }\n                $classNode.AddEdge($edge)\n            }\n        }\n\n        return $classNodes\n    }\n\n    hidden [void] GetOrderedClasses([ClassNode] $classNode, [ref] $resolvedClasses) {\n        foreach ($edge in $classNode.Edge) {\n            $containedEdge = $resolvedClasses.Value | Where-Object -FilterScript { $_.Name -eq $edge.Name }\n            if ($null -eq $containedEdge) {\n                $this.GetOrderedClasses($edge, ([ref] $resolvedClasses.Value))\n            }\n        }\n\n        $containedClassNode = $resolvedClasses.Value | Where-Object -FilterScript { $_.Name -eq $classNode.Name }\n        if ($null -eq $containedClassNode) {\n            $resolvedClasses.Value.Add($classNode)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/BaseDscMethodResult.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nBase type for Invoke-VmwDscConfigurations results.\n#>\nclass BaseDscMethodResult {\n    [string] $NodeName\n\n    BaseDscMethodResult([string] $nodeName) {\n        $this.NodeName = $nodeName\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/CompositeResourceGetMethodResult.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nUsed for get method result to represent composite DSC Resources.\n#>\nclass CompositeResourceGetMethodResult {\n    [string] $Name\n\n    [PsObject[]] $InnerResources\n\n    CompositeResourceGetMethodResult([string] $name, [PsObject[]] $innerResources) {\n        $this.Name = $name\n        $this.InnerResources = $innerResources\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/Constants.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:DuplicateResourceException = \"Duplicate resources found with name {0} and type {1}\"\n$script:DependsOnResourceNotFoundException = \"DependsOn resource of {0} with name {1} was not found\"\n$script:DscResourceNotFoundException = \"Resource of type: {0} was not found. Try importing it in the configuration file with Import-DscResource\"\n$script:ExperimentalFeatureNotEnabledInPsCoreException = 'This module depends on the Invoke-DscResource cmdlet and in order to use it must be enabled with \"Enable-ExperimentalFeature PSDesiredStateConfiguration.InvokeDscResource\"'\n$script:NoVsphereConnectionsFoundException = \"No active vSphere connection found. Please establish a connection first!\"\n$script:NestedMoreThanASingleLevelException = \"Nesting configurations, composite resources or regular dsc resources more than a single level of nesting is not supported\"\n$script:NestedNodesAreNotSupportedException = \"Nesting nodes is not supported.\"\n$script:TooManyConnectionOnASingleVCenterException = \"More than 1 active connection found for '{0}'. Please establish only a single connection.\"\n$script:VsphereNodesAreOnlySupportedOnPowerShellCoreException = \"In order to be able to run vSphere Nodes please switch to a Core version of PowerShell\"\n$script:NoConfigurationDetectedForInvokeException = \"No configuration has been found! Please supply a configuration via a parameter.\"\n$script:DscResourcesWithDuplicateKeyPropertiesException = \"The Dsc Resource of type '{0}' has multiple entries with the same key properties values. Please ensure all key properties have unique values.\"\n\n$script:ConfigurationDataDoesNotContainAllNodesException = \"ConfigurationData parameter must contain an AllNodes key.\"\n$script:ConfigurationDataAllNodesKeyIsNotAnArrayException = \"ConfigurationData AllNodes key must be an array.\"\n$script:ConfigurationDataNodeEntryInAllNodesIsNotAHashtableException = \"ConfigurationData AllNodes entries must be hashtables.\"\n$script:ConfigurationDataNodeEntryInAllNodesDoesNotContainNodeNameException = \"ConfigurationData AllNodes entries must contain an entry named NodeName.\"\n$script:DuplicateEntryInAllNodesException = \"ConfigurationData AllNodes must not have entries with the same NodeName.\"\n\n$script:NoVsphereConnectionsFoundForNodeWarning = \"No active vSphere connection found for node with name '{0}' and will be skipped. Please establish a connection.\"\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationBlock.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass DscConfigurationBlock {\n    [string] $Name\n\n    [System.Collections.Hashtable] $ConfigurationData\n\n    [DscConfigurationBlockExtent] $Extent\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationBlockExtent.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass DscConfigurationBlockExtent {\n    [string] $StartLine\n\n    [string] $Text\n\n    [string] $EndLine\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationCompiler.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nUsed for parsing and compiling a DSC Configuration into a DSC object.\n#>\nclass DscConfigurationCompiler {\n    hidden [string] $ConfigName\n    hidden [Hashtable] $Parameters\n    hidden [Hashtable] $ConfigurationData\n    hidden [Hashtable] $ResourceNameToInfo\n    hidden [Hashtable] $CompositeResourceToScriptBlock\n    hidden [bool] $IsNested\n\n    DscConfigurationCompiler([string] $ConfigName, [Hashtable] $Parameters, [Hashtable] $ConfigurationData) {\n        $this.ConfigName = $ConfigName\n        $this.Parameters = $Parameters\n\n        # configurationData gets cloned because it's state gets mutated during execution.\n        if ($null -ne $ConfigurationData) {\n            $this.ConfigurationData = $this.DeepCloneUtil($ConfigurationData)\n        }\n\n        $this.CompositeResourceToScriptBlock = @{}\n        $this.ResourceNameToInfo = @{}\n        $this.IsNested = $false\n    }\n\n    <#\n    .DESCRIPTION\n    Compiles the DSC Configuration and returns an configuration object\n    #>\n    [VmwDscConfiguration] CompileDscConfiguration([DscConfigurationBlock] $dscConfigurationBlock) {\n        Write-Verbose \"Starting compilation process\"\n\n        Write-Verbose \"Validating ConfigurationData\"\n\n        # validate the configurationData\n        $this.ValidateConfigurationData()\n\n        # parse and compile the configuration\n        $dscItems = $this.CompileDscConfigurationUtil($dscConfigurationBlock, $this.Parameters)\n\n        Write-Verbose \"Handling nodes\"\n\n        # combine nodes of same instanceName and bundle nodeless resources\n        $dscNodes = $this.CombineNodes($dscItems)\n\n        for ($i = 0; $i -lt $dscNodes.Length; $i++) {\n            Write-Verbose (\"Ordering DSC Resources of node: \" + $dscNodes[$i].InstanceName)\n\n            # parse the dsc resources and their dependencies into a sorted array\n            $dscNodes[$i].Resources = $this.OrderResources($dscNodes[$i].Resources)\n        }\n\n        $dscConfigurationObject = [VmwDscConfiguration]::new(\n            $this.ConfigName,\n            $dscNodes\n        )\n\n        return $dscConfigurationObject\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a deep clone of an object.\n    #>\n    hidden [PsObject] DeepCloneUtil([PsObject] $ObjectToClone) {\n        $memStream = New-Object -TypeName 'IO.MemoryStream'\n        $formatter = new-object -TypeName 'Runtime.Serialization.Formatters.Binary.BinaryFormatter'\n\n        $formatter.Serialize($memStream, $ObjectToClone)\n\n        $memStream.Position = 0\n\n        $clonedObject = $formatter.Deserialize($memStream)\n\n        return $clonedObject\n    }\n\n    <#\n    .DESCRIPTION\n    Ensures ConfigurationData is valid if present.\n    Throws an exception if ConfigurationData is invalid.\n    #>\n    hidden [void] ValidateConfigurationData() {\n        # if the configurationData is null nothing is validated\n        if ($null -eq $this.ConfigurationData) {\n            return\n        }\n\n        # must contain AllNodes key\n        if (-not $this.ConfigurationData.ContainsKey('AllNodes')) {\n            throw $script:ConfigurationDataDoesNotContainAllNodesException\n        }\n\n        # AllNodes key must be array\n        if ($this.ConfigurationData['AllNodes'] -isnot [Array]) {\n            throw $script:ConfigurationDataAllNodesKeyIsNotAnArrayException\n        }\n\n        # hashset for detecting entries with same nodeName property\n        $duplicateNodeNameSet = New-Object -TypeName 'System.Collections.Generic.HashSet[string]' -ArgumentList ([System.StringComparer]::OrdinalIgnoreCase)\n\n        # will contain the common nodes setting marked with '*'\n        $commonNodesConfiguration = $null\n\n        foreach ($nodeConfiguration in $this.ConfigurationData['AllNodes']) {\n            # each node entry must be a hashtable\n            if ($nodeConfiguration -isnot [Hashtable]) {\n                throw $script:ConfigurationDataNodeEntryInAllNodesIsNotAHashtableException\n            }\n\n            # each node entry must have a NodeName property\n            if (-not $nodeConfiguration.ContainsKey('NodeName')) {\n                throw $script:ConfigurationDataNodeEntryInAllNodesDoesNotContainNodeNameException\n            }\n\n            # checks if nodeName is added to the hashset or if it's already in.\n            $isNodeNameAdded = $duplicateNodeNameSet.Add($nodeConfiguration['NodeName'])\n\n            if (-not $isNodeNameAdded) {\n                throw $script:DuplicateEntryInAllNodesException\n            }\n\n            if($nodeConfiguration['NodeName'] -eq '*')\n            {\n                $commonNodesConfiguration = $nodeConfiguration\n            }\n        }\n\n        # remove the common node settings entry\n        $this.ConfigurationData['AllNodes'] = $this.ConfigurationData['AllNodes'] | Where-Object { $_.NodeName -ne '*' }\n\n        # add the common node settings entry properties to each node configuration\n        if ($null -ne $commonNodesConfiguration) {\n            foreach($nodeConfiguration in $this.ConfigurationData['AllNodes']) {\n                foreach($nodeKey in $commonNodesConfiguration.Keys)\n                {\n                    if(-not $nodeConfiguration.ContainsKey($nodeKey))\n                    {\n                        $nodeConfiguration[$nodeKey] = $commonNodesConfiguration[$nodeKey]\n                    }\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n    Orders a collection of Dsc resources based on their DependsOn property and check for duplicate ids.\n    When a duplicate is found an exception is thrown.\n    #>\n    hidden [VmwDscResource[]] OrderResources([VmwDscResource[]] $DscResources) {\n        # place resource in an oredered hashtable in order to check for duplicates\n        $dscResOrderedDict = [ordered]@{}\n        foreach ($resource in $DscResources) {\n            $key = $resource.GetId()\n\n            if ($dscResOrderedDict.Contains($key)) {\n                throw ($script:DuplicateResourceException -f $resource.InstanceName, $resource.ResourceType)\n            }\n\n            $dscResOrderedDict[$key] = $resource\n        }\n\n        # creates graph with the created ordered hashtable\n        $resGraph = [VmwDscResourceGraph]::new($dscResOrderedDict)\n\n        # sort the resources based on their dependencies\n        $sortedDscResArr = $resGraph.TopologicalSort()\n\n        $result = New-Object -TypeName 'System.Collections.ArrayList'\n\n        # iterate the ordered resources to find composite resources and retrieve their inner resources\n        for ($i = 0; $i -lt $sortedDscResArr.Count; $i++) {\n            $resource = $sortedDscResArr[$i]\n\n            if ($resource.GetIsComposite()) {\n                $innerResources = $resource.GetInnerResources()\n\n                # this sorts the composite resource dsc resources and handles inner DependsOn properties\n                $parsedInnerResources = $this.OrderResources($innerResources)\n\n                $resource.SetInnerResources($parsedInnerResources)\n            }\n\n            $result.Add($resource) | Out-Null\n        }\n\n        return $result.ToArray()\n    }\n\n    <#\n    .DESCRIPTION\n    Handles the main logic for compiling a dsc configuration\n    #>\n    hidden [DscItem[]] CompileDscConfigurationUtil([DscConfigurationBlock] $dscConfigurationBlock, [Hashtable] $Parameters) {\n        $dscConfigurationParser = [DscConfigurationParser]::new()\n\n        Write-Verbose \"Parsing configuration block of $($dscConfigurationBlock.Name)\"\n\n        <#\n            The Verbose preference is set to 'SilentlyContinue' to suppress the\n            Verbose output of 'Import-DscResource' when importing the 'VMware.vSphereDSC' module.\n        #>\n        $savedVerbosePreference = $Global:VerbosePreference\n        $Global:VerbosePreference = 'SilentlyContinue'\n\n        # parse the configuration, run Import-DscResource statements and retrieve the found resources/nested configurations\n        $parseResult = $dscConfigurationParser.ParseDscConfiguration($dscConfigurationBlock)\n\n        $Global:VerbosePreference = $savedVerbosePreference\n\n        Write-Verbose \"Preparing functions for dsc resources and nodes\"\n\n        $resources = $parseResult.ResourceNameToInfo\n        $foundDscResourcesList = New-Object -TypeName 'System.Collections.ArrayList'\n        # divide the regular resources and composite/nested into separate groups\n        foreach ($resourceName in $resources.Keys) {\n            $this.ResourceNameToInfo[$resourceName] = $resources[$resourceName]\n\n            $resourceInfo = $this.ResourceNameToInfo[$resourceName]\n\n            if (($resourceInfo.ImplementedAs.ToString() -eq 'Composite' -or $resourceInfo.ImplementedAs.ToString() -eq 'Configuration') -and\n                (-not $this.CompositeResourceToScriptBlock.ContainsKey($resourceName))) {\n                $this.CompositeResourceToScriptBlock[$resourceName] = (Get-Command $resourceName -ErrorAction 'SilentlyContinue')\n            } else {\n                $foundDscResourcesList.Add($resourceName) | Out-Null\n            }\n        }\n\n        # create functions for nodes and resources to be used in InvokeWithContext\n        $functionsToDefine = $this.CreateFunctionsToDefine($foundDscResourcesList.ToArray())\n\n        Write-Verbose \"Preparing default variables and variables from ConfigurationData\"\n\n        # create variable objects for InvokeWithContext from ConfigurationData and common dsc configuration variables\n        $variablesToDefine = $this.CreateVariablesToDefine()\n\n        $configScriptBlock = $parseResult.ScriptBlock\n\n        Write-Verbose \"Executing Configuration scriptblock to extract resources and nodes\"\n\n        $dscItems = $configScriptBlock.InvokeWithContext($functionsToDefine, $variablesToDefine, $Parameters)\n\n        return $dscItems\n    }\n\n    <#\n    .DESCRIPTION\n    Creates variables that will be used during the dsc configuration scriptblock execution\n    #>\n    hidden [Array] CreateVariablesToDefine() {\n        $result = @(\n            if ($null -ne $this.ConfigurationData) {\n                New-Object -TypeName PSVariable -ArgumentList ('ConfigurationData', $this.ConfigurationData )\n                New-Object -TypeName PSVariable -ArgumentList ('AllNodes', $this.ConfigurationData.AllNodes )\n            }\n        )\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n    Combines nodes of same name and adds nodeless resources to a default localhost node.\n    #>\n    hidden [VmwDscNode[]] CombineNodes([DscItem[]] $DscItemsArr) {\n        $nodeLessResources = New-Object -TypeName 'System.Collections.ArrayList'\n        $connectionNodes = [ordered]@{}\n\n        for ($i = 0; $i -lt $DscItemsArr.Count; $i++) {\n            # can be a node or nodeless resource\n            $dscItem = $DscItemsArr[$i]\n\n            # keep nodeless resources in a separate array in order to add them to the default 'localhost' node\n            if ($dscItem -is [VmwDscResource]) {\n                $nodeLessResources.Add($dscItem) | Out-Null\n\n                continue\n            }\n\n            if ($dscItem -is [VmwDscNode]) {\n                if (-not $connectionNodes.Contains($dscItem.InstanceName)) {\n                    $connectionNodes[$dscItem.InstanceName] = $dscItem\n                } else {\n                    $connectionNodes[$dscItem.InstanceName] += $dscItem\n                }\n\n                continue\n            }\n\n            foreach ($connection in $dscItem.Connections) {\n                if (-not $connectionNodes.Contains($connection)) {\n                    $nodeObject = New-Object -TypeName $dscItem.Type -ArgumentList $connection, $dscItem.Resources\n\n                    $connectionNodes[$connection] = $nodeObject\n\n                    continue\n                }\n\n                $connectionNodes[$connection].Resources += $dscItem.Resources\n            }\n        }\n\n        # group nodeless resources\n        if ($nodeLessResources.Count -gt 0) {\n            $localHostConnection = 'localhost'\n\n            if ($connectionNodes.Contains($localHostConnection)) {\n                $connectionNodes[$localHostConnection].Resources += $nodeLessResources.ToArray()\n            } else {\n                $localhostNode = [VmwDscNode]::new(\n                    $localHostConnection,\n                    $nodeLessResources.ToArray()\n                )\n\n                $connectionNodes[$localHostConnection] = $localHostNode\n            }\n        }\n\n        return @( $connectionNodes.Values )\n    }\n\n    <#\n    .DESCRIPTION\n    Creates functions for handling the dsc resources and dynamic keywords.\n    #>\n    hidden [Hashtable] CreateFunctionsToDefine([System.String[]] $foundDscResourcesArr) {\n        $functionsToDefine = @{}\n\n        $dscResourceScriptBlock = {\n            Param(\n                [string]\n                $Name,\n                [ScriptBlock]\n                $Properties\n            )\n\n            $this.ParseDscResource($Name, $Properties)\n        }\n\n        foreach ($dscResourceName in $foundDscResourcesArr) {\n            $functionsToDefine[$dscResourceName] = $dscResourceScriptBlock\n        }\n\n        $nestedConfigAndCompositeResScriptBlock = {\n            Param(\n                [string]\n                $NestedConfigName,\n\n                [ScriptBlock]\n                $Properties\n            )\n\n            if ($this.IsNested) {\n                throw $script:NestedMoreThanASingleLevelException\n            }\n\n            $this.IsNested = $true\n\n            # parse prop scriptblock into a hashtable\n            $propsAsText = $Properties.Ast.Extent.Text\n            $propsAsText = $propsAsText.Insert(0, '@')\n            $parsedProps = Invoke-Expression $propsAsText\n\n            $dependsOn = $null\n\n            # check if dependsOn property is present and removes it\n            if ($parsedProps.ContainsKey('DependsOn')) {\n                $dependsOn = $parsedProps['DependsOn']\n                $parsedProps.Remove('DependsOn')\n            }\n\n            # get type of the configuration from the stack\n            $configType = Get-PSCallStack | Select-Object -First 1 | Select-Object -ExpandProperty Command\n\n            # retrieve internal resources\n            $compositeDscResource = $this.CompositeResourceToScriptBlock[$configType]\n            $dscConfigurationBlock = $this.MapCompositeDSCResourceToDscConfigurationBlock($compositeDscResource)\n            $innerResources = $this.CompileDscConfigurationUtil($dscConfigurationBlock, $parsedProps)\n\n            $compositeResourceProps = @{}\n\n            # adds the dependsOn property on each resource in the composite resource\n            if ($null -ne $dependsOn) {\n                $compositeResourceProps['DependsOn'] = $dependsOn\n            }\n\n            $moduleName = $null\n            if ($this.ResourceNameToInfo.ContainsKey($configType)) {\n                $moduleName = @{\n                    ModuleName = $this.ResourceNameToInfo[$configType].ModuleName\n                    RequiredVersion = $this.ResourceNameToInfo[$configType].Version\n                }\n            }\n\n            $compositeResource = [VmwDscResource]::new(\n                $NestedConfigName,\n                $configType,\n                $moduleName,\n                $compositeResourceProps,\n                $innerResources\n            )\n\n            $this.IsNested = $false\n\n            return $compositeResource\n        }\n\n        foreach ($configName in $this.CompositeResourceToScriptBlock.Keys) {\n            $functionsToDefine[$configName] = $nestedConfigAndCompositeResScriptBlock\n        }\n\n        $nodeLogicScriptBlock = {\n            Param (\n                [string[]]\n                $Connections,\n\n                [ScriptBlock]\n                $scriptBlock\n            )\n\n            if ($this.IsNested) {\n                throw $script:NestedNodesAreNotSupportedException\n            }\n\n            $type = Get-PSCallStack | Select-Object -First 1 -ExpandProperty Command\n            $vmwNodeResult = New-Object -TypeName 'System.Collections.ArrayList'\n\n            # when multipe connections are specified for a node blocke\n            # each connection gets made into a different node object\n            foreach ($connection in $Connections) {\n                $nodeObject = $null\n\n                # resources are created here to avoid duplicates via reference\n                $dscResources = . $scriptBlock\n\n                if ($type -eq 'Node') {\n                    $nodeObject = [VmwDscNode]::new($connection, $dscResources)\n                } elseif ($type -eq 'vSphereNode') {\n                    $nodeObject = [VmwVsphereDscNode]::new($connection, $dscResources)\n                }\n\n                $vmwNodeResult.Add($nodeObject) | Out-Null\n            }\n\n            $vmwNodeResult.ToArray()\n        }\n\n        $functionsToDefine['Node'] = $nodeLogicScriptBlock\n        $functionsToDefine['vSphereNode'] = $nodeLogicScriptBlock\n\n        return $functionsToDefine\n    }\n\n    <#\n    .DESCRIPTION\n\n    Maps the specified PowerShell ConfigurationInfo object to a DSC Configuration Block by retrieving the name of the DSC Configuration and the text\n    information for it - start and end line and also the text of the DSC Configuration.\n    #>\n    hidden [DscConfigurationBlock] MapCompositeDSCResourceToDscConfigurationBlock([System.Management.Automation.ConfigurationInfo] $compositeDscResource) {\n        $dscConfigurationBlock = [DscConfigurationBlock]::new()\n\n        $dscConfigurationBlock.Name = $compositeDscResource.Name\n        $dscConfigurationBlock.Extent = [DscConfigurationBlockExtent]::new()\n\n        $dscConfigurationBlock.Extent.StartLine = $compositeDscResource.ScriptBlock.Ast.Extent.StartLineNumber\n        $dscConfigurationBlock.Extent.EndLine = $compositeDscResource.ScriptBlock.Ast.Extent.EndLineNumber\n        $dscConfigurationBlock.Extent.Text = $compositeDscResource.ScriptBlock.Ast.Extent.Text\n\n        return $dscConfigurationBlock\n    }\n\n    <#\n    .DESCRIPTION\n    Handles the logic for dsc resources and composite dsc resources.\n    #>\n    hidden [VmwDscResource] ParseDscResource([string] $Name, [ScriptBlock] $Properties) {\n        $moduleName = [string]::Empty\n\n        # gets the resource type by getting the callStack and selecting the top first call which is this function call\n        $resourceType = Get-PSCallStack | Select-Object -Skip 1 -First 1 -ExpandProperty Command\n\n        if (-not $this.ResourceNameToInfo.ContainsKey($resourceType)) {\n             # if the resource is not found throws exception\n             throw ($script:DscResourceNotFoundException -f $resourceType)\n        }\n\n        $resourceInfo = $this.ResourceNameToInfo[$resourceType]\n        $moduleName = @{\n            ModuleName = $resourceInfo.Module.Name\n            RequiredVersion = $resourceInfo.Module.Version\n        }\n\n        $propsAsText = $Properties.Ast.Extent.Text\n        $propsAsText = $propsAsText.Insert(0, '@')\n        $parsedProps = Invoke-Expression $propsAsText\n\n        $result = [VmwDscResource]::new(\n            $Name,\n            $resourceType,\n            $moduleName,\n            $parsedProps\n        )\n\n        return $result\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationFileParser.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass DscConfigurationFileParser {\n    <#\n    .DESCRIPTION\n\n    Parses the PowerShell script file containing the DSC Configurations by performing the following steps:\n\n    1. Extracts each DSC Configuration defined in the file and converts it into a DscConfigurationBlock object, which contains\n    the following information: the name of the DSC Configuration, the configurationData defined as hashtable which is needed\n    if the DSC Configuration retrieves data from it. Also the object contains the text information for the DSC Configuration:\n    the start and end line of the DSC Configuration in the file and also the DSC Configuration as text. This whole information\n    is later passed to the DscConfigurationCompiler which compiles it and produces the VmwDscConfiguration object.\n\n    2. Invokes all non DSC Configuration lines in the provided file and this ways makes them available in the current scope. This way\n    for example if there is configurationData defined, the hashtable will be available in memory for the DscConfigurationCompiler to\n    produce the VmwDscConfiguration object.\n\n    3. If the Parameters hashtable is passed, invokes all non DSC Configuration lines with the specified PowerShell script file parameters.\n    #>\n    [DscConfigurationBlock[]] ParseDscConfigurationFile([string] $dscConfigurationFilePath, [System.Collections.Hashtable] $parameters) {\n        $dscConfigurationFileContent = Get-Content -Path $dscConfigurationFilePath\n        $dscConfigurationFileContentRaw = Get-Content -Path $dscConfigurationFilePath -Raw\n\n        $tokens = [System.Management.Automation.PSParser]::Tokenize($dscConfigurationFileContentRaw, [ref]$null)\n        $dscConfigurations = $this.GetAllDscConfigurations($tokens)\n\n        $scriptContent = [System.Text.StringBuilder]::new()\n        $dscConfigurationsContent = [System.Text.StringBuilder]::new()\n\n        $j = 0\n        for ($i = 0; $i -lt $dscConfigurationFileContent.Length; $i++) {\n            if ($i -lt ($dscConfigurations[$j].Extent.StartLine - 1) -or $i -gt $dscConfigurations[$j].Extent.EndLine) {\n                $scriptContent.AppendLine($dscConfigurationFileContent[$i]) | Out-Null\n            }\n            else {\n                $dscConfigurationsContent.AppendLine($dscConfigurationFileContent[$i]) | Out-Null\n            }\n\n            if ($i + 1 -gt $dscConfigurations[$j].Extent.EndLine - 1) {\n                $dscConfigurationsContentAsString = $dscConfigurationsContent.ToString()\n\n                # Only the content of the DSC Configuration is needed so we trim the Configuration keyword and the name of the DSC Configuration.\n                $dscConfigurationsContentAsString = $dscConfigurationsContentAsString.TrimStart('Configuration').TrimStart()\n                $dscConfigurationsContentAsString = $dscConfigurationsContentAsString.TrimStart($dscConfigurations[$j].Name).TrimStart()\n\n                $dscConfigurationsContentAsString = $dscConfigurationsContentAsString.TrimEnd()\n\n                # After the text of the DSC Configuration is retrieved, we clear the content, so that we can start\n                # with an empty string for the next DSC Configuration in the file.\n                $dscConfigurations[$j].Extent.Text = $dscConfigurationsContentAsString\n                if ($j -lt ($dscConfigurations.Length - 1)) {\n                    $dscConfigurationsContent = [System.Text.StringBuilder]::new()\n                    $j++\n                }\n            }\n        }\n\n        # The ScriptBlock is invoked for all non DSC Configurations lines with the PowerShell script file parameters if specified.\n        $scriptContentAsString = $scriptContent.ToString()\n        $scriptBlock = [ScriptBlock]::Create($scriptContentAsString)\n\n        if ($parameters.Count -gt 0) {\n            $invokeParameters = $this.GetOrderedScriptParameters($tokens, $parameters)\n            $scriptBlock.Invoke($invokeParameters)\n        }\n        else {\n            $scriptBlock.Invoke()\n        }\n\n        <#\n            In the file there should be only one configurationData hashtable for all defined DSC Configurations. If the user wants to use different\n            configurationData hashtables, the DSC Configurations should be defined in separate files as there is no way to know which hashtable is for\n            which DSC Configuration. So the assumption is that there should be only one hashtable defined with the AllNodes key in the file.\n        #>\n        $configurationData = Get-Variable |\n            Where-Object -FilterScript { $null -ne $_.Value -and $_.Value.GetType() -eq [System.Collections.Hashtable] -and $_.Value.ContainsKey('AllNodes') } |\n            Select-Object -First 1\n        if ($null -ne $configurationData -and $scriptContentAsString -Match $configurationData.Name) {\n            foreach ($dscConfiguration in $dscConfigurations) {\n                $dscConfiguration.ConfigurationData = $configurationData.Value\n            }\n        }\n\n        return $dscConfigurations\n    }\n\n    <#\n    .DESCRIPTION\n\n    Extracts each DSC Configuration defined in the file and converts it into a DscConfigurationBlock object. The content of the file is passed\n    as an array of PSTokens from which each DSC Configuration info is extracted.\n    #>\n    hidden [DscConfigurationBlock[]] GetAllDscConfigurations([System.Collections.ObjectModel.Collection[System.Management.Automation.PSToken]] $tokens) {\n        $dscConfigurations = @()\n\n        for ($i = 0; $i -lt $tokens.Count; $i++) {\n            $token = $tokens[$i]\n\n            if ($token.Type -eq 'Keyword' -and $token.Content -eq 'Configuration') {\n                $dscConfiguration = [DscConfigurationBlock]::new()\n                $dscConfiguration.Extent = [DscConfigurationBlockExtent]::new()\n                $dscConfiguration.Extent.StartLine = $token.StartLine\n\n                $j = $i + 1\n                $dscConfigurationBlockReached = $false\n                $endOfDscConfigurationReached = $false\n                $bracketsCounter = 0\n\n                while ($j -lt $tokens.Count -and !$endOfDscConfigurationReached) {\n                    $dscConfigurationToken = $tokens[$j]\n\n                    # The name of the DSC Configuration is in the token of type CommandArgument.\n                    if ($null -eq $dscConfiguration.Name -and $dscConfigurationToken.Type -eq 'CommandArgument') {\n                        $dscConfiguration.Name = $dscConfigurationToken.Content\n                    }\n\n                    if ($dscConfigurationToken.Type -eq 'GroupStart' -and $dscConfigurationToken.Content -eq '{') {\n                        if (!$dscConfigurationBlockReached) {\n                            $dscConfigurationBlockReached = $true\n                        }\n\n                        $bracketsCounter++\n                    }\n\n                    if ($dscConfigurationToken.Type -eq 'GroupEnd' -and $dscConfigurationToken.Content -eq '}') {\n                        $bracketsCounter--\n                    }\n\n                    # bracketsCounter equal to zero indicates that the closing bracket of the current DSC Configuration was reached.\n                    if ($dscConfigurationBlockReached -and $bracketsCounter -eq 0) {\n                        $dscConfiguration.Extent.EndLine = $dscConfigurationToken.EndLine\n                        $endOfDscConfigurationReached = $true\n                    }\n\n                    <#\n                        The first index should be updated at each step, so after the nested loop finishes and\n                        the DSC Configuration block is populated with the text of the DSC Configuration,\n                        the first loop continues from the end of the current DSC Configuration.\n                    #>\n                    $j++\n                    $i = $j\n                }\n\n                $dscConfigurations += $dscConfiguration\n            }\n        }\n\n        return $dscConfigurations\n    }\n\n    <#\n    .DESCRIPTION\n\n    Orders the specified script parameters in the correct order.\n\n    1. Extracts each script parameter in an array in the correct order when parsing the script file.\n    2. Checks all passed parameters and orders the values in the correct parameter order.\n    3. If a parameter is not passed, $null is added to the array for the specified parameter.\n    #>\n    hidden [array] GetOrderedScriptParameters(\n        [System.Collections.ObjectModel.Collection[System.Management.Automation.PSToken]] $tokens,\n        [System.Collections.Hashtable] $parameters) {\n        $scriptParameters = @()\n        $invokeParameters = @()\n\n        $i = 0\n        $endOfParamsReached = $false\n\n        while ($i -lt $tokens.Count -and !$endOfParamsReached) {\n            $token = $tokens[$i]\n\n            if ($token.Type -eq 'Keyword' -and $token.Content -eq 'Param') {\n                $j = $i + 1\n                $paramsBlockReached = $false\n                $bracketsCounter = 0\n                $attributeBracketsCounter = 0\n\n                while ($j -lt $tokens.Count -and !$endOfParamsReached) {\n                    $paramsToken = $tokens[$j]\n\n                    if ($paramsToken.Type -eq 'GroupStart' -and $paramsToken.Content -eq '(') {\n                        if (!$paramsBlockReached) {\n                            $paramsBlockReached = $true\n                        }\n\n                        $bracketsCounter++\n                    }\n\n                    if ($paramsToken.Type -eq 'GroupEnd' -and $paramsToken.Content -eq ')') {\n                        $bracketsCounter--\n                    }\n\n                    if ($paramsToken.Type -eq 'Operator' -and $paramsToken.Content -eq '[') {\n                        $attributeBracketsCounter++\n                    }\n\n                    if ($paramsToken.Type -eq 'Operator' -and $paramsToken.Content -eq ']') {\n                        $attributeBracketsCounter--\n                    }\n\n                    <#\n                        The additional check is needed to ignore the Parameter Attributes, for example:\n                        [Parameter(Mandatory = $true)] where true is also a variable.\n                    #>\n                    if ($paramsToken.Type -eq 'Variable' -and $attributeBracketsCounter -eq 0) {\n                        $scriptParameters += $paramsToken.Content\n                    }\n\n                    # bracketsCounter equal to zero indicates that the closing bracket of the Param was reached.\n                    if ($paramsBlockReached -and $bracketsCounter -eq 0) {\n                        $endOfParamsReached = $true\n                    }\n\n                    $j++\n                    $i = $j\n                }\n            }\n\n            $i++\n        }\n\n        foreach ($scriptParameter in $scriptParameters) {\n            $parameterName = $parameters.Keys | Where-Object -FilterScript { $_ -eq $scriptParameter }\n            if ($null -ne $parameterName) {\n                if ($parameters.$parameterName -is [array]) {\n                    <#\n                        Arrays should be passed with the below syntax, otherwise\n                        only the first element of the array is passed to the script.\n                    #>\n                    $invokeParameters += (, $parameters.$parameterName)\n                }\n                else {\n                    $invokeParameters += $parameters.$parameterName\n                }\n            }\n            else {\n                <#\n                    If not specified, the parameter shoule be added with $null value\n                    to keep the order of the parameters.\n                #>\n                $invokeParameters += $null\n            }\n        }\n\n        return $invokeParameters\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationParser.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that handles the parsing of the DSC.\n#>\nclass DscConfigurationParser {\n    hidden [Hashtable] $ResourceNameToInfo\n\n    DscConfigurationParser() {\n        $this.ResourceNameToInfo = @{}\n    }\n\n    <#\n    .DESCRIPTION\n    Parses the Configuration scriptblock into an invokable form and retrieves a list dsc resources\n    and a hashtable of local configuration names to their scriptblock\n    #>\n    [PsObject] ParseDscConfiguration([DscConfigurationBlock] $dscConfigurationBlock) {\n        $configTextBlock = $dscConfigurationBlock.Extent.Text\n\n        # find and extract the import-dscresource statements so that they can be executed first\n        $searchScriptBlock = [ScriptBlock]::Create($configTextBlock)\n        $constantItemStatements = $searchScriptBlock.Ast.FindAll({\n            $args[0] -is [System.Management.Automation.Language.StringConstantExpressionAst]\n        }, $true) | Where-Object { $_.Value -eq 'Import-DscResource' }\n\n        $statements = New-Object -TypeName 'System.Collections.ArrayList'\n\n        foreach ($item in $constantItemStatements) {\n            $fullExpr = $item.Parent.ToString()\n\n            $expressionIndex = $configTextBlock.IndexOf($fullExpr)\n            $configTextBlock = $configTextBlock.Remove($expressionIndex, $fullExpr.Length)\n\n            $statements.Add($fullExpr) | Out-Null\n        }\n\n        # invoke the import-dscresource statements\n        $this.InvokeImportDscResource($statements.ToArray())\n\n        $configTextBlock = $configTextBlock.Insert(0, 'Param( $Parameters ) . ')\n\n        # find all dynamic keywords inside the configuration\n        # nodes are removed from the list as they are executed separately\n        $dscConfigurationBlockAsScriptBlock = $this.ConvertDscConfigurationBlockToScriptBlock($dscConfigurationBlock)\n        $dynamicKeywords = $dscConfigurationBlockAsScriptBlock.Ast.FindAll({\n            $args[0] -is [System.Management.Automation.Language.DynamicKeywordStatementAst]\n        }, $true)\n\n        # set bracket placement\n        foreach ($dynamicKeyword in $dynamicKeywords) {\n            $itemName = $dynamicKeyword.CommandElements[0].Value\n            if ($itemName -eq 'Import-DscResource') {\n                continue\n            }\n\n            $itemFullName = \"$itemName $($dynamicKeyword.CommandElements[1].Extent.Text)\"\n            $configTextBlock = $this.ReplaceBracketWith($configTextBlock, $itemFullName, \"{\")\n\n            $command = (Get-Command $itemName -ErrorAction 'SilentlyContinue')\n\n            # case for nested configurations\n            if ($null -ne $command -and -not $this.ResourceNameToInfo.ContainsKey($itemName)) {\n                $this.ResourceNameToInfo[$itemName] = [PsObject]@{\n                    ImplementedAs = 'Configuration'\n                }\n            }\n        }\n\n        $configTextBlock += ' @Parameters'\n\n        return [PsObject]@{\n            ScriptBlock = [ScriptBlock]::Create($configTextBlock)\n            ResourceNameToInfo = $this.ResourceNameToInfo\n        }\n    }\n\n    <#\n    .DESCRIPTION\n    Invokes all the found Import-DscResource statements\n    #>\n    hidden [void] InvokeImportDscResource([string[]] $statements) {\n        $importDscResourceLogic = {\n            Param (\n                [string[]]\n                $Name,          # names of the dsc resources to import\n                # string[] or Microsoft.PowerShell.Commands.ModuleSpecification\n                $ModuleName,    # names of the modules to import or module specification\n                [string]\n                $ModuleVersion  # the required version of the module\n            )\n\n            if ([string]::IsNullOrEmpty($Name) -or [string]::IsNullOrWhiteSpace($Name)) {\n                $Name = '*'\n            }\n\n            if ([string]::IsNullOrEmpty($ModuleName) -or [string]::IsNullOrWhiteSpace($ModuleName)) {\n                $ModuleName = '*'\n            }\n\n            if ((-not [string]::IsNullOrEmpty($ModuleVersion)) -and (-not [string]::IsNullOrWhiteSpace($ModuleVersion))) {\n                if ($ModuleName -is [Microsoft.PowerShell.Commands.ModuleSpecification]) {\n                    $ModuleName = @{\n                        ModuleName = $ModuleName.ModuleName\n                        RequiredVersion = $ModuleVersion\n                    }\n                } else {\n                    $ModuleName = @{\n                        ModuleName = $ModuleName\n                        RequiredVersion = $ModuleVersion\n                    }\n                }\n            }\n\n            $getDscResourceSplatParams = @{\n                Name = $Name\n                Module = $ModuleName\n            }\n\n            $oldProgPref = $Global:ProgressPreference\n            $Global:ProgressPreference = 'SilentlyContinue'\n\n            $importedResources = Get-DscResource @getDscResourceSplatParams\n\n            $Global:ProgressPreference = $oldProgPref\n\n            foreach ($importedResource in $importedResources) {\n                $this.ResourceNameToInfo[$importedResource.Name] = $importedResource\n            }\n        }\n\n        $funcToDefine = @{\n            'Import-DscResource' = $importDscResourceLogic\n        }\n\n        foreach ($statement in $statements) {\n            $sb = [scriptblock]::Create($statement)\n\n            $sb.InvokeWithContext($funcToDefine, $null)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the specified DSC Configuration Block to Script Block by adding the Configuration keyword and the\n    Configuration name to the text of the DSC Configuration.\n    #>\n    hidden [ScriptBlock] ConvertDscConfigurationBlockToScriptBlock([DscConfigurationBlock] $dscConfigurationBlock) {\n        $script = 'Configuration ' + $dscConfigurationBlock.Name + [System.Environment]::NewLine\n        $script += $dscConfigurationBlock.Extent.Text\n\n        return [ScriptBlock]::Create($script)\n    }\n\n    <#\n    .DESCRIPTION\n    Replaces the first found opening bracket after SearchString\n    and replaces it with StringToReplace in StringToChange\n    .EXAMPLE\n    ReplaceBracketWith -StringToChange @\"\n    TestResource test\n    {\n    }\n    \"@ `\n    -SearchString 'TestResource test' `\n    -StringToReplaceWith '{'\n    Outputs\n    TestResource test {\n    }\n    #>\n    hidden [string] ReplaceBracketWith([string] $StringToChange, [string] $SearchString, [string] $StringToReplaceWith) {\n        $regexPattern = \"$SearchString[\\s]*{\"\n        $replacement = \"$SearchString $StringToReplaceWith\"\n\n        $StringToChange = $StringToChange -replace $regexPattern, $replacement\n\n        return $StringToChange\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationRunner.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nExecutes Configuration objects created from New-VmwDscConfiguration cmdlet.\n#>\nclass DscConfigurationRunner {\n    [VmwDscConfiguration] $Configuration\n    [string] $DscMethod\n\n    hidden [VmwDscNode[]] $ValidNodes\n\n    DscConfigurationRunner([VmwDscConfiguration] $configuration, [string] $dscMethod) {\n        $this.Configuration = $configuration\n        $this.DscMethod = $dscMethod\n    }\n\n    <#\n    .DESCRIPTION\n    Invokes the configuration\n    #>\n    [PSCustomObject] InvokeConfiguration() {\n        $this.ValidateVsphereNodes()\n\n        $invokeResult = New-Object 'System.Collections.ArrayList'\n\n        foreach ($node in $this.ValidNodes) {\n            Write-Verbose -Message \"Invoking DSC Configuration for Node: $($node.InstanceName)\"\n\n            $this.ValidateDscKeyProperties($node.Resources)\n\n            $result = $this.InvokeNodeResources($node.Resources)\n\n            $nodeResult = [PSCustomObject] @{\n                OriginalNode = $node\n                InvokeResult = $result\n            }\n\n            $invokeResult.Add($nodeResult) | Out-Null\n        }\n\n        return $invokeResult\n    }\n\n    <#\n    .DESCRIPTION\n    Checks if there are any vSphere Nodes and validates them.\n    Sets ValidNodes property for use in invoking the nodes\n    #>\n    hidden [void] ValidateVsphereNodes() {\n        $vSphereNodes = $this.Configuration.Nodes | Where-Object { $_ -is [VmwVsphereDscNode] }\n\n        if ($null -eq $vSphereNodes -or $vSphereNodes.Count -eq 0) {\n            $this.ValidNodes = $this.Configuration.Nodes\n\n            return\n        }\n\n        # gets PSVersionTable via Get-Variable because automatic variables are not accessable in any other way inside classes\n        $psVersionTableVariable = Get-Variable -Name PSVersionTable\n\n        if ($psVersionTableVariable.Value['PSEdition'] -ne 'Core') {\n            throw $script:VsphereNodesAreOnlySupportedOnPowerShellCoreException\n        }\n\n        $validVsphereNodes = New-Object 'System.Collections.ArrayList'\n\n        $viServersHashtable = $this.GetDefaultViServers()\n\n        # check if any connections are established\n        if ($null -eq $viServersHashtable -or $viServersHashtable.Count -eq 0) {\n            throw $script:NoVsphereConnectionsFoundException\n        }\n\n        foreach ($vSphereNode in $vSphereNodes) {\n            $warningMessage = [string]::Empty\n\n            if (-not $viServersHashtable.ContainsKey($vSphereNode.InstanceName)) {\n                $warningMessage = ($script:NoVsphereConnectionsFoundForNodeWarning -f $vSphereNode.InstanceName)\n            } else {\n                $this.SetResourcesConnection($vSphereNode.Resources, $viServersHashtable, $vSphereNode.InstanceName)\n\n                $validVsphereNodes.Add($vSphereNode) | Out-Null\n            }\n\n            if (-not [string]::IsNullOrEmpty($warningMessage)) {\n                # write warning for no connection on a vSphere node\n                Write-Warning $warningMessage\n            }\n        }\n\n        # combine valid vSphereNodes with all regular Nodes\n        $this.ValidNodes = ($validVsphereNodes.ToArray()) + ($this.Configuration.Nodes | Where-Object { $_.GetType() -eq [VmwDscNode] })\n    }\n\n    <#\n    .DESCRIPTION\n    Sets the connection property of vSphereNode resources and composite resources.\n    #>\n    hidden [void] SetResourcesConnection([VmwDscResource[]] $Resources, [HashTable] $ViServers, [string] $nodeInstanceName) {\n        foreach ($resource in $Resources) {\n            if ($resource.GetIsComposite()) {\n                $this.SetResourcesConnection($resource.GetInnerResources(), $ViServers, $nodeInstanceName)\n            } else {\n                $resource.Property['Connection'] = $ViServers[$nodeInstanceName]\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n    Invokes Resources\n    #>\n    [Psobject[]] InvokeNodeResources([VmwDscResource[]] $DscResources) {\n        $result = New-Object -TypeName 'System.Collections.ArrayList'\n\n        # invoke the dsc resources\n        foreach ($dscResource in $DscResources) {\n            $invokeResult = $null\n\n            if ($dscResource.GetIsComposite()) {\n                $invokeResult = $this.InvokeNodeResources($dscResource.GetInnerResources())\n            } else {\n                $invokeResult = $this.InvokeNodeResource($dscResource)\n            }\n\n            $result.Add($invokeResult) | Out-Null\n        }\n\n        return $result.ToArray()\n    }\n\n    <#\n    .DESCRIPTION\n    Invokes single resource.\n    Uses Invoke-DscResource internaly.\n    #>\n    hidden [Psobject] InvokeNodeResource([VmwDscResource] $DscResource) {\n        # parameters used for Invoke-DscResource cmdlet\n        # Method property gets set later on inside switch, because it's variable\n        $invokeSplatParams = @{\n            Name = $DscResource.ResourceType\n            ModuleName = $DscResource.ModuleName\n            Property = $DscResource.Property\n            Verbose = $false\n            ErrorAction = 'Stop'\n        }\n\n        $logs = New-Object -TypeName 'System.Collections.ArrayList'\n\n        <#\n            On PowerShell 5.1, System.Management.Automation.PSReference\n            cannot be serialized into CimInstance. So the logs are only\n            available for the PowerShell Core version.\n        #>\n        if ($Global:PSVersionTable.PSEdition -eq 'Core') {\n            $invokeSplatParams.Property['Logs'] = [ref] $logs\n        }\n\n        Write-Verbose -Message \"Invoking DSC Resource with id: $($DscResource.GetId())\"\n\n        $invokeResult = $null\n\n        # ignore progress from internal Get-DscResource in Invoke-DscResource\n        $oldProgressPref = (Get-Variable 'ProgressPreference').Value\n        Set-Variable -Name 'ProgressPreference' -Value 'SilentlyContinue' -Scope 'Global'\n\n        try {\n            if ($this.DscMethod -eq 'Test' -or $this.DscMethod -eq 'Get') {\n                $invokeSplatParams.Method = $this.DscMethod\n                $invokeResult = Invoke-DscResource @invokeSplatParams\n            } else {\n                # checks if the resource is in target state\n                $invokeSplatParams.Method = 'Test'\n                $isInDesiredState = Invoke-DscResource @invokeSplatParams\n\n                # executes 'set' method only if state is not desired\n                if (-not $isInDesiredState.InDesiredState) {\n                    $invokeSplatParams.Method = $this.DscMethod\n                    (Invoke-DscResource @invokeSplatParams) | Out-Null\n                }\n            }\n        } catch {\n            $message = \"{0} method of {1} DSC Resource failed with the following error: {2}\"\n            $arguments = @($this.DscMethod, $invokeSplatParams.Name, $_.Exception.Message)\n            $dscResourceErrorMessage = [string]::Format($message, $arguments)\n\n            throw $dscResourceErrorMessage\n        } finally {\n            $this.HandleStreamOutputFromDscResources($logs)\n        }\n\n        # revert progresspreference\n        Set-Variable -Name 'ProgressPreference' -Value $oldProgressPref -Scope 'Global'\n\n        return $invokeResult\n    }\n\n    <#\n    .DESCRIPTION\n    Prints the output from the execution of a DSC Resource via the Invoke-DscResource cmdlet.\n    The logs are extracted from a log arrayList that gets passed via 'Property'\n    #>\n    hidden [void] HandleStreamOutputFromDscResources([System.Collections.ArrayList] $Logs) {\n        foreach ($log in $logs) {\n            $logType = $Log.Type\n            $message = $log.Message\n\n            if ($logType -eq 'Verbose') {\n                Write-Verbose -Message $message\n            } elseif ($logType -eq 'Warning') {\n                Write-Warning -Message $message\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n    Finds and validates DSC Resource key properties.\n    When two or more dsc resources of the same type have the same values for key properties an exception is thrown\n    #>\n    hidden [void] ValidateDscKeyProperties([VmwDscResource[]] $DscResources) {\n        $resourcesQueue = New-Object 'System.Collections.Queue'\n        $dscResourcesDuplicateChecker = New-Object 'System.Collections.Generic.HashSet[DscKeyPropertyResourceCheck]'\n\n        $resourcesQueue.Enqueue($DscResources)\n\n        while ($resourcesQueue.Count -gt 0) {\n            $currentResources = $resourcesQueue.Dequeue()\n\n            foreach ($currentResource in $currentResources) {\n                if ($currentResource.GetIsComposite()) {\n                    $resourcesQueue.Enqueue($currentResource.GetInnerResources())\n\n                    continue\n                }\n\n                <#\n                    The Verbose preference is set to 'SilentlyContinue' to suppress the\n                    Verbose output of 'using module' when importing the 'VMware.vSphereDSC' module.\n                #>\n                $savedVerbosePreference = $Global:VerbosePreference\n                $Global:VerbosePreference = 'SilentlyContinue'\n\n                $resourceCheck = $this.GetDscResouceKeyProperties($currentResource)\n\n                $Global:VerbosePreference = $savedVerbosePreference\n\n                $isAdded = $dscResourcesDuplicateChecker.Add($resourceCheck)\n\n                if (-not $isAdded) {\n                    throw ($script:DscResourcesWithDuplicateKeyPropertiesException -f $currentResource.ResourceType)\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n    Finds the key properties of a dsc resource and\n    wraps it in a DscKeyPropertyResourceCheck object with the resource type and key props array.\n    #>\n    hidden [DscKeyPropertyResourceCheck] GetDscResouceKeyProperties([VmwDscResource] $DscResource) {\n        $moduleName = $DscResource.ModuleName.Name\n        $moduleVersion = $DscResource.ModuleName.RequiredVersion.ToString()\n\n        # load resource module with 'using module'\n        # and find key properties via reflection\n        $sbText = @\"\n                using module @{\n                    ModuleName = '$moduleName'\n                    RequiredVersion = '$moduleVersion'\n                }\n\n                `$dscProperties = [$($DscResource.ResourceType)].GetProperties()\n\n                `$dscKeyProperties = New-Object -TypeName 'System.Collections.ArrayList'\n\n                foreach (`$dscProperty in `$dscProperties) {\n                    `$dscPropertyAttr = `$dscProperty.CustomAttributes | Where-Object {\n                        `$_.AttributeType.ToString() -eq 'System.Management.Automation.DscPropertyAttribute'\n                    }\n\n                    # not a dsc property\n                    if (`$null -eq `$dscPropertyAttr) {\n                        continue\n                    }\n\n                    if (`$dscPropertyAttr.NamedArguments.MemberName -eq 'Key' -and `$dscPropertyAttr.NamedArguments.TypedValue.ToString() -eq '(Boolean)True') {\n                        `$dscKeyProperties.Add(`$dscProperty.Name) | Out-Null\n                    }\n                }\n\n                `$dscKeyProperties.ToArray()\n\"@\n\n        $sb = [ScriptBlock]::Create($sbText)\n\n        $dscResourceKeyProperties = & $sb\n\n        $dscResourceKeyPropertiesHashTable = @{}\n\n        foreach ($dscKeyProp in $dscResourceKeyProperties) {\n            if ($null -eq $DscResource.Property[$dscKeyProp]) {\n               # DSC Key Property cannot be null, throw configuration error\n               throw \"Incorrect DSC Configuration: Key Property '$dscKeyProp' of resource $($DscResource.GetId()) is NULL\"\n            }\n            $dscResourceKeyPropertiesHashTable[$dscKeyProp] = $DscResource.Property[$dscKeyProp]\n        }\n\n        $resourceCheck = [DscKeyPropertyResourceCheck]::new(\n            $DscResource.ResourceType,\n            $dscResourceKeyPropertiesHashTable\n        )\n\n        return $resourceCheck\n    }\n\n    <#\n    .DESCRIPTION\n    Retrieves the global VI Servers array from VICore module and transforms it into\n    a hashtable with key name and value the object\n    #>\n    hidden [Hashtable] GetDefaultViServers() {\n        $serverList = $Global:DefaultVIServers\n\n        if ($null -eq $serverList) {\n            return $null\n        }\n\n        $serverHashtable = @{}\n\n        foreach ($server in $serverList) {\n            if ($serverHashtable.ContainsKey($server.Name)) {\n                # more than one connection to the same VIServer\n                throw ($script:TooManyConnectionOnASingleVCenterException -f $server.Name)\n            }\n\n            $serverHashtable[$server.Name] = $server\n        }\n\n        return $serverHashtable\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscGetMethodResult.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nResult type for Get-VmwDscConfiguration.\n#>\nclass DscGetMethodResult : BaseDscMethodResult {\n    [PsObject[]] $ResourcesStates\n\n    DscGetMethodResult([VmwDscNode] $node, [PsObject[]] $resources) : base($node.InstanceName) {\n        $this.FillResourceStates($node, $resources)\n    }\n\n    hidden [void] FillResourceStates([VmwDscNode] $node, [PsObject[]] $resources) {\n        $result = New-Object 'System.Collections.ArrayList'\n\n        for ($i = 0; $i -lt $resources.Count; $i++) {\n            $states = $resources[$i]\n            $objectToAdd = $null\n\n            if ($states.Count -gt 1) {\n                $objectToAdd = [CompositeResourceGetMethodResult]::new($node.Resources[$i].InstanceName, $states)\n            } else {\n                $objectToAdd = $states\n            }\n\n            $result.Add($objectToAdd) | Out-Null\n        }\n\n        $this.ResourcesStates = $result.ToArray()\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscItem.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nBase class for a DSC Item.\n#>\nclass DscItem {\n    [ValidateNotNullOrEmpty()]\n    [string] $InstanceName\n\n    DscItem($instanceName) {\n        $this.InstanceName = $instanceName\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscKeyPropertyResourceCheck.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nType used for checking uniqueness of a DSC Resource key properties.\n#>\nclass DscKeyPropertyResourceCheck {\n    [string] $DscResourceType\n\n    # can contain only string, int, enum values, because only properties of those types can be keys\n    [Hashtable] $KeyPropertiesToValues\n\n    DscKeyPropertyResourceCheck([string] $dscResourceType, [Hashtable] $keyPropertiesToValues) {\n        $this.DscResourceType = $dscResourceType\n        $this.KeyPropertiesToValues = $keyPropertiesToValues\n    }\n\n    [bool] Equals([Object] $other) {\n        $comparisonResult = $true\n        $other = $other -as [DscKeyPropertyResourceCheck]\n\n        if (-not $this.DscResourceType.Equals($other.DscResourceType)) {\n            $comparisonResult = $false\n        } else {\n            foreach ($key in $this.KeyPropertiesToValues.Keys) {\n                if ((-not $other.KeyPropertiesToValues.ContainsKey($key)) -or (-not $this.KeyPropertiesToValues[$key].Equals($other.KeyPropertiesToValues[$key]))) {\n                    $comparisonResult = $false\n                    break\n                }\n            }\n        }\n\n        return $comparisonResult\n    }\n\n    [int] GetHashCode() {\n        $hash = $this.CalculateHashCode()\n\n        return $hash\n    }\n\n    <#\n    .DESCRIPTION\n    Calculates the hashcode via the Get-KeyPropertyResourceCheckDotNetHashCode cmdlet, because\n    it uses a custom c# type that is created during runtime and can't be used inside a class due to it\n    raising a parse error.\n    #>\n    [int] CalculateHashCode() {\n        $splat = @{\n            ResourceType = $this.ResourceType\n            KeyPropertiesToValues = $this.KeyPropertiesToValues\n        }\n\n        $hash = Get-KeyPropertyResourceCheckDotNetHashCode @splat\n\n        return $hash\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscTestMethodDetailedResult.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nResult type for Test-VmwDscConfiguration with -Detailed flag switched on.\n#>\nclass DscTestMethodDetailedResult : BaseDscMethodResult {\n    [bool] $InDesiredState\n\n    [VmwDscResource[]] $ResourcesInDesiredState\n\n    [VmwDscResource[]] $ResourcesNotInDesiredState\n\n    DscTestMethodDetailedResult([VmwDscNode] $node, [PsObject[]] $stateArr) : base($node.InstanceName) {\n        $this.NodeName = $node.InstanceName\n\n        $this.GroupResourcesByDesiredState($node.Resources, $stateArr)\n    }\n\n    hidden [void] GroupResourcesByDesiredState([VmwDscResource[]] $resources, [PsObject[]] $stateArr) {\n        $this.InDesiredState = $true\n        $resInDesiredState = New-Object -TypeName 'System.Collections.ArrayList'\n        $resNotInDesiredState = New-Object -TypeName 'System.Collections.ArrayList'\n\n        for ($i = 0; $i -lt $resources.Count; $i++) {\n            # states can be an array due to composite resources having multiple inner resources\n            $states = $stateArr[$i]\n            $currInDesiredState = $true\n\n            foreach ($state in $states) {\n                if (-not $state.InDesiredState) {\n                    $currInDesiredState = $false\n                    break\n                }\n            }\n\n            # add to correct array depending on the desired state\n            if ($currInDesiredState) {\n                $resInDesiredState.Add($resources[$i]) | Out-Null\n            } else {\n                $resNotInDesiredState.Add($resources[$i]) | Out-Null\n                $this.InDesiredState = $false\n            }\n        }\n\n        $this.ResourcesInDesiredState = $resInDesiredState.ToArray()\n        $this.ResourcesNotInDesiredState = $resNotInDesiredState.ToArray()\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwDscConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that defines a DSC Configuration.\n#>\nclass VmwDscConfiguration : DscItem {\n    [VmwDscNode[]] $Nodes\n\n    VmwDscConfiguration($instanceName, $nodes) : base($instanceName) {\n        $this.Nodes = $nodes\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwDscNode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that defines a regular DSC Node.\n#>\nclass VmwDscNode : DscItem {\n    [VmwDscResource[]] $Resources\n\n    VmwDscNode($connection, $resources) : base($connection) {\n        $this.Resources = $resources\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwDscResource.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that defines a DSC Resource.\n#>\nclass VmwDscResource : DscItem {\n    [ValidateNotNullOrEmpty()]\n    [string] $ResourceType\n\n    [ValidateNotNull()]\n    [Hashtable] $Property\n\n    [Microsoft.PowerShell.Commands.ModuleSpecification] $ModuleName\n\n    hidden [VmwDscResource[]] $InnerResources\n\n    VmwDscResource($instanceName, $resourceType, $moduleName, $property, $innerResources) : base($instanceName) {\n        $this.Init($resourceType, $moduleName, $property, $innerResources)\n    }\n\n    VmwDscResource($instanceName, $resourceType, $moduleName, $property) : base($instanceName) {\n        $this.Init($resourceType, $moduleName, $property, $null)\n    }\n\n    VmwDscResource($instanceName, $resourceType, $moduleName) : base($instanceName) {\n        $this.Init($resourceType, $moduleName, @{}, $null)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Init function that sets the values of properties, because powershell does not support chaining constructors\n    #>\n    hidden [void] Init($resourceType, $moduleName, $property, $innerResources) {\n        $this.ResourceType = $resourceType\n        $this.Property = $property\n        $this.innerResources = $innerResources\n\n        if ($null -ne $moduleName) {\n            $this.ModuleName = $moduleName -as [Microsoft.PowerShell.Commands.ModuleSpecification]\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean flag on whether the DSC Resource is composite.\n    #>\n    [bool] GetIsComposite() {\n        return $null -ne $this.InnerResources\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns inner resources for composite DSC Resources.\n    #>\n    [VmwDscResource[]] GetInnerResources() {\n        return $this.innerResources\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets inner resources for a composite DSC resource.\n    #>\n    [void] SetInnerResources([VmwDscResource[]] $innerResources) {\n        if ($null -eq $innerResources) {\n            throw '$innerResources must not be null!'\n        }\n\n        $this.innerResources = $innerResources\n    }\n\n    <#\n    .DESCRIPTION\n\n    Gets the unique id of the DSC Resource.\n    #>\n    [string] GetId() {\n        return \"[$($this.ResourceType)]$($this.InstanceName)\"\n    }\n\n    [string] ToString() {\n        return \"$($this.ResourceType) $($this.InstanceName)\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwDscResourceGraph.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nThis graph is used to sort DSC Resources by their 'DependsOn' key in the 'Property' property.\n#>\nclass VmwDscResourceGraph {\n    hidden [System.Collections.Specialized.OrderedDictionary] $Edges\n\n    hidden [System.Collections.Specialized.OrderedDictionary] $Resources\n\n    VmwDscResourceGraph([System.Collections.Specialized.OrderedDictionary] $resources) {\n        $this.Resources = $resources\n        $this.FillEdges()\n    }\n\n    <#\n    .DESCRIPTION\n    Sorts the resources in the graph so that\n    the resources get ordered based on their dependencies\n    #>\n    [System.Array] TopologicalSort() {\n        # bool array for keeping track of visited resources\n        $visited = New-Object 'System.Collections.Generic.HashSet[string]'\n        # hashtable for detecting circular dependencies\n        $cycles = New-Object 'System.Collections.Generic.HashSet[string]'\n        # resource keys wil be kept inside this stack\n        $sortedResourceKeys = New-Object -TypeName 'System.Collections.Stack'\n\n        $keysArr = @($this.Edges.Keys)\n\n        for ($i = 0; $i -lt $keysArr.Count; $i++) {\n            $ind = $this.edges.Count - 1 - $i\n            $key = $keysArr[$ind]\n            $this.TopologicalSortUtil($key, $sortedResourceKeys, $visited, $cycles)\n        }\n\n        $result = New-Object -TypeName 'System.Collections.Arraylist'\n\n        foreach ($resKey in $sortedResourceKeys) {\n            $result.Add($this.Resources[$resKey]) | Out-Null\n        }\n\n        return $result.ToArray()\n    }\n\n    <#\n    .DESCRIPTION\n    Uses DFS in order to traverse the graph\n    #>\n    [void] hidden TopologicalSortUtil(\n    [string] $resKey,\n    [System.Collections.Stack] $sortedResourceKeys,\n    [System.Collections.Generic.HashSet[string]] $visited,\n    [System.Collections.Generic.HashSet[string]] $cycles) {\n        if ($cycles.Contains($resKey)) {\n            throw \"Cycle detected with key: $resKey\"\n        }\n\n        if ($visited.Contains($resKey)) {\n            return\n        }\n\n        $visited.Add($resKey) | Out-Null\n        $cycles.Add($resKey) | Out-Null\n\n        foreach ($child in $this.Edges[$resKey]) {\n            $this.TopologicalSortUtil($child, $sortedResourceKeys, $visited, $cycles)\n        }\n\n        $cycles.Remove($resKey) | Out-Null\n        $sortedResourceKeys.Push($resKey) | Out-Null\n    }\n\n    <#\n    .DESCRIPTION\n    Fills $Edges ordered dictionary from $Resources ordered dictionary\n    #>\n    [void] hidden FillEdges() {\n        # adjecency list representing dependencies between resources\n        $this.Edges = [ordered]@{}\n\n        # initialize lists\n        foreach ($key in $this.Resources.Keys) {\n            $children = New-Object -TypeName 'System.Collections.ArrayList'\n            $this.Edges[$key] = $children\n        }\n\n        # insert dependencies into edges\n        foreach ($key in $this.Resources.Keys) {\n            if (-not $this.Resources[$key].Property.ContainsKey('DependsOn')) {\n                continue\n            }\n\n            $dependencies = $this.Resources[$key].Property['DependsOn']\n\n            foreach ($dependency in $dependencies) {\n                if (-not $this.Edges.Contains($dependency)) {\n                    throw ($script:DependsOnResourceNotFoundException -f $this.Resources[$key].InstanceName, $dependency)\n                }\n\n                # remove DependsOn item so that it does not conflict with Invoke-DscResource later on\n                $this.Resources[$key].Property.Remove('DependsOn') | Out-Null\n\n                $this.Edges[$dependency].Add($key) | Out-Null\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwVsphereDscNode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nClass that defines a vSphere DSC Node.\n#>\nclass VmwVsphereDscNode : VmwDscNode {\n    VmwVsphereDscNode($connection, $resources) : base($connection, $resources) { }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Functions/Private/Get-KeyPropertyResourceCheckDotNetHashCode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nUsed to generate a hashcode for the KeyPropertyResourceCheck object.\nA similiar class is created via c# so that the unchecked param is used for overflow ignoring.\nPowerShell by itself automaticaly changes the number type when before overflowing to avoid it.\n#>\nfunction Get-KeyPropertyResourceCheckDotNetHashCode {\n    Param(\n        [string] $ResourceType,\n\n        [Hashtable] $KeyPropertiesToValues\n    )\n\n    $code = @\"\n    using System.Collections;\n\n    public class KeyPropertyResourceCheckDotNet\n    {\n        public KeyPropertyResourceCheckDotNet(string resourceType, Hashtable keyPropertiesToValues)\n        {\n            this.ResourceType = resourceType;\n            this.KeyPropertiesToValues = keyPropertiesToValues;\n        }\n\n        private string ResourceType { get; set; }\n\n        private Hashtable KeyPropertiesToValues { get; set; }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                int hash = 17;\n\n                hash = hash * 23 + this.ResourceType.GetHashCode();\n\n                foreach (var key in this.KeyPropertiesToValues.Keys)\n                {\n                    hash = hash * 23 + this.KeyPropertiesToValues[key].GetHashCode();\n                }\n\n                return hash;\n            }\n        }\n    }\n\"@\n\n    Add-Type -TypeDefinition $code\n\n    $obj = [KeyPropertyResourceCheckDotNet]::new($ResourceType, $KeyPropertiesToValues)\n\n    $obj.GetHashCode()\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Functions/Private/Invoke-VmwDscConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:LastExecutedConfiguration = $null\n\n<#\n.SYNOPSIS\n\nInvokes the dsc configuration object and returns an appropriate result depending on the method used\n#>\nfunction Invoke-VmwDscConfiguration {\n    [CmdletBinding()]\n    Param (\n        [Parameter(Mandatory = $true)]\n        [ValidateSet('Get', 'Set', 'Test')]\n        [string]\n        $Method,\n\n        [Parameter(Mandatory = $false)]\n        [VmwDscConfiguration]\n        $Configuration,\n\n        [Parameter(Mandatory = $false)]\n        [Switch]\n        $ExecuteLastConfiguration,\n\n        [Parameter(Mandatory = $false)]\n        [PsObject]\n        $ConnectionFilter\n    )\n\n    if ($ExecuteLastConfiguration) {\n        if ($null -eq $script:LastExecutedConfiguration) {\n            throw $script:NoConfigurationDetectedForInvokeException\n        }\n\n        $Configuration = $script:LastExecutedConfiguration\n    }\n\n    $configToUse = $Configuration\n\n    if ($null -ne $ConnectionFilter) {\n        $connectionToFilterBy = New-Object -TypeName 'System.Collections.Generic.HashSet[string]'\n\n        foreach ($connection in $ConnectionFilter) {\n            # check if entire connection object is given or just the connection name\n            if ($connection -is [string]) {\n                $connectionToFilterBy.Add($connection) | Out-Null\n            } else {\n                $connectionToFilterBy.Add($connection.Name) | Out-Null\n            }\n        }\n\n        $nodesToUse = New-Object -TypeName 'System.Collections.ArrayList'\n\n        foreach($node in $configToUse.Nodes) {\n            if ($connectionToFilterBy.Contains($node.InstanceName)) {\n                $nodesToUse.Add($node) | Out-Null\n            }\n        }\n\n        $configToUse.Nodes = $nodesToUse.ToArray()\n    }\n\n    $invoker = [DscConfigurationRunner]::new($configToUse, $Method)\n\n    try {\n        $savedVerbosePreference = $Global:VerbosePreference\n        $Global:VerbosePreference = $VerbosePreference\n\n        $invokeResult = $invoker.InvokeConfiguration()\n    }\n    finally {\n        $Global:VerbosePreference = $savedVerbosePreference\n    }\n\n    $script:LastExecutedConfiguration = $Configuration\n\n    $invokeResult\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Functions/Public/Get-VmwDscConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nInvokes the DSC Configuration with the 'Get' DSC method.\nRetrieves the dsc resources current states.\n#>\nfunction Get-VmwDscConfiguration {\n    [CmdletBinding()]\n    param (\n        [Parameter(Mandatory = $true,\n                   ValueFromPipeline = $true,\n                   ParameterSetName = 'Explicit_Configuration',\n                   Position = 0)]\n        [ValidateNotNullOrEmpty()]\n        [VmwDscConfiguration]\n        $Configuration,\n\n        [Parameter(Mandatory = $true,\n                   ParameterSetName = 'Last_Configuration',\n                   Position = 0)]\n        [Switch]\n        $ExecuteLastConfiguration,\n\n        [Parameter(Mandatory = $false,\n                   ValueFromPipeline = $false,\n                   Position = 1)]\n        [ValidateNotNullOrEmpty()]\n        [PsObject]\n        $ConnectionFilter\n    )\n\n    $invokeParams = @{\n        Configuration = $Configuration\n        ExecuteLastConfiguration = $ExecuteLastConfiguration\n        ConnectionFilter = $ConnectionFilter\n        Method = 'Get'\n    }\n\n    $getResult = Invoke-VmwDscConfiguration @invokeParams -Verbose:$VerbosePreference\n\n    $result = New-Object -TypeName 'System.Collections.ArrayList'\n\n    foreach ($nodeStateResult in $getResult) {\n        $dscGetResult = [DscGetMethodResult]::new($nodeStateResult.OriginalNode, $nodeStateResult.InvokeResult)\n\n        $result.Add($dscGetResult) | Out-Null\n    }\n\n    $result.ToArray()\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Functions/Public/New-VmwDscConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VmwDscConfiguration {\n    <#\n    .SYNOPSIS\n        Compiles a DSC Configuration into a VmwDscConfiguration object, which contains\n        the name of the DSC Configuration and the DSC Resources defined in it.\n\n    .DESCRIPTION\n        Compiles a DSC Configuration into a VmwDscConfiguration object, which contains\n        the name of the DSC Configuration and the DSC Resources defined in it. The provided\n        PowerShell script file can contain multiple DSC Configurations in which case the cmdlet\n        returns an array of VmwDscConfiguration objects. If the ConfigurationName parameter is specified,\n        the cmdlet returns only one VmwDscConfiguration object - the one constructed from the specified\n        DSC Configuration.\n\n    .PARAMETER Path\n        Specifies a file path of a file that contains DSC Configurations. The file can contain multiple DSC Configurations\n        and for each one, a separate VmwDscConfiguration object is created. If ConfigurationData hashtable is defined in the provided\n        file, it is passed to each DSC Configuration defined in the file.\n\n    .PARAMETER ConfigurationName\n        Specifies the name of the DSC Configuration which should be compiled into a VmwDscConfiguration object. This parameter is applicable\n        only when multiple DSC Configurations are defined in the file and only one specific DSC Configuration should be compiled. If not specified,\n        all DSC Configurations in the file are compiled and returned as VmwDscConfiguration objects.\n\n    .PARAMETER Parameters\n        Specifies the parameters of the file that contains the DSC Configurations as a hashtable\n        where each key is the parameter name and each value is the parameter value.\n\n    .EXAMPLE\n        Compiles the DSC Configurations defined in the vSphere_Config file located in the current directory.\n\n        PS> $dscConfigs = New-VmwDscConfiguration -Path .\\vSphere_Config.ps1\n\n    .EXAMPLE\n        Compiles the DSC Configuration vSphereNode_Config defined in the vSphere_Config file located in the current directory\n        and passes the VMHostName parameter to the vSphere_Config file.\n\n        PS> $dscConfig = New-VmwDscConfiguration -Path .\\vSphere_Config.ps1 -ConfigurationName 'vSphereNode_Config' -Parameters @{ VMHostName = 'MyVMHost' }\n\n    #>\n    [CmdletBinding()]\n    [OutputType([VmwDscConfiguration[]])]\n    Param (\n        [Parameter(Mandatory = $true,\n                   Position = 0)]\n        [ValidateScript({ Test-Path -Path $_ })]\n        [string]\n        $Path,\n\n        [Parameter(Mandatory = $false)]\n        [string]\n        $ConfigurationName,\n\n        [Parameter(Mandatory = $false)]\n        [System.Collections.Hashtable]\n        $Parameters\n    )\n\n    $vmwDscConfigurations = @()\n\n    try {\n        $savedVerbosePreference = $Global:VerbosePreference\n        $Global:VerbosePreference = $VerbosePreference\n\n        $dscConfigurationFileParser = [DscConfigurationFileParser]::new()\n        $dscConfigurationBlocks = $dscConfigurationFileParser.ParseDscConfigurationFile($Path, $Parameters)\n\n        foreach ($dscConfigurationBlock in $dscConfigurationBlocks) {\n            if (![string]::IsNullOrEmpty($ConfigurationName) -and $dscConfigurationBlock.Name -ne $ConfigurationName) {\n                continue\n            }\n\n            $dscConfigurationCompiler = [DscConfigurationCompiler]::new($dscConfigurationBlock.Name, $Parameters, $dscConfigurationBlock.ConfigurationData)\n            $vmwDscConfiguration = $dscConfigurationCompiler.CompileDscConfiguration($dscConfigurationBlock)\n\n            $vmwDscConfigurations += $vmwDscConfiguration\n        }\n    }\n    finally {\n        $Global:VerbosePreference = $savedVerbosePreference\n    }\n\n    $vmwDscConfigurations\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Functions/Public/Start-VmwDscConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nInvokes the DSC Configuration with the 'Set' DSC method.\nEvery Resource that is not in desired state gets it's set method run.\n#>\nfunction Start-VmwDscConfiguration {\n    [CmdletBinding()]\n    param (\n        [Parameter(Mandatory = $true,\n                   ValueFromPipeline = $true,\n                   Position = 0)]\n        [ValidateNotNullOrEmpty()]\n        [VmwDscConfiguration]\n        $Configuration,\n\n        [Parameter(Mandatory = $false,\n                   ValueFromPipeline = $false,\n                   Position = 1)]\n        [ValidateNotNullOrEmpty()]\n        [PSObject]\n        $ConnectionFilter\n    )\n\n    $invokeParams = @{\n        Configuration = $Configuration\n        ConnectionFilter = $ConnectionFilter\n        Method = 'Set'\n    }\n\n    Invoke-VmwDscConfiguration @invokeParams -Verbose:$VerbosePreference | Out-Null\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Functions/Public/Test-VmwDscConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nInvokes the DSC Configuration with the 'Test' DSC method\nReturns a boolean result that shows if the current state is desired.\nUse Detailed switch to return an object with state flag and more detailed information on resources and their individual states.\n#>\nfunction Test-VmwDscConfiguration {\n    [CmdletBinding()]\n    param (\n        [Parameter(Mandatory = $true,\n                   ValueFromPipeline = $true,\n                   ParameterSetName = 'Explicit_Configuration',\n                   Position = 0)]\n        [ValidateNotNullOrEmpty()]\n        [VmwDscConfiguration]\n        $Configuration,\n\n        [Parameter(Mandatory = $true,\n                   ParameterSetName = 'Last_Configuration',\n                   Position = 0)]\n        [Switch]\n        $ExecuteLastConfiguration,\n\n        [Parameter(Mandatory = $false,\n                   Position = 1)]\n        [Switch]\n        $Detailed,\n\n        [Parameter(Mandatory = $false,\n                   ValueFromPipeline = $false,\n                   Position = 2)]\n        [ValidateNotNullOrEmpty()]\n        [PsObject]\n        $ConnectionFilter\n    )\n\n    $invokeParams = @{\n        Configuration = $Configuration\n        ExecuteLastConfiguration = $ExecuteLastConfiguration\n        ConnectionFilter = $ConnectionFilter\n        Method = 'Test'\n    }\n\n    $testResults = Invoke-VmwDscConfiguration @invokeParams -Verbose:$VerbosePreference\n\n    $result = $null\n\n    if ($Detailed) {\n        $result = New-Object -TypeName 'System.Collections.ArrayList'\n\n        foreach ($nodeStateResult in $testResults) {\n            $testResultObject = [DscTestMethodDetailedResult]::new($nodeStateResult.OriginalNode, $nodeStateResult.InvokeResult)\n\n            $result.Add($testResultObject) | Out-Null\n        }\n\n        $result = $result.ToArray()\n    } else {\n        $result = ($testResults | Select-Object -ExpandProperty InvokeResult | Where-Object { $_.InDesiredState -eq $false }).Count -eq 0\n    }\n\n    $result\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Integration/Configurations/vSphereNodeConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration Config_Add {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    vSphereNode $ConfigurationData.AllNodes.NodeName {\n        DatacenterFolder 'MyDatacenterFolder' {\n            Name = $ConfigurationData.DatacenterFolder.Name\n            Location = $ConfigurationData.DatacenterFolder.Location\n            Ensure = 'Present'\n        }\n\n        Datacenter 'MyDatacenter' {\n            Name = $ConfigurationData.Datacenter.Name\n            Location = $ConfigurationData.Datacenter.Location\n            Ensure = 'Present'\n            DependsOn = '[DatacenterFolder]MyDatacenterFolder'\n        }\n    }\n}\n\nConfiguration Config_Remove {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    vSphereNode $ConfigurationData.AllNodes.NodeName {\n        Datacenter 'MyDatacenter' {\n            Name = $ConfigurationData.Datacenter.Name\n            Location = $ConfigurationData.Datacenter.Location\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder 'MyDatacenterFolder' {\n            Name = $ConfigurationData.DatacenterFolder.Name\n            Location = $ConfigurationData.DatacenterFolder.Location\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Integration/Invoke-VmwDscConfiguration.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$root = Split-Path (Split-Path $PSScriptRoot)\n\n$module = Join-Path $root 'VMware.PSDesiredStateConfiguration.psd1'\n\nImport-Module $module -Force\n\nInModuleScope -ModuleName 'VMware.PSDesiredStateConfiguration' {\n    Describe 'Invoke-VmwDscConfiguration integration tests' {\n        try {\n            $root = $PSScriptRoot\n            $serverConfigPath = Join-Path $root 'ServerConfig.ps1'\n\n            # server data is retrieved from a ServerConfig.ps1 file\n            $serverConfigs = . $serverConfigPath\n\n            foreach ($serverConfig in $serverConfigs) {\n                # establish connection to the vCenter\n                $Script:Connection = Connect-ViServer -Server $serverConfig.Server -User $serverConfig.User -Password $serverConfig.Password\n            }\n\n            $Script:ConfigData = @{\n                AllNodes = @(\n                    foreach ($serverConfig in $serverConfigs) {\n                        @{\n                            NodeName = $serverConfig.Server\n                        }\n                    }\n                )\n                DatacenterFolder = @{\n                    Name = 'MyDatacentersFolder'\n                    Location = ''\n                }\n                Datacenter = @{\n                    Name = 'MyDatacenter'\n                    Location = 'MyDatacentersFolder'\n                }\n            }\n\n            $configFolder = Join-Path $root 'Configurations'\n\n            $Script:ConfigPath = Join-Path $configFolder 'vSphereNodeConfiguration.ps1'\n\n            $Script:DscConfigurationObj = $null\n\n            It 'Should compile correctly' {\n                # Arrange\n                $splatParams = @{\n                    ConfigName = 'Config_Add'\n                    ConfigurationData = $Script:ConfigData\n                }\n\n                $vSphereModuleVersion = (Get-Module 'VMware.vSphereDSC' -ListAvailable | Select-Object -First 1).Version.ToString()\n\n                $Script:Expected = [VmwDscConfiguration]::new(\n                    'Config_Add',\n                    @(\n                        foreach ($serverConfig in $serverConfigs) {\n                            [VmwDscNode]::New(\n                                $serverConfig.Server,\n                                @(\n                                    [VmwDscResource]::new(\n                                        'MyDatacenterFolder',\n                                        'DatacenterFolder',\n                                        @{ ModuleName = 'VMware.vSphereDSC'; RequiredVersion = $vSphereModuleVersion },\n                                        @{\n                                            Name = $Script:ConfigData.DatacenterFolder.Name\n                                            Location = $Script:ConfigData.DatacenterFolder.Location\n                                            Ensure = 'Present'\n                                        }\n                                    ),\n                                    [VmwDscResource]::new(\n                                        'MyDatacenter',\n                                        'Datacenter',\n                                        @{ ModuleName = 'VMware.vSphereDSC'; RequiredVersion = $vSphereModuleVersion },\n                                        @{\n                                            Name = $Script:ConfigData.Datacenter.Name\n                                            Location = $Script:ConfigData.Datacenter.Location\n                                            Ensure = 'Present'\n                                        }\n                                    )\n                                )\n                            )\n                        }\n                    )\n                )\n\n                $util = Join-Path (Split-Path $root) 'Utility.ps1'\n\n                . $util\n\n                . $Script:ConfigPath\n\n                # Act\n                $Script:DscConfigurationObj = New-VmwDscConfiguration @splatParams\n\n                # Assert\n                Script:AssertConfigurationEqual $Script:DscConfigurationObj $Script:Expected\n            }\n\n            It 'Should apply the Configuration without throwing' {\n                # Assert\n                { Start-VmwDscConfiguration $Script:DscConfigurationObj } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-VmwDscConfiguration without throwing' {\n                # Assert\n                { Get-VmwDscConfiguration $Script:DscConfigurationObj } | Should -Not -Throw\n            }\n\n            It 'Should return $true when Test-VmwDscConfiguration is run' {\n                # Assert\n                Test-VmwDscConfiguration $Script:DscConfigurationObj | Should -Contain $true\n            }\n\n            It 'Should return correct object when Test-VmwDscConfiguration is run with -Detailed flag' {\n                # Act\n                $nodeResults = Test-VmwDscConfiguration $Script:DscConfigurationObj -Detailed\n\n                foreach($res in $nodeResults) {\n                    # Assert\n                    $res.InDesiredState | Should -Be $true\n                    $res.ResourcesInDesiredState.Count | Should -Be 2\n                    $res.ResourcesNotInDesiredState.Count | Should -Be 0\n                }\n            }\n\n            It 'Should be able to call Get-VmwDscConfiguration and all parameters should match' {\n                # Act\n                $nodeResults = Get-VmwDscConfiguration $Script:DscConfigurationObj\n\n                foreach($res in $nodeResults) {\n                    # Assert\n                    $res.ResourcesStates[0].Name | Should -Be $Script:ConfigData.DatacenterFolder.Name\n                    $res.ResourcesStates[0].Location | Should -Be $Script:ConfigData.DatacenterFolder.Location\n\n                    $res.ResourcesStates[1].Name | Should -Be $Script:ConfigData.Datacenter.Name\n                    $res.ResourcesStates[1].Location | Should -Be $Script:ConfigData.Datacenter.Location\n                }\n            }\n\n            It 'Should execute current configuration with -ExecuteLastConfiguration flag on Test-VmwDscConfiguration' {\n                # Assert\n                Test-VmwDscConfiguration -ExecuteLastConfiguration | Should -Contain $true\n            }\n\n            It 'Should execute current configuration with -ExecuteLastConfiguration flag on Get-VmwDscConfiguration' {\n                # Act\n                $nodeResults = Get-VmwDscConfiguration -ExecuteLastConfiguration\n\n                foreach($res in $nodeResults) {\n                    # Assert\n                    $res.ResourcesStates[0].Name | Should -Be $Script:ConfigData.DatacenterFolder.Name\n                    $res.ResourcesStates[0].Location | Should -Be $Script:ConfigData.DatacenterFolder.Location\n\n                    $res.ResourcesStates[1].Name | Should -Be $Script:ConfigData.Datacenter.Name\n                    $res.ResourcesStates[1].Location | Should -Be $Script:ConfigData.Datacenter.Location\n                }\n            }\n\n            It 'Should execute only on a single node with -ConnectionFilter param' {\n                # Assert\n                Test-VmwDscConfiguration $Script:DscConfigurationObj -ConnectionFilter $Script:DscConfigurationObj.Nodes[0].InstanceName | Should -Be $true\n            }\n        } finally {\n            # cleanup changes\n\n            $splatParams = @{\n                ConfigName = 'Config_Remove'\n                ConfigurationData = $Script:ConfigData\n            }\n\n            . $Script:ConfigPath\n\n            $Script:DscConfigurationCleanObj = New-VmwDscConfiguration @splatParams\n\n            $Script:DscConfigurationCleanObj | Start-VmwDscConfiguration\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Integration/ServerConfig.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\nHere Servers are listed that will be used in the integration tests\n#>\n@(\n    <#\n    Entries Must be in the following format:\n\n    @{\n        Server = ''\n        User = ''\n        Password = ''\n    }\n    #>\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/DSCResources/CompositeResourceTest/CompositeResourceTest.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'CompositeResourceTest.schema.psm1'\n\n# Version number of this module.\nModuleVersion = '1.0.0.0'\n\n# ID used to uniquely identify this module\nGUID = 'afa6b042-c83c-4991-97cc-931cc81a3d06'\n\n# Author of this module\nAuthor = 'VMware'\n\n# Company or vendor of this module\nCompanyName = 'VMware'\n\n# Copyright statement for this module\nCopyright = '(c) VMware. All rights reserved.'\n\n# Description of the functionality provided by this module\nDescription = 'Test DSC Composite Resource.'\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.1'\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/DSCResources/CompositeResourceTest/CompositeResourceTest.schema.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration CompositeResourceTest {\n    Param(\n        $Value\n    )\n\n    Import-DscResource -ModuleName MyDscResource\n\n    MyTestResource Test\n    {\n        SomeVal = $Value\n        Ensure = 'Present'\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/MyDscResource.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n    # Script module or binary module file associated with this manifest.\n    RootModule = 'MyDscResource.psm1'\n\n    DscResourcesToExport = @(\n    'FileResource',\n    'MyTestResource'\n    )\n\n    # Version number of this module.\n    ModuleVersion = '1.0.0.0'\n\n    # ID used to uniquely identify this module\n    GUID = '81624038-5e71-40f8-8905-b1a87afe22d7'\n\n    # Author of this module\n    Author = 'VMware'\n\n    # Company or vendor of this module\n    CompanyName = 'VMware'\n\n    # Copyright statement for this module\n    Copyright = '(c) VMware. All rights reserved.'\n\n    # Description of the functionality provided by this module\n    Description = 'This module contains basic dsc resources designed for use in simple tests'\n\n    # Minimum version of the Windows PowerShell engine required by this module\n    PowerShellVersion = '5.1'\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/MyDscResource.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum Ensure\n{\n    Absent\n    Present\n}\n\n[DscResource()]\nclass MyTestResource\n{\n    [DscProperty(Key)]\n    [string] $SomeVal\n\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    [string] $PropForSet\n\n    [void] Set() {\n        $val = ''\n\n        if ($this.ensure -eq [Ensure]::Present) {\n            $val = 'Set result'\n        }\n        elseif ($this.Ensure -eq [Ensure]::Absent) {\n            $val = ''\n        }\n\n        $this.PropForSet = $val\n\t}\n\n\t[MyTestResource] Get() {\n\t\treturn $this\n\t}\n\n\t[bool] Test() {\n        $result = [string]::IsNullOrEmpty($this.PropForSet)\n\n        if ($this.ensure -eq [Ensure]::Present) {\n            $result = -not $result\n        }\n\n        return $result\n\t}\n}\n\n<#\n   This resource manages the file in a specific path.\n   [DscResource()] indicates the class is a DSC resource\n#>\n\n[DscResource()]\nclass FileResource\n{\n    <#\n       This property is the fully qualified path to the file that is\n       expected to be present or absent.\n\n       The [DscProperty(Key)] attribute indicates the property is a\n       key and its value uniquely identifies a resource instance.\n       Defining this attribute also means the property is required\n       and DSC will ensure a value is set before calling the resource.\n\n       A DSC resource must define at least one key property.\n    #>\n    [DscProperty(Key)]\n    [string]$Path\n\n    <#\n        This property indicates if the settings should be present or absent\n        on the system. For present, the resource ensures the file pointed\n        to by $Path exists. For absent, it ensures the file point to by\n        $Path does not exist.\n\n        The [DscProperty(Mandatory)] attribute indicates the property is\n        required and DSC will guarantee it is set.\n\n        If Mandatory is not specified or if it is defined as\n        Mandatory=$false, the value is not guaranteed to be set when DSC\n        calls the resource.  This is appropriate for optional properties.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n       This property defines the fully qualified path to a file that will\n       be placed on the system if $Ensure = Present and $Path does not\n        exist.\n\n       NOTE: This property is required because [DscProperty(Mandatory)] is\n        set.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $SourcePath\n\n    <#\n       This property reports the file's create timestamp.\n\n       [DscProperty(NotConfigurable)] attribute indicates the property is\n       not configurable in DSC configuration.  Properties marked this way\n       are populated by the Get() method to report additional details\n       about the resource when it is present.\n\n    #>\n    [DscProperty(NotConfigurable)]\n    [Nullable[datetime]] $CreationTime\n\n    <#\n        This method is equivalent of the Set-TargetResource script function.\n        It sets the resource to the desired state.\n    #>\n    [void] Set()\n    {\n        $fileExists = $this.TestFilePath($this.Path)\n        if ($this.ensure -eq [Ensure]::Present)\n        {\n            if (-not $fileExists)\n            {\n                $this.CopyFile()\n            }\n        }\n        else\n        {\n            if ($fileExists)\n            {\n                Write-Verbose -Message \"Deleting the file $($this.Path)\"\n                Remove-Item -LiteralPath $this.Path -Force\n            }\n        }\n    }\n\n    <#\n        This method is equivalent of the Test-TargetResource script function.\n        It should return True or False, showing whether the resource\n        is in a desired state.\n    #>\n    [bool] Test()\n    {\n        $present = $this.TestFilePath($this.Path)\n\n        if ($this.Ensure -eq [Ensure]::Present)\n        {\n            return $present\n        }\n        else\n        {\n            return -not $present\n        }\n    }\n\n    <#\n        This method is equivalent of the Get-TargetResource script function.\n        The implementation should use the keys to find appropriate resources.\n        This method returns an instance of this class with the updated key\n         properties.\n    #>\n    [FileResource] Get()\n    {\n        $present = $this.TestFilePath($this.Path)\n\n        if ($present)\n        {\n            $file = Get-ChildItem -LiteralPath $this.Path\n            $this.CreationTime = $file.CreationTime\n            $this.Ensure = [Ensure]::Present\n        }\n        else\n        {\n            $this.CreationTime = $null\n            $this.Ensure = [Ensure]::Absent\n        }\n\n        return $this\n    }\n\n    <#\n        Helper method to check if the file exists and it is file\n    #>\n    [bool] TestFilePath([string] $location)\n    {\n        $present = $true\n\n        $item = Get-ChildItem -LiteralPath $location -ea Ignore\n        if ($item -eq $null)\n        {\n            $present = $false\n        }\n        elseif ($item.PSProvider.Name -ne \"FileSystem\")\n        {\n            throw \"Path $($location) is not a file path.\"\n        }\n        elseif ($item.PSIsContainer)\n        {\n            throw \"Path $($location) is a directory path.\"\n        }\n\n        return $present\n    }\n\n    <#\n        Helper method to copy file from source to path\n    #>\n    [void] CopyFile()\n    {\n        if (-not $this.TestFilePath($this.SourcePath))\n        {\n            throw \"SourcePath $($this.SourcePath) is not found.\"\n        }\n\n        [System.IO.FileInfo] $destFileInfo = new-object System.IO.FileInfo($this.Path)\n        if (-not $destFileInfo.Directory.Exists)\n        {\n            Write-Verbose -Message \"Creating directory $($destFileInfo.Directory.FullName)\"\n\n            <#\n                Use CreateDirectory instead of New-Item to avoid code\n                 to handle the non-terminating error\n            #>\n            [System.IO.Directory]::CreateDirectory($destFileInfo.Directory.FullName)\n        }\n\n        if (Test-Path -LiteralPath $this.Path -PathType Container)\n        {\n            throw \"Path $($this.Path) is a directory path\"\n        }\n\n        Write-Verbose -Message \"Copying $($this.SourcePath) to $($this.Path)\"\n\n        # DSC engine catches and reports any error that occurs\n        Copy-Item -LiteralPath $this.SourcePath -Destination $this.Path -Force\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_ArrayWithNonHashtable_Value.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        'AllNodes'\n    )\n}\n\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_HashtableValue_Without_NodeNameKey.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NoNodeName = 'NoNodeName'\n        }\n    )\n}\n\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_NotAnArray.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = 'AllNodes'\n}\n\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_Values_With_Duplicate_NodeNameKeys.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'NodeName'\n        },\n        @{\n            NodeName = 'NodeName'\n        }\n    )\n}\n\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/Multiple_DSCConfigurations.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration DSC_Configuration_One {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource fileOne {\n        Path = 'C:\\Users\\temp'\n        SourcePath = 'C:\\Users\\temp'\n        Ensure = 'Present'\n    }\n}\n\nConfiguration DSC_Configuration_Two {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource fileTwo {\n        Path = 'C:\\Users\\temp'\n        SourcePath = 'C:\\Users\\temp'\n        Ensure = 'Present'\n    }\n}\n\n$script:expectedCompiledOne = [VmwDscConfiguration]::new(\n    'DSC_Configuration_One',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'fileOne',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = 'C:\\Users\\temp'\n                        SourcePath = 'C:\\Users\\temp'\n                        Ensure = 'Present'\n                    }\n                )\n            )\n        )\n    )\n)\n\n$script:expectedCompiledTwo = [VmwDscConfiguration]::new(\n    'DSC_Configuration_Two',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'fileTwo',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = 'C:\\Users\\temp'\n                        SourcePath = 'C:\\Users\\temp'\n                        Ensure = 'Present'\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/Nodes/manyNodes.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\nConfiguration with multiple nodes\n#>\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    Node 'MyNode'\n    {\n        FileResource 'file'\n        {\n            Path = 'path'\n            SourcePath = 'path2'\n            Ensure = 'present'\n        }\n    }\n\n    Node 'OtherNode'\n    {\n        FileResource file {\n            Path = 'no path'\n            SourcePath = 'no source'\n            Ensure = 'absent'\n        }\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'MyNode',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path2\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        ),\n        [VmwDscNode]::new(\n            'OtherNode',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"no path\"\n                        SourcePath = \"no source\"\n                        Ensure = \"absent\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/Nodes/oneNodeManyConnections.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration with a single node that has many connections.\nShould generate multiple node objects.\n#>\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    vSphereNode @('MyNode', 'OtherNode') {\n        FileResource 'file'\n        {\n            Path = 'path'\n            SourcePath = 'path2'\n            Ensure = 'present'\n        }\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwVsphereDscNode]::new(\n            'MyNode',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path2\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        ),\n        [VmwVsphereDscNode]::new(\n            'OtherNode',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path2\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/Nodes/singleNode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n    Basic Configuration with only a single resource\n#>\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    Node 'Sample Node' {\n        FileResource file\n        {\n            Path = \"path\"\n            SourcePath = \"path\"\n            Ensure = \"present\"\n        }\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'Sample Node',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/compositeResourceConfig.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration containing a composite resource.\nShould result in a composite resource object with set innerResources.\n#>\nConfiguration Test\n{\n    Import-DscResource -Name 'CompositeResourceTest'\n\n    CompositeResourceTest Test\n    {\n        Value = 'Test Field'\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'Test',\n                    'CompositeResourceTest',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{},\n                    @(\n                        [VmwDscResource]::new(\n                            'Test',\n                            'MyTestResource',\n                            @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                            @{\n                                SomeVal = 'Test Field'\n                                Ensure = 'Present'\n                            }\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/configurationDataConfig.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            Path = 'C:\\Users\\temp'\n            SourcePath = 'C:\\Users\\temp'\n        }\n    )\n}\n\n<#\n.DESCRIPTION\nConfiguration that requires ConfigurationData\nShould get parsed correctly.\n#>\nConfiguration Test {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = $script:configurationData['AllNodes']['Path']\n        SourcePath = $script:configurationData['AllNodes']['SourcePath']\n        Ensure = 'Present'\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            [VmwDscResource]::new(\n                'file',\n                'FileResource',\n                @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                @{\n                    Path = $script:configurationData['AllNodes']['Path']\n                    SourcePath = $script:configurationData['AllNodes']['SourcePath']\n                    Ensure = 'Present'\n                }\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/dependsOnOrder.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration with resources that have a non-linear order.\nShould get ordered by their DependsOn property.\n#>\nConfiguration Test {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file1\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n        DependsOn = '[FileResource]file3'\n    }\n\n    FileResource file2\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n\n    FileResource file3\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n        DependsOn = '[FileResource]file2'\n    }\n\n    FileResource file4\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n\n    FileResource file5\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n\n    FileResource file6\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n        DependsOn = '[FileResource]file7'\n    }\n\n    FileResource file7\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n        DependsOn = '[FileResource]file8'\n    }\n\n    FileResource file8\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n}\n\n# file2 -> file3 -> file1 -> file4 -> file5 -> file8 -> file7 -> file6\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'file2',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file3',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file1',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file4',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file5',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file8',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file7',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file6',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/duplicateResources.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration with duplicate resource names of the same type.\nShould throw exception.\n#>\nConfiguration Test {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n\n    FileResource file\n    {\n        Path = \"path2\"\n        SourcePath = \"path2\"\n        Ensure = \"absent\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/fileParams.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration with parameters from the file.\nShould get parsed correctly.\n#>\nParam (\n    $PathToUse\n)\n\nConfiguration Test {\n    Param (\n        $PathToUse\n    )\n\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = $PathToUse\n        SourcePath = 'some path'\n        Ensure = 'present'\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = $PathToUse\n                        SourcePath = \"some path\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/innerException.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration that causes an exception during runtime.\nShould rethrow the exception.\n#>\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n\n    InvalidCall\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/invalidDependsOn.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration with a Resource that has an invalid dependsOn property.\nShould throw an exception.\n#>\nConfiguration Test {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = 'path'\n        SourcePath = 'path'\n        Ensure = 'present'\n        DependsOn = \"Something else\"\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/manyResources.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nBasic Configuration with many Resources in linear order.\nResources should maintain the order in which they are defined.\n#>\nConfiguration Test {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n\n    FileResource file2\n    {\n        Path = \"path2\"\n        SourcePath = \"path2\"\n        Ensure = \"absent\"\n    }\n\n    FileResource file3\n    {\n        Path = \"path3\"\n        SourcePath = \"path3\"\n        Ensure = \"absent\"\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file2',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path2\"\n                        SourcePath = \"path2\"\n                        Ensure = \"absent\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file3',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path3\"\n                        SourcePath = \"path3\"\n                        Ensure = \"absent\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/multipleDependsOnResource.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nConfiguration with many resources that depend on a single resource.\nResources should be ordered first by their DependsOn property then by the order in which they are defined.\n#>\nConfiguration Test {\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file1\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n        DependsOn = @(\n            '[FileResource]file2',\n            '[FileResource]file3'\n        )\n    }\n\n    FileResource file2\n    {\n        Path = \"path2\"\n        SourcePath = \"path2\"\n        Ensure = \"absent\"\n    }\n\n    FileResource file3\n    {\n        Path = \"path3\"\n        SourcePath = \"path3\"\n        Ensure = \"absent\"\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'file2',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path2\"\n                        SourcePath = \"path2\"\n                        Ensure = \"absent\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file3',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path3\"\n                        SourcePath = \"path3\"\n                        Ensure = \"absent\"\n                    }\n                )\n                [VmwDscResource]::new(\n                    'file1',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/simple.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nBasic Configuration with only a single resource.\nShould compile the configuration correctly.\n#>\nConfiguration Test\n{\n    Import-DscResource -ModuleName MyDscResource\n\n    FileResource file\n    {\n        Path = \"path\"\n        SourcePath = \"path\"\n        Ensure = \"present\"\n    }\n}\n\n$Script:expectedCompiled = [VmwDscConfiguration]::new(\n    'Test',\n    @(\n        [VmwDscNode]::new(\n            'localhost',\n            @(\n                [VmwDscResource]::new(\n                    'file',\n                    'FileResource',\n                    @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' },\n                    @{\n                        Path = \"path\"\n                        SourcePath = \"path\"\n                        Ensure = \"present\"\n                    }\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Unit/Invoke-VmwDscConfiguration.tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$root = Split-Path (Split-Path $PSScriptRoot)\n\n$module = Join-Path $root 'VMware.PSDesiredStateConfiguration.psd1'\n\nImport-Module $module -Force\n\nInModuleScope -ModuleName 'VMware.PSDesiredStateConfiguration' {\n    $Script:SampleDscConfiguration = [VmwDscConfiguration]::new(\n        'Test',\n        @(\n            [VmwDscNode]::new(\n                'localhost',\n                @(\n                    [VmwDscResource]::new(\n                        'file',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path\"\n                            SourcePath = \"path\"\n                            Ensure = \"present\"\n                        }\n                    ),\n                    [VmwDscResource]::new(\n                        'file2',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path2\"\n                            SourcePath = \"path2\"\n                            Ensure = \"absent\"\n                        }\n                    )\n                )\n            )\n        )\n    )\n\n    $Script:SampleDscConfigurationWithVsphereNode = [VmwDscConfiguration]::new(\n        'Test',\n        @(\n            [VmwVsphereDscNode]::new(\n                '10.10.10.10',\n                @(\n                    [VmwDscResource]::new(\n                        'MyDatacenterFolder',\n                        'DatacenterFolder',\n                        @{ ModuleName = 'VMware.vSphereDSC'; RequiredVersion = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).Version.ToString() },\n                        @{\n                            Location = ''\n                            Name = 'MyDatacenterFolder'\n                            Ensure = 'Present'\n                        }\n                    )\n                )\n            )\n        )\n    )\n\n    $Script:SampleDscConfigurationWithDuplicateKeyPropertiesResource = [VmwDscConfiguration]::new(\n        'Test',\n        @(\n            [VmwDscNode]::new(\n                'localhost',\n                @(\n                    [VmwDscResource]::new(\n                        'file',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path\"\n                            SourcePath = \"path\"\n                            Ensure = \"present\"\n                        }\n                    ),\n                    [VmwDscResource]::new(\n                        'file2',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path\"\n                            SourcePath = \"path\"\n                            Ensure = \"present\"\n                        }\n                    )\n                )\n            )\n        )\n    )\n\n    $Script:SampleDscConfigurationWithMultipleNodes = [VmwDscConfiguration]::new(\n        'Test',\n        @(\n            [VmwDscNode]::new(\n                'firstNode',\n                @(\n                    [VmwDscResource]::new(\n                        'file',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path\"\n                            SourcePath = \"path\"\n                            Ensure = \"present\"\n                        }\n                    )\n                )\n            ),\n            [VmwDscNode]::new(\n                'secondNode',\n                @(\n                    [VmwDscResource]::new(\n                        'file2',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path2\"\n                            SourcePath = \"path2\"\n                            Ensure = \"absent\"\n                        }\n                    )\n                )\n            ),\n            [VmwDscNode]::new(\n                'thirdNode',\n                @(\n                    [VmwDscResource]::new(\n                        'file3',\n                        'FileResource',\n                        @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0.0.0' },\n                        @{\n                            Path = \"path3\"\n                            SourcePath = \"path3\"\n                            Ensure = \"present\"\n                        }\n                    )\n                )\n            )\n        )\n    )\n\n    Describe 'Get-VmwDscConfiguration' {\n        It 'Should return the last executed configuration resources when ExecuteLastConfiguration switch is used' {\n            # arrange\n            Mock Invoke-DscResource {\n                Param(\n                    $Method\n                )\n\n                if ($Method -eq 'Get') {\n                    [PSCustomObject]@{\n                        Prop = 'MyProp'\n                    }\n                }\n            } -Verifiable\n\n            $Script:LastExecutedConfiguration = $Script:SampleDscConfiguration\n\n            # act\n            $result = Get-VmwDscConfiguration -ExecuteLastConfiguration\n\n            # assert\n            Assert-VerifiableMock\n            ($null -ne $result) | Should -Be $true\n        }\n        It 'Should throw when there is no old configuration to be used with ExecuteLastConfiguration switch' {\n            #assert\n            {\n                $Script:LastExecutedConfiguration = $null\n\n                Get-VmwDscConfiguration -ExecuteLastConfiguration\n            } | Should -Throw $Script:NoConfigurationDetectedForInvokeException\n        }\n    }\n    Describe 'Test-VmwDscConfiguration' {\n        Context 'Detailed switch is on' {\n            It 'Should place resources in desired state in ResourcesInDesiredState property' {\n                Mock Invoke-DscResource {\n                    Param(\n                        $Name\n                    )\n\n                    [PSCustomObject]@{\n                        InDesiredState = $true\n                    }\n                } -Verifiable\n\n                # act\n                $res = Test-VmwDscConfiguration $Script:SampleDscConfiguration -Detailed\n\n                # assert\n                Assert-VerifiableMock\n                $res.InDesiredState | Should -Be $true\n                $res.ResourcesInDesiredState.Count | Should -Be 2\n                $res.ResourcesNotInDesiredState.Count | Should -Be 0\n            }\n            It 'Should place resources not in desired state in ResourcesNotInDesiredState property' {\n                Mock Invoke-DscResource {\n                    Param(\n                        $Name\n                    )\n\n                    [PSCustomObject]@{\n                        InDesiredState = $false\n                    }\n                } -Verifiable\n\n                # act\n                $res = Test-VmwDscConfiguration $Script:SampleDscConfiguration -Detailed\n\n                # assert\n                Assert-VerifiableMock\n                $res.InDesiredState | Should -Be $false\n                $res.ResourcesInDesiredState.Count | Should -Be 0\n                $res.ResourcesNotInDesiredState.Count | Should -Be 2\n            }\n        }\n        Context 'Detailed switch is off' {\n            It 'Should return $true if state is desired' {\n                Mock Invoke-DscResource {\n                    [PSCustomObject]@{\n                        InDesiredState = $true\n                    }\n                } -Verifiable\n\n                # act\n                $res = Test-VmwDscConfiguration $Script:SampleDscConfiguration\n\n                # assert\n                Assert-VerifiableMock\n                $res | Should -Be $true\n            }\n            It 'Should return $false if state is not desired' {\n                Mock Invoke-DscResource {\n                    [PSCustomObject]@{\n                        InDesiredState = $false\n                    }\n                } -Verifiable\n\n                # act\n                $res = Test-VmwDscConfiguration $Script:SampleDscConfiguration\n\n                # assert\n                Assert-VerifiableMock\n                $res | Should -Be $false\n            }\n        }\n    }\n    Describe 'Start-VmwDscConfiguration' {\n        It 'Should not execute set method if resource is in desired state' {\n            try {\n                # arrange\n                $Global:_IsSetExecuted = $false\n\n                Mock Invoke-DscResource {\n                    Param(\n                        $Method\n                    )\n\n                    if ($Method -eq 'Test') {\n                        [PSCustomObject]@{\n                            InDesiredState = $true\n                        }\n                    } else {\n                        $Global:_IsSetExecuted = $true\n                    }\n                } -Verifiable\n\n                # act\n                Start-VmwDscConfiguration $Script:SampleDscConfiguration\n\n                # assert\n                Assert-VerifiableMock\n                $Global:_IsSetExecuted | Should -Be $false\n            }\n            finally {\n                Remove-Variable -Name '_IsSetExecuted' -Scope 'Global'\n            }\n        }\n        It 'Should execute set method if resource is not in desired state' {\n            try {\n                # arrange\n                $Global:_IsSetExecuted = $false\n\n                Mock Invoke-DscResource {\n                    Param(\n                        $Method\n                    )\n\n                    if ($Method -eq 'Test') {\n                        [PSCustomObject]@{\n                            InDesiredState = $false\n                        }\n                    } else {\n                        $Global:_IsSetExecuted = $true\n                    }\n                } -Verifiable\n\n                # act\n                Start-VmwDscConfiguration $Script:SampleDscConfiguration\n\n                # assert\n                Assert-VerifiableMock\n                $Global:_IsSetExecuted | Should -Be $true\n            }\n            finally {\n                Remove-Variable -Name '_IsSetExecuted' -Scope 'Global'\n            }\n        }\n    }\n    Describe 'Invoke-VmwDscConfiguration' {\n        It 'Should throw if invalid method is given' {\n            # assert\n            {\n                $splat = @{\n                    Configuration = $Script:SampleDscConfiguration\n                    Method = 'Invalid Method'\n                }\n\n                Invoke-VmwDscConfiguration @splat\n            } | Should -Throw\n        }\n        It 'Should throw if node contains a resource with duplicate key property values' {\n            # assert\n            {\n                $splat = @{\n                    Configuration = $Script:SampleDscConfigurationWithDuplicateKeyPropertiesResource\n                    Method = 'Test'\n                }\n\n                Invoke-VmwDscConfiguration @splat\n            } | Should -Throw ($Script:DscResourcesWithDuplicateKeyPropertiesException -f $Script:SampleDscConfigurationWithDuplicateKeyPropertiesResource.Nodes[0].Resources[0].ResourceType)\n        }\n        It 'Should correctly filter configuration nodes based on ConnectionFilter parameter with string input' {\n            # arrange\n            $nodeToUse = 'secondNode'\n\n            Mock Invoke-DscResource {\n                [PsObject]@{\n                    Result = 'myResult'\n                }\n            } -Verifiable\n\n            # act\n            $splat = @{\n                Configuration = $Script:SampleDscConfigurationWithMultipleNodes\n                ConnectionFilter = $nodeToUse\n                Method = 'Test'\n            }\n\n            $res = Invoke-VmwDscConfiguration @splat\n\n            # assert\n            Assert-VerifiableMock\n            $res.OriginalNode.InstanceName | Should -Be $nodeToUse\n        }\n        It 'Should correctly filter configuration nodes based on ConnectionFilter parameter with object input' {\n            # arrange\n            $nodeToUse = [PsObject]@{\n                Name = 'secondNode'\n            }\n\n            Mock Invoke-DscResource {\n                [PsObject]@{\n                    Result = 'myResult'\n                }\n            } -Verifiable\n\n            # act\n            $splat = @{\n                Configuration = $Script:SampleDscConfigurationWithMultipleNodes\n                ConnectionFilter = $nodeToUse\n                Method = 'Test'\n            }\n\n            $res = Invoke-VmwDscConfiguration @splat\n\n            # assert\n            Assert-VerifiableMock\n            $res.OriginalNode.InstanceName | Should -Be $nodeToUse.Name\n        }\n        It 'Should correctly filter configuration nodes based on ConnectionFilter parameter with array input' -Skip {\n            # arrange\n            $nodesToUse = @(\n                'secondNode',\n                'thirdNode'\n            )\n\n            Mock Invoke-DscResource {\n                [PsObject]@{\n                    Result = 'myResult'\n                }\n            } -Verifiable\n\n            # act\n            $splat = @{\n                Configuration = $Script:SampleDscConfigurationWithMultipleNodes\n                ConnectionFilter = $nodesToUse\n                Method = 'Test'\n            }\n\n            $results = Invoke-VmwDscConfiguration @splat\n\n            # assert\n            Assert-VerifiableMock\n            $results.Count | Should -Be $nodesToUse.Count\n\n            foreach($res in $results) {\n                $nodesToUse | Should -Contain $res.OriginalNode.InstanceName\n            }\n        }\n    }\n    Describe 'vSphereNode functionality' {\n        It 'Should throw if DefaultViServers is null' {\n            # assert\n            {\n                $splat = @{\n                    Configuration = $Script:SampleDscConfigurationWithVsphereNode\n                    Method = 'Test'\n                }\n\n                Invoke-VmwDscConfiguration @splat\n            } | Should -Throw $Script:NoVsphereConnectionsFoundException\n        }\n        It 'Should throw if there are multiple connections to the same vSphere server' {\n            try {\n                # arrange\n                $Global:DefaultViServers = @(\n                    [PsObject]@{\n                        Name = $Script:SampleDscConfigurationWithVsphereNode.Nodes[0].InstanceName\n                    }\n                    [PsObject]@{\n                        Name = $Script:SampleDscConfigurationWithVsphereNode.Nodes[0].InstanceName\n                    }\n                )\n\n                # assert\n                {\n                    $splat = @{\n                        Configuration = $Script:SampleDscConfigurationWithVsphereNode\n                        Method = 'Test'\n                    }\n                    Invoke-VmwDscConfiguration @splat\n                } | Should -Throw ($Script:TooManyConnectionOnASingleVCenterException -f $Script:SampleDscConfigurationWithVsphereNode.Nodes[0].InstanceName)\n            }\n            finally {\n                Remove-Variable -Name 'DefaultViServers' -Scope 'Global'\n            }\n        }\n        It 'Should Set Connection property of resources correctly' {\n            try {\n                $Global:_IsConnectionPropertySet = $false\n                $Global:DefaultViServers = @(\n                    [PsObject]@{\n                        Name = $Script:SampleDscConfigurationWithVsphereNode.Nodes[0].InstanceName\n                    }\n                )\n\n                Mock Invoke-DscResource {\n                    Param(\n                        $Property\n                    )\n\n                    $Global:_IsConnectionPropertySet = $Property.ContainsKey('Connection')\n\n                    [PSCustomObject]@{\n                        InDesiredState = $true\n                    }\n                } -Verifiable\n\n                # act\n                $splat = @{\n                    Configuration = $Script:SampleDscConfigurationWithVsphereNode\n                    Method = 'Test'\n                }\n                Invoke-VmwDscConfiguration @splat | Out-Null\n\n                # assert\n                Assert-VerifiableMock\n                $Global:_IsConnectionPropertySet | Should -Be $true\n            }\n            finally {\n                Remove-Variable -Name 'DefaultViServers' -Scope 'Global'\n                Remove-Variable -Name '_IsConnectionPropertySet' -Scope 'Global'\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Unit/New-VmwDscConfiguration.tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$root = Split-Path -Path (Split-Path -Path $PSScriptRoot)\n\n$module = Join-Path -Path $root -ChildPath 'VMware.PSDesiredStateConfiguration.psd1'\n\nImport-Module $module -Force\n\nInModuleScope -ModuleName 'VMware.PSDesiredStateConfiguration' {\n    try {\n        $rootTestPath = Split-Path $PSScriptRoot\n\n        $script:configFolder = Join-Path -Path $rootTestPath -ChildPath 'Sample Configurations'\n        $script:configurationDataFolder = Join-Path -Path $script:configFolder -ChildPath 'ConfigurationData'\n        $script:nodeConfigFolder = Join-Path -Path $script:configFolder -ChildPath 'Nodes'\n\n        $util = Join-Path -Path $rootTestPath -ChildPath 'Utility.ps1'\n        . $util\n\n        $Global:OldProgressPreference = $ProgressPreference\n        $Global:ProgressPreference = 'SilentlyContinue'\n\n        Describe 'New-VmwDscConfiguration Tests' {\n            It 'Should compile a DSC Configuration with one DSC Resource correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'simple.ps1'\n\n                # Act\n                $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n            }\n\n            It 'Should compile a DSC Configuration with many DSC Resources correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'manyResources.ps1'\n\n                # Act\n                $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n            }\n\n            It 'Should compile a DSC Configuration with script parameters correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'fileParams.ps1'\n\n                # Act\n                $dscConfiguration = New-VmwDscConfiguration -Path $configFile -Parameters @{ PathToUse = 'C:\\Users\\temp' }\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n            }\n\n            It 'Should compile a DSC Configuration with dependencies and order the DSC Resources correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'dependsOnOrder.ps1'\n\n                # Act\n                $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n            }\n\n            It 'Should compile a DSC Configuration with multiple dependencies on a DSC Resource and order the DSC Resources correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'multipleDependsOnResource.ps1'\n\n                # Act\n                $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n            }\n\n            It 'Should compile all DSC Configurations defined in the script file correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'Multiple_DSCConfigurations.ps1'\n\n                # Act\n                $dscConfigurations = New-VmwDscConfiguration -Path $configFile\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfigurations[0] $script:expectedCompiledOne\n                Script:AssertConfigurationEqual $dscConfigurations[1] $script:expectedCompiledTwo\n            }\n\n            It 'Should compile only the DSC Configuration with the specified name correctly' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'Multiple_DSCConfigurations.ps1'\n\n                # Act\n                $dscConfiguration = New-VmwDscConfiguration -Path $configFile -ConfigurationName 'DSC_Configuration_Two'\n\n                # Assert\n                Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiledTwo\n            }\n\n            It 'Should throw an exception with the correct message for a DSC Configuration with duplicate DSC Resources' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'duplicateResources.ps1'\n\n                # Act && Assert\n                { New-VmwDscConfiguration -Path $configFile } | Should -Throw ($script:DuplicateResourceException -f 'file', 'FileResource')\n            }\n\n            It 'Should throw an exception with the correct message for a DSC Configuration with a DSC Resource with invalid dependency' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'invalidDependsOn.ps1'\n\n                # Act && Assert\n                { New-VmwDscConfiguration -Path $configFile } | Should -Throw ($script:DependsOnResourceNotFoundException -f 'file', 'Something else')\n            }\n\n            It 'Should throw an exception for a DSC Configuration that contains an invalid code' {\n                # Arrange\n                $configFile = Join-Path -Path $script:configFolder -ChildPath 'innerException.ps1'\n\n                # Act && Assert\n                { New-VmwDscConfiguration -Path $configFile } | Should -Throw\n            }\n\n            Context 'New-VmwDscConfiguration ConfigurationData Tests' {\n                It 'Should throw an exception with the correct message for a ConfigurationData where AllNodes key is not an array' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:configurationDataFolder -ChildPath 'AllNodes_NotAnArray.ps1'\n\n                    # Act && Assert\n                    { New-VmwDscConfiguration -Path $configFile } | Should -Throw $script:ConfigurationDataAllNodesKeyIsNotAnArrayException\n                }\n\n                It 'Should throw an exception with the correct message for a ConfigurationData where AllNodes array contains a value which is not a hashtable' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:configurationDataFolder -ChildPath 'AllNodes_ArrayWithNonHashtable_Value.ps1'\n\n                    # Act && Assert\n                    { New-VmwDscConfiguration -Path $configFile } | Should -Throw $script:ConfigurationDataNodeEntryInAllNodesIsNotAHashtableException\n                }\n\n                It 'Should throw an exception with the correct message for a ConfigurationData where AllNodes array contains a hashtable value without NodeName key' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:configurationDataFolder -ChildPath 'AllNodes_HashtableValue_Without_NodeNameKey.ps1'\n\n                    # Act && Assert\n                    { New-VmwDscConfiguration -Path $configFile } | Should -Throw $script:ConfigurationDataNodeEntryInAllNodesDoesNotContainNodeNameException\n                }\n\n                It 'Should throw an exception with the correct message for a ConfigurationData where AllNodes array contains values with duplicate NodeName keys' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:configurationDataFolder -ChildPath 'AllNodes_Values_With_Duplicate_NodeNameKeys.ps1'\n\n                    # Act && Assert\n                    { New-VmwDscConfiguration -Path $configFile } | Should -Throw $script:DuplicateEntryInAllNodesException\n                }\n\n                It 'Should compile a DSC Configuration with ConfigurationData correctly' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:configFolder -ChildPath 'configurationDataConfig.ps1'\n\n                    # Act\n                    $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                    # Assert\n                    Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n                }\n            }\n\n            Context 'New-VmwDscConfiguration Composite DSC Resources Tests' {\n                if ($PSVersionTable.OS -Match 'Microsoft Windows') {\n                    It 'Should compile a DSC Configuration with Composite DSC Resource correctly' {\n                        # Arrange\n                        $configFile = Join-Path -Path $script:configFolder -ChildPath 'compositeResourceConfig.ps1'\n\n                        # Act\n                        $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                        # Assert\n                        Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n                    }\n                }\n            }\n\n            Context 'New-VmwDscConfiguration Node Tests' {\n                It 'Should compile a DSC Configuration with a single Node correctly' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:nodeConfigFolder -ChildPath 'singleNode.ps1'\n\n                    # Act\n                    $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                    # Assert\n                    Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n                }\n\n                It 'Should compile a DSC Configuration and group the DSC Resources from one vSphereNode which value is array correctly' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:nodeConfigFolder -ChildPath 'oneNodeManyConnections.ps1'\n\n                    # Act\n                    $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                    # Assert\n                    Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n                }\n\n                It 'Should compile a DSC Configuration with multiple Nodes correctly' {\n                    # Arrange\n                    $configFile = Join-Path -Path $script:nodeConfigFolder -ChildPath 'manyNodes.ps1'\n\n                    # Act\n                    $dscConfiguration = New-VmwDscConfiguration -Path $configFile\n\n                    # Assert\n                    Script:AssertConfigurationEqual $dscConfiguration $script:expectedCompiled\n                }\n            }\n        }\n    }\n    finally {\n        if ($null -eq $Global:OldProgressPreference) {\n            $Global:OldProgressPreference = 'continue'\n        }\n\n        $Global:ProgressPreference = $Global:OldProgressPreference\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/Tests/Utility.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\nPerforms an assert on two [VmwDscResource] objects to check if they're equal\n#>\nfunction Script:AssertResourceEqual {\n    Param (\n        [VmwDscResource]\n        $ResultRes,\n\n        [VmwDscResource]\n        $ExpectedRes\n    )\n\n    # assert regular properties\n    $ResultRes.InstanceName | Should -Be $ExpectedRes.InstanceName\n    $ResultRes.ResourceType | Should -Be $ExpectedRes.ResourceType\n\n    ($null -ne $ResultRes.ModuleName) | Should -Be ($null -ne $ExpectedRes.ModuleName)\n\n    if ($null -ne $ResultRes.ModuleName) {\n        $ResultRes.ModuleName.Name | Should -Be $ExpectedRes.ModuleName.Name\n        $ResultRes.ModuleName.RequiredVersion.ToString().Contains($ExpectedRes.ModuleName.RequiredVersion.ToString()) | Should -Be $true\n    }\n\n    $ResultRes.Property.Keys.Count | Should -Be $ExpectedRes.Property.Keys.Count\n\n    # assert key value pairs in 'Property' property are equal\n    foreach ($key in $ResultRes.Property.Keys) {\n        $ResultResPropVal = $ResultRes.Property[$key]\n\n        $isKeyContained = $ExpectedRes.Property.ContainsKey($key)\n        $isKeyContained | Should -Be $true\n\n        $ResultResPropVal | Should -Be $ExpectedRes.Property[$key]\n    }\n\n    $ResultRes.GetIsComposite() | Should -Be $ExpectedRes.GetIsComposite()\n\n    if ($ResultRes.GetIsComposite()) {\n        $ResultResInnerRes = $ResultRes.GetInnerResources()\n        $ExpectedResInnerRes = $ExpectedRes.GetInnerResources()\n\n        $ResultResInnerRes.Count | Should -Be $ExpectedResInnerRes.Count\n\n        for ($j = 0; $j -lt $ResultResInnerRes.Count; $j++) {\n            # assert inner Resources equal\n            Script:AssertResourceEqual $ResultResInnerRes[$j] $ExpectedResInnerRes[$j]\n        }\n    } else {\n        $ResultRes.GetInnerResources() | Should -Be $null\n    }\n}\n\n<#\n.DESCRIPTION\nPerforms an assert on two [VmwNode] objects to check if they're equal\n#>\nfunction Script:AssertNodeEqual {\n    Param (\n        [VmwDscNode]\n        $ResultNode,\n\n        [VmwDscNode]\n        $ExpectedNode\n    )\n\n    $ResultNode.InstanceName | Should -Be $ExpectedNode.InstanceName\n\n    $ResultNode.Resources.Count | Should -Be $ExpectedNode.Resources.Count\n\n    for ($i = 0; $i -lt $ResultNode.Resources.Count; $i++) {\n        # assert resources array of node\n        Script:AssertResourceEqual $ResultNode.Resources[$i] $ExpectedNode.Resources[$i]\n    }\n}\n\n<#\n.DESCRIPTION\nPerforms an assert on two [VmwDscConfiguration] objects to check if they're equal\n#>\nfunction Script:AssertConfigurationEqual {\n    Param (\n        [VmwDscConfiguration]\n        $Result,\n\n        [VmwDscConfiguration]\n        $Expected\n    )\n\n    # assert regular properties\n    $Result.InstanceName | Should -Be $Expected.InstanceName\n    $Result.Nodes.Count | Should -Be $Expected.Nodes.Count\n\n    for ($i = 0; $i -lt $Result.Nodes.Count; $i++) {\n        # assert node array of configuration\n        Script:AssertNodeEqual $Result.Nodes[$i] $Expected.Nodes[$i]\n    }\n}\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/VMware.PSDesiredStateConfiguration.build.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:ModuleRoot = $PSScriptRoot\n$script:ProjectRoot = (Get-Item -Path $script:ModuleRoot).Parent.Parent.FullName\n$script:ModuleName = Split-Path -Path $script:ModuleRoot -Leaf\n\n$script:PsdPath = Join-Path -Path $script:ModuleRoot -ChildPath \"$($script:ModuleName).psd1\"\n\n$script:LicensePath = Join-Path -Path $script:ProjectRoot -ChildPath \"LICENSE.txt\"\n\n# This is used to skip the lines from LICENSE.txt containing the repository name and the empty line after it.\n$script:LicenseSkipLines = 2\n$script:LicenseFileContent = Get-Content -Path $script:LicensePath | Select-Object -Skip $script:LicenseSkipLines\n\n$script:ClassesPath = Join-Path -Path $script:ModuleRoot -ChildPath 'Classes'\n$script:FunctionsPath = Join-Path -Path $script:ModuleRoot -ChildPath 'Functions'\n$script:TestsPath = Join-Path -Path $script:ModuleRoot -ChildPath 'Tests'\n$script:ModuleFilePaths = @($script:ClassesPath, $script:FunctionsPath, $script:TestsPath)\n\n<#\n.Description\nChecks if file contains the required license\n#>\nfunction EnsureLicenseInFile {\n    param (\n        [System.IO.FileInfo]\n        $File,\n\n        [string[]]\n        $LicenseContent\n    )\n\n    $fileContent = Get-Content -Path $File.FullName\n    $lineCounter = 1\n    $startsWithLicenseContent = $true\n\n    foreach ($licenseLine in $LicenseContent) {\n        if ($fileContent[$lineCounter] -ne $licenseLine) {\n            $startsWithLicenseContent = $false\n            break\n        }\n\n        $lineCounter += 1\n    }\n\n    if (!$startsWithLicenseContent) {\n        $modifiedFileContent = @()\n\n        $modifiedFileContent += '<#'\n        $LicenseContent | ForEach-Object -Process { $modifiedFileContent += $_ }\n        $modifiedFileContent += '#>'\n        $modifiedFileContent += [string]::Empty\n\n        $fileContent | ForEach-Object -Process { $modifiedFileContent += $_ }\n\n        $modifiedFileContent | Out-File -FilePath $File.FullName -Encoding Default\n    }\n}\n\n<#\n.Description\nUpdates the version of the module\n#>\nfunction Update-ModuleVersion {\n    [CmdletBinding()]\n    [OutputType([void])]\n    param(\n        [string] $FilePath\n    )\n\n    $fileContent = Get-Content $filePath -Raw\n    $moduleVersionPattern = \"(?<=ModuleVersion = ')(\\d*.\\d*.\\d*.\\d*)\"\n    $moduleVersionMatch = $FileContent | Select-String -Pattern $moduleVersionPattern\n\n    [System.Version] $currentVersion = $moduleVersionMatch.Matches[0].Value\n\n    $newVersion = (New-Object -TypeName 'System.Version' $currentVersion.Major, $currentVersion.Minor, $currentVersion.Build, ($currentVersion.Revision + 1)).ToString()\n\n    # -NoNewline switch prevents a new line being added every time\n    ($fileContent -replace $moduleVersionPattern, $newVersion) | Out-File $FilePath -NoNewline\n}\n\nGet-ChildItem -Path $script:ModuleFilePaths -File -Recurse | ForEach-Object {\n    EnsureLicenseInFile -File $_ -LicenseContent $script:LicenseFileContent\n}\n\nUpdate-ModuleVersion -FilePath $script:PsdPath\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/VMware.PSDesiredStateConfiguration.psd1",
    "content": "<#\r\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\r\n\r\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\r\n\r\nBSD-2 License\r\n\r\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r\n\r\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r\n\r\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n#>\r\n\r\n@{\r\n\r\nModuleToProcess = 'VMware.PSDesiredStateConfiguration.psm1'\r\n\r\n# Version number of this module.\r\nModuleVersion = '1.0.0.17'\r\n\r\n# ID used to uniquely identify this module\r\nGUID = '4f9a62bf-e2a6-4bd1-ac20-ccf127bc643e'\r\n\r\n# Author of this module\r\nAuthor = 'VMware'\r\n\r\n# Company or vendor of this module\r\nCompanyName = 'VMware'\r\n\r\n# Supported PSEditions\r\nCompatiblePSEditions = 'Desktop', 'Core'\r\n\r\n# Copyright statement for this module\r\nCopyright = '(c) VMware. All rights reserved.'\r\n\r\n# Description of the functionality provided by this module\r\nDescription = 'This PowerShell module contains logic for creating and running object based DSC Configurations'\r\n\r\n# Minimum version of the Windows PowerShell engine required by this module\r\nPowerShellVersion = '5.1'\r\n\r\n# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.\r\nFunctionsToExport = @('New-VmwDscConfiguration', 'Start-VmwDscConfiguration', 'Test-VmwDscConfiguration', 'Get-VmwDscConfiguration')\r\n\r\n# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.\r\nPrivateData = @{\r\n\r\n    PSData = @{\r\n\r\n        # Tags applied to this module. These help with module discovery in online galleries.\r\n        Tags = @('VMware', 'Automation', 'DSC', 'DesiredStateConfiguration')\r\n\r\n        # A URL to the main website for this project.\r\n        ProjectUri = 'https://github.com/vmware/dscr-for-vmware'\r\n\r\n    } # End of PSData hashtable\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "Source/VMware.PSDesiredStateConfiguration/VMware.PSDesiredStateConfiguration.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PrivateClassesPath = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath 'Classes') -ChildPath 'Private'\n$script:PublicClassesPath = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath 'Classes') -ChildPath 'Public'\n\n$script:PrivateFunctionsPath = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath 'Functions') -ChildPath 'Private'\n$script:PublicFunctionsPath = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath 'Functions') -ChildPath 'Public'\n\n$script:PrivateFunctions = Get-ChildItem -Path $script:PrivateFunctionsPath -Recurse -File -Filter '*.ps1'\n$script:PublicFunctions = Get-ChildItem -Path $script:PublicFunctionsPath -Recurse -File -Filter '*.ps1'\n$script:Functions = @($script:PrivateFunctions + $script:PublicFunctions)\n\n$script:PublicClassFiles = Get-ChildItem -Path $script:PublicClassesPath -Recurse -File -Filter '*.ps1'\n\n# The private classes are imported first so that the ClassResolver can order all public classes.\nGet-ChildItem -Path $script:PrivateClassesPath -Recurse -File -Filter '*.ps1' | ForEach-Object -Process { . $_.FullName }\n\n$script:ClassResolver = [ClassResolver]::new($script:PublicClassFiles)\n$script:OrderedPublicClassFiles = $script:ClassResolver.OrderClassFiles()\n\n$script:OrderedPublicClassFiles | ForEach-Object -Process { . $_.FullName }\n\n$script:Functions | ForEach-Object -Process { . $_.FullName }\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/BaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass BaseDSC : BasevSphereConnection {\n    <#\n    .DESCRIPTION\n\n    Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi.\n    #>\n    [DscProperty()]\n    [string] $Server\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/BasevSphereConnection.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass BasevSphereConnection {\n    <#\n    .DESCRIPTION\n\n    Credentials needed for connection to the specified Server.\n    #>\n    [DscProperty()]\n    [PSCredential] $Credential\n\n    <#\n    .DESCRIPTION\n\n    Established connection to the specified vSphere Server.\n    #>\n    [PSObject] $Connection\n\n    <#\n    .DESCRIPTION\n\n    Saves logs in a HashTable ref in order to retrieve the stream output from outside of Invoke-DscResource execution.\n    #>\n    [ref] $Logs\n\n    hidden [string] $DscResourceName = $this.GetType().Name\n    hidden [string] $DscResourceIsInDesiredStateMessage = \"{0} DSC Resource is in Desired State.\"\n    hidden [string] $DscResourceIsNotInDesiredStateMessage = \"{0} DSC Resource is not in Desired State.\"\n\n    hidden [string] $TestMethodStartMessage = \"Begin executing Test functionality for {0} DSC Resource.\"\n    hidden [string] $TestMethodEndMessage = \"End executing Test functionality for {0} DSC Resource.\"\n    hidden [string] $SetMethodStartMessage = \"Begin executing Set functionality for {0} DSC Resource.\"\n    hidden [string] $SetMethodEndMessage = \"End executing Set functionality for {0} DSC Resource.\"\n    hidden [string] $GetMethodStartMessage = \"Begin executing Get functionality for {0} DSC Resource.\"\n    hidden [string] $GetMethodEndMessage = \"End executing Get functionality for {0} DSC Resource.\"\n\n    hidden [string] $SettingIsNotInDesiredStateMessage = \"Setting {0}: Current setting value [ {1} ] does not match desired setting value [ {2} ].\"\n    hidden [string] $DscResourcesEnumDefaultValue = 'Unset'\n\n    hidden [string] $VCenterConnectionRequiredMessage = \"The DSC Resource operations are only supported when connection is directly to a vCenter.\"\n    hidden [string] $ESXiConnectionRequiredMessage = \"The DSC Resource operations are only supported when connection is directly to an ESXi host.\"\n\n    hidden [string] $CouldNotEstablishvSphereConnectionMessage = \"Could not establish connection to vSphere Server {0}. For more information: {1}\"\n    hidden [string] $CouldNotClosevSphereConnectionMessage = \"Could not close connection to vSphere Server {0}. For more information: {1}\"\n\n    hidden [string] $vCenterProductId = 'vpx'\n    hidden [string] $ESXiProductId = 'embeddedEsx'\n\n    <#\n    .DESCRIPTION\n\n    Imports the required modules where the used PowerCLI cmdlets reside.\n    #>\n    [void] ImportRequiredModules() {\n        <#\n            The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n            when importing the 'VMware.VimAutomation.Core' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        Import-Module -Name 'VMware.VimAutomation.Core'\n\n        $global:VerbosePreference = $savedVerbosePreference\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed array is in the desired state and if an update should be performed.\n    #>\n    [bool] ShouldUpdateArraySetting($settingName, $currentArray, $desiredArray) {\n        $result = $null\n\n        if ($null -eq $desiredArray) {\n            # The property is not specified.\n            $result = $false\n        }\n        elseif ($desiredArray.Length -eq 0 -and $currentArray.Length -ne 0) {\n            # Empty array specified as desired, but current is not an empty array, so update should be performed.\n            $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($settingName, ($currentArray -Join ', '), ($desiredArray -Join ', ')))\n\n            $result = $true\n        }\n        else {\n            $elementsToAdd = $desiredArray | Where-Object { $currentArray -NotContains $_ }\n            $elementsToRemove = $currentArray | Where-Object { $desiredArray -NotContains $_ }\n\n            if ($null -ne $elementsToAdd -or $null -ne $elementsToRemove) {\n                <#\n                    The current array does not contain at least one element from desired array or\n                    the desired array is a subset of the current array. In both cases\n                    we should perform an update operation.\n                #>\n                $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($settingName, ($currentArray -Join ', '), ($desiredArray -Join ', ')))\n\n                $result = $true\n            }\n            else {\n                # No need to perform an update operation.\n                $result = $false\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed setting is in the desired state and if an update should be performed.\n    #>\n    [bool] ShouldUpdateDscResourceSetting($settingName, $currentSetting, $desiredSetting) {\n        $result = $null\n\n        if ($this.$settingName -is [string]) {\n            $result = ($null -ne $desiredSetting -and $desiredSetting -ne [string] $currentSetting)\n        }\n        elseif ($this.$settingName -is [enum]) {\n            $result = ($desiredSetting -ne $this.DscResourcesEnumDefaultValue -and $desiredSetting -ne $currentSetting)\n        }\n        else {\n            $result = ($null -ne $desiredSetting -and $desiredSetting -ne $currentSetting)\n        }\n\n        if ($result) {\n            $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($settingName, $currentSetting, $desiredSetting))\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Connection is directly to a vCenter and if not, throws an exception.\n    #>\n    [void] EnsureConnectionIsvCenter() {\n        if ($this.Connection.ProductLine -ne $this.vCenterProductId) {\n            throw $this.VCenterConnectionRequiredMessage\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Connection is directly to an ESXi host and if not, throws an exception.\n    #>\n    [void] EnsureConnectionIsESXi() {\n        if ($this.Connection.ProductLine -ne $this.ESXiProductId) {\n            throw $this.ESXiConnectionRequiredMessage\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Writes a Verbose message specifying if the DSC Resource is in the Desired State.\n    #>\n    [void] WriteDscResourceState($result) {\n        $messageToUse = [string]::Empty\n\n        if ($result) {\n            $messageToUse = $this.DscResourceIsInDesiredStateMessage\n        }\n        else {\n            $messageToUse = $this.DscResourceIsNotInDesiredStateMessage\n        }\n\n        $this.WriteLogUtil('Verbose', $messageToUse, @($this.DscResourceName))\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VIObject is of the specified type.\n    #>\n    [bool] IsVIObjectOfTheCorrectType($viObject, $typeAsString) {\n        $result = $false\n        $viObjectType = $viObject.GetType()\n\n        if ($viObjectType.FullName -eq $typeAsString) {\n            $result = $true\n        }\n        elseif (($viObjectType.GetInterfaces().FullName -eq $typeAsString).Length -gt 0) {\n            $result = $true\n        }\n        else {\n            $baseType = $viObjectType.BaseType\n\n            while ($null -ne $baseType) {\n                if ($baseType.FullName -eq $typeAsString) {\n                    $result = $true\n                    break\n                }\n\n                $baseType = $baseType.BaseType\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Connects to the specified vSphere Server with the passed Credentials.\n    The method sets the Connection property to the established connection.\n    If connection cannot be established, the method throws an exception.\n    #>\n    [void] ConnectVIServer() {\n        $this.ImportRequiredModules()\n\n        if ($null -eq $this.Connection) {\n            try {\n                $connectVIServerParams = @{\n                    Server = $this.Server\n                    Credential = $this.Credential\n                    ErrorAction = 'Stop'\n                    Verbose = $false\n                }\n\n                $this.Connection = Connect-VIServer @connectVIServerParams\n            }\n            catch {\n                throw ($this.CouldNotEstablishvSphereConnectionMessage -f $this.Server, $_.Exception.Message)\n            }\n        } else {\n            # this is a connection from a vSphereDSC node\n            # a new connection with the same session and server name get created because of an issue with runspaces in PowerShell\n\n            $this.Connection = Connect-VIServer -Session $this.Connection.SessionSecret -Server $this.Connection.Name\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Closes the last open connection to the specified vSphere Server.\n    #>\n    [void] DisconnectVIServer() {\n        if ($null -eq $this.Connection) {\n            return\n        }\n\n        try {\n            $disconnectVIServerParams = @{\n                Server = $this.Connection\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            Disconnect-VIServer @disconnectVIServerParams\n        }\n        catch {\n            throw ($this.CouldNotClosevSphereConnectionMessage -f $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Logs a message to the correct information stream and to a property.\n    #>\n    [void] WriteLogUtil($logType, $message, $arguments) {\n        $writeLogSplat = @{\n            Message = $message\n        }\n\n        # this variable will be added to the logs hashtable\n        $logMessage = $message\n\n        if ($null -ne $arguments) {\n            $writeLogSplat['Arguments'] = $arguments\n\n            $logMessage = [string]::Format($Message, $Arguments)\n        }\n\n        # write to warning or verbose stream\n        if ($logType -eq 'Verbose') {\n            Write-VerboseLog @writeLogSplat\n        } elseif ($logType -eq 'Warning') {\n            Write-WarningLog @writeLogSplat\n        }\n\n        if ($null -eq $this.Logs) {\n            return\n        }\n\n        $this.Logs.Value.Add([PsObject]@{\n            Type = $logType\n            Message = $logMessage\n        }) | Out-Null\n    }\n\n    [void] WriteLogUtil($logType, $message) {\n        $this.WriteLogUtil($logType, $message, $null)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/DatacenterInventoryBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass DatacenterInventoryBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the Inventory Item located in the Datacenter specified in 'DatacenterName' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Location of the Inventory Item with name specified in 'Name' key property in\n    the Datacenter specified in the 'DatacenterName' key property.\n    Location consists of 0 or more Inventory Items.\n    Empty Location means that the Inventory Item is in the Root Folder of the Datacenter ('Vm', 'Host', 'Network' or 'Datastore' based on the Inventory Item).\n    The Root Folders of the Datacenter are not part of the Location.\n    Inventory Item names in Location are separated by \"/\".\n    Example Location for a VM Inventory Item: \"Discovered Virtual Machines/My Ubuntu VMs\".\n    #>\n    [DscProperty(Key)]\n    [string] $Location\n\n    <#\n    .DESCRIPTION\n\n    Name of the Datacenter we will use from the specified Inventory.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterName\n\n    <#\n    .DESCRIPTION\n\n    Location of the Datacenter we will use from the Inventory.\n    Root Folder of the Inventory is not part of the Location.\n    Empty Location means that the Datacenter is in the Root Folder of the Inventory.\n    Folder names in Location are separated by \"/\".\n    Example Location: \"MyDatacentersFolder\".\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterLocation\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Inventory Item should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Type of Folder in which the Inventory Item is located.\n    Possible values are VM, Network, Datastore, Host.\n    #>\n    hidden [FolderType] $InventoryItemFolderType\n\n    <#\n    .DESCRIPTION\n\n    Ensures the correct behaviour when the Location is not valid based on the passed Ensure value.\n    If Ensure is set to 'Present' and the Location is not valid, the method should throw with the passed error message.\n    Otherwise Ensure is set to 'Absent' and $null result is returned because with invalid Location, the Inventory Item is 'Absent'\n    from that Location and no error should be thrown.\n    #>\n    [PSObject] EnsureCorrectBehaviourForInvalidLocation($expression) {\n        if ($this.Ensure -eq [Ensure]::Present) {\n            throw $expression\n        }\n\n        return $null\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Datacenter we will use from the Inventory.\n    #>\n    [PSObject] GetDatacenter() {\n        $rootFolderAsViewObject = Get-View -Server $this.Connection -Id $this.Connection.ExtensionData.Content.RootFolder\n        $rootFolder = Get-Inventory -Server $this.Connection -Id $rootFolderAsViewObject.MoRef\n\n        # Special case where the Location does not contain any folders.\n        if ($this.DatacenterLocation -eq [string]::Empty) {\n            $foundDatacenter = Get-Datacenter -Server $this.Connection -Name $this.DatacenterName -Location $rootFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $rootFolder.Id }\n            if ($null -eq $foundDatacenter) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) was not found at $($rootFolder.Name).\")\n            }\n\n            return $foundDatacenter\n        }\n\n        # Special case where the Location is just one folder.\n        if ($this.DatacenterLocation -NotMatch '/') {\n            $foundLocation = Get-Folder -Server $this.Connection -Name $this.DatacenterLocation -Location $rootFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $rootFolder.Id }\n            if ($null -eq $foundLocation) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Folder $($this.DatacenterLocation) was not found at $($rootFolder.Name).\")\n            }\n\n            $foundDatacenter = Get-Datacenter -Server $this.Connection -Name $this.DatacenterName -Location $foundLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $foundLocation.Id }\n            if ($null -eq $foundDatacenter) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) was not found at $($foundLocation.Name).\")\n            }\n\n            return $foundDatacenter\n        }\n\n        $locationItems = $this.DatacenterLocation -Split '/'\n        $childEntities = Get-View -Server $this.Connection -Id $rootFolder.ExtensionData.ChildEntity\n        $foundLocationItem = $null\n\n        for ($i = 0; $i -lt $locationItems.Length; $i++) {\n            $locationItem = $locationItems[$i]\n            $foundLocationItem = $childEntities | Where-Object -Property Name -eq $locationItem\n\n            if ($null -eq $foundLocationItem) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) with Location $($this.DatacenterLocation) was not found because $locationItem folder cannot be found below $($rootFolder.Name).\")\n            }\n\n            # If the found location item does not have 'ChildEntity' member, the item is a Datacenter.\n            $childEntityMember = $foundLocationItem | Get-Member -Name 'ChildEntity'\n            if ($null -eq $childEntityMember) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.DatacenterLocation) contains another Datacenter $locationItem.\")\n            }\n\n            <#\n            If the found location item is a Folder we check how many Child Entities the folder has:\n            If the Folder has zero Child Entities and the Folder is not the last location item, the Location is not valid.\n            Otherwise we start looking in the items of this Folder.\n            #>\n            if ($foundLocationItem.ChildEntity.Length -eq 0) {\n                if ($i -ne $locationItems.Length - 1) {\n                    return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.DatacenterLocation) is not valid because Folder $locationItem does not have Child Entities and the Location $($this.DatacenterLocation) contains other Inventory Items.\")\n                }\n            }\n            else {\n                $childEntities = Get-View -Server $this.Connection -Id $foundLocationItem.ChildEntity\n            }\n        }\n\n        $foundLocation = Get-Inventory -Server $this.Connection -Id $foundLocationItem.MoRef\n        $foundDatacenter = Get-Datacenter -Server $this.Connection -Name $this.DatacenterName -Location $foundLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $foundLocation.Id }\n\n        if ($null -eq $foundDatacenter) {\n            return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) with Location $($this.DatacenterLocation) was not found.\")\n        }\n\n        return $foundDatacenter\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Location of the Inventory Item from the specified Datacenter.\n    #>\n    [PSObject] GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName) {\n        <#\n        Here if the Ensure property is set to 'Absent', we do not need to check if the Location is valid\n        because the Datacenter does not exist and this means that the Inventory Item does not exist in the specified Datacenter.\n        #>\n        if ($null -eq $datacenter -and $this.Ensure -eq [Ensure]::Absent) {\n            return $null\n        }\n\n        $validInventoryItemLocation = $null\n        $datacenterFolderAsViewObject = Get-View -Server $this.Connection -Id $datacenter.ExtensionData.$datacenterFolderName\n        $datacenterFolder = Get-Inventory -Server $this.Connection -Id $datacenterFolderAsViewObject.MoRef\n\n        # Special case where the Location does not contain any Inventory Items.\n        if ($this.Location -eq [string]::Empty) {\n            return $datacenterFolder\n        }\n\n        # Special case where the Location is just one Inventory Item.\n        if ($this.Location -NotMatch '/') {\n            $validInventoryItemLocation = Get-Inventory -Server $this.Connection -Name $this.Location -Location $datacenterFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $datacenterFolder.Id }\n\n            if ($null -eq $validInventoryItemLocation) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Location $($this.Location) of Inventory Item $($this.Name) was not found in Folder $($datacenterFolder.Name).\")\n            }\n\n            return $validInventoryItemLocation\n        }\n\n        $locationItems = $this.Location -Split '/'\n\n        # Reverses the location items so that we can start from the bottom and go to the top of the Inventory.\n        [array]::Reverse($locationItems)\n\n        $datacenterInventoryItemLocationName = $locationItems[0]\n        $foundLocations = Get-Inventory -Server $this.Connection -Name $datacenterInventoryItemLocationName -Location $datacenterFolder -ErrorAction SilentlyContinue\n\n        # Removes the Name of the Inventory Item Location from the location items array as we already retrieved it.\n        $locationItems = $locationItems[1..($locationItems.Length - 1)]\n\n        <#\n        For every found Inventory Item Location in the Datacenter with the specified name we start to go up through the parents to check if the Location is valid.\n        If one of the Parents does not meet the criteria of the Location, we continue with the next found Location.\n        If we find a valid Location we stop iterating through the Locations and return it.\n        #>\n        foreach ($foundLocation in $foundLocations) {\n            $foundLocationAsViewObject = Get-View -Server $this.Connection -Id $foundLocation.Id -Property Parent\n            $validLocation = $true\n\n            foreach ($locationItem in $locationItems) {\n                $foundLocationAsViewObject = Get-View -Server $this.Connection -Id $foundLocationAsViewObject.Parent -Property Name, Parent\n                if ($foundLocationAsViewObject.Name -ne $locationItem) {\n                    $validLocation = $false\n                    break\n                }\n            }\n\n            if ($validLocation) {\n                $validInventoryItemLocation = $foundLocation\n                break\n            }\n        }\n\n        if ($null -eq $validInventoryItemLocation) {\n            return $this.EnsureCorrectBehaviourForInvalidLocation(\"Location $($this.Location) of Inventory Item $($this.Name) was not found in Datacenter $($datacenter.Name).\")\n        }\n\n        return $validInventoryItemLocation\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Inventory Item from the specified Location in the Datacenter if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetInventoryItem($inventoryItemLocationInDatacenter) {\n        return Get-Inventory -Server $this.Connection -Name $this.Name -Location $inventoryItemLocationInDatacenter -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $inventoryItemLocationInDatacenter.Id }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/DatastoreBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass DatastoreBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    For Nfs Datastore, specifies the remote path of the Nfs mount point.\n    For Vmfs Datastore, specifies the canonical name of the Scsi logical unit that contains the Vmfs Datastore.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $Path\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Datastore should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the file system that is used on the Datastore.\n    #>\n    [DscProperty()]\n    [string] $FileSystemVersion\n\n    <#\n    .DESCRIPTION\n\n    Specifies the latency period beyond which the storage array is considered congested. The range of this value is between 10 to 100 milliseconds.\n    #>\n    [DscProperty()]\n    [nullable[int]] $CongestionThresholdMillisecond\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the IO control is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $StorageIOControlEnabled\n\n    hidden [string] $CreateDatastoreMessage = \"Creating Datastore {0} on VMHost {1}.\"\n    hidden [string] $ModifyDatastoreMessage = \"Modifying Datastore {0} on VMHost {1}.\"\n    hidden [string] $RemoveDatastoreMessage = \"Removing Datastore {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotCreateDatastoreMessage = \"Could not create Datastore {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyDatastoreMessage = \"Could not modify Datastore {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveDatastoreMessage = \"Could not remove Datastore {0} from VMHost {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore with the specified name from the VMHost if it exists.\n    #>\n    [PSObject] GetDatastore() {\n        $getDatastoreParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            VMHost = $this.VMHost\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Datastore @getDatastoreParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified Datastore should be modified.\n    #>\n    [bool] ShouldModifyDatastore($datastore) {\n        $shouldModifyDatastore = @(\n            $this.ShouldUpdateDscResourceSetting('CongestionThresholdMillisecond', $datastore.CongestionThresholdMillisecond, $this.CongestionThresholdMillisecond),\n            $this.ShouldUpdateDscResourceSetting('StorageIOControlEnabled', $datastore.StorageIOControlEnabled, $this.StorageIOControlEnabled)\n        )\n\n        return ($shouldModifyDatastore -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datastore with the specified name on the VMHost.\n    #>\n    [PSObject] NewDatastore($newDatastoreParams) {\n        $newDatastoreParams.Server = $this.Connection\n        $newDatastoreParams.Name = $this.Name\n        $newDatastoreParams.VMHost = $this.VMHost\n        $newDatastoreParams.Path = $this.Path\n        $newDatastoreParams.Confirm = $false\n        $newDatastoreParams.ErrorAction = 'Stop'\n        $newDatastoreParams.Verbose = $false\n\n        if (![string]::IsNullOrEmpty($this.FileSystemVersion)) { $newDatastoreParams.FileSystemVersion = $this.FileSystemVersion }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateDatastoreMessage, @($this.Name, $this.VMHost.Name))\n\n            $datastore = New-Datastore @newDatastoreParams\n\n            return $datastore\n        }\n        catch {\n            throw ($this.CouldNotCreateDatastoreMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the properties of the specified Datastore.\n    #>\n    [void] ModifyDatastore($datastore) {\n        $setDatastoreParams = @{\n            Server = $this.Connection\n            Datastore = $datastore\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.StorageIOControlEnabled) { $setDatastoreParams.StorageIOControlEnabled = $this.StorageIOControlEnabled }\n        if ($null -ne $this.CongestionThresholdMillisecond) { $setDatastoreParams.CongestionThresholdMillisecond = $this.CongestionThresholdMillisecond }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyDatastoreMessage, @($datastore.Name, $this.VMHost.Name))\n\n            Set-Datastore @setDatastoreParams\n        }\n        catch {\n            throw ($this.CouldNotModifyDatastoreMessage -f $datastore.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Datastore from the VMHost.\n    #>\n    [void] RemoveDatastore($datastore) {\n        $removeDatastoreParams = @{\n            Server = $this.Connection\n            Datastore = $datastore\n            VMHost = $thiS.VMHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveDatastoreMessage, @($datastore.Name, $this.VMHost.Name))\n\n            Remove-Datastore @removeDatastoreParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveDatastoreMessage -f $datastore.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $datastore) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n\n        if ($null -ne $datastore) {\n            $result.Name = $datastore.Name\n            $result.Ensure = [Ensure]::Present\n            $result.FileSystemVersion = $datastore.FileSystemVersion\n            $result.CongestionThresholdMillisecond = $datastore.CongestionThresholdMillisecond\n            $result.StorageIOControlEnabled = $datastore.StorageIOControlEnabled\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.FileSystemVersion = $this.FileSystemVersion\n            $result.CongestionThresholdMillisecond = $this.CongestionThresholdMillisecond\n            $result.StorageIOControlEnabled = $this.StorageIOControlEnabled\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/EsxCliBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass EsxCliBaseDSC : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The PowerCLI EsxCli version 2 interface to ESXCLI.\n    #>\n    hidden [PSObject] $EsxCli\n\n    <#\n    .DESCRIPTION\n\n    The EsxCli command for the DSC Resource that inherits the base class.\n    For the DCUI Keyboard DSC Resource the command is the following: 'system.settings.keyboard.layout'.\n    #>\n    hidden [string] $EsxCliCommand\n\n    <#\n    .DESCRIPTION\n\n    The name of the DSC Resource that inherits the base class.\n    #>\n    hidden [string] $DscResourceName = $this.GetType().Name\n\n    hidden [string] $EsxCliAddMethodName = 'add'\n    hidden [string] $EsxCliSetMethodName = 'set'\n    hidden [string] $EsxCliRemoveMethodName = 'remove'\n    hidden [string] $EsxCliGetMethodName = 'get'\n    hidden [string] $EsxCliListMethodName = 'list'\n\n    hidden [string] $CouldNotRetrieveEsxCliInterfaceMessage = \"Could not retrieve EsxCli interface for VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotCreateMethodArgumentsMessage = \"Could not create arguments for {0} method. For more information: {1}\"\n    hidden [string] $EsxCliCommandFailedMessage = \"EsxCli command {0} failed to execute successfully. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the EsxCli version 2 interface to ESXCLI for the specified VMHost.\n    #>\n    [void] GetEsxCli($vmHost) {\n        try {\n            $this.EsxCli = Get-EsxCli -Server $this.Connection -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotRetrieveEsxCliInterfaceMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Executes the specified method for modification - 'set', 'add' or 'remove' of the specified EsxCli command.\n    #>\n    [void] ExecuteEsxCliModifyMethod($methodName, $methodArguments) {\n        $esxCliCommandMethod = \"$($this.EsxCliCommand).$methodName.\"\n        $esxCliMethodArgs = $null\n\n        try {\n            $esxCliMethodArgs = Invoke-Expression -Command (\"`$this.EsxCli.\" + $esxCliCommandMethod + 'CreateArgs()') -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotCreateMethodArgumentsMessage -f $methodName, $_.Exception.Message)\n        }\n\n        # Skips the properties that are defined in the base classes of the Dsc Resource because they are not arguments of the EsxCli command.\n        $dscResourceNamesOfProperties = $this.GetType().GetProperties() |\n                                        Where-Object -FilterScript { $_.DeclaringType.Name -eq $this.DscResourceName } |\n                                        Select-Object -ExpandProperty Name\n\n        # A separate array of keys is needed because collections cannot be modified while being enumerated.\n        $commandArgs = @()\n        $commandArgs = $commandArgs + $esxCliMethodArgs.Keys\n        foreach ($key in $commandArgs) {\n            # The argument of the method is present in the method arguments hashtable and should be used instead of the property of the Dsc Resource.\n            if ($methodArguments.Count -gt 0 -and $null -ne $methodArguments.$key) {\n                $esxCliMethodArgs.$key = $methodArguments.$key\n            }\n            else {\n                # The name of the property of the Dsc Resource starts with a capital letter whereas the key of the argument contains only lower case letters.\n                $dscResourcePropertyName = $dscResourceNamesOfProperties | Where-Object -FilterScript { $_.ToLower() -eq $key.ToLower() }\n\n                # Not all properties of the Dsc Resource are part of the arguments hashtable.\n                if ($null -ne $dscResourcePropertyName) {\n                    if ($this.$dscResourcePropertyName -is [string]) {\n                        if (![string]::IsNullOrEmpty($this.$dscResourcePropertyName)) { $esxCliMethodArgs.$key = $this.$dscResourcePropertyName }\n                    }\n                    elseif ($this.$dscResourcePropertyName -is [array]) {\n                        if ($null -ne $this.$dscResourcePropertyName -and $this.$dscResourcePropertyName.Length -gt 0) { $esxCliMethodArgs.$key = $this.$dscResourcePropertyName }\n                    }\n                    else {\n                        if ($null -ne $this.$dscResourcePropertyName) { $esxCliMethodArgs.$key = $this.$dscResourcePropertyName }\n                    }\n                }\n            }\n        }\n\n        try {\n            Invoke-EsxCliCommandMethod -EsxCli $this.EsxCli -EsxCliCommandMethod ($esxCliCommandMethod + 'Invoke({0})') -EsxCliCommandMethodArguments $esxCliMethodArgs\n        }\n        catch {\n            throw ($this.EsxCliCommandFailedMessage -f ('esxcli.' + $this.EsxCliCommand), $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Executes the specified method for modification - 'set', 'add' or 'remove' of the specified EsxCli command.\n    #>\n    [void] ExecuteEsxCliModifyMethod($methodName) {\n        $this.ExecuteEsxCliModifyMethod($methodName, @{})\n    }\n\n    <#\n    .DESCRIPTION\n\n    Executes the specified retrieval method - 'get' or 'list' of the specified EsxCli command.\n    #>\n    [PSObject] ExecuteEsxCliRetrievalMethod($methodName) {\n        $esxCliCommandMethod = '$this.EsxCli.' + \"$($this.EsxCliCommand).$methodName.\"\n\n        try {\n            $esxCliCommandMethodResult = Invoke-Expression -Command ($esxCliCommandMethod + 'Invoke()') -ErrorAction Stop -Verbose:$false\n            return $esxCliCommandMethodResult\n        }\n        catch {\n            throw ($this.EsxCliCommandFailedMessage -f ('esxcli.' + $this.EsxCliCommand), $_.Exception.Message)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/InventoryBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass InventoryBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the Inventory Item (Folder or Datacenter) located in the Folder specified in 'Location' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Location of the Inventory Item (Folder or Datacenter) we will use from the Inventory.\n    Root Folder of the Inventory is not part of the Location.\n    Empty Location means that the Inventory Item (Folder or Datacenter) is in the Root Folder of the Inventory.\n    Folder names in Location are separated by \"/\".\n    Example Location: \"MyDatacenters\".\n    #>\n    [DscProperty(Key)]\n    [string] $Location\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Inventory Item (Folder or Datacenter) should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Ensures the correct behaviour when the Location is not valid based on the passed Ensure value.\n    If Ensure is set to 'Present' and the Location is not valid, the method should throw with the passed error message.\n    Otherwise Ensure is set to 'Absent' and $null result is returned because with invalid Location, the Inventory Item is 'Absent'\n    from that Location and no error should be thrown.\n    #>\n    [PSObject] EnsureCorrectBehaviourForInvalidLocation($expression) {\n        if ($this.Ensure -eq [Ensure]::Present) {\n            throw $expression\n        }\n\n        return $null\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Location of the Inventory Item (Folder or Datacenter) from the specified Inventory.\n    #>\n    [PSObject] GetInventoryItemLocation() {\n        $rootFolderAsViewObject = Get-View -Server $this.Connection -Id $this.Connection.ExtensionData.Content.RootFolder\n        $rootFolder = Get-Inventory -Server $this.Connection -Id $rootFolderAsViewObject.MoRef\n\n        # Special case where the Location does not contain any folders.\n        if ($this.Location -eq [string]::Empty) {\n            return $rootFolder\n        }\n\n        # Special case where the Location is just one folder.\n        if ($this.Location -NotMatch '/') {\n            $foundLocation = Get-Inventory -Server $this.Connection -Name $this.Location -Location $rootFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $rootFolder.Id }\n            if ($null -eq $foundLocation) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Folder $($this.Location) was not found at $($rootFolder.Name).\")\n            }\n\n            return $foundLocation\n        }\n\n        $locationItems = $this.Location -Split '/'\n        $childEntities = Get-View -Server $this.Connection -Id $rootFolder.ExtensionData.ChildEntity\n        $foundLocationItem = $null\n\n        for ($i = 0; $i -lt $locationItems.Length; $i++) {\n            $locationItem = $locationItems[$i]\n            $foundLocationItem = $childEntities | Where-Object -Property Name -eq $locationItem\n\n            if ($null -eq $foundLocationItem) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Inventory Item $($this.Name) with Location $($this.Location) was not found because $locationItem folder cannot be found below $($rootFolder.Name).\")\n            }\n\n            # If the found location item does not have 'ChildEntity' member, the item is a Datacenter.\n            $childEntityMember = $foundLocationItem | Get-Member -Name 'ChildEntity'\n            if ($null -eq $childEntityMember) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.Location) contains Datacenter $locationItem which is not valid.\")\n            }\n\n            <#\n            If the found location item is a Folder we check how many Child Entities the folder has:\n            If the Folder has zero Child Entities and the Folder is not the last location item, the Location is not valid.\n            Otherwise we start looking in the items of this Folder.\n            #>\n            if ($foundLocationItem.ChildEntity.Length -eq 0) {\n                if ($i -ne $locationItems.Length - 1) {\n                    return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.Location) is not valid because Folder $locationItem does not have Child Entities and the Location $($this.Location) contains other Inventory Items.\")\n                }\n            }\n            else {\n                $childEntities = Get-View -Server $this.Connection -Id $foundLocationItem.ChildEntity\n            }\n        }\n\n        return Get-Inventory -Server $this.Connection -Id $foundLocationItem.MoRef\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/InventoryUtil.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass InventoryUtil {\n    InventoryUtil($viServer, $ensure) {\n        $this.VIServer = $viServer\n        $this.Ensure = $ensure\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the established connection to the vCenter Server system.\n    #>\n    [PSObject] $VIServer\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Inventory Item that is exposed through a DSC Resource that uses the 'InventoryUtil' class\n    should be present or absent. It is used to determine the behaviour of the methods in the class\n    that retrieve Inventory Items.\n    #>\n    [Ensure] $Ensure\n\n    hidden [string] $InvalidLocationMessage = \"Location {0} is not a valid location inside Folder {1}.\"\n\n    hidden [string] $CouldNotRetrieveRootFolderMessage = \"Could not retrieve Inventory Root Folder of vCenter Server {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveDatacenterRootFolderMessage = \"Could not retrieve {0} of Datacenter {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveVDSwitchMessage = \"Could not retrieve VDSwitch {0}. For more information: {1}\"\n    hidden [string] $CouldNotFindDatacenterMessage = \"Could not find Datacenter {0} located in Folder {1}.\"\n    hidden [string] $CouldNotFindFolderMessage = \"Could not find Folder {0} located in Folder {1}.\"\n    hidden [string] $CouldNotFindInventoryItemMessage = \"Could not find Inventory Item {0} located in Inventory Item {1}.\"\n    hidden [string] $CouldNotFindDatastoreClusterMessage = \"Could not find Datastore Cluster {0} located in Folder {1}.\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datacenter with the specified name, located in the specified Folder.\n    #>\n    [PSObject] GetDatacenter($datacenterName, $datacenterLocation) {\n        $datacenter = $null\n        $inventoryRootFolder = $this.GetInventoryRootFolder()\n\n        <#\n            If empty Datacenter location is passed, the Datacenter should be located\n                in the Root Folder of the Inventory.\n            If Datacenter location without '/' is passed, the Datacenter should be located\n                in the Folder specified in the Datacenter location.\n            If Datacenter location with '/' is passed, the Datacenter should be located\n                in the Folder that is lastly specified in the Datacenter location.\n        #>\n        if ($datacenterLocation -eq [string]::Empty) {\n            $datacenter = $this.GetDatacenterInFolder($datacenterName, $inventoryRootFolder)\n        }\n        elseif ($datacenterLocation -NotMatch '/') {\n            $folder = $this.GetFolder($datacenterLocation, $inventoryRootFolder)\n            $datacenter = $this.GetDatacenterInFolder($datacenterName, $folder)\n        }\n        else {\n            $folder = $null\n            $datacenterLocationItems = $datacenterLocation -Split '/'\n\n            # The array needs to be reversed so we can retrieve the Folder where the Datacenter is located.\n            [array]::Reverse($datacenterLocationItems)\n\n            $datacenterLocationName = $datacenterLocationItems[0]\n            $foundDatacenterFolderLocations = $this.GetDatacenterFoldersByName($datacenterLocationName, $inventoryRootFolder)\n\n            # The Folder where the Datacenter is located is already retrieved and it's not needed anymore.\n            $datacenterLocationItems = $datacenterLocationItems[1..($datacenterLocationItems.Length - 1)]\n\n            foreach ($foundDatacenterFolderLocation in $foundDatacenterFolderLocations) {\n                $currentDatacenterLocationItem = $foundDatacenterFolderLocation\n                $isDatacenterLocationValid = $true\n\n                foreach ($datacenterLocationItem in $datacenterLocationItems) {\n                    if ($currentDatacenterLocationItem.Parent.Name -ne $datacenterLocationItem) {\n                        $isDatacenterLocationValid = $false\n                        break\n                    }\n\n                    $currentDatacenterLocationItem = $currentDatacenterLocationItem.Parent\n                }\n\n                <#\n                    If the Datacenter location is valid, the first Datacenter location item\n                    should be located inside the Root Folder of the Inventory.\n                #>\n                if (\n                    $isDatacenterLocationValid -and\n                    $currentDatacenterLocationItem.ParentId -eq $inventoryRootFolder.Id\n                ) {\n                    $folder = $foundDatacenterFolderLocation\n                    break\n                }\n            }\n\n            if ($null -eq $folder -and $this.Ensure -eq [Ensure]::Present) {\n                throw ($this.InvalidLocationMessage -f $datacenterLocation, $inventoryRootFolder.Name)\n            }\n\n            $datacenter = $this.GetDatacenterInFolder($datacenterName, $folder)\n        }\n\n        return $datacenter\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Parent of the Inventory Item located in the specified Datacenter.\n    #>\n    [PSObject] GetInventoryItemParent($inventoryItemLocation, $datacenter, $datacenterRootFolderName) {\n        # If the Datacenter doesn't exist, the Inventory Item Parent doesn't exist as well.\n        if ($null -eq $datacenter) {\n            return $null\n        }\n\n        $inventoryItemParent = $null\n        $datacenterRootFolder = $this.GetRootFolderOfDatacenter($datacenter, $datacenterRootFolderName)\n\n        <#\n            If empty Inventory Item location is passed, the Inventory Item Parent\n                in the Root Folder of the Datacenter.\n            If Inventory Item location without '/' is passed, the Inventory Item Parent\n                is the Inventory Item specified in the Inventory Item location.\n            If Inventory Item location with '/' is passed, the Inventory Item Parent\n                is the Inventory Item that is lastly specified in the Inventory Item location.\n        #>\n        if ($inventoryItemLocation -eq [string]::Empty) {\n            $inventoryItemParent = $datacenterRootFolder\n        }\n        elseif ($inventoryItemLocation -NotMatch '/') {\n            $inventoryItemParent = $this.GetInventoryItem($inventoryItemLocation, $datacenterRootFolder)\n        }\n        else {\n            $inventoryItemLocationItems = $inventoryItemLocation -Split '/'\n\n            # The array needs to be reversed so we can retrieve the name of the Parent of the Inventory Item.\n            [array]::Reverse($inventoryItemLocationItems)\n\n            $inventoryItemParentName = $inventoryItemLocationItems[0]\n            $foundInventoryItemLocations = $this.GetInventoryItemsByName($inventoryItemParentName, $datacenterRootFolder)\n\n            # The Parent name where the Inventory Item is located is already retrieved and it's not needed anymore.\n            $inventoryItemLocationItems = $inventoryItemLocationItems[1..($inventoryItemLocationItems.Length - 1)]\n\n            foreach ($foundInventoryItemLocation in $foundInventoryItemLocations) {\n                $currentInventoryItemLocationItem = $foundInventoryItemLocation\n                $isInventoryItemLocationValid = $true\n\n                foreach ($inventoryItemLocationItem in $inventoryItemLocationItems) {\n                    if ($currentInventoryItemLocationItem.Parent.Name -ne $inventoryItemLocationItem) {\n                        $isInventoryItemLocationValid = $false\n                        break\n                    }\n\n                    $currentInventoryItemLocationItem = $currentInventoryItemLocationItem.Parent\n                }\n\n                <#\n                    If the Inventory Item location is valid, the first Inventory Item location item\n                    should be located inside the corresponding Root Folder of the Datacenter.\n                #>\n                if (\n                    $isInventoryItemLocationValid -and\n                    $currentInventoryItemLocationItem.ParentId -eq $datacenterRootFolder.Id\n                ) {\n                    $inventoryItemParent = $foundInventoryItemLocation\n                    break\n                }\n            }\n\n            if ($null -eq $inventoryItemParent -and $this.Ensure -eq [Ensure]::Present) {\n                throw ($this.InvalidLocationMessage -f $inventoryItemLocation, $datacenterRootFolder.Name)\n            }\n        }\n\n        return $inventoryItemParent\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Root Folder of the specified Inventory.\n    #>\n    [PSObject] GetInventoryRootFolder() {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Id = $this.VIServer.ExtensionData.Content.RootFolder\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            return Get-Inventory @getInventoryParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRootFolderMessage -f $this.VIServer.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the specified Root Folder of the Datacenter.\n    #>\n    [PSObject] GetRootFolderOfDatacenter($datacenter, $datacenterRootFolderName) {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Id = $datacenter.ExtensionData.$datacenterRootFolderName\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            return Get-Inventory @getInventoryParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveDatacenterRootFolderMessage -f $datacenterRootFolderName, $datacenter.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datacenter with the specified name, located in the specified Folder.\n    #>\n    [PSObject] GetDatacenterInFolder($datacenterName, $folder) {\n        $getDatacenterParams = @{\n            Server = $this.VIServer\n            Name = $datacenterName\n            Location = $folder\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentFolderId -eq $folder.Id\n            }\n        }\n\n        $datacenter = Get-Datacenter @getDatacenterParams | Where-Object @whereObjectParams\n        if ($null -eq $datacenter -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindDatacenterMessage -f $datacenterName, $folder.Name)\n        }\n\n        return $datacenter\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Folder with the specified name, located in the specified Folder.\n    #>\n    [PSObject] GetFolder($folderName, $parentFolder) {\n        $getFolderParams = @{\n            Server = $this.VIServer\n            Name = $folderName\n            Location = $parentFolder\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentId -eq $parentFolder.Id\n            }\n        }\n\n        $folder = Get-Folder @getFolderParams | Where-Object @whereObjectParams\n        if ($null -eq $folder -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindFolderMessage -f $folderName, $parentFolder.Name)\n        }\n\n        return $folder\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves all Folders with the specified name of type Datacenter,\n    located inside the specified Folder.\n    #>\n    [PSObject] GetDatacenterFoldersByName($folderName, $folderLocation) {\n        $getFolderParams = @{\n            Server = $this.VIServer\n            Name = $folderName\n            Location = $folderLocation\n            Type = 'Datacenter'\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Folder @getFolderParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves all Inventory Items with the specified name,\n    located inside the specified Inventory Item.\n    #>\n    [array] GetInventoryItemsByName($inventoryItemName, $inventoryItemLocation) {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Name = $inventoryItemName\n            Location = $inventoryItemLocation\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Inventory @getInventoryParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Inventory Item with the specified name, located in the specified Inventory Item.\n    #>\n    [PSObject] GetInventoryItem($inventoryItemName, $inventoryItemParent) {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Name = $inventoryItemName\n            Location = $inventoryItemParent\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentId -eq $inventoryItemParent.Id\n            }\n        }\n\n        $inventoryItem = Get-Inventory @getInventoryParams | Where-Object @whereObjectParams\n        if ($null -eq $inventoryItem -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindInventoryItemMessage -f $inventoryItemName, $inventoryItemParent.Name)\n        }\n\n        return $inventoryItem\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore Cluster with the specified name located in the specified Folder.\n    #>\n    [PSObject] GetDatastoreCluster($datastoreClusterName, $folder) {\n        $getDatastoreClusterParams = @{\n            Server = $this.VIServer\n            Name = $datastoreClusterName\n            Location = $folder\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ExtensionData.Parent -eq $folder.ExtensionData.MoRef\n            }\n        }\n\n        <#\n            Multiple Datastore Clusters with the same name can be present in a Datacenter. So we need to filter\n            by the direct Parent Folder of the Datastore Cluster to retrieve the desired one.\n        #>\n        $datastoreCluster = Get-DatastoreCluster @getDatastoreClusterParams | Where-Object @whereObjectParams\n        if ($null -eq $datastoreCluster -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindDatastoreClusterMessage -f $datastoreClusterName, $folder.Name)\n        }\n\n        return $datastoreCluster\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VDSwitch with the specified name from the server if it exists.\n    If the VDSwitch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise the method throws an exception.\n    #>\n    [PSObject] GetVDSwitch($vdSwitchName) {\n        <#\n            The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n            when importing the 'VMware.VimAutomation.Vds' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        $getVDSwitchParams = @{\n            Server = $this.VIServer\n            Name = $vdSwitchName\n            Verbose = $false\n        }\n\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            $getVDSwitchParams.ErrorAction = 'SilentlyContinue'\n        }\n        else {\n            $getVDSwitchParams.ErrorAction = 'Stop'\n        }\n\n        try {\n            return Get-VDSwitch @getVDSwitchParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVDSwitchMessage -f $vdSwitchName, $_.Exception.Message)\n        }\n        finally {\n            $global:VerbosePreference = $savedVerbosePreference\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VMHost to configure.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    hidden [string] $CouldNotRetrieveVMHostMessage = \"Could not retrieve VMHost {0} on Server {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost with the specified name from the specified Server.\n    If the VMHost is not found, the method throws an exception.\n    #>\n    [PSObject] GetVMHost() {\n        try {\n            $getVMHostParams = @{\n                Server = $this.Connection\n                Name = $this.Name\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VMHost @getVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVMHostMessage -f $this.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostEntityBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostEntityBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the VMHost which is going to be used.\n    #>\n    [DscProperty(Key)]\n    [string] $VMHostName\n\n    <#\n    .DESCRIPTION\n\n    The VMHost which is going to be used.\n    #>\n    hidden [PSObject] $VMHost\n\n    hidden [string] $RetrieveVMHostMessage = \"Retrieving VMHost {0} from vCenter {1}.\"\n    hidden [string] $CouldNotRetrieveVMHostMessage = \"Could not retrieve VMHost {0} from vCenter {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost with the specified name from the server.\n    If the VMHost is not found, it throws an exception.\n    #>\n    [void] RetrieveVMHost() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVMHostMessage, @($this.VMHostName, $this.Connection.Name))\n\n            $getVMHostParams = @{\n                Server = $this.Connection\n                Name = $this.VMHostName\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            $this.VMHost = Get-VMHost @getVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVMHostMessage -f $this.VMHostName, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostGraphicsBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostGraphicsBaseDSC : VMHostRestartBaseDSC {\n    hidden [string] $CouldNotRetrieveGraphicsManagerMessage = \"Could not retrieve the Graphics Manager of VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Graphics Manager of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostGraphicsManager($vmHost) {\n        try {\n            $vmHostGraphicsManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.GraphicsManager -ErrorAction Stop\n            return $vmHostGraphicsManager\n        }\n        catch {\n            throw ($this.CouldNotRetrieveGraphicsManagerMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    The enum value passed in the Configuration should be converted to string value by the following criteria:\n    Shared => shared; SharedDevice => sharedDevice\n    #>\n    [string] ConvertEnumValueToServerValue($enumValue) {\n        return $enumValue.ToString().Substring(0, 1).ToLower() + $enumValue.ToString().Substring(1)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostIScsiHbaBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostIScsiHbaBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the CHAP (Challenge Handshake Authentication Protocol).\n    #>\n    [DscProperty()]\n    [ChapType] $ChapType = [ChapType]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the CHAP authentication name.\n    #>\n    [DscProperty()]\n    [string] $ChapName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the CHAP authentication password.\n    #>\n    [DscProperty()]\n    [string] $ChapPassword\n\n    <#\n    .DESCRIPTION\n\n    Indicates that Mutual CHAP is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MutualChapEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Mutual CHAP authentication name.\n    #>\n    [DscProperty()]\n    [string] $MutualChapName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Mutual CHAP authentication password.\n    #>\n    [DscProperty()]\n    [string] $MutualChapPassword\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to change the password for CHAP, Mutual CHAP or both. When the property is not specified or its value is $false, it is ignored.\n    If the property is $true the passwords for CHAP and Mutual CHAP are changed to their desired values.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $IScsiDeviceType = 'iSCSI'\n\n    hidden [string] $CouldNotRetrieveIScsiHbaMessage = \"Could not retrieve iSCSI Host Bus Adapter {0} from VMHost {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the iSCSI Host Bus Adapter with the specified name from the specified VMHost if it exists.\n    #>\n    [PSObject] GetIScsiHba($iScsiHbaName) {\n        try {\n            $iScsiHba = Get-VMHostHba -Server $this.Connection -VMHost $this.VMHost -Device $iScsiHbaName -Type $this.IScsiDeviceType -ErrorAction Stop -Verbose:$false\n            return $iScsiHba\n        }\n        catch {\n            throw ($this.CouldNotRetrieveIScsiHbaMessage -f $iScsiHbaName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the CHAP settings should be modified based on the current authentication properties.\n    #>\n    [bool] ShouldModifyCHAPSettings($authenticationProperties, $inheritChap, $inheritMutualChap) {\n        $shouldModifyCHAPSettings = @(\n            $this.ShouldUpdateDscResourceSetting('InheritChap', $authenticationProperties.ChapInherited, $inheritChap),\n            $this.ShouldUpdateDscResourceSetting('ChapType', [string] $authenticationProperties.ChapType, $this.ChapType.ToString()),\n            $this.ShouldUpdateDscResourceSetting('InheritMutualChap', $authenticationProperties.MutualChapInherited, $inheritMutualChap),\n            $this.ShouldUpdateDscResourceSetting('MutualChapEnabled', $authenticationProperties.MutualChapEnabled, $this.MutualChapEnabled),\n            $this.ShouldUpdateDscResourceSetting('Force', $false, $this.Force)\n        )\n\n        # CHAP and Mutual CHAP names should be ignored when determining the Desired State when CHAP type is 'Prohibited'.\n        if ($this.ChapType -ne [ChapType]::Prohibited) {\n            $shouldModifyCHAPSettings += $this.ShouldUpdateDscResourceSetting(\n                'ChapName',\n                [string] $authenticationProperties.ChapName,\n                $this.ChapName\n            )\n            $shouldModifyCHAPSettings += $this.ShouldUpdateDscResourceSetting(\n                'MutualChapName',\n                [string] $authenticationProperties.MutualChapName,\n                $this.MutualChapName\n            )\n        }\n\n        return ($shouldModifyCHAPSettings -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the CHAP settings should be modified based on the current authentication properties.\n    #>\n    [bool] ShouldModifyCHAPSettings($authenticationProperties) {\n        return $this.ShouldModifyCHAPSettings($authenticationProperties, $null, $null)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the cmdlet parameters with the CHAP settings based on the following criteria:\n    1. CHAP settings can only be passed to the cmdlet if the 'InheritChap' option is not passed or it is passed with a '$false' value.\n    2. Mutual CHAP settings can only be passed to the cmdlet if the 'InheritMutualChap' option is not passed or it is passed with a '$false' value.\n    3. CHAP name and CHAP password can be passed to the cmdlet if the CHAP type is not 'Prohibited'.\n    4. Mutual CHAP settings can only be passed to the cmdlet if the CHAP type is 'Required'.\n    5. Mutual CHAP name and Mutual CHAP password can be passed to the cmdlet if Mutual CHAP enabled is not passed\n       or if it is passed with a '$true' value.\n    #>\n    [void] PopulateCmdletParametersWithCHAPSettings($cmdletParams, $inheritChap, $inheritMutualChap) {\n        if ($null -ne $inheritChap -and $inheritChap) {\n            $cmdletParams.InheritChap = $inheritChap\n        }\n        else {\n            # When 'InheritChap' is $false, it can be passed to the cmdlet only if CHAP type is not 'Prohibited'.\n            if ($null -ne $inheritChap -and $this.ChapType -ne [ChapType]::Prohibited) { $cmdletParams.InheritChap = $inheritChap }\n            if ($this.ChapType -ne [ChapType]::Unset) { $cmdletParams.ChapType = $this.ChapType.ToString() }\n\n            if ($this.ChapType -ne [ChapType]::Prohibited) {\n                if (![string]::IsNullOrEmpty($this.ChapName)) { $cmdletParams.ChapName = $this.ChapName }\n                if (![string]::IsNullOrEmpty($this.ChapPassword)) { $cmdletParams.ChapPassword = $this.ChapPassword }\n            }\n        }\n\n        if ($null -ne $inheritMutualChap -and $inheritMutualChap) {\n            $cmdletParams.InheritMutualChap = $inheritMutualChap\n        }\n        else {\n            # When 'InheritMutualChap' is $false, it can be passed to the cmdlet only if CHAP type is not 'Prohibited'.\n            if ($null -ne $inheritMutualChap -and $this.ChapType -ne [ChapType]::Prohibited) { $cmdletParams.InheritMutualChap = $inheritMutualChap }\n\n            if ($this.ChapType -eq [ChapType]::Required) {\n                if ($null -ne $this.MutualChapEnabled) { $cmdletParams.MutualChapEnabled = $this.MutualChapEnabled }\n\n                if ($null -eq $this.MutualChapEnabled -or $this.MutualChapEnabled) {\n                    if (![string]::IsNullOrEmpty($this.MutualChapName)) { $cmdletParams.MutualChapName = $this.MutualChapName }\n                    if (![string]::IsNullOrEmpty($this.MutualChapPassword)) { $cmdletParams.MutualChapPassword = $this.MutualChapPassword }\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the cmdlet parameters with the CHAP settings.\n    #>\n    [void] PopulateCmdletParametersWithCHAPSettings($cmdletParams) {\n        $this.PopulateCmdletParametersWithCHAPSettings($cmdletParams, $null, $null)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostNetworkBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostNetworkBaseDSC : VMHostBaseDSC {\n    hidden [PSObject] $VMHostNetworkSystem\n\n    hidden [string] $CouldNotRetrieveNetworkSystemMessage = \"Could not retrieve the Network System of VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Network System from the specified VMHost.\n    #>\n    [void] GetNetworkSystem($vmHost) {\n        try {\n            $this.VMHostNetworkSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.NetworkSystem -ErrorAction Stop\n        }\n        catch {\n            throw ($this.CouldNotRetrieveNetworkSystemMessage -f $this.Name, $_.Exception.Message)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostNetworkMigrationBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostNetworkMigrationBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Physical Network Adapters that should be part of the vSphere Distributed/Standard Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $PhysicalNicNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the VMKernel Network Adapters that should be part of the vSphere Distributed/Standard Switch.\n    #>\n    [DscProperty()]\n    [string[]] $VMKernelNicNames\n\n    hidden [string] $RetrievePhysicalNicMessage = \"Retrieving Physical Network Adapter {0} from VMHost {1}.\"\n    hidden [string] $RetrieveVMKernelNicMessage = \"Retrieving VMKernel Network Adapter {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotFindPhysicalNicMessage = \"Physical Network Adapter {0} was not found on VMHost {1} and will be ignored.\"\n    hidden [string] $CouldNotFindVMKernelNicMessage = \"VMKernel Network Adapter {0} was not found on VMHost {1}.\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Physical Network Adapters with the specified names from the server if they exist.\n    For every Physical Network Adapter that does not exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetPhysicalNetworkAdapters() {\n        $physicalNetworkAdapters = @()\n\n        foreach ($physicalNetworkAdapterName in $this.PhysicalNicNames) {\n            $this.WriteLogUtil('Verbose', $this.RetrievePhysicalNicMessage, @($physicalNetworkAdapterName, $this.VMHost.Name))\n\n            $getVMHostNetworkAdapterParams = @{\n                Server = $this.Connection\n                Name = $physicalNetworkAdapterName\n                VMHost = $this.VMHost\n                Physical = $true\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $physicalNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n            if ($null -eq $physicalNetworkAdapter) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindPhysicalNicMessage, @($physicalNetworkAdapterName, $this.VMHost.Name))\n            }\n            else {\n                $physicalNetworkAdapters += $physicalNetworkAdapter\n            }\n        }\n\n        return $physicalNetworkAdapters\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel Network Adapters with the specified names from the server if they exist.\n    If one of the passed VMKernel Network Adapters does not exist, an exception is thrown.\n    #>\n    [array] GetVMKernelNetworkAdapters() {\n        $vmKernelNetworkAdapters = @()\n\n        foreach ($vmKernelNetworkAdapterName in $this.VMKernelNicNames) {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVMKernelNicMessage, @($vmKernelNetworkAdapterName, $this.VMHost.Name))\n\n            $getVMHostNetworkAdapterParams = @{\n                Server = $this.Connection\n                Name = $vmKernelNetworkAdapterName\n                VMHost = $this.VMHost\n                VMKernel = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            try {\n                $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n                $vmKernelNetworkAdapters += $vmKernelNetworkAdapter\n            }\n            catch {\n                <#\n                Here 'throw' should be used instead of 'Write-WarningLog' because if we ignore one VMKernel Network Adapter that is invalid, the mapping between VMKernel\n                Network Adapters and Port Groups will not work: The first Adapter should be attached to the first Port Group,\n                the second Adapter should be attached to the second Port Group, and so on.\n                #>\n                throw ($this.CouldNotFindVMKernelNicMessage -f $vmKernelNetworkAdapterName, $this.VMHost.Name)\n            }\n        }\n\n        return $vmKernelNetworkAdapters\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostNicBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostNicBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Port Group to which the VMKernel Network Adapter should be connected. If a Distributed Switch is passed, an existing Port Group name should be specified.\n    For Standard Virtual Switches, if the Port Group is non-existent, a new Port Group with the specified name will be created and the VMKernel Network Adapter will be connected to it.\n    #>\n    [DscProperty(Key)]\n    [string] $PortGroupName\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VMKernel Network Adapter should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the VMKernel Network Adapter uses a Dhcp server.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Dhcp\n\n    <#\n    .DESCRIPTION\n\n    Specifies an IP address for the VMKernel Network Adapter. All IP addresses are specified using IPv4 dot notation. If IP is not specified, DHCP mode is enabled.\n    #>\n    [DscProperty()]\n    [string] $IP\n\n    <#\n    .DESCRIPTION\n\n    Specifies a Subnet Mask for the VMKernel Network Adapter.\n    #>\n    [DscProperty()]\n    [string] $SubnetMask\n\n    <#\n    .DESCRIPTION\n\n    Specifies a media access control (MAC) address for the VMKernel Network Adapter.\n    #>\n    [DscProperty()]\n    [string] $Mac\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the IPv6 address is obtained through a router advertisement.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AutomaticIPv6\n\n    <#\n    .DESCRIPTION\n\n    Specifies multiple static addresses using the following format: <IPv6>/<subnet_prefix_length> or <IPv6>. If you skip <subnet_prefix_length>, the default value of 64 is used.\n    #>\n    [DscProperty()]\n    [string[]] $IPv6\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the IPv6 address is obtained through DHCP.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IPv6ThroughDhcp\n\n    <#\n    .DESCRIPTION\n\n    Specifies the MTU size.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Mtu\n\n    <#\n    .DESCRIPTION\n\n    Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables all IPv6-related parameters.\n    If the value is $true, you need to provide values for at least one of the IPv6 parameters.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IPv6Enabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that you want to enable the VMKernel Network Adapter for management traffic.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ManagementTrafficEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the VMKernel Network Adapter is enabled for Fault Tolerance (FT) logging.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $FaultToleranceLoggingEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that you want to use the VMKernel Network Adapter for VMotion.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $VMotionEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that Virtual SAN traffic is enabled on this VMKernel Network Adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $VsanTrafficEnabled\n\n    hidden [string] $CouldNotCreateVMKernelNicMessage = \"Cannot create VMKernel Network Adapter connected to Virtual Switch {0} and Port Group {1}. For more information: {2}\"\n    hidden [string] $CouldNotUpdateVMKernelNicMessage = \"Cannot update VMKernel Network Adapter {0}. For more information: {1}\"\n    hidden [string] $CouldNotRemoveVMKernelNicMessage = \"Cannot remove VMKernel Network Adapter {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel Network Adapter connected to the specified Port Group and Virtual Switch and available on the specified VMHost from the server\n    if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetVMHostNetworkAdapter($virtualSwitch) {\n        if ($null -eq $virtualSwitch) {\n            <#\n            If the Virtual Switch is $null, it means that Ensure was set to 'Absent' and\n            the VMKernel Network Adapter does not exist for the specified Virtual Switch.\n            #>\n            return $null\n        }\n\n        return Get-VMHostNetworkAdapter -Server $this.Connection -PortGroup $this.PortGroupName -VirtualSwitch $virtualSwitch -VMHost $this.VMHost -VMKernel -ErrorAction SilentlyContinue\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed VMKernel Network Adapter IPv6 array needs to be updated.\n    #>\n    [bool] ShouldUpdateIPv6($ipv6) {\n        $currentIPv6 = @()\n        foreach ($ip in $ipv6) {\n            <#\n            The IPs on the server are of type 'IPv6Address' so they need to be converted to\n            string before being passed to ShouldUpdateArraySetting method.\n            #>\n            $currentIPv6 += $ip.ToString()\n        }\n\n        <#\n        The default IPv6 array contains one element, so when empty array is passed no update\n        should be performed.\n        #>\n        if ($null -ne $this.IPv6 -and ($this.IPv6.Length -eq 0 -and $currentIPv6.Length -eq 1)) {\n            return $false\n        }\n\n        return $this.ShouldUpdateArraySetting('IPv6', $currentIPv6, $this.IPv6)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed VMKernel Network Adapter needs be updated based on the specified properties.\n    #>\n    [bool] ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter) {\n        $shouldUpdateVMHostNetworkAdapter = @(\n            $this.ShouldUpdateDscResourceSetting('IP', [string] $vmHostNetworkAdapter.IP, $this.IP),\n            $this.ShouldUpdateDscResourceSetting('SubnetMask', [string] $vmHostNetworkAdapter.SubnetMask, $this.SubnetMask),\n            $this.ShouldUpdateDscResourceSetting('Mac', [string] $vmHostNetworkAdapter.Mac, $this.Mac),\n            $this.ShouldUpdateDscResourceSetting('Dhcp', $vmHostNetworkAdapter.DhcpEnabled, $this.Dhcp),\n            $this.ShouldUpdateDscResourceSetting('AutomaticIPv6', $vmHostNetworkAdapter.AutomaticIPv6, $this.AutomaticIPv6),\n            $this.ShouldUpdateIPv6($vmHostNetworkAdapter.IPv6),\n            $this.ShouldUpdateDscResourceSetting('IPv6ThroughDhcp', $vmHostNetworkAdapter.IPv6ThroughDhcp, $this.IPv6ThroughDhcp),\n            $this.ShouldUpdateDscResourceSetting('Mtu', $vmHostNetworkAdapter.Mtu, $this.Mtu),\n            $this.ShouldUpdateDscResourceSetting('IPv6Enabled', $vmHostNetworkAdapter.IPv6Enabled, $this.IPv6Enabled),\n            $this.ShouldUpdateDscResourceSetting('ManagementTrafficEnabled', $vmHostNetworkAdapter.ManagementTrafficEnabled, $this.ManagementTrafficEnabled),\n            $this.ShouldUpdateDscResourceSetting('FaultToleranceLoggingEnabled', $vmHostNetworkAdapter.FaultToleranceLoggingEnabled, $this.FaultToleranceLoggingEnabled),\n            $this.ShouldUpdateDscResourceSetting('VMotionEnabled', $vmHostNetworkAdapter.VMotionEnabled, $this.VMotionEnabled),\n            $this.ShouldUpdateDscResourceSetting('VsanTrafficEnabled', $vmHostNetworkAdapter.VsanTrafficEnabled, $this.VsanTrafficEnabled)\n        )\n\n        return ($shouldUpdateVMHostNetworkAdapter -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated VMKernel Network Adapter parameters.\n    #>\n    [hashtable] GetVMHostNetworkAdapterParams() {\n        $vmHostNetworkAdapterParams = @{}\n\n        $vmHostNetworkAdapterParams.Confirm = $false\n        $vmHostNetworkAdapterParams.ErrorAction = 'Stop'\n\n        if (![string]::IsNullOrEmpty($this.IP)) { $vmHostNetworkAdapterParams.IP = $this.IP }\n        if (![string]::IsNullOrEmpty($this.SubnetMask)) { $vmHostNetworkAdapterParams.SubnetMask = $this.SubnetMask }\n        if (![string]::IsNullOrEmpty($this.Mac)) { $vmHostNetworkAdapterParams.Mac = $this.Mac }\n\n        if ($null -ne $this.AutomaticIPv6) { $vmHostNetworkAdapterParams.AutomaticIPv6 = $this.AutomaticIPv6 }\n        if ($null -ne $this.IPv6) { $vmHostNetworkAdapterParams.IPv6 = $this.IPv6 }\n        if ($null -ne $this.IPv6ThroughDhcp) { $vmHostNetworkAdapterParams.IPv6ThroughDhcp = $this.IPv6ThroughDhcp }\n        if ($null -ne $this.Mtu) { $vmHostNetworkAdapterParams.Mtu = $this.Mtu }\n        if ($null -ne $this.ManagementTrafficEnabled) { $vmHostNetworkAdapterParams.ManagementTrafficEnabled = $this.ManagementTrafficEnabled }\n        if ($null -ne $this.FaultToleranceLoggingEnabled) { $vmHostNetworkAdapterParams.FaultToleranceLoggingEnabled = $this.FaultToleranceLoggingEnabled }\n        if ($null -ne $this.VMotionEnabled) { $vmHostNetworkAdapterParams.VMotionEnabled = $this.VMotionEnabled }\n        if ($null -ne $this.VsanTrafficEnabled) { $vmHostNetworkAdapterParams.VsanTrafficEnabled = $this.VsanTrafficEnabled }\n\n        return $vmHostNetworkAdapterParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new VMKernel Network Adapter connected to the specified Virtual Switch and Port Group for the specified VMHost.\n    If the Port Id is specified, the Port Group is ignored and only the Port Id is passed to the cmdlet.\n    #>\n    [PSObject] AddVMHostNetworkAdapter($virtualSwitch, $portId) {\n        $vmHostNetworkAdapterParams = $this.GetVMHostNetworkAdapterParams()\n\n        $vmHostNetworkAdapterParams.Server = $this.Connection\n        $vmHostNetworkAdapterParams.VMHost = $this.VMHost\n        $vmHostNetworkAdapterParams.VirtualSwitch = $virtualSwitch\n\n        if ($null -ne $portId) {\n            $vmHostNetworkAdapterParams.PortId = $portId\n        }\n        else {\n            $vmHostNetworkAdapterParams.PortGroup = $this.PortGroupName\n        }\n\n        try {\n            return New-VMHostNetworkAdapter @vmHostNetworkAdapterParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVMKernelNicMessage -f $virtualSwitch.Name, $this.PortGroupName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMKernel Network Adapter with the specified properties.\n    #>\n    [void] UpdateVMHostNetworkAdapter($vmHostNetworkAdapter) {\n        $vmHostNetworkAdapterParams = $this.GetVMHostNetworkAdapterParams()\n\n        <#\n        IPv6 should only be passed to the cmdlet if an update needs to be performed.\n        Otherwise the following error occurs when passing the same array: 'Address already exists in the config.'\n        #>\n        if (!$this.ShouldUpdateIPv6($vmHostNetworkAdapter.IPv6)) {\n            $vmHostNetworkAdapterParams.Remove('IPv6')\n        }\n\n        <#\n        Both Dhcp and IPv6Enabled are applicable only for the Update operation, so they are not\n        populated in the GetVMHostNetworkAdapterParams() which is used for Create and Update operations.\n        #>\n        if ($null -ne $this.Dhcp) {\n            $vmHostNetworkAdapterParams.Dhcp = $this.Dhcp\n\n            <#\n            IP and SubnetMask parameters are mutually exclusive with Dhcp so they should be removed\n            from the parameters hashtable before calling Set-VMHostNetworkAdapter cmdlet.\n            #>\n            $vmHostNetworkAdapterParams.Remove('IP')\n            $vmHostNetworkAdapterParams.Remove('SubnetMask')\n        }\n\n        if ($null -ne $this.IPv6Enabled) {\n            $vmHostNetworkAdapterParams.IPv6Enabled = $this.IPv6Enabled\n\n            if (!$this.IPv6Enabled) {\n                <#\n                If the value of IPv6Enabled is $false, other IPv6 settings cannot be specified.\n                #>\n                $vmHostNetworkAdapterParams.Remove('AutomaticIPv6')\n                $vmHostNetworkAdapterParams.Remove('IPv6ThroughDhcp')\n                $vmHostNetworkAdapterParams.Remove('IPv6')\n            }\n        }\n\n        try {\n            $vmHostNetworkAdapter | Set-VMHostNetworkAdapter @vmHostNetworkAdapterParams\n        }\n        catch {\n            throw ($this.CouldNotUpdateVMKernelNicMessage -f $vmHostNetworkAdapter.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMKernel Network Adapter connected to the specified Virtual Switch and Port Group for the specified VMHost.\n    #>\n    [void] RemoveVMHostNetworkAdapter($vmHostNetworkAdapter) {\n        try {\n            Remove-VMHostNetworkAdapter -Nic $vmHostNetworkAdapter -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw ($this.CouldNotRemoveVMKernelNicMessage -f $vmHostNetworkAdapter.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMKernel Network Adapter from the server.\n    #>\n    [void] PopulateResult($vmHostNetworkAdapter, $result) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n\n        if ($null -ne $vmHostNetworkAdapter) {\n            $result.PortGroupName = $vmHostNetworkAdapter.PortGroupName\n            $result.Ensure = [Ensure]::Present\n            $result.IP = $vmHostNetworkAdapter.IP\n            $result.SubnetMask = $vmHostNetworkAdapter.SubnetMask\n            $result.Mac = $vmHostNetworkAdapter.Mac\n            $result.AutomaticIPv6 = $vmHostNetworkAdapter.AutomaticIPv6\n            $result.IPv6 = $vmHostNetworkAdapter.IPv6\n            $result.IPv6ThroughDhcp = $vmHostNetworkAdapter.IPv6ThroughDhcp\n            $result.Mtu = $vmHostNetworkAdapter.Mtu\n            $result.Dhcp = $vmHostNetworkAdapter.DhcpEnabled\n            $result.IPv6Enabled = $vmHostNetworkAdapter.IPv6Enabled\n            $result.ManagementTrafficEnabled = $vmHostNetworkAdapter.ManagementTrafficEnabled\n            $result.FaultToleranceLoggingEnabled = $vmHostNetworkAdapter.FaultToleranceLoggingEnabled\n            $result.VMotionEnabled = $vmHostNetworkAdapter.VMotionEnabled\n            $result.VsanTrafficEnabled = $vmHostNetworkAdapter.VsanTrafficEnabled\n        }\n        else {\n            $result.PortGroupName = $this.PortGroupName\n            $result.Ensure = [Ensure]::Absent\n            $result.IP = $this.IP\n            $result.SubnetMask = $this.SubnetMask\n            $result.Mac = $this.Mac\n            $result.AutomaticIPv6 = $this.AutomaticIPv6\n            $result.IPv6 = $this.IPv6\n            $result.IPv6ThroughDhcp = $this.IPv6ThroughDhcp\n            $result.Mtu = $this.Mtu\n            $result.Dhcp = $this.Dhcp\n            $result.IPv6Enabled = $this.IPv6Enabled\n            $result.ManagementTrafficEnabled = $this.ManagementTrafficEnabled\n            $result.FaultToleranceLoggingEnabled = $this.FaultToleranceLoggingEnabled\n            $result.VMotionEnabled = $this.VMotionEnabled\n            $result.VsanTrafficEnabled = $this.VsanTrafficEnabled\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostRestartBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostRestartBaseDSC : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the time in minutes to wait for the VMHost to restart before timing out\n    and aborting the operation. The default value is 5 minutes.\n    #>\n    [DscProperty()]\n    [int] $RestartTimeoutMinutes = 5\n\n    hidden [string] $NotRespondingState = 'NotResponding'\n    hidden [string] $MaintenanceState = 'Maintenance'\n\n    hidden [string] $VMHostIsRestartedSuccessfullyMessage = \"VMHost {0} is successfully restarted and in {1} State.\"\n    hidden [string] $VMHostIsStillNotInDesiredStateMessage = \"VMHost {0} is still not in {1} State.\"\n    hidden [string] $RestartVMHostMessage = \"Restarting VMHost {0}.\"\n\n    hidden [string] $VMHostIsNotInMaintenanceModeMessage = \"The Resource update operation requires the VMHost {0} to be in a Maintenance mode.\"\n    hidden [string] $CouldNotRestartVMHostInTimeMessage = \"VMHost {0} could not be restarted successfully in {1} minutes.\"\n    hidden [string] $CouldNotRestartVMHostMessage = \"Could not restart VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost is in Maintenance mode and if not, throws an exception.\n    #>\n    [void] EnsureVMHostIsInMaintenanceMode($vmHost) {\n        if ($vmHost.ConnectionState.ToString() -ne $this.MaintenanceState) {\n            throw ($this.VMHostIsNotInMaintenanceModeMessage -f $vmHost.Name)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified VMHost is restarted successfully in the specified period of time. If the elapsed time is\n    longer than the desired time for restart, the method throws an exception.\n    #>\n    [void] EnsureRestartTimeoutIsNotReached($elapsedTimeInSeconds) {\n        $timeSpan = New-TimeSpan -Seconds $elapsedTimeInSeconds\n        if ($this.RestartTimeoutMinutes -le $timeSpan.Minutes) {\n            throw ($this.CouldNotRestartVMHostInTimeMessage -f $this.Name, $this.RestartTimeoutMinutes)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified VMHost is in a Desired State after successful restart operation.\n    #>\n    [void] EnsureVMHostIsInDesiredState($requiresVIServerConnection, $desiredState) {\n        $sleepTimeInSeconds = 10\n        $elapsedTimeInSeconds = 0\n\n        while ($true) {\n            $this.EnsureRestartTimeoutIsNotReached($elapsedTimeInSeconds)\n\n            Start-Sleep -Seconds $sleepTimeInSeconds\n            $elapsedTimeInSeconds += $sleepTimeInSeconds\n\n            try {\n                if ($requiresVIServerConnection) {\n                    $this.ConnectVIServer()\n                }\n\n                $vmHost = $this.GetVMHost()\n                if ($vmHost.ConnectionState.ToString() -eq $desiredState) {\n                    break\n                }\n\n                $this.WriteLogUtil('Verbose', $this.VMHostIsStillNotInDesiredStateMessage, @($this.Name, $desiredState))\n            }\n            catch {\n                <#\n                Here the message used in the try block is written again in the case when an exception is thrown\n                when retrieving the VMHost or establishing a Connection. This way the user still gets notified\n                that the VMHost is not in the Desired State.\n                #>\n                $this.WriteLogUtil('Verbose', $this.VMHostIsStillNotInDesiredStateMessage, @($this.Name, $desiredState))\n            }\n        }\n\n        $this.WriteLogUtil('Verbose', $this.VMHostIsRestartedSuccessfullyMessage, @($this.Name, $desiredState))\n    }\n\n    <#\n    .DESCRIPTION\n\n    Restarts the specified VMHost so that the update of the VMHost Configuration is successful.\n    #>\n    [void] RestartVMHost($vmHost) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RestartVMHostMessage, @($vmHost.Name))\n\n            $restartVMHostParams = @{\n                Server = $this.Connection\n                VMHost = $vmHost\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            Restart-VMHost @restartVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRestartVMHostMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n\n        <#\n        If the Connection is directly to a vCenter we do not need to establish a new connection so we pass $false\n        to the method 'EnsureVMHostIsInCorrectState'. When the Connection is directly to an ESXi, after a successful\n        restart the ESXi is down so new Connection needs to be established to check the ESXi state. So we pass $true\n        to the method 'EnsureVMHostIsInCorrectState'. We also need to set the variable holding the current Connection\n        to $null, so a new Connection can be established via the ConnectVIServer().\n        #>\n        if ($this.Connection.ProductLine -eq $this.vCenterProductId) {\n            $this.EnsureVMHostIsInDesiredState($false, $this.NotRespondingState)\n            $this.EnsureVMHostIsInDesiredState($false, $this.MaintenanceState)\n        }\n        else {\n            $this.Connection = $null\n            $this.EnsureVMHostIsInDesiredState($true, $this.MaintenanceState)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostVssBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostVssBaseDSC : VMHostNetworkBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VSS should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    The name of the VSS.\n    #>\n    [DscProperty(Key)]\n    [string] $VssName\n\n    <#\n    .DESCRIPTION\n\n    Returns the desired virtual switch if it is present on the server otherwise returns $null.\n    #>\n    [PSObject] GetVss() {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $this.vmHostNetworkSystem.UpdateViewData('NetworkInfo.Vswitch')\n        return ($this.vmHostNetworkSystem.NetworkInfo.Vswitch | Where-Object { $_.Name -eq $this.VssName })\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Classes/VMHostVssPortGroupBaseDSC.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nclass VMHostVssPortGroupBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the the Port Group.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Port Group should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    The Network System of the specified VMHost.\n    #>\n    hidden [PSObject] $VMHostNetworkSystem\n\n    hidden [string] $CouldNotRetrievePortGroupMessage = \"Could not retrieve Virtual Port Group {0} of VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveNetworkSystemMessage = \"Could not retrieve the Network System of VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group with the specified name from the server if it exists.\n    The Virtual Port Group must be a Standard Virtual Port Group. If the Virtual Port Group does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVirtualPortGroup() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            return $null\n        }\n        else {\n            try {\n                $virtualPortGroup = Get-VirtualPortGroup -Server $this.Connection -Name $this.Name -VMHost $this.VMHost -Standard -ErrorAction Stop\n                return $virtualPortGroup\n            }\n            catch {\n                throw ($this.CouldNotRetrievePortGroupMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Network System of the specified VMHost.\n    #>\n    [void] GetVMHostNetworkSystem() {\n        try {\n            $this.VMHostNetworkSystem = Get-View -Server $this.Connection -Id $this.VMHost.ExtensionData.ConfigManager.NetworkSystem -ErrorAction Stop\n        }\n        catch {\n            throw ($this.CouldNotRetrieveNetworkSystemMessage -f $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the specified Policy Setting. If the Inherited Setting is passed and set to $true,\n    the Policy Setting should not be populated because \"Parameters of the form \"XXX\" and \"InheritXXX\" are mutually exclusive.\"\n    If the Inherited Setting is set to $false, both parameters can be populated.\n    #>\n    [void] PopulatePolicySetting($policyParams, $policySettingName, $policySetting, $policySettingInheritedName, $policySettingInherited) {\n        if ($null -ne $policySetting) {\n            if ($null -eq $policySettingInherited -or !$policySettingInherited) {\n                $policyParams.$policySettingName = $policySetting\n            }\n        }\n\n        if ($null -ne $policySettingInherited) { $policyParams.$policySettingInheritedName = $policySettingInherited }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Ansible/README.md",
    "content": "# Desired State Configuration Resources for VMware Examples with Ansible\n\n## Getting Started\n## Requirements\n1. Install [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)\n2. Setup [Windows Host](https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html)\n3. Put your Remote Systems following the instructions [here](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html) in the file:\n\n    ```/etc/ansible/hosts```\n4. To apply your configuration run the following command in the Terminal:\n    ```\n    ansible-playbook <path to your config file>\n    ```\n\n## Examples\nAll shown examples are located [here](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations/Ansible).\n\n### Example 1\nUpdates the Statistics settings of the passed vCenter by changing the level to 2 for the Day period and also setting the Period Length and Interval in Minutes to 3. Also the collecting of statistics is enabled.\n\n```yaml\n- hosts: <host>\n  tasks:\n  - name: Updates the Statistics settings of the passed vCenter.\n    win_dsc:\n        resource_name: vCenterStatistics\n        Server: <server>\n        Credential_username: <user>\n        Credential_password: <password>\n        Period: Day\n        PeriodLength: 3\n        Level: 2\n        Enabled: True\n        IntervalMinutes: 3\n```\n\nFor more information on how to write your configurations with Ansible, you can refer to the documentation [here](https://docs.ansible.com/ansible/latest/user_guide/windows_dsc.html).\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Ansible/vCenter_Statistics_config.yml",
    "content": "- hosts: <host>\n  tasks:\n  - name: Updates the Statistics settings of the passed vCenter.\n    win_dsc:\n        resource_name: vCenterStatistics\n        Server: <server>\n        Credential_username: <user>\n        Credential_password: <password>\n        Period: Day\n        PeriodLength: 3\n        Level: 2\n        Enabled: True\n        IntervalMinutes: 3\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Chef/README.md",
    "content": "# Desired State Configuration Resources for VMware Examples with Chef\n\n## Getting Started\n## Requirements\n1. Install [Chef Development Kit](https://docs.chef.io/install_dk.html)\n2. To apply your configuration run the following command in Powershell:\n    ```powershell\n    chef-client -z <path to your config file>\n    ```\n\n## Examples\nAll shown examples are located [here](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations/Chef).\n\n### Example 1\nCreates a new Cluster in the specified Datacenter. The new Cluster has HAEnabled and HAAdmissionControlEnabled set to 'true', HAFailoverLevel is set to '3', HAIsolationResponse is 'DoNothing' and HARestartPriority is set to 'Low'.\n\n```ruby\ndsc_resource 'ha-cluster' do\n    resource :hacluster\n    property :server, '<server>'\n    property :credential, ps_credential('<user>', '<password>')\n    property :name, 'MyChefCluster'\n    property :datacenterinventorypath, ''\n    property :datacenter, 'Datacenter'\n    property :ensure, 'Present'\n    property :haenabled, true\n    property :haadmissioncontrolenabled, true\n    property :hafailoverlevel, 3\n    property :haisolationresponse, 'DoNothing'\n    property :harestartpriority, 'Low'\nend\n```\n\n### Example 2\nCreates a new Cluster in the specified Datacenter. The new Cluster has HAEnabled and HAAdmissionControlEnabled set to 'true', HAFailoverLevel is set to '3', HAIsolationResponse is 'DoNothing' and HARestartPriority is set to 'Low'. The new Cluster also has DrsEnabled set to 'true', DrsAutomationLevel is 'FullyAutomated', DrsMigrationThreshold is set to '5'. It has the following options specified: DrsDistribution is set to '0', MemoryLoadBalancing is set to '100' and CPUOverCommitment is set to '500'.\n\n```ruby\ndsc_script 'cluster' do\n    imports 'VMware.vSphereDSC'\n    configuration_data <<-EOH\n        @{\n            AllNodes = @(\n                @{\n                    NodeName = \"localhost\";\n                    PSDscAllowPlainTextPassword = $true\n                })\n        }\n    EOH\n    code <<-EOH\n        $Server = '<server>'\n        $User = '<user>'\n        $Password = ConvertTo-SecureString -String '<password>' -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Cluster cluster\n        {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            DatacenterInventoryPath = [string]::Empty\n            Datacenter = 'Datacenter'\n            Name = 'MyChefCluster'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n        }\n    EOH\nend\n```\n\nFor more information on how to write your configurations with Chef, you can refer to the documentation [here](https://docs.chef.io/resource_dsc_resource.html) and [here](https://docs.chef.io/resource_dsc_script.html).\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Chef/cluster_config.rb",
    "content": "dsc_script 'cluster' do\n    imports 'VMware.vSphereDSC'\n    configuration_data <<-EOH\n        @{\n            AllNodes = @(\n                @{\n                    NodeName = \"localhost\";\n                    PSDscAllowPlainTextPassword = $true\n                })\n        }\n    EOH\n    code <<-EOH\n        $Server = '<server>'\n        $User = '<user>'\n        $Password = ConvertTo-SecureString -String '<password>' -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Cluster cluster\n        {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            DatacenterInventoryPath = [string]::Empty\n            Datacenter = 'Datacenter'\n            Name = 'MyChefCluster'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n        }\n    EOH\nend\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Chef/ha_cluster_config.rb",
    "content": "dsc_resource 'ha-cluster' do\n    resource :hacluster\n    property :server, '<server>'\n    property :credential, ps_credential('<user>', '<password>')\n    property :name, 'MyChefCluster'\n    property :datacenterinventorypath, ''\n    property :datacenter, 'Datacenter'\n    property :ensure, 'Present'\n    property :haenabled, true\n    property :haadmissioncontrolenabled, true\n    property :hafailoverlevel, 3\n    property :haisolationresponse, 'DoNothing'\n    property :harestartpriority, 'Low'\nend\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostAcceptanceLevel/VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the VMHost acceptance level by setting it to 'CommunitySupported'.\n#>\nConfiguration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAcceptanceLevel VMHostAcceptanceLevel {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Level = 'CommunitySupported'\n        }\n    }\n}\n\nVMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostDCUIKeyboard/VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the Direct Console User Interface Keyboard Layout to be 'US Default'.\n#>\nConfiguration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostDCUIKeyboard VMHostDCUIKeyboard {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Layout = 'US Default'\n        }\n    }\n}\n\nVMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostNetworkCoreDump/VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostVMKernelNetworkAdapterName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostVMKernelNetworkAdapterName = $VMHostVMKernelNetworkAdapterName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the configuration of the network coredump of the VMHost by setting the active interface to be the passed VMKernel Network Adapter, the IP address of the coredump server is '10.11.12.13'\nand the port on which the coredump server is listening is '6500'. It also enables the network coredump.\n#>\nConfiguration VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostNetworkCoreDump VMHostNetworkCoreDump {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Enable = $true\n            InterfaceName = $AllNodes.VMHostVMKernelNetworkAdapterName\n            ServerIp = '10.11.12.13'\n            ServerPort = 6500\n        }\n    }\n}\n\nVMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostSNMPAgent/VMHostSNMPAgent_ModifyVMHostSNMPAgentConfiguration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the configuration of the SNMP agent of the VMHost by setting the authentication protocol to 'SHA1', the privacy protocol to 'AES128',\nthe log level to 'info' and the UDP port to poll SNMP agent on to '161'. It also starts the SNMP service, 'CIM Indications' to source hardware events from and\nsupports large storage.\n#>\nConfiguration VMHostSNMPAgent_ModifyVMHostSNMPAgentConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSNMPAgent VMHostSNMPAgent {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Authentication = 'SHA1'\n            Enable = $true\n            Hwsrc = 'indications'\n            LargeStorage = $true\n            LogLevel = 'info'\n            Port = 161\n            Privacy = 'AES128'\n        }\n    }\n}\n\nVMHostSNMPAgent_ModifyVMHostSNMPAgentConfiguration_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostSNMPAgent/VMHostSNMPAgent_ResetVMHostSNMPAgentConfiguration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nReturns the SNMP agent configuration on the VMHost to factory defaults.\n#>\nConfiguration VMHostSNMPAgent_ResetVMHostSNMPAgentConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSNMPAgent VMHostSNMPAgent {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Reset = $true\n        }\n    }\n}\n\nVMHostSNMPAgent_ResetVMHostSNMPAgentConfiguration_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostSharedSwapSpace/VMHostSharedSwapSpace_ModifySharedSwapSpaceConfiguration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DatastoreName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DatastoreName = $DatastoreName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables the Datastore option and uses the Datastore with the specified name. Disables the host cache option. Disabled the host local swap option.\nThe preference of the options is: 0. host local swap option, 1. Datastore option, 2. host cache option.\n#>\nConfiguration VMHostSharedSwapSpace_ModifySharedSwapSpaceConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSharedSwapSpace VMHostSharedSwapSpace {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DatastoreEnabled = $true\n            DatastoreName = $AllNodes.DatastoreName\n            DatastoreOrder = 1\n            HostCacheEnabled = $false\n            HostCacheOrder = 2\n            HostLocalSwapEnabled = $false\n            HostLocalSwapOrder = 0\n        }\n    }\n}\n\nVMHostSharedSwapSpace_ModifySharedSwapSpaceConfiguration_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostSoftwareDevice/VMHostSoftwareDevice_AddSoftwareDevice_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DeviceId\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DeviceId = $DeviceId\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nAdds the device with the specified id to enable the software device driver. '0' is used to address this instance of the device.\n#>\nConfiguration VMHostSoftwareDevice_AddSoftwareDevice_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSoftwareDevice VMHostSoftwareDevice {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DeviceIdentifier = $AllNodes.DeviceId\n            Ensure = 'Present'\n            InstanceAddress = 0\n        }\n    }\n}\n\nVMHostSoftwareDevice_AddSoftwareDevice_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostSoftwareDevice/VMHostSoftwareDevice_RemoveSoftwareDevice_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DeviceId\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DeviceId = $DeviceId\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the software device with the specified id.\n#>\nConfiguration VMHostSoftwareDevice_RemoveSoftwareDevice_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSoftwareDevice VMHostSoftwareDevice {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DeviceIdentifier = $AllNodes.DeviceId\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostSoftwareDevice_RemoveSoftwareDevice_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostVMKernelActiveDumpFile/VMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables the VMKernel dump file on the specified VMHost by selecting the best available file using the smart selection algorithm.\n#>\nConfiguration VMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelActiveDumpFile VMHostVMKernelActiveDumpFile {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Enable = $true\n            Smart = $true\n        }\n    }\n}\n\nVMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostVMKernelActiveDumpPartition/VMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables the VMKernel dump partition on the specified VMHost by selecting the best available partition using the smart selection algorithm.\n#>\nConfiguration VMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelActiveDumpPartition VMHostVMKernelActiveDumpPartition {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Enable = $true\n            Smart = $true\n        }\n    }\n}\n\nVMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile_CreateVMKernelDumpFile_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates VMKernel dump file 'MyDumpFile' with size '1181 MB' on Datastore 'MyDatastore' on the specified VMHost.\n#>\nConfiguration VMHostVMKernelDumpFile_CreateVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelDumpFile VMHostVMKernelDumpFile {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DatastoreName = 'MyDatastore'\n            FileName = 'MyDumpFile'\n            Size = 1181\n            Ensure = 'Present'\n        }\n    }\n}\n\nVMHostVMKernelDumpFile_CreateVMKernelDumpFile_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile_RemoveVMKernelDumpFile_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the VMKernel dump file 'MyDumpFile' on Datastore 'MyDatastore' on the specified VMHost.\n#>\nConfiguration VMHostVMKernelDumpFile_RemoveVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelDumpFile VMHostVMKernelDumpFile {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DatastoreName = 'MyDatastore'\n            FileName = 'MyDumpFile'\n            Ensure = 'Absent'\n            Force = $true\n        }\n    }\n}\n\nVMHostVMKernelDumpFile_RemoveVMKernelDumpFile_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostVMKernelModule/VMHostVMKernelModule_EnableVMKernelModule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMKernelModule\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMKernelModule = $VMKernelModule\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables the specified VMKernel module on the specified VMHost and skips the module validity checks.\n#>\nConfiguration VMHostVMKernelModule_EnableVMKernelModule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelModule VMHostVMKernelModule {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Module = $AllNodes.VMKernelModule\n            Enabled = $true\n            Force = $true\n        }\n    }\n}\n\nVMHostVMKernelModule_EnableVMKernelModule_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration_AddVMHostvSANNetworkConfigurationIPInterface_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostVMKernelNetworkAdapterName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostVMKernelNetworkAdapterName = $VMHostVMKernelNetworkAdapterName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nAdds a new vSAN network configuration IP Interface where the interface name is the specified VMKernel Network Adapter name. The time-to-live for multicast packets is '5' and the traffic type is 'vsan'.\nAlso specified are the settings for the 'Agent' and 'Master' groups as well as the unicast address port for the VMHost unicast channel: '12321'.\n#>\nConfiguration VMHostvSANNetworkConfiguration_AddVMHostvSANNetworkConfigurationIPInterface_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostvSANNetworkConfiguration VMHostvSANNetworkConfiguration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            InterfaceName = $AllNodes.VMHostVMKernelNetworkAdapterName\n            Ensure = 'Present'\n            AgentV6McAddr = 'ff19::2:3:4'\n            AgentMcAddr = '224.2.3.4'\n            AgentMcPort = 23451\n            HostUcPort = 12321\n            MasterV6McAddr = 'ff19::1:2:3'\n            MasterMcAddr = '224.1.2.3'\n            MasterMcPort = 12345\n            MulticastTtl = 5\n            TrafficType = 'vsan'\n        }\n    }\n}\n\nVMHostvSANNetworkConfiguration_AddVMHostvSANNetworkConfigurationIPInterface_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/EsxCli/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration_RemoveVMHostvSANNetworkConfigurationIPInterface_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostVMKernelNetworkAdapterName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostVMKernelNetworkAdapterName = $VMHostVMKernelNetworkAdapterName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the vSAN network configuration IP Interface where the interface name is the specified VMKernel Network Adapter name. The vSAN subsystem is notified of the removal of the IP Interface.\n#>\nConfiguration VMHostvSANNetworkConfiguration_RemoveVMHostvSANNetworkConfigurationIPInterface_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostvSANNetworkConfiguration VMHostvSANNetworkConfiguration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            InterfaceName = $AllNodes.VMHostVMKernelNetworkAdapterName\n            Ensure = 'Absent'\n            Force = $true\n            AgentV6McAddr = 'ff19::2:3:4'\n            AgentMcAddr = '224.2.3.4'\n            AgentMcPort = 23451\n            HostUcPort = 12321\n            MasterV6McAddr = 'ff19::1:2:3'\n            MasterMcAddr = '224.1.2.3'\n            MasterMcPort = 12345\n            MulticastTtl = 5\n            TrafficType = 'vsan'\n        }\n    }\n}\n\nVMHostvSANNetworkConfiguration_RemoveVMHostvSANNetworkConfigurationIPInterface_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/NfsDatastore/NfsDatastore_CreateNfsDatastoreWithReadOnlyAccessMode_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $NfsHost,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $NfsPath\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            NfsHost = $NfsHost\n            NfsPath = $NfsPath\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates Nfs Datastore 'MyNfsDatastore' with 'version 3' File System on the specified Nfs Host and VMHost. The access mode is 'ReadOnly' and the Authentication method is 'AUTH_SYS'.\n#>\nConfiguration NfsDatastore_CreateNfsDatastoreWithReadOnlyAccessMode_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore NfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $AllNodes.NfsPath\n            Ensure = 'Present'\n            NfsHost = $AllNodes.NfsHost\n            FileSystemVersion = '3'\n            AccessMode = 'ReadOnly'\n            AuthenticationMethod = 'AUTH_SYS'\n        }\n    }\n}\n\nNfsDatastore_CreateNfsDatastoreWithReadOnlyAccessMode_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/NfsDatastore/NfsDatastore_CreateNfsDatastoreWithReadWriteAccessMode_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $NfsHost,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $NfsPath\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            NfsHost = $NfsHost\n            NfsPath = $NfsPath\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies Nfs Datastore 'MyNfsDatastore' with 'version 3' File System on the specified Nfs Host and VMHost. The access mode is 'ReadWrite' and the Authentication method\nis 'AUTH_SYS'. The StorageIOControl is 'enabled' and the latency period beyond which the storage array is considered congested is '10 milliseconds'.\n#>\nConfiguration NfsDatastore_CreateNfsDatastoreWithReadWriteAccessMode_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore NfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $AllNodes.NfsPath\n            Ensure = 'Present'\n            NfsHost = $AllNodes.NfsHost\n            FileSystemVersion = '3'\n            AccessMode = 'ReadWrite'\n            AuthenticationMethod = 'AUTH_SYS'\n            StorageIOControlEnabled = $true\n            CongestionThresholdMillisecond = 10\n        }\n    }\n}\n\nNfsDatastore_CreateNfsDatastoreWithReadWriteAccessMode_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/NfsDatastore/NfsDatastore_RemoveNfsDatastore_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $NfsHost,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $NfsPath\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            NfsHost = $NfsHost\n            NfsPath = $NfsPath\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves Nfs Datastore 'MyNfsDatastore' from the specified Nfs Host and VMHost.\n#>\nConfiguration NfsDatastore_RemoveNfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore NfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsDatastore'\n            Path = $AllNodes.NfsPath\n            Ensure = 'Absent'\n            NfsHost = $AllNodes.NfsHost\n        }\n    }\n}\n\nNfsDatastore_RemoveNfsDatastore_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/NfsUser/NfsUser_ChangeNfsUserPassword_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nChanges the password of Nfs User 'MyNfsUser' to 'MyNfsUserPassword2!' on the specified VMHost.\n#>\nConfiguration NfsUser_ChangeNfsUserPassword_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsUser NfsUser {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsUser'\n            Password = 'MyNfsUserPassword2!'\n            Ensure = 'Present'\n            Force = $true\n        }\n    }\n}\n\nNfsUser_ChangeNfsUserPassword_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/NfsUser/NfsUser_CreateNfsUser_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates Nfs User 'MyNfsUser' with password 'MyNfsUserPassword1!' on the specified VMHost. The VMHost must be in Active Directory domain for the Nfs User to be created.\n#>\nConfiguration NfsUser_CreateNfsUser_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsUser NfsUser {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsUser'\n            Password = 'MyNfsUserPassword1!'\n            Ensure = 'Present'\n        }\n    }\n}\n\nNfsUser_CreateNfsUser_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/NfsUser/NfsUser_RemoveNfsUser_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves Nfs User 'MyNfsUser' from the specified VMHost.\n#>\nConfiguration NfsUser_RemoveNfsUser_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsUser NfsUser {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyNfsUser'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nNfsUser_RemoveNfsUser_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardPortGroup/StandardPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nThe Configuration does the following:\n1. Creates/Updates Port Group 'MyStandardPortGroup' which belongs to Standard Switch 'MyStandardSwitch' with VLanId set to '1'.\n2. Enables the Shaping Policy and sets the 'BurstSize', 'Average' and 'Peak bandwidth' values.\n3. Enables 'Promiscuous mode', 'Forged Transmits' and 'Mac Changes'. The Security Policy settings are not inherited from the parent Standard Switch 'MyStandardSwitch'.\n4. Sets the active Nics to be 'vmnic2' and 'vmnnic3', the LoadBalancing Policy to 'LoadBalanceIP' and the NetworkFailover Policy to 'LinkStatus'.\n   The Teaming Policy settings are not inherited from the parent Standard Switch 'MyStandardSwitch'.\n#>\nConfiguration StandardPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        StandardPortGroup StandardPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyStandardPortGroup'\n            VssName = 'MyStandardSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            AllowPromiscuous = $true\n            AllowPromiscuousInherited = $false\n            ForgedTransmits = $true\n            ForgedTransmitsInherited = $false\n            MacChanges = $true\n            MacChangesInherited = $false\n            FailbackEnabled = $false\n            LoadBalancingPolicy = 'LoadBalanceIP'\n            ActiveNic = @('vmnic2', 'vmnic3')\n            StandbyNic = @()\n            UnusedNic = @()\n            NetworkFailoverDetectionPolicy = 'LinkStatus'\n            NotifySwitches = $false\n            InheritFailback = $false\n            InheritFailoverOrder = $false\n            InheritLoadBalancingPolicy = $false\n            InheritNetworkFailoverDetectionPolicy = $false\n            InheritNotifySwitches = $false\n        }\n    }\n}\n\nStandardPortGroup_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardPortGroup/VMHostVssPortGroupSecurity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\nConfiguration VMHostVssPortGroupSecurity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss VMHostStandardSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n\n        VMHostVssPortGroupSecurity VMHostVssPortGroupSecurity {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            AllowPromiscuous = $true\n            AllowPromiscuousInherited = $false\n            ForgedTransmits = $true\n            ForgedTransmitsInherited = $false\n            MacChanges = $true\n            MacChangesInherited = $false\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n\nVMHostVssPortGroupSecurity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardPortGroup/VMHostVssPortGroupShaping_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\nConfiguration VMHostVssPortGroupShaping_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss VMHostStandardSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n\n        VMHostVssPortGroupShaping VMHostVssPortGroupShaping {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n\nVMHostVssPortGroupShaping_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardPortGroup/VMHostVssPortGroupTeaming_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\nConfiguration VMHostVssPortGroupTeaming_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss VMHostStandardSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssBridge VMHostVssBridge {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            NicDevice = @('vmnic2', 'vmnic3')\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n\n        VMHostVssTeaming VMHostVssTeaming {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            CheckBeacon = $true\n            ActiveNic = @('vmnic2', 'vmnic3')\n            StandbyNic = @()\n            NotifySwitches = $false\n            Policy = 'Loadbalance_ip'\n            RollingOrder = $true\n            DependsOn = \"[VMHostVssBridge]VMHostVssBridge\"\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            DependsOn = \"[VMHostVssTeaming]VMHostVssTeaming\"\n        }\n\n        VMHostVssPortGroupTeaming VMHostVssPortGroupTeaming {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            FailbackEnabled = $false\n            LoadBalancingPolicy = 'LoadBalanceIP'\n            ActiveNic = @('vmnic2', 'vmnic3')\n            StandbyNic = @()\n            UnusedNic = @()\n            NetworkFailoverDetectionPolicy = 'LinkStatus'\n            NotifySwitches = $false\n            InheritFailback = $false\n            InheritFailoverOrder = $false\n            InheritLoadBalancingPolicy = $false\n            InheritNetworkFailoverDetectionPolicy = $false\n            InheritNotifySwitches = $false\n            DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n        }\n    }\n}\n\nVMHostVssPortGroupTeaming_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardPortGroup/VMHostVssPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\nConfiguration VMHostVssPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss VMHostVss {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssPortGroup VMHostVssPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'MyVirtualPortGroup'\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            VLanId = 0\n            DependsOn = \"[VMHostVss]VMHostVss\"\n        }\n    }\n}\n\nVMHostVssPortGroup_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardSwitch/StandardSwitch_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates/modifies Standard Switch 'MyStandardSwitch' with maximum transmission unit '1500 bytes'.\nPhysical Network Adapters 'vmnic2' and 'vmnic3' are bridged to Standard Switch 'MyStandardSwitch' with configured beacon probing and link discovery protocol type 'CDP' and operation 'Listen'.\n'Promiscuous mode', 'Forged Transmits' and 'Mac Changes' are enabled for Standard Switch 'MyStandardSwitch'.\nThe shaping policy for Standard Switch 'MyStandardSwitch' is 'enabled' with average bandwidth in bits per second '104857600000', peak bandwidth during bursts in bits per second '104857600000' and\nthe maximum burst size allowed in bytes '107374182400'. The active Nic is 'vmnic2', the standby Nic is 'vmnnic3', the Network Adapter teaming policy is 'LoadBalanceSrcId'. The Physical Network Adapters are\nnotified if a link fails. Rolling policy when restoring links is not used. Beacon probing as a method to validate the link status of a Physical Network Adapter is not enabled.\n#>\nConfiguration StandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        StandardSwitch StandardSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyStandardSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n            NicDevice = @('vmnic2', 'vmnic3')\n            BeaconInterval = 1\n            LinkDiscoveryProtocolType = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Listen'\n            AllowPromiscuous = $true\n            ForgedTransmits = $true\n            MacChanges = $true\n            Enabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n            CheckBeacon = $false\n            ActiveNic = @('vmnic2')\n            StandbyNic = @('vmnic3')\n            NotifySwitches = $true\n            Policy = 'Loadbalance_srcid'\n            RollingOrder = $false\n        }\n    }\n}\n\nStandardSwitch_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardSwitch/VMHostVssBridge_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssBridge_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            Mtu = 1500\n        }\n\n        VMHostVssBridge vmHostVssBridge {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            NicDevice = @('vmnic2', 'vmnic3')\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nVMHostVssBridge_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardSwitch/VMHostVssSecurity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssSecurity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            Mtu = 1500\n        }\n\n        VMHostVssSecurity vmHostVssSecurity {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            AllowPromiscuous = $true\n            ForgedTransmits = $true\n            MacChanges = $true\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nVMHostVssSecurity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardSwitch/VMHostVssShaping_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssShaping_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            Mtu = 1500\n        }\n\n        VMHostVssShaping vmHostVssShaping {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            AverageBandwidth = 100000\n            BurstSize = 100000\n            Enabled = $true\n            PeakBandwidth = 100000\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nVMHostVssShaping_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardSwitch/VMHostVssTeaming_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVssTeaming_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            Mtu = 1500\n        }\n\n        VMHostVssBridge vmHostVssBridge {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            NicDevice = @('vmnic2', 'vmnic3')\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n\n        VMHostVssTeaming vmHostVssTeaming {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            CheckBeacon = $false\n            ActiveNic = @('vmnic2')\n            StandbyNic = @('vmnic3')\n            NotifySwitches = $true\n            Policy = 'Loadbalance_srcid'\n            RollingOrder = $false\n            DependsOn = \"[VMHostVssBridge]vmHostVssBridge\"\n        }\n    }\n}\n\nVMHostVssTeaming_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/StandardSwitch/VMHostVss_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostVss_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostVss vmHostVss {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            VssName = 'VSS1'\n            Mtu = 1500\n        }\n    }\n}\n\nVMHostVss_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VDSwitchVMHost_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $VMHostNames\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostNames = $VMHostNames\n        }\n    )\n}\n\nConfiguration VDSwitchVMHost_WhenAddingVMHostsToDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitchVMHost VDSwitchVMHost {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VdsName = 'MyDistributedSwitch'\n            VMHostNames = $AllNodes.VMHostNames\n            Ensure = 'Present'\n            DependsOn = \"[VDSwitch]VDSwitch\"\n        }\n    }\n}\n\nConfiguration VDSwitchVMHost_WhenRemovingVMHostsFromDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitchVMHost VDSwitchVMHost {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VdsName = 'MyDistributedSwitch'\n            VMHostNames = $AllNodes.VMHostNames\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVDSwitchVMHost_WhenAddingVMHostsToDistributedSwitch_Config -ConfigurationData $script:configurationData\nVDSwitchVMHost_WhenRemovingVMHostsFromDistributedSwitch_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostAccount_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:vmHostAccountId = 'MyVMHostAccount'\n$script:vmHostAccountRole = 'Admin'\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostAccount_WithAccountToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $Credential\n            Id = $script:vmHostAccountId\n            Ensure = 'Present'\n            Role = $script:vmHostAccountRole\n            AccountPassword = 'MyAccountPass1!'\n            Description = 'MyVMHostAccount Description'\n        }\n    }\n}\n\nConfiguration VMHostAccount_WithAccountToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $Credential\n            Id = $script:vmHostAccountId\n            Ensure = 'Absent'\n            Role = $script:vmHostAccountRole\n        }\n    }\n}\n\nVMHostAccount_WithAccountToAdd_Config -ConfigurationData $script:configurationData\nVMHostAccount_WithAccountToRemove_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostAdvancedSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n<#\nValues of type 'System.Int32' are not allowed in the hashtable and need to be cast to 'long'.\nSupported types : [String], [Char], [Int64], [UInt64], [Double], [Bool] ,[DateTime] and [ScriptBlock].\n#>\nConfiguration VMHostAdvancedSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAdvancedSettings vmHostAdvancedSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AdvancedSettings = @{\n                'Annotations.WelcomeMessage' = 'Hello from DSC'\n                'BufferCache.FlushInterval' = [long] 20000\n                'BufferCache.HardMaxDirty' = [long] 50\n                'CBRC.Enable' = $true\n                'Cpu.UseMwait' = [long] 1\n                'Config.Etc.issue' = 'Contents of /etc/issue'\n                'Config.HostAgent.plugins.solo.enableMob' = $true\n                'DataMover.MaxHeapSize' = [long] 32\n                'HBR.HbrBitmapVMMaxStorageGB' = [long] 65500\n                'HBR.HbrMinExtentSizeKB' = [long] 4\n                'Misc.WorldletLoadType' = 'low'\n                'VMkernel.Boot.useReliableMem' = $false\n                'Vpx.Vpxa.config.workingDir' = '/var/log/vmware'\n                'UserVars.ProductLockerLocation' = '/locker/packages/vmtoolsRepo/'\n            }\n        }\n    }\n}\n\nVMHostAdvancedSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostAgentVM_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostAgentVM_WhenBothAgentVmSettingsArePassedAsNull_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AgentVmDatastore = $null\n            AgentVmNetwork = $null\n        }\n    }\n}\n\nConfiguration VMHostAgentVM_WhenBothAgentVmSettingsArePassed_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            AgentVmDatastore = 'MyDatastore'\n            AgentVmNetwork = 'MyNetwork'\n        }\n    }\n}\n\nVMHostAgentVM_WhenBothAgentVmSettingsArePassedAsNull_Config -ConfigurationData $script:configurationData\nVMHostAgentVM_WhenBothAgentVmSettingsArePassed_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostAuthentication/VMHostAuthentication_JoinDomain_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainUsername,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainPassword\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$DomainCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $DomainUsername, (ConvertTo-SecureString -String $DomainPassword -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DomainName = $DomainName\n            DomainCredential = $DomainCredential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nIncludes the specified VMHost in the specified domain.\n#>\nConfiguration VMHostAuthentication_JoinDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAuthentication VMHostAuthentication {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DomainName = $AllNodes.DomainName\n            DomainAction = 'Join'\n            DomainCredential = $AllNodes.DomainCredential\n        }\n    }\n}\n\nVMHostAuthentication_JoinDomain_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostAuthentication/VMHostAuthentication_LeaveDomain_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DomainName = $DomainName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nExcludes the specified VMHost from the specified domain.\n#>\nConfiguration VMHostAuthentication_LeaveDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAuthentication VMHostAuthentication {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DomainName = $AllNodes.DomainName\n            DomainAction = 'Leave'\n        }\n    }\n}\n\nVMHostAuthentication_LeaveDomain_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostCache_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostCache_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostCache vmHostCache {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            DatastoreName = 'MyDatastore'\n            SwapSizeGB = 1\n        }\n    }\n}\n\nVMHostCache_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostConfiguration/VMHostConfiguration_ModifyVMHostCryptoKey_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $KmsClusterName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            KmsClusterName = $KmsClusterName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nIf the VMHost is not in 'CryptoSafe' state, the DSC Resource makes the VMHost 'CryptoSafe'.\nIf the VMHost is already in 'CryptoSafe' state, the DSC Resource resets the 'CryptoKey' in the VMHost.\n#>\nConfiguration VMHostConfiguration_ModifyVMHostCryptoKey_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration VMHostConfiguration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            KmsClusterName = $AllNodes.KmsClusterName\n        }\n    }\n}\n\nVMHostConfiguration_ModifyVMHostCryptoKey_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostConfiguration/VMHostConfiguration_ModifyVMHostHostProfileAssociation_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $HostProfileName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            HostProfileName = $HostProfileName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nAssociates the specified Host Profile with the specified VMHost.\n#>\nConfiguration VMHostConfiguration_ModifyVMHostHostProfileAssociation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration VMHostConfiguration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            HostProfileName = $AllNodes.HostProfileName\n        }\n    }\n}\n\nVMHostConfiguration_ModifyVMHostHostProfileAssociation_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostConfiguration/VMHostConfiguration_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates Vmfs Datastore 'MyVmfsDatastore' on the specified VMHost.\nSets the VMHost to evaluation mode by passing the '00000-00000-00000-00000-00000' evaluation key.\nModifies the Time Zone to be 'UTC', and the VM swapfile settings - uses Datastore 'MyVmfsDatastore' for storing the swapfiles\nand 'InHostDatastore' for swapfile placement policy.\n#>\nConfiguration VMHostConfiguration_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore VmfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n        }\n\n        VMHostConfiguration VMHostConfiguration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            LicenseKey = '00000-00000-00000-00000-00000'\n            TimeZoneName = 'UTC'\n            VMSwapfileDatastoreName = 'MyVmfsDatastore'\n            VMSwapfilePolicy = 'InHostDatastore'\n            DependsOn = '[VmfsDatastore]VmfsDatastore'\n        }\n    }\n}\n\nVMHostConfiguration_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostConfiguration/VMHostConfiguration_ModifyVMHostState_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nSets the VMHost into 'Maintenance' mode. The vCenter Server system automatically reregisters the VMs that are compatible for reregistration.\nIf they are not compatible, they remain on the VMHost. The special action to take regarding Virtual SAN data when moving in 'Maintenance' mode is 'Full'.\n#>\nConfiguration VMHostConfiguration_ModifyVMHostState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration VMHostConfiguration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            State = 'Maintenance'\n            Evacuate = $true\n            VsanDataMigrationMode = 'Full'\n        }\n    }\n}\n\nVMHostConfiguration_ModifyVMHostState_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostDnsSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostDnsSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostDnsSettings vmHostDnsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            HostName = \"esx-server1\"\n            DomainName = \"eng.vmware.com\"\n            Dhcp = $false\n            Address = @(\"10.23.83.229\", \"10.23.108.1\")\n            SearchDomain = @(\"eng.vmware.com\")\n        }\n    }\n}\n\nVMHostDnsSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostFirewallRuleset/VMHostFirewallRuleset_EnableVMHostFirewallRulesetAndModifyTheAllowedIPAddressesList_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostFirewallRulesetName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VMHostFirewallRulesetName = $VMHostFirewallRulesetName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables the specified VMHost firewall ruleset and modifies the allowed IP addresses list to be: '192.0.20.10', '192.0.20.11', '192.0.20.12', '10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/24'.\nAll IPs for the firewall ruleset are 'disabled'.\n#>\nConfiguration VMHostFirewallRuleset_EnableVMHostFirewallRulesetAndModifyTheAllowedIPAddressesList_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset VMHostFirewallRuleset {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            Enabled = $true\n            AllIP = $false\n            IPAddresses = @('192.0.20.10', '192.0.20.11', '192.0.20.12', '10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/24')\n        }\n    }\n}\n\nVMHostFirewallRuleset_EnableVMHostFirewallRulesetAndModifyTheAllowedIPAddressesList_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostGraphics/VMHostGraphicsDevice_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostGraphicsDevice_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostGraphicsDevice vmHostGraphicsDevice {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Id = '0000:00:00.0'\n            GraphicsType = 'Shared'\n            RestartTimeoutMinutes = 10\n        }\n    }\n}\n\nVMHostGraphicsDevice_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostGraphics/VMHostGraphics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostGraphics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostGraphics vmHostGraphics {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            GraphicsType = 'Shared'\n            SharedPassthruAssignmentPolicy = 'Performance'\n            RestartTimeoutMinutes = 10\n        }\n    }\n}\n\nVMHostGraphics_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHba/VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapType_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nConfigures the CHAP settings of the specified iSCSI Host Bus Adapter by specifiying the CHAP type as 'Prohibited'.\n#>\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = 'Prohibited'\n        }\n    }\n}\n\nVMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapType_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHba/VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nConfigures the CHAP settings of the specified iSCSI Host Bus Adapter by specifiying the CHAP type as 'Required' with CHAP name 'AdminOne' and CHAP password 'AdminPasswordOne'.\nAlso the Mutual CHAP is enabled with Mutual CHAP name 'AdminTwo' and Mutual CHAP password 'AdminPasswordTwo'.\n#>\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = 'Required'\n            ChapName = 'AdminOne'\n            ChapPassword = 'AdminPasswordOne'\n            MutualChapEnabled = $true\n            MutualChapName = 'AdminTwo'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n    }\n}\n\nVMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHba/VMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapter_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the 'iSCSI name' of the specified iSCSI Host Bus Adapter to 'iqn.1998-01.com.vmware:esx-server1'.\n#>\nConfiguration VMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba VMHostIScsiHba {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            IScsiName = 'iqn.1998-01.com.vmware:esx-server1'\n        }\n    }\n}\n\nVMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapter_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates a new iSCSI Host Bus Adapter Send target with address '10.23.84.73' on port '3260' for the specified iSCSI Host Bus Adapter. Also it configures the CHAP settings of the\niSCSI Host Bus Adapter target by specifiying the CHAP type as 'Required' with CHAP name 'AdminOne' and CHAP password 'AdminPasswordOne'.\nThe Mutual CHAP is enabled with Mutual CHAP name 'AdminTwo' and Mutual CHAP password 'AdminPasswordTwo'. CHAP and Mutual CHAP settings are not inherited from the iSCSI Host Bus Adapter.\n#>\nConfiguration VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget VMHostIScsiHbaTarget {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = 'Send'\n            Ensure = 'Present'\n            InheritChap = $false\n            ChapType = 'Required'\n            ChapName = 'AdminOne'\n            ChapPassword = 'AdminPasswordOne'\n            InheritMutualChap = $false\n            MutualChapEnabled = $true\n            MutualChapName = 'AdminTwo'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n    }\n}\n\nVMHostIScsiHbaTarget_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n            IScsiName = $IScsiName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates a new iSCSI Host Bus Adapter Static target with address '10.23.84.73' on port '3260' with the specified iSCSI name for the specified iSCSI Host Bus Adapter.\nCHAP and Mutual CHAP settings are inherited from the iSCSI Host Bus Adapter.\n#>\nConfiguration VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget VMHostIScsiHbaTarget {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = 'Static'\n            Ensure = 'Present'\n            IScsiName = $AllNodes.IScsiName\n            InheritChap = $true\n            InheritMutualChap = $true\n        }\n    }\n}\n\nVMHostIScsiHbaTarget_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterSendTarget_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            IScsiHbaName = $IScsiHbaName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the iSCSI Host Bus Adapter Send target with address '10.23.84.73' on port '3260' from the specified iSCSI Host Bus Adapter.\n#>\nConfiguration VMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterSendTarget_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget VMHostIScsiHbaTarget {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = '10.23.84.73'\n            Port = 3260\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = 'Send'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterSendTarget_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic_BindVMKernelNicsToIscsiHba_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $VMKernelNicNames\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            VMHostName = $VMHostName\n            Credential = $script:Credential\n            IScsiHbaName = $IScsiHbaName\n            VMKernelNicNames = $VMKernelNicNames\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nBinds the specified VMKernel Network Adapters to the specified iSCSI Host Bus Adapter.\n#>\nConfiguration VMHostIScsiHbaVMKernelNic_BindVMKernelNicsToIscsiHba_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaVMKernelNic VMHostIScsiHbaVMKernelNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            VMKernelNicNames = $AllNodes.VMKernelNicNames\n            Ensure = 'Present'\n        }\n    }\n}\n\nVMHostIScsiHbaVMKernelNic_BindVMKernelNicsToIscsiHba_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic_UnbindVMKernelNicsToIscsiHba_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $IScsiHbaName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $VMKernelNicNames\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            VMHostName = $VMHostName\n            Credential = $script:Credential\n            IScsiHbaName = $IScsiHbaName\n            VMKernelNicNames = $VMKernelNicNames\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nUnbinds the specified VMKernel Network Adapters from the specified iSCSI Host Bus Adapter.\n#>\nConfiguration VMHostIScsiHbaVMKernelNic_UnbindVMKernelNicsToIscsiHba_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaVMKernelNic VMHostIScsiHbaVMKernelNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            VMKernelNicNames = $AllNodes.VMKernelNicNames\n            Ensure = 'Absent'\n            Force = $true\n        }\n    }\n}\n\nVMHostIScsiHbaVMKernelNic_UnbindVMKernelNicsToIscsiHba_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostIPRoute/VMHostIPRoute_CreateVMHostIPRoute_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DefaultGateway\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostDefaultGateway = $DefaultGateway\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates a new IPv4 route with the specified gateway address and destination address '192.168.100.0/24' on the specified VMHost.\n#>\nConfiguration VMHostIPRoute_CreateVMHostIPRoute_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIPRoute VMHostIPRoute {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Gateway = $AllNodes.VMHostDefaultGateway\n            Destination = '192.168.100.0'\n            PrefixLength = 24\n            Ensure = 'Present'\n        }\n    }\n}\n\nVMHostIPRoute_CreateVMHostIPRoute_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostIPRoute/VMHostIPRoute_RemoveVMHostIPRoute_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DefaultGateway\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostDefaultGateway = $DefaultGateway\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the IPv4 route with the specified gateway address and destination address '192.168.100.0/24' from the specified VMHost.\n#>\nConfiguration VMHostIPRoute_RemoveVMHostIPRoute_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIPRoute VMHostIPRoute {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Gateway = $AllNodes.VMHostDefaultGateway\n            Destination = '192.168.100.0'\n            PrefixLength = 24\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostIPRoute_RemoveVMHostIPRoute_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNetworkMigration/VMHostVDSwitchMigration/VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToDifferentPortGroups_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nMigrates Physical Network Adapters 'vmnic0' and 'vmnic1' to vSphere Distributed Switch 'MyVDSwitch'.\nMigrates VMKernel Network Adapters 'vmk0' and 'vmk1' to vSphere Distributed Switch 'MyVDSwitch' and attaches them to Port Groups 'Management Network' and 'VM Network' respectively.\nIf the specified VMHost is not part of vSphere Distributed Switch 'MyVDSwitch', the DSC Resource adds it to 'MyVDSwitch' before the migration occurs.\nIf the Port Groups are not present on vSphere Distributed Switch 'MyVDSwitch', they are created by the DSC Resource before the migration occurs.\n#>\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToDifferentPortGroups_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n            PortGroupNames = @('Management Network', 'VM Network')\n        }\n    }\n}\n\nVMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToDifferentPortGroups_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNetworkMigration/VMHostVDSwitchMigration/VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToTheSamePortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nMigrates Physical Network Adapters 'vmnic0' and 'vmnic1' to vSphere Distributed Switch 'MyVDSwitch'.\nMigrates VMKernel Network Adapters 'vmk0' and 'vmk1' to vSphere Distributed Switch 'MyVDSwitch' and attaches them to Port Group 'Management Network'.\nIf the specified VMHost is not part of vSphere Distributed Switch 'MyVDSwitch', the DSC Resource adds it to 'MyVDSwitch' before the migration occurs.\nIf the Port Group is not present on vSphere Distributed Switch 'MyVDSwitch', it is created by the DSC Resource before the migration occurs.\n#>\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToTheSamePortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n            PortGroupNames = @('Management Network')\n        }\n    }\n}\n\nVMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToTheSamePortGroup_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNetworkMigration/VMHostVDSwitchMigration/VMHostVDSwitchMigration_MigratePhysicalNics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nMigrates Physical Network Adapters 'vmnic0' and 'vmnic1' to vSphere Distributed Switch 'MyVDSwitch'.\nIf the specified VMHost is not part of vSphere Distributed Switch 'MyVDSwitch', the DSC Resource adds it to\n'MyVDSwitch' before the migration occurs. The 'MigratePhysicalNicsOnly' parameter is specified to ensure that\nthe user allows the migration to occur without passing any VMKernel Network Adapters which can result in an\nESXi network connectivity loss.\n#>\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration VMHostVDSwitchMigration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = 'MyVDSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            MigratePhysicalNicsOnly = $true\n        }\n    }\n}\n\nVMHostVDSwitchMigration_MigratePhysicalNics_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNetworkMigration/VMHostVssMigration/VMHostVssMigration_MigratePhysicalNicsAndVMKernelNicsWithPortGroups_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nMigrates Physical Network Adapters 'vmnic0' and 'vmnic1' to Standard Switch 'MyStandardSwitch'.\nMigrates VMKernel Network Adapters 'vmk0' and 'vmk1' to Standard Switch 'MyStandardSwitch' and attaches them to Port Groups 'Management Network' and 'VM Network' respectively.\nIf the Port Groups are not present on Standard Switch 'MyStandardSwitch', they are created by the DSC Resource before the migration occurs.\n#>\nConfiguration VMHostVssMigration_MigratePhysicalNicsAndVMKernelNicsWithPortGroups_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration VMHostVssMigration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = 'MyStandardSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n            PortGroupNames = @('Management Network', 'VM Network')\n        }\n    }\n}\n\nVMHostVssMigration_MigratePhysicalNicsAndVMKernelNicsWithPortGroups_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNetworkMigration/VMHostVssMigration/VMHostVssMigration_MigratePhysicalNicsAndVMKernelNics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nMigrates Physical Network Adapters 'vmnic0' and 'vmnic1' to Standard Switch 'MyStandardSwitch'.\nMigrates VMKernel Network Adapters 'vmk0' and 'vmk1' to Standard Switch 'MyStandardSwitch'. The VMKernel Network Adapters are attached to newly created\nPort Groups which name has the 'VMKernel' prefix.\n#>\nConfiguration VMHostVssMigration_MigratePhysicalNicsAndVMKernelNics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration VMHostVssMigration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = 'MyStandardSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n            VMKernelNicNames = @('vmk0', 'vmk1')\n        }\n    }\n}\n\nVMHostVssMigration_MigratePhysicalNicsAndVMKernelNics_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNetworkMigration/VMHostVssMigration/VMHostVssMigration_MigratePhysicalNics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nMigrates Physical Network Adapters 'vmnic0' and 'vmnic1' to Standard Switch 'MyStandardSwitch'.\n#>\nConfiguration VMHostVssMigration_MigratePhysicalNics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration VMHostVssMigration {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = 'MyStandardSwitch'\n            PhysicalNicNames = @('vmnic0', 'vmnic1')\n        }\n    }\n}\n\nVMHostVssMigration_MigratePhysicalNics_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNic/VMHostPhysicalNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\nConfiguration VMHostPhysicalNic_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPhysicalNic VMHostPhysicalNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = 'vmnic0'\n            Duplex = 'Full'\n            BitRatePerSecMb = 1000\n        }\n    }\n}\n\nVMHostPhysicalNic_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic_EnableAvailableServices_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables all available services (VMotion, Vsan traffic, Management traffic and Fault Tolerance logging)\nfor VMKernel NIC 'vmk0' connected to Distributed Port Group 'DscVDPortGroup' on\nVDSwitch 'DscVDSwitch'.\n#>\nConfiguration VMHostVdsNic_EnableAvailableServices_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVdsNic VMHostVdsNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'vmk0'\n            VdsName = 'DscVDSwitch'\n            PortGroupName = 'DscVDPortGroup'\n            Ensure = 'Present'\n            ManagementTrafficEnabled = $true\n            FaultToleranceLoggingEnabled = $true\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n        }\n    }\n}\n\nVMHostVdsNic_EnableAvailableServices_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic_RemoveVMKernelNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            VMHostName = $VMHostName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves VMKernel NIC 'vmk0' connected to Distributed Port Group 'DscVDPortGroup' on\nVDSwitch 'DscVDSwitch'.\n#>\nConfiguration VMHostVdsNic_RemoveVMKernelNic_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVdsNic VMHostVdsNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'vmk0'\n            VdsName = 'DscVDSwitch'\n            PortGroupName = 'DscVDPortGroup'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostVdsNic_RemoveVMKernelNic_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNetwork/VMHostNic/VMHostVssNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n        }\n    )\n}\n\nConfiguration VMHostVssNic_WhenAddingVMKernelNetworkAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss VMHostStandardSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            Ensure = 'Present'\n            Mtu = 1500\n        }\n\n        VMHostVssNic VMHostVssNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            PortGroupName = 'MyVirtualPortGroup'\n            Ensure = 'Present'\n            IP = '192.168.0.1'\n            SubnetMask = '255.255.255.0'\n            Mac = '00:50:56:63:5b:0e'\n            AutomaticIPv6 = $true\n            IPv6 = @('fe80::250:56ff:fe63:5b0e/64', '200:2342::1/32')\n            IPv6ThroughDhcp = $true\n            Mtu = 4000\n            ManagementTrafficEnabled = $true\n            FaultToleranceLoggingEnabled = $true\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n            DependsOn = \"[VMHostVss]VMHostStandardSwitch\"\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenRemovingVMKernelNetworkAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic VMHostVssNic {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = 'MyVirtualSwitch'\n            PortGroupName = 'MyVirtualPortGroup'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostVssNic_WhenAddingVMKernelNetworkAdapter_Config -ConfigurationData $script:configurationData\nVMHostVssNic_WhenRemovingVMKernelNetworkAdapter_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNtpSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostNtpSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            NtpServer = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\", \"2.bg.pool.ntp.org\")\n            NtpServicePolicy = \"automatic\"\n        }\n    }\n}\n\nVMHostNtpSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPciPassthrough_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostPciPassthrough_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostPciPassthrough vmHostPciPassthrough {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Id = '0000:00:00.0'\n            Enabled = $true\n            RestartTimeoutMinutes = 10\n        }\n    }\n}\n\nVMHostPciPassthrough_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPermission/VMHostPermission_CreateVMHostPermissionForDatacenterEntity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies the Permission for Datacenter Entity 'ha-datacenter', Principal 'MyDscPrincipal' and Role 'MyDscRole' on the specified VMHost.\nThe Permission is propagated to the child Inventory Items of Datacenter Entity 'ha-datacenter'.\n#>\nConfiguration VMHostPermission_CreateVMHostPermissionForDatacenterEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = 'ha-datacenter'\n            EntityLocation = ''\n            EntityType = 'Datacenter'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n            Propagate = $true\n        }\n    }\n}\n\nVMHostPermission_CreateVMHostPermissionForDatacenterEntity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPermission/VMHostPermission_CreateVMHostPermissionForDatastoreEntity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies the Permission for Datastore Entity 'MyDscDatastore', Principal 'MyDscPrincipal' and Role 'MyDscRole' on the specified VMHost.\n#>\nConfiguration VMHostPermission_CreateVMHostPermissionForDatastoreEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = 'MyDscDatastore'\n            EntityLocation = ''\n            EntityType = 'Datastore'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n        }\n    }\n}\n\nVMHostPermission_CreateVMHostPermissionForDatastoreEntity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPermission/VMHostPermission_CreateVMHostPermissionForResourcePoolEntity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies the Permission for Resource Pool Entity 'MyDscResourcePool', Principal 'MyDscPrincipal' and Role 'MyDscRole' on the specified VMHost.\nThe Resource Pool Entity 'MyDscResourcePool' is located in the Root Resource Pool of the specified VMHost.\n#>\nConfiguration VMHostPermission_CreateVMHostPermissionForResourcePoolEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = 'MyDscResourcePool'\n            EntityLocation = ''\n            EntityType = 'ResourcePool'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n        }\n    }\n}\n\nVMHostPermission_CreateVMHostPermissionForResourcePoolEntity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPermission/VMHostPermission_CreateVMHostPermissionForVMEntity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies the Permission for Virtual Machine Entity 'MyDscVM', Principal 'MyDscPrincipal' and Role 'MyDscRole' on the specified VMHost.\nThe Virtual Machine Entity 'MyDscVM' is located in the 'MyDscvApp' vApp which is located in 'MyDscResourcePool' Resource Pool of the specified VMHost.\n#>\nConfiguration VMHostPermission_CreateVMHostPermissionForVMEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = 'MyDscVM'\n            EntityLocation = 'MyDscResourcePool/MyDscvApp'\n            EntityType = 'VM'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n        }\n    }\n}\n\nVMHostPermission_CreateVMHostPermissionForVMEntity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPermission/VMHostPermission_CreateVMHostPermissionForVMHostEntity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies the Permission for VMHost Entity, Principal 'MyDscPrincipal' and Role 'MyDscRole' on the specified VMHost.\nThe Permission is not propagated to the child Inventory Items of VMHost Entity.\n#>\nConfiguration VMHostPermission_CreateVMHostPermissionForVMHostEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.Server\n            EntityLocation = ''\n            EntityType = 'VMHost'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Present'\n            Propagate = $false\n        }\n    }\n}\n\nVMHostPermission_CreateVMHostPermissionForVMHostEntity_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPermission/VMHostPermission_RemoveVMHostPermission_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Permission for Virtual Machine Entity 'MyDscVM', Principal 'MyDscPrincipal' and Role 'MyDscRole' from the specified VMHost.\n#>\nConfiguration VMHostPermission_RemoveVMHostPermission_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission VMHostPermission {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = 'MyDscVM'\n            EntityLocation = 'MyDscResourcePool/MyDscvApp'\n            EntityType = 'VM'\n            PrincipalName = 'MyDscPrincipal'\n            RoleName = 'MyDscRole'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostPermission_RemoveVMHostPermission_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostPowerPolicy_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostPowerPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostPowerPolicy vmHostPowerPolicy {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            PowerPolicy = 'Balanced'\n        }\n    }\n}\n\nVMHostPowerPolicy_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostRole/VMHostRole_CreateRoleWithPrivileges_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies Role 'MyDscRole' on the specified VMHost. The applied Privileges of Role 'MyDscRole' should be:\n'Host.Inventory.AddStandaloneHost', 'Host.Inventory.CreateCluster', 'Host.Inventory.MoveHost', 'System.Anonymous', 'System.Read' and 'System.View'.\n#>\nConfiguration VMHostRole_CreateRoleWithPrivileges_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole VMHostRole {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDscRole'\n            Ensure = 'Present'\n            PrivilegeIds = @(\n                'Host.Inventory.AddStandaloneHost',\n                'Host.Inventory.CreateCluster',\n                'Host.Inventory.MoveHost',\n                'System.Anonymous',\n                'System.Read',\n                'System.View'\n            )\n        }\n    }\n}\n\nVMHostRole_CreateRoleWithPrivileges_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostRole/VMHostRole_RemoveRole_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves Role 'MyDscRole' from the specified VMHost. All Permissions associated with Role 'MyDscRole' will be removed as well.\n#>\nConfiguration VMHostRole_RemoveRole_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole VMHostRole {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDscRole'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVMHostRole_RemoveRole_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostSatpClaimRule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSatpClaimRule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSatpClaimRule vmHostSatpClaimRule {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Ensure = \"Present\"\n            RuleName = \"VMW_SATP_LOCAL\"\n            Transport = \"VMW_SATP_LOCAL Transport\"\n            Description = \"Description of VMW_SATP_LOCAL Claim Rule.\"\n            Type = \"transport\"\n            Psp = \"VMW_PSP_MRU\"\n        }\n    }\n}\n\nVMHostSatpClaimRule_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostScsiLun/VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunPathName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n            ScsiLunPathName = $ScsiLunPathName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the configuration of the specified SCSI device by changing the Multipath policy to 'Fixed' and setting the preferred SCSI Lun path to access the SCSI Lun to be the specified SCSI Lun path.\n#>\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLun VMHostScsiLun {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            MultipathPolicy = 'Fixed'\n            PreferredScsiLunPathName = $AllNodes.ScsiLunPathName\n        }\n    }\n}\n\nVMHostScsiLun_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostScsiLun/VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nModifies the configuration of the specified SCSI device by changing the Multipath policy to 'RoundRobin', the maximum number of I/O blocks to be issued on a given path\nto '2048', the maximum number of I/O requests to be issued on a given path to '50'. The SCSI disk is marked as 'local' and 'SSD'.\n#>\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLun VMHostScsiLun {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            MultipathPolicy = 'RoundRobin'\n            BlocksToSwitchPath = 2048\n            CommandsToSwitchPath = 50\n            IsLocal = $true\n            IsSsd = $true\n        }\n    }\n}\n\nVMHostScsiLun_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostScsiLun/VMHostScsiLun_RemoveScsiDiskPartitions_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves all partitions from the specified SCSI disk.\n#>\nConfiguration VMHostScsiLun_RemoveScsiDiskPartitions_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLun VMHostScsiLun {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            DeletePartitions = $true\n        }\n    }\n}\n\nVMHostScsiLun_RemoveScsiDiskPartitions_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostScsiLunPath/VMHostScsiLunPath_ConfigureScsiLunPathToBeActiveAndPreferred_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunPathName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n            ScsiLunPathName = $ScsiLunPathName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nConfigures the specified SCSI Lun path to the specified SCSI device to be 'Active' and 'Preferred'.\n#>\nConfiguration VMHostScsiLunPath_ConfigureScsiLunPathToBeActiveAndPreferred_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLunPath VMHostScsiLunPath {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ScsiLunPathName\n            ScsiLunCanonicalName = $AllNodes.ScsiLunCanonicalName\n            Active = $true\n            Preferred = $true\n        }\n    }\n}\n\nVMHostScsiLunPath_ConfigureScsiLunPathToBeActiveAndPreferred_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostService_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostServices_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostService vmHostService {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Key = 'TSM-SSH'\n            Policy = 'Automatic'\n            Running = $true\n        }\n    }\n}\n\nVMHostServices_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSettings vmHostSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Motd = 'Hello World from motd!'\n            Issue = 'Hello World from issue!'\n        }\n    }\n}\n\nVMHostSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostStorage/VMHostStorage_EnableSoftwareIscsi_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            VMHostName = $VMHostName\n            Credential = $script:Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nEnables the software iSCSI for the specified VMHost.\n#>\nConfiguration VMHostStorage_EnableSoftwareIscsi_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostStorage VMHostStorage {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enabled = $true\n        }\n    }\n}\n\nVMHostStorage_EnableSoftwareIscsi_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostSyslog_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSyslog_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostSyslog vmHostSyslog {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Loghost = '<SysLogServer:SysLogServerPort>'\n            CheckSslCerts = $true\n            DefaultRotate = 10\n            DefaultSize = 100\n            DefaultTimeout = 180\n            Logdir = '/scratch/log'\n            LogdirUnique = $false\n            DropLogRotate = 10\n            DropLogSize = 100\n            QueueDropMark = 90\n        }\n    }\n}\n\nVMHostSyslog_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostTpsSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostTpsSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostTpsSettings vmHostTpsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            ShareScanTime = 50\n            ShareForceSalting = 1\n        }\n    }\n}\n\nVMHostTpsSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VmfsDatastore/VmfsDatastore_CreateVmfsDatastore_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates or modifies Vmfs Datastore 'MyVmfsDatastore' with 'version 5' File System and maximum file size of Vmfs: '1MB' on the specified VMHost. The StorageIOControl is 'enabled' and the\nlatency period beyond which the storage array is considered congested is '100 milliseconds'.\n#>\nConfiguration VmfsDatastore_CreateVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore VmfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n            FileSystemVersion = '5'\n            BlockSizeMB = 1\n            StorageIOControlEnabled = $true\n            CongestionThresholdMillisecond = 100\n        }\n    }\n}\n\nVmfsDatastore_CreateVmfsDatastore_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VmfsDatastore/VmfsDatastore_RemoveVmfsDatastore_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ScsiLunCanonicalName\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            ScsiLunCanonicalName = $ScsiLunCanonicalName\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves Vmfs Datastore 'MyVmfsDatastore' from the specified VMHost.\n#>\nConfiguration VmfsDatastore_RemoveVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore VmfsDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = 'MyVmfsDatastore'\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVmfsDatastore_RemoveVmfsDatastore_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/PowerCLISettingsConfigs/PowerCLISettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration PowerCLISettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        PowerCLISettings powerCLISettings {\n            SettingsScope = 'LCM' # LCM is the only possible value for the Settings Scope.\n            ParticipateInCeip = $false\n            InvalidCertificateAction = 'Warn'\n            DefaultVIServerMode = 'Multiple'\n            DisplayDeprecationWarnings = $false\n        }\n    }\n}\n\nPowerCLISettings_Config\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/Cluster/Cluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration Cluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Cluster cluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            Location = [string]::Empty\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            Name = 'MyCluster'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n        }\n    }\n}\n\nCluster_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/Cluster/DrsCluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:clusterName = 'MyCluster'\n$script:location = [string]::Empty\n$script:datacenterName = 'Datacenter'\n$script:datacenterLocation = [string]::Empty\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration DrsCluster_WithClusterToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DrsCluster drsCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            Location = $script:location\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocation\n            Name = $script:clusterName\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n        }\n    }\n}\n\nConfiguration DrsCluster_WithClusterToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DrsCluster drsCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Absent'\n            Location = $script:location\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocation\n            Name = $script:clusterName\n        }\n    }\n}\n\nDrsCluster_WithClusterToAdd_Config -ConfigurationData $script:configurationData\nDrsCluster_WithClusterToRemove_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/Cluster/HACluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:clusterName = 'MyCluster'\n$script:location = [string]::Empty\n$script:datacenterName = 'Datacenter'\n$script:datacenterLocation = [string]::Empty\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration HACluster_WithClusterToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        HACluster haCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Present'\n            Location = $script:location\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocation\n            Name = $script:clusterName\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n        }\n    }\n}\n\nConfiguration HACluster_WithClusterToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        HACluster haCluster {\n            Server = $Server\n            Credential = $Credential\n            Ensure = 'Absent'\n            Location = $script:location\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocation\n            Name = $script:clusterName\n        }\n    }\n}\n\nHACluster_WithClusterToAdd_Config -ConfigurationData $script:configurationData\nHACluster_WithClusterToRemove_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/DRSRule/DRSRule_CreateDRSRule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates and enables 'VMAffinity' DRS rule 'DscDrsRule' for Cluster 'DscCluster'.\nVirtual Machines 'DscVM1' and 'DscVM2' are referenced by the DRS rule 'DscDrsRule'.\n#>\nConfiguration DRSRule_CreateDRSRule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DRSRule DRSRule {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'DscDrsRule'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            ClusterName = 'DscCluster'\n            ClusterLocation = ''\n            DRSRuleType = 'VMAffinity'\n            VMNames = @('DscVM1', 'DscVM2')\n            Ensure = 'Present'\n            Enabled = $true\n        }\n    }\n}\n\nDRSRule_CreateDRSRule_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/DRSRule/DRSRule_RemoveDRSRule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves 'VMAffinity' DRS rule 'DscDrsRule' for Cluster 'DscCluster'.\n#>\nConfiguration DRSRule_RemoveDRSRule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DRSRule DRSRule {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'DscDrsRule'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            ClusterName = 'DscCluster'\n            ClusterLocation = ''\n            DRSRuleType = 'VMAffinity'\n            VMNames = @('DscVM1', 'DscVM2')\n            Ensure = 'Absent'\n        }\n    }\n}\n\nDRSRule_RemoveDRSRule_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/DatacenterFolder_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration DatacenterFolder_WhenAddingFolderWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Present'\n            DependsOn = \"[DatacenterFolder]MyFolder\"\n        }\n    }\n}\n\nConfiguration DatacenterFolder_WhenRemovingFolderWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Absent'\n            DependsOn = \"[DatacenterFolder]MyDatacentersFolder\"\n        }\n    }\n}\n\nDatacenterFolder_WhenAddingFolderWithLocationWithOneFolder_Config -ConfigurationData $script:configurationData\nDatacenterFolder_WhenRemovingFolderWithLocationWithOneFolder_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/Datacenter_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration Datacenter_WhenAddingDatacenterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Present'\n            DependsOn = \"[DatacenterFolder]MyFolder\"\n        }\n\n        Datacenter MyDatacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = 'MyFolder/MyDatacentersFolder'\n            Ensure = 'Present'\n            DependsOn = \"[DatacenterFolder]MyDatacentersFolder\"\n        }\n    }\n}\n\nConfiguration Datacenter_WhenRemovingDatacenterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Datacenter MyDatacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = 'MyFolder/MyDatacentersFolder'\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder MyDatacentersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacentersFolder'\n            Location = 'MyFolder'\n            Ensure = 'Absent'\n            DependsOn = \"[Datacenter]MyDatacenter\"\n        }\n\n        DatacenterFolder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            Ensure = 'Absent'\n            DependsOn = \"[DatacenterFolder]MyDatacentersFolder\"\n        }\n    }\n}\n\nDatacenter_WhenAddingDatacenterWithLocationWithTwoFolders_Config -ConfigurationData $script:configurationData\nDatacenter_WhenRemovingDatacenterWithLocationWithTwoFolders_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/DatastoreCluster/DatastoreCluster_CreateDatastoreCluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates a Datastore Cluster 'DscDatastoreCluster' in the 'Datastore Folder' of Datacenter 'Datacenter'.\nThe IOLoadBalanceEnabled is set to '$true', the SdrsAutomationLevel is set to 'FullyAutomated' and\nthe IOLatencyThresholdMillisecond and SpaceUtilizationThresholdPercent are set to '50'.\n#>\nConfiguration DatastoreCluster_CreateDatastoreCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatastoreCluster DatastoreCluster {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'DscDatastoreCluster'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            IOLatencyThresholdMillisecond = 50\n            IOLoadBalanceEnabled = $true\n            SdrsAutomationLevel = 'FullyAutomated'\n            SpaceUtilizationThresholdPercent = 50\n        }\n    }\n}\n\nDatastoreCluster_CreateDatastoreCluster_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/DatastoreCluster/DatastoreCluster_RemoveDatastoreCluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Datastore Cluster 'DscDatastoreCluster' located in the 'Datastore Folder' of Datacenter 'Datacenter'.\n#>\nConfiguration DatastoreCluster_RemoveDatastoreCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatastoreCluster DatastoreCluster {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'DscDatastoreCluster'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            IOLatencyThresholdMillisecond = 50\n            IOLoadBalanceEnabled = $true\n            SdrsAutomationLevel = 'FullyAutomated'\n            SpaceUtilizationThresholdPercent = 50\n        }\n    }\n}\n\nDatastoreCluster_RemoveDatastoreCluster_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore_AddDatastoresToDatastoreCluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nAdds Datastores 'DscDatastoreOne' and 'DscDatastoreTwo' to\nDatastore Cluster 'DscDatastoreCluster' located in Datacenter 'Datacenter'.\n#>\nConfiguration DatastoreClusterAddDatastore_AddDatastoresToDatastoreCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatastoreClusterAddDatastore DatastoreClusterAddDatastore {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            DatastoreClusterName = 'DscDatastoreCluster'\n            DatastoreClusterLocation = ''\n            DatastoreNames = @('DscDatastoreOne', 'DscDatastoreTwo')\n        }\n    }\n}\n\nDatastoreClusterAddDatastore_AddDatastoresToDatastoreCluster_Config -ConfigurationData $script:ConfigurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/Folder_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration Folder_WhenAddingFolderWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Folder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n        }\n\n        Folder MyClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyClustersFolder'\n            Location = 'MyFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyFolder\"\n        }\n\n        Folder MyHAClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyHAClustersFolder'\n            Location = 'MyFolder/MyClustersFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyClustersFolder\"\n        }\n    }\n}\n\nConfiguration Folder_WhenRemovingFolderWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        Folder MyHAClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyHAClustersFolder'\n            Location = 'MyFolder/MyClustersFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            FolderType = 'Host'\n        }\n\n        Folder MyClustersFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyClustersFolder'\n            Location = 'MyFolder'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyHAClustersFolder\"\n        }\n\n        Folder MyFolder {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            FolderType = 'Host'\n            DependsOn = \"[Folder]MyClustersFolder\"\n        }\n    }\n}\n\nFolder_WhenAddingFolderWithLocationWithTwoFolders_Config -ConfigurationData $script:configurationData\nFolder_WhenRemovingFolderWithLocationWithTwoFolders_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/VDPortGroup/VDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Datacenter 'Datacenter' in the Root Folder of the Inventory.\nCreates a new vSphere Distributed Switch 'MyVDSwitch' in the Network Folder of Datacenter 'Datacenter'.\nCreates a new Distributed Port Group 'MyVDPortGroup' on vSphere Distributed Switch 'MyVDSwitch' with\nStatic Port Binding and 128 Ports.\nCreates a new Distributed Port Group 'MyVDPortGroupViaReferenceVDPortGroup' on vSphere Distributed Switch 'MyVDSwitch'.\nThe properties of the new Distributed Port Group will be cloned from the Reference Distributed Port Group 'MyVDPortGroup'.\n#>\nConfiguration VDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter Datacenter {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'Datacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        VDPortGroup VDPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            NumPorts = 128\n            Notes = 'MyVDPortGroup Notes'\n            PortBinding = 'Static'\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n\n        VDPortGroup VDPortGroupViaReferenceVDPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyVDPortGroupViaReferenceVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            ReferenceVDPortGroupName = 'MyVDPortGroup'\n            DependsOn = '[VDPortGroup]VDPortGroup'\n        }\n    }\n}\n\nVDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/VDPortGroup/VDPortGroup_CreateVDPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Datacenter 'Datacenter' in the Root Folder of the Inventory.\nCreates a new vSphere Distributed Switch 'MyVDSwitch' in the Network Folder of Datacenter 'Datacenter'.\nCreates a new Distributed Port Group 'MyVDPortGroup' on vSphere Distributed Switch 'MyVDSwitch' with\nStatic Port Binding, 128 Ports and VLAN ID 1.\n#>\nConfiguration VDPortGroup_CreateVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter Datacenter {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'Datacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        VDPortGroup VDPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Present'\n            NumPorts = 128\n            Notes = 'MyVDPortGroup Notes'\n            PortBinding = 'Static'\n            VLanId = 1\n            DependsOn = '[VDSwitch]VDSwitch'\n        }\n    }\n}\n\nVDPortGroup_CreateVDPortGroup_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/VDPortGroup/VDPortGroup_RemoveVDPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves Distributed Port Group 'MyVDPortGroup' on vSphere Distributed Switch 'MyVDSwitch'.\n#>\nConfiguration VDPortGroup_RemoveVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup VDPortGroup {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyVDPortGroup'\n            VdsName = 'MyVDSwitch'\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVDPortGroup_RemoveVDPortGroup_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/VDSwitch_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\nConfiguration VDSwitch_WhenAddingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ContactDetails = 'My Contact Details'\n            ContactName = 'My Contact Name'\n            LinkDiscoveryProtocol = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Advertise'\n            MaxPorts = 100\n            Mtu = 2000\n            Notes = 'My Notes for Distributed Switch'\n            NumUplinkPorts = 10\n            Version = '6.6.0'\n        }\n    }\n}\n\nConfiguration VDSwitch_WhenAddingDistributedSwitchViaReferenceVDSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ContactDetails = 'My Contact Details'\n            ContactName = 'My Contact Name'\n            LinkDiscoveryProtocol = 'CDP'\n            LinkDiscoveryProtocolOperation = 'Advertise'\n            MaxPorts = 100\n            Mtu = 2000\n            Notes = 'My Notes for Distributed Switch'\n            NumUplinkPorts = 10\n            Version = '6.6.0'\n        }\n\n        VDSwitch VDSwitchViaReferenceVDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDistributedSwitchViaReferenceVDSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            ReferenceVDSwitchName = 'MyDistributedSwitch'\n            WithoutPortGroups = $true\n            DependsOn = \"[VDSwitch]VDSwitch\"\n        }\n    }\n}\n\nConfiguration VDSwitch_WhenRemovingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch VDSwitch {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDistributedSwitch'\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n        }\n    }\n}\n\nVDSwitch_WhenAddingDistributedSwitch_Config -ConfigurationData $script:configurationData\nVDSwitch_WhenAddingDistributedSwitchViaReferenceVDSwitch_Config -ConfigurationData $script:configurationData\nVDSwitch_WhenRemovingDistributedSwitch_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/vCenterSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration vCenterSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $Credential\n            LoggingLevel = 'Warning'\n            EventMaxAgeEnabled = $false\n            EventMaxAge = 40\n            TaskMaxAgeEnabled = $false\n            TaskMaxAge = 40\n            Motd = 'Hello World from motd!'\n            Issue = 'Hello World from issue!'\n        }\n    }\n}\n\nvCenterSettings_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/vCenterStatistics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration vCenterStatistics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        vCenterStatistics vCenterStatistics {\n            Server = $Server\n            Credential = $Credential\n            Period = \"Day\"\n            Level = 2\n            Enabled = $true\n            IntervalMinutes = 3\n            PeriodLength = 3\n        }\n    }\n}\n\nvCenterStatistics_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/vCenterVMHost/vCenterVMHost_AddVMHostTovCenterAndImportResourcePoolHierarchy_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostUser,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostPassword\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$VMHostCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $VMHostUser, (ConvertTo-SecureString -String $VMHostPassword -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VMHostCredential = $VMHostCredential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\n1. Creates Datacenter 'MyDatacenter' in the Root Folder of the specified Inventory.\n2. Creates Folder 'MyFolder' in the Host Folder of Datacenter 'MyDatacenter'.\n3. Creates Cluster 'MyCluster' located in Folder 'MyFolder' in Datacenter 'MyDatacenter' and enables Drs.\n4. Adds the specified VMHost to Cluster 'MyCluster'. The port for connecting to the VMHost is specified to be '443'.\n   'Force' is used to ignore the invalid SSL certificate of the VMHost.\n   The VMHost's Root Resource Pool becomes the Resource Pool 'Resources' that is the Root Resource Pool of Cluster 'MyCluster'\n   and the VMHost Resource Pool hierarchy is imported into the new nested Resource Pool.\n#>\nConfiguration vCenterVMHost_AddVMHostTovCenterAndImportResourcePoolHierarchy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter Datacenter {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        Folder Folder {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        Cluster Cluster {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyCluster'\n            Location = 'MyFolder'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DrsEnabled = $true\n            DependsOn = '[Folder]Folder'\n        }\n\n        vCenterVMHost vCenterVMHost {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = 'MyFolder/MyCluster'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.VMHostCredential\n            ResourcePoolLocation = '/'\n            Port = 443\n            Force = $true\n            DependsOn = '[Cluster]Cluster'\n        }\n    }\n}\n\nvCenterVMHost_AddVMHostTovCenterAndImportResourcePoolHierarchy_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/vCenterVMHost/vCenterVMHost_AddVMHostTovCenter_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostUser,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostPassword\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$VMHostCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $VMHostUser, (ConvertTo-SecureString -String $VMHostPassword -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VMHostCredential = $VMHostCredential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\n1. Creates Datacenter 'MyDatacenter' in the Root Folder of the specified Inventory.\n2. Creates Folder 'MyFolder' in the Host Folder of Datacenter 'MyDatacenter'.\n3. Creates Cluster 'MyCluster' located in Folder 'MyFolder' in Datacenter 'MyDatacenter'.\n4. Adds the specified VMHost to Cluster 'MyCluster'. The port for connecting to the VMHost is specified to be '443'.\n   'Force' is used to ignore the invalid SSL certificate of the VMHost.\n#>\nConfiguration vCenterVMHost_AddVMHostTovCenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter Datacenter {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n\n        Folder Folder {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyFolder'\n            Location = ''\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            FolderType = 'Host'\n            DependsOn = '[Datacenter]Datacenter'\n        }\n\n        Cluster Cluster {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyCluster'\n            Location = 'MyFolder'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            DependsOn = '[Folder]Folder'\n        }\n\n        vCenterVMHost vCenterVMHost {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = 'MyFolder/MyCluster'\n            DatacenterName = 'MyDatacenter'\n            DatacenterLocation = ''\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.VMHostCredential\n            Port = 443\n            Force = $true\n            DependsOn = '[Cluster]Cluster'\n        }\n    }\n}\n\nvCenterVMHost_AddVMHostTovCenter_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/PowerShell/vCenterConfigs/vCenterVMHost/vCenterVMHost_RemoveVMHostFromvCenter_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostUser,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostPassword\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$VMHostCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $VMHostUser, (ConvertTo-SecureString -String $VMHostPassword -AsPlainText -Force)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VMHostCredential = $VMHostCredential\n        }\n    )\n}\n\n<#\n.DESCRIPTION\n\nRemoves the specified VMHost located in Datacenter 'Datacenter' from the specified vCenter Server.\n#>\nConfiguration vCenterVMHost_RemoveVMHostFromvCenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost vCenterVMHost {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = ''\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = ''\n            Ensure = 'Absent'\n            VMHostCredential = $AllNodes.VMHostCredential\n        }\n    }\n}\n\nvCenterVMHost_RemoveVMHostFromvCenter_Config -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Puppet/README.md",
    "content": "# Desired State Configuration Resources for VMware Examples with Puppet\n\n## Getting Started\n## Requirements\n1. Install [Puppet Agent](https://downloads.puppetlabs.com)\n2. Install [DSC Lite Module](https://forge.puppet.com/puppetlabs/dsc_lite/readme)\n3. To apply your configuration run the following command in Powershell:\n    ```powershell\n    puppet apply <path to your config file>\n    ```\n\n## Examples\nAll shown examples are located [here](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations/Puppet).\n\n### Example 1\nUpdates the EventMaxAge Settings, TaskMaxAge Settings, Motd Setting, Issue Setting and the Logging Level of the passed vCenter.\n\n```\ndsc {'vCenter-Settings':\n  resource_name => 'vCenterSettings',\n  module => 'VMware.vSphereDSC',\n  properties => {\n    'server' => '<server>',\n    'credential' => {\n      'dsc_type' => 'MSFT_Credential',\n      'dsc_properties' => {\n        'user' => '<user>',\n        'password' => Sensitive('<password>')\n      }\n    },\n    'logginglevel' => 'Warning',\n    'eventmaxageenabled' => false,\n    'eventmaxage' => 40,\n    'taskmaxageenabled' => false,\n    'taskmaxage' => 40,\n    'motd' => 'Hello World from motd!',\n    'issue' => 'Hello World from issue!'\n  }\n}\n```\n\nFor more information on how to write your configurations with Puppet, you can refer to the documentation [here](https://forge.puppet.com/puppetlabs/dsc_lite/readme).\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Configurations/Puppet/vcenter_settings_config.pp",
    "content": "dsc {'vCenter-Settings':\n  resource_name => 'vCenterSettings',\n  module => 'VMware.vSphereDSC',\n  properties => {\n    'server' => '<server>',\n    'credential' => {\n      'dsc_type' => 'MSFT_Credential',\n      'dsc_properties' => {\n        'user' => '<user>',\n        'password' => Sensitive('<password>')\n      }\n    },\n    'logginglevel' => 'Warning',\n    'eventmaxageenabled' => false,\n    'eventmaxage' => 40,\n    'taskmaxageenabled' => false,\n    'taskmaxage' => 40,\n    'motd' => 'Hello World from motd!',\n    'issue' => 'Hello World from issue!'\n  }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Cluster/Cluster.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'Cluster.schema.psm1'\n\n# Version number of this module.\nModuleVersion = '1.0'\n\n# ID used to uniquely identify this module\nGUID = '3f15af41-f98a-4762-86b8-3272d28dffc0'\n\n# Author of this module\nAuthor = 'VMware'\n\n# Company or vendor of this module\nCompanyName = 'VMware'\n\n# Copyright statement for this module\nCopyright = '(c) 2018-2020 VMware. All rights reserved.'\n\n# Description of the functionality provided by this module\nDescription = 'Cluster DSC Composite Resource.'\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.1'\n\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Cluster/Cluster.schema.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:moduleRoot = (Get-Item -Path $PSScriptRoot).Parent.Parent.FullName\n. \"$script:moduleRoot/VMware.vSphereDSC.CompositeResourcesHelper.ps1\"\n\nConfiguration Cluster {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [AllowEmptyString()]\n        [string]\n        $Location,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $DatacenterName,\n\n        [Parameter(Mandatory = $true)]\n        [AllowEmptyString()]\n        [string]\n        $DatacenterLocation,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [ValidateSet('Present', 'Absent')]\n        [string]\n        $Ensure,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $HAEnabled,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $HAAdmissionControlEnabled,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $HAFailoverLevel,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('PowerOff', 'DoNothing', 'Shutdown', 'Unset')]\n        [string]\n        $HAIsolationResponse = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('Disabled', 'Low', 'Medium', 'High', 'Unset')]\n        [string]\n        $HARestartPriority = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $DrsEnabled,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('FullyAutomated', 'Manual', 'PartiallyAutomated', 'Disabled', 'Unset')]\n        [string]\n        $DrsAutomationLevel = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $DrsMigrationThreshold,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $DrsDistribution,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $MemoryLoadBalancing,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $CPUOverCommitment\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    # Constructs HACluster Resource Block.\n    $nullableHAClusterProperties = @{\n        HAEnabled = $HAEnabled\n        HAAdmissionControlEnabled = $HAAdmissionControlEnabled\n        HAFailoverLevel = $HAFailoverLevel\n        Server = $Server\n        Credential = $Credential\n    }\n    $haClusterProperties = @{\n        Ensure = $Ensure\n        Location = $Location\n        DatacenterName = $DatacenterName\n        DatacenterLocation = $DatacenterLocation\n        Name = $Name\n        HAIsolationResponse = $HAIsolationResponse\n        HARestartPriority = $HARestartPriority\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $haClusterProperties -NullableProperties $nullableHAClusterProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'HACluster' -Properties $haClusterProperties\n    $dscResourceBlock.Invoke($haClusterProperties)\n\n    # Constructs DrsCluster Resource Block.\n    $nullableDrsClusterProperties = @{\n        DrsEnabled = $DrsEnabled\n        DrsMigrationThreshold = $DrsMigrationThreshold\n        DrsDistribution = $DrsDistribution\n        MemoryLoadBalancing = $MemoryLoadBalancing\n        CPUOverCommitment = $CPUOverCommitment\n        Server = $Server\n        Credential = $Credential\n    }\n    $drsClusterProperties = @{\n        Ensure = $Ensure\n        Location = $Location\n        DatacenterName = $DatacenterName\n        DatacenterLocation = $DatacenterLocation\n        Name = $Name\n        DrsAutomationLevel = $DrsAutomationLevel\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $drsClusterProperties -NullableProperties $nullableDrsClusterProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'DrsCluster' -Properties $drsClusterProperties\n    $dscResourceBlock.Invoke($drsClusterProperties)\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Cluster/DrsCluster.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass DrsCluster : DatacenterInventoryBaseDSC {\n    DrsCluster() {\n        $this.InventoryItemFolderType = [FolderType]::Host\n    }\n\n    <#\n    .DESCRIPTION\n\n    Indicates that VMware DRS (Distributed Resource Scheduler) is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DrsEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies a DRS (Distributed Resource Scheduler) automation level. The valid values are FullyAutomated, Manual, PartiallyAutomated, Disabled and Unset.\n    #>\n    [DscProperty()]\n    [DrsAutomationLevel] $DrsAutomationLevel = [DrsAutomationLevel]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Threshold for generated ClusterRecommendations. DRS generates only those recommendations that are above the specified vmotionRate. Ratings vary from 1 to 5.\n    This setting applies to Manual, PartiallyAutomated, and FullyAutomated DRS Clusters.\n    #>\n    [DscProperty()]\n    [nullable[int]] $DrsMigrationThreshold\n\n    <#\n    .DESCRIPTION\n\n    For availability, distributes a more even number of virtual machines across hosts.\n    #>\n    [DscProperty()]\n    [nullable[int]] $DrsDistribution\n\n    <#\n    .DESCRIPTION\n\n    Load balance based on consumed memory of virtual machines rather than active memory.\n    This setting is recommended for clusters where host memory is not over-committed.\n    #>\n    [DscProperty()]\n    [nullable[int]] $MemoryLoadBalancing\n\n    <#\n    .DESCRIPTION\n\n    Controls CPU over-commitment in the cluster.\n    Min value is 0 and Max value is 500.\n    #>\n    [DscProperty()]\n    [nullable[int]] $CPUOverCommitment\n\n    hidden [string] $DrsEnabledConfigPropertyName = 'Enabled'\n    hidden [string] $DrsAutomationLevelConfigPropertyName = 'DefaultVmBehavior'\n    hidden [string] $DrsMigrationThresholdConfigPropertyName = 'VmotionRate'\n    hidden [string] $DrsDistributionSettingName = 'LimitVMsPerESXHostPercent'\n    hidden [string] $MemoryLoadBalancingSettingName = 'PercentIdleMBInMemDemand'\n    hidden [string] $CPUOverCommitmentSettingName = 'MaxVcpusPerClusterPct'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $this.AddCluster($clusterLocation)\n                }\n                else {\n                    $this.UpdateCluster($cluster)\n                }\n            }\n            else {\n                if ($null -ne $cluster) {\n                    $this.RemoveCluster($cluster)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateCluster($cluster)\n                }\n            }\n            else {\n                $result = ($null -eq $cluster)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [DrsCluster] Get() {\n        try {\n            $result = [DrsCluster]::new()\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $this.PopulateResult($cluster, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Cluster should be updated.\n    #>\n    [bool] ShouldUpdateCluster($cluster) {\n        $drsConfig = $cluster.ExtensionData.ConfigurationEx.DrsConfig\n\n        $currentDrsDistributionOption = ($drsConfig.Option | Where-Object -FilterScript { $_.Key -eq $this.DrsDistributionSettingName }).Value\n        $currentMemoryLoadBalancingOption = ($drsConfig.Option | Where-Object -FilterScript { $_.Key -eq $this.MemoryLoadBalancingSettingName }).Value\n        $currentCPUOverCommitmentOption = ($drsConfig.Option | Where-Object -FilterScript { $_.Key -eq $this.CPUOverCommitmentSettingName }).Value\n\n        $shouldUpdateCluster = @(\n            $this.ShouldUpdateDscResourceSetting('DrsEnabled', $drsConfig.Enabled, $this.DrsEnabled),\n            $this.ShouldUpdateDscResourceSetting('DrsAutomationLevel', [string] $drsConfig.DefaultVmBehavior, $this.DrsAutomationLevel.ToString()),\n            $this.ShouldUpdateDscResourceSetting('DrsMigrationThreshold', $drsConfig.VmotionRate, $this.DrsMigrationThreshold),\n            $this.ShouldUpdateDscResourceSetting('DrsDistribution', $currentDrsDistributionOption, $this.DrsDistribution),\n            $this.ShouldUpdateDscResourceSetting('MemoryLoadBalancing', $currentMemoryLoadBalancingOption, $this.MemoryLoadBalancing),\n            $this.ShouldUpdateDscResourceSetting('CPUOverCommitment', $currentCPUOverCommitmentOption, $this.CPUOverCommitment)\n        )\n\n        return ($shouldUpdateCluster -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the DrsConfig property with the desired value.\n    #>\n    [void] PopulateDrsConfigProperty($drsConfig, $propertyName, $propertyValue) {\n        <#\n            Special case where the passed property value is enum type. These type of properties\n            should be populated only when their value is not equal to Unset.\n            Unset means that the property was not specified in the Configuration.\n        #>\n        if ($propertyValue -is [DrsAutomationLevel]) {\n            if ($propertyValue -ne [DrsAutomationLevel]::Unset) {\n                $drsConfig.$propertyName = $propertyValue.ToString()\n            }\n        }\n        elseif ($null -ne $propertyValue) {\n            $drsConfig.$propertyName = $propertyValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Option array for the DrsConfig with the specified options in the Configuration.\n    #>\n    [PSObject] GetOptionsForDrsConfig($allOptions) {\n        $drsConfigOptions = @()\n\n        foreach ($key in $allOptions.Keys) {\n            if ($null -ne $allOptions.$key) {\n                $option = New-Object VMware.Vim.OptionValue\n\n                $option.Key = $key\n                $option.Value = $allOptions.$key.ToString()\n\n                $drsConfigOptions += $option\n            }\n        }\n\n        return $drsConfigOptions\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Cluster Spec with the specified values in the Configuration.\n    #>\n    [PSObject] GetPopulatedClusterSpec() {\n        $clusterSpec = New-Object VMware.Vim.ClusterConfigSpecEx\n        $clusterSpec.DrsConfig = New-Object VMware.Vim.ClusterDrsConfigInfo\n\n        $this.PopulateDrsConfigProperty($clusterSpec.DrsConfig, $this.DrsEnabledConfigPropertyName, $this.DrsEnabled)\n        $this.PopulateDrsConfigProperty($clusterSpec.DrsConfig, $this.DrsAutomationLevelConfigPropertyName, $this.DrsAutomationLevel)\n        $this.PopulateDrsConfigProperty($clusterSpec.DrsConfig, $this.DrsMigrationThresholdConfigPropertyName, $this.DrsMigrationThreshold)\n\n        $allOptions = [ordered] @{\n            $this.DrsDistributionSettingName = $this.DrsDistribution\n            $this.MemoryLoadBalancingSettingName = $this.MemoryLoadBalancing\n            $this.CPUOverCommitmentSettingName = $this.CPUOverCommitment\n        }\n\n        $clusterSpec.DrsConfig.Option = $this.GetOptionsForDrsConfig($allOptions)\n\n        return $clusterSpec\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Cluster with the specified properties at the specified location.\n    #>\n    [void] AddCluster($clusterLocation) {\n        $clusterSpec = $this.GetPopulatedClusterSpec()\n\n        try {\n            Add-Cluster -Folder $clusterLocation.ExtensionData -Name $this.Name -Spec $clusterSpec\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Cluster with the specified properties.\n    #>\n    [void] UpdateCluster($cluster) {\n        $clusterSpec = $this.GetPopulatedClusterSpec()\n\n        try {\n            Update-ClusterComputeResource -ClusterComputeResource $cluster.ExtensionData -Spec $clusterSpec\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Cluster from the specified Datacenter.\n    #>\n    [void] RemoveCluster($cluster) {\n        try {\n            Remove-ClusterComputeResource -ClusterComputeResource $cluster.ExtensionData\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Cluster from the server.\n    #>\n    [void] PopulateResult($cluster, $result) {\n        if ($null -ne $cluster) {\n            $drsConfig = $cluster.ExtensionData.ConfigurationEx.DrsConfig\n\n            $result.Name = $cluster.Name\n            $result.Ensure = [Ensure]::Present\n            $result.DrsEnabled = $drsConfig.Enabled\n\n            if ($null -eq $drsConfig.DefaultVmBehavior) {\n                $result.DrsAutomationLevel = [DrsAutomationLevel]::Unset\n            }\n            else {\n                $result.DrsAutomationLevel = $drsConfig.DefaultVmBehavior.ToString()\n            }\n\n            $result.DrsMigrationThreshold = $drsConfig.VmotionRate\n\n            if ($null -ne $drsConfig.Option) {\n                $options = $drsConfig.Option\n\n                $result.DrsDistribution = ($options | Where-Object { $_.Key -eq $this.DrsDistributionSettingName }).Value\n                $result.MemoryLoadBalancing = ($options | Where-Object { $_.Key -eq $this.MemoryLoadBalancingSettingName }).Value\n                $result.CPUOverCommitment = ($options | Where-Object { $_.Key -eq $this.CPUOverCommitmentSettingName }).Value\n            }\n            else {\n                $result.DrsDistribution = $null\n                $result.MemoryLoadBalancing = $null\n                $result.CPUOverCommitment = $null\n            }\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.DrsEnabled = $this.DrsEnabled\n            $result.DrsAutomationLevel = $this.DrsAutomationLevel\n            $result.DrsMigrationThreshold = $this.DrsMigrationThreshold\n            $result.DrsDistribution = $this.DrsDistribution\n            $result.MemoryLoadBalancing = $this.MemoryLoadBalancing\n            $result.CPUOverCommitment = $this.CPUOverCommitment\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Cluster/HACluster.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass HACluster : DatacenterInventoryBaseDSC {\n    HACluster() {\n        $this.InventoryItemFolderType = [FolderType]::Host\n    }\n\n    <#\n    .DESCRIPTION\n\n    Indicates that VMware HA (High Availability) is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HAEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that virtual machines cannot be powered on if they violate availability constraints.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HAAdmissionControlEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies a configured failover level.\n    This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines.\n    The valid values range from 1 to 4.\n    #>\n    [DscProperty()]\n    [nullable[int]] $HAFailoverLevel\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource.\n    The valid values are PowerOff, DoNothing, Shutdown and Unset.\n    #>\n    [DscProperty()]\n    [HAIsolationResponse] $HAIsolationResponse = [HAIsolationResponse]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the cluster HA restart priority. The valid values are Disabled, Low, Medium, High and Unset.\n    VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts.\n    #>\n    [DscProperty()]\n    [HARestartPriority] $HARestartPriority = [HARestartPriority]::Unset\n\n    hidden [string] $HAEnabledParameterName = 'HAEnabled'\n    hidden [string] $HAAdmissionControlEnabledParameterName = 'HAAdmissionControlEnabled'\n    hidden [string] $HAFailoverLevelParameterName = 'HAFailoverLevel'\n    hidden [string] $HAIsolationResponseParameterName = 'HAIsolationResponse'\n    hidden [string] $HARestartPriorityParemeterName = 'HARestartPriority'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $this.AddCluster($clusterLocation)\n                }\n                else {\n                    $this.UpdateCluster($cluster)\n                }\n            }\n            else {\n                if ($null -ne $cluster) {\n                    $this.RemoveCluster($cluster)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateCluster($cluster)\n                }\n            }\n            else {\n                $result = ($null -eq $cluster)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [HACluster] Get() {\n        try {\n            $result = [HACluster]::new()\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $this.PopulateResult($cluster, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Cluster should be updated.\n    #>\n    [bool] ShouldUpdateCluster($cluster) {\n        $shouldUpdateCluster = @(\n            $this.ShouldUpdateDscResourceSetting('HAEnabled', $cluster.HAEnabled, $this.HAEnabled),\n            $this.ShouldUpdateDscResourceSetting('HAAdmissionControlEnabled', $cluster.HAAdmissionControlEnabled, $this.HAAdmissionControlEnabled),\n            $this.ShouldUpdateDscResourceSetting('HAFailoverLevel', $cluster.HAFailoverLevel, $this.HAFailoverLevel),\n            $this.ShouldUpdateDscResourceSetting('HAIsolationResponse', [string] $cluster.HAIsolationResponse, $this.HAIsolationResponse.ToString()),\n            $this.ShouldUpdateDscResourceSetting('HARestartPriority', [string] $cluster.HARestartPriority, $this.HARestartPriority.ToString())\n        )\n\n        return ($shouldUpdateCluster -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the parameters for the New-Cluster and Set-Cluster cmdlets.\n    #>\n    [void] PopulateClusterParams($clusterParams, $parameter, $desiredValue) {\n        <#\n            Special case where the desired value is enum type. These type of properties\n            should be added as parameters to the cmdlet only when their value is not equal to Unset.\n            Unset means that the property was not specified in the Configuration.\n        #>\n        if ($desiredValue -is [HAIsolationResponse] -or $desiredValue -is [HARestartPriority]) {\n            if ($desiredValue -ne 'Unset') {\n                $clusterParams.$parameter = $desiredValue.ToString()\n            }\n\n            return\n        }\n\n        if ($null -ne $desiredValue) {\n            $clusterParams.$parameter = $desiredValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Cluster parameters.\n    #>\n    [hashtable] GetClusterParams() {\n        $clusterParams = @{}\n\n        $clusterParams.Server = $this.Connection\n        $clusterParams.Confirm = $false\n        $clusterParams.ErrorAction = 'Stop'\n\n        $this.PopulateClusterParams($clusterParams, $this.HAEnabledParameterName, $this.HAEnabled)\n\n        # High Availability settings cannot be passed to the cmdlets if 'HAEnabled' is $false.\n        if ($null -eq $this.HAEnabled -or $this.HAEnabled) {\n            $this.PopulateClusterParams($clusterParams, $this.HAAdmissionControlEnabledParameterName, $this.HAAdmissionControlEnabled)\n            $this.PopulateClusterParams($clusterParams, $this.HAFailoverLevelParameterName, $this.HAFailoverLevel)\n            $this.PopulateClusterParams($clusterParams, $this.HAIsolationResponseParameterName, $this.HAIsolationResponse)\n            $this.PopulateClusterParams($clusterParams, $this.HARestartPriorityParemeterName, $this.HARestartPriority)\n        }\n\n        return $clusterParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Cluster with the specified properties at the specified location.\n    #>\n    [void] AddCluster($clusterLocation) {\n        $clusterParams = $this.GetClusterParams()\n        $clusterParams.Name = $this.Name\n        $clusterParams.Location = $clusterLocation\n\n        try {\n            New-Cluster @clusterParams\n        }\n        catch {\n            throw \"Cannot create Cluster $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Cluster with the specified properties.\n    #>\n    [void] UpdateCluster($cluster) {\n        $clusterParams = $this.GetClusterParams()\n\n        try {\n            $cluster | Set-Cluster @clusterParams\n        }\n        catch {\n            throw \"Cannot update Cluster $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Cluster from the specified Datacenter.\n    #>\n    [void] RemoveCluster($cluster) {\n        try {\n            $cluster | Remove-Cluster -Server $this.Connection -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw \"Cannot remove Cluster $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Cluster from the server.\n    #>\n    [void] PopulateResult($cluster, $result) {\n        if ($null -ne $cluster) {\n            $result.Name = $cluster.Name\n            $result.Ensure = [Ensure]::Present\n            $result.HAEnabled = $cluster.HAEnabled\n            $result.HAAdmissionControlEnabled = $cluster.HAAdmissionControlEnabled\n            $result.HAFailoverLevel = $cluster.HAFailoverLevel\n            $result.HAIsolationResponse = $cluster.HAIsolationResponse.ToString()\n            $result.HARestartPriority = $cluster.HARestartPriority.ToString()\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.HAEnabled = $this.HAEnabled\n            $result.HAAdmissionControlEnabled = $this.HAAdmissionControlEnabled\n            $result.HAFailoverLevel = $this.HAFailoverLevel\n            $result.HAIsolationResponse = $this.HAIsolationResponse\n            $result.HARestartPriority = $this.HARestartPriority\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/DRSRule.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass DRSRule : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the DRS rule.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datacenter where the Cluster, for which the DRS rule applies, is located.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Datacenter where the Cluster, for which the DRS rule applies, is located.\n    The Root Folder of the Inventory is not part of the location.\n    Empty location means that the Datacenter is located in the Root Folder of the Inventory.\n    The Folder names in the location are separated by '/'.\n    Example Datacenter location: 'MyDatacentersFolderOne/MyDatacentersFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Cluster for which the DRS rule applies.\n    #>\n    [DscProperty(Key)]\n    [string] $ClusterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Cluster, for which the DRS rule applies, located in the\n    Datacenter specified in 'DatacenterName' key property.\n    The Root Folders of the Datacenter are not part of the location.\n    Empty location means that the Cluster is located in the Host Folder of the Datacenter.\n    The Folder names in the location are separated by '/'.\n    Example Cluster location: 'MyClusterFolderOne/MyClusterFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $ClusterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the DRS rule - affinity or anti-affinity.\n    #>\n    [DscProperty(Key)]\n    [DRSRuleType] $DRSRuleType\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the virtual machines that are referenced by the DRS rule.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $VMNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the DRS rule should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the DRS rule is enabled or disabled for the specified Cluster.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the instance of the 'InventoryUtil' class that is used\n    for Inventory operations.\n    #>\n    hidden [InventoryUtil] $InventoryUtil\n\n    hidden [string] $CreateDrsRuleMessage = \"Creating DRS Rule {0} for Cluster {1}.\"\n    hidden [string] $ModifyDrsRuleMessage = \"Modifying DRS rule {0} for Cluster {1}.\"\n    hidden [string] $RemoveDrsRuleMessage = \"Removing DRS rule {0} for Cluster {1}.\"\n\n    hidden [string] $InvalidVMCountMessage = \"At least 2 Virtual Machines should be specified.\"\n\n    hidden [string] $CouldNotFindVMMessage = \"Could not find Virtual Machine {0} in Cluster {1}.\"\n    hidden [string] $CouldNotCreateDrsRuleMessage = \"Could not create DRS rule {0} for Cluster {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyDrsRuleMessage = \"Could not modify DRS rule {0} for Cluster {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveDrsRuleMessage = \"Could not remove DRS rule {0} for Cluster {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterHostFolderName = [FolderType]::Host.ToString() + 'Folder'\n            $cluster = $this.InventoryUtil.GetInventoryItem(\n                $this.ClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.ClusterLocation,\n                    $datacenter,\n                    $datacenterHostFolderName\n                )\n            )\n\n            $drsRule = $this.GetDrsRule($cluster)\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $virtualMachines = $this.GetVirtualMachines($cluster)\n                if ($null -eq $drsRule) {\n                    $this.NewDrsRule($cluster, $virtualMachines)\n                }\n                else {\n                    $this.ModifyDrsRule($drsRule, $virtualMachines)\n                }\n            }\n            else {\n                if ($null -ne $drsRule) {\n                    $this.RemoveDrsRule($drsRule)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterHostFolderName = [FolderType]::Host.ToString() + 'Folder'\n            $cluster = $this.InventoryUtil.GetInventoryItem(\n                $this.ClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.ClusterLocation,\n                    $datacenter,\n                    $datacenterHostFolderName\n                )\n            )\n\n            $drsRule = $this.GetDrsRule($cluster)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $drsRule) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDrsRule($drsRule)\n                }\n            }\n            else {\n                $result = ($null -eq $drsRule)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [DRSRule] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [DRSRule]::new()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterHostFolderName = [FolderType]::Host.ToString() + 'Folder'\n            $cluster = $this.InventoryUtil.GetInventoryItem(\n                $this.ClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.ClusterLocation,\n                    $datacenter,\n                    $datacenterHostFolderName\n                )\n            )\n\n            $drsRule = $this.GetDrsRule($cluster)\n\n            $result.DatacenterName = $datacenter.Name\n            $result.ClusterName = $cluster.Name\n            $this.PopulateResult($result, $drsRule)\n\n            return $result\n        }\n        finally {            \n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Initializes an instance of the 'InventoryUtil' class.\n    #>\n    [void] InitInventoryUtil() {\n        if ($null -eq $this.InventoryUtil) {\n            $this.InventoryUtil = [InventoryUtil]::new($this.Connection, $this.Ensure)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the DRS Rule with the speciifed name located in the specified Cluster.\n    #>\n    [PSObject] GetDrsRule($cluster) {\n        $getDrsRuleParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Cluster = $cluster\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-DrsRule @getDrsRuleParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Machines with the specified names located in the specified Cluster.\n    #>\n    [array] GetVirtualMachines($cluster) {\n        $result = @()\n        if ($this.VMNames.Length -gt 0) {\n            $getVMParams = @{\n                Server = $this.Connection\n                Name = $this.VMNames\n                Location = $cluster\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $result = Get-VM @getVMParams\n        }\n\n        if ($result.Length -lt 2) {\n            throw $this.InvalidVMCountMessage\n        }\n\n        if ($this.VMNames.Length -gt $result.Length) {\n            $notFoundVMNames = $this.VMNames | Where-Object -FilterScript { $result.Name -NotContains $_ }\n            foreach ($notFoundVMName in $notFoundVMNames) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindVMMessage, @($notFoundVMName, $cluster.Name))\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the names of the Virtual Machines with the specified Ids.\n    #>\n    [string[]] GetVirtualMachineNames($vmIds) {\n        $getVMParams = @{\n            Server = $this.Connection\n            Id = $vmIds\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-VM @getVMParams | Select-Object -ExpandProperty Name\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified DRS rule should be modified.\n    #>\n    [bool] ShouldModifyDrsRule($drsRule) {\n        $shouldModifyDrsRule = @(\n            $this.ShouldUpdateDscResourceSetting('Enabled', $drsRule.Enabled, $this.Enabled),\n            $this.ShouldUpdateArraySetting('VMNames', $this.GetVirtualMachineNames($drsRule.VMIds), $this.VMNames)\n        )\n\n        return ($shouldModifyDrsRule -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new DRS rule with the specified name for the specified Cluster.\n    #>\n    [void] NewDrsRule($cluster, $virtualMachines) {\n        $newDrsRuleParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Cluster = $cluster\n            KeepTogether = ($this.DRSRuleType -eq [DRSRuleType]::VMAffinity)\n            VM = $virtualMachines\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Enabled) { $newDrsRuleParams.Enabled = $this.Enabled }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateDrsRuleMessage, @($this.Name, $cluster.Name))\n\n            New-DrsRule @newDrsRuleParams\n        }\n        catch {\n            throw ($this.CouldNotCreateDrsRuleMessage -f $this.Name, $cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the specified DRS rule.\n    #>\n    [void] ModifyDrsRule($drsRule, $virtualMachines) {\n        $setDrsRuleParams = @{\n            Server = $this.Connection\n            Rule = $drsRule\n            VM = $virtualMachines\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Enabled) { $setDrsRuleParams.Enabled = $this.Enabled }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyDrsRuleMessage, @($drsRule.Name, $drsRule.Cluster.Name))\n\n            Set-DrsRule @setDrsRuleParams\n        }\n        catch {\n            throw ($this.CouldNotModifyDrsRuleMessage -f $drsRule.Name, $drsRule.Cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified DRS rule.\n    #>\n    [void] RemoveDrsRule($drsRule) {\n        $removeDrsRuleParams = @{\n            Rule = $drsRule\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveDrsRuleMessage, @($drsRule.Name, $drsRule.Cluster.Name))\n\n            Remove-DrsRule @removeDrsRuleParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveDrsRuleMessage -f $drsRule.Name, $drsRule.Cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $drsRule) {\n        $result.Server = $this.Server\n        $result.DatacenterLocation = $this.DatacenterLocation\n        $result.ClusterLocation = $this.ClusterLocation\n\n        if ($null -ne $drsRule) {\n            $result.Name = $drsRule.Name\n            $result.DRSRuleType = [string] $drsRule.Type\n            $result.VMNames = $this.GetVirtualMachineNames($drsRule.VMIds)\n            $result.Ensure = [Ensure]::Present\n            $result.Enabled = $drsRule.Enabled\n        }\n        else {\n            $result.Name = $this.Name\n            $result.DRSRuleType = $this.DRSRuleType\n            $result.VMNames = $this.VMNames\n            $result.Ensure = [Ensure]::Absent\n            $result.Enabled = $this.Enabled\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Datacenter.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass Datacenter : InventoryBaseDSC {\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterLocation = $this.GetInventoryItemLocation()\n            $datacenter = $this.GetDatacenter($datacenterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datacenter) {\n                    $this.AddDatacenter($datacenterLocation)\n                }\n            }\n            else {\n                if ($null -ne $datacenter) {\n                    $this.RemoveDatacenter($datacenter)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterLocation = $this.GetInventoryItemLocation()\n            $datacenter = $this.GetDatacenter($datacenterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                return ($null -ne $datacenter)\n            }\n            else {\n                return ($null -eq $datacenter)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [Datacenter] Get() {\n        try {\n            $result = [Datacenter]::new()\n\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n\n            $this.ConnectVIServer()\n\n            $datacenterLocation = $this.GetInventoryItemLocation()\n            $datacenter = $this.GetDatacenter($datacenterLocation)\n\n            $this.PopulateResult($datacenter, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Datacenter from the specified Location if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetDatacenter($datacenterLocation) {\n        <#\n        The client side filtering here is used so we can retrieve only the Datacenter which is located directly below the found Folder Location\n        because Get-Datacenter searches recursively and can return more than one Datacenter located below the found Folder Location.\n        #>\n        return Get-Datacenter -Server $this.Connection -Name $this.Name -Location $datacenterLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $datacenterLocation.Id }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datacenter with the specified properties at the specified Location.\n    #>\n    [void] AddDatacenter($datacenterLocation) {\n        $datacenterParams = @{}\n\n        $datacenterParams.Server = $this.Connection\n        $datacenterParams.Name = $this.Name\n        $datacenterParams.Location = $datacenterLocation\n        $datacenterParams.Confirm = $false\n        $datacenterParams.ErrorAction = 'Stop'\n\n        try {\n            New-Datacenter @datacenterParams\n        }\n        catch {\n            throw \"Cannot create Datacenter $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Datacenter from the specified Location.\n    #>\n    [void] RemoveDatacenter($datacenter) {\n        $datacenterParams = @{}\n\n        $datacenterParams.Server = $this.Connection\n        $datacenterParams.Confirm = $false\n        $datacenterParams.ErrorAction = 'Stop'\n\n        try {\n            $datacenter | Remove-Datacenter @datacenterParams\n        }\n        catch {\n            throw \"Cannot remove Datacenter $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Datacenter from the server.\n    #>\n    [void] PopulateResult($datacenter, $result) {\n        if ($null -ne $datacenter) {\n            $result.Name = $datacenter.Name\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/DatacenterFolder.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass DatacenterFolder : InventoryBaseDSC {\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterFolderLocation = $this.GetInventoryItemLocation()\n            $datacenterFolder = $this.GetDatacenterFolder($datacenterFolderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datacenterFolder) {\n                    $this.AddDatacenterFolder($datacenterFolderLocation)\n                }\n            }\n            else {\n                if ($null -ne $datacenterFolder) {\n                    $this.RemoveDatacenterFolder($datacenterFolder)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterFolderLocation = $this.GetInventoryItemLocation()\n            $datacenterFolder = $this.GetDatacenterFolder($datacenterFolderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                return ($null -ne $datacenterFolder)\n            }\n            else {\n                return ($null -eq $datacenterFolder)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [DatacenterFolder] Get() {\n        try {\n            $result = [DatacenterFolder]::new()\n\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n\n            $this.ConnectVIServer()\n\n            $datacenterFolderLocation = $this.GetInventoryItemLocation()\n            $datacenterFolder = $this.GetDatacenterFolder($datacenterFolderLocation)\n\n            $this.PopulateResult($datacenterFolder, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Datacenter Folder from the specified Location if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetDatacenterFolder($datacenterFolderLocation) {\n        <#\n        The client side filtering here is used so we can retrieve only the Folder which is located directly below the found Folder Location\n        because Get-Folder searches recursively and can return more than one Folder located below the found Folder Location.\n        #>\n        return Get-Folder -Server $this.Connection -Name $this.Name -Location $datacenterFolderLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $datacenterFolderLocation.Id }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datacenter Folder with the specified properties at the specified Location.\n    #>\n    [void] AddDatacenterFolder($datacenterFolderLocation) {\n        $datacenterFolderParams = @{}\n\n        $datacenterFolderParams.Server = $this.Connection\n        $datacenterFolderParams.Name = $this.Name\n        $datacenterFolderParams.Location = $datacenterFolderLocation\n        $datacenterFolderParams.Confirm = $false\n        $datacenterFolderParams.ErrorAction = 'Stop'\n\n        try {\n            New-Folder @datacenterFolderParams\n        }\n        catch {\n            throw \"Cannot create Datacenter Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Datacenter Folder from the specified Location.\n    #>\n    [void] RemoveDatacenterFolder($datacenterFolder) {\n        $datacenterFolderParams = @{}\n\n        $datacenterFolderParams.Server = $this.Connection\n        $datacenterFolderParams.Confirm = $false\n        $datacenterFolderParams.ErrorAction = 'Stop'\n\n        try {\n            $datacenterFolder | Remove-Folder @datacenterFolderParams\n        }\n        catch {\n            throw \"Cannot remove Datacenter Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Datacenter Folder from the server.\n    #>\n    [void] PopulateResult($datacenterFolder, $result) {\n        if ($null -ne $datacenterFolder) {\n            $result.Name = $datacenterFolder.Name\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Datastore/NfsDatastore.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass NfsDatastore : DatastoreBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Nfs Host for the Datastore.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $NfsHost\n\n    <#\n    .DESCRIPTION\n\n    Specifies the access mode for the Nfs Datastore. Valid access modes are 'ReadWrite' and 'ReadOnly'.\n    The default access mode is 'ReadWrite'.\n    #>\n    [DscProperty()]\n    [AccessMode] $AccessMode = [AccessMode]::ReadWrite\n\n    <#\n    .DESCRIPTION\n\n    Specifies the authentication method for the Nfs Datastore. Valid authentication methods are 'AUTH_SYS' and 'Kerberos'.\n    The default authentication method is 'AUTH_SYS'.\n    #>\n    [DscProperty()]\n    [AuthenticationMethod] $AuthenticationMethod = [AuthenticationMethod]::AUTH_SYS\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $datastore = $this.NewNfsDatastore()\n                }\n\n                if ($this.ShouldModifyDatastore($datastore)) {\n                    $this.ModifyDatastore($datastore)\n                }\n            }\n            else {\n                if ($null -ne $datastore) {\n                    $this.RemoveDatastore($datastore)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDatastore($datastore)\n                }\n            }\n            else {\n                $result = ($null -eq $datastore)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [NfsDatastore] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [NfsDatastore]::new()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.PopulateResultForNfsDatastore($result, $datastore)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Nfs Datastore with the specified name on the VMHost.\n    #>\n    [PSObject] NewNfsDatastore() {\n        $newDatastoreParams = @{\n            Nfs = $true\n            NfsHost = $this.NfsHost\n        }\n\n        if ($this.AccessMode -eq [AccessMode]::ReadOnly) { $newDatastoreParams.ReadOnly = $true }\n        if ($this.AuthenticationMethod -eq [AuthenticationMethod]::Kerberos) { $newDatastoreParams.Kerberos = $true }\n\n        return $this.NewDatastore($newDatastoreParams)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResultForNfsDatastore($result, $datastore) {\n        if ($null -ne $datastore) {\n            $result.NfsHost = $datastore.RemoteHost\n            $result.Path = $datastore.RemotePath\n            $result.AccessMode = [AccessMode] $datastore.ExtensionData.Host.MountInfo.AccessMode\n            $result.AuthenticationMethod = $datastore.AuthenticationMethod.ToString()\n        }\n        else {\n            $result.NfsHost = $this.NfsHost\n            $result.Path = $this.Path\n            $result.AccessMode = $this.AccessMode\n            $result.AuthenticationMethod = $this.AuthenticationMethod\n        }\n\n        $this.PopulateResult($result, $datastore)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Datastore/VmfsDatastore.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VmfsDatastore : DatastoreBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum file size of Vmfs in megabytes (MB). If no value is specified, the maximum file size for the current system platform is used.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BlockSizeMB\n\n    hidden [string] $CouldNotCreateVmfsDatastoreWithTheSpecifiedNameMessage = \"Could not create Vmfs Datastore {0} on VMHost {1} because there is another Vmfs Datastore with the same name on vCenter Server {2}.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.ValidateVmfsDatastoreCreation($datastore)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $datastore = $this.NewVmfsDatastore()\n                }\n\n                if ($this.ShouldModifyDatastore($datastore)) {\n                    $this.ModifyDatastore($datastore)\n                }\n            }\n            else {\n                if ($null -ne $datastore) {\n                    $this.RemoveDatastore($datastore)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.ValidateVmfsDatastoreCreation($datastore)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDatastore($datastore)\n                }\n            }\n            else {\n                $result = ($null -eq $datastore)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VmfsDatastore] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VmfsDatastore]::new()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.ValidateVmfsDatastoreCreation($datastore)\n\n            $this.PopulateResultForVmfsDatastore($result, $datastore)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if a Vmfs Datastore with the specified name can be created on the vCenter Server.\n    #>\n    [void] ValidateVmfsDatastoreCreation($datastore) {\n        <#\n            If the established connection is to a vCenter Server, Ensure is 'Present' and the Vmfs Datastore does not exist on the specified VMHost,\n            we need to check if there is a Vmfs Datastore with the same name on the vCenter Server.\n        #>\n        if ($this.Connection.ProductLine -eq $this.vCenterProductId -and $this.Ensure -eq [Ensure]::Present -and $null -eq $datastore) {\n            $getDatastoreParams = @{\n                Server = $this.Connection\n                Name = $this.Name\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            <#\n                If there is another Vmfs Datastore with the same name on the vCenter Server but on a different VMHost, we need to inform the user that\n                the Vmfs Datastore cannot be created with the specified name. vCenter Server accepts multiple Vmfs Datastore creations with the same name\n                but changes the names internally to avoid name duplication. vCenter Server appends '(<index>)' to the Vmfs Datastore name.\n            #>\n            $datastoreInvCenter = Get-Datastore @getDatastoreParams\n            if ($null -ne $datastoreInvCenter) {\n                throw ($this.CouldNotCreateVmfsDatastoreWithTheSpecifiedNameMessage -f $this.Name, $this.VMHost.Name, $this.Connection.Name)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Vmfs Datastore with the specified name on the VMHost.\n    #>\n    [PSObject] NewVmfsDatastore() {\n        $newDatastoreParams = @{\n            Vmfs = $true\n        }\n\n        if ($null -ne $this.BlockSizeMB) { $newDatastoreParams.BlockSizeMB = $this.BlockSizeMB }\n\n        return $this.NewDatastore($newDatastoreParams)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResultForVmfsDatastore($result, $datastore) {\n        if ($null -ne $datastore) {\n            $result.BlockSizeMB = $datastore.ExtensionData.Info.Vmfs.BlockSizeMB\n            $result.Path = $datastore.ExtensionData.Info.Vmfs.Extent | Where-Object -FilterScript { $_.DiskName -eq $this.Path } | Select-Object -ExpandProperty DiskName\n        }\n        else {\n            $result.BlockSizeMB = $this.BlockSizeMB\n            $result.Path = $this.Path\n        }\n\n        $this.PopulateResult($result, $datastore)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/DatastoreCluster.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass DatastoreCluster : DatacenterInventoryBaseDSC {\n    DatastoreCluster() {\n        $this.InventoryItemFolderType = [FolderType]::Datastore\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum I/O latency in milliseconds allowed before Storage DRS is triggered for the Datastore Cluster.\n    Valid values are in the range of 5 to 100. If the value of IOLoadBalancing is $false, the setting for the I/O latency threshold is not applied.\n    #>\n    [DscProperty()]\n    [nullable[int]] $IOLatencyThresholdMillisecond\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether I/O load balancing is enabled for the Datastore Cluster. If the value is $false, I/O load balancing is disabled\n    and the settings for the I/O latency threshold and utilized space threshold are not applied.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IOLoadBalanceEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Storage DRS automation level for the Datastore Cluster. Valid values are Disabled, Manual and FullyAutomated.\n    #>\n    [DscProperty()]\n    [DrsAutomationLevel] $SdrsAutomationLevel = [DrsAutomationLevel]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum percentage of consumed space allowed before Storage DRS is triggered for the Datastore Cluster.\n    Valid values are in the range of 50 to 100. If the value of IOLoadBalancing is $false, the setting for the utilized space threshold is not applied.\n    #>\n    [DscProperty()]\n    [nullable[int]] $SpaceUtilizationThresholdPercent\n\n    hidden [string] $CreateDatastoreClusterMessage = \"Creating Datastore Cluster {0} in Folder {1}.\"\n    hidden [string] $ModifyDatastoreClusterMessage = \"Modifying Datastore Cluster {0} configuration.\"\n    hidden [string] $RemoveDatastoreClusterMessage = \"Removing Datastore Cluster {0}.\"\n\n    hidden [string] $CouldNotCreateDatastoreClusterMessage = \"Could not create Datastore Cluster {0} in Folder {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyDatastoreClusterMessage = \"Could not modify Datastore Cluster {0} configuration. For more information: {1}\"\n    hidden [string] $CouldNotRemoveDatastoreClusterMessage = \"Could not remove Datastore Cluster {0}. For more information: {1}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $datastoreClusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n            $datastoreCluster = $this.GetDatastoreCluster($datastoreClusterLocation)\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastoreCluster) {\n                    $datastoreCluster = $this.NewDatastoreCluster($datastoreClusterLocation)\n                }\n\n                if ($this.ShouldModifyDatastoreCluster($datastoreCluster)) {\n                    $this.ModifyDatastoreCluster($datastoreCluster)\n                }\n            }\n            else {\n                if ($null -ne $datastoreCluster) {\n                    $this.RemoveDatastoreCluster($datastoreCluster)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $datastoreClusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n            $datastoreCluster = $this.GetDatastoreCluster($datastoreClusterLocation)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastoreCluster) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDatastoreCluster($datastoreCluster)\n                }\n            }\n            else {\n                $result = ($null -eq $datastoreCluster)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [DatastoreCluster] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [DatastoreCluster]::new()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $datastoreClusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n            $datastoreCluster = $this.GetDatastoreCluster($datastoreClusterLocation)\n            $this.PopulateResult($result, $datastoreCluster)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore Cluster with the specified name located in the specified Folder if it exists.\n    #>\n    [PSObject] GetDatastoreCluster($datastoreClusterLocation) {\n        $getDatastoreClusterParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Location = $datastoreClusterLocation\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ExtensionData.Parent -eq $datastoreClusterLocation.ExtensionData.MoRef\n            }\n        }\n\n        <#\n            Multiple Datastore Clusters with the same name can be present in a Datacenter. So we need to filter\n            by the direct Parent Folder of the Datastore Cluster to retrieve the desired one.\n        #>\n        return Get-DatastoreCluster @getDatastoreClusterParams | Where-Object @whereObjectParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified Datastore Cluster configuration should be modified.\n    #>\n    [bool] ShouldModifyDatastoreCluster($datastoreCluster) {\n        $shouldModifyDatastoreCluster = @(\n            $this.ShouldUpdateDscResourceSetting(\n                'IOLatencyThresholdMillisecond',\n                $datastoreCluster.IOLatencyThresholdMillisecond,\n                $this.IOLatencyThresholdMillisecond\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'IOLoadBalanceEnabled',\n                $datastoreCluster.IOLoadBalanceEnabled,\n                $this.IOLoadBalanceEnabled\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'SdrsAutomationLevel',\n                [string] $datastoreCluster.SdrsAutomationLevel,\n                $this.SdrsAutomationLevel.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'SpaceUtilizationThresholdPercent',\n                $datastoreCluster.SpaceUtilizationThresholdPercent,\n                $this.SpaceUtilizationThresholdPercent\n            )\n        )\n\n        return ($shouldModifyDatastoreCluster -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datastore Cluster with the specified name located in the specified Folder.\n    #>\n    [PSObject] NewDatastoreCluster($datastoreClusterLocation) {\n        $newDatastoreClusterParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Location = $datastoreClusterLocation\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateDatastoreClusterMessage, @($this.Name, $datastoreClusterLocation.Name))\n\n            return New-DatastoreCluster @newDatastoreClusterParams\n        }\n        catch {\n            throw ($this.CouldNotCreateDatastoreClusterMessage -f $this.Name, $datastoreClusterLocation.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the configuration of the specified Datastore Cluster.\n    #>\n    [void] ModifyDatastoreCluster($datastoreCluster) {\n        $setDatastoreClusterParams = @{\n            Server = $this.Connection\n            DatastoreCluster = $datastoreCluster\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.IOLatencyThresholdMillisecond) { $setDatastoreClusterParams.IOLatencyThresholdMillisecond = $this.IOLatencyThresholdMillisecond }\n        if ($null -ne $this.IOLoadBalanceEnabled) { $setDatastoreClusterParams.IOLoadBalanceEnabled = $this.IOLoadBalanceEnabled }\n        if ($this.SdrsAutomationLevel -ne [DrsAutomationLevel]::Unset) { $setDatastoreClusterParams.SdrsAutomationLevel = $this.SdrsAutomationLevel.ToString() }\n        if ($null -ne $this.SpaceUtilizationThresholdPercent) { $setDatastoreClusterParams.SpaceUtilizationThresholdPercent = $this.SpaceUtilizationThresholdPercent }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyDatastoreClusterMessage, @($datastoreCluster.Name))\n\n            Set-DatastoreCluster @setDatastoreClusterParams\n        }\n        catch {\n            throw ($this.CouldNotModifyDatastoreClusterMessage -f $datastoreCluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Datastore Cluster.\n    #>\n    [void] RemoveDatastoreCluster($datastoreCluster) {\n        $removeDatastoreClusterParams = @{\n            Server = $this.Connection\n            DatastoreCluster = $datastoreCluster\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveDatastoreClusterMessage, @($datastoreCluster.Name))\n\n            Remove-DatastoreCluster @removeDatastoreClusterParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveDatastoreClusterMessage -f $datastoreCluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $datastoreCluster) {\n        $result.Server = $this.Server\n        $result.Location = $this.Location\n        $result.DatacenterName = $this.DatacenterName\n        $result.DatacenterLocation = $this.DatacenterLocation\n\n        if ($null -ne $datastoreCluster) {\n            $result.Name = $datastoreCluster.Name\n            $result.Ensure = [Ensure]::Present\n            $result.IOLatencyThresholdMillisecond = $datastoreCluster.IOLatencyThresholdMillisecond\n            $result.IOLoadBalanceEnabled = $datastoreCluster.IOLoadBalanceEnabled\n            $result.SdrsAutomationLevel = $datastoreCluster.SdrsAutomationLevel.ToString()\n            $result.SpaceUtilizationThresholdPercent = $datastoreCluster.SpaceUtilizationThresholdPercent\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.IOLatencyThresholdMillisecond = $this.IOLatencyThresholdMillisecond\n            $result.IOLoadBalanceEnabled = $this.IOLoadBalanceEnabled\n            $result.SdrsAutomationLevel = $this.SdrsAutomationLevel\n            $result.SpaceUtilizationThresholdPercent = $this.SpaceUtilizationThresholdPercent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/DatastoreClusterAddDatastore.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass DatastoreClusterAddDatastore : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datacenter where the specified\n    Datastore Cluster and Datastores are located.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Datacenter where the specified Datastore Cluster and\n    Datastores are located. The Root Folder of the Inventory is not part of the location.\n    Empty location means that the Datacenter is in the Root Folder of the Inventory.\n    The Folder names in the location are separated by '/'.\n    Example Datacenter location: 'MyDatacentersFolderOne/MyDatacentersFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore Cluster located in the Datacenter specified in 'DatacenterName' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreClusterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Datastore Cluster with name specified in 'DatastoreClusterName' key property in the Datacenter\n    specified in 'DatacenterName' key property. Location consists of 0 or more Folders.\n    Empty location means that the Datastore Cluster is located in the Datastore Folder of the Datacenter.\n    The Root Folders of the Datacenter are not part of the location. Folder names in the location are separated by '/'.\n    Example location for a Datastore Cluster: 'MyDatastoreClusterFolderOne/MyDatastoreClusterFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreClusterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Datastores that should be located in the specified Datastore Cluster.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $DatastoreNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies the instance of the 'InventoryUtil' class that is used\n    for Inventory operations.\n    #>\n    hidden [InventoryUtil] $InventoryUtil\n\n    hidden [string] $AddDatastoresToDatastoreClusterMessage = \"Adding Datastores {0} to Datastore Cluster {1}.\"\n\n    hidden [string] $CouldNotFindDatastoreMessage = \"Could not find Datastore {0} in Datacenter {1}.\"\n    hidden [string] $CouldNotAddDatastoresToDatastoreClusterMessage = \"Could not add Datastores {0} to Datastore Cluster {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterDatastoreFolderName = [FolderType]::Datastore.ToString() + 'Folder'\n            $datastoreCluster = $this.InventoryUtil.GetDatastoreCluster(\n                $this.DatastoreClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.DatastoreClusterLocation,\n                    $datacenter,\n                    $datacenterDatastoreFolderName\n                )\n            )\n\n            $datastores = $this.GetDatastores($datacenter)\n            $datastoresToAddToDatastoreCluster = $this.GetDatastoresToAddToDatastoreCluster($datastoreCluster, $datastores)\n\n            $this.AddDatastoresToDatastoreCluster($datastoreCluster, $datastoresToAddToDatastoreCluster)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterDatastoreFolderName = [FolderType]::Datastore.ToString() + 'Folder'\n            $datastoreCluster = $this.InventoryUtil.GetDatastoreCluster(\n                $this.DatastoreClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.DatastoreClusterLocation,\n                    $datacenter,\n                    $datacenterDatastoreFolderName\n                )\n            )\n\n            $datastores = $this.GetDatastores($datacenter)\n            $datastoresToAddToDatastoreCluster = $this.GetDatastoresToAddToDatastoreCluster($datastoreCluster, $datastores)\n            $result = !($datastoresToAddToDatastoreCluster.Length -gt 0)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [DatastoreClusterAddDatastore] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [DatastoreClusterAddDatastore]::new()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterDatastoreFolderName = [FolderType]::Datastore.ToString() + 'Folder'\n            $datastoreCluster = $this.InventoryUtil.GetDatastoreCluster(\n                $this.DatastoreClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.DatastoreClusterLocation,\n                    $datacenter,\n                    $datacenterDatastoreFolderName\n                )\n            )\n\n            $datastores = $this.GetDatastoresInDatastoreCluster($datastoreCluster)\n\n            $result.Server = $this.Server\n            $result.DatacenterName = $datacenter.Name\n            $result.DatacenterLocation = $this.DatacenterLocation\n            $result.DatastoreClusterName = $datastoreCluster.Name\n            $result.DatastoreClusterLocation = $this.DatastoreClusterLocation\n            $result.DatastoreNames = $datastores | Select-Object -ExpandProperty Name\n\n            return $result\n        }\n        finally {            \n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Initializes an instance of the 'InventoryUtil' class.\n    #>\n    [void] InitInventoryUtil() {\n        if ($null -eq $this.InventoryUtil) {\n            $this.InventoryUtil = [InventoryUtil]::new($this.Connection, [Ensure]::Present)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastores with the specified names located in the specified Datacenter.\n    #>\n    [array] GetDatastores($datacenter) {\n        $result = @()\n        if ($this.DatastoreNames.Length -gt 0) {\n            $getDatastoreParams = @{\n                Server = $this.Connection\n                Name = $this.DatastoreNames\n                Location = $datacenter\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $result = Get-Datastore @getDatastoreParams\n        }\n\n        if ($this.DatastoreNames.Length -gt $result.Length) {\n            $notFoundDatastoreNames = $this.DatastoreNames | Where-Object -FilterScript { $result.Name -NotContains $_ }\n            foreach ($notFoundDatastoreName in $notFoundDatastoreNames) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindDatastoreMessage, @($notFoundDatastoreName, $datacenter.Name))\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastores located in the specified Datastore Cluster.\n    #>\n    [array] GetDatastoresInDatastoreCluster($datastoreCluster) {\n        $getDatastoreParams = @{\n            Server = $this.Connection\n            Location = $datastoreCluster\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Datastore @getDatastoreParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves only the Datastores that are still not added to the specified\n    Datastore Cluster.\n    #>\n    [array] GetDatastoresToAddToDatastoreCluster($datastoreCluster, $datastores) {\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentFolderId -ne $datastoreCluster.Id\n            }\n        }\n\n        return $datastores | Where-Object @whereObjectParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the specified Datastores to the Datastore Cluster.\n    #>\n    [void] AddDatastoresToDatastoreCluster($datastoreCluster, $datastoresToAddToDatastoreCluster) {\n        $moveDatastoreParams = @{\n            Server = $this.Connection\n            Datastore = $datastoresToAddToDatastoreCluster\n            Destination = $datastoreCluster\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddDatastoresToDatastoreClusterMessage, @(\n                ($datastoresToAddToDatastoreCluster.Name -Join ', '),\n                $datastoreCluster.Name\n            ))\n                \n            Move-Datastore @moveDatastoreParams\n        }\n        catch {\n            throw (\n                $this.CouldNotAddDatastoresToDatastoreClusterMessage -f @(\n                    ($datastoresToAddToDatastoreCluster.Name -Join ', '),\n                    $datastoreCluster.Name,\n                    $_.Exception.Message\n                )\n            )\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostAcceptanceLevel.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostAcceptanceLevel : EsxCliBaseDSC {\n    VMHostAcceptanceLevel() {\n        $this.EsxCliCommand = 'software.acceptance'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the acceptance level of the VMHost. Valid values are VMwareCertified, VMwareAccepted, PartnerSupported and CommunitySupported.\n    #>\n    [DscProperty(Mandatory)]\n    [AcceptanceLevel] $Level\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            # The 'Level' value needs to be converted to a string type before being passed to the base class method.\n            $modifyVMHostAcceptanceLevelMethodArguments = @{\n                level = $this.Level.ToString()\n            }\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName, $modifyVMHostAcceptanceLevelMethodArguments)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldUpdateDscResourceSetting('Level', [string] $esxCliGetMethodResult, $this.Level.ToString())\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostAcceptanceLevel] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostAcceptanceLevel]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.Level = $esxCliGetMethodResult\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostDCUIKeyboard.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostDCUIKeyboard : EsxCliBaseDSC {\n    VMHostDCUIKeyboard() {\n        $this.EsxCliCommand = 'system.settings.keyboard.layout'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Direct Console User Interface Keyboard Layout.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $Layout\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldUpdateDscResourceSetting('Layout', [string] $esxCliGetMethodResult, $this.Layout)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostDCUIKeyboard] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostDCUIKeyboard]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n        $result.Layout = $esxCliGetMethodResult\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostNetworkCoreDump.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostNetworkCoreDump : EsxCliBaseDSC {\n    VMHostNetworkCoreDump() {\n        $this.EsxCliCommand = 'system.coredump.network'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to enable network coredump.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies the active interface to be used for the network coredump.\n    #>\n    [DscProperty()]\n    [string] $InterfaceName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IP address of the coredump server (IPv4 or IPv6).\n    #>\n    [DscProperty()]\n    [string] $ServerIp\n\n    <#\n    .DESCRIPTION\n\n    Specifies the port on which the coredump server is listening.\n    #>\n    [DscProperty()]\n    [nullable[long]] $ServerPort\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            <#\n            The 'Enable' argument of the 'set' method of the command should be passed separately from the other method arguments.\n            So if any of the other method arguments is passed, the method of the command should be invoked twice - the first time\n            without 'Enable' and the second time only with 'Enable' argument.\n            #>\n            if ($null -ne $this.Enable) {\n                if (![string]::IsNullOrEmpty($this.InterfaceName) -or ![string]::IsNullOrEmpty($this.ServerIp) -or $null -ne $this.ServerPort) {\n                    <#\n                    The desired 'Enable' value must be set to $null, so that the base class can ignore it when constructing the arguments of the method of the command.\n                    The value is stored in a separate variable, so that it can be used when the second invocation of the command method occurs.\n                    #>\n                    $enableArgumentDesiredValue = $this.Enable\n                    $this.Enable = $null\n\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n\n                    # The property value is restored to its initial value.\n                    $this.Enable = $enableArgumentDesiredValue\n\n                    # All property values except the desired 'Enable' value should be set to $null, because the command method was invoked with them already and their values are not needed.\n                    $this.InterfaceName = $null\n                    $this.ServerIp = $null\n                    $this.ServerPort = $null\n\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n                }\n                else {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n                }\n            }\n            else {\n                $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMHostNetworkCoreDumpConfiguration($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [VMHostNetworkCoreDump] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostNetworkCoreDump]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMHost network coredump configuration should be modified.\n    #>\n    [bool] ShouldModifyVMHostNetworkCoreDumpConfiguration($esxCliGetMethodResult) {\n        $shouldModifyVMHostNetworkCoreDumpConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('Enable', [System.Convert]::ToBoolean($esxCliGetMethodResult.Enabled), $this.Enable),\n            $this.ShouldUpdateDscResourceSetting('InterfaceName', [string] $esxCliGetMethodResult.HostVNic, $this.InterfaceName),\n            $this.ShouldUpdateDscResourceSetting('ServerIp', [string] $esxCliGetMethodResult.NetworkServerIP, $this.ServerIp),\n            $this.ShouldUpdateDscResourceSetting('ServerPort', [long] $esxCliGetMethodResult.NetworkServerPort, $this.ServerPort)\n        )\n\n        return ($shouldModifyVMHostNetworkCoreDumpConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.Enable = [System.Convert]::ToBoolean($esxCliGetMethodResult.Enabled)\n        $result.InterfaceName = $esxCliGetMethodResult.HostVNic\n        $result.ServerIp = $esxCliGetMethodResult.NetworkServerIP\n        $result.ServerPort = [long] $esxCliGetMethodResult.NetworkServerPort\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostSNMPAgent.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostSNMPAgent : EsxCliBaseDSC {\n    VMHostSNMPAgent() {\n        $this.EsxCliCommand = 'system.snmp'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the default authentication protocol. Valid values are none, MD5, SHA1.\n    #>\n    [DscProperty()]\n    [string] $Authentication\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to ten communities each no more than 64 characters. Format is: 'community1[,community2,...]'. This overwrites previous settings.\n    #>\n    [DscProperty()]\n    [string] $Communities\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to start or stop the SNMP service.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies the SNMPv3 engine id. Must be between 10 and 32 hexadecimal characters. 0x or 0X are stripped if found as well as colons (:).\n    #>\n    [DscProperty()]\n    [string] $EngineId\n\n    <#\n    .DESCRIPTION\n\n    Specifies where to source hardware events - IPMI sensors or CIM Indications. Valid values are indications and sensors.\n    #>\n    [DscProperty()]\n    [string] $Hwsrc\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to support large storage for 'hrStorageAllocationUnits' * 'hrStorageSize'. Controls how the agent reports 'hrStorageAllocationUnits', 'hrStorageSize' and 'hrStorageUsed' in 'hrStorageTable'.\n    Setting this directive to $true to support large storage with small allocation units, the agent re-calculates these values so they all fit into 'int' and 'hrStorageAllocationUnits' * 'hrStorageSize' gives real size\n    of the storage. Setting this directive to $false turns off this calculation and the agent reports real 'hrStorageAllocationUnits', but it might report wrong 'hrStorageSize' for large storage because the value won't fit\n    into 'int'.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $LargeStorage\n\n    <#\n    .DESCRIPTION\n\n    Specifies the SNMP agent syslog logging level. Valid values are debug, info, warning and error.\n    #>\n    [DscProperty()]\n    [string] $LogLevel\n\n    <#\n    .DESCRIPTION\n\n    Specifies a comma separated list of trap oids for traps not to be sent by the SNMP agent. Use the property 'reset' to clear this setting.\n    #>\n    [DscProperty()]\n    [string] $NoTraps\n\n    <#\n    .DESCRIPTION\n\n    Specifies the UDP port to poll SNMP agent on. The default is 'udp/161'. May not use ports 32768 to 40959.\n    #>\n    [DscProperty()]\n    [nullable[long]] $Port\n\n    <#\n    .DESCRIPTION\n\n    Specifies the default privacy protocol. Valid values are none and AES128.\n    #>\n    [DscProperty()]\n    [string] $Privacy\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to five inform user ids. Format is: 'user/auth-proto/-|auth-hash/priv-proto/-|priv-hash/engine-id[,...]', where user is 32 chars max. 'auth-proto' is 'none', 'MD5' or 'SHA1',\n    'priv-proto' is 'none' or 'AES'. '-' indicates no hash. 'engine-id' is hex string '0x0-9a-f' up to 32 chars max.\n    #>\n    [DscProperty()]\n    [string] $RemoteUsers\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to return SNMP agent configuration to factory defaults.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Reset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the System contact as presented in 'sysContact.0'. Up to 255 characters.\n    #>\n    [DscProperty()]\n    [string] $SysContact\n\n    <#\n    .DESCRIPTION\n\n    Specifies the System location as presented in 'sysLocation.0'. Up to 255 characters.\n    #>\n    [DscProperty()]\n    [string] $SysLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to three targets to send SNMPv1 traps to. Format is: 'ip-or-hostname[@port]/community[,...]'. The default port is 'udp/162'.\n    #>\n    [DscProperty()]\n    [string] $Targets\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to five local users. Format is: 'user/-|auth-hash/-|priv-hash/model[,...]', where user is 32 chars max. '-' indicates no hash. Model is one of 'none', 'auth' or 'priv'.\n    #>\n    [DscProperty()]\n    [string] $Users\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to three SNMPv3 notification targets. Format is: 'ip-or-hostname[@port]/remote-user/security-level/trap|inform[,...]'.\n    #>\n    [DscProperty()]\n    [string] $V3Targets\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $modifyVMHostSNMPAgentMethodArguments = @{}\n            if ($null -ne $this.NoTraps) { $modifyVMHostSNMPAgentMethodArguments.notraps = $this.NoTraps }\n            if ($null -ne $this.SysContact) { $modifyVMHostSNMPAgentMethodArguments.syscontact = $this.SysContact }\n            if ($null -ne $this.SysLocation) { $modifyVMHostSNMPAgentMethodArguments.syslocation = $this.SysLocation }\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName, $modifyVMHostSNMPAgentMethodArguments)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMHostSNMPAgent($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostSNMPAgent] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSNMPAgent]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMHost SNMP Agent should be modified.\n    #>\n    [bool] ShouldModifyVMHostSNMPAgent($esxCliGetMethodResult) {\n        $shouldModifyVMHostSNMPAgent = @(\n            $this.ShouldUpdateDscResourceSetting('Authentication', [string] $esxCliGetMethodResult.authentication, $this.Authentication),\n            $this.ShouldUpdateDscResourceSetting('Communities', [string] $esxCliGetMethodResult.communities, $this.Communities),\n            $this.ShouldUpdateDscResourceSetting('Enable', [System.Convert]::ToBoolean($esxCliGetMethodResult.enable), $this.Enable),\n            $this.ShouldUpdateDscResourceSetting('EngineId', [string] $esxCliGetMethodResult.engineid, $this.EngineId),\n            $this.ShouldUpdateDscResourceSetting('Hwsrc', [string] $esxCliGetMethodResult.hwsrc, $this.Hwsrc),\n            $this.ShouldUpdateDscResourceSetting('LargeStorage', [System.Convert]::ToBoolean($esxCliGetMethodResult.largestorage), $this.LargeStorage),\n            $this.ShouldUpdateDscResourceSetting('LogLevel', [string] $esxCliGetMethodResult.loglevel, $this.LogLevel),\n            $this.ShouldUpdateDscResourceSetting('NoTraps', [string] $esxCliGetMethodResult.notraps, $this.NoTraps),\n            $this.ShouldUpdateDscResourceSetting('Port', [int] $esxCliGetMethodResult.port, $this.Port),\n            $this.ShouldUpdateDscResourceSetting('Privacy', [string] $esxCliGetMethodResult.privacy, $this.Privacy),\n            $this.ShouldUpdateDscResourceSetting('RemoteUsers', [string] $esxCliGetMethodResult.remoteusers, $this.RemoteUsers),\n            $this.ShouldUpdateDscResourceSetting('SysContact', [string] $esxCliGetMethodResult.syscontact, $this.SysContact),\n            $this.ShouldUpdateDscResourceSetting('SysLocation', [string] $esxCliGetMethodResult.syslocation, $this.SysLocation),\n            $this.ShouldUpdateDscResourceSetting('Targets', [string] $esxCliGetMethodResult.targets, $this.Targets),\n            $this.ShouldUpdateDscResourceSetting('Users', [string] $esxCliGetMethodResult.users, $this.Users),\n            $this.ShouldUpdateDscResourceSetting('V3Targets', [string] $esxCliGetMethodResult.v3targets, $this.V3Targets),\n            $this.ShouldUpdateDscResourceSetting('Reset', $false, $this.Reset)\n        )\n\n        return ($shouldModifyVMHostSNMPAgent -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Reset = $this.Reset\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.Authentication = $esxCliGetMethodResult.authentication\n        $result.Communities = $esxCliGetMethodResult.communities\n        $result.Enable = [System.Convert]::ToBoolean($esxCliGetMethodResult.enable)\n        $result.EngineId = $esxCliGetMethodResult.engineid\n        $result.Hwsrc = $esxCliGetMethodResult.hwsrc\n        $result.LargeStorage = [System.Convert]::ToBoolean($esxCliGetMethodResult.largestorage)\n        $result.LogLevel = $esxCliGetMethodResult.loglevel\n        $result.NoTraps = $esxCliGetMethodResult.notraps\n        $result.Port = [int] $esxCliGetMethodResult.port\n        $result.Privacy = $esxCliGetMethodResult.privacy\n        $result.RemoteUsers = $esxCliGetMethodResult.remoteusers\n        $result.SysContact = $esxCliGetMethodResult.syscontact\n        $result.SysLocation = $esxCliGetMethodResult.syslocation\n        $result.Targets = $esxCliGetMethodResult.targets\n        $result.Users = $esxCliGetMethodResult.users\n        $result.V3Targets = $esxCliGetMethodResult.v3targets\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostSharedSwapSpace.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostSharedSwapSpace : EsxCliBaseDSC {\n    VMHostSharedSwapSpace() {\n        $this.EsxCliCommand = 'sched.swap.system'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies if the Datastore option should be enabled or not.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DatastoreEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore used by the Datastore option.\n    #>\n    [DscProperty()]\n    [string] $DatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the order of the Datastore option in the preference of the options of the system-wide shared swap space.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DatastoreOrder\n\n    <#\n    .DESCRIPTION\n\n    Specifies if the host cache option should be enabled or not.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HostCacheEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the order of the host cache option in the preference of the options of the system-wide shared swap space.\n    #>\n    [DscProperty()]\n    [nullable[long]] $HostCacheOrder\n\n    <#\n    .DESCRIPTION\n\n    Specifies if the host local swap option should be enabled or not.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HostLocalSwapEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the order of the host local swap option in the preference of the options of the system-wide shared swap space.\n    #>\n    [DscProperty()]\n    [nullable[long]] $HostLocalSwapOrder\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $modifyVMHostSharedSwapSpaceMethodArguments = @{}\n            if ($null -ne $this.DatastoreName) { $modifyVMHostSharedSwapSpaceMethodArguments.datastorename = $this.DatastoreName }\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName, $modifyVMHostSharedSwapSpaceMethodArguments)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifySystemWideSharedSwapSpaceConfiguration($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [VMHostSharedSwapSpace] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSharedSwapSpace]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the system-wide shared swap space configuration should be modified.\n    #>\n    [bool] ShouldModifySystemWideSharedSwapSpaceConfiguration($esxCliGetMethodResult) {\n        $shouldModifySystemWideSharedSwapSpaceConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('DatastoreEnabled', [System.Convert]::ToBoolean($esxCliGetMethodResult.DatastoreEnabled), $this.DatastoreEnabled),\n            $this.ShouldUpdateDscResourceSetting('DatastoreName', [string] $esxCliGetMethodResult.DatastoreName, $this.DatastoreName),\n            $this.ShouldUpdateDscResourceSetting('DatastoreOrder', [long] $esxCliGetMethodResult.DatastoreOrder, $this.DatastoreOrder),\n            $this.ShouldUpdateDscResourceSetting('HostCacheEnabled', [System.Convert]::ToBoolean($esxCliGetMethodResult.HostcacheEnabled), $this.HostCacheEnabled),\n            $this.ShouldUpdateDscResourceSetting('HostCacheOrder', [long] $esxCliGetMethodResult.HostcacheOrder, $this.HostCacheOrder),\n            $this.ShouldUpdateDscResourceSetting('HostLocalSwapOrder', [long] $esxCliGetMethodResult.HostlocalswapOrder, $this.HostLocalSwapOrder),\n            $this.ShouldUpdateDscResourceSetting(\n                'HostLocalSwapEnabled',\n                [System.Convert]::ToBoolean($esxCliGetMethodResult.HostlocalswapEnabled),\n                $this.HostLocalSwapEnabled\n            )\n        )\n\n        return ($shouldModifySystemWideSharedSwapSpaceConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.DatastoreEnabled = [System.Convert]::ToBoolean($esxCliGetMethodResult.DatastoreEnabled)\n        $result.DatastoreName = $esxCliGetMethodResult.DatastoreName\n        $result.DatastoreOrder = [long] $esxCliGetMethodResult.DatastoreOrder\n        $result.HostCacheEnabled = [System.Convert]::ToBoolean($esxCliGetMethodResult.HostcacheEnabled)\n        $result.HostCacheOrder = [long] $esxCliGetMethodResult.HostcacheOrder\n        $result.HostLocalSwapEnabled = [System.Convert]::ToBoolean($esxCliGetMethodResult.HostlocalswapEnabled)\n        $result.HostLocalSwapOrder = [long] $esxCliGetMethodResult.HostlocalswapOrder\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostSoftwareDevice.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostSoftwareDevice : EsxCliBaseDSC {\n    VMHostSoftwareDevice() {\n        $this.EsxCliCommand = 'device.software'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the device identifier from the device specification for the software device driver. Valid input is in reverse domain name format (e.g. com.company.device...).\n    #>\n    [DscProperty(Key)]\n    [string] $DeviceIdentifier\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the software device should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the unique number to address this instance of the device, if multiple instances of the same device identifier are added. Valid values are integer in the range 0-31. Default is 0.\n    #>\n    [DscProperty()]\n    [nullable[long]] $InstanceAddress\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $softwareDevice = $this.GetVMHostSoftwareDevice()\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $softwareDevice) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliAddMethodName)\n                }\n            }\n            else {\n                if ($null -ne $softwareDevice) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliRemoveMethodName)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $result = $this.IsVMHostSoftwareDeviceInDesiredState()\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostSoftwareDevice] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSoftwareDevice]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Software device with the specified id and instance address if it exists.\n    #>\n    [PSObject] GetVMHostSoftwareDevice() {\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n        $softwareDeviceInstanceAddress = if ($null -ne $this.InstanceAddress) { $this.InstanceAddress } else { 0 }\n        $softwareDevice = $esxCliListMethodResult | Where-Object -FilterScript { $_.DeviceID -eq $this.DeviceIdentifier -and [long] $_.Instance -eq $softwareDeviceInstanceAddress }\n\n        return $softwareDevice\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Software device is in a Desired State depending on the value of the 'Ensure' property.\n    #>\n    [bool] IsVMHostSoftwareDeviceInDesiredState() {\n        $softwareDevice = $this.GetVMHostSoftwareDevice()\n\n        $result = $false\n        if ($this.Ensure -eq [Ensure]::Present) {\n            $result = ($null -ne $softwareDevice)\n        }\n        else {\n            $result = ($null -eq $softwareDevice)\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $softwareDevice = $this.GetVMHostSoftwareDevice()\n        if ($null -ne $softwareDevice) {\n            $result.DeviceIdentifier = $softwareDevice.DeviceID\n            $result.InstanceAddress = [long] $softwareDevice.Instance\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.DeviceIdentifier = $this.DeviceIdentifier\n            $result.InstanceAddress = $this.InstanceAddress\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostVMKernelActiveDumpFile.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVMKernelActiveDumpFile : EsxCliBaseDSC {\n    VMHostVMKernelActiveDumpFile() {\n        $this.EsxCliCommand = 'system.coredump.file'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the VMKernel dump file should be enabled or disabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to select the best available file using the smart selection algorithm. Can only be used when 'Enabled' property is specified with '$true' value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Smart\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMKernelDumpFile($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelActiveDumpFile] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelActiveDumpFile]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMKernel dump file should be modified.\n    #>\n    [bool] ShouldModifyVMKernelDumpFile($esxCliGetMethodResult) {\n        $result = $null\n\n        if ($null -ne $this.Enable) {\n            if ($this.Enable) { $result = [string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n            else { $result = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n        }\n        else {\n            $result = $false\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Smart = $this.Smart\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n        $result.Enable = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostVMKernelActiveDumpPartition.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVMKernelActiveDumpPartition : EsxCliBaseDSC {\n    VMHostVMKernelActiveDumpPartition() {\n        $this.EsxCliCommand = 'system.coredump.partition'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the VMKernel dump partition should be enabled or disabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to select the best available partition using the smart selection algorithm. Can only be used when 'Enabled' property is specified with '$true' value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Smart\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMKernelDumpPartition($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelActiveDumpPartition] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelActiveDumpPartition]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMKernel dump partition should be modified.\n    #>\n    [bool] ShouldModifyVMKernelDumpPartition($esxCliGetMethodResult) {\n        $result = $null\n\n        if ($null -ne $this.Enable) {\n            if ($this.Enable) { $result = [string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n            else { $result = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n        }\n        else {\n            $result = $false\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Smart = $this.Smart\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n        $result.Enable = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostVMKernelDumpFile.ps1",
    "content": "+<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVMKernelDumpFile : EsxCliBaseDSC {\n    VMHostVMKernelDumpFile() {\n        $this.EsxCliCommand = 'system.coredump.file'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore for the dump file.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the file name of the dump file.\n    #>\n    [DscProperty(Key)]\n    [string] $FileName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the VMKernel dump Vmfs file should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the size in MB of the dump file. If not provided, a default size for the current machine is calculated.\n    #>\n    [DscProperty()]\n    [nullable[long]] $Size\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to deactivate and unconfigure the dump file being removed. This option is required if the file is active.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $CouldNotRetrieveFileSystemsInformationMessage = \"Could not retrieve information about File Systems on VMHost {0}. For more information: {1}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $addVMKernelDumpFileMethodArguments = @{\n                    datastore = $this.DatastoreName\n                    file = $this.FileName\n                }\n\n                $this.ExecuteEsxCliModifyMethod($this.EsxCliAddMethodName, $addVMKernelDumpFileMethodArguments)\n            }\n            else {\n                $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n                $vmKernelDumpFile = $this.GetVMKernelDumpFile($esxCliListMethodResult)\n                $removeVMKernelDumpFileMethodArguments = @{\n                    file = $vmKernelDumpFile.Path\n                }\n\n                $this.ExecuteEsxCliModifyMethod($this.EsxCliRemoveMethodName, $removeVMKernelDumpFileMethodArguments)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n            $vmKernelDumpFile = $this.GetVMKernelDumpFile($esxCliListMethodResult)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($vmKernelDumpFile.Count -ne 0)\n            }\n            else {\n                $result = ($vmKernelDumpFile.Count -eq 0)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelDumpFile] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelDumpFile]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Translates the Datastore name from a volume UUID to volume name, if required.\n    #>\n    [string] TranslateDatastoreName($datastoreName) {\n        $foundDatastoreName = $null\n        $fileSystemsList = $null\n\n        try {\n            $fileSystemsList = Invoke-EsxCliCommandMethod -EsxCli $this.EsxCli -EsxCliCommandMethod 'storage.filesystem.list.Invoke({0})' -EsxCliCommandMethodArguments @{}\n        }\n        catch {\n            throw ($this.CouldNotRetrieveFileSystemsInformationMessage -f $this.Name, $_.Exception.Message)\n        }\n\n        foreach ($fileSystem in $fileSystemsList) {\n            if ($fileSystem.UUID -eq $datastoreName) {\n                $foundDatastoreName = $fileSystem.VolumeName\n                break\n            }\n\n            if ($fileSystem.VolumeName -eq $datastoreName) {\n                $foundDatastoreName = $fileSystem.VolumeName\n                break\n            }\n        }\n\n        return $foundDatastoreName\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the name of the specified dump file.\n    #>\n    [string] GetDumpFileName($dumpFile) {\n        $fileParts = $dumpFile -Split '\\.'\n        return $fileParts[0]\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed bytes value to MB value.\n    #>\n    [double] ConvertBytesValueToMBValue($bytesValue) {\n        return [Math]::Round($bytesValue / 1MB)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel dump file if it exists.\n    #>\n    [PSObject] GetVMKernelDumpFile($esxCliListMethodResult) {\n        $foundDumpFile = @{}\n        $result = @()\n\n        foreach ($dumpFile in $esxCliListMethodResult) {\n            $dumpFileParts = $dumpFile.Path -Split '/'\n            $dumpFileDatastoreName = $this.TranslateDatastoreName($dumpFileParts[3])\n            $dumpFileName = $this.GetDumpFileName($dumpFileParts[5])\n\n            $result += ($this.DatastoreName -eq $dumpFileDatastoreName)\n            $result += ($this.FileName -eq $dumpFileName)\n\n            if ($null -ne $this.Size) {\n                $result += ($this.Size -eq $this.ConvertBytesValueToMBValue($dumpFile.Size))\n            }\n\n            if ($result -NotContains $false) {\n                $foundDumpFile.Path = $dumpFile.Path\n                $foundDumpFile.Datastore = $dumpFileDatastoreName\n                $foundDumpFile.File = $dumpFileName\n                $foundDumpFile.Size = $this.ConvertBytesValueToMBValue($dumpFile.Size)\n\n                break\n            }\n\n            $result = @()\n        }\n\n        return $foundDumpFile\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Force = $this.Force\n\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n        $vmKernelDumpFile = $this.GetVMKernelDumpFile($esxCliListMethodResult)\n\n        if ($vmKernelDumpFile.Count -ne 0) {\n            $result.DatastoreName = $vmKernelDumpFile.Datastore\n            $result.FileName = $vmKernelDumpFile.File\n            $result.Size = $vmKernelDumpFile.Size\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.DatastoreName = $this.DatastoreName\n            $result.FileName = $this.FileName\n            $result.Size = $this.Size\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostVMKernelModule.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVMKernelModule : EsxCliBaseDSC {\n    VMHostVMKernelModule() {\n        $this.EsxCliCommand = 'system.module'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VMKernel module.\n    #>\n    [DscProperty(Key)]\n    [string] $Module\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the module should be enabled or disabled.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to skip the VMkernel module validity checks.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n\n            $result = !$this.ShouldModifyVMKernelModule($esxCliListMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelModule] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelModule]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMKernel module should be modified.\n    #>\n    [bool] ShouldModifyVMKernelModule($esxCliListMethodResult) {\n        $vmKernelModule = $esxCliListMethodResult | Where-Object -FilterScript { $_.Name -eq $this.Module }\n        return $this.ShouldUpdateDscResourceSetting('Enabled', [System.Convert]::ToBoolean($vmKernelModule.IsEnabled), $this.Enabled)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Force = $this.Force\n\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n        $vmKernelModule = $esxCliListMethodResult | Where-Object -FilterScript { $_.Name -eq $this.Module }\n\n        $result.Module = $vmKernelModule.Name\n        $result.Enabled = [System.Convert]::ToBoolean($vmKernelModule.IsEnabled)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/EsxCli/VMHostvSANNetworkConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostvSANNetworkConfiguration : EsxCliBaseDSC {\n    VMHostvSANNetworkConfiguration() {\n        $this.EsxCliCommand = 'vsan.network.ip'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the interface.\n    #>\n    [DscProperty(Key)]\n    [string] $InterfaceName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the IP interface of the vSAN network configuration should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv4 multicast address for the agent group.\n    #>\n    [DscProperty()]\n    [string] $AgentMcAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv6 multicast address for the agent group.\n    #>\n    [DscProperty()]\n    [string] $AgentV6McAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the multicast address port for the agent group.\n    #>\n    [DscProperty()]\n    [nullable[long]] $AgentMcPort\n\n    <#\n    .DESCRIPTION\n\n    Specifies the unicast address port for the VMHost unicast channel.\n    #>\n    [DscProperty()]\n    [nullable[long]] $HostUcPort\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv4 multicast address for the master group.\n    #>\n    [DscProperty()]\n    [string] $MasterMcAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv6 multicast address for the master group.\n    #>\n    [DscProperty()]\n    [string] $MasterV6McAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the multicast address port for the master group.\n    #>\n    [DscProperty()]\n    [nullable[long]] $MasterMcPort\n\n    <#\n    .DESCRIPTION\n\n    Specifies the time-to-live for multicast packets.\n    #>\n    [DscProperty()]\n    [nullable[long]] $MulticastTtl\n\n    <#\n    .DESCRIPTION\n\n    Specifies the network transmission type of the vSAN traffic through a virtual network adapter. Supported values are vsan and witness. Type 'vsan' means general vSAN transmission, which is used for both\n    data and witness transmission, if there is no virtual adapter configured with 'witness' traffic type; Type 'witness' indicates that, vSAN vmknic is used for vSAN witness transmission.\n    Once a virtual adapter is configured with 'witness' traffic type, vSAN witness data transmission will stop using virtual adapter with 'vsan' traffic type, and use first dicovered virtual adapter with 'witness' traffic type.\n    Multiple traffic types can be provided in format -T type1 -T type2. Default value is 'vsan', if the property is not specified.\n    #>\n    [DscProperty()]\n    [string[]] $TrafficType\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to notify vSAN subsystem of the removal of the IP Interface, even if is not configured.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $vSanNetworkConfigurationIPInterface = $this.GetvSanNetworkConfigurationIPInterface()\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vSanNetworkConfigurationIPInterface) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliAddMethodName)\n                }\n            }\n            else {\n                if ($null -ne $vSanNetworkConfigurationIPInterface) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliRemoveMethodName)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $result = $this.IsvSanNetworkConfigurationIPInterfaceInDesiredState()\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostvSANNetworkConfiguration] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostvSANNetworkConfiguration]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the IP interface with the specified name of the vSAN network configuration.\n    #>\n    [PSObject] GetvSanNetworkConfigurationIPInterface() {\n        <#\n        The 'list' method of the command is not on the same element as the 'add' and 'remove' methods. So the different methods\n        need to be executed with different commands.\n        #>\n        $initialEsxCliCommand = $this.EsxCliCommand\n        $this.EsxCliCommand = 'vsan.network'\n\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n\n        # The command needs to be restored to its initial value, so that it can be used by the 'add' and 'remove' methods.\n        $this.EsxCliCommand = $initialEsxCliCommand\n\n        return ($esxCliListMethodResult | Where-Object -FilterScript { $_.VmkNicName -eq $this.InterfaceName })\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the vSan network configuration IP interface is in a Desired State depending on the value of the 'Ensure' property.\n    #>\n    [bool] IsvSanNetworkConfigurationIPInterfaceInDesiredState() {\n        $vSanNetworkConfigurationIPInterface = $this.GetvSanNetworkConfigurationIPInterface()\n\n        $result = $false\n        if ($this.Ensure -eq [Ensure]::Present) {\n            $result = ($null -ne $vSanNetworkConfigurationIPInterface)\n        }\n        else {\n            $result = ($null -eq $vSanNetworkConfigurationIPInterface)\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Force = $this.Force\n\n        $vSanNetworkConfigurationIPInterface = $this.GetvSanNetworkConfigurationIPInterface()\n        if ($null -ne $vSanNetworkConfigurationIPInterface) {\n            $result.InterfaceName = $vSanNetworkConfigurationIPInterface.VmkNicName\n            $result.AgentMcAddr = $vSanNetworkConfigurationIPInterface.AgentGroupMulticastAddress\n            $result.AgentMcPort = [long] $vSanNetworkConfigurationIPInterface.AgentGroupMulticastPort\n            $result.AgentV6McAddr = $vSanNetworkConfigurationIPInterface.AgentGroupIPv6MulticastAddress\n            $result.HostUcPort = [long] $vSanNetworkConfigurationIPInterface.HostUnicastChannelBoundPort\n            $result.MasterMcAddr = $vSanNetworkConfigurationIPInterface.MasterGroupMulticastAddress\n            $result.MasterMcPort = [long] $vSanNetworkConfigurationIPInterface.MasterGroupMulticastPort\n            $result.MasterV6McAddr = $vSanNetworkConfigurationIPInterface.MasterGroupIPv6MulticastAddress\n            $result.MulticastTtl = [long] $vSanNetworkConfigurationIPInterface.MulticastTTL\n            $result.TrafficType = $vSanNetworkConfigurationIPInterface.TrafficType\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.InterfaceName = $this.InterfaceName\n            $result.AgentMcAddr = $this.AgentMcAddr\n            $result.AgentMcPort = $this.AgentMcPort\n            $result.AgentV6McAddr = $this.AgentV6McAddr\n            $result.HostUcPort = $this.HostUcPort\n            $result.MasterMcAddr = $this.MasterMcAddr\n            $result.MasterMcPort = $this.MasterMcPort\n            $result.MasterV6McAddr = $this.MasterV6McAddr\n            $result.MulticastTtl = $this.MulticastTtl\n            $result.TrafficType = $this.TrafficType\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/Folder.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass Folder : DatacenterInventoryBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The type of Root Folder in the Datacenter in which the Folder is located.\n    Possible values are VM, Network, Datastore, Host.\n    #>\n    [DscProperty(Key)]\n    [FolderType] $FolderType\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.FolderType)Folder\"\n            $folderLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $folder = $this.GetInventoryItem($folderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $folder) {\n                    $this.AddFolder($folderLocation)\n                }\n            }\n            else {\n                if ($null -ne $folder) {\n                    $this.RemoveFolder($folder)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.FolderType)Folder\"\n            $folderLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $folder = $this.GetInventoryItem($folderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                return ($null -ne $folder)\n            }\n            else {\n                return ($null -eq $folder)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [Folder] Get() {\n        try {\n            $result = [Folder]::new()\n\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n            $result.FolderType = $this.FolderType\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.FolderType)Folder\"\n            $folderLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $folder = $this.GetInventoryItem($folderLocation)\n\n            $this.PopulateResult($folder, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Folder with the specified properties at the specified Location.\n    #>\n    [void] AddFolder($folderLocation) {\n        $folderParams = @{}\n\n        $folderParams.Server = $this.Connection\n        $folderParams.Name = $this.Name\n        $folderParams.Location = $folderLocation\n        $folderParams.Confirm = $false\n        $folderParams.ErrorAction = 'Stop'\n\n        try {\n            New-Folder @folderParams\n        }\n        catch {\n            throw \"Cannot create Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Folder from the specified Location.\n    #>\n    [void] RemoveFolder($folder) {\n        $folderParams = @{}\n\n        $folderParams.Server = $this.Connection\n        $folderParams.Confirm = $false\n        $folderParams.ErrorAction = 'Stop'\n\n        try {\n            $folder | Remove-Folder @folderParams\n        }\n        catch {\n            throw \"Cannot remove Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Folder from the server.\n    #>\n    [void] PopulateResult($folder, $result) {\n        if ($null -ne $folder) {\n            $result.Name = $folder.Name\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/NfsUser.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass NfsUser : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Nfs User name used for Kerberos authentication.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Nfs User password used for Kerberos authentication.\n    #>\n    [DscProperty()]\n    [string] $Password\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Nfs User should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to change the password of the Nfs User. When the property is not specified or is $false, it is ignored.\n    If the property is $true and the Nfs User exists, the password of the Nfs User is changed.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $CreateNfsUserMessage = \"Creating Nfs User {0} on VMHost {1}.\"\n    hidden [string] $ChangeNfsUserPasswordMessage = \"Changing Nfs User {0} password on VMHost {1}.\"\n    hidden [string] $RemoveNfsUserMessage = \"Removing Nfs User {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotCreateNfsUserMessage = \"Could not create Nfs User {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotChangeNfsUserPasswordMessage = \"Could not change Nfs User {0} password on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveNfsUserMessage = \"Could not remove Nfs User {0} from VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $nfsUser = $this.GetNfsUser()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $nfsUser) {\n                    $this.NewNfsUser()\n                }\n                else {\n                    $this.ChangeNfsUserPassword($nfsUser)\n                }\n            }\n            else {\n                if ($null -ne $nfsUser) {\n                    $this.RemoveNfsUser($nfsUser)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $nfsUser = $this.GetNfsUser()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $nfsUser) {\n                    $result = $false\n                }\n                else {\n                    $result = !($null -ne $this.Force -and $this.Force)\n                }\n            }\n            else {\n                $result = ($null -eq $nfsUser)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [NfsUser] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [NfsUser]::new()\n\n            $this.RetrieveVMHost()\n\n            $nfsUser = $this.GetNfsUser()\n            $this.PopulateResult($result, $nfsUser)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Nfs User with the specified name from the VMHost if it exists.\n    #>\n    [PSObject] GetNfsUser() {\n        <#\n        The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n        when importing the 'VMware.VimAutomation.Storage' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        $nfsUser = Get-NfsUser -Server $this.Connection -Username $this.Name -VMHost $this.VMHost -ErrorAction SilentlyContinue -Verbose:$false\n\n        $global:VerbosePreference = $savedVerbosePreference\n\n        return $nfsUser\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Nfs User with the specified name and password on the VMHost.\n    #>\n    [void] NewNfsUser() {\n        $newNfsUserParams = @{\n            Server = $this.Connection\n            Username = $this.Name\n            VMHost = $this.VMHost\n            Password = $this.Password\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateNfsUserMessage,  @($this.Name, $this.VMHost.Name))\n\n            New-NfsUser @newNfsUserParams\n        }\n        catch {\n            throw ($this.CouldNotCreateNfsUserMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Changes the password of the specified Nfs User on the VMHost.\n    #>\n    [void] ChangeNfsUserPassword($nfsUser) {\n        $setNfsUserParams = @{\n            Server = $this.Connection\n            NfsUser = $nfsUser\n            Password = $this.Password\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ChangeNfsUserPasswordMessage,  @($nfsUser.Username, $this.VMHost.Name))\n\n            Set-NfsUser @setNfsUserParams\n        }\n        catch {\n            throw ($this.CouldNotChangeNfsUserPasswordMessage -f $nfsUser.Username, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Nfs User from the VMHost.\n    #>\n    [void] RemoveNfsUser($nfsUser) {\n        $removeNfsUserParams = @{\n            NfsUser = $nfsUser\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveNfsUserMessage,  @($nfsUser.Username, $this.VMHost.Name))\n\n            Remove-NfsUser @removeNfsUserParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveNfsUserMessage -f $nfsUser.Username, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $nfsUser) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Force = $this.Force\n\n        if ($null -ne $nfsUser) {\n            $result.Name = $nfsUser.Username\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/PowerCLISettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass PowerCLISettings {\n    <#\n    .DESCRIPTION\n\n    Specifies the scope on which the PowerCLI Settings will be applied.\n    LCM is the only possible value for the Settings Scope.\n    #>\n    [DscProperty(Key)]\n    [PowerCLISettingsScope] $SettingsScope\n\n    <#\n    .DESCRIPTION\n\n    Specifies the proxy policy for the connection through which Customer Experience Improvement Program (CEIP) data is sent to VMware.\n    #>\n    [DscProperty()]\n    [ProxyPolicy] $CEIPDataTransferProxyPolicy = [ProxyPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the server connection mode.\n    #>\n    [DscProperty()]\n    [DefaultVIServerMode] $DefaultVIServerMode = [DefaultVIServerMode]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether you want to see warnings about deprecated elements.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DisplayDeprecationWarnings\n\n    <#\n    .DESCRIPTION\n\n    Define the action to take when an attempted connection to a server fails due to a certificate error.\n    #>\n    [DscProperty()]\n    [BadCertificateAction] $InvalidCertificateAction = [BadCertificateAction]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies if PowerCLI should send anonymous usage information to VMware.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ParticipateInCeip\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether VMware PowerCLI uses a system proxy server to connect to the vCenter Server system.\n    #>\n    [DscProperty()]\n    [ProxyPolicy] $ProxyPolicy = [ProxyPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Defines the timeout for Web operations. The default value is 300 sec.\n    #>\n    [DscProperty()]\n    [nullable[int]] $WebOperationTimeoutSeconds\n\n    hidden [string] $Scope = \"User\"\n\n    [void] Set() {\n        $this.ImportRequiredModules()\n        $powerCLIConfigurationProperties = $this.GetPowerCLIConfigurationProperties()\n\n        $commandName = 'Set-PowerCLIConfiguration'\n        $namesOfPowerCLIConfigurationProperties = $powerCLIConfigurationProperties.Keys\n\n        <#\n        For testability we use this function to construct the Set-PowerCLIConfiguration cmdlet instead of using splatting and passing the cmdlet parameters as hashtable.\n        At the moment Pester does not allow to pass hashtable in the ParameterFilter property of the Assert-MockCalled function.\n        There is an open issue in GitHub: (https://github.com/pester/Pester/issues/862) describing the problem in details.\n        #>\n        $constructedCommand = $this.ConstructCommandWithParameters($commandName, $powerCLIConfigurationProperties, $namesOfPowerCLIConfigurationProperties)\n        Invoke-Expression -Command $constructedCommand\n    }\n\n    [bool] Test() {\n        $this.ImportRequiredModules()\n        $powerCLICurrentConfiguration = Get-PowerCLIConfiguration -Scope $this.Scope\n        $powerCLIDesiredConfiguration = $this.GetPowerCLIConfigurationProperties()\n\n        return $this.Equals($powerCLICurrentConfiguration, $powerCLIDesiredConfiguration)\n    }\n\n    [PowerCLISettings] Get() {\n        $this.ImportRequiredModules()\n        $result = [PowerCLISettings]::new()\n        $powerCLICurrentConfiguration = Get-PowerCLIConfiguration -Scope $this.Scope\n\n        $this.PopulateResult($powerCLICurrentConfiguration, $result)\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Imports the needed VMware Modules.\n    #>\n    [void] ImportRequiredModules() {\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        Import-Module -Name VMware.VimAutomation.Core\n\n        $global:VerbosePreference = $savedVerbosePreference\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns all passed PowerCLI configuration properties as a hashtable.\n    #>\n    [hashtable] GetPowerCLIConfigurationProperties() {\n        $powerCLIConfigurationProperties = @{}\n\n        # Adds the Default Scope to the hashtable.\n        $powerCLIConfigurationProperties.Add(\"Scope\", $this.Scope)\n\n        if ($this.CEIPDataTransferProxyPolicy -ne [ProxyPolicy]::Unset -and $this.ParticipateInCeip -eq $true) {\n            $powerCLIConfigurationProperties.Add(\"CEIPDataTransferProxyPolicy\", $this.CEIPDataTransferProxyPolicy)\n        }\n\n        if ($this.DefaultVIServerMode -ne [DefaultVIServerMode]::Unset) {\n            $powerCLIConfigurationProperties.Add(\"DefaultVIServerMode\", $this.DefaultVIServerMode)\n        }\n\n        if ($null -ne $this.DisplayDeprecationWarnings) {\n            $powerCLIConfigurationProperties.Add(\"DisplayDeprecationWarnings\", $this.DisplayDeprecationWarnings)\n        }\n\n        if ($this.InvalidCertificateAction -ne [BadCertificateAction]::Unset) {\n            $powerCLIConfigurationProperties.Add(\"InvalidCertificateAction\", $this.InvalidCertificateAction)\n        }\n\n        if ($null -ne $this.ParticipateInCeip) {\n            $powerCLIConfigurationProperties.Add(\"ParticipateInCeip\", $this.ParticipateInCeip)\n        }\n\n        if ($this.ProxyPolicy -ne [ProxyPolicy]::Unset) {\n            $powerCLIConfigurationProperties.Add(\"ProxyPolicy\", $this.ProxyPolicy)\n        }\n\n        if ($null -ne $this.WebOperationTimeoutSeconds) {\n            $powerCLIConfigurationProperties.Add(\"WebOperationTimeoutSeconds\", $this.WebOperationTimeoutSeconds)\n        }\n\n        return $powerCLIConfigurationProperties\n    }\n\n    <#\n    .DESCRIPTION\n\n    Constructs the Set-PowerCLIConfiguration cmdlet with the passed properties.\n    This function is used instead of splatting because at the moment Pester does not allow to pass hashtable in the ParameterFilter property of the Assert-MockCalled function.\n    There is an open issue in GitHub: (https://github.com/pester/Pester/issues/862) describing the problem in details.\n    So with this function we can successfully test which properties are passed to the Set-PowerCLIConfiguration cmdlet.\n    #>\n    [string] ConstructCommandWithParameters($commandName, $properties, $namesOfProperties) {\n        $constructedCommand = [System.Text.StringBuilder]::new()\n\n        # Adds the command name to the constructed command.\n        [void]$constructedCommand.Append(\"$commandName \")\n\n        # For every property name we add the property value with the following syntax: '-Property Value'.\n        foreach ($propertyName in $namesOfProperties) {\n            $propertyValue = $properties.$propertyName\n\n            <#\n            For bool values we need to add another '$' sign so the value can be evaluated to bool.\n            So we check the type of the value and if it is a boolean we add another '$' sign, because without it the value will\n            not be evaluated to boolean and instead it will be evaluated to string which will cause an exception of mismatching types.\n            #>\n            if ($propertyValue.GetType().Name -eq 'Boolean') {\n                [void]$constructedCommand.Append(\"-$propertyName $\")\n                [void]$constructedCommand.Append(\"$propertyValue \")\n            }\n            else {\n                [void]$constructedCommand.Append(\"-$propertyName $propertyValue \")\n            }\n        }\n\n        # Adds the confirm:$false to the command to ignore the confirmation.\n        [void]$constructedCommand.Append(\"-Confirm:`$false\")\n\n        # Converts the StringBuilder to String and returns the result.\n        return $constructedCommand.ToString()\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the current PowerCLI Configuration is equal to the Desired Configuration.\n    #>\n    [bool] Equals($powerCLICurrentConfiguration, $powerCLIDesiredConfiguration) {\n        foreach ($key in $powerCLIDesiredConfiguration.Keys) {\n            <#\n            Currently works only for properties which are numbers, strings and enums. For more complex types like\n            Hashtable the logic needs to be modified to work correctly.\n            #>\n            if ($powerCLIDesiredConfiguration.$key.ToString() -ne $powerCLICurrentConfiguration.$key.ToString()) {\n                return $false\n            }\n        }\n\n        return $true\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the PowerCLI settings from the server.\n    #>\n    [void] PopulateResult($powerCLICurrentConfiguration, $result) {\n        $result.SettingsScope = $this.SettingsScope\n        $result.CEIPDataTransferProxyPolicy = if ($null -ne $powerCLICurrentConfiguration.CEIPDataTransferProxyPolicy) { $powerCLICurrentConfiguration.CEIPDataTransferProxyPolicy.ToString() } else { [ProxyPolicy]::Unset }\n        $result.DefaultVIServerMode = if ($null -ne $powerCLICurrentConfiguration.DefaultVIServerMode) { $powerCLICurrentConfiguration.DefaultVIServerMode.ToString() } else { [DefaultVIServerMode]::Unset }\n        $result.DisplayDeprecationWarnings = $powerCLICurrentConfiguration.DisplayDeprecationWarnings\n        $result.InvalidCertificateAction = if ($null -ne $powerCLICurrentConfiguration.InvalidCertificateAction) { $powerCLICurrentConfiguration.InvalidCertificateAction.ToString() } else { [BadCertificateAction]::Unset }\n        $result.ParticipateInCeip = $powerCLICurrentConfiguration.ParticipateInCEIP\n        $result.ProxyPolicy = if ($null -ne $powerCLICurrentConfiguration.ProxyPolicy) { $powerCLICurrentConfiguration.ProxyPolicy.ToString() } else { [ProxyPolicy]::Unset }\n        $result.WebOperationTimeoutSeconds = $powerCLICurrentConfiguration.WebOperationTimeoutSeconds\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/StandardPortGroup.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'StandardPortGroup.schema.psm1'\n\n# Version number of this module.\nModuleVersion = '1.0'\n\n# ID used to uniquely identify this module\nGUID = 'ff5427e3-1a15-48af-92da-2941e051c9e7'\n\n# Author of this module\nAuthor = 'VMware'\n\n# Company or vendor of this module\nCompanyName = 'VMware'\n\n# Copyright statement for this module\nCopyright = '(c) 2018-2020 VMware. All rights reserved.'\n\n# Description of the functionality provided by this module\nDescription = 'Standard Port Group DSC Composite Resource.'\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.1'\n\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/StandardPortGroup.schema.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:moduleRoot = (Get-Item -Path $PSScriptRoot).Parent.Parent.FullName\n. \"$script:moduleRoot/VMware.vSphereDSC.CompositeResourcesHelper.ps1\"\n\nConfiguration StandardPortGroup {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VssName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [ValidateSet('Present', 'Absent')]\n        [string]\n        $Ensure,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $VLanId,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $AllowPromiscuous,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $AllowPromiscuousInherited,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $ForgedTransmits,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $ForgedTransmitsInherited,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $MacChanges,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $MacChangesInherited,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $Enabled,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[long]]\n        $AverageBandwidth,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[long]]\n        $PeakBandwidth,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[long]]\n        $BurstSize,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $FailbackEnabled,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('LoadBalanceIP', 'LoadBalanceSrcMac', 'LoadBalanceSrcId', 'ExplicitFailover', 'Unset')]\n        [string]\n        $LoadBalancingPolicy = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [string[]]\n        $ActiveNic,\n\n        [Parameter(Mandatory = $false)]\n        [string[]]\n        $StandbyNic,\n\n        [Parameter(Mandatory = $false)]\n        [string[]]\n        $UnusedNic,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('LinkStatus', 'BeaconProbing', 'Unset')]\n        [string]\n        $NetworkFailoverDetectionPolicy = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $NotifySwitches,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $InheritFailback,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $InheritFailoverOrder,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $InheritLoadBalancingPolicy,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $InheritNetworkFailoverDetectionPolicy,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $InheritNotifySwitches\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    # Constructs VMHostVssPortGroup Resource Block.\n    $nullableVMHostVssPortGroupProperties = @{\n        Server = $Server\n        Credential = $Credential\n        VLanId = $VLanId\n    }\n    $vmHostVssPortGroupProperties = @{\n        VMHostName = $VMHostName\n        Name = $Name\n        VssName = $VssName\n        Ensure = $Ensure\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssPortGroupProperties -NullableProperties $nullableVMHostVssPortGroupProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssPortGroup' -Properties $vmHostVssPortGroupProperties\n    $dscResourceBlock.Invoke($vmHostVssPortGroupProperties)\n\n    # Constructs VMHostVssPortGroupShaping Resource Block.\n    $nullableVMHostVssPortGroupShapingProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Enabled = $Enabled\n        AverageBandwidth = $AverageBandwidth\n        PeakBandwidth = $PeakBandwidth\n        BurstSize = $BurstSize\n    }\n    $vmHostVssPortGroupShapingProperties = @{\n        VMHostName = $VMHostName\n        Name = $Name\n        Ensure = $Ensure\n        DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssPortGroupShapingProperties -NullableProperties $nullableVMHostVssPortGroupShapingProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssPortGroupShaping' -Properties $vmHostVssPortGroupShapingProperties\n    $dscResourceBlock.Invoke($vmHostVssPortGroupShapingProperties)\n\n    # Constructs VMHostVssPortGroupSecurity Resource Block.\n    $nullableVMHostVssPortGroupSecurityProperties = @{\n        Server = $Server\n        Credential = $Credential\n        AllowPromiscuous = $AllowPromiscuous\n        AllowPromiscuousInherited = $AllowPromiscuousInherited\n        ForgedTransmits = $ForgedTransmits\n        ForgedTransmitsInherited = $ForgedTransmitsInherited\n        MacChanges = $MacChanges\n        MacChangesInherited = $MacChangesInherited\n    }\n    $vmHostVssPortGroupSecurityProperties = @{\n        VMHostName = $VMHostName\n        Name = $Name\n        Ensure = $Ensure\n        DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssPortGroupSecurityProperties -NullableProperties $nullableVMHostVssPortGroupSecurityProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssPortGroupSecurity' -Properties $vmHostVssPortGroupSecurityProperties\n    $dscResourceBlock.Invoke($vmHostVssPortGroupSecurityProperties)\n\n    # Constructs VMHostVssPortGroupTeaming Resource Block.\n    $nullableVMHostVssPortGroupTeamingProperties = @{\n        Server = $Server\n        Credential = $Credential\n        FailbackEnabled = $FailbackEnabled\n        NotifySwitches = $NotifySwitches\n        InheritFailback = $InheritFailback\n        InheritFailoverOrder = $InheritFailoverOrder\n        InheritLoadBalancingPolicy = $InheritLoadBalancingPolicy\n        InheritNetworkFailoverDetectionPolicy = $InheritNetworkFailoverDetectionPolicy\n        InheritNotifySwitches = $InheritNotifySwitches\n    }\n    $vmHostVssPortGroupTeamingProperties = @{\n        VMHostName = $VMHostName\n        Name = $Name\n        Ensure = $Ensure\n        LoadBalancingPolicy = $LoadBalancingPolicy\n        ActiveNic = $ActiveNic\n        StandbyNic = $StandbyNic\n        UnusedNic = $UnusedNic\n        NetworkFailoverDetectionPolicy = $NetworkFailoverDetectionPolicy\n        DependsOn = \"[VMHostVssPortGroup]VMHostVssPortGroup\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssPortGroupTeamingProperties -NullableProperties $nullableVMHostVssPortGroupTeamingProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssPortGroupTeaming' -Properties $vmHostVssPortGroupTeamingProperties\n    $dscResourceBlock.Invoke($vmHostVssPortGroupTeamingProperties)\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/VMHostVssPortGroup.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssPortGroup : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Name of the Virtual Switch associated with the Port Group.\n    The Virtual Switch must be a Standard Virtual Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $VssName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the VLAN ID for ports using this Port Group. The following values are valid:\n    0 - specifies that you do not want to associate the Port Group with a VLAN.\n    1 to 4094 - specifies a VLAN ID for the Port Group.\n    4095 - specifies that the Port Group should use trunk mode, which allows the guest operating system to manage its own VLAN tags.\n    #>\n    [DscProperty()]\n    [nullable[int]] $VLanId\n\n    hidden [int] $VLanIdMaxValue = 4095\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $portGroup = $this.GetVirtualPortGroup($virtualSwitch)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $portGroup) {\n                    $this.AddVirtualPortGroup($virtualSwitch)\n                }\n                else {\n                    $this.UpdateVirtualPortGroup($portGroup)\n                }\n            }\n            else {\n                if ($null -ne $portGroup) {\n                    $this.RemoveVirtualPortGroup($portGroup)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $portGroup = $this.GetVirtualPortGroup($virtualSwitch)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $portGroup) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateDscResourceSetting('VLanId', $portGroup.VLanId, $this.VLanId)\n                }\n            }\n            else {\n                $result = ($null -eq $portGroup)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroup] Get() {\n        try {\n            $result = [VMHostVssPortGroup]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $portGroup = $this.GetVirtualPortGroup($virtualSwitch)\n\n            $result.VMHostName = $this.VMHost.Name\n            $this.PopulateResult($portGroup, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Switch with the specified name from the server if it exists.\n    The Virtual Switch must be a Standard Virtual Switch. If the Virtual Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVirtualSwitch() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            return Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction SilentlyContinue\n        }\n        else {\n            try {\n                $virtualSwitch = Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction Stop\n                return $virtualSwitch\n            }\n            catch {\n                throw \"Could not retrieve Virtual Switch $($this.VssName) of VMHost $($this.VMHost.Name). For more information: $($_.Exception.Message)\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group with the specified Name, available on the specified Virtual Switch and VMHost from the server if it exists,\n    otherwise returns $null.\n    #>\n    [PSObject] GetVirtualPortGroup($virtualSwitch) {\n        if ($null -eq $virtualSwitch) {\n            <#\n            If the Virtual Switch is $null, it means that Ensure was set to 'Absent' and\n            the Port Group does not exist for the specified Virtual Switch.\n            #>\n            return $null\n        }\n\n        return Get-VirtualPortGroup -Server $this.Connection -Name $this.Name -VirtualSwitch $virtualSwitch -VMHost $this.VMHost -ErrorAction SilentlyContinue\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the passed VLanId value is in the range [0, 4095].\n    #>\n    [void] EnsureVLanIdValueIsValid() {\n        if ($this.VLanId -lt 0 -or $this.VLanId -gt $this.VLanIdMaxValue) {\n            throw \"The passed VLanId value $($this.VLanId) is not valid. The valid values are in the following range: [0, $($this.VLanIdMaxValue)].\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Port Group parameters.\n    #>\n    [hashtable] GetPortGroupParams() {\n        $portGroupParams = @{}\n\n        $portGroupParams.Confirm = $false\n        $portGroupParams.ErrorAction = 'Stop'\n\n        if ($null -ne $this.VLanId) {\n            $this.EnsureVLanIdValueIsValid()\n            $portGroupParams.VLanId = $this.VLanId\n        }\n\n        return $portGroupParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Port Group available on the specified Virtual Switch.\n    #>\n    [void] AddVirtualPortGroup($virtualSwitch) {\n        $portGroupParams = $this.GetPortGroupParams()\n\n        $portGroupParams.Server = $this.Connection\n        $portGroupParams.Name = $this.Name\n        $portGroupParams.VirtualSwitch = $virtualSwitch\n\n        try {\n            New-VirtualPortGroup @portGroupParams\n        }\n        catch {\n            throw \"Cannot create Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Port Group by changing its VLanId value.\n    #>\n    [void] UpdateVirtualPortGroup($portGroup) {\n        $portGroupParams = $this.GetPortGroupParams()\n\n        try {\n            $portGroup | Set-VirtualPortGroup @portGroupParams\n        }\n        catch {\n            throw \"Cannot update Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Port Group available on the Virtual Switch. All VMs connected to the Port Group must be PoweredOff to successfully remove the Port Group.\n    If one or more of the VMs are PoweredOn, the removal would not be successful because the Port Group is used by the VMs.\n    #>\n    [void] RemoveVirtualPortGroup($portGroup) {\n        try {\n            $portGroup | Remove-VirtualPortGroup -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw \"Cannot remove Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Port Group from the server.\n    #>\n    [void] PopulateResult($portGroup, $result) {\n        if ($null -ne $portGroup) {\n            $result.Name = $portGroup.Name\n            $result.VssName = $portGroup.VirtualSwitchName\n            $result.Ensure = [Ensure]::Present\n            $result.VLanId = $portGroup.VLanId\n        }\n        else {\n            $result.Name = $this.Name\n            $result.VssName = $this.VssName\n            $result.Ensure = [Ensure]::Absent\n            $result.VLanId = $this.VLanId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/VMHostVssPortGroupSecurity.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssPortGroupSecurity : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies whether promiscuous mode is enabled for the corresponding Virtual Port Group.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllowPromiscuous\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the AllowPromiscuous setting is inherited from the parent Standard Virtual Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllowPromiscuousInherited\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether forged transmits are enabled for the corresponding Virtual Port Group.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ForgedTransmits\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the ForgedTransmits setting is inherited from the parent Standard Virtual Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ForgedTransmitsInherited\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether MAC address changes are enabled for the corresponding Virtual Port Group.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MacChanges\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the MacChanges setting is inherited from the parent Standard Virtual Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MacChangesInherited\n\n    hidden [string] $AllowPromiscuousSettingName = 'AllowPromiscuous'\n    hidden [string] $AllowPromiscuousInheritedSettingName = 'AllowPromiscuousInherited'\n    hidden [string] $ForgedTransmitsSettingName = 'ForgedTransmits'\n    hidden [string] $ForgedTransmitsInheritedSettingName = 'ForgedTransmitsInherited'\n    hidden [string] $MacChangesSettingName = 'MacChanges'\n    hidden [string] $MacChangesInheritedSettingName = 'MacChangesInherited'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            $virtualPortGroupSecurityPolicy = $this.GetVirtualPortGroupSecurityPolicy($virtualPortGroup)\n\n            $this.UpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $result = $null\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result = $true\n            }\n            else {\n                $virtualPortGroupSecurityPolicy = $this.GetVirtualPortGroupSecurityPolicy($virtualPortGroup)\n                $result = !$this.ShouldUpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroupSecurity] Get() {\n        try {\n            $result = [VMHostVssPortGroupSecurity]::new()\n            $result.Server = $this.Server\n            $result.Ensure = $this.Ensure\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $result.VMHostName = $this.VMHost.Name\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result.Name = $this.Name\n                return $result\n            }\n\n            $virtualPortGroupSecurityPolicy = $this.GetVirtualPortGroupSecurityPolicy($virtualPortGroup)\n            $result.Name = $virtualPortGroup.Name\n\n            $this.PopulateResult($virtualPortGroupSecurityPolicy, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group Security Policy from the server.\n    #>\n    [PSObject] GetVirtualPortGroupSecurityPolicy($virtualPortGroup) {\n        try {\n            $virtualPortGroupSecurityPolicy = Get-SecurityPolicy -Server $this.Connection -VirtualPortGroup $virtualPortGroup -ErrorAction Stop\n            return $virtualPortGroupSecurityPolicy\n        }\n        catch {\n            throw \"Could not retrieve Virtual Port Group $($this.PortGroup) Security Policy. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Security Policy of the specified Virtual Port Group should be updated.\n    #>\n    [bool] ShouldUpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy) {\n        $shouldUpdateVirtualPortGroupSecurityPolicy = @(\n            $this.ShouldUpdateDscResourceSetting('AllowPromiscuous', $virtualPortGroupSecurityPolicy.AllowPromiscuous, $this.AllowPromiscuous),\n            $this.ShouldUpdateDscResourceSetting('AllowPromiscuousInherited', $virtualPortGroupSecurityPolicy.AllowPromiscuousInherited, $this.AllowPromiscuousInherited),\n            $this.ShouldUpdateDscResourceSetting('ForgedTransmits', $virtualPortGroupSecurityPolicy.ForgedTransmits, $this.ForgedTransmits),\n            $this.ShouldUpdateDscResourceSetting('ForgedTransmitsInherited', $virtualPortGroupSecurityPolicy.ForgedTransmitsInherited, $this.ForgedTransmitsInherited),\n            $this.ShouldUpdateDscResourceSetting('MacChanges', $virtualPortGroupSecurityPolicy.MacChanges, $this.MacChanges),\n            $this.ShouldUpdateDscResourceSetting('MacChangesInherited', $virtualPortGroupSecurityPolicy.MacChangesInherited, $this.MacChangesInherited)\n        )\n\n        return ($shouldUpdateVirtualPortGroupSecurityPolicy -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Security Policy of the specified Virtual Port Group.\n    #>\n    [void] UpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy) {\n        $securityPolicyParams = @{}\n        $securityPolicyParams.VirtualPortGroupPolicy = $virtualPortGroupSecurityPolicy\n\n        $this.PopulatePolicySetting($securityPolicyParams, $this.AllowPromiscuousSettingName, $this.AllowPromiscuous, $this.AllowPromiscuousInheritedSettingName, $this.AllowPromiscuousInherited)\n        $this.PopulatePolicySetting($securityPolicyParams, $this.ForgedTransmitsSettingName, $this.ForgedTransmits, $this.ForgedTransmitsInheritedSettingName, $this.ForgedTransmitsInherited)\n        $this.PopulatePolicySetting($securityPolicyParams, $this.MacChangesSettingName, $this.MacChanges, $this.MacChangesInheritedSettingName, $this.MacChangesInherited)\n\n        try {\n            Set-SecurityPolicy @securityPolicyParams\n        }\n        catch {\n            throw \"Cannot update Security Policy of Virtual Port Group $($this.PortGroup). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security Policy of the specified Virtual Port Group from the server.\n    #>\n    [void] PopulateResult($virtualPortGroupSecurityPolicy, $result) {\n        $result.AllowPromiscuous = $virtualPortGroupSecurityPolicy.AllowPromiscuous\n        $result.AllowPromiscuousInherited = $virtualPortGroupSecurityPolicy.AllowPromiscuousInherited\n        $result.ForgedTransmits = $virtualPortGroupSecurityPolicy.ForgedTransmits\n        $result.ForgedTransmitsInherited = $virtualPortGroupSecurityPolicy.ForgedTransmitsInherited\n        $result.MacChanges = $virtualPortGroupSecurityPolicy.MacChanges\n        $result.MacChangesInherited = $virtualPortGroupSecurityPolicy.MacChangesInherited\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/VMHostVssPortGroupShaping.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssPortGroupShaping : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not traffic shaper is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    The average bandwidth in bits per second if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $AverageBandwidth\n\n    <#\n    .DESCRIPTION\n\n    The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $PeakBandwidth\n\n    <#\n    .DESCRIPTION\n\n    The maximum burst size allowed in bytes if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $BurstSize\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $this.GetVMHostNetworkSystem()\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $this.UpdateVirtualPortGroupShapingPolicy($virtualPortGroup)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $result = $null\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result = $true\n            }\n            else {\n                $result = !$this.ShouldUpdateVirtualPortGroupShapingPolicy($virtualPortGroup)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroupShaping] Get() {\n        try {\n            $result = [VMHostVssPortGroupShaping]::new()\n            $result.Server = $this.Server\n            $result.Ensure = $this.Ensure\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $result.VMHostName = $this.VMHost.Name\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result.Name = $this.Name\n                return $result\n            }\n\n            $result.Name = $virtualPortGroup.Name\n            $this.PopulateResult($virtualPortGroup, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Shaping Policy of the specified Virtual Port Group should be updated.\n    #>\n    [bool] ShouldUpdateVirtualPortGroupShapingPolicy($virtualPortGroup) {\n        $shapingPolicy = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy\n\n        $shouldUpdateVirtualPortGroupShapingPolicy = @(\n            $this.ShouldUpdateDscResourceSetting('Enabled', $shapingPolicy.Enabled, $this.Enabled),\n            $this.ShouldUpdateDscResourceSetting('AverageBandwidth', $shapingPolicy.AverageBandwidth, $this.AverageBandwidth),\n            $this.ShouldUpdateDscResourceSetting('PeakBandwidth', $shapingPolicy.PeakBandwidth, $this.PeakBandwidth),\n            $this.ShouldUpdateDscResourceSetting('BurstSize', $shapingPolicy.BurstSize, $this.BurstSize)\n        )\n\n        return ($shouldUpdateVirtualPortGroupShapingPolicy -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Shaping Policy of the specified Virtual Port Group.\n    #>\n    [void] UpdateVirtualPortGroupShapingPolicy($virtualPortGroup) {\n        $virtualPortGroupSpec = New-Object VMware.Vim.HostPortGroupSpec\n\n        $virtualPortGroupSpec.Name = $virtualPortGroup.Name\n        $virtualPortGroupSpec.VswitchName = $virtualPortGroup.VirtualSwitchName\n        $virtualPortGroupSpec.VlanId = $virtualPortGroup.VLanId\n\n        $virtualPortGroupSpec.Policy = New-Object VMware.Vim.HostNetworkPolicy\n        $virtualPortGroupSpec.Policy.ShapingPolicy = New-Object VMware.Vim.HostNetworkTrafficShapingPolicy\n\n        if ($null -ne $this.Enabled) { $virtualPortGroupSpec.Policy.ShapingPolicy.Enabled = $this.Enabled }\n        if ($null -ne $this.AverageBandwidth) { $virtualPortGroupSpec.Policy.ShapingPolicy.AverageBandwidth = $this.AverageBandwidth }\n        if ($null -ne $this.PeakBandwidth) { $virtualPortGroupSpec.Policy.ShapingPolicy.PeakBandwidth = $this.PeakBandwidth }\n        if ($null -ne $this.BurstSize) { $virtualPortGroupSpec.Policy.ShapingPolicy.BurstSize = $this.BurstSize }\n\n        try {\n            Update-VirtualPortGroup -VMHostNetworkSystem $this.VMHostNetworkSystem -VirtualPortGroupName $virtualPortGroup.Name -Spec $virtualPortGroupSpec\n        }\n        catch {\n            throw \"Cannot update Shaping Policy of Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Shaping Policy of the specified Virtual Port Group from the server.\n    #>\n    [void] PopulateResult($virtualPortGroup, $result) {\n        $result.Enabled = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.Enabled\n        $result.AverageBandwidth = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.AverageBandwidth\n        $result.PeakBandwidth = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.PeakBandwidth\n        $result.BurstSize = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.BurstSize\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/VMHostVssPortGroupTeaming.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssPortGroupTeaming : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies how a physical adapter is returned to active duty after recovering from a failure.\n    If the value is $true, the adapter is returned to active duty immediately on recovery, displacing the standby adapter that took over its slot, if any.\n    If the value is $false, a failed adapter is left inactive even after recovery until another active adapter fails, requiring its replacement.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $FailbackEnabled\n\n    <#\n    .DESCRIPTION\n\n    Determines how network traffic is distributed between the network adapters assigned to a switch. The following values are valid:\n    LoadBalanceIP - Route based on IP hash. Choose an uplink based on a hash of the source and destination IP addresses of each packet.\n    For non-IP packets, whatever is at those offsets is used to compute the hash.\n    LoadBalanceSrcMac - Route based on source MAC hash. Choose an uplink based on a hash of the source Ethernet.\n    LoadBalanceSrcId - Route based on the originating port ID. Choose an uplink based on the virtual port where the traffic entered the virtual switch.\n    ExplicitFailover - Always use the highest order uplink from the list of Active adapters that passes failover detection criteria.\n    #>\n    [DscProperty()]\n    [LoadBalancingPolicy] $LoadBalancingPolicy = [LoadBalancingPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the adapters you want to continue to use when the network adapter connectivity is available and active.\n    #>\n    [DscProperty()]\n    [string[]] $ActiveNic\n\n    <#\n    .DESCRIPTION\n\n    Specifies the adapters you want to use if one of the active adapter's connectivity is unavailable.\n    #>\n    [DscProperty()]\n    [string[]] $StandbyNic\n\n    <#\n    .DESCRIPTION\n\n    Specifies the adapters you do not want to use.\n    #>\n    [DscProperty()]\n    [string[]] $UnusedNic\n\n    <#\n    .DESCRIPTION\n\n    Specifies how to reroute traffic in the event of an adapter failure. The following values are valid:\n    LinkStatus - Relies solely on the link status that the network adapter provides. This option detects failures, such as cable pulls and physical switch power failures,\n    but not configuration errors, such as a physical switch port being blocked by spanning tree or misconfigured to the wrong VLAN or cable pulls on the other side of a physical switch.\n    BeaconProbing - Sends out and listens for beacon probes on all NICs in the team and uses this information, in addition to link status, to determine link failure.\n    This option detects many of the failures mentioned above that are not detected by link status alone.\n    #>\n    [DscProperty()]\n    [NetworkFailoverDetectionPolicy] $NetworkFailoverDetectionPolicy = [NetworkFailoverDetectionPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Indicates that whenever a virtual NIC is connected to the virtual switch or whenever that virtual NIC's traffic is routed over a different physical NIC in the team because of a\n    failover event, a notification is sent over the network to update the lookup tables on the physical switches.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $NotifySwitches\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the FailbackEnabled parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritFailback\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the values of the ActiveNic, StandbyNic, and UnusedNic parameters are inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritFailoverOrder\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the LoadBalancingPolicy parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritLoadBalancingPolicy\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the NetworkFailoverDetectionPolicy parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritNetworkFailoverDetectionPolicy\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the NotifySwitches parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritNotifySwitches\n\n    hidden [string] $FailbackEnabledSettingName = 'FailbackEnabled'\n    hidden [string] $InheritFailbackSettingName = 'InheritFailback'\n    hidden [string] $LoadBalancingPolicySettingName = 'LoadBalancingPolicy'\n    hidden [string] $InheritLoadBalancingPolicySettingName = 'InheritLoadBalancingPolicy'\n    hidden [string] $NetworkFailoverDetectionPolicySettingName = 'NetworkFailoverDetectionPolicy'\n    hidden [string] $InheritNetworkFailoverDetectionPolicySettingName = 'InheritNetworkFailoverDetectionPolicy'\n    hidden [string] $NotifySwitchesSettingName = 'NotifySwitches'\n    hidden [string] $InheritNotifySwitchesSettingName = 'InheritNotifySwitches'\n    hidden [string] $MakeNicActiveSettingName = 'MakeNicActive'\n    hidden [string] $MakeNicStandbySettingName = 'MakeNicStandby'\n    hidden [string] $MakeNicUnusedSettingName = 'MakeNicUnused'\n    hidden [string] $InheritFailoverOrderSettingName = 'InheritFailoverOrder'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            $virtualPortGroupTeamingPolicy = $this.GetVirtualPortGroupTeamingPolicy($virtualPortGroup)\n\n            $this.UpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $result = $null\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result = $true\n            }\n            else {\n                $virtualPortGroupTeamingPolicy = $this.GetVirtualPortGroupTeamingPolicy($virtualPortGroup)\n                $result = !$this.ShouldUpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroupTeaming] Get() {\n        try {\n            $result = [VMHostVssPortGroupTeaming]::new()\n            $result.Server = $this.Server\n            $result.Ensure = $this.Ensure\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $result.VMHostName = $this.VMHost.Name\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result.Name = $this.Name\n                return $result\n            }\n\n            $virtualPortGroupTeamingPolicy = $this.GetVirtualPortGroupTeamingPolicy($virtualPortGroup)\n            $result.Name = $virtualPortGroup.Name\n\n            $this.PopulateResult($virtualPortGroupTeamingPolicy, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group Teaming Policy from the server.\n    #>\n    [PSObject] GetVirtualPortGroupTeamingPolicy($virtualPortGroup) {\n        try {\n            $virtualPortGroupTeamingPolicy = Get-NicTeamingPolicy -Server $this.Connection -VirtualPortGroup $virtualPortGroup -ErrorAction Stop\n            return $virtualPortGroupTeamingPolicy\n        }\n        catch {\n            throw \"Could not retrieve Virtual Port Group $($this.Name) Teaming Policy. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Teaming Policy of the specified Virtual Port Group should be updated.\n    #>\n    [bool] ShouldUpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy) {\n        $shouldUpdateVirtualPortGroupTeamingPolicy = @(\n            $this.ShouldUpdateDscResourceSetting('FailbackEnabled', $virtualPortGroupTeamingPolicy.FailbackEnabled, $this.FailbackEnabled),\n            $this.ShouldUpdateDscResourceSetting('NotifySwitches', $virtualPortGroupTeamingPolicy.NotifySwitches, $this.NotifySwitches),\n            $this.ShouldUpdateDscResourceSetting('InheritFailback', $virtualPortGroupTeamingPolicy.IsFailbackInherited, $this.InheritFailback),\n            $this.ShouldUpdateDscResourceSetting('InheritFailoverOrder', $virtualPortGroupTeamingPolicy.IsFailoverOrderInherited, $this.InheritFailoverOrder),\n            $this.ShouldUpdateDscResourceSetting('InheritLoadBalancingPolicy', $virtualPortGroupTeamingPolicy.IsLoadBalancingInherited, $this.InheritLoadBalancingPolicy),\n            $this.ShouldUpdateDscResourceSetting(\n                'InheritNetworkFailoverDetectionPolicy',\n                $virtualPortGroupTeamingPolicy.IsNetworkFailoverDetectionInherited,\n                $this.InheritNetworkFailoverDetectionPolicy\n            ),\n            $this.ShouldUpdateDscResourceSetting('InheritNotifySwitches', $virtualPortGroupTeamingPolicy.IsNotifySwitchesInherited, $this.InheritNotifySwitches),\n            $this.ShouldUpdateDscResourceSetting('LoadBalancingPolicy', [string] $virtualPortGroupTeamingPolicy.LoadBalancingPolicy, $this.LoadBalancingPolicy.ToString()),\n            $this.ShouldUpdateDscResourceSetting(\n                'NetworkFailoverDetectionPolicy',\n                [string] $virtualPortGroupTeamingPolicy.NetworkFailoverDetectionPolicy,\n                $this.NetworkFailoverDetectionPolicy.ToString()\n            ),\n            $this.ShouldUpdateArraySetting('ActiveNic', $virtualPortGroupTeamingPolicy.ActiveNic, $this.ActiveNic),\n            $this.ShouldUpdateArraySetting('StandbyNic', $virtualPortGroupTeamingPolicy.StandbyNic, $this.StandbyNic),\n            $this.ShouldUpdateArraySetting('UnusedNic', $virtualPortGroupTeamingPolicy.UnusedNic, $this.UnusedNic)\n        )\n\n        return ($shouldUpdateVirtualPortGroupTeamingPolicy -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the specified Enum Policy Setting. If the Inherited Setting is passed and set to $true,\n    the Policy Setting should not be populated because \"Parameters of the form \"XXX\" and \"InheritXXX\" are mutually exclusive.\"\n    If the Inherited Setting is set to $false, both parameters can be populated.\n    #>\n    [void] PopulateEnumPolicySetting($policyParams, $policySettingName, $policySetting, $policySettingInheritedName, $policySettingInherited) {\n        if ($policySetting -ne 'Unset') {\n            if ($null -eq $policySettingInherited -or !$policySettingInherited) {\n                $policyParams.$policySettingName = $policySetting\n            }\n        }\n\n        if ($null -ne $policySettingInherited) { $policyParams.$policySettingInheritedName = $policySettingInherited }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the specified Array Policy Setting. If the Inherited Setting is passed and set to $true,\n    the Policy Setting should not be populated because \"Parameters of the form \"XXX\" and \"InheritXXX\" are mutually exclusive.\"\n    If the Inherited Setting is set to $false, both parameters can be populated.\n    #>\n    [void] PopulateArrayPolicySetting($policyParams, $policySettingName, $policySetting, $policySettingInheritedName, $policySettingInherited) {\n        if ($null -ne $policySetting -and $policySetting.Length -gt 0) {\n            if ($null -eq $policySettingInherited -or !$policySettingInherited) {\n                $policyParams.$policySettingName = $policySetting\n            }\n        }\n\n        if ($null -ne $policySettingInherited) { $policyParams.$policySettingInheritedName = $policySettingInherited }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Teaming Policy of the specified Virtual Port Group.\n    #>\n    [void] UpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy) {\n        $teamingPolicyParams = @{}\n        $teamingPolicyParams.VirtualPortGroupPolicy = $virtualPortGroupTeamingPolicy\n\n        $this.PopulatePolicySetting($teamingPolicyParams, $this.FailbackEnabledSettingName, $this.FailbackEnabled, $this.InheritFailbackSettingName, $this.InheritFailback)\n        $this.PopulatePolicySetting($teamingPolicyParams, $this.NotifySwitchesSettingName, $this.NotifySwitches, $this.InheritNotifySwitchesSettingName, $this.InheritNotifySwitches)\n\n        $this.PopulateEnumPolicySetting($teamingPolicyParams, $this.LoadBalancingPolicySettingName, $this.LoadBalancingPolicy.ToString(), $this.InheritLoadBalancingPolicySettingName, $this.InheritLoadBalancingPolicy)\n        $this.PopulateEnumPolicySetting($teamingPolicyParams, $this.NetworkFailoverDetectionPolicySettingName, $this.NetworkFailoverDetectionPolicy.ToString(), $this.InheritNetworkFailoverDetectionPolicySettingName, $this.InheritNetworkFailoverDetectionPolicy)\n\n        $this.PopulateArrayPolicySetting($teamingPolicyParams, $this.MakeNicActiveSettingName, $this.ActiveNic, $this.InheritFailoverOrderSettingName, $this.InheritFailoverOrder)\n        $this.PopulateArrayPolicySetting($teamingPolicyParams, $this.MakeNicStandbySettingName, $this.StandbyNic, $this.InheritFailoverOrderSettingName, $this.InheritFailoverOrder)\n        $this.PopulateArrayPolicySetting($teamingPolicyParams, $this.MakeNicUnusedSettingName, $this.UnusedNic, $this.InheritFailoverOrderSettingName, $this.InheritFailoverOrder)\n\n        try {\n            Set-NicTeamingPolicy @teamingPolicyParams\n        }\n        catch {\n            throw \"Cannot update Teaming Policy of Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Teaming Policy of the specified Virtual Port Group from the server.\n    #>\n    [void] PopulateResult($virtualPortGroupTeamingPolicy, $result) {\n        $result.FailbackEnabled = $virtualPortGroupTeamingPolicy.FailbackEnabled\n        $result.NotifySwitches = $virtualPortGroupTeamingPolicy.NotifySwitches\n        $result.LoadBalancingPolicy = $virtualPortGroupTeamingPolicy.LoadBalancingPolicy.ToString()\n        $result.NetworkFailoverDetectionPolicy = $virtualPortGroupTeamingPolicy.NetworkFailoverDetectionPolicy.ToString()\n        $result.ActiveNic = $virtualPortGroupTeamingPolicy.ActiveNic\n        $result.StandbyNic = $virtualPortGroupTeamingPolicy.StandbyNic\n        $result.UnusedNic = $virtualPortGroupTeamingPolicy.UnusedNic\n        $result.InheritFailback = $virtualPortGroupTeamingPolicy.IsFailbackInherited\n        $result.InheritNotifySwitches = $virtualPortGroupTeamingPolicy.IsNotifySwitchesInherited\n        $result.InheritLoadBalancingPolicy = $virtualPortGroupTeamingPolicy.IsLoadBalancingInherited\n        $result.InheritNetworkFailoverDetectionPolicy = $virtualPortGroupTeamingPolicy.IsNetworkFailoverDetectionInherited\n        $result.InheritFailoverOrder = $virtualPortGroupTeamingPolicy.IsFailoverOrderInherited\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/StandardSwitch.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'StandardSwitch.schema.psm1'\n\n# Version number of this module.\nModuleVersion = '1.0'\n\n# ID used to uniquely identify this module\nGUID = '427e294f-9add-4e3e-a63d-28dad679a8cd'\n\n# Author of this module\nAuthor = 'VMware'\n\n# Company or vendor of this module\nCompanyName = 'VMware'\n\n# Copyright statement for this module\nCopyright = '(c) 2018-2020 VMware. All rights reserved.'\n\n# Description of the functionality provided by this module\nDescription = 'Standard Switch DSC Composite Resource.'\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.1'\n\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/StandardSwitch.schema.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:moduleRoot = (Get-Item -Path $PSScriptRoot).Parent.Parent.FullName\n. \"$script:moduleRoot/VMware.vSphereDSC.CompositeResourcesHelper.ps1\"\n\nConfiguration StandardSwitch {\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [ValidateSet('Present', 'Absent')]\n        [string]\n        $Ensure,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Server,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateNotNullOrEmpty()]\n        [System.Management.Automation.PSCredential]\n        $Credential,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $Mtu,\n\n        [Parameter(Mandatory = $false)]\n        [string[]]\n        $NicDevice,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[int]]\n        $BeaconInterval,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('CDP', 'Unset')]\n        [string]\n        $LinkDiscoveryProtocolType = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('Advertise', 'Both', 'Listen', 'None', 'Unset')]\n        [string]\n        $LinkDiscoveryProtocolOperation = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $AllowPromiscuous,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $ForgedTransmits,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $MacChanges,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $Enabled,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[long]]\n        $AverageBandwidth,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[long]]\n        $PeakBandwidth,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[long]]\n        $BurstSize,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $CheckBeacon,\n\n        [Parameter(Mandatory = $false)]\n        [string[]]\n        $ActiveNic,\n\n        [Parameter(Mandatory = $false)]\n        [string[]]\n        $StandbyNic,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $NotifySwitches,\n\n        [Parameter(Mandatory = $false)]\n        [ValidateSet('Loadbalance_ip', 'Loadbalance_srcmac', 'Loadbalance_srcid', 'Failover_explicit', 'Unset')]\n        [string]\n        $Policy = 'Unset',\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $RollingOrder\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    # Constructs VMHostVss Resource Block.\n    $nullableVMHostVssProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Mtu = $Mtu\n    }\n    $vmHostVssProperties = @{\n        Name = $VMHostName\n        VssName = $Name\n        Ensure = $Ensure\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssProperties -NullableProperties $nullableVMHostVssProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVss' -Properties $vmHostVssProperties\n    $dscResourceBlock.Invoke($vmHostVssProperties)\n\n    # Constructs VMHostVssBridge Resource Block.\n    $nullableVMHostVssBridgeProperties = @{\n        Server = $Server\n        Credential = $Credential\n        BeaconInterval = $BeaconInterval\n    }\n    $vmHostVssBridgeProperties = @{\n        Name = $VMHostName\n        VssName = $Name\n        Ensure = $Ensure\n        NicDevice = $NicDevice\n        LinkDiscoveryProtocolProtocol = $LinkDiscoveryProtocolType\n        LinkDiscoveryProtocolOperation = $LinkDiscoveryProtocolOperation\n        DependsOn = \"[VMHostVss]VMHostVss\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssBridgeProperties -NullableProperties $nullableVMHostVssBridgeProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssBridge' -Properties $vmHostVssBridgeProperties\n    $dscResourceBlock.Invoke($vmHostVssBridgeProperties)\n\n    # Constructs VMHostVssShaping Resource Block.\n    $nullableVMHostVssShapingProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Enabled = $Enabled\n        AverageBandwidth = $AverageBandwidth\n        PeakBandwidth = $PeakBandwidth\n        BurstSize = $BurstSize\n    }\n    $vmHostVssShapingProperties = @{\n        Name = $VMHostName\n        VssName = $Name\n        Ensure = $Ensure\n        DependsOn = \"[VMHostVss]VMHostVss\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssShapingProperties -NullableProperties $nullableVMHostVssShapingProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssShaping' -Properties $vmHostVssShapingProperties\n    $dscResourceBlock.Invoke($vmHostVssShapingProperties)\n\n    # Constructs VMHostVssSecurity Resource Block.\n    $nullableVMHostVssSecurityProperties = @{\n        Server = $Server\n        Credential = $Credential\n        AllowPromiscuous = $AllowPromiscuous\n        ForgedTransmits = $ForgedTransmits\n        MacChanges = $MacChanges\n    }\n    $vmHostVssSecurityProperties = @{\n        Name = $VMHostName\n        VssName = $Name\n        Ensure = $Ensure\n        DependsOn = \"[VMHostVss]VMHostVss\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssSecurityProperties -NullableProperties $nullableVMHostVssSecurityProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssSecurity' -Properties $vmHostVssSecurityProperties\n    $dscResourceBlock.Invoke($vmHostVssSecurityProperties)\n\n    # Constructs VMHostVssTeaming Resource Block.\n    $nullableVMHostVssTeamingProperties = @{\n        Server = $Server\n        Credential = $Credential\n        CheckBeacon = $CheckBeacon\n        NotifySwitches = $NotifySwitches\n        RollingOrder = $RollingOrder\n    }\n    $vmHostVssTeamingProperties = @{\n        Name = $VMHostName\n        VssName = $Name\n        Ensure = $Ensure\n        ActiveNic = $ActiveNic\n        StandbyNic = $StandbyNic\n        Policy = $Policy\n        DependsOn = \"[VMHostVss]VMHostVss\"\n    }\n\n    Push-NullablePropertiesToDscResourceBlock -ResourceBlockProperties $vmHostVssTeamingProperties -NullableProperties $nullableVMHostVssTeamingProperties\n    $dscResourceBlock = New-DscResourceBlock -ResourceName 'VMHostVssTeaming' -Properties $vmHostVssTeamingProperties\n    $dscResourceBlock.Invoke($vmHostVssTeamingProperties)\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/VMHostVss.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVss : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The maximum transmission unit (MTU) associated with this virtual switch in bytes.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Mtu\n\n    <#\n    .DESCRIPTION\n\n    The virtual switch key.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string] $Key\n\n    <#\n    .DESCRIPTION\n\n    The number of ports that this virtual switch currently has.\n    #>\n    [DscProperty(NotConfigurable)]\n    [int] $NumPorts\n\n    <#\n    .DESCRIPTION\n\n    The number of ports that are available on this virtual switch.\n    #>\n    [DscProperty(NotConfigurable)]\n    [int] $NumPortsAvailable\n\n    <#\n    .DESCRIPTION\n\n    The set of physical network adapters associated with this bridge.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string[]] $Pnic\n\n    <#\n    .DESCRIPTION\n\n    The list of port groups configured for this virtual switch.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string[]] $PortGroup\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n            \n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVss($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $result = ($null -eq $vss)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVss] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VMHostVss]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.Key) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVss should be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssTest = @(\n            $this.ShouldUpdateDscResourceSetting('VssName', $vss.Name, $this.VssName),\n            $this.ShouldUpdateDscResourceSetting('Mtu', $vss.Mtu, $this.Mtu)\n        )\n\n        return ($vssTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVss($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssConfigArgs = @{\n            Name = $this.VssName\n            Mtu = $this.Mtu\n        }\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($null -ne $vss) {\n                if ($this.Equals($vss)) {\n                    return\n                }\n                $vssConfigArgs.Add('Operation', 'edit')\n            }\n            else {\n                $vssConfigArgs.Add('Operation', 'add')\n            }\n        }\n        else {\n            if ($null -eq $vss) {\n                return\n            }\n            $vssConfigArgs.Add('Operation', 'remove')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssConfig $vssConfigArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the virtual switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSS) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSS.Key = $currentVss.Key\n            $vmHostVSS.Mtu = $currentVss.Mtu\n            $vmHostVSS.VssName = $currentVss.Name\n            $vmHostVSS.NumPortsAvailable = $currentVss.NumPortsAvailable\n            $vmHostVSS.Pnic = $currentVss.Pnic\n            $vmHostVSS.PortGroup = $currentVss.PortGroup\n        }\n        else{\n            $vmHostVSS.Key = [string]::Empty\n            $vmHostVSS.Mtu = $this.Mtu\n            $vmHostVSS.VssName = $this.VssName\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/VMHostVssBridge.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssBridge : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The list of keys of the physical network adapters to be bridged.\n    #>\n    [DscProperty()]\n    [string[]] $NicDevice\n\n    <#\n    .DESCRIPTION\n\n    The beacon configuration to probe for the validity of a link.\n    If this is set, beacon probing is configured and will be used.\n    If this is not set, beacon probing is disabled.\n    Determines how often, in seconds, a beacon should be sent.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BeaconInterval\n\n    <#\n    .DESCRIPTION\n\n    The link discovery protocol, whether to advertise or listen.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolOperation] $LinkDiscoveryProtocolOperation = [LinkDiscoveryProtocolOperation]::Unset\n\n    <#\n    .DESCRIPTION\n\n    The link discovery protocol type.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolProtocol] $LinkDiscoveryProtocolProtocol = [LinkDiscoveryProtocolProtocol]::Unset\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssBridge($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.NicDevice = @()\n                $this.BeaconInterval = 0\n                $this.LinkDiscoveryProtocolProtocol = [LinkDiscoveryProtocolProtocol]::Unset\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssBridge] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VMHostVssBridge]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssBridge should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssBridgeTest = @(\n            $this.ShouldUpdateArraySetting('NicDevice', $vss.Spec.Bridge.NicDevice, $this.NicDevice),\n            $this.ShouldUpdateDscResourceSetting('BeaconInterval', $vss.Spec.Bridge.Beacon.Interval, $this.BeaconInterval),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocolProtocol',\n                [string] $vss.Spec.Bridge.LinkDiscoveryProtocolConfig.Protocol,\n                $this.LinkDiscoveryProtocolProtocol.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocolOperation',\n                [string] $vss.Spec.Bridge.LinkDiscoveryProtocolConfig.Operation,\n                $this.LinkDiscoveryProtocolOperation.ToString()\n            )\n        )\n\n        return ($vssBridgeTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Bridge configuration of the virtual switch.\n    #>\n    [void] UpdateVssBridge($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssBridgeArgs = @{\n            Name = $this.VssName\n            NicDevice = $this.NicDevice\n        }\n\n        # The Bridge configuration of the Standard Switch should be populated only when the Nic devices are passed.\n        if ($this.NicDevice.Count -gt 0) {\n            if ($null -ne $this.BeaconInterval) { $vssBridgeArgs.BeaconInterval = $this.BeaconInterval }\n            if ($this.LinkDiscoveryProtocolProtocol -ne [LinkDiscoveryProtocolProtocol]::Unset) {\n                $vssBridgeArgs.Add('LinkDiscoveryProtocolProtocol', $this.LinkDiscoveryProtocolProtocol.ToString())\n                $vssBridgeArgs.Add('LinkDiscoveryProtocolOperation', $this.LinkDiscoveryProtocolOperation.ToString())\n            }\n        }\n\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n        }\n        else {\n            $vssBridgeArgs.NicDevice = @()\n        }\n        $vssBridgeArgs.Add('Operation', 'edit')\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssBridgeConfig $vssBridgeArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Bridge Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Bridge settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSBridge) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSBridge.VssName = $currentVss.Name\n            $vmHostVSSBridge.NicDevice = $currentVss.Spec.Bridge.NicDevice\n            $vmHostVSSBridge.BeaconInterval = $currentVss.Spec.Bridge.Beacon.Interval\n\n            if ($null -ne $currentVss.Spec.Bridge.linkDiscoveryProtocolConfig) {\n                $vmHostVSSBridge.LinkDiscoveryProtocolOperation = $currentVss.Spec.Bridge.LinkDiscoveryProtocolConfig.Operation.ToString()\n                $vmHostVSSBridge.LinkDiscoveryProtocolProtocol = $currentVss.Spec.Bridge.LinkDiscoveryProtocolConfig.Protocol.ToString()\n            }\n        }\n        else {\n            $vmHostVSSBridge.VssName = $this.VssName\n            $vmHostVSSBridge.NicDevice = $this.NicDevice\n            $vmHostVSSBridge.BeaconInterval = $this.BeaconInterval\n            $vmHostVSSBridge.LinkDiscoveryProtocolOperation = $this.LinkDiscoveryProtocolOperation\n            $vmHostVSSBridge.LinkDiscoveryProtocolProtocol = $this.LinkDiscoveryProtocolProtocol\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/VMHostVssSecurity.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssSecurity : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not all traffic is seen on the port.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllowPromiscuous\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not the virtual network adapter should be\n    allowed to send network traffic with a different MAC address than that of\n    the virtual network adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ForgedTransmits\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not the Media Access Control (MAC) address\n    can be changed.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MacChanges\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssSecurity($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.AllowPromiscuous = $false\n                $this.ForgedTransmits = $true\n                $this.MacChanges = $true\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssSecurity] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VMHostVssSecurity]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssSecurity should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssSecurityTest = @(\n            $this.ShouldUpdateDscResourceSetting('AllowPromiscuous', $vss.Spec.Policy.Security.AllowPromiscuous, $this.AllowPromiscuous),\n            $this.ShouldUpdateDscResourceSetting('ForgedTransmits', $vss.Spec.Policy.Security.ForgedTransmits, $this.ForgedTransmits),\n            $this.ShouldUpdateDscResourceSetting('MacChanges', $vss.Spec.Policy.Security.MacChanges, $this.MacChanges)\n        )\n\n        return ($vssSecurityTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVssSecurity($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssSecurityArgs = @{\n            Name = $this.VssName\n            AllowPromiscuous = $this.AllowPromiscuous\n            ForgedTransmits = $this.ForgedTransmits\n            MacChanges = $this.MacChanges\n        }\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n            $vssSecurityArgs.Add('Operation', 'edit')\n        }\n        else {\n            $vssSecurityArgs.AllowPromiscuous = $false\n            $vssSecurityArgs.ForgedTransmits = $true\n            $vssSecurityArgs.MacChanges = $true\n            $vssSecurityArgs.Add('Operation', 'edit')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssSecurityConfig $vssSecurityArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Security Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSSecurity) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSSecurity.VssName = $currentVss.Name\n            $vmHostVSSSecurity.AllowPromiscuous = $currentVss.Spec.Policy.Security.AllowPromiscuous\n            $vmHostVSSSecurity.ForgedTransmits = $currentVss.Spec.Policy.Security.ForgedTransmits\n            $vmHostVSSSecurity.MacChanges = $currentVss.Spec.Policy.Security.MacChanges\n        }\n        else {\n            $vmHostVSSSecurity.VssName = $this.VssName\n            $vmHostVSSSecurity.AllowPromiscuous = $this.AllowPromiscuous\n            $vmHostVSSSecurity.ForgedTransmits = $this.ForgedTransmits\n            $vmHostVSSSecurity.MacChanges = $this.MacChanges\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/VMHostVssShaping.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssShaping : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The average bandwidth in bits per second if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $AverageBandwidth\n\n    <#\n    .DESCRIPTION\n\n    The maximum burst size allowed in bytes if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $BurstSize\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not traffic shaper is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $PeakBandwidth\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssShaping($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.AverageBandwidth = 100000\n                $this.BurstSize = 100000\n                $this.Enabled = $false\n                $this.PeakBandwidth = 100000\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssShaping] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVssShaping]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssShaping should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssShapingTest = @(\n            $this.ShouldUpdateDscResourceSetting('AverageBandwidth', $vss.Spec.Policy.ShapingPolicy.AverageBandwidth, $this.AverageBandwidth),\n            $this.ShouldUpdateDscResourceSetting('BurstSize', $vss.Spec.Policy.ShapingPolicy.BurstSize, $this.BurstSize),\n            $this.ShouldUpdateDscResourceSetting('Enabled', $vss.Spec.Policy.ShapingPolicy.Enabled, $this.Enabled),\n            $this.ShouldUpdateDscResourceSetting('PeakBandwidth', $vss.Spec.Policy.ShapingPolicy.PeakBandwidth, $this.PeakBandwidth)\n        )\n\n        return ($vssShapingTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVssShaping($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssShapingArgs = @{\n            Name = $this.VssName\n            AverageBandwidth = $this.AverageBandwidth\n            BurstSize = $this.BurstSize\n            Enabled = $this.Enabled\n            PeakBandwidth = $this.PeakBandwidth\n        }\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n            $vssShapingArgs.Add('Operation', 'edit')\n        }\n        else {\n            $vssShapingArgs.AverageBandwidth = 100000\n            $vssShapingArgs.BurstSize = 100000\n            $vssShapingArgs.Enabled = $false\n            $vssShapingArgs.PeakBandwidth = 100000\n            $vssShapingArgs.Add('Operation', 'edit')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssShapingConfig $vssShapingArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Shaping Policy Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSShaping) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSShaping.VssName = $currentVss.Name\n            $vmHostVSSShaping.AverageBandwidth = $currentVss.Spec.Policy.ShapingPolicy.AverageBandwidth\n            $vmHostVSSShaping.BurstSize = $currentVss.Spec.Policy.ShapingPolicy.BurstSize\n            $vmHostVSSShaping.Enabled = $currentVss.Spec.Policy.ShapingPolicy.Enabled\n            $vmHostVSSShaping.PeakBandwidth = $currentVss.Spec.Policy.ShapingPolicy.PeakBandwidth\n        }\n        else {\n            $vmHostVSSShaping.VssName = $this.Name\n            $vmHostVSSShaping.AverageBandwidth = $this.AverageBandwidth\n            $vmHostVSSShaping.BurstSize = $this.BurstSize\n            $vmHostVSSShaping.Enabled = $this.Enabled\n            $vmHostVSSShaping.PeakBandwidth = $this.PeakBandwidth\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/StandardSwitch/VMHostVssTeaming.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssTeaming : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not to enable beacon probing\n    as a method to validate the link status of a physical network adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $CheckBeacon\n\n    <#\n    .DESCRIPTION\n\n    List of active network adapters used for load balancing.\n    #>\n    [DscProperty()]\n    [string[]] $ActiveNic\n\n    <#\n    .DESCRIPTION\n\n    Standby network adapters used for failover.\n    #>\n    [DscProperty()]\n    [string[]] $StandbyNic\n\n    <#\n    .DESCRIPTION\n\n    Flag to specify whether or not to notify the physical switch if a link fails.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $NotifySwitches\n\n    <#\n    .DESCRIPTION\n\n    Network adapter teaming policy.\n    #>\n    [DscProperty()]\n    [NicTeamingPolicy] $Policy = [NicTeamingPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not to use a rolling policy when restoring links.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $RollingOrder\n\n    hidden [string] $PhysicalNicNotInBridgeMessage = \"Physical network adapter {0} is not in the bridge with standard switch {1}.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssTeaming($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.CheckBeacon = $false\n                $this.ActiveNic = @()\n                $this.StandbyNic = @()\n                $this.NotifySwitches = $true\n                $this.Policy = [NicTeamingPolicy]::Loadbalance_srcid\n                $this.RollingOrder = $false\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssTeaming] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVssTeaming]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssTeaming should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssTeamingTest = @(\n            $this.ShouldUpdateDscResourceSetting('CheckBeacon', $vss.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon, $this.CheckBeacon),\n            $this.ShouldUpdateDscResourceSetting('NotifySwitches', $vss.Spec.Policy.NicTeaming.NotifySwitches, $this.NotifySwitches),\n            $this.ShouldUpdateDscResourceSetting('RollingOrder', $vss.Spec.Policy.NicTeaming.RollingOrder, $this.RollingOrder),\n            $this.ShouldUpdateDscResourceSetting('Policy', [string] $vss.Spec.Policy.NicTeaming.Policy, $this.Policy.ToString().ToLower()),\n            $this.ShouldUpdateArraySetting('ActiveNic', $vss.Spec.Policy.NicTeaming.NicOrder.ActiveNic, $this.ActiveNic),\n            $this.ShouldUpdateArraySetting('StandbyNic', $vss.Spec.Policy.NicTeaming.NicOrder.StandbyNic, $this.StandbyNic)\n        )\n\n        return ($vssTeamingTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Validates that all provided physical network adapters: (ActiveNic and StandbyNic) are in the bridge\n    with the specified standard switch.\n    #>\n    [void] ValidatePhysicalNetworkAdapters() {\n        $physicalNics = $this.ActiveNic + $this.StandbyNic\n\n        if ($physicalNics.Length -gt 0) {\n            $standardSwitch = $this.GetVss()\n            foreach ($physicalNic in $physicalNics) {\n                if (!($standardSwitch.Spec.Bridge.NicDevice -Contains $physicalNic)) {\n                    throw ($this.PhysicalNicNotInBridgeMessage -f $physicalNic, $standardSwitch.Name)\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVssTeaming($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $this.ValidatePhysicalNetworkAdapters()\n\n        $vssTeamingArgs = @{\n            Name = $this.VssName\n            ActiveNic = $this.ActiveNic\n            StandbyNic = $this.StandbyNic\n            NotifySwitches = $this.NotifySwitches\n            RollingOrder = $this.RollingOrder\n        }\n\n        if ($null -ne $this.CheckBeacon) { $vssTeamingArgs.CheckBeacon = $this.CheckBeacon }\n        if ($this.Policy -ne [NicTeamingPolicy]::Unset) { $vssTeamingArgs.Policy = $this.Policy.ToString().ToLower() }\n\n        $vss = $this.GetVss()\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n            $vssTeamingArgs.Add('Operation', 'edit')\n        }\n        else {\n            $vssTeamingArgs.CheckBeacon = $false\n            $vssTeamingArgs.ActiveNic = @()\n            $vssTeamingArgs.StandbyNic = @()\n            $vssTeamingArgs.NotifySwitches = $true\n            $vssTeamingArgs.Policy = ([NicTeamingPolicy]::Loadbalance_srcid).ToString().ToLower()\n            $vssTeamingArgs.RollingOrder = $false\n            $vssTeamingArgs.Add('Operation', 'edit')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssTeamingConfig $vssTeamingArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Teaming Policy Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSTeaming) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSTeaming.VssName = $currentVss.Name\n            $vmHostVSSTeaming.CheckBeacon = $currentVss.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon\n            $vmHostVSSTeaming.ActiveNic = $currentVss.Spec.Policy.NicTeaming.NicOrder.ActiveNic\n            $vmHostVSSTeaming.StandbyNic = $currentVss.Spec.Policy.NicTeaming.NicOrder.StandbyNic\n            $vmHostVSSTeaming.NotifySwitches = $currentVss.Spec.Policy.NicTeaming.NotifySwitches\n            $vmHostVSSTeaming.Policy = [NicTeamingPolicy]$currentVss.Spec.Policy.NicTeaming.Policy\n            $vmHostVSSTeaming.RollingOrder = $currentVss.Spec.Policy.NicTeaming.RollingOrder\n        }\n        else {\n            $vmHostVSSTeaming.VssName = $this.Name\n            $vmHostVSSTeaming.CheckBeacon = $this.CheckBeacon\n            $vmHostVSSTeaming.ActiveNic = $this.ActiveNic\n            $vmHostVSSTeaming.StandbyNic = $this.StandbyNic\n            $vmHostVSSTeaming.NotifySwitches = $this.NotifySwitches\n            $vmHostVSSTeaming.Policy = $this.Policy\n            $vmHostVSSTeaming.RollingOrder = $this.RollingOrder\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VDPortGroup.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VDPortGroup : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Distributed Port Group.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch associated with the Distributed Port Group.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Distributed Port Group should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies a description for the Distributed Port Group.\n    #>\n    [DscProperty()]\n    [string] $Notes\n\n    <#\n    .DESCRIPTION\n\n    Specifies the number of ports that the Distributed Port Group will have.\n    If the parameter is not specified, the number of ports for the Distributed Port Group is 128.\n    #>\n    [DscProperty()]\n    [nullable[int]] $NumPorts\n\n    <#\n    .DESCRIPTION\n\n    Specifies the port binding setting for the Distributed Port Group.\n    Valid values are Static, Dynamic, and Ephemeral.\n    #>\n    [DscProperty()]\n    [PortBinding] $PortBinding = [PortBinding]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the VLAN ID for the Distributed Port Group.\n    Valid values are integers in the range of 1 to 4094.\n    If 0 is specified, the VLAN type is 'None'.\n    #>\n    [DscProperty()]\n    [nullable[int]] $VLanId\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name for the reference Distributed Port Group.\n    The properties of the new Distributed Port Group will be cloned from the reference Distributed Port Group.\n    #>\n    [DscProperty()]\n    [string] $ReferenceVDPortGroupName\n\n    hidden [string] $RetrieveVDSwitchMessage = \"Retrieving distributed switch {0}.\"\n    hidden [string] $CreateVDPortGroupMessage = \"Creating distributed port group {0} on distributed switch {1}.\"\n    hidden [string] $ModifyVDPortGroupMessage = \"Modifying distributed port group {0}.\"\n    hidden [string] $ModifyVDPortGroupVlanConfigurationMessage = \"Modifying the VLAN ID of distributed port group {0} to {1}.\"\n    hidden [string] $RemoveVDPortGroupMessage = \"Removing distributed port group {0} from distributed switch {1}.\"\n\n    hidden [string] $CouldNotRetrieveVDSwitchMessage = \"Could not retrieve distributed switch {0}. For more information: {1}\"\n    hidden [string] $CouldNotCreateVDPortGroupMessage = \"Could not create distributed port group {0} on distributed switch {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyVDPortGroupMessage = \"Could not modify distributed port group {0}. For more information: {1}\"\n    hidden [string] $CouldNotModifyVDPortGroupVlanConfigurationMessage = \"Could not modify the VLAN ID of distributed port group {0} to {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveVDPortGroupMessage = \"Could not remove distributed port group {0} from distributed switch {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $distributedPortGroup = $this.GetDistributedPortGroup($distributedSwitch)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedPortGroup) {\n                    $this.AddDistributedPortGroup($distributedSwitch)\n                }\n                else {\n                    if ($this.ShouldUpdateVLanId($distributedPortGroup)) {\n                        $this.UpdateDistributedPortGroupVlanConfiguration($distributedPortGroup)\n                    }\n\n                    if ($this.ShouldUpdateDistributedPortGroup($distributedPortGroup)) {\n                        $this.UpdateDistributedPortGroup($distributedPortGroup)\n                    }\n                }\n            }\n            else {\n                if ($null -ne $distributedPortGroup) {\n                    $this.RemoveDistributedPortGroup($distributedPortGroup)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $distributedPortGroup = $this.GetDistributedPortGroup($distributedSwitch)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedPortGroup) {\n                    $result = $false\n                }\n                else {\n                    $result = if ($this.ShouldUpdateDistributedPortGroup($distributedPortGroup) -or $this.ShouldUpdateVLanId($distributedPortGroup)) { $false } else { $true }\n                }\n            }\n            else {\n                $result = ($null -eq $distributedPortGroup)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VDPortGroup] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n            $result = [VDPortGroup]::new()\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $distributedPortGroup = $this.GetDistributedPortGroup($distributedSwitch)\n\n            $this.PopulateResult($distributedPortGroup, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch with the specified name from the server if it exists.\n    If the Distributed Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetDistributedSwitch() {\n        <#\n            The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n            when importing the 'VMware.VimAutomation.Vds' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        try {\n            $getVDSwitchParams = @{\n                Server = $this.Connection\n                Name = $this.VdsName\n                Verbose = $false\n            }\n            if ($this.Ensure -eq [Ensure]::Absent) {\n                $getVDSwitchParams.ErrorAction = 'SilentlyContinue'\n                return Get-VDSwitch @getVDSwitchParams\n            }\n            else {\n                try {\n                    $this.WriteLogUtil('Verbose', $this.RetrieveVDSwitchMessage, @($this.VdsName))\n                    $getVDSwitchParams.ErrorAction = 'Stop'\n                    return Get-VDSwitch @getVDSwitchParams\n                }\n                catch {\n                    throw ($this.CouldNotRetrieveVDSwitchMessage -f $this.VdsName, $_.Exception.Message)\n                }\n            }\n        }\n        finally {\n            $global:VerbosePreference = $savedVerbosePreference\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Port Group with the specified name, available on the specified Distributed Switch from the server if it exists.\n    Otherwise returns $null.\n    #>\n    [PSObject] GetDistributedPortGroup($distributedSwitch) {\n        if ($null -eq $distributedSwitch) {\n            <#\n            If the Distributed Switch is $null, it means that Ensure was set to 'Absent' and\n            the Distributed Port Group does not exist for the specified Distributed Switch.\n            #>\n            return $null\n        }\n\n        $getVDPortgroupParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            VDSwitch = $distributedSwitch\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n        return Get-VDPortgroup @getVDPortgroupParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed Distributed Port Group needs be modified based on the passed properties.\n    #>\n    [bool] ShouldUpdateDistributedPortGroup($distributedPortGroup) {\n        $shouldUpdateDistributedPortGroup = @(\n            $this.ShouldUpdateDscResourceSetting('NumPorts', $distributedPortGroup.NumPorts, $this.NumPorts),\n            $this.ShouldUpdateDscResourceSetting('PortBinding', [string] $distributedPortGroup.PortBinding, $this.PortBinding.ToString()),\n            $this.ShouldUpdateDscResourceSetting('Notes', [string] $distributedPortGroup.Notes, $this.Notes)\n        )\n\n        return ($shouldUpdateDistributedPortGroup -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VLAN ID of the specified distributed port group should be modified.\n    #>\n    [bool] ShouldUpdateVLanId($distributedPortGroup) {\n        $currentVLanId = if ($null -ne $distributedPortGroup.VlanConfiguration) { $distributedPortGroup.VlanConfiguration.VlanId } else { 0 }\n        return $this.ShouldUpdateDscResourceSetting('VLanId', $currentVLanId, $this.VLanId)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Distributed Port Group parameters.\n    #>\n    [hashtable] GetDistributedPortGroupParams() {\n        $distributedPortGroupParams = @{}\n\n        $distributedPortGroupParams.Server = $this.Connection\n        $distributedPortGroupParams.Confirm = $false\n        $distributedPortGroupParams.ErrorAction = 'Stop'\n        $distributedPortGroupParams.Verbose = $false\n\n        if ($null -ne $this.Notes) { $distributedPortGroupParams.Notes = $this.Notes }\n        if ($null -ne $this.NumPorts) { $distributedPortGroupParams.NumPorts = $this.NumPorts }\n\n        if ($this.PortBinding -ne [PortBinding]::Unset) {\n            $distributedPortGroupParams.PortBinding = $this.PortBinding.ToString()\n        }\n\n        return $distributedPortGroupParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Distributed Port Group available on the specified Distributed Switch.\n    #>\n    [void] AddDistributedPortGroup($distributedSwitch) {\n        $distributedPortGroupParams = $this.GetDistributedPortGroupParams()\n        $distributedPortGroupParams.Name = $this.Name\n        $distributedPortGroupParams.VDSwitch = $distributedSwitch\n\n        <#\n        ReferencePortGroup and VLanId are parameters only for the New-VDPortgroup cmdlet\n        and are not used for the Set-VDPortgroup cmdlet.\n        #>\n        if (![string]::IsNullOrEmpty($this.ReferenceVDPortGroupName)) { $distributedPortGroupParams.ReferencePortgroup = $this.ReferenceVDPortGroupName }\n        if ($null -ne $this.VLanId) { $distributedPortGroupParams.VlanId = $this.VLanId }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateVDPortGroupMessage, @($this.Name, $distributedSwitch.Name))\n            New-VDPortgroup @distributedPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVDPortGroupMessage -f $this.Name, $distributedSwitch.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the configuration of the specified Distributed Port Group with the passed properties.\n    #>\n    [void] UpdateDistributedPortGroup($distributedPortGroup) {\n        $distributedPortGroupParams = $this.GetDistributedPortGroupParams()\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVDPortGroupMessage, @($distributedPortGroup.Name))\n            $distributedPortGroup | Set-VDPortgroup @distributedPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVDPortGroupMessage -f $distributedPortGroup.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the VLAN configuration of the specified Distributed Port Group.\n    #>\n    [void] UpdateDistributedPortGroupVlanConfiguration($distributedPortGroup) {\n        $setVDVlanConfigurationParams = @{\n            VDPortgroup = $distributedPortGroup\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($this.VLanId -eq 0) {\n            $setVDVlanConfigurationParams.DisableVlan = $true\n        }\n        else {\n            $setVDVlanConfigurationParams.VlanId = $this.VLanId\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVDPortGroupVlanConfigurationMessage, @($distributedPortGroup.Name, $this.VLanId))\n            Set-VDVlanConfiguration @setVDVlanConfigurationParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVDPortGroupVlanConfigurationMessage -f $distributedPortGroup.Name, $this.VLanId, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Distributed Port Group from the vSphere Distributed Switch that it belongs to.\n    #>\n    [void] RemoveDistributedPortGroup($distributedPortGroup) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveVDPortGroupMessage, @($distributedPortGroup.Name, $distributedPortGroup.VDSwitch.Name))\n            $removeVDPortGroupParams = @{\n                Server = $this.Connection\n                VDPortGroup = $distributedPortGroup\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Remove-VDPortGroup @removeVDPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveVDPortGroupMessage -f $distributedPortGroup.Name, $distributedPortGroup.VDSwitch.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($distributedPortGroup, $result) {\n        $result.Server = $this.Connection.Name\n        $result.ReferenceVDPortGroupName = $this.ReferenceVDPortGroupName\n\n        if ($null -ne $distributedPortGroup) {\n            $result.Name = $distributedPortGroup.Name\n            $result.VdsName = $distributedPortGroup.VDSwitch.Name\n            $result.Ensure = [Ensure]::Present\n            $result.Notes = $distributedPortGroup.Notes\n            $result.NumPorts = $distributedPortGroup.NumPorts\n            $result.PortBinding = $distributedPortGroup.PortBinding.ToString()\n            $result.VLanId = [int] $distributedPortGroup.VlanConfiguration.VlanId\n        }\n        else {\n            $result.Name = $this.Name\n            $result.VdsName = $this.VdsName\n            $result.Ensure = [Ensure]::Absent\n            $result.Notes = $this.Notes\n            $result.NumPorts = $this.NumPorts\n            $result.PortBinding = $this.PortBinding\n            $result.VLanId = [int] $this.VLanId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VDSwitch.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VDSwitch : DatacenterInventoryBaseDSC {\n    DistributedSwitch() {\n        $this.InventoryItemFolderType = [FolderType]::Network\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the contact details of the vSphere Distributed Switch administrator.\n    #>\n    [DscProperty()]\n    [string] $ContactDetails\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch administrator.\n    #>\n    [DscProperty()]\n    [string] $ContactName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the discovery protocol type of the vSphere Distributed Switch that you want to create.\n    The valid values are CDP, LLDP and Unset. If you do not set a value for this parameter, the default server setting is used.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolProtocol] $LinkDiscoveryProtocol = [LinkDiscoveryProtocolProtocol]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the link discovery protocol operation for the vSphere Distributed Switch that you want to create.\n    The valid values are Advertise, Both, Listen, None and Unset. If you do not set a value for this parameter, the default server setting is used.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolOperation] $LinkDiscoveryProtocolOperation = [LinkDiscoveryProtocolOperation]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum number of ports allowed on the vSphere Distributed Switch that you want to create.\n    #>\n    [DscProperty()]\n    [nullable[int]] $MaxPorts\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum MTU size for the vSphere Distributed Switch that you want to create. Valid values are positive integers only.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Mtu\n\n    <#\n    .DESCRIPTION\n\n    Specifies a description for the vSphere Distributed Switch that you want to create.\n    #>\n    [DscProperty()]\n    [string] $Notes\n\n    <#\n    .DESCRIPTION\n\n    Specifies the number of uplink ports on the vSphere Distributed Switch that you want to create.\n    #>\n    [DscProperty()]\n    [nullable[int]] $NumUplinkPorts\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Name for the reference vSphere Distributed Switch.\n    The properties of the new vSphere Distributed Switch will be cloned from the reference vSphere Distributed Switch.\n    #>\n    [DscProperty()]\n    [string] $ReferenceVDSwitchName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the version of the vSphere Distributed Switch that you want to create.\n    You cannot specify a version that is incompatible with the version of the vCenter Server system you are connected to.\n    #>\n    [DscProperty()]\n    [string] $Version\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the new vSphere Distributed Switch will be created without importing the port groups from the specified reference vSphere Distributed Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $WithoutPortGroups\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $distributedSwitchLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $distributedSwitch = $this.GetDistributedSwitch($distributedSwitchLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedSwitch) {\n                    $this.AddDistributedSwitch($distributedSwitchLocation)\n                }\n                else {\n                    $this.UpdateDistributedSwitch($distributedSwitch)\n                }\n            }\n            else {\n                if ($null -ne $distributedSwitch) {\n                    $this.RemoveDistributedSwitch($distributedSwitch)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $distributedSwitchLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $distributedSwitch = $this.GetDistributedSwitch($distributedSwitchLocation)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedSwitch) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateDistributedSwitch($distributedSwitch)\n                }\n            }\n            else {\n                $result = ($null -eq $distributedSwitch)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VDSwitch] Get() {\n        try {\n            $result = [VDSwitch]::new()\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n            $result.ReferenceVDSwitchName = $this.ReferenceVDSwitchName\n            $result.WithoutPortGroups = $this.WithoutPortGroups\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $distributedSwitchLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $distributedSwitch = $this.GetDistributedSwitch($distributedSwitchLocation)\n\n            $this.PopulateResult($distributedSwitch, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch from the specified Location in the Datacenter if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetDistributedSwitch($distributedSwitchLocation) {\n        <#\n        The Verbose logic here is needed to suppress the Exporting and Importing of the\n        cmdlets from the VMware.VimAutomation.Vds Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        $distributedSwitch = Get-VDSwitch -Server $this.Connection -Name $this.Name -Location $distributedSwitchLocation -ErrorAction SilentlyContinue\n\n        $global:VerbosePreference = $savedVerbosePreference\n\n        return $distributedSwitch\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed Distributed Switch needs be updated based on the specified properties.\n    #>\n    [bool] ShouldUpdateDistributedSwitch($distributedSwitch) {\n        $shouldUpdateDistributedSwitch = @(\n            $this.ShouldUpdateDscResourceSetting('ContactDetails', [string] $distributedSwitch.ContactDetails, $this.ContactDetails),\n            $this.ShouldUpdateDscResourceSetting('ContactName', [string] $distributedSwitch.ContactName, $this.ContactName),\n            $this.ShouldUpdateDscResourceSetting('Notes', [string] $distributedSwitch.Notes, $this.Notes),\n            $this.ShouldUpdateDscResourceSetting('Version', [string] $distributedSwitch.Version, $this.Version),\n            $this.ShouldUpdateDscResourceSetting('MaxPorts', $distributedSwitch.MaxPorts, $this.MaxPorts),\n            $this.ShouldUpdateDscResourceSetting('Mtu', $distributedSwitch.Mtu, $this.Mtu),\n            $this.ShouldUpdateDscResourceSetting('NumUplinkPorts', $distributedSwitch.NumUplinkPorts, $this.NumUplinkPorts),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocol',\n                [string] $distributedSwitch.LinkDiscoveryProtocol,\n                $this.LinkDiscoveryProtocol.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocolOperation',\n                [string] $distributedSwitch.LinkDiscoveryProtocolOperation,\n                $this.LinkDiscoveryProtocolOperation.ToString()\n            )\n        )\n\n        return ($shouldUpdateDistributedSwitch -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Distributed Switch parameters.\n    #>\n    [hashtable] GetDistributedSwitchParams() {\n        $distributedSwitchParams = @{}\n\n        $distributedSwitchParams.Server = $this.Connection\n        $distributedSwitchParams.Confirm = $false\n        $distributedSwitchParams.ErrorAction = 'Stop'\n\n        if (![string]::IsNullOrEmpty($this.ContactDetails)) { $distributedSwitchParams.ContactDetails = $this.ContactDetails }\n        if (![string]::IsNullOrEmpty($this.ContactName)) { $distributedSwitchParams.ContactName = $this.ContactName }\n        if (![string]::IsNullOrEmpty($this.Notes)) { $distributedSwitchParams.Notes = $this.Notes }\n        if (![string]::IsNullOrEmpty($this.Version)) { $distributedSwitchParams.Version = $this.Version }\n\n        if ($null -ne $this.MaxPorts) { $distributedSwitchParams.MaxPorts = $this.MaxPorts }\n        if ($null -ne $this.Mtu) { $distributedSwitchParams.Mtu = $this.Mtu }\n        if ($null -ne $this.NumUplinkPorts) { $distributedSwitchParams.NumUplinkPorts = $this.NumUplinkPorts }\n\n        if ($this.LinkDiscoveryProtocol -ne [LinkDiscoveryProtocolProtocol]::Unset) {\n            $distributedSwitchParams.LinkDiscoveryProtocol = $this.LinkDiscoveryProtocol.ToString()\n        }\n\n        if ($this.LinkDiscoveryProtocolOperation -ne [LinkDiscoveryProtocolOperation]::Unset) {\n            $distributedSwitchParams.LinkDiscoveryProtocolOperation = $this.LinkDiscoveryProtocolOperation.ToString()\n        }\n\n        return $distributedSwitchParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Distributed Switch with the specified properties at the specified location.\n    #>\n    [void] AddDistributedSwitch($distributedSwitchLocation) {\n        $distributedSwitchParams = $this.GetDistributedSwitchParams()\n        $distributedSwitchParams.Name = $this.Name\n        $distributedSwitchParams.Location = $distributedSwitchLocation\n\n        <#\n        ReferenceVDSwitch and WithoutPortGroups are parameters only for the New-VDSwitch cmdlet\n        and are not used for the Set-VDSwitch cmdlet.\n        #>\n        if (![string]::IsNullOrEmpty($this.ReferenceVDSwitchName)) { $distributedSwitchParams.ReferenceVDSwitch = $this.ReferenceVDSwitchName }\n        if ($null -ne $this.WithoutPortGroups) { $distributedSwitchParams.WithoutPortGroups = $this.WithoutPortGroups }\n\n        try {\n            New-VDSwitch @distributedSwitchParams\n        }\n        catch {\n            throw \"Cannot create Distributed Switch $($this.Name) at Location $($distributedSwitchLocation.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Distributed Switch with the specified properties.\n    #>\n    [void] UpdateDistributedSwitch($distributedSwitch) {\n        $distributedSwitchParams = $this.GetDistributedSwitchParams()\n\n        try {\n            $distributedSwitch | Set-VDSwitch @distributedSwitchParams\n        }\n        catch {\n            throw \"Cannot update Distributed Switch $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Distributed Switch from the specified location.\n    #>\n    [void] RemoveDistributedSwitch($distributedSwitch) {\n        try {\n            $distributedSwitch | Remove-VDSwitch -Server $this.Connection -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw \"Cannot remove Distributed Switch $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Distributed Switch from the server.\n    #>\n    [void] PopulateResult($distributedSwitch, $result) {\n        if ($null -ne $distributedSwitch) {\n            $result.Name = $distributedSwitch.Name\n            $result.Ensure = [Ensure]::Present\n            $result.ContactDetails = $distributedSwitch.ContactDetails\n            $result.ContactName = $distributedSwitch.ContactName\n            $result.LinkDiscoveryProtocol = $distributedSwitch.LinkDiscoveryProtocol.ToString()\n            $result.LinkDiscoveryProtocolOperation = $distributedSwitch.LinkDiscoveryProtocolOperation.ToString()\n            $result.MaxPorts = $distributedSwitch.MaxPorts\n            $result.Mtu = $distributedSwitch.Mtu\n            $result.Notes = $distributedSwitch.Notes\n            $result.NumUplinkPorts = $distributedSwitch.NumUplinkPorts\n            $result.Version = $distributedSwitch.Version\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.ContactDetails = $this.ContactDetails\n            $result.ContactName = $this.ContactName\n            $result.LinkDiscoveryProtocol = $this.LinkDiscoveryProtocol\n            $result.LinkDiscoveryProtocolOperation = $this.LinkDiscoveryProtocolOperation\n            $result.MaxPorts = $this.MaxPorts\n            $result.Mtu = $this.Mtu\n            $result.Notes = $this.Notes\n            $result.NumUplinkPorts = $this.NumUplinkPorts\n            $result.Version = $this.Version\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VDSwitchVMHost.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VDSwitchVMHost : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch to/from which you want to add/remove the specified VMHosts.\n    #>\n    [DscProperty(Key)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the VMHosts that you want to add/remove to/from the specified vSphere Distributed Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $VMHostNames\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VMHosts should be Present/Absent to/from the specified vSphere Distributed Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $vmHosts = $this.GetVMHosts()\n            $filteredVMHosts = $this.GetFilteredVMHosts($vmHosts, $distributedSwitch)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $this.AddVMHostsToDistributedSwitch($filteredVMHosts, $distributedSwitch)\n            }\n            else {\n                $this.RemoveVMHostsFromDistributedSwitch($filteredVMHosts, $distributedSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $vmHosts = $this.GetVMHosts()\n\n            if ($null -eq $distributedSwitch) {\n                # If the Distributed Switch is $null, it means that Ensure is 'Absent' and the Distributed Switch does not exist.\n                return $true\n            }\n\n            return !$this.ShouldUpdateVMHostsInDistributedSwitch($vmHosts, $distributedSwitch)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VDSwitchVMHost] Get() {\n        try {\n            $result = [VDSwitchVMHost]::new()\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $vmHosts = $this.GetVMHosts()\n\n            $result.Server = $this.Connection.Name\n            $result.VMHostNames = $vmHosts | Select-Object -ExpandProperty Name\n            $result.Ensure = $this.Ensure\n\n            if ($null -eq $distributedSwitch) {\n                # If the Distributed Switch is $null, it means that Ensure is 'Absent' and the Distributed Switch does not exist.\n                $result.VdsName = $this.Name\n            }\n            else {\n                $result.VdsName = $distributedSwitch.Name\n            }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch with the specified name from the server if it exists.\n    If the Distributed Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetDistributedSwitch() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            $distributedSwitch = Get-VDSwitch -Server $this.Connection -Name $this.VdsName -ErrorAction SilentlyContinue\n            return $distributedSwitch\n        }\n        else {\n            try {\n                $distributedSwitch = Get-VDSwitch -Server $this.Connection -Name $this.VdsName -ErrorAction Stop\n                return $distributedSwitch\n            }\n            catch {\n                throw \"Could not retrieve Distributed Switch $($this.VdsName). For more information: $($_.Exception.Message)\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHosts with the specified names from the server if they exist.\n    For every VMHost that does not exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetVMHosts() {\n        $vmHosts = @()\n\n        foreach ($vmHostName in $this.VMHostNames) {\n            $vmHost = Get-VMHost -Server $this.Connection -Name $vmHostName -ErrorAction SilentlyContinue\n            if ($null -eq $vmHost) {\n                $this.WriteLogUtil('Warning', \"The passed VMHost {0} was not found and it will be ignored.\", @($vmHostName))\n            }\n            else {\n                $vmHosts += $vmHost\n            }\n        }\n\n        return $vmHosts\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if VMHosts should be added/removed from the Distributed Switch depending on the value of the Ensure property.\n    If Ensure is set to 'Present', checks if all passed VMHosts are part of the Distributed Switch.\n    If Ensure is set to 'Absent', checks if all passed VMHosts are not part of the Distributed Switch.\n    #>\n    [bool] ShouldUpdateVMHostsInDistributedSwitch($vmHosts, $distributedSwitch) {\n        if ($this.Ensure -eq [Ensure]::Present) {\n            foreach ($vmHost in $vmHosts) {\n                $addedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -eq $addedVMHost) {\n                    return $true\n                }\n            }\n        }\n        else {\n            foreach ($vmHost in $vmHosts) {\n                $removedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -ne $removedVMHost) {\n                    return $true\n                }\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the filtered VMHosts based on the value of the Ensure property. If Ensure is set to 'Present', it returns only\n    these VMHosts that are currently not part of the Distributed Switch. The other VMHosts in the array are ignored because they are already part\n    of the Distributed Switch. If Ensure is set to 'Absent', it returns only these VMHosts that are currently part of the Distributed Switch. The other VMHosts\n    in the array are ignored because they are not part of the Distributed Switch. In both cases a warning message is shown to the user when a specific VMHost is\n    ignored.\n    #>\n    [array] GetFilteredVMHosts($vmHosts, $distributedSwitch) {\n        $filteredVMHosts = @()\n\n        if ($this.Ensure -eq [Ensure]::Present) {\n            foreach ($vmHost in $vmHosts) {\n                $addedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -ne $addedVMHost) {\n                    $this.WriteLogUtil('Warning', \"VMHost {0} is already added to Distributed Switch {1} and it will be ignored.\", @($vmHost.Name, $distributedSwitch.Name))\n\n                    continue\n                }\n\n                $filteredVMHosts += $vmHost\n            }\n        }\n        else {\n            foreach ($vmHost in $vmHosts) {\n                $removedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -eq $removedVMHost) {\n                    $this.WriteLogUtil('Warning', \"VMHost {0} is not added to Distributed Switch {1} and it will be ignored.\", @($vmHost.Name, $distributedSwitch.Name))\n\n                    continue\n                }\n\n                $filteredVMHosts += $vmHost\n            }\n        }\n\n        return $filteredVMHosts\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the VMHosts to the specified Distributed Switch.\n    #>\n    [void] AddVMHostsToDistributedSwitch($filteredVMHosts, $distributedSwitch) {\n        try {\n            Add-VDSwitchVMHost -Server $this.Connection -VDSwitch $distributedSwitch -VMHost $filteredVMHosts -ErrorAction Stop\n        }\n        catch {\n            throw \"Could not add VMHosts $filteredVMHosts to Distributed Switch $($distributedSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMHosts from the specified Distributed Switch.\n    #>\n    [void] RemoveVMHostsFromDistributedSwitch($filteredVMHosts, $distributedSwitch) {\n        try {\n            Remove-VDSwitchVMHost -Server $this.Connection -VDSwitch $distributedSwitch -VMHost $filteredVMHosts -ErrorAction Stop\n        }\n        catch {\n            throw \"Could not remove VMHosts $filteredVMHosts from Distributed Switch $($distributedSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostAccount.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostAccount : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the ID for the host account.\n    #>\n    [DscProperty(Key)]\n    [string] $Id\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Resource should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Permission on the VMHost entity is created for the specified User Id with the specified Role.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $Role\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Password for the host account.\n    #>\n    [DscProperty()]\n    [string] $AccountPassword\n\n    <#\n    .DESCRIPTION\n\n    Provides a description for the host account. The maximum length of the text is 255 symbols.\n    #>\n    [DscProperty()]\n    [string] $Description\n\n    hidden [string] $AccountPasswordParameterName = 'Password'\n    hidden [string] $DescriptionParameterName = 'Description'\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n            $vmHostAccount = $this.GetVMHostAccount()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostAccount) {\n                    $this.AddVMHostAccount()\n                }\n                else {\n                    $this.UpdateVMHostAccount($vmHostAccount)\n                }\n            }\n            else {\n                if ($null -ne $vmHostAccount) {\n                    $this.RemoveVMHostAccount($vmHostAccount)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n            $vmHostAccount = $this.GetVMHostAccount()\n\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostAccount) {\n                    $result = $false\n                }\n                else {\n                    $result = if ($this.ShouldUpdateVMHostAccount($vmHostAccount) -or $this.ShouldCreateAcountPermission($vmHostAccount)) { $false } else { $true }\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostAccount)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostAccount] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostAccount]::new()\n            $result.Server = $this.Server\n\n            $this.EnsureConnectionIsESXi()\n            $vmHostAccount = $this.GetVMHostAccount()\n\n            $this.PopulateResult($vmHostAccount, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the VMHost Account if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetVMHostAccount() {\n        $getVMHostAccountParams = @{\n            Server = $this.Connection\n            Id = $this.Id\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-VMHostAccount @getVMHostAccountParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if a new Permission with the passed Role needs to be created for the specified VMHost Account.\n    #>\n    [bool] ShouldCreateAcountPermission($vmHostAccount) {\n        $getVIPermissionParams = @{\n            Server = $this.Connection\n            Entity = $this.Server\n            Principal = $vmHostAccount\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $existingPermission = Get-VIPermission @getVIPermissionParams\n\n        return ($null -eq $existingPermission)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMHost Account should be updated.\n    #>\n    [bool] ShouldUpdateVMHostAccount($vmHostAccount) {\n        <#\n        If the Account Password is passed, we should check if we can connect to the ESXi host with the passed Id and Password.\n        If we can connect to the host it means that the password is in the desired state so we should close the connection and\n        continue checking the other passed properties. If we cannot connect to the host it means that\n        the desired Password is not equal to the current Password of the Account.\n        #>\n        if ($null -ne $this.AccountPassword) {\n            $connectVIServerParams = @{\n                Server = $this.Server\n                User = $this.Id\n                Password = $this.AccountPassword\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $hostConnection = Connect-VIServer @connectVIServerParams\n\n            if ($null -eq $hostConnection) {\n                return $true\n            }\n            else {\n                $disconnectVIServerParams = @{\n                    Server = $hostConnection\n                    ErrorAction = 'SilentlyContinue'\n                    Verbose = $false\n                    Confirm = $false\n                }\n\n                Disconnect-VIServer @disconnectVIServerParams\n            }\n        }\n\n        return $this.ShouldUpdateDscResourceSetting('Description', $vmHostAccount.Description, $this.Description)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the parameters for the New-VMHostAccount and Set-VMHostAccount cmdlets.\n    #>\n    [void] PopulateVMHostAccountParams($vmHostAccountParams, $parameter, $desiredValue) {\n        if ($null -ne $desiredValue) {\n            $vmHostAccountParams.$parameter = $desiredValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated VMHost Account parameters.\n    #>\n    [hashtable] GetVMHostAccountParams() {\n        $vmHostAccountParams = @{}\n\n        $vmHostAccountParams.Server = $this.Connection\n        $vmHostAccountParams.Confirm = $false\n        $vmHostAccountParams.ErrorAction = 'Stop'\n        $vmHostAccountParams.Verbose = $false\n\n        $this.PopulateVMHostAccountParams($vmHostAccountParams, $this.AccountPasswordParameterName, $this.AccountPassword)\n        $this.PopulateVMHostAccountParams($vmHostAccountParams, $this.DescriptionParameterName, $this.Description)\n\n        return $vmHostAccountParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Permission with the passed Role for the specified VMHost Account.\n    #>\n    [void] CreateAccountPermission($vmHostAccount) {\n        $getVIRoleParams = @{\n            Server = $this.Connection\n            Name = $this.Role\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $accountRole = Get-VIRole @getVIRoleParams\n        if ($null -eq $accountRole) {\n            throw \"The passed role $($this.Role) is not present on the server.\"\n        }\n\n        try {\n            $newVIPermissionParams = @{\n                Server = $this.Connection\n                Entity = $this.Server\n                Principal = $vmHostAccount\n                Role = $accountRole\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            New-VIPermission @newVIPermissionParams\n        }\n        catch {\n            throw \"Cannot assign role $($this.Role) to account $($vmHostAccount.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new VMHost Account with the specified properties.\n    #>\n    [void] AddVMHostAccount() {\n        $vmHostAccountParams = $this.GetVMHostAccountParams()\n        $vmHostAccountParams.Id = $this.Id\n\n        $vmHostAccount = $null\n\n        try {\n            $vmHostAccount = New-VMHostAccount @vmHostAccountParams\n        }\n        catch {\n            throw \"Cannot create VMHost Account $($this.Id). For more information: $($_.Exception.Message)\"\n        }\n\n        $this.CreateAccountPermission($vmHostAccount)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMHost Account with the specified properties.\n    #>\n    [void] UpdateVMHostAccount($vmHostAccount) {\n        $vmHostAccountParams = $this.GetVMHostAccountParams()\n\n        try {\n            $vmHostAccount | Set-VMHostAccount @vmHostAccountParams\n        }\n        catch {\n            throw \"Cannot update VMHost Account $($this.Id). For more information: $($_.Exception.Message)\"\n        }\n\n        if ($this.ShouldCreateAcountPermission($vmHostAccount)) {\n            $this.CreateAccountPermission($vmHostAccount)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMHost Account.\n    #>\n    [void] RemoveVMHostAccount($vmHostAccount) {\n        try {\n            $removeVMHostAccountParams = @{\n                Server = $this.Connection\n                HostAccount = $vmHostAccount\n                ErrorAction = 'Stop'\n                Verbose = $false\n                Confirm = $false\n            }\n\n            Remove-VMHostAccount @removeVMHostAccountParams\n        }\n        catch {\n            throw \"Cannot remove VMHost Account $($this.Id). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMHost Account from the server.\n    #>\n    [void] PopulateResult($vmHostAccount, $result) {\n        if ($null -ne $vmHostAccount) {\n            $getVIPermissionParams = @{\n                Server = $this.Connection\n                Entity = $this.Server\n                Principal = $vmHostAccount\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $permission = Get-VIPermission @getVIPermissionParams\n\n            $result.Id = $vmHostAccount.Id\n            $result.Ensure = [Ensure]::Present\n            $result.Role = $permission.Role\n            $result.Description = $vmHostAccount.Description\n        }\n        else {\n            $result.Id = $this.Id\n            $result.Ensure = [Ensure]::Absent\n            $result.Role = $this.Role\n            $result.Description = $this.Description\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostAdvancedSettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostAdvancedSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Hashtable containing the advanced settings of the specified VMHost, where\n    each key-value pair represents one advanced setting - the key is the name of the\n    setting and the value is the desired value for the setting.\n    #>\n    [DscProperty(Mandatory)]\n    [hashtable] $AdvancedSettings\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostAdvancedSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            return !$this.ShouldUpdateVMHostAdvancedSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostAdvancedSettings] Get() {\n        try {\n            $result = [VMHostAdvancedSettings]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $result.Name = $vmHost.Name\n            $result.AdvancedSettings = @{}\n\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Advanced Settings of the specified VMHost from the server.\n    #>\n    [array] GetAdvancedSettings($vmHost) {\n        try {\n            $retrievedAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost -ErrorAction Stop\n            return $retrievedAdvancedSettings\n        }\n        catch {\n            throw \"Could not retrieve the Advanced Settings of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Advanced Setting if it is present in the retrieved Advanced Settings from the server.\n    Otherwise returns $null.\n    #>\n    [PSObject] GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHostName) {\n        $advancedSetting = $retrievedAdvancedSettings | Where-Object { $_.Name -eq $advancedSettingName }\n        if ($null -eq $advancedSetting) {\n            <#\n            Here a warning log is used instead of 'throw' to ensure that the execution will not stop\n            if an invalid Advanced Setting is present in the passed hashtable and in the same time to\n            provide an information to the user that invalid data is passed.\n            #>\n            $this.WriteLogUtil('Warning', \"Advanced Setting {0} does not exist for VMHost {1} and will be ignored.\", @($advancedSettingName, $vmHostName))\n        }\n\n        return $advancedSetting\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the desired value of the Advanced Setting from the hashtable to the correct type of the value\n    from the server. Works only for primitive types.\n    #>\n    [object] ConvertAdvancedSettingDesiredValueToCorrectType($advancedSetting) {\n        $advancedSettingDesiredValue = $null\n        if ($advancedSetting.Value -is [bool]) {\n            # For bool values the '-as' operator returns 'True' for both 'true' and 'false' strings so specific conversion is needed.\n            $advancedSettingDesiredValue = [System.Convert]::ToBoolean($this.AdvancedSettings[$advancedSetting.Name])\n        }\n        else {\n            $advancedSettingDesiredValue = $this.AdvancedSettings[$advancedSetting.Name] -as $advancedSetting.Value.GetType()\n        }\n\n        return $advancedSettingDesiredValue\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Advanced Setting should be updated depending on the passed desired value.\n    #>\n    [bool] ShouldUpdateVMHostAdvancedSetting($advancedSetting) {\n        <#\n        Each element in the hashtable is of type MSFT_KeyValuePair where the value is a string.\n        So before comparison the value needs to be converted to its original type which can be\n        retrieved from its server value.\n        #>\n        $advancedSettingDesiredValue = $this.ConvertAdvancedSettingDesiredValueToCorrectType($advancedSetting)\n\n        $result = $advancedSettingDesiredValue -ne $advancedSetting.Value\n        if ($result) {\n            $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @(\n                $advancedSetting.Name,\n                $advancedSetting.Value,\n                $advancedSettingDesiredValue\n            ))\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if any of the Advanced Settings present in the hashtable need to be updated.\n    #>\n    [bool] ShouldUpdateVMHostAdvancedSettings($vmHost) {\n        $retrievedAdvancedSettings = $this.GetAdvancedSettings($vmHost)\n\n        foreach ($advancedSettingName in $this.AdvancedSettings.Keys) {\n            $advancedSetting = $this.GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHost.Name)\n\n            if ($null -ne $advancedSetting -and $this.ShouldUpdateVMHostAdvancedSetting($advancedSetting)) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Advanced Option Manager of the specified VMHost.\n    #>\n    [PSObject] GetVMHostAdvancedOptionManager($vmHost) {\n        try {\n            $vmHostAdvancedOptionManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.AdvancedOption -ErrorAction Stop\n            return $vmHostAdvancedOptionManager\n        }\n        catch {\n            throw \"VMHost Advanced Option Manager could not be retrieved. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on these Advanced Settings that are present in the hashtable and\n    need to be updated.\n    #>\n    [void] UpdateVMHostAdvancedSettings($vmHost) {\n        $retrievedAdvancedSettings = $this.GetAdvancedSettings($vmHost)\n        $vmHostAdvancedOptionManager = $this.GetVMHostAdvancedOptionManager($vmHost)\n        $options = @()\n\n        foreach ($advancedSettingName in $this.AdvancedSettings.Keys) {\n            $advancedSetting = $this.GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHost.Name)\n\n            if ($null -ne $advancedSetting -and $this.ShouldUpdateVMHostAdvancedSetting($advancedSetting)) {\n                <#\n                Each element in the hashtable is of type MSFT_KeyValuePair where the value is a string.\n                So before setting the value of the option, we need to convert it to its original type which can be\n                retrieved from its server value.\n                #>\n                $option = New-Object VMware.Vim.OptionValue\n                $option.Key = $advancedSettingName\n                $option.Value = $this.ConvertAdvancedSettingDesiredValueToCorrectType($advancedSetting)\n\n                $options += $option\n            }\n        }\n\n        if ($options.Length -eq 0) {\n            return\n        }\n\n        try {\n            Update-VMHostAdvancedSettings -VMHostAdvancedOptionManager $vmHostAdvancedOptionManager -Options $options\n        }\n        catch {\n            throw \"The Advanced Settings Update operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Advanced Settings from the server.\n    #>\n    [void] PopulateResult($vmHost, $result) {\n        $retrievedAdvancedSettings = $this.GetAdvancedSettings($vmHost)\n\n        foreach ($advancedSettingName in $this.AdvancedSettings.Keys) {\n            $advancedSetting = $this.GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHost.Name)\n\n            if ($null -ne $advancedSetting) {\n                <#\n                The LCM converts the hashtable to MSFT_KeyValuePair class which has the following properties:\n                Key of type string and Value of type string. So the value of the Advanced Setting from the server\n                should be converted to string to avoid an error to be thrown. This will only work for primitive types\n                like bool, int, long and so on. If a non-primitive type is introduced for Advanced Setting, invalid result\n                will be returned from the conversion.\n                #>\n                $result.AdvancedSettings[$advancedSettingName] = $advancedSetting.Value.ToString()\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostAgentVM.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostAgentVM : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Datastore used for deploying Agent VMs on this host.\n    #>\n    [DscProperty()]\n    [string] $AgentVmDatastore\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Management Network for Agent VMs on this host.\n    #>\n    [DscProperty()]\n    [string] $AgentVmNetwork\n\n    hidden [string] $AgentVmDatastoreName = 'AgentVmDatastore'\n    hidden [string] $AgentVmNetworkName = 'AgentVmNetwork'\n    hidden [string] $GetAgentVmDatastoreAsViewObjectMethodName = 'GetAgentVmDatastoreAsViewObject'\n    hidden [string] $GetAgentVmNetworkAsViewObjectMethodName = 'GetAgentVmNetworkAsViewObject'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            # vCenter Connection is needed to retrieve the EsxAgentHostManager.\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $esxAgentHostManager = $this.GetEsxAgentHostManager($vmHost)\n\n            $this.UpdateAgentVMConfiguration($vmHost, $esxAgentHostManager)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            # vCenter Connection is needed to retrieve the EsxAgentHostManager.\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $esxAgentHostManager = $this.GetEsxAgentHostManager($vmHost)\n\n            return !$this.ShouldUpdateAgentVMConfiguration($esxAgentHostManager)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostAgentVM] Get() {\n        try {\n            $result = [VMHostAgentVM]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n\n            # vCenter Connection is needed to retrieve the EsxAgentHostManager.\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $esxAgentHostManager = $this.GetEsxAgentHostManager($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($esxAgentHostManager, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the EsxAgentHostManager of the specified VMHost from the server.\n    #>\n    [PSObject] GetEsxAgentHostManager($vmHost) {\n        try {\n            $esxAgentHostManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.EsxAgentHostManager -ErrorAction Stop\n            return $esxAgentHostManager\n        }\n        catch {\n            throw \"Could not retrieve the EsxAgentHostManager of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the AgentVM Datastore of the EsxAgentHostManager of the specified VMHost from the server as a View Object.\n    #>\n    [PSObject] GetAgentVmDatastoreAsViewObject($esxAgentHostManager) {\n        try {\n            $datastoreAsViewObject = Get-View -Server $this.Connection -Id $esxAgentHostManager.ConfigInfo.AgentVmDatastore -ErrorAction Stop\n            return $datastoreAsViewObject\n        }\n        catch {\n            throw \"Could not retrieve the AgentVM Datastore of the EsxAgentHostManager. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the AgentVM Network of the EsxAgentHostManager of the specified VMHost from the server as a View Object.\n    #>\n    [PSObject] GetAgentVmNetworkAsViewObject($esxAgentHostManager) {\n        try {\n            $networkAsViewObject = Get-View -Server $this.Connection -Id $esxAgentHostManager.ConfigInfo.AgentVmNetwork -ErrorAction Stop\n            return $networkAsViewObject\n        }\n        catch {\n            throw \"Could not retrieve the AgentVM Network of the EsxAgentHostManager. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the AgentVM Setting needs to be updated with the desired value.\n    #>\n    [bool] ShouldUpdateAgentVMSetting($esxAgentHostManager, $agentVmSetting, $agentVmSettingName, $getAgentVmSettingAsViewObjectMethodName) {\n        if ($null -eq $agentVmSetting) {\n            if ($null -ne $esxAgentHostManager.ConfigInfo.$agentVmSettingName) {\n                return $true\n            }\n        }\n        else {\n            if ($null -eq $esxAgentHostManager.ConfigInfo.$agentVmSettingName) {\n                return $true\n            }\n            else {\n                $agentVmSettingAsViewObject = $this.$getAgentVmSettingAsViewObjectMethodName($esxAgentHostManager)\n                if ($agentVmSetting -ne $agentVmSettingAsViewObject.Name) {\n                    $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @(\n                        $agentVmSettingName,\n                        $agentVmSettingAsViewObject.Name,\n                        $agentVmSetting\n                    ))\n\n                    return $true\n                }\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the AgentVM Configuration needs to be updated with the desired values.\n    #>\n    [bool] ShouldUpdateAgentVMConfiguration($esxAgentHostManager) {\n        if ($this.ShouldUpdateAgentVMSetting($esxAgentHostManager, $this.AgentVmDatastore, $this.AgentVmDatastoreName, $this.GetAgentVmDatastoreAsViewObjectMethodName)) {\n            return $true\n        }\n        elseif ($this.ShouldUpdateAgentVMSetting($esxAgentHostManager, $this.AgentVmNetwork, $this.AgentVmNetworkName, $this.GetAgentVmNetworkAsViewObjectMethodName)) {\n            return $true\n        }\n        else {\n            return $false\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore for AgentVM from the server if it exists.\n    If the Datastore name is not passed it returns $null and if the Datastore does not exist\n    it throws an exception.\n    #>\n    [PSObject] GetDatastoreForAgentVM($vmHost) {\n        if ($null -eq $this.AgentVmDatastore) {\n            return $null\n        }\n\n        try {\n            $datastore = Get-Datastore -Server $this.Connection -Name $this.AgentVmDatastore -RelatedObject $vmHost -ErrorAction Stop\n            return $datastore.ExtensionData.MoRef\n        }\n        catch {\n            throw \"Could not retrieve Datastore $($this.AgentVmDatastore) for VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Network for AgentVM from the specified VMHost if it exists.\n    If the Network name is not passed it returns $null and if the Network does not exist\n    it throws an exception.\n    #>\n    [PSObject] GetNetworkForAgentVM($vmHost) {\n        if ($null -eq $this.AgentVmNetwork) {\n            return $null\n        }\n\n        $foundNetwork = $null\n        $networks = $vmHost.ExtensionData.Network\n\n        foreach ($network in $networks) {\n            $networkAsViewObject = Get-View -Server $this.Connection -Id $network\n            if ($this.AgentVmNetwork -eq $networkAsViewObject.Name) {\n                $foundNetwork = $network\n                break\n            }\n        }\n\n        if ($null -eq $foundNetwork) {\n            throw \"Could not find Network $($this.AgentVmNetwork) for VMHost $($vmHost.Name).\"\n        }\n\n        return $foundNetwork\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the AgentVM Configuration of the specified VMHost by setting the Datastore and Network.\n    #>\n    [void] UpdateAgentVMConfiguration($vmHost, $esxAgentHostManager) {\n        $datastore = $this.GetDatastoreForAgentVM($vmHost)\n        $network = $this.GetNetworkForAgentVM($vmHost)\n\n        $configInfo = New-Object VMware.Vim.HostEsxAgentHostManagerConfigInfo\n\n        $configInfo.AgentVmDatastore = $datastore\n        $configInfo.AgentVmNetwork = $network\n\n        try {\n            Update-AgentVMConfiguration -EsxAgentHostManager $esxAgentHostManager -EsxAgentHostManagerConfigInfo $configInfo\n        }\n        catch {\n            throw \"The AgentVM Configuration of VMHost $($vmHost.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the AgentVM Setting value from the Configuration on the server.\n    #>\n    [string] PopulateAgentVmSetting($esxAgentHostManager, $agentVmSettingName, $getAgentVmSettingAsViewObjectMethodName) {\n        if ($null -eq $esxAgentHostManager.ConfigInfo.$agentVmSettingName) {\n            return $null\n        }\n        else {\n            $agentVmSettingAsViewObject = $this.$getAgentVmSettingAsViewObjectMethodName($esxAgentHostManager)\n            return $agentVmSettingAsViewObject.Name\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the AgentVM Settings from the server.\n    #>\n    [void] PopulateResult($esxAgentHostManager, $result) {\n        $result.AgentVmDatastore = $this.PopulateAgentVmSetting($esxAgentHostManager, $this.AgentVmDatastoreName, $this.GetAgentVmDatastoreAsViewObjectMethodName)\n        $result.AgentVmNetwork = $this.PopulateAgentVmSetting($esxAgentHostManager, $this.AgentVmNetworkName, $this.GetAgentVmNetworkAsViewObjectMethodName)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostAuthentication.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostAuthentication : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the domain to join/leave. The name should be the fully qualified domain name (FQDN).\n    #>\n    [DscProperty(Mandatory)]\n    [string] $DomainName\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the specified VMHost should join/leave the specified domain.\n    #>\n    [DscProperty(Mandatory)]\n    [DomainAction] $DomainAction\n\n    <#\n    .DESCRIPTION\n\n    The credentials needed for joining the specified domain.\n    #>\n    [DscProperty()]\n    [PSCredential] $DomainCredential\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostAuthenticationInfo = $this.GetVMHostAuthenticationInfo($vmHost)\n\n            if ($this.DomainAction -eq [DomainAction]::Join) {\n                $this.JoinDomain($vmHostAuthenticationInfo, $vmHost)\n            }\n            else {\n                $this.LeaveDomain($vmHostAuthenticationInfo, $vmHost)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostAuthenticationInfo = $this.GetVMHostAuthenticationInfo($vmHost)\n\n            $result = $null\n            if ($this.DomainAction -eq [DomainAction]::Join) {\n                $result = !$this.ShouldUpdateDscResourceSetting('DomainName', [string] $vmHostAuthenticationInfo.Domain, $this.DomainName)\n            }\n            else {\n                $result = ($null -eq $vmHostAuthenticationInfo.Domain)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostAuthentication] Get() {\n        try {\n            $result = [VMHostAuthentication]::new()\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostAuthenticationInfo = $this.GetVMHostAuthenticationInfo($vmHost)\n\n            $this.PopulateResult($vmHostAuthenticationInfo, $vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Authentication information for the specified VMHost.\n    #>\n    [PSObject] GetVMHostAuthenticationInfo($vmHost) {\n        try {\n            $vmHostAuthenticationInfo = Get-VMHostAuthentication -Server $this.Connection -VMHost $vmHost -ErrorAction Stop\n            return $vmHostAuthenticationInfo\n        }\n        catch {\n            throw \"Could not retrieve Authentication information for VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Includes the specified VMHost in the specified domain.\n    #>\n    [void] JoinDomain($vmHostAuthenticationInfo, $vmHost) {\n        $setVMHostAuthenticationParams = @{\n            VMHostAuthentication = $vmHostAuthenticationInfo\n            Domain = $this.DomainName\n            Credential = $this.DomainCredential\n            JoinDomain = $true\n            Confirm = $false\n            ErrorAction = 'Stop'\n        }\n\n        try {\n            Set-VMHostAuthentication @setVMHostAuthenticationParams\n        }\n        catch {\n            throw \"Could not include VMHost $($vmHost.Name) in domain $($this.DomainName). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Excludes the specified VMHost from the specified domain.\n    #>\n    [void] LeaveDomain($vmHostAuthenticationInfo, $vmHost) {\n        $setVMHostAuthenticationParams = @{\n            VMHostAuthentication = $vmHostAuthenticationInfo\n            LeaveDomain = $true\n            Force = $true\n            Confirm = $false\n            ErrorAction = 'Stop'\n        }\n\n        try {\n            Set-VMHostAuthentication @setVMHostAuthenticationParams\n        }\n        catch {\n            throw \"Could not exclude VMHost $($vmHost.Name) from domain $($this.DomainName). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($vmHostAuthenticationInfo, $vmHost, $result) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        if ($null -ne $vmHostAuthenticationInfo.Domain) {\n            $result.DomainName = $vmHostAuthenticationInfo.Domain\n            $result.DomainAction = [DomainAction]::Join\n        }\n        else {\n            $result.DomainName = $this.DomainName\n            $result.DomainAction = [DomainAction]::Leave\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostCache.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostCache : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore used for swap performance enhancement.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the space to allocate on the specified Datastore to implement swap performance enhancements, in GB.\n    This value should be less than or equal to the free space capacity of the Datastore.\n    #>\n    [DscProperty(Mandatory)]\n    [double] $SwapSizeGB\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateHostCacheConfiguration($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            return !$this.ShouldUpdateHostCacheConfiguration($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostCache] Get() {\n        try {\n            $result = [VMHostCache]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    hidden [int] $NumberOfFractionalDigits = 3\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Cache Configuration Manager of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostCacheConfigurationManager($vmHost) {\n        try {\n            $vmHostCacheConfigurationManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.CacheConfigurationManager -ErrorAction Stop\n            return $vmHostCacheConfigurationManager\n        }\n        catch {\n            throw \"Could not retrieve the Cache Configuration Manager of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore for Host Cache Configuration from the server if it exists.\n    If the Datastore does not exist, it throws an exception.\n    #>\n    [PSObject] GetDatastore($vmHost) {\n        try {\n            $foundDatastore = Get-Datastore -Server $this.Connection -Name $this.DatastoreName -RelatedObject $vmHost -ErrorAction Stop\n            return $foundDatastore\n        }\n        catch {\n            throw \"Could not retrieve Datastore $($this.DatastoreName) for VMHost $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Cache Info for the specified Datastore from the Host Cache Configuration.\n    If the Datastore is not enabled for swap performance, it throws an exception.\n    #>\n    [PSObject] GetDatastoreCacheInfo($vmHostCacheConfigurationManager, $foundDatastore) {\n        $datastoreCacheInfo = $vmHostCacheConfigurationManager.CacheConfigurationInfo | Where-Object { $_.Key -eq $foundDatastore.ExtensionData.MoRef }\n        if ($null -eq $datastoreCacheInfo) {\n            throw \"Datastore $($foundDatastore.Name) could not be found in enabled for swap performance Datastores.\"\n        }\n\n        return $datastoreCacheInfo\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed MB value to GB value by rounding it down with 3 fractional digits in the return value.\n    #>\n    [double] ConvertMBValueToGBValue($mbValue) {\n        return [Math]::Round($mbValue * 1MB / 1GB, $this.NumberOfFractionalDigits)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed GB value to MB value by rounding it down.\n    #>\n    [long] ConvertGBValueToMBValue($gbValue) {\n        return [long] [Math]::Round($gbValue * 1GB / 1MB)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Host Cache Configuration should be updated for the specified VMHost by checking\n    if the current Swap Size is equal to the desired one for the specified Datastore.\n    #>\n    [bool] ShouldUpdateHostCacheConfiguration($vmHost) {\n        $vmHostCacheConfigurationManager = $this.GetVMHostCacheConfigurationManager($vmHost)\n        $foundDatastore = $this.GetDatastore($vmHost)\n        $datastoreCacheInfo = $this.GetDatastoreCacheInfo($vmHostCacheConfigurationManager, $foundDatastore)\n\n        return $this.ShouldUpdateDscResourceSetting('SwapSizeGB', $this.ConvertMBValueToGBValue($datastoreCacheInfo.SwapSize), $this.SwapSizeGB)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Host Cache Configuration of the specified VMHost by changing the Swap Size for the\n    specified Datastore.\n    #>\n    [void] UpdateHostCacheConfiguration($vmHost) {\n        $vmHostCacheConfigurationManager = $this.GetVMHostCacheConfigurationManager($vmHost)\n        $foundDatastore = $this.GetDatastore($vmHost)\n\n        if ($this.SwapSizeGB -lt 0) {\n            throw \"The passed Swap Size $($this.SwapSizeGB) is less than zero.\"\n        }\n\n        if ($this.SwapSizeGB -gt $foundDatastore.FreeSpaceGB) {\n            throw \"The passed Swap Size $($this.SwapSizeGB) is larger than the free space of the Datastore $($foundDatastore.Name).\"\n        }\n\n        $hostCacheConfigurationSpec = New-Object VMware.Vim.HostCacheConfigurationSpec\n        $hostCacheConfigurationSpec.Datastore = $foundDatastore.ExtensionData.MoRef\n        $hostCacheConfigurationSpec.SwapSize = $this.ConvertGBValueToMBValue($this.SwapSizeGB)\n\n        $hostCacheConfigurationResult = Update-HostCacheConfiguration -VMHostCacheConfigurationManager $vmHostCacheConfigurationManager -Spec $hostCacheConfigurationSpec\n        $hostCacheConfigurationTask = Get-Task -Server $this.Connection -Id $hostCacheConfigurationResult\n\n        try {\n            Wait-Task -Task $hostCacheConfigurationTask -ErrorAction Stop\n        }\n        catch {\n            throw \"An error occured while updating Cache Configuration for VMHost $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n\n        $this.WriteLogUtil('Verbose', \"Cache Configuration was successfully updated for VMHost {0}.\", @($this.Name))\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Host Cache Configuration from the server.\n    #>\n    [void] PopulateResult($vmHost, $result) {\n        $vmHostCacheConfigurationManager = $this.GetVMHostCacheConfigurationManager($vmHost)\n        $foundDatastore = $this.GetDatastore($vmHost)\n        $datastoreCacheInfo = $this.GetDatastoreCacheInfo($vmHostCacheConfigurationManager, $foundDatastore)\n\n        $result.DatastoreName = $foundDatastore.Name\n        $result.SwapSizeGB = $this.ConvertMBValueToGBValue($datastoreCacheInfo.SwapSize)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostConfiguration : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the state of the VMHost. If there are powered on VMs on the VMHost, the VMHost can be set into Maintenance mode, only if it is a part of a Drs-enabled Cluster.\n    Before entering Maintenance mode, if the VMHost is fully automated, all powered on VMs are relocated. If the VMHost is not fully automated,\n    a Drs recommendation is generated and all powered on VMs are relocated or powered off.\n    Valid values are Connected, Disconnected and Maintenance.\n    #>\n    [DscProperty()]\n    [VMHostState] $State = [VMHostState]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the license key to be used by the VMHost. You can set the VMHost to evaluation mode by passing the '00000-00000-00000-00000-00000' evaluation key.\n    #>\n    [DscProperty()]\n    [string] $LicenseKey\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Time Zone for the VMHost.\n    #>\n    [DscProperty()]\n    [string] $TimeZoneName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore that is visible to the VMHost and can be used for storing swapfiles for the VMs that run on the VMHost. Using a VMHost-specific\n    swap location might degrade the VMotion performance.\n    #>\n    [DscProperty()]\n    [string] $VMSwapfileDatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the swapfile placement policy.\n    Valid values are InHostDatastore and WithVM.\n    #>\n    [DscProperty()]\n    [VMSwapfilePolicy] $VMSwapfilePolicy = [VMSwapfilePolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the host profile associated with the VMHost. If the value is an empty string, the current profile association should not exist.\n    #>\n    [DscProperty()]\n    [string] $HostProfileName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the KmsCluster which is used to generate a key to set the VMHost. If the property is passed and the VMHost is not in CryptoSafe state,\n    the DSC Resource makes the VMHost CryptoSafe. If the property is passed and the VMHost is already in CryptoSafe state, the DSC Resource resets the CryptoKey in the VMHost.\n    #>\n    [DscProperty()]\n    [string] $KmsClusterName\n\n    <#\n    .DESCRIPTION\n\n    If the value is $true, vCenter Server system automatically reregisters the VMs that are compatible for reregistration. If they are not compatible, they remain on the VMHost.\n    The Evacuate property is valid only when the connection is to a vCenter Server system and the State property is 'Maintenance'. Also, the VMHost must be in a Drs-enabled Cluster.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Evacuate\n\n    <#\n    .DESCRIPTION\n\n    Specifies the special action to take regarding Virtual SAN data when moving in Maintenance mode. The VsanDataMigrationMode property is valid only when the connection is to a\n    vCenter Server system and the State property is 'Maintenance'.\n    #>\n    [DscProperty()]\n    [VsanDataMigrationMode] $VsanDataMigrationMode = [VsanDataMigrationMode]::Unset\n\n    hidden [string] $ClusterType = 'VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster'\n    hidden [int] $EnterMaintenanceModeTaskSecondsToSleep = 5\n\n    hidden [string] $ModifyVMHostConfigurationMessage = \"Modifying the configuration of VMHost {0}.\"\n    hidden [string] $ApplyingDrsRecommendationsFromClusterMessage = \"Applying Drs Recommendations from Cluster {0}.\"\n    hidden [string] $VMHostStateWasChangedSuccessfullyMessage = \"The state of the VMHost {0} was changed successfully to {1}.\"\n    hidden [string] $ModifyVMHostCryptoKeyMessage = \"Modifying the Crypto Key of VMHost {0} by using Kms Cluster {1}.\"\n\n    hidden [string] $CouldNotRetrieveTimeZoneMessage = \"Could not retrieve Time Zone {0} available on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveDatastoreMessage = \"Could not retrieve Datastore {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveHostProfileMessage = \"Could not retrieve Host Profile {0} from Server {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveHostProfileAssociatedWithVMHostMessage = \"Could not retrieve Host Profile associated with VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveKmsClusterMessage = \"Could not retrieve Kms Cluster {0} from the Server. For more information: {1}\"\n    hidden [string] $CouldNotModifyVMHostConfigurationMessage = \"Could not modify the configuration of VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotModifyVMHostCryptoKeyMessage = \"Could not modify the Crypto Key of VMHost {0} by using Kms Cluster {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            if ($this.ShouldModifyVMHostConfiguration($vmHost)) {\n                $setVMHostParams = $this.GetVMHostParamsToModify($vmHost)\n\n                if ($this.ShouldApplyDrsRecommendation($vmHost)) {\n                    $this.ModifyVMHostConfigurationAndApplyDrsRecommendation($setVMHostParams)\n                }\n                else {\n                    $this.ModifyVMHostConfiguration($setVMHostParams)\n                }\n            }\n\n            if ($this.ShouldModifyCryptoKeyOfVMHost($vmHost)) {\n                $this.ModifyVMHostCryptoKey($vmHost)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $result = $true\n\n            if ($this.ShouldModifyVMHostConfiguration($vmHost) -or $this.ShouldModifyCryptoKeyOfVMHost($vmHost)) {\n                $result = $false\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostConfiguration] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostConfiguration]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Time Zone with the specified name available on the specified VMHost.\n    #>\n    [PSObject] GetVMHostTimeZone($vmHost) {\n        $getVMHostAvailableTimeZoneParams = @{\n            Server = $this.Connection\n            Name = $this.TimeZoneName\n            VMHost = $vmHost\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $vmHostTimeZone = Get-VMHostAvailableTimeZone @getVMHostAvailableTimeZoneParams\n            return $vmHostTimeZone\n        }\n        catch {\n            throw ($this.CouldNotRetrieveTimeZoneMessage -f $this.TimeZoneName, $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore with the specified name that is used for storing swapfiles for the VMs that run on the specified VMHost.\n    #>\n    [PSObject] GetVMSwapfileDatastore($vmHost) {\n        $getDatastoreParams = @{\n            Server = $this.Connection\n            Name = $this.VMSwapfileDatastoreName\n            VMHost = $vmHost\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $vmSwapfileDatastore = Get-Datastore @getDatastoreParams\n            return $vmSwapfileDatastore\n        }\n        catch {\n            throw ($this.CouldNotRetrieveDatastoreMessage -f $this.VMSwapfileDatastoreName, $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Host Profile with the specified name from the Server.\n    #>\n    [PSObject] GetHostProfile() {\n        $getVMHostProfileParams = @{\n            Server = $this.Connection\n            Name = $this.HostProfileName\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $hostProfile = Get-VMHostProfile @getVMHostProfileParams\n            return $hostProfile\n        }\n        catch {\n            throw ($this.CouldNotRetrieveHostProfileMessage -f $this.HostProfileName, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Host Profile associated with the specified VMHost if the VMHost is associated with a Host Profile.\n    Otherwise returns $null, which indicates that the VMHost is not associated with a Host Profile.\n    #>\n    [PSObject] GetHostProfileAssociatedWithVMHost($vmHost) {\n        $getVMHostProfileParams = @{\n            Server = $this.Connection\n            Entity = $vmHost\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        if (![string]::IsNullOrEmpty($this.HostProfileName)) {\n            $getVMHostProfileParams.Name = $this.HostProfileName\n        }\n\n        try {\n            $hostProfileAssociatedWithVMHost = Get-VMHostProfile @getVMHostProfileParams\n            return $hostProfileAssociatedWithVMHost\n        }\n        catch {\n            throw ($this.CouldNotRetrieveHostProfileAssociatedWithVMHostMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Kms Cluster with the specified name from the Server.\n    #>\n    [PSObject] GetKmsCluster() {\n        try {\n            $kmsCluster = Get-KmsCluster -Server $this.Connection -Name $this.KmsClusterName -ErrorAction Stop -Verbose:$false\n            return $kmsCluster\n        }\n        catch {\n            throw ($this.CouldNotRetrieveKmsClusterMessage -f $this.KmsClusterName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates and returns the parameters which should be modified with the Set-VMHost cmdlet.\n    #>\n    [hashtable] GetVMHostParamsToModify($vmHost) {\n        $setVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if (\n            ![string]::IsNullOrEmpty($this.LicenseKey) -and\n            $this.LicenseKey -ne $vmHost.LicenseKey\n        ) { $setVMHostParams.LicenseKey = $this.LicenseKey }\n\n        if (\n            ![string]::IsNullOrEmpty($this.TimeZoneName) -and\n            $this.TimeZoneName -ne $vmHost.TimeZone.Name\n        ) { $setVMHostParams.TimeZone = $this.GetVMHostTimeZone($vmHost) }\n\n        if (\n            ![string]::IsNullOrEmpty($this.VMSwapfileDatastoreName) -and\n            $this.VMSwapfileDatastoreName -ne $vmHost.VMSwapfileDatastore.Name\n        ) { $setVMHostParams.VMSwapfileDatastore = $this.GetVMSwapfileDatastore($vmHost) }\n\n        if (\n            $this.VMSwapfilePolicy -ne [VMSwapfilePolicy]::Unset -and\n            $this.VMSwapfilePolicy.ToString() -ne $vmHost.VMSwapfilePolicy.ToString()\n        ) { $setVMHostParams.VMSwapfilePolicy = $this.VMSwapfilePolicy.ToString() }\n\n        if ($null -ne $this.HostProfileName) {\n            if ($this.HostProfileName -eq [string]::Empty) {\n                # Profile value '$null' cannot be passed if the specified VMHost does not have a Host Profile associated with it.\n                $hostProfileAssociatedWithVMHost = $this.GetHostProfileAssociatedWithVMHost($vmHost)\n                if ($null -ne $hostProfileAssociatedWithVMHost) {\n                    $setVMHostParams.Profile = $null\n                }\n            }\n            else {\n                $setVMHostParams.Profile = $this.GetHostProfile()\n            }\n        }\n\n        if (\n            $this.State -ne [VMHostState]::Unset -and\n            $this.State.ToString() -ne $vmHost.ConnectionState.ToString()\n        ) {\n            $setVMHostParams.State = $this.State.ToString()\n            if ($this.State -eq [VMHostState]::Maintenance) {\n                if ($null -ne $this.Evacuate) { $setVMHostParams.Evacuate = $this.Evacuate }\n                if ($this.VsanDataMigrationMode -ne [VsanDataMigrationMode]::Unset) { $setVMHostParams.VsanDataMigrationMode = $this.VsanDataMigrationMode.ToString() }\n            }\n        }\n\n        return $setVMHostParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the configuration of the specified VMHost should be modified.\n    #>\n    [bool] ShouldModifyVMHostConfiguration($vmHost) {\n        $shouldModifyVMHostConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('State', [string] $vmHost.ConnectionState, $this.State.ToString()),\n            $this.ShouldUpdateDscResourceSetting('LicenseKey', [string] $vmHost.LicenseKey, $this.LicenseKey),\n            $this.ShouldUpdateDscResourceSetting('TimeZoneName', [string] $vmHost.TimeZone.Name, $this.TimeZoneName),\n            $this.ShouldUpdateDscResourceSetting('VMSwapfileDatastoreName', [string] $vmHost.VMSwapfileDatastore.Name, $this.VMSwapfileDatastoreName),\n            $this.ShouldUpdateDscResourceSetting('VMSwapfilePolicy', [string] $vmHost.VMSwapfilePolicy, $this.VMSwapfilePolicy.ToString())\n        )\n\n        <#\n        If the Host Profile name is specified and it is an empty string, the VMHost should not be associated with a Host Profile.\n        If the Host Profile name is not an empty string, the VMHost should be associated with the specified Host Profile.\n        #>\n        if ($null -ne $this.HostProfileName) {\n            $hostProfileAssociatedWithVMHost = $this.GetHostProfileAssociatedWithVMHost($vmHost)\n            if ($this.HostProfileName -eq [string]::Empty) {\n                $shouldModifyVMHostConfiguration += ($null -ne $hostProfileAssociatedWithVMHost)\n            }\n            else {\n                $shouldModifyVMHostConfiguration += ($null -eq $hostProfileAssociatedWithVMHost)\n            }\n        }\n\n        return ($shouldModifyVMHostConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the CryptoKey of the specified VMHost should be modified.\n    #>\n    [bool] ShouldModifyCryptoKeyOfVMHost($vmHost) {\n        $result = $false\n\n        if (![string]::IsNullOrEmpty($this.KmsClusterName)) {\n            $kmsCluster = $this.GetKmsCluster()\n            $result = ($kmsCluster.Id -ne $vmHost.ExtensionData.Runtime.CryptoKeyId.ProviderId.Id)\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if a Drs recommendation should be generated and applied. A Drs recommendation is generated when the following criteria is met:\n    1. State property is specified with 'Maintenance' value.\n    2. The current State of the VMHost is not 'Maintenance'.\n    3. The VMHost is part of a Drs Cluster and the Cluster is not 'Fully Automated'.\n    #>\n    [bool] ShouldApplyDrsRecommendation($vmHost) {\n        $result = $false\n        $vmHostParent = $vmHost.Parent\n\n        if (\n            $this.State -ne [VMHostState]::Unset -and\n            $this.State -eq [VMHostState]::Maintenance -and\n            $vmHost.ConnectionState.ToString() -ne ([VMHostState]::Maintenance).ToString() -and\n            $this.IsVIObjectOfTheCorrectType($vmHostParent, $this.ClusterType)\n        ) {\n            $clusterAutomationLevel = $vmHostParent.DrsAutomationLevel.ToString()\n            $result = (\n                $vmHostParent.DrsEnabled -and\n                $clusterAutomationLevel -ne ([DrsAutomationLevel]::FullyAutomated).ToString()\n            )\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the specified configuration parameters of the VMHost.\n    Generates and applies the Drs Recommendation from the Cluster of the specified VMHost.\n    #>\n    [void] ModifyVMHostConfigurationAndApplyDrsRecommendation($setVMHostParams) {\n        $setVMHostParams.RunAsync = $true\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostConfigurationMessage, @($setVMHostParams.VMHost.Name))\n\n            $modifyVMHostConfigurationTask = Set-VMHost @setVMHostParams\n\n            # The Drs Recommendation is not generated immediately after 'EnterMaintenance' task generation.\n            Start-Sleep -Seconds $this.EnterMaintenanceModeTaskSecondsToSleep\n\n            $getDrsRecommendationParams = @{\n                Server = $this.Connection\n                Cluster = $setVMHostParams.VMHost.Parent\n                Refresh = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            $clusterDrsRecommendations = Get-DrsRecommendation @getDrsRecommendationParams\n            if ($null -ne $clusterDrsRecommendations) {\n                $applyDrsRecommendationParams = @{\n                    DrsRecommendation = $clusterDrsRecommendations\n                    RunAsync = $true\n                    Confirm = $false\n                    ErrorAction = 'Stop'\n                    Verbose = $false\n                }\n\n                # All generated Drs Recommendations from the Cluster should be applied and when the Task is completed all powered on VMs are relocated or powered off.\n                $this.WriteLogUtil('Verbose', $this.ApplyingDrsRecommendationsFromClusterMessage, @($setVMHostParams.VMHost.Parent.Name))\n\n                $applyDrsRecommendationTask = Apply-DrsRecommendation @applyDrsRecommendationParams\n                Wait-Task -Task $applyDrsRecommendationTask -ErrorAction Stop -Verbose:$false\n            }\n\n            Wait-Task -Task $modifyVMHostConfigurationTask -ErrorAction Stop -Verbose:$false\n            $vmHost = $this.GetVMHost()\n\n            # The state of the VMHost should be verified when the Task completes.\n            if ($vmHost.ConnectionState.ToString() -eq ([VMHostState]::Maintenance).ToString()) {\n                $this.WriteLogUtil('Verbose', $this.VMHostStateWasChangedSuccessfullyMessage, @($vmHost.Name, $vmHost.ConnectionState.ToString()))\n            }\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostConfigurationMessage -f $setVMHostParams.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the specified configuration parameters of the VMHost.\n    #>\n    [void] ModifyVMHostConfiguration($setVMHostParams) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostConfigurationMessage, @($setVMHostParams.VMHost.Name))\n\n            Set-VMHost @setVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostConfigurationMessage -f $setVMHostParams.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the CryptoKey of the specified VMHost.\n    #>\n    [void] ModifyVMHostCryptoKey($vmHost) {\n        $setVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        $kmsCluster = $this.GetKmsCluster()\n        $setVMHostParams.KmsCluster = $kmsCluster\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostCryptoKeyMessage, @($vmHost.Name, $kmsCluster.Name))\n\n            Set-VMHost @setVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostCryptoKeyMessage -f $vmHost.Name, $kmsCluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.State = $vmHost.ConnectionState.ToString()\n        $result.Evacuate = $this.Evacuate\n        $result.VsanDataMigrationMode = $this.VsanDataMigrationMode\n        $result.LicenseKey = $vmHost.LicenseKey\n        $result.TimeZoneName = $vmHost.TimeZone.Name\n        $result.VMSwapfileDatastoreName = $vmHost.VMSwapfileDatastore.Name\n        $result.VMSwapfilePolicy = $vmHost.VMSwapfilePolicy.ToString()\n\n        $hostProfileAssociatedWithVMHost = $this.GetHostProfileAssociatedWithVMHost($vmHost)\n        $result.HostProfileName = $hostProfileAssociatedWithVMHost.Name\n\n        if (![string]::IsNullOrEmpty($this.KmsClusterName)) {\n            $kmsCluster = $this.GetKmsCluster()\n            $result.KmsClusterName = if ($kmsCluster.Id -ne $vmHost.ExtensionData.Runtime.CryptoKeyId.ProviderId.Id) { $kmsCluster.Name } else { $null }\n        }\n        else {\n            $result.KmsClusterName = $this.KmsClusterName\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostDnsSettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostDnsSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n\n    List of domain name or IP address of the DNS Servers.\n    #>\n    [DscProperty()]\n    [string[]] $Address\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether DHCP is used to determine DNS configuration.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Dhcp\n\n    <#\n    .DESCRIPTION\n\n    Domain Name portion of the DNS name. For example, \"vmware.com\".\n    #>\n    [DscProperty(Mandatory)]\n    [string] $DomainName\n\n    <#\n    .DESCRIPTION\n\n    Host Name portion of DNS name. For example, \"esx01\".\n    #>\n    [DscProperty(Mandatory)]\n    [string] $HostName\n\n    <#\n    .DESCRIPTION\n\n    Desired value for the VMHost DNS Ipv6VirtualNicDevice.\n    #>\n    [DscProperty()]\n    [string] $Ipv6VirtualNicDevice\n\n    <#\n    .DESCRIPTION\n\n    Domain in which to search for hosts, placed in order of preference.\n    #>\n    [DscProperty()]\n    [string[]] $SearchDomain\n\n    <#\n    .DESCRIPTION\n\n    Desired value for the VMHost DNS VirtualNicDevice.\n    #>\n    [DscProperty()]\n    [string] $VirtualNicDevice\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateDns($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $vmHostDnsConfig = $vmHost.ExtensionData.Config.Network.DnsConfig\n\n            $result = !((\n                $this.ShouldUpdateDscResourceSetting('Dhcp', $vmHostDnsConfig.Dhcp, $this.Dhcp),\n                $this.ShouldUpdateDscResourceSetting('DomainName', $vmHostDnsConfig.DomainName, $this.DomainName),\n                $this.ShouldUpdateDscResourceSetting('HostName', $vmHostDnsConfig.HostName, $this.HostName),\n                $this.ShouldUpdateDscResourceSetting('Ipv6VirtualNicDevice', $vmHostDnsConfig.Ipv6VirtualNicDevice, $this.Ipv6VirtualNicDevice),\n                $this.ShouldUpdateDscResourceSetting('VirtualNicDevice', $vmHostDnsConfig.VirtualNicDevice, $this.VirtualNicDevice),\n                $this.ShouldUpdateArraySetting('Address', $vmHostDnsConfig.Address, $this.Address),\n                $this.ShouldUpdateArraySetting('SearchDomain', $vmHostDnsConfig.SearchDomain, $this.SearchDomain)\n            ) -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostDnsSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostDnsSettings]::new()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostDnsConfig = $vmHost.ExtensionData.Config.Network.DnsConfig\n\n            $result.Name = $vmHost.Name\n            $result.Server = $this.Server\n            $result.Address = $vmHostDnsConfig.Address\n            $result.Dhcp = $vmHostDnsConfig.Dhcp\n            $result.DomainName = $vmHostDnsConfig.DomainName\n            $result.HostName = $vmHostDnsConfig.HostName\n            $result.Ipv6VirtualNicDevice = $vmHostDnsConfig.Ipv6VirtualNicDevice\n            $result.SearchDomain = $vmHostDnsConfig.SearchDomain\n            $result.VirtualNicDevice = $vmHostDnsConfig.VirtualNicDevice\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the DNS Config of the VMHost with the Desired DNS Config.\n    #>\n    [void] UpdateDns($vmHost) {\n        $dnsConfigArgs = @{\n            Address = $this.Address\n            Dhcp = $this.Dhcp\n            DomainName = $this.DomainName\n            HostName = $this.HostName\n            Ipv6VirtualNicDevice = $this.Ipv6VirtualNicDevice\n            SearchDomain = $this.SearchDomain\n            VirtualNicDevice = $this.VirtualNicDevice\n        }\n\n        $dnsConfig = New-DNSConfig @dnsConfigArgs\n\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $vmHost.ExtensionData.ConfigManager.NetworkSystem\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $networkSystem = Get-View @getViewParams\n\n        try {\n            Update-DNSConfig -NetworkSystem $networkSystem -DnsConfig $dnsConfig\n        }\n        catch {\n            throw \"The DNS Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostFirewallRuleset.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostFirewallRuleset : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the firewall ruleset.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the firewall ruleset should be enabled or disabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the firewall ruleset allows connections from any IP address.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllIP\n\n    <#\n    .DESCRIPTION\n\n    Specifies the list of IP addresses. All IPv4 addresses are specified using dotted decimal format. For example '192.0.20.10'.\n    IPv6 addresses are 128-bit addresses represented as eight fields of up to four hexadecimal digits. A colon separates each field (:).\n    For example 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol '::' to represent multiple 16-bit groups of contiguous 0's only once in an address.\n    #>\n    [DscProperty()]\n    [string[]] $IPAddresses\n\n    hidden [string] $ModifyVMHostFirewallRulesetStateMessage = \"Modifying the state of firewall ruleset {0} on VMHost {1}.\"\n    hidden [string] $ModifyVMHostFirewallRulesetAllowedIPAddressesListMessage = \"Modifying the allowed IP addresses list of firewall ruleset {0} on VMHost {1}.\"\n\n    hidden [string] $CouldNotRetrieveFirewallSystemOfVMHostMessage = \"Could not retrieve the FirewallSystem managed object of VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveFirewallRulesetMessage = \"Could not retrieve firewall ruleset {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyVMHostFirewallRulesetStateMessage = \"Could not modify the state of firewall ruleset {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyVMHostFirewallRulesetAllowedIPAddressesListMessage = \"Could not modify the allowed IP addresses list of firewall ruleset {0} on VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $vmHostFirewallRuleset = $this.GetVMHostFirewallRuleset()\n\n            if ($this.ShouldModifyVMHostFirewallRulesetState($vmHostFirewallRuleset)) {\n                $this.ModifyVMHostFirewallRulesetState($vmHostFirewallRuleset)\n            }\n\n            if ($this.ShouldModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallRuleset)) {\n                $vmHostFirewallSystem = $this.GetVMHostFirewallSystem()\n                $this.ModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallSystem, $vmHostFirewallRuleset)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $vmHostFirewallRuleset = $this.GetVMHostFirewallRuleset()\n\n            $result = !($this.ShouldModifyVMHostFirewallRulesetState($vmHostFirewallRuleset) -or $this.ShouldModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallRuleset))\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostFirewallRuleset] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostFirewallRuleset]::new()\n\n            $this.RetrieveVMHost()\n\n            $vmHostFirewallRuleset = $this.GetVMHostFirewallRuleset()\n\n            $this.PopulateResult($result, $vmHostFirewallRuleset)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the FirewallSystem of the specified VMHost.\n    #>\n    [PSObject] GetVMHostFirewallSystem() {\n        try {\n            $firewallSystem = Get-View -Server $this.Connection -Id $this.VMHost.ExtensionData.ConfigManager.FirewallSystem -ErrorAction Stop -Verbose:$false\n            return $firewallSystem\n        }\n        catch {\n            throw ($this.CouldNotRetrieveFirewallSystemOfVMHostMessage -f $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the firewall ruleset with the specified name on the specified VMHost.\n    #>\n    [PSObject] GetVMHostFirewallRuleset() {\n        try {\n            $vmHostFirewallRuleset = Get-VMHostFirewallException -Server $this.Connection -Name $this.Name -VMHost $this.VMHost -ErrorAction Stop -Verbose:$false\n            return $vmHostFirewallRuleset\n        }\n        catch {\n            throw ($this.CouldNotRetrieveFirewallRulesetMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed string array containing IP networks in the following format: '10.20.120.12/22' to HostFirewallRulesetIpNetwork array,\n    where the 'Network' is '10.23.120.12' and the 'PrefixLength' is '22'.\n    #>\n    [array] ConvertIPNetworksToHostFirewallRulesetIpNetworks($ipNetworks) {\n        $hostFirewallRulesetIpNetworks = @()\n\n        foreach ($ipNetwork in $ipNetworks) {\n            $ipNetworkParts = $ipNetwork -Split '/'\n\n            $hostFirewallRulesetIpNetwork = New-Object -TypeName VMware.Vim.HostFirewallRulesetIpNetwork\n            $hostFirewallRulesetIpNetwork.Network = $ipNetworkParts[0]\n            $hostFirewallRulesetIpNetwork.PrefixLength = $ipNetworkParts[1]\n\n            $hostFirewallRulesetIpNetworks += $hostFirewallRulesetIpNetwork\n        }\n\n        return $hostFirewallRulesetIpNetworks\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed HostFirewallRulesetIpNetwork array containing IP networks in the following format: 'Network' = '10.23.120.12' and 'PrefixLength' = '22' to string array,\n    where each IP network is in the following format: '10.23.120.12/22'.\n    #>\n    [array] ConvertHostFirewallRulesetIpNetworksToIPNetworks($hostFirewallRulesetIpNetworks) {\n        $ipNetworks = @()\n\n        foreach ($hostFirewallRulesetIpNetwork in $hostFirewallRulesetIpNetworks) {\n            $ipNetwork = $hostFirewallRulesetIpNetwork.Network + '/' + $hostFirewallRulesetIpNetwork.PrefixLength\n            $ipNetworks += $ipNetwork\n        }\n\n        return $ipNetworks\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the current firewall ruleset state (enabled or disabled) is equal to the desired firewall ruleset state.\n    #>\n    [bool] ShouldModifyVMHostFirewallRulesetState($vmHostFirewallRuleset) {\n        return $this.ShouldUpdateDscResourceSetting('Enabled', $vmHostFirewallRuleset.Enabled, $this.Enabled)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the current firewall ruleset IP addresses allowed list is equal to the desired firewall ruleset IP addresses allowed list.\n    #>\n    [bool] ShouldModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallRuleset) {\n        $vmHostFirewallRulesetAllowedHosts = $vmHostFirewallRuleset.ExtensionData.AllowedHosts\n\n        $shouldModifyVMHostFirewallRulesetAllowedIPAddressesList = @(\n            $this.ShouldUpdateDscResourceSetting('AllIP', $vmHostFirewallRulesetAllowedHosts.AllIp, $this.AllIP)\n        )\n\n        if ($null -ne $this.IPAddresses) {\n            $desiredIPAddresses = $this.IPAddresses -NotMatch '/'\n            $desiredIPNetworks = $this.IPAddresses -Match '/'\n\n            $shouldModifyVMHostFirewallRulesetAllowedIPAddressesList += $this.ShouldUpdateArraySetting(\n                'IPAddresses',\n                $vmHostFirewallRulesetAllowedHosts.IpAddress,\n                $desiredIPAddresses\n            )\n            $shouldModifyVMHostFirewallRulesetAllowedIPAddressesList += $this.ShouldUpdateArraySetting(\n                'IPNetworks',\n                $this.ConvertHostFirewallRulesetIpNetworksToIPNetworks($vmHostFirewallRulesetAllowedHosts.IpNetwork),\n                $desiredIPNetworks\n            )\n        }\n\n        return ($shouldModifyVMHostFirewallRulesetAllowedIPAddressesList -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the firewall ruleset state depending on the specified value (enables or disables the firewall ruleset).\n    #>\n    [void] ModifyVMHostFirewallRulesetState($vmHostFirewallRuleset) {\n        $setVMHostFirewallExceptionParams = @{\n            Exception = $vmHostFirewallRuleset\n            Enabled = $this.Enabled\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostFirewallRulesetStateMessage, @($vmHostFirewallRuleset.Name, $this.VMHost.Name))\n\n            Set-VMHostFirewallException @setVMHostFirewallExceptionParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostFirewallRulesetStateMessage -f $vmHostFirewallRuleset.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the firewall ruleset IP addresses allowed list.\n    #>\n    [void] ModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallSystem, $vmHostFirewallRuleset) {\n        $vmHostFirewallRulesetSpec = New-Object -TypeName VMware.Vim.HostFirewallRulesetRulesetSpec\n        $vmHostFirewallRulesetSpec.AllowedHosts = New-Object -TypeName VMware.Vim.HostFirewallRulesetIpList\n\n        if ($null -ne $this.AllIP) { $vmHostFirewallRulesetSpec.AllowedHosts.AllIp = $this.AllIP }\n\n        if ($null -ne $this.IPAddresses) {\n            $desiredIPAddresses = $this.IPAddresses -NotMatch '/'\n            $desiredIPNetworks = $this.IPAddresses -Match '/'\n\n            $vmHostFirewallRulesetSpec.AllowedHosts.IpAddress = $desiredIPAddresses\n            $vmHostFirewallRulesetSpec.AllowedHosts.IpNetwork = $this.ConvertIPNetworksToHostFirewallRulesetIpNetworks($desiredIPNetworks)\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostFirewallRulesetAllowedIPAddressesListMessage, @($vmHostFirewallRuleset.Name, $this.VMHost.Name))\n\n            Update-VMHostFirewallRuleset -VMHostFirewallSystem $vmHostFirewallSystem -VMHostFirewallRulesetId $vmHostFirewallRuleset.ExtensionData.Key -VMHostFirewallRulesetSpec $vmHostFirewallRulesetSpec\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostFirewallRulesetAllowedIPAddressesListMessage -f $vmHostFirewallRuleset.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostFirewallRuleset) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Name = $vmHostFirewallRuleset.Name\n        $result.Enabled = $vmHostFirewallRuleset.Enabled\n\n        $vmHostFirewallRulesetAllowedHosts = $vmHostFirewallRuleset.ExtensionData.AllowedHosts\n        $result.AllIP = $vmHostFirewallRulesetAllowedHosts.AllIp\n        $result.IPAddresses = $vmHostFirewallRulesetAllowedHosts.IpAddress + $this.ConvertHostFirewallRulesetIpNetworksToIPNetworks($vmHostFirewallRulesetAllowedHosts.IpNetwork)\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostGraphics/VMHostGraphics.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostGraphics : VMHostGraphicsBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the default graphics type for the specified VMHost.\n    #>\n    [DscProperty(Mandatory)]\n    [GraphicsType] $GraphicsType\n\n    <#\n    .DESCRIPTION\n\n    Specifies the policy for assigning shared passthrough VMs to a host graphics device.\n    #>\n    [DscProperty(Mandatory)]\n    [SharedPassthruAssignmentPolicy] $SharedPassthruAssignmentPolicy\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            $this.EnsureVMHostIsInMaintenanceMode($vmHost)\n            $this.UpdateGraphicsConfiguration($vmHostGraphicsManager)\n            $this.RestartVMHost($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            return !$this.ShouldUpdateGraphicsConfiguration($vmHostGraphicsManager)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostGraphics] Get() {\n        try {\n            $result = [VMHostGraphics]::new()\n            $result.Server = $this.Server\n            $result.RestartTimeoutMinutes = $this.RestartTimeoutMinutes\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            $result.Name = $vmHost.Name\n            $result.GraphicsType = $vmHostGraphicsManager.GraphicsConfig.HostDefaultGraphicsType\n            $result.SharedPassthruAssignmentPolicy = $vmHostGraphicsManager.GraphicsConfig.SharedPassthruAssignmentPolicy\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Graphics Configuration needs to be updated with the desired values.\n    #>\n    [bool] ShouldUpdateGraphicsConfiguration($vmHostGraphicsManager) {\n        $shouldUpdateGraphicsConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting(\n                'GraphicsType',\n                [string] $vmHostGraphicsManager.GraphicsConfig.HostDefaultGraphicsType,\n                $this.GraphicsType.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'SharedPassthruAssignmentPolicy',\n                [string] $vmHostGraphicsManager.GraphicsConfig.SharedPassthruAssignmentPolicy,\n                $this.SharedPassthruAssignmentPolicy.ToString()\n            )\n        )\n\n        return ($shouldUpdateGraphicsConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Graphics Configuration of the specified VMHost.\n    #>\n    [void] UpdateGraphicsConfiguration($vmHostGraphicsManager) {\n        $vmHostGraphicsConfig = New-Object VMware.Vim.HostGraphicsConfig\n\n        $vmHostGraphicsConfig.HostDefaultGraphicsType = $this.ConvertEnumValueToServerValue($this.GraphicsType)\n        $vmHostGraphicsConfig.SharedPassthruAssignmentPolicy = $this.ConvertEnumValueToServerValue($this.SharedPassthruAssignmentPolicy)\n\n        try {\n            Update-GraphicsConfig -VMHostGraphicsManager $vmHostGraphicsManager -VMHostGraphicsConfig $vmHostGraphicsConfig\n        }\n        catch {\n            throw \"The Graphics Configuration of VMHost $($this.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostGraphics/VMHostGraphicsDevice.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostGraphicsDevice : VMHostGraphicsBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Graphics device identifier (ex. PCI ID).\n    #>\n    [DscProperty(Key)]\n    [string] $Id\n\n    <#\n    .DESCRIPTION\n\n    Specifies the graphics type for the specified Device in 'Id' property.\n    #>\n    [DscProperty(Mandatory)]\n    [GraphicsType] $GraphicsType\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            $this.EnsureVMHostIsInMaintenanceMode($vmHost)\n            $this.UpdateGraphicsConfiguration($vmHostGraphicsManager)\n            $this.RestartVMHost($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n            $foundDevice = $this.GetGraphicsDevice($vmHostGraphicsManager)\n\n            $result = !$this.ShouldUpdateDscResourceSetting(\n                'GraphicsType',\n                [string] $foundDevice.GraphicsType,\n                $this.GraphicsType.ToString()\n            )\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostGraphicsDevice] Get() {\n        try {\n            $result = [VMHostGraphicsDevice]::new()\n            $result.Server = $this.Server\n            $result.RestartTimeoutMinutes = $this.RestartTimeoutMinutes\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n            $foundDevice = $this.GetGraphicsDevice($vmHostGraphicsManager)\n\n            $result.Name = $vmHost.Name\n            $result.Id = $foundDevice.DeviceId\n            $result.GraphicsType = $foundDevice.GraphicsType\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Graphics Device with the specified Id from the server.\n    #>\n    [PSObject] GetGraphicsDevice($vmHostGraphicsManager) {\n        $foundDevice = $vmHostGraphicsManager.GraphicsConfig.DeviceType | Where-Object { $_.DeviceId -eq $this.Id }\n        if ($null -eq $foundDevice) {\n            throw \"Device $($this.Id) was not found in the available Graphics devices.\"\n        }\n\n        return $foundDevice\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Graphics Configuration of the specified VMHost by changing the Graphics Type for the\n    specified Device.\n    #>\n    [void] UpdateGraphicsConfiguration($vmHostGraphicsManager) {\n        $vmHostGraphicsConfig = New-Object VMware.Vim.HostGraphicsConfig\n\n        $vmHostGraphicsConfig.HostDefaultGraphicsType = $vmHostGraphicsManager.GraphicsConfig.HostDefaultGraphicsType\n        $vmHostGraphicsConfig.SharedPassthruAssignmentPolicy = $vmHostGraphicsManager.GraphicsConfig.SharedPassthruAssignmentPolicy\n        $vmHostGraphicsConfig.DeviceType = @()\n\n        $vmHostGraphicsConfigDeviceType = New-Object VMware.Vim.HostGraphicsConfigDeviceType\n        $vmHostGraphicsConfigDeviceType.DeviceId = $this.Id\n        $vmHostGraphicsConfigDeviceType.GraphicsType = $this.ConvertEnumValueToServerValue($this.GraphicsType)\n\n        $vmHostGraphicsConfig.DeviceType += $vmHostGraphicsConfigDeviceType\n\n        try {\n            Update-GraphicsConfig -VMHostGraphicsManager $vmHostGraphicsManager -VMHostGraphicsConfig $vmHostGraphicsConfig\n        }\n        catch {\n            throw \"The Graphics Configuration of VMHost $($this.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostIScsiHba.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostIScsiHba : VMHostIScsiHbaBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name for the VMHost Host Bus Adapter device.\n    #>\n    [DscProperty()]\n    [string] $IScsiName\n\n    hidden [string] $ConfigureIScsiHbaMessage = \"Configuring iSCSI Host Bus Adapter {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotConfigureIScsiHbaMessage = \"Could not configure iSCSI Host Bus Adapter {0} from VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $iScsiHba = $this.GetIScsiHba($this.Name)\n\n            $this.ConfigureIScsiHba($iScsiHba)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $iScsiHba = $this.GetIScsiHba($this.Name)\n\n            $shouldConfigureiScsiHba = @(\n                $this.ShouldModifyCHAPSettings($iScsiHba.AuthenticationProperties),\n                $this.ShouldUpdateDscResourceSetting('IScsiName', $iScsiHba.IScsiName, $this.IScsiName)\n            )\n            $result = !($shouldConfigureiScsiHba -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIScsiHba] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostIScsiHba]::new()\n\n            $this.RetrieveVMHost()\n\n            $iScsiHba = $this.GetIScsiHba($this.Name)\n\n            $this.PopulateResult($result, $iScsiHba)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Configures the CHAP properties and the iScsi name of the specified iSCSI Host Bus Adapter.\n    #>\n    [void] ConfigureIScsiHba($iScsiHba) {\n        $setVMHostHbaParams = @{\n            IScsiHba = $iScsiHba\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        $this.PopulateCmdletParametersWithCHAPSettings($setVMHostHbaParams)\n        if (![string]::IsNullOrEmpty($this.IScsiName)) { $setVMHostHbaParams.IScsiName = $this.IScsiName }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ConfigureIScsiHbaMessage, @($iScsiHba.Device, $this.VMHost.Name))\n\n            Set-VMHostHba @setVMHostHbaParams\n        }\n        catch {\n            throw ($this.CouldNotConfigureIScsiHbaMessage -f $iScsiHba.Device, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $iScsiHba) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Name = $iScsiHba.Device\n        $result.IScsiName = $iScsiHba.IScsiName\n        $result.ChapType = $iScsiHba.AuthenticationProperties.ChapType.ToString()\n        $result.ChapName = [string] $iScsiHba.AuthenticationProperties.ChapName\n        $result.MutualChapEnabled = $iScsiHba.AuthenticationProperties.MutualChapEnabled\n        $result.MutualChapName = [string] $iScsiHba.AuthenticationProperties.MutualChapName\n        $result.Force = $this.Force\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostIScsiHbaTarget.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostIScsiHbaTarget : VMHostIScsiHbaBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the address of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [string] $Address\n\n    <#\n    .DESCRIPTION\n\n    Specifies the TCP port of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [int] $Port\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the iSCSI Host Bus Adapter of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [string] $IScsiHbaName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [IScsiHbaTargetType] $TargetType\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the iSCSI Host Bus Adapter target should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the iSCSI name of the iSCSI Host Bus Adapter target. It is required for Static iSCSI Host Bus Adapter targets.\n    #>\n    [DscProperty()]\n    [string] $IScsiName\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the CHAP setting is inherited from the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritChap\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the Mutual CHAP setting is inherited from the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritMutualChap\n\n    <#\n    .DESCRIPTION\n\n    Specifies the <Address>:<Port> that uniquely identifies an iSCSI Host Bus Adapter target.\n    #>\n    hidden [string] $IPEndPoint\n\n    hidden [string] $CreateIScsiHbaTargetMessage = \"Creating iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}.\"\n    hidden [string] $ModifyIScsiHbaTargetMessage = \"Modifying CHAP settings of iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}.\"\n    hidden [string] $RemoveIScsiHbaTargetMessage = \"Removing iSCSI Host Bus Adapter target with IP address {0} from iSCSI Host Bus Adapter device {1}.\"\n\n    hidden [string] $CouldNotCreateIScsiHbaTargetMessage = \"Could not create iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyIScsiHbaTargetMessage = \"Could not modify CHAP settings of iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveIScsiHbaTargetMessage = \"Could not remove iSCSI Host Bus Adapter target with IP address {0} from iSCSI Host Bus Adapter device {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $this.IPEndPoint = $this.Address + ':' + $this.Port.ToString()\n\n            $iScsiHba = $this.GetIScsiHba($this.IScsiHbaName)\n            $iScsiHbaTarget = $this.GetIScsiHbaTarget($iScsiHba)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $iScsiHbaTarget) {\n                    $this.NewIScsiHbaTarget($iScsiHba)\n                }\n                else {\n                    $this.ModifyIScsiHbaTarget($iScsiHbaTarget)\n                }\n            }\n            else {\n                if ($null -ne $iScsiHbaTarget) {\n                    $this.RemoveIScsiHbaTarget($iScsiHbaTarget)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $this.IPEndPoint = $this.Address + ':' + $this.Port.ToString()\n\n            $iScsiHba = $this.GetIScsiHba($this.IScsiHbaName)\n            $iScsiHbaTarget = $this.GetIScsiHbaTarget($iScsiHba)\n\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $iScsiHbaTarget) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyCHAPSettings($iScsiHbaTarget.AuthenticationProperties, $this.InheritChap, $this.InheritMutualChap)\n                }\n            }\n            else {\n                $result = ($null -eq $iScsiHbaTarget)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIScsiHbaTarget] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostIScsiHbaTarget]::new()\n\n            $this.RetrieveVMHost()\n            $this.IPEndPoint = $this.Address + ':' + $this.Port.ToString()\n\n            $iScsiHba = $this.GetIScsiHba($this.IScsiHbaName)\n            $iScsiHbaTarget = $this.GetIScsiHbaTarget($iScsiHba)\n\n            $this.PopulateResult($result, $iScsiHbaTarget)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the iSCSI Host Bus Adapter target with the specified IPEndPoint for the specified iSCSI Host Bus Adapter if it exists.\n    #>\n    [PSObject] GetIScsiHbaTarget($iScsiHba) {\n        $getIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            IScsiHba = $iScsiHba\n            IPEndPoint = $this.IPEndPoint\n            Type = $this.TargetType.ToString()\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-IScsiHbaTarget @getIScsiHbaTargetParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new iSCSI Host Bus Adapter target of the specified type with the specified address for the specified iSCSI Host Bus Adapter.\n    #>\n    [void] NewIScsiHbaTarget($iScsiHba) {\n        $newIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            Address = $this.Address\n            Port = $this.Port\n            IScsiHba = $iScsiHba\n            Type = $this.TargetType.ToString()\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($this.TargetType -eq [IScsiHbaTargetType]::Static) { $newIScsiHbaTargetParams.IScsiName = $this.IScsiName }\n        $this.PopulateCmdletParametersWithCHAPSettings($newIScsiHbaTargetParams, $this.InheritChap, $this.InheritMutualChap)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateIScsiHbaTargetMessage, @($this.IPEndPoint, $this.IScsiHbaName))\n\n            New-IScsiHbaTarget @newIScsiHbaTargetParams\n        }\n        catch {\n            throw ($this.CouldNotCreateIScsiHbaTargetMessage -f $this.IPEndPoint, $this.IScsiHbaName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the CHAP settings of the specified iSCSI Host Bus Adapter target.\n    #>\n    [void] ModifyIScsiHbaTarget($iScsiHbaTarget) {\n        $setIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            Target = $iScsiHbaTarget\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        $this.PopulateCmdletParametersWithCHAPSettings($setIScsiHbaTargetParams, $this.InheritChap, $this.InheritMutualChap)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyIScsiHbaTargetMessage, @($this.IPEndPoint, $this.IScsiHbaName))\n\n            Set-IScsiHbaTarget @setIScsiHbaTargetParams\n        }\n        catch {\n            throw ($this.CouldNotModifyIScsiHbaTargetMessage -f $this.IPEndPoint, $this.IScsiHbaName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified iSCSI Host Bus Adapter target from its iSCSI Host Bus Adapter.\n    #>\n    [void] RemoveIScsiHbaTarget($iScsiHbaTarget) {\n        $removeIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            Target = $iScsiHbaTarget\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveIScsiHbaTargetMessage, @($this.IPEndPoint, $this.IScsiHbaName))\n\n            Remove-IScsiHbaTarget @removeIScsiHbaTargetParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveIScsiHbaTargetMessage -f $this.IPEndPoint, $this.IScsiHbaName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $iScsiHbaTarget) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.IScsiHbaName = $this.IScsiHbaName\n        $result.Force = $this.Force\n\n        if ($null -ne $iScsiHbaTarget) {\n            $result.Address = $iScsiHbaTarget.Address\n            $result.Port = $iScsiHbaTarget.Port\n            $result.TargetType = $iScsiHbaTarget.Type.ToString()\n            $result.IScsiName = $iScsiHbaTarget.IScsiName\n            $result.InheritChap = $iScsiHbaTarget.AuthenticationProperties.ChapInherited\n            $result.ChapType = $iScsiHbaTarget.AuthenticationProperties.ChapType.ToString()\n            $result.ChapName = [string] $iScsiHbaTarget.AuthenticationProperties.ChapName\n            $result.InheritMutualChap = $iScsiHbaTarget.AuthenticationProperties.MutualChapInherited\n            $result.MutualChapEnabled = $iScsiHbaTarget.AuthenticationProperties.MutualChapEnabled\n            $result.MutualChapName = [string] $iScsiHbaTarget.AuthenticationProperties.MutualChapName\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Address = $this.Address\n            $result.Port = $this.Port\n            $result.TargetType = $this.TargetType\n            $result.IScsiName = $this.IScsiName\n            $result.InheritChap = $this.InheritChap\n            $result.ChapType = $this.ChapType\n            $result.ChapName = $this.ChapName\n            $result.InheritMutualChap = $this.InheritMutualChap\n            $result.MutualChapEnabled = $this.MutualChapEnabled\n            $result.MutualChapName = $this.MutualChapName\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostIScsiHbaVMKernelNic.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostIScsiHbaVMKernelNic : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Key)]\n    [string] $IScsiHbaName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the VMKernel Network Adapters that should be bound/unbound\n    to/from the specified iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $VMKernelNicNames\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VMKernel Network Adapters should be bound/unbound\n    to/from the specified iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to bind VMKernel Network Adapters to iSCSI Host Bus Adapter\n    when VMKernel Network Adapters aren't compatible for iSCSI multipathing.\n    Specifies whether to unbind VMKernel Network Adapters from iSCSI Host Bus Adapter\n    when there're active sessions using the VMKernel Network Adapters.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $IScsiDeviceType = 'iSCSI'\n\n    hidden [string] $RetrieveIScsiHbaMessage = \"Retrieving iSCSI Host Bus Adapter {0} from VMHost {1}.\"\n    hidden [string] $RetrieveEsxCliInterfaceMessage = \"Retrieving EsxCli interface for VMHost {0}.\"\n    hidden [string] $RetrieveVMKernelNicsMessage = \"Retrieving VMKernel Network Adapters {0} from VMHost {1}.\"\n\n    hidden [string] $VMKernelNicAlreadyBoundMessage = \"VMKernel Network Adapter {0} is already bound to iSCSI Host Bus Adapter {1} and will be ignored.\"\n    hidden [string] $VMKernelNicAlreadyUnboundMessage = \"VMKernel Network Adapter {0} is already unbound from iSCSI Host Bus Adapter {1} and will be ignored.\"\n\n    hidden [string] $VMKernelNicBindMessage = \"Binding VMKernel Network Adapter {0} to iSCSI Host Bus Adapter {1}.\"\n    hidden [string] $VMKernelNicUnbindMessage = \"Unbinding VMKernel Network Adapter {0} from iSCSI Host Bus Adapter {1}.\"\n\n    hidden [string] $CouldNotRetrieveIScsiHbaMessage = \"Could not retrieve iSCSI Host Bus Adapter {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveEsxCliInterfaceMessage = \"Could not retrieve EsxCli interface for VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveVMKernelNicMessage = \"VMKernel Network Adapter {0} could not be retrieved from VMHost {1} and will be ignored.\"\n\n    hidden [string] $CouldNotBindVMKernelNicMessage = \"Could not bind VMKernel Network Adapter {0} to iSCSI Host Bus Adapter {1}. For more information: {2}\"\n    hidden [string] $CouldNotUnbindVMKernelNicMessage = \"Could not unbind VMKernel Network Adapter {0} from iSCSI Host Bus Adapter {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $esxCli = $this.GetEsxCli()\n            $iScsiHba = $this.GetIScsiHba()\n\n            $vmKernelNics = $this.GetVMKernelNetworkAdapters()\n            $filteredVMKernelNics = $this.GetFilteredVMKernelNetworkAdapters($esxCli, $iScsiHba, $vmKernelNics)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $this.BindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $filteredVMKernelNics)\n            }\n            else {\n                $this.UnbindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $filteredVMKernelNics)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $esxCli = $this.GetEsxCli()\n            $iScsiHba = $this.GetIScsiHba()\n            $vmKernelNics = $this.GetVMKernelNetworkAdapters()\n\n            $result = !$this.ShouldUpdateIScsiHbaBoundNics($esxCli, $iScsiHba, $vmKernelNics)\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIScsiHbaVMKernelNic] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $result = [VMHostIScsiHbaVMKernelNic]::new()\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $esxCli = $this.GetEsxCli()\n            $iScsiHba = $this.GetIScsiHba()\n\n            $this.PopulateResult($result, $esxCli, $iScsiHba)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the EsxCli version 2 interface to ESXCLI for the specified VMHost.\n    #>\n    [PSObject] GetEsxCli() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveEsxCliInterfaceMessage, @($this.VMHost.Name))\n\n            $getEsxCliParams = @{\n                Server = $this.Connection\n                VMHost = $this.VMHost\n                V2 = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            return Get-EsxCli @getEsxCliParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveEsxCliInterfaceMessage -f $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the iSCSI Host Bus Adapter with the specified name from the specified VMHost.\n    If the iSCSI Host Bus Adapter is not found, it throws an exception.\n    #>\n    [PSObject] GetIScsiHba() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveIScsiHbaMessage, @($this.IScsiHbaName, $this.VMHost.Name))\n\n            $getVMHostHbaParams = @{\n                Server = $this.Connection\n                VMHost = $this.VMHost\n                Device = $this.IScsiHbaName\n                Type = $this.IScsiDeviceType\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VMHostHba @getVMHostHbaParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveIScsiHbaMessage -f $this.IScsiHbaName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel Network Adapters with the specified names from the specified VMHost.\n    For every VMKernel Network Adapter that doesn't exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetVMKernelNetworkAdapters() {\n        $vmKernelNics = @()\n\n        $this.WriteLogUtil('Verbose', $this.RetrieveVMKernelNicsMessage, @(($this.VMKernelNicNames -Join ', '), $this.VMHost.Name))\n\n        $getVMHostNetworkAdapterParams = @{\n            Server = $this.Connection\n            VMHost = $this.VMHost\n            VMKernel = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n        $retrievedVMKernelNics = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n\n        foreach ($vmKernelNicName in $this.VMKernelNicNames) {\n            $vmKernelNic = $retrievedVMKernelNics | Where-Object -FilterScript { $_.Name -eq $vmKernelNicName }\n            if ($null -eq $vmKernelNic) {\n                $this.WriteLogUtil('Warning', $this.CouldNotRetrieveVMKernelNicMessage, @($vmKernelNicName, $this.VMHost.Name))\n            }\n            else {\n                $vmKernelNics += $vmKernelNic\n            }\n        }\n\n        return $vmKernelNics\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the filtered VMKernel Network Adapters based on the value of the Ensure property.\n    If Ensure is set to 'Present', it returns only those VMKernel Network Adapters that are currently not bound\n    to the iSCSI Host Bus Adapter. The other VMKernel Network Adapters in the array are ignored because they're already bound\n    to the iSCSI Host Bus Adapter. If Ensure is set to 'Absent', it returns only these VMKernel Network Adapters that are currently\n    bound to the iSCSI Host Bus Adapter. The other VMKernel Network Adapters in the array are ignored because they're not bound to the\n    iSCSI Host Bus Adapter. In both cases a warning message is shown to the user when a specific VMKernel Network Adapter is ignored.\n    #>\n    [array] GetFilteredVMKernelNetworkAdapters($esxCli, $iScsiHba, $vmKernelNics) {\n        $filteredVMKernelNics = @()\n\n        $boundVMKernelNics = Get-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device\n        foreach ($vmKernelNic in $vmKernelNics) {\n            $boundVMKernelNic = $boundVMKernelNics | Where-Object -FilterScript { $_.Vmknic -eq $vmKernelNic.Name }\n            if ($this.Ensure -eq [Ensure]::Present -and $null -ne $boundVMKernelNic) {\n                $this.WriteLogUtil('Warning', $this.VMKernelNicAlreadyBoundMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                continue\n            }\n            elseif ($this.Ensure -eq [Ensure]::Absent -and $null -eq $boundVMKernelNic) {\n                $this.WriteLogUtil('Warning', $this.VMKernelNicAlreadyUnboundMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                continue\n            }\n\n            $filteredVMKernelNics += $vmKernelNic\n        }\n\n        return $filteredVMKernelNics\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if VMKernel Network Adapters should be bound/unbound to/from the specified iSCSI Host Bus Adapter.\n    If Ensure is set to 'Present', checks if all passed VMKernel Network Adapters are bound to the specified iSCSI Host Bus Adapter.\n    If Ensure is set to 'Absent', checks if all passed VMKernel Network Adapters are unbound from the specified iSCSI Host Bus Adapter.\n    #>\n    [bool] ShouldUpdateIScsiHbaBoundNics($esxCli, $iScsiHba, $vmKernelNics) {\n        $result = $false\n\n        $boundVMKernelNics = Get-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device\n        foreach ($vmKernelNic in $vmKernelNics) {\n            $boundVMKernelNic = $boundVMKernelNics | Where-Object -FilterScript { $_.Vmknic -eq $vmKernelNic.Name }\n            if ($this.Ensure -eq [Ensure]::Present -and $null -eq $boundVMKernelNic) {\n                $result = $true\n                break\n            }\n            elseif ($this.Ensure -eq [Ensure]::Absent -and $null -ne $boundVMKernelNic) {\n                $result = $true\n                break\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Binds the specified VMKernel Network Adapters to the specified iSCSI Host Bus Adapter.\n    #>\n    [void] BindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $vmKernelNics) {\n        foreach ($vmKernelNic in $vmKernelNics) {\n            try {\n                $this.WriteLogUtil('Verbose', $this.VMKernelNicBindMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                Update-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device -VMKernelNicName $vmKernelNic.Name -Operation 'Add' -Force $this.Force\n            }\n            catch {\n                throw ($this.CouldNotBindVMKernelNicMessage -f $vmKernelNic.Name, $iScsiHba.Device, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Unbinds the specified VMKernel Network Adapters from the specified iSCSI Host Bus Adapter.\n    #>\n    [void] UnbindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $vmKernelNics) {\n        foreach ($vmKernelNic in $vmKernelNics) {\n            try {\n                $this.WriteLogUtil('Verbose', $this.VMKernelNicUnbindMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                Update-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device -VMKernelNicName $vmKernelNic.Name -Operation 'Remove' -Force $this.Force\n            }\n            catch {\n                throw ($this.CouldNotUnbindVMKernelNicMessage -f $vmKernelNic.Name, $iScsiHba.Device, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $esxCli, $iScsiHba) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.IScsiHbaName = $iScsiHba.Device\n        $result.Force = $this.Force\n\n        $boundVMKernelNics = Get-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device\n        if ($boundVMKernelNics.Length -gt 0) {\n            $result.Ensure = [Ensure]::Present\n            $result.VMKernelNicNames = $boundVMKernelNics.Vmknic\n        }\n        else {\n            $result.Ensure = [Ensure]::Absent\n            $result.VMKernelNicNames = $this.VMKernelNicNames\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNetwork/VMHostIPRoute/VMHostIPRoute.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostIPRoute : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the gateway IPv4/IPv6 address of the route.\n    #>\n    [DscProperty(Key)]\n    [string] $Gateway\n\n    <#\n    .DESCRIPTION\n\n    Specifies the destination IPv4/IPv6 address of the route.\n    #>\n    [DscProperty(Key)]\n    [string] $Destination\n\n    <#\n    .DESCRIPTION\n\n    Specifies the prefix length of the destination IP address. For IPv4, the valid values are from 0 to 32, and for IPv6 - from 0 to 128.\n    #>\n    [DscProperty(Key)]\n    [int] $PrefixLength\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the IPv4/IPv6 route should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    hidden [string] $CreateVMHostIPRouteMessage = \"Creating IP Route with Gateway address {0} and Destination address {1} on VMHost {2}.\"\n    hidden [string] $RemoveVMHostIPRouteMessage = \"Removing IP Route with Gateway address {0} and Destination address {1} on VMHost {2}.\"\n\n    hidden [string] $CouldNotCreateVMHostIPRouteMessage = \"Could not create IP Route with Gateway address {0} and Destination address {1} on VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotRemoveVMHostIPRouteMessage = \"Could not remove IP Route with Gateway address {0} and Destination address {1} on VMHost {2}. For more information: {3}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostIPRoute = $this.GetVMHostIPRoute($vmHost)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostIPRoute) {\n                    $this.NewVMHostIPRoute($vmHost)\n                }\n            }\n            else {\n                if ($null -ne $vmHostIPRoute) {\n                    $this.RemoveVMHostIPRoute($vmHostIPRoute)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostIPRoute = $this.GetVMHostIPRoute($vmHost)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vmHostIPRoute)\n            }\n            else {\n                $result = ($null -eq $vmHostIPRoute)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIPRoute] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostIPRoute]::new()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostIPRoute = $this.GetVMHostIPRoute($vmHost)\n\n            $this.PopulateResult($result, $vmHostIPRoute)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the configured IPv4/IPv6 route with the specified Gateway and Destination addresses if it exists.\n    #>\n    [PSObject] GetVMHostIPRoute($vmHost) {\n        return (Get-VMHostRoute -Server $this.Connection -VMHost $vmHost -ErrorAction SilentlyContinue -Verbose:$false |\n                Where-Object -FilterScript { $_.Gateway -eq $this.Gateway -and $_.Destination -eq $this.Destination -and $_.PrefixLength -eq $this.PrefixLength })\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new IP route with the specified Gateway and Destination addresses.\n    #>\n    [void] NewVMHostIPRoute($vmHost) {\n        $newVMHostRouteParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Gateway = $this.Gateway\n            Destination = $this.Destination\n            PrefixLength = $this.PrefixLength\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateVMHostIPRouteMessage, @($this.Gateway, $this.Destination, $vmHost.Name))\n\n            New-VMHostRoute @newVMHostRouteParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVMHostIPRouteMessage -f $this.Gateway, $this.Destination, $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the IP route with the specified Gateway and Destination addresses.\n    #>\n    [void] RemoveVMHostIPRoute($vmHostIPRoute) {\n        $removeVMHostRouteParams = @{\n            VMHostRoute = $vmHostIPRoute\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveVMHostIPRouteMessage, @($this.Gateway, $this.Destination, $this.Name))\n\n            Remove-VMHostRoute @removeVMHostRouteParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveVMHostIPRouteMessage -f $this.Gateway, $this.Destination, $this.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostIPRoute) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $this.Name\n\n        if ($null -ne $vmHostIPRoute) {\n            $result.Ensure = [Ensure]::Present\n            $result.Gateway = $vmHostIPRoute.Gateway\n            $result.Destination = $vmHostIPRoute.Destination\n            $result.PrefixLength = $vmHostIPRoute.PrefixLength\n        }\n        else {\n            $result.Ensure = [Ensure]::Absent\n            $result.Gateway = $this.Gateway\n            $result.Destination = $this.Destination\n            $result.PrefixLength = $this.PrefixLength\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNetwork/VMHostNetworkMigration/VMHostVDSwitchMigration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVDSwitchMigration : VMHostNetworkMigrationBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch to which the VMHost and its Network should be part of.\n    VMHost Network consists of the passed Physical Network Adapters, VMKernel Network Adapters and Port Groups.\n    #>\n    [DscProperty(Key)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Port Groups to which the specified VMKernel Network Adapters should be attached. Accepts either one Port Group\n    or the same number of Port Groups as the number of VMKernel Network Adapters specified. If one Port Group is specified, all Adapters are attached to that Port Group.\n    If the same number of Port Groups as the number of VMKernel Network Adapters are specified, the first Adapter is attached to the first Port Group,\n    the second Adapter to the second Port Group, and so on.\n    #>\n    [DscProperty()]\n    [string[]] $PortGroupNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the user wants to migrate only the Physical Network\n    Adapters when no VMKernel Network Adapters are specified. Migrating a\n    Physical Network Adapter that takes care of the Management traffic without a\n    VMKernel Network Adapter could result in an ESXi network connectivity loss.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MigratePhysicalNicsOnly\n\n    hidden [string] $RetrieveVDSwitchMessage = \"Retrieving VDSwitch {0} from vCenter {1}.\"\n    hidden [string] $RetrieveStandardPortGroupMessage = \"Retrieving Standard Port Group {0} located on VMHost {1}.\"\n    hidden [string] $CreateVDPortGroupMessage = \"Creating VDPortGroup {0} on VDSwitch {1}{2}\"\n    hidden [string] $AddVDSwitchToVMHostMessage = \"Adding VDSwitch {0} to VMHost {1}.\"\n    hidden [string] $AddPhysicalNicsToVDSwitchMessage = \"Migrating Physical Network Adapters {0} to VDSwitch {1}.\"\n    hidden [string] $AddPhysicalNicsAndVMKernelNicsToVDSwitchMessage = \"Migrating Physical Network Adapters {0} and VMKernel Network Adapters {1} to VDSwitch {2}.\"\n\n    hidden [string] $MigratePhysicalNicsOnlyNotSpecified = \"When migrating Physical Network Adapters without VMKernel Network Adapters, the MigratePhysicalNicsOnly parameter should be specified in order for the migration to occur.\"\n\n    hidden [string] $CouldNotRetrieveVDSwitchMessage = \"Could not retrieve VDSwitch {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveStandardPortGroupMessage = \"Could not retrieve Standard Port Group {0} located on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreateVDPortGroupMessage = \"Could not create VDPortGroup {0} on VDSwitch {1}. For more information: {2}\"\n    hidden [string] $CouldNotAddVDSwitchToVMHostMessage = \"Could not add VDSwitch {0} to VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotAddPhysicalNicsToVDSwitchMessage = \"Could not migrate Physical Network Adapters {0} to VDSwitch {1}. For more information: {2}\"\n    hidden [string] $CouldNotAddPhysicalNicsAndVMKernelNicsToVDSwitchMessage = \"Could not migrate Physical Network Adapters {0} and VMKernel Network Adapters {1} to VDSwitch {2}. For more information: {3}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $distributedSwitch = $this.GetDistributedSwitch()\n\n            if (!$this.IsVMHostAddedToDistributedSwitch($distributedSwitch)) {\n                $this.AddVMHostToDistributedSwitch($distributedSwitch)\n            }\n\n            $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n            if ($this.VMkernelNicNames.Length -eq 0) {\n                $this.AddPhysicalNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $distributedSwitch)\n            }\n            else {\n                $vmKernelNetworkAdapters = $this.GetVMKernelNetworkAdapters()\n                $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n                $this.AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $distributedSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $distributedSwitch = $this.GetDistributedSwitch()\n\n            $result = $null\n\n            if (!$this.IsVMHostAddedToDistributedSwitch($distributedSwitch)) {\n                $result = $false\n            }\n\n            # The $null checks ensure that the desired state has not been determined yet from the previous statements.\n            if ($null -eq $result -and $this.ShouldAddPhysicalNetworkAdaptersToDistributedSwitch($distributedSwitch)) {\n                $result = $false\n            }\n\n            if ($null -eq $result -and $this.VMkernelNicNames.Length -eq 0 -and $this.PortGroupNames.Length -eq 0) {\n                $result = $true\n            }\n            elseif ($null -eq $result) {\n                $result = !$this.ShouldAddVMKernelNetworkAdaptersAndPortGroupsToDistributedSwitch($distributedSwitch)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVDSwitchMigration] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVDSwitchMigration]::new()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $distributedSwitch = $this.GetDistributedSwitch()\n\n            $this.PopulateResult($distributedSwitch, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch with the specified name from the server if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetDistributedSwitch() {\n        <#\n        The Verbose logic here is needed to suppress the Exporting and Importing of the\n        cmdlets from the VMware.VimAutomation.Vds Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVDSwitchMessage, @($this.VdsName, $this.Connection.Name))\n\n            $getVDSwitchParams = @{\n                Server = $this.Connection\n                Name = $this.VdsName\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VDSwitch @getVDSwitchParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVDSwitchMessage -f $this.VdsName, $_.Exception.Message)\n        }\n        finally {\n            $global:VerbosePreference = $savedVerbosePreference\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Standard Port Group with the specified name if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetStandardPortGroup($standardPortGroupName) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveStandardPortGroupMessage, @($standardPortGroupName, $this.VMHost.Name))\n            $getVirtualPortGroupParams = @{\n                Server = $this.Connection\n                Name = $standardPortGroupName\n                VMHost = $this.VMHost\n                Standard = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VirtualPortGroup @getVirtualPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveStandardPortGroupMessage -f $standardPortGroupName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a hashtable containing the parameters for the Add-VDSwitchPhysicalNetworkAdapter cmdlet.\n    #>\n    [hashtable] GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNics) {\n        return @{\n            Server = $this.Connection\n            DistributedSwitch = $distributedSwitch\n            VMHostPhysicalNic = $physicalNics\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a hashtable containing the parameters for the Add-VDSwitchPhysicalNetworkAdapter cmdlet.\n    #>\n    [hashtable] GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNics, $vmKernelNics, $portGroups) {\n        $addVDSwitchPhysicalNetworkAdapterParams = $this.GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNics)\n\n        $addVDSwitchPhysicalNetworkAdapterParams.VMHostVirtualNic = $vmKernelNics\n        $addVDSwitchPhysicalNetworkAdapterParams.VirtualNicPortgroup = $portGroups\n\n        return $addVDSwitchPhysicalNetworkAdapterParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost is part of the Distributed Switch.\n    #>\n    [bool] IsVMHostAddedToDistributedSwitch($distributedSwitch) {\n        $addedVMHost = $this.VMHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n        return ($null -ne $addedVMHost)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed Physical Network Adapters are added to the Distributed Switch.\n    #>\n    [bool] ShouldAddPhysicalNetworkAdaptersToDistributedSwitch($distributedSwitch) {\n        $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n        if ($physicalNetworkAdapters.Length -eq 0) {\n            throw 'At least one Physical Network Adapter needs to be specified.'\n        }\n\n        if ($null -eq $distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec) {\n            # No Physical Network Adapters are added to the Distributed Switch.\n            return $true\n        }\n\n        foreach ($physicalNetworkAdapter in $physicalNetworkAdapters) {\n            $addedPhysicalNetworkAdapter = $distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec | Where-Object -FilterScript { $_.PNicDevice -eq $physicalNetworkAdapter.Name }\n            if ($null -eq $addedPhysicalNetworkAdapter) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed VMKernel Network Adapters and Port Groups are added to the Distributed Switch.\n    #>\n    [bool] ShouldAddVMKernelNetworkAdaptersAndPortGroupsToDistributedSwitch($distributedSwitch) {\n        $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n        if ($this.PortGroupNames.Length -eq 1) {\n            $portGroupName = $this.PortGroupNames[0]\n\n            foreach ($vmKernelNetworkAdapterName in $this.VMKernelNicNames) {\n                $getVMHostNetworkAdapterParams = @{\n                    Server = $this.Connection\n                    Name = $vmKernelNetworkAdapterName\n                    VMHost = $this.VMHost\n                    VirtualSwitch = $distributedSwitch\n                    PortGroup = $portGroupName\n                    VMKernel = $true\n                    ErrorAction = 'SilentlyContinue'\n                    Verbose = $false\n                }\n\n                $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n                if ($null -eq $vmKernelNetworkAdapter) {\n                    return $true\n                }\n            }\n        }\n        else {\n            for ($i = 0; $i -lt $this.VMKernelNicNames.Length; $i++) {\n                $vmKernelNetworkAdapterName = $this.VMKernelNicNames[$i]\n                $portGroupName = $this.PortGroupNames[$i]\n\n                $getVMHostNetworkAdapterParams = @{\n                    Server = $this.Connection\n                    Name = $vmKernelNetworkAdapterName\n                    VMHost = $this.VMHost\n                    VirtualSwitch = $distributedSwitch\n                    PortGroup = $portGroupName\n                    VMKernel = $true\n                    ErrorAction = 'SilentlyContinue'\n                    Verbose = $false\n                }\n\n                $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n                if ($null -eq $vmKernelNetworkAdapter) {\n                    return $true\n                }\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified Distributed Port Groups exist. If a Distributed Port Group is specified and does not exist,\n    it is created on the specified Distributed Switch.\n    #>\n    [array] EnsureDistributedPortGroupsExist($distributedSwitch, $vmKernelNetworkAdapters) {\n        $portGroups = @()\n        foreach ($distributedPortGroupName in $this.PortGroupNames) {\n            $getVDPortGroupParams = @{\n                Server = $this.Connection\n                Name = $distributedPortGroupName\n                VDSwitch = $distributedSwitch\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n            $distributedPortGroup = Get-VDPortgroup @getVDPortGroupParams\n            if ($null -eq $distributedPortGroup) {\n                $distributedPortGroup = $this.CreateDistributedPortGroup($distributedPortGroupName, $distributedSwitch, $vmKernelNetworkAdapters)\n            }\n\n            $portGroups += $distributedPortGroup\n        }\n\n        return $portGroups\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the passed VMKernel Network Adapter names and Port Group names count meets the following criteria:\n    If at least one VMKernel Network Adapter is specified, one of the following requirements should be met:\n    1. The number of specified Port Groups should be equal to the number of specified VMKernel Network Adapters.\n    2. Only one Port Group is passed.\n    If no VMKernel Network Adapter names are passed, no Port Group names should be passed as well.\n    #>\n    [void] EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect() {\n        if ($this.VMkernelNicNames.Length -gt 0) {\n            if ($this.PortGroupNames.Length -eq 0 -or ($this.VMkernelNicNames.Length -ne $this.PortGroupNames.Length -and $this.PortGroupNames.Length -ne 1)) {\n                throw \"$($this.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($this.PortGroupNames.Length) Port Groups specified which is not valid.\"\n            }\n        }\n        else {\n            if ($this.PortGroupNames.Length -ne 0) {\n                throw \"$($this.PortGroupNames.Length) Port Groups specified and no VMKernel Network Adapters specified which is not valid.\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Distributed Port Group with the specified name on the specified Distributed Switch.\n    If a Standard Port Group with the same name exists on the Standard Switch from which the VMKernel Network Adapters are migrated\n    and the Standard Port Group is associated with a VLAN, the new Distributed Port Group is created with the same VLAN to avoid\n    any network misconfigurations due to VLANs not configured correctly.\n    #>\n    [PSObject] CreateDistributedPortGroup($distributedPortGroupName, $distributedSwitch, $vmKernelNetworkAdapters) {\n        try {\n            $createVDPortGroupMessageEnd = \".\"\n            $newVDPortGroupParams = @{\n                Server = $this.Connection\n                Name = $distributedPortGroupName\n                VDSwitch = $distributedSwitch\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            $vmKernelNetworkAdapterOfStandardPortGroup = $vmKernelNetworkAdapters | Where-Object -FilterScript { $_.PortGroupName -eq $distributedPortGroupName }\n            if ($null -ne $vmKernelNetworkAdapterOfStandardPortGroup) {\n                $standardPortGroup = $this.GetStandardPortGroup($distributedPortGroupName)\n\n                # The VLAN for Distributed Port Groups is valid only in the specified range.\n                if ($standardPortGroup.VLanId -In 1..4094) {\n                    $newVDPortGroupParams.VlanId = $standardPortGroup.VLanId\n                    $createVDPortGroupMessageEnd = \" with VLAN ID $($standardPortGroup.VLanId).\"\n                }\n            }\n\n            $this.WriteLogUtil('Verbose', $this.CreateVDPortGroupMessage, @($distributedPortGroupName, $distributedSwitch.Name, $createVDPortGroupMessageEnd))\n            return New-VDPortgroup @newVDPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVDPortGroupMessage -f $distributedPortGroupName, $distributedSwitch.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the VMHost to the specified Distributed Switch.\n    #>\n    [void] AddVMHostToDistributedSwitch($distributedSwitch) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddVDSwitchToVMHostMessage, @($distributedSwitch.Name, $this.VMHost.Name))\n\n            $addVDSwitchVMHostParams = @{\n                Server = $this.Connection\n                VDSwitch = $distributedSwitch\n                VMHost = $this.VMHost\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Add-VDSwitchVMHost @addVDSwitchVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotAddVDSwitchToVMHostMessage -f $distributedSwitch.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters to the specified Distributed Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $distributedSwitch) {\n        if ($null -eq $this.MigratePhysicalNicsOnly -or !$this.MigratePhysicalNicsOnly) {\n            $this.WriteLogUtil('Warning', $this.MigratePhysicalNicsOnlyNotSpecified)\n\n            return\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddPhysicalNicsToVDSwitchMessage, @(\n                ($physicalNetworkAdapters.Name -Join ', '),\n                $distributedSwitch.Name\n            ))\n\n            $addVDSwitchPhysicalNetworkAdapterParams = $this.GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNetworkAdapters)\n\n            Add-VDSwitchPhysicalNetworkAdapter @addVDSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw (\n                $this.CouldNotAddPhysicalNicsToVDSwitchMessage -f @(\n                    ($physicalNetworkAdapters.Name -Join ', '),\n                    $distributedSwitch.Name,\n                    $_.Exception.Message\n                )\n            )\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters and VMKernel Network Adapters to the specified Distributed Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $distributedSwitch) {\n        $portGroups = $this.EnsureDistributedPortGroupsExist($distributedSwitch, $vmKernelNetworkAdapters)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddPhysicalNicsAndVMKernelNicsToVDSwitchMessage, @(\n                ($physicalNetworkAdapters.Name -Join ', '),\n                ($vmKernelNetworkAdapters.Name -Join ', '),\n                $distributedSwitch.Name\n            ))\n\n            $addVDSwitchPhysicalNetworkAdapterParams = $this.GetAddVDSwitchPhysicalNetworkAdapterParams(\n                $distributedSwitch,\n                $physicalNetworkAdapters,\n                $vmKernelNetworkAdapters,\n                $portGroups\n            )\n\n            Add-VDSwitchPhysicalNetworkAdapter @addVDSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw (\n                $this.CouldNotAddPhysicalNicsAndVMKernelNicsToVDSwitchMessage -f @(\n                    ($physicalNetworkAdapters.Name -Join ', '),\n                    ($vmKernelNetworkAdapters.Name -Join ', '),\n                    $distributedSwitch.Name,\n                    $_.Exception.Message\n                )\n            )\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($distributedSwitch, $result) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.VdsName = $distributedSwitch.Name\n\n        if ($null -eq $distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec) {\n            $result.PhysicalNicNames = @()\n        }\n        else {\n            $result.PhysicalNicNames = [string[]]($distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec | Select-Object -ExpandProperty PNicDevice)\n        }\n\n        $result.VMkernelNicNames = @()\n        $result.PortGroupNames = @()\n\n        if ($this.VMKernelNicNames.Length -eq 0) {\n            return\n        }\n\n        $getVMHostNetworkAdapterParams = @{\n            Server = $this.Connection\n            VMHost = $this.VMHost\n            VirtualSwitch = $distributedSwitch\n            VMKernel = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n        $vmKernelNetworkAdapters = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams | Where-Object -FilterScript { $this.VMKernelNicNames.Contains($_.Name) }\n\n        foreach ($vmKernelNetworkAdapter in $vmKernelNetworkAdapters) {\n            $result.VMkernelNicNames += $vmKernelNetworkAdapter.Name\n            $result.PortGroupNames += $vmKernelNetworkAdapter.PortGroupName\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNetwork/VMHostNetworkMigration/VMHostVssMigration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssMigration : VMHostNetworkMigrationBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Standard Switch to which the passed Physical Network Adapters, VMKernel Network Adapters and Port Groups should be part of.\n    #>\n    [DscProperty(Key)]\n    [string] $VssName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Port Groups to which the specified VMKernel Network Adapters should be attached. Accepts the same number of\n    Port Groups as the number of VMKernel Network Adapters specified. The first Adapter is attached to the first Port Group,\n    the second Adapter to the second Port Group, and so on.\n    #>\n    [DscProperty()]\n    [string[]] $PortGroupNames\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $standardSwitch = $this.GetStandardSwitch()\n\n            $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n            if ($this.VMkernelNicNames.Length -eq 0) {\n                $this.AddPhysicalNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $standardSwitch)\n            }\n            else {\n                $vmKernelNetworkAdapters = $this.GetVMKernelNetworkAdapters()\n                $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n                $this.AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $standardSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $standardSwitch = $this.GetStandardSwitch()\n\n            if ($this.ShouldAddPhysicalNetworkAdaptersToStandardSwitch($standardSwitch)) {\n                return $false\n            }\n\n            if ($this.VMkernelNicNames.Length -eq 0 -and $this.PortGroupNames.Length -eq 0) {\n                return $true\n            }\n            else {\n                return !$this.ShouldAddVMKernelNetworkAdaptersAndPortGroupsToStandardSwitch($standardSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssMigration] Get() {\n        try {\n            $result = [VMHostVssMigration]::new()\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $standardSwitch = $this.GetStandardSwitch()\n\n            $this.PopulateResult($standardSwitch, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Standard Switch with the specified name from the specified VMHost if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetStandardSwitch() {\n        try {\n            $standardSwitch = Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction Stop\n            return $standardSwitch\n        }\n        catch {\n            throw \"Could not retrieve Standard Switch $($this.VssName). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed Physical Network Adapters are added to the Standard Switch.\n    #>\n    [bool] ShouldAddPhysicalNetworkAdaptersToStandardSwitch($standardSwitch) {\n        $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n        if ($physicalNetworkAdapters.Length -eq 0) {\n            throw 'At least one Physical Network Adapter needs to be specified.'\n        }\n\n        if ($null -eq $standardSwitch.Nic) {\n            # No Physical Network Adapters are added to the Standard Switch.\n            return $true\n        }\n\n        foreach ($physicalNetworkAdapter in $physicalNetworkAdapters) {\n            $addedPhysicalNetworkAdapter = $standardSwitch.Nic | Where-Object -FilterScript { $_ -eq $physicalNetworkAdapter.Name }\n            if ($null -eq $addedPhysicalNetworkAdapter) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed VMKernel Network Adapters and Port Groups are added to the Standard Switch.\n    #>\n    [bool] ShouldAddVMKernelNetworkAdaptersAndPortGroupsToStandardSwitch($standardSwitch) {\n        $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n        for ($i = 0; $i -lt $this.VMKernelNicNames.Length; $i++) {\n            $vmKernelNetworkAdapterName = $this.VMKernelNicNames[$i]\n\n            $getVMHostNetworkAdapterParams = @{\n                Server = $this.Connection\n                Name = $vmKernelNetworkAdapterName\n                VMHost = $this.VMHost\n                VirtualSwitch = $standardSwitch\n                VMKernel = $true\n                ErrorAction = 'SilentlyContinue'\n            }\n\n            if ($this.PortGroupNames.Length -gt 0) {\n                $getVMHostNetworkAdapterParams.PortGroup = $this.PortGroupNames[$i]\n            }\n\n            $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n            if ($null -eq $vmKernelNetworkAdapter) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the passed VMKernel Network Adapter names and Port Group names count meets the following criteria:\n    If VMKernel Network Adapter names are passed, the following requirements should be met:\n    No Port Group names are passed or the number of Port Group names is the same as the number of VMKernel Network Adapter names.\n    If no VMKernel Network Adapter names are passed, no Port Group names should be passed as well.\n    #>\n    [void] EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect() {\n        if ($this.VMKernelNicNames.Length -gt 0) {\n            if ($this.PortGroupNames.Length -gt 0 -and $this.VMkernelNicNames.Length -ne $this.PortGroupNames.Length) {\n                throw \"$($this.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($this.PortGroupNames.Length) Port Groups specified which is not valid.\"\n            }\n        }\n        else {\n            if ($this.PortGroupNames.Length -gt 0) {\n                throw \"$($this.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($this.PortGroupNames.Length) Port Groups specified which is not valid.\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified Standard Port Groups exist. If a Standard Port Group is specified and does not exist,\n    it is created on the specified Standard Switch.\n    #>\n    [void] EnsureStandardPortGroupsExist($standardSwitch) {\n        foreach ($standardPortGroupName in $this.PortGroupNames) {\n            $standardPortGroup = Get-VirtualPortGroup -Server $this.Connection -Name $standardPortGroupName -VirtualSwitch $standardSwitch -Standard -ErrorAction SilentlyContinue\n            if ($null -eq $standardPortGroup) {\n                try {\n                    New-VirtualPortGroup -Server $this.Connection -Name $standardPortGroupName -VirtualSwitch $standardSwitch -Confirm:$false -ErrorAction Stop\n                }\n                catch {\n                    throw \"Cannot create Standard Port Group $standardPortGroupName on Standard Switch $($standardSwitch.Name). For more information: $($_.Exception.Message)\"\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters to the specified Standard Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $standardSwitch) {\n        try {\n            $addVirtualSwitchPhysicalNetworkAdapterParams = @{\n                Server = $this.Connection\n                VirtualSwitch = $standardSwitch\n                VMHostPhysicalNic = $physicalNetworkAdapters\n                Confirm = $false\n                ErrorAction = 'Stop'\n            }\n\n            Add-VirtualSwitchPhysicalNetworkAdapter @addVirtualSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw \"Could not migrate Physical Network Adapters $($physicalNetworkAdapters) to Standard Switch $($standardSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters and VMKernel Network Adapters to the specified Standard Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $standardSwitch) {\n        $this.EnsureStandardPortGroupsExist($standardSwitch)\n\n        try {\n            $addVirtualSwitchPhysicalNetworkAdapterParams = @{\n                Server = $this.Connection\n                VirtualSwitch = $standardSwitch\n                VMHostPhysicalNic = $physicalNetworkAdapters\n                VMHostVirtualNic = $vmKernelNetworkAdapters\n                Confirm = $false\n                ErrorAction = 'Stop'\n            }\n\n            if ($this.PortGroupNames.Length -gt 0) {\n                $addVirtualSwitchPhysicalNetworkAdapterParams.VirtualNicPortgroup = $this.PortGroupNames\n            }\n\n            Add-VirtualSwitchPhysicalNetworkAdapter @addVirtualSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw \"Could not migrate Physical Network Adapters $($physicalNetworkAdapters) and VMKernel Network Adapters $($vmKernelNetworkAdapters) to Standard Switch $($standardSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($standardSwitch, $result) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.VssName = $standardSwitch.Name\n        $result.PhysicalNicNames = $standardSwitch.Nic\n        $result.VMkernelNicNames = @()\n        $result.PortGroupNames = @()\n\n        if ($this.VMKernelNicNames.Length -eq 0) {\n            return\n        }\n\n        $vmKernelNetworkAdapters = Get-VMHostNetworkAdapter -Server $this.Connection -VMHost $this.VMHost -VirtualSwitch $standardSwitch -VMKernel -ErrorAction SilentlyContinue |\n                                   Where-Object -FilterScript { $this.VMKernelNicNames.Contains($_.Name) }\n\n        foreach ($vmKernelNetworkAdapter in $vmKernelNetworkAdapters) {\n            $result.VMkernelNicNames += $vmKernelNetworkAdapter.Name\n            $result.PortGroupNames += $vmKernelNetworkAdapter.PortGroupName\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNetwork/VMHostNic/VMHostPhysicalNic.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostPhysicalNic : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Name of the Physical Network Adapter which is going to be configured.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the link is capable of full-duplex. The valid values are Full, Half and Unset.\n    #>\n    [DscProperty()]\n    [Duplex] $Duplex = [Duplex]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the bit rate of the link.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BitRatePerSecMb\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the host network adapter speed/duplex settings are configured automatically.\n    If the property is passed, the Duplex and BitRatePerSecMb properties will be ignored.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AutoNegotiate\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n            $physicalNetworkAdapter = $this.GetPhysicalNetworkAdapter()\n\n            $this.UpdatePhysicalNetworkAdapter($physicalNetworkAdapter)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n            $physicalNetworkAdapter = $this.GetPhysicalNetworkAdapter()\n\n            return !$this.ShouldUpdatePhysicalNetworkAdapter($physicalNetworkAdapter)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostPhysicalNic] Get() {\n        try {\n            $result = [VMHostPhysicalNic]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n            $physicalNetworkAdapter = $this.GetPhysicalNetworkAdapter()\n\n            $result.VMHostName = $this.VMHost.Name\n            $result.Name = $physicalNetworkAdapter.Name\n\n            $this.PopulateResult($physicalNetworkAdapter, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Physical Network Adapter with the specified name from the server if it exists.\n    The Network Adapter must be a Physical Network Adapter. If the Physical Network Adapter does not exist, it throws an exception.\n    #>\n    [PSObject] GetPhysicalNetworkAdapter() {\n        try {\n            $physicalNetworkAdapter = Get-VMHostNetworkAdapter -Server $this.Connection -Name $this.Name -VMHost $this.VMHost -Physical -ErrorAction Stop\n            return $physicalNetworkAdapter\n        }\n        catch {\n            throw \"Could not retrieve Physical Network Adapter $($this.Name) of VMHost $($this.VMHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Physical Network Adapter should be updated.\n    #>\n    [bool] ShouldUpdatePhysicalNetworkAdapter($physicalNetworkAdapter) {\n        $shouldUpdatePhysicalNetworkAdapter = @(\n            $this.ShouldUpdateDscResourceSetting('BitRatePerSecMb', $physicalNetworkAdapter.BitRatePerSec, $this.BitRatePerSecMb)\n        )\n\n        <#\n        The Duplex value on the server is stored as boolean indicating if the link is capable of full-duplex.\n        So mapping between the enum and boolean values needs to be performed for comparison purposes.\n        #>\n        if ($this.Duplex -ne [Duplex]::Unset) {\n            if ($physicalNetworkAdapter.FullDuplex) {\n                $shouldUpdatePhysicalNetworkAdapter += ($this.Duplex -ne [Duplex]::Full)\n            }\n            else {\n                $shouldUpdatePhysicalNetworkAdapter += ($this.Duplex -ne [Duplex]::Half)\n            }\n        }\n\n        <#\n        If the network adapter speed/duplex settings are configured automatically, the Link Speed\n        property is $null on the server.\n        #>\n        if ($null -ne $this.AutoNegotiate) {\n            if ($this.AutoNegotiate) {\n                $shouldUpdatePhysicalNetworkAdapter += ($null -ne $physicalNetworkAdapter.ExtensionData.Spec.LinkSpeed)\n            }\n            else {\n                $shouldUpdatePhysicalNetworkAdapter += ($null -eq $physicalNetworkAdapter.ExtensionData.Spec.LinkSpeed)\n            }\n        }\n\n        return ($shouldUpdatePhysicalNetworkAdapter -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update operation on the specified Physical Network Adapter.\n    #>\n    [void] UpdatePhysicalNetworkAdapter($physicalNetworkAdapter) {\n        $physicalNetworkAdapterParams = @{}\n\n        $physicalNetworkAdapterParams.PhysicalNic = $physicalNetworkAdapter\n        $physicalNetworkAdapterParams.Confirm = $false\n        $physicalNetworkAdapterParams.ErrorAction = 'Stop'\n\n        if ($null -ne $this.AutoNegotiate -and $this.AutoNegotiate) {\n            $physicalNetworkAdapterParams.AutoNegotiate = $this.AutoNegotiate\n        }\n        else {\n            if ($this.Duplex -ne [Duplex]::Unset) { $physicalNetworkAdapterParams.Duplex = $this.Duplex.ToString() }\n            if ($null -ne $this.BitRatePerSecMb) { $physicalNetworkAdapterParams.BitRatePerSecMb = $this.BitRatePerSecMb }\n        }\n\n        try {\n            Set-VMHostNetworkAdapter @physicalNetworkAdapterParams\n        }\n        catch {\n            throw \"Cannot update Physical Network Adapter $($physicalNetworkAdapter.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Physical Network Adapter from the server.\n    #>\n    [void] PopulateResult($physicalNetworkAdapter, $result) {\n        <#\n        AutoNegotiate property is not present on the server, so it should be populated\n        with the value provided by user.\n        #>\n        $result.AutoNegotiate = $this.AutoNegotiate\n        $result.BitRatePerSecMb = $physicalNetworkAdapter.BitRatePerSec\n\n        if ($physicalNetworkAdapter.FullDuplex) {\n            $result.Duplex = [Duplex]::Full\n        }\n        else {\n            $result.Duplex = [Duplex]::Half\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNetwork/VMHostNic/VMHostVdsNic.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVdsNic : VMHostNicBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VMKernel NIC connected\n    to the specified Distributed Port Group on the specified VDSwitch.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VDSwitch to which the\n    VMKernel NIC is added.\n    #>\n    [DscProperty(Key)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the instance of the 'InventoryUtil' class that is used\n    for Inventory operations.\n    #>\n    hidden [InventoryUtil] $InventoryUtil\n\n    hidden [string] $VMHostIsNotAddedToVDSwitchMessage = \"VMHost {0} should be added to VDSwitch {1} before configuring the VMKernel NIC.\"\n    hidden [string] $CouldNotFindVMKernelNICMessage = \"VMKernel NIC {0} connected to Distributed Port Group {1} on VDSwitch {2} could not be found.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.InitInventoryUtil()\n\n            $this.RetrieveVMHost()\n            $vdSwitch = $this.InventoryUtil.GetVDSwitch($this.VdsName)\n            $this.EnsureVMHostIsAddedToTheVDSwitch($vdSwitch)\n\n            $vmKernelNic = $this.GetVMKernelNic($vdSwitch)\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $this.UpdateVMHostNetworkAdapter($vmKernelNic)\n            }\n            else {\n                if ($null -ne $vmKernelNic) {\n                    $this.RemoveVMHostNetworkAdapter($vmKernelNic)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.InitInventoryUtil()\n\n            $this.RetrieveVMHost()\n            $vdSwitch = $this.InventoryUtil.GetVDSwitch($this.VdsName)\n            $this.EnsureVMHostIsAddedToTheVDSwitch($vdSwitch)\n\n            $vmKernelNic = $this.GetVMKernelNic($vdSwitch)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = !$this.ShouldUpdateVMHostNetworkAdapter($vmKernelNic)\n            }\n            else {\n                $result = ($null -eq $vmKernelNic)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVdsNic] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVdsNic]::new()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.InitInventoryUtil()\n\n            $this.RetrieveVMHost()\n            $vdSwitch = $this.InventoryUtil.GetVDSwitch($this.VdsName)\n            $this.EnsureVMHostIsAddedToTheVDSwitch($vdSwitch)\n\n            $vmKernelNic = $this.GetVMKernelNic($vdSwitch)\n            if ($null -eq $vmKernelNic) {\n                $result.VdsName = $this.VdsName\n                $result.Name = $this.Name\n            }\n            else {\n                $result.VdsName = $vdSwitch.Name\n                $result.Name = $vmKernelNic.Name\n            }\n\n            $this.PopulateResult($vmKernelNic, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Initializes an instance of the 'InventoryUtil' class.\n    #>\n    [void] InitInventoryUtil() {\n        if ($null -eq $this.InventoryUtil) {\n            $this.InventoryUtil = [InventoryUtil]::new($this.Connection, $this.Ensure)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel NIC connected to the specified Distributed Port Group and added\n    to the specified VDSwitch from the server if it exists,\n    otherwise the method returns $null.\n    #>\n    [PSObject] GetVMKernelNic($vdSwitch) {\n        if ($null -eq $vdSwitch) {\n            <#\n                If the VDSwitch is $null, it means that Ensure was set to 'Absent' and\n                the VMKernel NIC is not added to the specified VDSwitch.\n            #>\n            return $null\n        }\n\n        $getVMHostNetworkAdapterParams = @{\n            Server = $this.Connection\n            VMHost = $this.VMHost\n            Name = $this.Name\n            VirtualSwitch = $vdSwitch\n            PortGroup = $this.PortGroupName\n            VMKernel = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $vmKernelNic = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n        if ($this.Ensure -eq [Ensure]::Present -and $null -eq $vmKernelNic) {\n            throw ($this.CouldNotFindVMKernelNICMessage -f $this.Name, $this.PortGroupName, $vdSwitch.Name)\n        }\n\n        return $vmKernelNic\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost is part of the specified VDSwitch\n    and if not, throws an exception.\n    #>\n    [void] EnsureVMHostIsAddedToTheVDSwitch($vdSwitch) {\n        if ($null -eq $vdSwitch) {\n            <#\n                If the VDSwitch is $null, it means that Ensure was set to 'Absent' and\n                the VMKernel NIC does not exist for the specified VDSwitch.\n                So there is no need to ensure that the VMHost is part of the VDSwitch.\n            #>\n            return\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.DvsName -eq $vdSwitch.Name\n            }\n        }\n\n        $addedVMHost = $this.VMHost.ExtensionData.Config.Network.ProxySwitch | Where-Object @whereObjectParams\n        if ($null -eq $addedVMHost) {\n            throw ($this.VMHostIsNotAddedToVDSwitchMessage -f $this.VMHost.Name, $vdSwitch.Name)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNetwork/VMHostNic/VMHostVssNic.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostVssNic : VMHostNicBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Virtual Switch to which the VMKernel Network Adapter should be connected.\n    #>\n    [DscProperty(Key)]\n    [string] $VssName\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $vmHostNetworkAdapter = $this.GetVMHostNetworkAdapter($virtualSwitch)\n\n            if ($null -ne $vmHostNetworkAdapter) {\n                <#\n                Here the retrieval of the VMKernel is done for the second time because retrieving it\n                by Virtual Switch and Port Group produces errors when trying to update or delete it.\n                The errors do not occur when the retrieval is done by Name.\n                #>\n                $vmHostNetworkAdapter = Get-VMHostNetworkAdapter -Server $this.Connection -Name $vmHostNetworkAdapter.Name -VMHost $this.VMHost -VMKernel\n            }\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostNetworkAdapter) {\n                    $vmHostNetworkAdapter = $this.AddVMHostNetworkAdapter($virtualSwitch, $null)\n                }\n\n                if ($this.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)) {\n                    $this.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n                }\n            }\n            else {\n                if ($null -ne $vmHostNetworkAdapter) {\n                    $this.RemoveVMHostNetworkAdapter($vmHostNetworkAdapter)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $vmHostNetworkAdapter = $this.GetVMHostNetworkAdapter($virtualSwitch)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostNetworkAdapter) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostNetworkAdapter)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssNic] Get() {\n        try {\n            $result = [VMHostVssNic]::new()\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $vmHostNetworkAdapter = $this.GetVMHostNetworkAdapter($virtualSwitch)\n\n            $result.VssName = $virtualSwitch.Name\n            $this.PopulateResult($vmHostNetworkAdapter, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Switch with the specified name from the server if it exists.\n    The Virtual Switch must be a Standard Virtual Switch. If the Virtual Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVirtualSwitch() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            return Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction SilentlyContinue\n        }\n        else {\n            try {\n                $virtualSwitch = Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction Stop\n                return $virtualSwitch\n            }\n            catch {\n                throw \"Could not retrieve Virtual Switch $($this.VssName) of VMHost $($this.VMHost.Name). For more information: $($_.Exception.Message)\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostNtpSettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostNtpSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    List of domain name or IP address of the desired NTP Servers.\n    #>\n    [DscProperty()]\n    [string[]] $NtpServer\n\n    <#\n    .DESCRIPTION\n\n    Desired Policy of the VMHost 'ntpd' service activation.\n    #>\n    [DscProperty()]\n    [ServicePolicy] $NtpServicePolicy = [ServicePolicy]::Unset\n\n    hidden [string] $ServiceId = 'ntpd'\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostNtpServer($vmHost)\n            $this.UpdateVMHostNtpServicePolicy($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $vmHostNtpConfig = $vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n            $vmHostServices = $vmHost.ExtensionData.Config.Service\n            $vmHostNtpService = $vmHostServices.Service | Where-Object -FilterScript { $_.Key -eq $this.ServiceId }\n\n            $result = !((\n                $this.ShouldUpdateArraySetting('NtpServer', $vmHostNtpConfig.Server, $this.NtpServer),\n                $this.ShouldUpdateDscResourceSetting('NtpServicePolicy', $vmHostNtpService.Policy.ToString(), $this.NtpServicePolicy.ToString())\n            ) -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostNtpSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostNtpSettings]::new()\n\n            $vmHost = $this.GetVMHost()\n\n            $vmHostNtpConfig = $vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n            $vmHostServices = $vmHost.ExtensionData.Config.Service\n            $vmHostNtpService = $vmHostServices.Service | Where-Object -FilterScript { $_.Key -eq $this.ServiceId }\n\n            $result.Name = $vmHost.Name\n            $result.Server = $this.Server\n            $result.NtpServer = $vmHostNtpConfig.Server\n            $result.NtpServicePolicy = $vmHostNtpService.Policy\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMHost NTP Server with the desired NTP Server array.\n    #>\n    [void] UpdateVMHostNtpServer($vmHost) {\n        $vmHostNtpConfig = $vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n        if (!$this.ShouldUpdateArraySetting('NtpServer', $vmHostNtpConfig.Server, $this.NtpServer)) {\n            return\n        }\n\n        $dateTimeConfig = New-DateTimeConfig -NtpServer $this.NtpServer\n\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $vmHost.ExtensionData.ConfigManager.DateTimeSystem\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $dateTimeSystem = Get-View @getViewParams\n\n        Update-DateTimeConfig -DateTimeSystem $dateTimeSystem -DateTimeConfig $dateTimeConfig\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMHost 'ntpd' Service Policy with the desired Service Policy.\n    #>\n    [void] UpdateVMHostNtpServicePolicy($vmHost) {\n        $vmHostServices = $vmHost.ExtensionData.Config.Service\n        $vmHostNtpService = $vmHostServices.Service | Where-Object -FilterScript { $_.Key -eq $this.ServiceId }\n        if (!$this.ShouldUpdateDscResourceSetting('NtpServicePolicy', $vmHostNtpService.Policy.ToString(), $this.NtpServicePolicy.ToString())) {\n            return\n        }\n\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $vmHost.ExtensionData.ConfigManager.ServiceSystem\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $serviceSystem = Get-View @getViewParams\n\n        Update-ServicePolicy -ServiceSystem $serviceSystem -ServiceId $this.ServiceId -ServicePolicyValue $this.NtpServicePolicy.ToString().ToLower()\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostPciPassthrough.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostPciPassthrough : VMHostRestartBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Id of the PCI Device, composed of \"bus:slot.function\".\n    #>\n    [DscProperty(Key)]\n    [string] $Id\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether passThru has been configured for this device.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Enabled\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPciPassthruSystem = $this.GetVMHostPciPassthruSystem($vmHost)\n            $pciDevice = $this.GetPCIDevice($vmHostPciPassthruSystem)\n\n            $this.EnsurePCIDeviceIsPassthruCapable($pciDevice)\n            $this.EnsureVMHostIsInMaintenanceMode($vmHost)\n\n            $this.UpdatePciPassthruConfiguration($vmHostPciPassthruSystem)\n            $this.RestartVMHost($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPciPassthruSystem = $this.GetVMHostPciPassthruSystem($vmHost)\n\n            $pciDevice = $this.GetPCIDevice($vmHostPciPassthruSystem)\n            $this.EnsurePCIDeviceIsPassthruCapable($pciDevice)\n\n            $result = !$this.ShouldUpdateDscResourceSetting('Enabled', $pciDevice.PassthruEnabled, $this.Enabled)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostPciPassthrough] Get() {\n        try {\n            $result = [VMHostPciPassthrough]::new()\n            $result.Server = $this.Server\n            $result.RestartTimeoutMinutes = $this.RestartTimeoutMinutes\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPciPassthruSystem = $this.GetVMHostPciPassthruSystem($vmHost)\n\n            $pciDevice = $this.GetPCIDevice($vmHostPciPassthruSystem)\n            $this.EnsurePCIDeviceIsPassthruCapable($pciDevice)\n\n            $result.Name = $vmHost.Name\n            $result.Id = $pciDevice.Id\n            $result.Enabled = $pciDevice.PassthruEnabled\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the PciPassthruSystem of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostPciPassthruSystem($vmHost) {\n        try {\n            $vmHostPciPassthruSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.PciPassthruSystem -ErrorAction Stop\n            return $vmHostPciPassthruSystem\n        }\n        catch {\n            throw \"Could not retrieve the PciPassthruSystem of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the PCI Device with the specified Id from the server.\n    #>\n    [PSObject] GetPCIDevice($vmHostPciPassthruSystem) {\n        $pciDevice = $vmHostPciPassthruSystem.PciPassthruInfo | Where-Object { $_.Id -eq $this.Id }\n        if ($null -eq $pciDevice) {\n            throw \"The specified PCI Device $($this.Id) does not exist for VMHost $($this.Name).\"\n        }\n\n        return $pciDevice\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified PCIDevice is Passthrough capable and if not, throws an exception.\n    #>\n    [void] EnsurePCIDeviceIsPassthruCapable($pciDevice) {\n        if (!$pciDevice.PassthruCapable) {\n            throw \"Cannot configure PCI-Passthrough on incapable device $($pciDevice.Id).\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the specified PCI Device by changing its Passthru Enabled value.\n    #>\n    [void] UpdatePciPassthruConfiguration($vmHostPciPassthruSystem) {\n        $vmHostPciPassthruConfig = New-Object VMware.Vim.HostPciPassthruConfig\n\n        $vmHostPciPassthruConfig.Id = $this.Id\n        $vmHostPciPassthruConfig.PassthruEnabled = $this.Enabled\n\n        try {\n            Update-PassthruConfig -VMHostPciPassthruSystem $vmHostPciPassthruSystem -VMHostPciPassthruConfig $vmHostPciPassthruConfig\n        }\n        catch {\n            throw \"The Update operation of PCI Device $($this.Id) failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostPermission.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostPermission : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Entity to which the Permission applies.\n    #>\n    [DscProperty(Key)]\n    [string] $EntityName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Entity with name specified in 'EntityName' key property. Location consists of 0 or more Inventory Items.\n    When the Entity is a Datacenter, a VMHost or a Datastore, the property is ignored. If the Entity is a Virtual Machine, a Resource Pool or a vApp and empty location\n    is passed, the Entity should be located in the Root Resource Pool of the VMHost. Inventory Item names in the location are separated by '/'.\n    Example location for a Datastore Inventory Item: ''. Example location for a Virtual Machine Inventory Item: 'MyResourcePoolOne/MyResourcePoolTwo/MyvApp'.\n    #>\n    [DscProperty(Key)]\n    [string] $EntityLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the Entity of the Permission. Valid Entity types are: 'Datacenter', 'VMHost', 'Datastore', 'VM', 'ResourcePool' and 'VApp'.\n    #>\n    [DscProperty(Key)]\n    [EntityType] $EntityType\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the User to which the Permission applies. If the User is a Domain User, the Principal name should be in one of the\n    following formats: '<Domain Name>/<User name>' or '<User name>@<Domain Name>'. Example Principal name for Domain User: 'MyDomain/MyDomainUser' or 'MyDomainUser@MyDomain'.\n    #>\n    [DscProperty(Key)]\n    [string] $PrincipalName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Role to which the Permission applies.\n    #>\n    [DscProperty(Key)]\n    [string] $RoleName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Permission should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to propagate the Permission to the child Inventory Items.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Propagate\n\n    hidden [string] $CreatePermissionMessage = \"Creating Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}.\"\n    hidden [string] $ModifyPermissionMessage = \"Modifying Permission for Entity {0} and Principal {1} on VMHost {2}.\"\n    hidden [string] $RemovePermissionMessage = \"Removing Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}.\"\n\n    hidden [string] $CouldNotRetrieveRootResourcePoolMessage = \"Could not retrieve Root Resource Pool from VMHost {0}. For more information: {1}\"\n    hidden [string] $InvalidEntityLocationMessage = \"Location {0} for Entity {1} on VMHost {2} is not valid.\"\n    hidden [string] $CouldNotIdentifyVMMessage = \"Could not uniquely identify VM with name {0} on VMHost {1}. {2} VMs with this name exist on the VMHost.\"\n    hidden [string] $CouldNotFindEntityMessage = \"Entity {0} of type {1} was not found on VMHost {2}.\"\n    hidden [string] $CouldNotRetrievePrincipalMessage = \"Could not retrieve Principal {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveRoleMessage = \"Could not retrieve Role from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreatePermissionMessage = \"Could not create Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}. For more information: {4}\"\n    hidden [string] $CouldNotModifyPermissionMessage = \"Could not modify Permission for Entity {0} and Principal {1} on VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotRemovePermissionMessage = \"Could not remove Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}. For more information: {4}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $foundEntityLocation = $this.GetEntityLocation()\n            $entity = $this.GetEntity($foundEntityLocation)\n            $vmHostPrincipal = $this.GetVMHostPrincipal()\n\n            $vmHostPermission = $this.GetVMHostPermission($entity, $vmHostPrincipal)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostPermission) {\n                    $this.NewVMHostPermission($entity, $vmHostPrincipal)\n                }\n                else {\n                    $this.ModifyVMHostPermission($vmHostPermission)\n                }\n            }\n            else {\n                if ($null -ne $vmHostPermission) {\n                    $this.RemoveVMHostPermission($vmHostPermission)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $foundEntityLocation = $this.GetEntityLocation()\n            $entity = $this.GetEntity($foundEntityLocation)\n            $vmHostPrincipal = $this.GetVMHostPrincipal()\n\n            $vmHostPermission = $this.GetVMHostPermission($entity, $vmHostPrincipal)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostPermission) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyVMHostPermission($vmHostPermission)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostPermission)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostPermission] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostPermission]::new()\n\n            $this.EnsureConnectionIsESXi()\n\n            $foundEntityLocation = $this.GetEntityLocation()\n            $entity = $this.GetEntity($foundEntityLocation)\n            $vmHostPrincipal = $this.GetVMHostPrincipal()\n\n            $vmHostPermission = $this.GetVMHostPermission($entity, $vmHostPrincipal)\n            $this.PopulateResult($result, $vmHostPermission)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Root Resource Pool from the VMHost.\n    #>\n    [PSObject] GetRootResourcePool() {\n        try {\n            $vmHost = Get-VMHost -Server $this.Connection -ErrorAction Stop -Verbose:$false\n            $rootResourcePool = Get-ResourcePool -Server $this.Connection -ErrorAction Stop -Verbose:$false |\n                                Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id }\n\n            return $rootResourcePool\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRootResourcePoolMessage -f $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the location of the Entity with the specified name on the VMHost if it exists. For VMs, Resource Pools and vApps\n    if Ensure is 'Present' and the location is not found, an exception is thrown. If Ensure is 'Absent' and the location is not found, $null is returned.\n    #>\n    [PSObject] GetEntityLocation() {\n        $foundEntityLocation = $null\n\n        if (\n            $this.EntityType -eq [EntityType]::Datacenter -or\n            $this.EntityType -eq [EntityType]::VMHost -or\n            $this.EntityType -eq [EntityType]::Datastore\n        ) {\n            # The location is not needed to identify the Entity when it is a Datacenter, VMHost or a Datastore.\n            $foundEntityLocation = $null\n        }\n        else {\n            $rootResourcePool = $this.GetRootResourcePool()\n\n            if ([string]::IsNullOrEmpty($this.EntityLocation)) {\n                # Special case where the Entity location does not contain any Inventory Items. So the Root Resource Pool is the location for the Entity.\n                $foundEntityLocation = $rootResourcePool\n            }\n            elseif ($this.EntityLocation -NotMatch '/') {\n                # Special case where the Entity location is just one Resource Pool or vApp. On VMHosts the vApps are also retrieved with the Get-ResourcePool cmdlet.\n                $foundEntityLocation = Get-ResourcePool -Server $this.Connection -Name $this.EntityLocation -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false |\n                                       Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n            }\n            else {\n                $entityLocationItems = $this.EntityLocation -Split '/'\n\n                # Reverses the Entity location items so that we can start from the bottom and go to the top of the Inventory.\n                [array]::Reverse($entityLocationItems)\n\n                $entityLocationName = $entityLocationItems[0]\n                $foundEntityLocations = Get-Inventory -Server $this.Connection -Name $entityLocationName -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false\n\n                # Removes the name of the Entity location from the Entity location items array as we already retrieved it.\n                $entityLocationItems = $entityLocationItems[1..($entityLocationItems.Length - 1)]\n\n                <#\n                For every found Entity Location with the specified name we start to go up through the parents to check if the Entity Location is valid.\n                If one of the Parents does not meet the criteria of the Entity location, we continue with the next found Entity location.\n                If we find a valid Entity location we stop iterating through the Entity locations and mark it as the found Entity location.\n                #>\n                foreach ($entityLocation in $foundEntityLocations) {\n                    $foundEntityLocationAsViewObject = Get-View -Server $this.Connection -Id $entityLocation.Id -Verbose:$false -Property Parent\n                    $validEntityLocation = $true\n\n                    foreach ($entityLocationItem in $entityLocationItems) {\n                        $foundEntityLocationAsViewObject = Get-View -Server $this.Connection -Id $foundEntityLocationAsViewObject.Parent -Verbose:$false -Property Name, Parent\n                        if ($foundEntityLocationAsViewObject.Name -ne $entityLocationItem) {\n                            $validEntityLocation = $false\n                            break\n                        }\n                    }\n\n                    if ($validEntityLocation) {\n                        $foundEntityLocation = $entityLocation\n                        break\n                    }\n                }\n            }\n\n            $exceptionMessage = $this.InvalidEntityLocationMessage -f $this.EntityLocation, $this.EntityName, $this.Connection.Name\n            $this.EnsureCorrectBehaviourIfTheEntityIsNotFound($foundEntityLocation, $exceptionMessage)\n        }\n\n        return $foundEntityLocation\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Entity with the specified name from the specified location on the VMHost if it exists. For VMs, Resource Pools and vApps\n    if Ensure is 'Present' and the Entity is not found, an exception is thrown. If Ensure is 'Absent' and the Entity is not found, $null is returned.\n    #>\n    [PSObject] GetEntity($entityLocation) {\n        $entity = $null\n\n        if ($this.EntityType -eq [EntityType]::Datacenter) {\n            # Each VMHost has only one Datacenter, so the name is not needed to retrieve it.\n            $entity = Get-Datacenter -Server $this.Connection -ErrorAction SilentlyContinue -Verbose:$false\n        }\n        elseif ($this.EntityType -eq [EntityType]::VMHost) {\n            # If the Entity is a VMHost, the Entity name and location are ignored because the Connection is directly to an ESXi host.\n            $entity = Get-VMHost -Server $this.Connection -ErrorAction SilentlyContinue -Verbose:$false\n        }\n        elseif ($this.EntityType -eq [EntityType]::Datastore) {\n            # If the Entity is a Datastore, the Entity location is ignored because the name uniquely identifies the Datastore.\n            $entity = Get-Datastore -Server $this.Connection -Name $this.EntityName -ErrorAction SilentlyContinue -Verbose:$false\n        }\n        elseif ($this.EntityType -eq [EntityType]::VM) {\n            <#\n            If the Entity is a VM, the Entity location is either a Resource Pool or a vApp where the VM is placed. If the VMHost is managed by a vCenter,\n            there is a special case where two VMs could be created with the same name on the same VMHost but on different vCenter folders. And this way the\n            VM could not be uniquely identified on the VMHost.\n            #>\n            $entity = Get-VM -Server $this.Connection -Name $this.EntityName -Location $entityLocation -ErrorAction SilentlyContinue -Verbose:$false\n\n            # Only throw an exception if Ensure is 'Present', otherwise ignore that multiple VMs were found.\n            if ($entity.Length -gt 1 -and $this.Ensure -eq [Ensure]::Present) {\n                throw ($this.CouldNotIdentifyVMMessage -f $this.EntityName, $this.Connection.Name, $entity.Length)\n            }\n        }\n        else {\n            <#\n            If the Entity is a Resource Pool or vApp, the Entity location is either a Resource Pool or a vApp where the Entity is placed. For a specific Resource Pool\n            or vApp, the name does not uniquely identify the Entity because there can be other Resource Pools or vApps below in the hierarchy with the same name placed in the\n            Entity location. So additional filtering is needed to verify that the Entity is directly placed in the specified Entity location.\n            #>\n            $entity = Get-ResourcePool -Server $this.Connection -Name $this.EntityName -Location $entityLocation -ErrorAction SilentlyContinue -Verbose:$false |\n                      Where-Object -FilterScript { $_.ParentId -eq $entityLocation.Id }\n        }\n\n        $exceptionMessage = $this.CouldNotFindEntityMessage -f $this.EntityName, $this.EntityType.ToString(), $this.Connection.Name\n        $this.EnsureCorrectBehaviourIfTheEntityIsNotFound($entity, $exceptionMessage)\n\n        return $entity\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Principal with the specified name from the VMHost if it exists.\n    If the name contains '\\' or '@', it means that the Principal is part of a Domain, so the search for the Principal should be done by filtering by Domain.\n    If Ensure is 'Present' and the Principal is not found, an exception is thrown. If Ensure is 'Absent' and the Principal is not found, $null is returned.\n    #>\n    [PSObject] GetVMHostPrincipal() {\n        $getVIAccountParams = @{\n            Server = $this.Connection\n            Verbose = $false\n        }\n\n        # If the Principal is a Domain User, we should extact the Domain and User names from the Principal name.\n        if ($this.PrincipalName -Match '\\\\') {\n            $principalNameParts = $this.PrincipalName -Split '\\\\'\n            $domainName = $principalNameParts[0]\n            $username = $principalNameParts[1]\n\n            $getVIAccountParams.Domain = $domainName\n            $getVIAccountParams.User = $true\n            $getVIAccountParams.Id = $username\n        }\n        elseif ($this.PrincipalName -Match '@') {\n            $principalNameParts = $this.PrincipalName -Split '@'\n            $username = $principalNameParts[0]\n            $domainName = $principalNameParts[1]\n\n            $getVIAccountParams.Domain = $domainName\n            $getVIAccountParams.User = $true\n            $getVIAccountParams.Id = $username\n        }\n        else {\n            $getVIAccountParams.Id = $this.PrincipalName\n        }\n\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            $getVIAccountParams.ErrorAction = 'SilentlyContinue'\n            return Get-VIAccount @getVIAccountParams\n        }\n        else {\n            try {\n                $getVIAccountParams.ErrorAction = 'Stop'\n                $vmHostPrincipal = Get-VIAccount @getVIAccountParams\n\n                return $vmHostPrincipal\n            }\n            catch {\n                throw ($this.CouldNotRetrievePrincipalMessage -f $this.PrincipalName, $this.Connection.Name, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Permission applied to the specified Entity and Principal from the VMHost if it exists.\n    If one of the Entity and Principal parameters is $null, $null is returned.\n    #>\n    [PSObject] GetVMHostPermission($entity, $vmHostPrincipal) {\n        if ($null -eq $entity -or $null -eq $vmHostPrincipal) {\n            return $null\n        }\n\n        return Get-VIPermission -Server $this.Connection -Entity $entity -Principal $vmHostPrincipal -ErrorAction SilentlyContinue -Verbose:$false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Role with the specified name from the VMHost if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVMHostRole() {\n        try {\n            $vmHostRole = Get-VIRole -Server $this.Connection -Name $this.RoleName -ErrorAction Stop -Verbose:$false\n            return $vmHostRole\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRoleMessage -f $this.RoleName, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures the correct behaviour if the Entity is not found based on the passed Ensure value.\n    If Ensure is 'Present' and the Entity is not found, the method should throw an exception.\n    #>\n    [void] EnsureCorrectBehaviourIfTheEntityIsNotFound($entity, $exceptionMessage) {\n        if ($null -eq $entity) {\n            if ($this.Ensure -eq [Ensure]::Present) {\n                throw $exceptionMessage\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified Permission should be modified. The Permission should be modified if the desired Role is different\n    from the current one or if the Propagate behaviour should be different.\n    #>\n    [bool] ShouldModifyVMHostPermission($vmHostPermission) {\n        $shouldModifyVMHostPermission = @(\n            $this.ShouldUpdateDscResourceSetting('RoleName', [string] $vmHostPermission.Role, $this.RoleName),\n            $this.ShouldUpdateDscResourceSetting('Propagate', $vmHostPermission.Propagate, $this.Propagate)\n        )\n\n        return ($shouldModifyVMHostPermission -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Permission and applies it to the specified Entity, Principal and Role.\n    #>\n    [void] NewVMHostPermission($entity, $vmHostPrincipal) {\n        $vmHostRole = $this.GetVMHostRole()\n        $newVIPermissionParams = @{\n            Server = $this.Connection\n            Entity = $entity\n            Principal = $vmHostPrincipal\n            Role = $vmHostRole\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Propagate) {\n            $newVIPermissionParams.Propagate = $this.Propagate\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreatePermissionMessage, @($entity.Name, $vmHostPrincipal.Name, $vmHostRole.Name, $this.Connection.Name))\n\n            New-VIPermission @newVIPermissionParams\n        }\n        catch {\n            throw ($this.CouldNotCreatePermissionMessage -f $entity.Name, $vmHostPrincipal.Name, $vmHostRole.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the properties of the specified Permission. Changes the Role if the desired one is not the same as the current one.\n    It also changes the propagate behaviour of the Permission if the 'Propagate' property is specified.\n    #>\n    [void] ModifyVMHostPermission($vmHostPermission) {\n        $setVIPermissionParams = @{\n            Server = $this.Connection\n            Permission = $vmHostPermission\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($vmHostPermission.Role -ne $this.RoleName) {\n            $vmHostRole = $this.GetVMHostRole()\n            $setVIPermissionParams.Role = $vmHostRole\n        }\n\n        if ($null -ne $this.Propagate) {\n            $setVIPermissionParams.Propagate = $this.Propagate\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyPermissionMessage, @($vmHostPermission.Entity.Name, $vmHostPermission.Principal, $this.Connection.Name))\n\n            Set-VIPermission @setVIPermissionParams\n        }\n        catch {\n            throw ($this.CouldNotModifyPermissionMessage -f $vmHostPermission.Entity.Name, $vmHostPermission.Principal, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Permission.\n    #>\n    [void] RemoveVMHostPermission($vmHostPermission) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemovePermissionMessage, @($vmHostPermission.Entity.Name, $vmHostPermission.Principal, $vmHostPermission.Role, $this.Connection.Name))\n\n            $vmHostPermission | Remove-VIPermission -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotRemovePermissionMessage -f $vmHostPermission.Entity.Name, $vmHostPermission.Principal, $vmHostPermission.Role, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostPermission) {\n        $result.Server = $this.Connection.Name\n        $result.EntityLocation = $this.EntityLocation\n        $result.EntityType = $this.EntityType\n\n        if ($null -ne $vmHostPermission) {\n            $result.EntityName = $vmHostPermission.Entity.Name\n            $result.PrincipalName = $vmHostPermission.Principal\n            $result.RoleName = $vmHostPermission.Role\n            $result.Ensure = [Ensure]::Present\n            $result.Propagate = $vmHostPermission.Propagate\n        }\n        else {\n            $result.EntityName = $this.EntityName\n            $result.PrincipalName = $this.PrincipalName\n            $result.RoleName = $this.RoleName\n            $result.Ensure = [Ensure]::Absent\n            $result.Propagate = $this.Propagate\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostPowerPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostPowerPolicy : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Power Management Policy for the specified VMHost.\n    #>\n    [DscProperty(Mandatory)]\n    [PowerPolicy] $PowerPolicy\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPowerSystem = $this.GetVMHostPowerSystem($vmHost)\n\n            $this.UpdatePowerPolicy($vmHostPowerSystem)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $currentPowerPolicy = $vmHost.ExtensionData.Config.PowerSystemInfo.CurrentPolicy\n\n            $result = !$this.ShouldUpdateDscResourceSetting('PowerPolicy', $currentPowerPolicy.Key, $this.PowerPolicy)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostPowerPolicy] Get() {\n        try {\n            $result = [VMHostPowerPolicy]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $currentPowerPolicy = $vmHost.ExtensionData.Config.PowerSystemInfo.CurrentPolicy\n\n            $result.Name = $vmHost.Name\n            $result.PowerPolicy = $currentPowerPolicy.Key\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Power System of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostPowerSystem($vmHost) {\n        try {\n            $vmHostPowerSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.PowerSystem -ErrorAction Stop\n            return $vmHostPowerSystem\n        }\n        catch {\n            throw \"Could not retrieve the Power System of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Power Management Policy of the specified VMHost.\n    #>\n    [void] UpdatePowerPolicy($vmHostPowerSystem) {\n        try {\n            Update-PowerPolicy -VMHostPowerSystem $vmHostPowerSystem -PowerPolicy $this.PowerPolicy\n        }\n        catch {\n            throw \"The Power Policy of VMHost $($this.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostRole.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostRole : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Role on the VMHost.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Role on the VMHost should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the ids of the Privileges for the Role on the VMHost. The Privilege ids should be in the following format: '<Privilege Group id>.<Privilege Item id>'.\n    Exampe Privilege id: 'VirtualMachine.Inventory.Create' where 'VirtualMachine.Inventory' is the Privilege Group id and 'Create' is the id of the Privilege item.\n    #>\n    [DscProperty()]\n    [string[]] $PrivilegeIds\n\n    hidden [string] $CreateRoleMessage = \"Creating Role {0} on VMHost {1}.\"\n    hidden [string] $CreateRoleWithPrivilegesMessage = \"Creating Role {0} with Privileges {1} on VMHost {2}.\"\n    hidden [string] $ModifyPrivilegesOfRoleMessage = \"Modifying Privileges of Role {0} on VMHost {1}.\"\n    hidden [string] $RemoveRoleMessage = \"Removing Role {0} on VMHost {1}.\"\n\n    hidden [string] $CouldNotFindPrivilegeMessage = \"The passed Privilege {0} was not found and it will be ignored.\"\n    hidden [string] $CouldNotRetrieveRolePrivilegesMessage = \"Could not retrieve Privilege {0} of Role {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreateRoleMessage = \"Could not create Role {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreateRoleWithPrivilegesMessage = \"Could not create Role {0} with Privileges {1} on VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotModifyPrivilegesOfRoleMessage = \"Could not modify Privileges of Role {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveRoleMessage = \"Could not remove Role {0} on VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $vmHostRole = $this.GetVMHostRole()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $desiredPrivileges = $this.GetPrivileges()\n\n                if ($null -eq $vmHostRole) {\n                    if ($desiredPrivileges.Length -gt 0) {\n                        $this.NewVMHostRole($desiredPrivileges)\n                    }\n                    else {\n                        $this.NewVMHostRole()\n                    }\n                }\n                else {\n                    $currentPrivileges = $this.GetRolePrivileges($vmHostRole, $desiredPrivileges)\n                    $this.ModifyPrivilegesOfVMHostRole($vmHostRole, $currentPrivileges, $desiredPrivileges)\n                }\n            }\n            else {\n                if ($null -ne $vmHostRole) {\n                    $this.RemoveVMHostRole($vmHostRole)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $vmHostRole = $this.GetVMHostRole()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostRole) {\n                    $result = $false\n                }\n                else {\n                    $desiredPrivileges = $this.GetPrivileges()\n                    $desiredPrivilegeIds = if ($desiredPrivileges.Length -eq 0) { $null } else { $desiredPrivileges.Id }\n\n                    $result = !$this.ShouldUpdateArraySetting('PrivilegeList', $vmHostRole.PrivilegeList, $desiredPrivilegeIds)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostRole)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostRole] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostRole]::new()\n\n            $this.EnsureConnectionIsESXi()\n\n            $vmHostRole = $this.GetVMHostRole()\n            $this.PopulateResult($result, $vmHostRole)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Role with the specified name on the VMHost if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetVMHostRole() {\n        return Get-VIRole -Server $this.Connection -Name $this.Name -ErrorAction SilentlyContinue -Verbose:$false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Privileges with the specified ids on the VMHost if they exist.\n    For every Privilege that does not exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetPrivileges() {\n        $privileges = @()\n\n        foreach ($privilegeId in $this.PrivilegeIds) {\n            $privilege = Get-VIPrivilege -Server $this.Connection -Id $privilegeId -ErrorAction SilentlyContinue -Verbose:$false\n            if ($null -eq $privilege) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindPrivilegeMessage, @($privilegeId))\n            }\n            else {\n                $privileges += $privilege\n            }\n        }\n\n        return $privileges\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Privileges of the Role on the VMHost.\n    #>\n    [array] GetRolePrivileges($vmHostRole, $desiredPrivileges) {\n        $rolePrivileges = @()\n\n        foreach ($privilegeId in $vmHostRole.PrivilegeList) {\n            <#\n            Here we can check if the desired Privilege list already contains the Role Privilege and this way\n            we can skip the server call because the Privilege object is already available in the array of Privileges.\n            #>\n            if ($desiredPrivileges.Length -gt 0 -and $desiredPrivileges.Id.Contains($privilegeId)) {\n                $rolePrivileges += ($desiredPrivileges | Where-Object -FilterScript { $_.Id -eq $privilegeId })\n            }\n            else {\n                try {\n                    $rolePrivilige = Get-VIPrivilege -Server $this.Connection -Id $privilegeId -ErrorAction Stop -Verbose:$false\n                    $rolePrivileges += $rolePrivilige\n                }\n                catch {\n                    throw ($this.CouldNotRetrieveRolePrivilegesMessage -f $privilegeId, $vmHostRole.Name, $_.Exception.Message)\n                }\n            }\n        }\n\n        return $rolePrivileges\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Role with the specified name on the VMHost.\n    #>\n    [void] NewVMHostRole() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateRoleMessage, @($this.Name, $this.Connection.Name))\n\n            New-VIRole -Server $this.Connection -Name $this.Name -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotCreateRoleMessage -f $this.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Role with the specified name on the VMHost and applies the provided Privileges.\n    #>\n    [void] NewVMHostRole($desiredPrivileges) {\n        $desiredPrivilegeIds = [string]::Join(', ', $desiredPrivileges.Id)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateRoleWithPrivilegesMessage, @($this.Name, $desiredPrivilegeIds, $this.Connection.Name))\n\n            New-VIRole -Server $this.Connection -Name $this.Name -Privilege $desiredPrivileges -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotCreateRoleWithPrivilegesMessage -f $this.Name, $desiredPrivilegeIds, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the Privileges of the Role on the VMHost. The 'Set-VIRole' cmdlet has two parameters for Privileges - 'AddPrivilege' and 'RemovePrivilege'.\n    So based on the provided desired Privileges we need to add those of them that are not yet Privileges of the Role and also remove existing ones\n    from the Privilege list of the Role because they are not specified as desired.\n    #>\n    [void] ModifyPrivilegesOfVMHostRole($vmHostRole, $currentPrivileges, $desiredPrivileges) {\n        $setVIRoleParams = @{\n            Server = $this.Connection\n            Role = $vmHostRole\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $privilegesToAdd = @()\n        $privilegesToRemove = @()\n\n        <#\n        If the Role does not have Privileges, it means that all desired Privileges need to be marked as Privileges to add.\n        Otherwise Privileges to add are those that are not present in the Privilege list of the Role and Privileges\n        to remove are those that are not present in the desired Privilege list.\n        #>\n        if ($currentPrivileges.Length -eq 0) {\n            $privilegesToAdd = $desiredPrivileges\n        }\n        else {\n            $privilegesToAdd = $desiredPrivileges | Where-Object -FilterScript { $currentPrivileges -NotContains $_ }\n            $privilegesToRemove = $currentPrivileges | Where-Object -FilterScript { $desiredPrivileges -NotContains $_ }\n        }\n\n        <#\n        If the Privileges to add array is empty, it means that only removal of Privileges is needed. Otherwise, we first add\n        all the specified Privileges that are not present in the list of Privileges of the Role and after that check if there are\n        Privileges to remove from that list. The 'AddPrivilege' entry needs to be removed from the params hashtable because 'AddPrivilege'\n        and 'RemovePrivilege' parameters of 'Set-VIRole' cmdlet are in different parameter sets, so two cmdlet invocations need to be made.\n        #>\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyPrivilegesOfRoleMessage, @($vmHostRole.Name, $this.Connection.Name))\n\n            if ($privilegesToAdd.Length -eq 0) {\n                $setVIRoleParams.RemovePrivilege = $privilegesToRemove\n                Set-VIRole @setVIRoleParams\n            }\n            else {\n                $setVIRoleParams.AddPrivilege = $privilegesToAdd\n                Set-VIRole @setVIRoleParams\n\n                if ($privilegesToRemove.Length -gt 0) {\n                    $setVIRoleParams.Remove('AddPrivilege')\n                    $setVIRoleParams.RemovePrivilege = $privilegesToRemove\n\n                    Set-VIRole @setVIRoleParams\n                }\n            }\n        }\n        catch {\n            throw ($this.CouldNotModifyPrivilegesOfRoleMessage -f $vmHostRole.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Role on the VMHost. All Permissions associated with the Role will be removed as well.\n    #>\n    [void] RemoveVMHostRole($vmHostRole) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveRoleMessage, @($vmHostRole.Name, $this.Connection.Name))\n\n            $vmHostRole | Remove-VIRole -Server $this.Connection -Force -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotRemoveRoleMessage -f $vmHostRole.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostRole) {\n        $result.Server = $this.Connection.Name\n\n        if ($null -ne $vmHostRole) {\n            $result.Name = $vmHostRole.Name\n            $result.Ensure = [Ensure]::Present\n            $result.PrivilegeIds = $vmHostRole.PrivilegeList\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.PrivilegeIds = $this.PrivilegeIds\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostSatpClaimRule.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostSatpClaimRule : EsxCliBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Value indicating if the SATP Claim Rule should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Name of the SATP Claim Rule.\n    #>\n    [DscProperty(Key)]\n    [string] $RuleName\n\n    <#\n    .DESCRIPTION\n\n    PSP options for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $PSPOptions\n\n    <#\n    .DESCRIPTION\n\n    Transport Property of the Satp Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Transport\n\n    <#\n    .DESCRIPTION\n\n    Description string to set when adding the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Description\n\n    <#\n    .DESCRIPTION\n\n    Vendor string to set when adding the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Vendor\n\n    <#\n    .DESCRIPTION\n\n    System default rule added at boot time.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Boot\n\n    <#\n    .DESCRIPTION\n\n    Claim type for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Type\n\n    <#\n    .DESCRIPTION\n\n    Device of the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Device\n\n    <#\n    .DESCRIPTION\n\n    Driver string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Driver\n\n    <#\n    .DESCRIPTION\n\n    Claim option string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $ClaimOptions\n\n    <#\n    .DESCRIPTION\n\n    Default PSP for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Psp\n\n    <#\n    .DESCRIPTION\n\n    Option string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Options\n\n    <#\n    .DESCRIPTION\n\n    Model string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Model\n\n    <#\n    .DESCRIPTION\n\n    Value, which ignores validity checks and install the rule anyway.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.GetEsxCli($vmHost)\n            $satpClaimRule = $this.GetSatpClaimRule()\n            $satpClaimRulePresent = ($null -ne $satpClaimRule)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if (!$satpClaimRulePresent) {\n                    $this.AddSatpClaimRule()\n                }\n            }\n            else {\n                if ($satpClaimRulePresent) {\n                    $this.RemoveSatpClaimRule()\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.GetEsxCli($vmHost)\n            $satpClaimRule = $this.GetSatpClaimRule()\n            $satpClaimRulePresent = ($null -ne $satpClaimRule)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = $satpClaimRulePresent\n            }\n            else {\n                $result = -not $satpClaimRulePresent\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostSatpClaimRule] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSatpClaimRule]::new()\n\n            $result.Server = $this.Server\n            $result.RuleName = $this.RuleName\n            $result.Boot = $this.Boot\n            $result.Type = $this.Type\n            $result.Force = $this.Force\n\n            $vmHost = $this.GetVMHost()\n            $result.Name = $vmHost.Name\n\n            $this.GetEsxCli($vmHost)\n            $satpClaimRule = $this.GetSatpClaimRule()\n            $satpClaimRulePresent = ($null -ne $satpClaimRule)\n\n            if (!$satpClaimRulePresent) {\n                $result.Ensure = \"Absent\"\n                $result.Psp = $this.Psp\n                $this.PopulateResult($result, $this)\n            }\n            else {\n                $result.Ensure = \"Present\"\n                $result.Psp = $satpClaimRule.DefaultPSP\n                $this.PopulateResult($result, $satpClaimRule)\n            }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the desired SATP Claim Rule is equal to the passed SATP Claim Rule.\n    #>\n    [bool] Equals($satpClaimRule) {\n        if ($this.RuleName -ne $satpClaimRule.Name) {\n            return $false\n        }\n\n        <#\n            For every optional property we check if it is not passed(if it is null), because\n            all properties on the server, which are not set are returned as empty strings and\n            if we compare null with empty string the equality will fail.\n        #>\n\n        if ($null -ne $this.PSPOptions -and $this.PSPOptions -ne $satpClaimRule.PSPOptions) {\n            return $false\n        }\n\n        if ($null -ne $this.Transport -and $this.Transport -ne $satpClaimRule.Transport) {\n            return $false\n        }\n\n        if ($null -ne $this.Description -and $this.Description -ne $satpClaimRule.Description) {\n            return $false\n        }\n\n        if ($null -ne $this.Vendor -and $this.Vendor -ne $satpClaimRule.Vendor) {\n            return $false\n        }\n\n        if ($null -ne $this.Device -and $this.Device -ne $satpClaimRule.Device) {\n            return $false\n        }\n\n        if ($null -ne $this.Driver -and $this.Driver -ne $satpClaimRule.Driver) {\n            return $false\n        }\n\n        if ($null -ne $this.ClaimOptions -and $this.ClaimOptions -ne $satpClaimRule.ClaimOptions) {\n            return $false\n        }\n\n        if ($null -ne $this.Psp -and $this.Psp -ne $satpClaimRule.DefaultPSP) {\n            return $false\n        }\n\n        if ($null -ne $this.Options -and $this.Options -ne $satpClaimRule.Options) {\n            return $false\n        }\n\n        if ($null -ne $this.Model -and $this.Model -ne $satpClaimRule.Model) {\n            return $false\n        }\n\n        return $true\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the desired SatpClaimRule if the Rule is present on the server, otherwise returns $null.\n    #>\n    [PSObject] GetSatpClaimRule() {\n        $foundSatpClaimRule = $null\n        $satpClaimRules = Get-SATPClaimRules -EsxCli $this.EsxCli\n\n        foreach ($satpClaimRule in $satpClaimRules) {\n            if ($this.Equals($satpClaimRule)) {\n                $foundSatpClaimRule = $satpClaimRule\n                break\n            }\n        }\n\n        return $foundSatpClaimRule\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the SATP Claim Rule properties from the server.\n    #>\n    [void] PopulateResult($result, $satpClaimRule) {\n        $result.PSPoptions = $satpClaimRule.PSPOptions\n        $result.Transport = $satpClaimRule.Transport\n        $result.Description = $satpClaimRule.Description\n        $result.Vendor = $satpClaimRule.Vendor\n        $result.Device = $satpClaimRule.Device\n        $result.Driver = $satpClaimRule.Driver\n        $result.ClaimOptions = $satpClaimRule.ClaimOptions\n        $result.Options = $satpClaimRule.Options\n        $result.Model = $satpClaimRule.Model\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the arguments for the Add and Remove operations of SATP Claim Rule with the specified properties from the user.\n    #>\n    [void] PopulateSatpArgs($satpArgs) {\n        $satpArgs.satp = $this.RuleName\n        $satpArgs.pspoption = $this.PSPoptions\n        $satpArgs.transport = $this.Transport\n        $satpArgs.description = $this.Description\n        $satpArgs.vendor = $this.Vendor\n        $satpArgs.type = $this.Type\n        $satpArgs.device = $this.Device\n        $satpArgs.driver = $this.Driver\n        $satpArgs.claimoption = $this.ClaimOptions\n        $satpArgs.psp = $this.Psp\n        $satpArgs.option = $this.Options\n        $satpArgs.model = $this.Model\n\n        if ($null -ne $this.Boot) { $satpArgs.boot = $this.Boot }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Installs the new SATP Claim Rule with the specified properties from the user.\n    #>\n    [void] AddSatpClaimRule() {\n        $satpArgs = Add-CreateArgs -EsxCli $this.EsxCli\n        if ($null -ne $this.Force) { $satpArgs.force = $this.Force }\n\n        $this.PopulateSatpArgs($satpArgs)\n\n        try {\n            Add-SATPClaimRule -EsxCli $this.EsxCli -SatpArgs $satpArgs\n        }\n        catch {\n            throw \"EsxCLI command for adding satp rule failed with the following exception: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Uninstalls the SATP Claim Rule with the specified properties from the user.\n    #>\n    [void] RemoveSatpClaimRule() {\n        $satpArgs = Remove-CreateArgs -EsxCli $this.EsxCli\n\n        $this.PopulateSatpArgs($satpArgs)\n\n        try {\n            Remove-SATPClaimRule -EsxCli $this.EsxCli -SatpArgs $satpArgs\n        }\n        catch {\n            throw \"EsxCLI command for removing satp rule failed with the following exception: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostScsiLun.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostScsiLun : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the canonical name of the SCSI device. An example of a SCSI canonical name is 'vmhba0:0:0:0'.\n    #>\n    [DscProperty(Key)]\n    [string] $CanonicalName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the policy that the Lun must use when choosing a path. The following values are valid:\n    Fixed - uses the preferred SCSI Lun path whenever possible.\n    RoundRobin - load balance.\n    MostRecentlyUsed - uses the most recently used SCSI Lun path.\n    Unknown\n    #>\n    [DscProperty()]\n    [MultipathPolicy] $MultipathPolicy = [MultipathPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the preferred SCSI Lun path to access the SCSI Lun.\n    #>\n    [DscProperty()]\n    [string] $PreferredScsiLunPathName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum number of I/O blocks to be issued on a given path before the system tries to select a different path. Modifying this setting affects all SCSI Lun devices that are connected to the same VMHost.\n    The default value is 2048. Setting this parameter to zero (0) disables switching based on blocks.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BlocksToSwitchPath\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum number of I/O requests to be issued on a given path before the system tries to select a different path. Modifying this setting affects all SCSI Lun devices that are connected to the same VMHost.\n    The default value is 50. Setting this parameter to zero (0) disables switching based on commands. This parameter is not supported on vCenter Server 4.x.\n    #>\n    [DscProperty()]\n    [nullable[int]] $CommandsToSwitchPath\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to remove all partitions from the SCSI disk.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DeletePartitions\n\n    <#\n    .DESCRIPTION\n\n    Marks the SCSI disk as local or remote. If the value is $true, the SCSI disk is local. If the value is $false, the SCSI disk is remote.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IsLocal\n\n    <#\n    .DESCRIPTION\n\n    Marks the SCSI disk as an SSD or HDD. If the value is $true, the SCSI disk is SSD type. If the value is $false, the SCSI disk is HDD type.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IsSsd\n\n    hidden [string] $ModifyScsiLunConfigurationMessage = \"Modifying the configuration of SCSI device {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotRetrieveScsiLunMessage = \"Could not retrieve SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveScsiLunPathMessage = \"Could not retrieve SCSI Lun path {0} to SCSI device {1} from VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotRetrievePreferredScsiLunPathMessage = \"Could not retrieve the preferred SCSI Lun path to SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveScsiLunDiskInformationMessage = \"Could not retrieve SCSI Lun disk information for SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyScsiLunConfigurationMessage = \"Could not modify the configuration of SCSI device {0} from VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n\n            $this.ModifyScsiLunConfiguration($scsiLun)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n\n            $result = !$this.ShouldModifyScsiLunConfiguration($scsiLun)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostScsiLun] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostScsiLun]::new()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n\n            $this.PopulateResult($result, $scsiLun)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI device with the specified canonical name from the specified VMHost if it exists.\n    #>\n    [PSObject] GetScsiLun() {\n        try {\n            $scsiLun = Get-ScsiLun -Server $this.Connection -VmHost $this.VMHost -CanonicalName $this.CanonicalName -ErrorAction Stop -Verbose:$false\n            return $scsiLun\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunMessage -f $this.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI Lun path with the specified name to the specified SCSI device if it exists.\n    #>\n    [PSObject] GetScsiLunPath($scsiLun) {\n        try {\n            $scsiLunPath = Get-ScsiLunPath -Name $this.PreferredScsiLunPathName -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n            return $scsiLunPath\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunPathMessage -f $this.PreferredScsiLunPathName, $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the preferred SCSI Lun path to the specified SCSI device.\n    #>\n    [PSObject] GetPreferredScsiLunPath($scsiLun) {\n        try {\n            # For each SCSI device there is only one SCSI Lun path which is preferred.\n            $preferredScsiLunPath = Get-ScsiLunPath -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false |\n                                    Where-Object -FilterScript { $_.Preferred }\n            return $preferredScsiLunPath\n        }\n        catch {\n            throw ($this.CouldNotRetrievePreferredScsiLunPathMessage -f $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves SCSI Lun disk information for the specified SCSI device.\n    #>\n    [PSObject] GetVMHostDisk($scsiLun) {\n        try {\n            $vmHostDisk = Get-VMHostDisk -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n            return $vmHostDisk\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunDiskInformationMessage -f $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the SCSI device configuration should be modified.\n    #>\n    [bool] ShouldModifyScsiLunConfiguration($scsiLun) {\n        $shouldModifyScsiLunConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('MultipathPolicy', [string] $scsiLun.MultipathPolicy, $this.MultipathPolicy.ToString()),\n            $this.ShouldUpdateDscResourceSetting('IsLocal', $scsiLun.IsLocal, $this.IsLocal),\n            $this.ShouldUpdateDscResourceSetting('IsSsd', $scsiLun.IsSsd, $this.IsSsd)\n        )\n\n        # 'BlocksToSwitchPath' and 'CommandsToSwitchPath' properties should determine the Desired State only when the desired Multipath policy is 'Round Robin'.\n        if ($this.MultipathPolicy -eq [MultipathPolicy]::RoundRobin) {\n            $shouldModifyScsiLunConfiguration += $this.ShouldUpdateDscResourceSetting(\n                'BlocksToSwitchPath',\n                [int] $scsiLun.BlocksToSwitchPath,\n                $this.BlocksToSwitchPath\n            )\n            $shouldModifyScsiLunConfiguration += $this.ShouldUpdateDscResourceSetting(\n                'CommandsToSwitchPath',\n                [int] $scsiLun.CommandsToSwitchPath,\n                $this.CommandsToSwitchPath\n            )\n        }\n\n        if (![string]::IsNullOrEmpty($this.PreferredScsiLunPathName) -and $this.MultipathPolicy -eq [MultipathPolicy]::Fixed) {\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            # If the found SCSI Lun path is not preferred, the SCSI device is not in a desired state.\n            $shouldModifyScsiLunConfiguration += !$scsiLunPath.Preferred\n        }\n\n        # If the VMHost disk has existing partitions and 'DeletePartitions' is specified, the SCSI device is not in a desired state.\n        if ($null -ne $this.DeletePartitions -and $this.DeletePartitions) {\n            $vmHostDisk = $this.GetVMHostDisk($scsiLun)\n            $shouldModifyScsiLunConfiguration += ($null -ne $vmHostDisk.ExtensionData.Spec.Partition)\n        }\n\n        return ($shouldModifyScsiLunConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the configuration of the specified SCSI device.\n    #>\n    [void] ModifyScsiLunConfiguration($scsiLun) {\n        $setScsiLunParams = @{\n            ScsiLun = $scsiLun\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($this.MultipathPolicy -ne [MultipathPolicy]::Unset) { $setScsiLunParams.MultipathPolicy = $this.MultipathPolicy.ToString() }\n        if ($null -ne $this.IsLocal) { $setScsiLunParams.IsLocal = $this.IsLocal }\n        if ($null -ne $this.IsSsd) { $setScsiLunParams.IsSsd = $this.IsSsd }\n\n        # 'BlocksToSwitchPath' and 'CommandsToSwitchPath' parameters should be passed to the cmdlet only if the desired Multipath policy is 'Round Robin'.\n        if ($this.MultipathPolicy -eq [MultipathPolicy]::RoundRobin) {\n            if ($null -ne $this.BlocksToSwitchPath) { $setScsiLunParams.BlocksToSwitchPath = $this.BlocksToSwitchPath }\n            if ($null -ne $this.CommandsToSwitchPath) { $setScsiLunParams.CommandsToSwitchPath = $this.CommandsToSwitchPath }\n        }\n\n        if ($null -ne $this.DeletePartitions) {\n            # Force should be specified to avoid the user being asked for confirmation when deleting disk partitions.\n            $setScsiLunParams.DeletePartitions = $this.DeletePartitions\n            $setScsiLunParams.Force = $true\n        }\n\n        if (![string]::IsNullOrEmpty($this.PreferredScsiLunPathName) -and $this.MultipathPolicy -eq [MultipathPolicy]::Fixed) {\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n            $setScsiLunParams.PreferredPath = $scsiLunPath\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyScsiLunConfigurationMessage, @($scsiLun.CanonicalName, $this.VMHost.Name))\n\n            Set-ScsiLun @setScsiLunParams\n        }\n        catch {\n            throw ($this.CouldNotModifyScsiLunConfigurationMessage -f $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $scsiLun) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.CanonicalName = $scsiLun.CanonicalName\n        $result.MultipathPolicy = $scsiLun.MultipathPolicy.ToString()\n        $result.BlocksToSwitchPath = [int] $scsiLun.BlocksToSwitchPath\n        $result.CommandsToSwitchPath = [int] $scsiLun.CommandsToSwitchPath\n        $result.IsLocal = $scsiLun.IsLocal\n        $result.IsSsd = $scsiLun.IsSsd\n\n        $preferredScsiLunPath = $this.GetPreferredScsiLunPath($scsiLun)\n        $result.PreferredScsiLunPathName = $preferredScsiLunPath.Name\n        $result.DeletePartitions = $this.DeletePartitions\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostScsiLunPath.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostScsiLunPath : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the SCSI Lun path to the specified SCSI device in 'ScsiLunCanonicalName' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the canonical name of the SCSI device for the specified SCSI Lun path in 'Name' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $ScsiLunCanonicalName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the SCSI Lun path should be active.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Active\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the SCSI Lun path should be preferred. Only one SCSI Lun path can be preferred, so when a SCSI Lun path is made preferred, the preference is removed from the previously preferred SCSI Lun path.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Preferred\n\n    hidden [string] $ActiveScsiLunPathState = 'Active'\n\n    hidden [string] $ConfigureScsiLunPathMessage = \"Configuring SCSI Lun path {0} to SCSI device {1} from VMHost {2}.\"\n\n    hidden [string] $CouldNotRetrieveScsiLunMessage = \"Could not retrieve SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveScsiLunPathMessage = \"Could not retrieve SCSI Lun path {0} to SCSI device {1} from VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotConfigureScsiLunPathMessage = \"Could not configure SCSI Lun path {0} to SCSI device {1} from VMHost {2}. For more information: {3}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            $this.ConfigureScsiLunPath($scsiLunPath)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            $result = !$this.ShouldConfigureScsiLunPath($scsiLunPath)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostScsiLunPath] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostScsiLunPath]::new()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            $this.PopulateResult($result, $scsiLunPath)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI device with the specified canonical name from the specified VMHost if it exists.\n    #>\n    [PSObject] GetScsiLun() {\n        try {\n            $scsiLun = Get-ScsiLun -Server $this.Connection -VmHost $this.VMHost -CanonicalName $this.ScsiLunCanonicalName -ErrorAction Stop -Verbose:$false\n            return $scsiLun\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunMessage -f $this.ScsiLunCanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI Lun path with the specified name to the specified SCSI device if it exists.\n    #>\n    [PSObject] GetScsiLunPath($scsiLun) {\n        try {\n            $scsiLunPath = Get-ScsiLunPath -Name $this.Name -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n            return $scsiLunPath\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunPathMessage -f $this.Name, $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the SCSI Lun path should be configured depending on the desired 'Active' and 'Preferred' values.\n    #>\n    [bool] ShouldConfigureScsiLunPath($scsiLunPath) {\n        $shouldConfigureScsiLunPath = @(\n            $this.ShouldUpdateDscResourceSetting('Preferred', $scsiLunPath.Preferred, $this.Preferred)\n        )\n\n        if ($null -ne $this.Active) {\n            $currentScsiLunPathState = $scsiLunPath.State.ToString()\n            if ($this.Active) {\n                $shouldConfigureScsiLunPath += ($currentScsiLunPathState -ne $this.ActiveScsiLunPathState)\n            }\n            else {\n                $shouldConfigureScsiLunPath += ($currentScsiLunPathState -eq $this.ActiveScsiLunPathState)\n            }\n        }\n\n        return ($shouldConfigureScsiLunPath -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Configures the SCSI Lun path with the specified name with the desired 'Active' and 'Preferred' values.\n    #>\n    [void] ConfigureScsiLunPath($scsiLunPath) {\n        $setScsiLunPathParams = @{\n            ScsiLunPath = $scsiLunPath\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Active) { $setScsiLunPathParams.Active = $this.Active }\n        if ($null -ne $this.Preferred) { $setScsiLunPathParams.Preferred = $this.Preferred }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ConfigureScsiLunPathMessage, @($scsiLunPath.Name, $scsiLunPath.ScsiLun.CanonicalName, $this.VMHost.Name))\n\n            Set-ScsiLunPath @setScsiLunPathParams\n        }\n        catch {\n            throw ($this.CouldNotConfigureScsiLunPathMessage -f $scsiLunPath.Name, $scsiLunPath.ScsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $scsiLunPath) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Name = $scsiLunPath.Name\n        $result.ScsiLunCanonicalName = $scsiLunPath.ScsiLun.CanonicalName\n        $result.Active = if ($scsiLunPath.State.ToString() -eq $this.ActiveScsiLunPathState) { $true } else { $false }\n        $result.Preferred = $scsiLunPath.Preferred\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostService.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostService : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The key value of the service.\n    #>\n    [DscProperty(Key)]\n    [string] $Key\n\n    <#\n    .DESCRIPTION\n\n    The state of the service after a VMHost reboot.\n    #>\n    [DscProperty()]\n    [ServicePolicy] $Policy = [ServicePolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    The current state of the service.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Running\n\n    <#\n    .DESCRIPTION\n\n    Host Service Label.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string] $Label\n\n    <#\n    .DESCRIPTION\n\n    Host Service Required flag.\n    #>\n    [DscProperty(NotConfigurable)]\n    [bool] $Required\n\n    <#\n    .DESCRIPTION\n\n    Firewall rules for the service.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string[]] $Ruleset\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostService($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateVMHostService($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostService] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostService]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostService should to be updated.\n    #>\n    [bool] ShouldUpdateVMHostService($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vmHostCurrentService = Get-VMHostService -Server $this.Connection -VMHost $vmHost | Where-Object { $_.Key -eq $this.Key }\n\n        $shouldUpdateVMHostService = @(\n            $this.ShouldUpdateDscResourceSetting('Policy', [string] $vmHostCurrentService.Policy, $this.Policy.ToString()),\n            $this.ShouldUpdateDscResourceSetting('Running', $vmHostCurrentService.Running, $this.Running)\n        )\n\n        return ($shouldUpdateVMHostService -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the VMHostService.\n    #>\n    [void] UpdateVMHostService($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vmHostCurrentService = Get-VMHostService -Server $this.Connection -VMHost $vmHost | Where-Object { $_.Key -eq $this.Key }\n\n        if ($this.ShouldUpdateDscResourceSetting('Policy', [string] $vmHostCurrentService.Policy, $this.Policy.ToString())) {\n            Set-VMHostService -HostService $vmHostCurrentService -Policy $this.Policy.ToString() -Confirm:$false\n        }\n\n        if ($this.ShouldUpdateDscResourceSetting('Running', $vmHostCurrentService.Running, $this.Running)) {\n            if ($vmHostCurrentService.Running) {\n                Stop-VMHostService -HostService $vmHostCurrentService -Confirm:$false\n            }\n            else {\n                Start-VMHostService -HostService $vmHostCurrentService -Confirm:$false\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMHostService from the server.\n    #>\n    [void] PopulateResult($vmHost, $vmHostService) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vmHostCurrentService = Get-VMHostService -Server $this.Connection -VMHost $vmHost | Where-Object { $_.Key -eq $this.Key }\n        $vmHostService.Name = $vmHost.Name\n        $vmHostService.Server = $this.Server\n        $vmHostService.Key = $vmHostCurrentService.Key\n        $vmHostService.Policy = $vmHostCurrentService.Policy\n        $vmHostService.Running = $vmHostCurrentService.Running\n        $vmHostService.Label = $vmHostCurrentService.Label\n        $vmHostService.Required = $vmHostCurrentService.Required\n        $vmHostService.Ruleset = $vmHostCurrentService.Ruleset\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostSettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Motd Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Motd\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Motd content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $MotdClear\n\n    <#\n    .DESCRIPTION\n\n    Issue Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Issue\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Issue content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $IssueClear\n\n    hidden [string] $IssueSettingName = \"Config.Etc.issue\"\n    hidden [string] $MotdSettingName = \"Config.Etc.motd\"\n\n    [void] Set() {\n    \ttry {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateVMHostSettings($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostSettings] Get() {\n    \ttry {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSettings]::new()\n            $result.Server = $this.Server\n\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if at least one Advanced Setting value should be updated.\n    #>\n    [bool] ShouldUpdateVMHostSettings($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \t$vmHostCurrentAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost\n\n    \t$currentMotd = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n        $currentIssue = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $motdDesiredValue = if ($this.MotdClear) { [string]::Empty } else { $this.Motd }\n        $issueDesiredValue = if ($this.IssueClear) { [string]::Empty } else { $this.Issue }\n\n    \t$shouldUpdateVMHostSettings = @(\n            $this.ShouldUpdateDscResourceSetting('Motd', $currentMotd.Value, $motdDesiredValue),\n            $this.ShouldUpdateDscResourceSetting('Issue', $currentIssue.Value, $issueDesiredValue)\n        )\n\n        return ($shouldUpdateVMHostSettings -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets the desired value for the Advanced Setting, if update of the Advanced Setting value is needed.\n    #>\n  \t[void] SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue, $clearValue) {\n    \t$this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \tif ($clearValue) {\n      \t    if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, [string]::Empty)) {\n                Set-AdvancedSetting -AdvancedSetting $advancedSetting -Value [string]::Empty -Confirm:$false\n      \t    }\n    \t}\n    \telse {\n      \t    if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, $advancedSettingDesiredValue)) {\n                Set-AdvancedSetting -AdvancedSetting $advancedSetting -Value $advancedSettingDesiredValue -Confirm:$false\n      \t    }\n    \t}\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs update on those Advanced Settings values that needs to be updated.\n    #>\n    [void] UpdateVMHostSettings($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \t$vmHostCurrentAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost\n\n    \t$currentMotd = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n    \t$currentIssue = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n    \t$this.SetAdvancedSetting('Motd', $currentMotd, $this.Motd, $currentMotd.Value, $this.MotdClear)\n        $this.SetAdvancedSetting('Issue', $currentIssue, $this.Issue, $currentIssue.Value, $this.IssueClear)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the advanced settings from the server.\n    #>\n    [void] PopulateResult($vmHost, $result) {\n    \t$this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \t$vmHostCurrentAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost\n\n    \t$currentMotd = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n    \t$currentIssue = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $result.Name = $vmHost.Name\n    \t$result.Motd = $currentMotd.Value\n        $result.Issue = $currentIssue.Value\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostStorage.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostStorage : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies whether the software iSCSI is enabled on the VMHost storage.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Enabled\n\n    hidden [string] $RetrieveVMHostStorageMessage = \"Retrieving VMHost storage for VMHost {0}.\"\n    hidden [string] $ConfigureVMHostStorageMessage = \"Configuring VMHost storage for VMHost {0}.\"\n\n    hidden [string] $CouldNotRetrieveVMHostStorageMessage = \"Could not retrieve VMHost storage for VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotConfigureVMHostStorageMessage = \"Could not configure VMHost storage for VMHost {0}. For more information: {1}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostStorage = $this.GetVMHostStorage($vmHost)\n            $this.ConfigureVMHostStorage($vmHostStorage)\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostStorage = $this.GetVMHostStorage($vmHost)\n\n            $result = !$this.ShouldConfigureVMHostStorage($vmHostStorage)\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostStorage] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n            $result = [VMHostStorage]::new()\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostStorage = $this.GetVMHostStorage($vmHost)\n\n            $this.PopulateResult($result, $vmHostStorage)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost storage for the specified VMHost.\n    #>\n    [PSObject] GetVMHostStorage($vmHost) {\n        $getVMHostStorageParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVMHostStorageMessage, @($vmHost.Name))\n            return Get-VMHostStorage @getVMHostStorageParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVMHostStorageMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost storage should be configured - whether to\n    enable or disable the software iSCSI support.\n    #>\n    [bool] ShouldConfigureVMHostStorage($vmHostStorage) {\n        return $this.ShouldUpdateDscResourceSetting('Enabled', $vmHostStorage.SoftwareIScsiEnabled, $this.Enabled)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Configures the VMHost storage - enables or disables the software iSCSI support.\n    #>\n    [void] ConfigureVMHostStorage($vmHostStorage) {\n        $setVMHostStorageParams = @{\n            VMHostStorage = $vmHostStorage\n            SoftwareIScsiEnabled = $this.Enabled\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ConfigureVMHostStorageMessage, @($vmHostStorage.VMHost.Name))\n            Set-VMHostStorage @setVMHostStorageParams\n        }\n        catch {\n            throw ($this.CouldNotConfigureVMHostStorageMessage -f $vmHostStorage.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostStorage) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHostStorage.VMHost.Name\n        $result.Enabled = $vmHostStorage.SoftwareIScsiEnabled\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostSyslog.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostSyslog : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The remote host(s) to send logs to.\n    #>\n    [DscProperty()]\n    [string] $Loghost\n\n    <#\n    .DESCRIPTION\n\n    Verify remote SSL certificates against the local CA Store.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $CheckSslCerts\n\n    <#\n    .DESCRIPTION\n\n    Default network retry timeout in seconds if a remote server fails to respond.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DefaultTimeout\n\n    <#\n    .DESCRIPTION\n\n    Message queue capacity after which messages are dropped.\n    #>\n    [DscProperty()]\n    [nullable[long]] $QueueDropMark\n\n    <#\n    .DESCRIPTION\n\n    The directory to output local logs to.\n    #>\n    [DscProperty()]\n    [string] $Logdir\n\n    <#\n    .DESCRIPTION\n\n    Place logs in a unique subdirectory of logdir, based on hostname.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $LogdirUnique\n\n    <#\n    .DESCRIPTION\n\n    Default number of rotated local logs to keep.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DefaultRotate\n\n    <#\n    .DESCRIPTION\n\n    Default size of local logs before rotation, in KiB.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DefaultSize\n\n    <#\n    .DESCRIPTION\n\n    Number of rotated dropped log files to keep.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DropLogRotate\n\n    <#\n    .DESCRIPTION\n\n    Size of dropped log file before rotation, in KiB.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DropLogSize\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostSyslog($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateVMHostSyslog($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostSyslog] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSyslog]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if VMHostSyslog needs to be updated.\n    #>\n    [bool] ShouldUpdateVMHostSyslog($VMHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $esxcli = Get-Esxcli -Server $this.Connection -VMHost $vmHost -V2\n        $current = Get-VMHostSyslogConfig -EsxCLi $esxcli\n\n        $shouldUpdateVMHostSyslog = @(\n            $this.ShouldUpdateDscResourceSetting('LogHost', [string] $current.RemoteHost, $this.LogHost),\n            $this.ShouldUpdateDscResourceSetting('CheckSslCerts', $current.EnforceSSLCertificates, $this.CheckSslCerts),\n            $this.ShouldUpdateDscResourceSetting('DefaultTimeout', $current.DefaultNetworkRetryTimeout, $this.DefaultTimeout),\n            $this.ShouldUpdateDscResourceSetting('QueueDropMark', $current.MessageQueueDropMark, $this.QueueDropMark),\n            $this.ShouldUpdateDscResourceSetting('Logdir', [string] $current.LocalLogOutput, $this.Logdir),\n            $this.ShouldUpdateDscResourceSetting('LogdirUnique', [System.Convert]::ToBoolean($current.LogToUniqueSubdirectory), $this.LogdirUnique),\n            $this.ShouldUpdateDscResourceSetting('DefaultRotate', $current.LocalLoggingDefaultRotations, $this.DefaultRotate),\n            $this.ShouldUpdateDscResourceSetting('DefaultSize', $current.LocalLoggingDefaultRotationSize, $this.DefaultSize),\n            $this.ShouldUpdateDscResourceSetting('DropLogRotate', $current.DroppedLogFileRotations, $this.DropLogRotate),\n            $this.ShouldUpdateDscResourceSetting('DropLogSize', $current.DroppedLogFileRotationSize, $this.DropLogSize)\n        )\n\n        return ($shouldUpdateVMHostSyslog -contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the VMHostSyslog.\n    #>\n    [void] UpdateVMHostSyslog($VMHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $esxcli = Get-Esxcli -Server $this.Connection -VMHost $vmHost -V2\n\n        $vmHostSyslogConfig = @{\n            queuedropmark = $this.QueueDropMark\n            defaultrotate = $this.DefaultRotate\n            droplogrotate = $this.DropLogRotate\n        }\n\n        if ($null -ne $this.CheckSslCerts) { $vmHostSyslogConfig.checksslcerts = $this.CheckSslCerts }\n        if ($null -ne $this.DefaultTimeout) { $vmHostSyslogConfig.defaulttimeout = $this.DefaultTimeout }\n        if (![string]::IsNullOrEmpty($this.Logdir)) { $vmHostSyslogConfig.logdir = $this.Logdir }\n        if ($null -ne $this.LogdirUnique) { $vmHostSyslogConfig.logdirunique = $this.LogdirUnique }\n        if ($null -ne $this.DefaultSize) { $vmHostSyslogConfig.defaultsize = $this.DefaultSize }\n        if ($null -ne $this.DropLogSize) { $vmHostSyslogConfig.droplogsize = $this.DropLogSize }\n        if (![string]::IsNullOrEmpty($this.LogHost)) { $vmHostSyslogConfig.loghost = $this.Loghost }\n\n        Set-VMHostSyslogConfig -EsxCli $esxcli -VMHostSyslogConfig $vmHostSyslogConfig\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMHostService from the server.\n    #>\n    [void] PopulateResult($VMHost, $syslog) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $esxcli = Get-Esxcli -Server $this.Connection -VMHost $vmHost -V2\n        $currentVMHostSyslog = Get-VMHostSyslogConfig -EsxCLi $esxcli\n\n        $syslog.Server = $this.Server\n        $syslog.Name = $VMHost.Name\n        $syslog.Loghost = $currentVMHostSyslog.RemoteHost\n        $syslog.CheckSslCerts = [System.Convert]::ToBoolean($currentVMHostSyslog.EnforceSSLCertificates)\n        $syslog.DefaultTimeout = [long] $currentVMHostSyslog.DefaultNetworkRetryTimeout\n        $syslog.QueueDropMark = [long] $currentVMHostSyslog.MessageQueueDropMark\n        $syslog.Logdir = $currentVMHostSyslog.LocalLogOutput\n        $syslog.LogdirUnique = [System.Convert]::ToBoolean($currentVMHostSyslog.LogToUniqueSubdirectory)\n        $syslog.DefaultRotate = [long] $currentVMHostSyslog.LocalLoggingDefaultRotations\n        $syslog.DefaultSize = [long] $currentVMHostSyslog.LocalLoggingDefaultRotationSize\n        $syslog.DropLogRotate = [long] $currentVMHostSyslog.DroppedLogFileRotations\n        $syslog.DropLogSize = [long] $currentVMHostSyslog.DroppedLogFileRotationSize\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/VMHostTpsSettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass VMHostTpsSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Share Scan Time Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareScanTime\n\n    <#\n    .DESCRIPTION\n\n    Share Scan GHz Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareScanGHz\n\n    <#\n    .DESCRIPTION\n\n    Share Rate Max Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareRateMax\n\n    <#\n    .DESCRIPTION\n\n    Share Force Salting Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareForceSalting\n\n    hidden [string] $TpsSettingsName = \"Mem.Sh*\"\n    hidden [string] $MemValue = \"Mem.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateTpsSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateTpsSettings($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostTpsSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostTpsSettings]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $result.Name = $vmHost.Name\n\n            $tpsSettings = $this.GetTpsAdvancedSettings($vmHost)\n\n            $vmHostTpsSettingsDscResourcePropertyNames = $this.GetType().GetProperties().Name\n            foreach ($tpsSetting in $tpsSettings) {\n                $tpsSettingName = $tpsSetting.Name.TrimStart($this.MemValue)\n                if ($vmHostTpsSettingsDscResourcePropertyNames -Contains $tpsSettingName) {\n                    $result.$tpsSettingName = $tpsSetting.Value\n                }\n            }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Tps advanced settings for the specified VMHost from the server.\n    #>\n    [PSObject] GetTpsAdvancedSettings($vmHost) {\n        $getAdvancedSettingParams = @{\n            Server = $this.Connection\n            Entity = $vmHost\n            Name = $this.TpsSettingsName\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        return Get-AdvancedSetting @getAdvancedSettingParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value, indicating if update operation should be performed on at least one of the TPS Settings.\n    #>\n    [bool] ShouldUpdateTpsSettings($vmHost) {\n        $tpsSettings = $this.GetTpsAdvancedSettings($vmHost)\n\n        foreach ($tpsSetting in $tpsSettings) {\n            $tpsSettingName = $tpsSetting.Name.TrimStart($this.MemValue)\n\n            if ($null -ne $this.$tpsSettingName -and $this.$tpsSettingName -ne $tpsSetting.Value) {\n                $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($tpsSettingName, $tpsSetting.Value, $this.$tpsSettingName))\n\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the needed TPS Settings with the specified values.\n    #>\n    [void] UpdateTpsSettings($vmHost) {\n        $tpsSettings = $this.GetTpsAdvancedSettings($vmHost)\n\n        foreach ($tpsSetting in $tpsSettings) {\n            $tpsSettingName = $tpsSetting.Name.TrimStart($this.MemValue)\n\n            if ($null -eq $this.$tpsSettingName -or $this.$tpsSettingName -eq $tpsSetting.Value) {\n                continue\n            }\n\n            $setAdvancedSettingParams = @{\n                AdvancedSetting = $tpsSetting\n                Value = $this.$tpsSettingName\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Set-AdvancedSetting @setAdvancedSettingParams\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/vCenterSettings.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.NOTES\nvCenterSettings inherits BasevSphereConnection instead of BaseDSC because it is a specific case where\nthe resource does not have it's own DSC key property. That's why were define a $Server property here in order to\nuse it as a key.\n#>\n[DscResource()]\nclass vCenterSettings : BasevSphereConnection {\n    <#\n    .DESCRIPTION\n\n    Name of the Server we are trying to connect to. The Server must be a vCenter.\n    #>\n    [DscProperty(Key)]\n    [string] $Server\n\n    <#\n    .DESCRIPTION\n\n    Logging Level Advanced Setting value.\n    #>\n    [DscProperty()]\n    [LoggingLevel] $LoggingLevel = [LoggingLevel]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Event Max Age Enabled Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $EventMaxAgeEnabled\n\n    <#\n    .DESCRIPTION\n\n    Event Max Age Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $EventMaxAge\n\n    <#\n    .DESCRIPTION\n\n    Task Max Age Enabled Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $TaskMaxAgeEnabled\n\n    <#\n    .DESCRIPTION\n\n    Task Max Age Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $TaskMaxAge\n\n    <#\n    .DESCRIPTION\n\n    Motd Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Motd\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Motd content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $MotdClear\n\n    <#\n    .DESCRIPTION\n\n    Issue Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Issue\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Issue content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $IssueClear\n\n    hidden [string] $LogLevelSettingName = \"log.level\"\n    hidden [string] $EventMaxAgeEnabledSettingName = \"event.maxAgeEnabled\"\n    hidden [string] $EventMaxAgeSettingName = \"event.maxAge\"\n    hidden [string] $TaskMaxAgeEnabledSettingName = \"task.maxAgeEnabled\"\n    hidden [string] $TaskMaxAgeSettingName = \"task.maxAge\"\n    hidden [string] $MotdSettingName = \"etc.motd\"\n    hidden [string] $IssueSettingName = \"etc.issue\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.UpdatevCenterSettings($this.Connection)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = !$this.ShouldUpdatevCenterSettings()\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [vCenterSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [vCenterSettings]::new()\n            $result.Server = $this.Server\n\n            $this.PopulateResult($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the advanced settings of the specified vCenter Server.\n    #>\n    [PSObject] GetvCenterAdvancedSettings() {\n        $getAdvancedSettingParams = @{\n            Server = $this.Connection\n            Entity = $this.Connection\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        return Get-AdvancedSetting @getAdvancedSettingParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if at least one Advanced Setting value should be updated.\n    #>\n    [bool] ShouldUpdatevCenterSettings() {\n        $vCenterCurrentAdvancedSettings = $this.GetvCenterAdvancedSettings()\n\n    \t$currentLogLevel = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.LogLevelSettingName }\n    \t$currentEventMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeEnabledSettingName }\n    \t$currentEventMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeSettingName }\n    \t$currentTaskMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeEnabledSettingName }\n    \t$currentTaskMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeSettingName }\n    \t$currentMotd = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n        $currentIssue = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $motdDesiredValue = if ($this.MotdClear) { [string]::Empty } else { $this.Motd }\n        $issueDesiredValue = if ($this.IssueClear) { [string]::Empty } else { $this.Issue }\n\n    \t$shouldUpdatevCenterSettings = @(\n            $this.ShouldUpdateDscResourceSetting('LoggingLevel', [string] $currentLogLevel.Value, $this.LoggingLevel.ToString()),\n            $this.ShouldUpdateDscResourceSetting('EventMaxAgeEnabled', $currentEventMaxAgeEnabled.Value, $this.EventMaxAgeEnabled),\n            $this.ShouldUpdateDscResourceSetting('EventMaxAge', $currentEventMaxAge.Value, $this.EventMaxAge),\n            $this.ShouldUpdateDscResourceSetting('TaskMaxAgeEnabled', $currentTaskMaxAgeEnabled.Value, $this.TaskMaxAgeEnabled),\n            $this.ShouldUpdateDscResourceSetting('TaskMaxAge', $currentTaskMaxAge.Value, $this.TaskMaxAge),\n            $this.ShouldUpdateDscResourceSetting('Motd', $currentMotd.Value, $motdDesiredValue),\n            $this.ShouldUpdateDscResourceSetting('Issue', $currentIssue.Value, $issueDesiredValue)\n        )\n\n    \treturn ($shouldUpdatevCenterSettings -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets the desired value for the Advanced Setting, if update of the Advanced Setting value is needed.\n    #>\n   [void] SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue) {\n        if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, $advancedSettingDesiredValue)) {\n            $setAdvancedSettingParams = @{\n                AdvancedSetting = $advancedSetting\n                Value = $advancedSettingDesiredValue\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Set-AdvancedSetting @setAdvancedSettingParams\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets the desired value for the Advanced Setting, if update of the Advanced Setting value is needed.\n    This handles Advanced Settings that have a \"Clear\" property.\n    #>\n\n    [void] SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue, $clearValue) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\" , @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \tif ($clearValue) {\n      \t    if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, [string]::Empty)) {\n                $setAdvancedSettingParams = @{\n                    AdvancedSetting = $advancedSetting\n                    Value = [string]::Empty\n                    Confirm = $false\n                    ErrorAction = 'Stop'\n                    Verbose = $false\n                }\n                Set-AdvancedSetting @setAdvancedSettingParams\n      \t    }\n    \t}\n    \telse {\n            $this.SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue)\n    \t}\n  \t}\n\n    <#\n    .DESCRIPTION\n\n    Performs update on those Advanced Settings values that needs to be updated.\n    #>\n    [void] UpdatevCenterSettings($vCenter) {\n        $vCenterCurrentAdvancedSettings = $this.GetvCenterAdvancedSettings()\n\n        $currentLogLevel = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.LogLevelSettingName }\n        $currentEventMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeEnabledSettingName }\n        $currentEventMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeSettingName }\n        $currentTaskMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeEnabledSettingName }\n        $currentTaskMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeSettingName }\n    \t$currentMotd = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n    \t$currentIssue = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $this.SetAdvancedSetting('LoggingLevel', $currentLogLevel, $this.LoggingLevel.ToString(), $currentLogLevel.Value)\n        $this.SetAdvancedSetting('EventMaxAgeEnabled', $currentEventMaxAgeEnabled, $this.EventMaxAgeEnabled, $currentEventMaxAgeEnabled.Value)\n        $this.SetAdvancedSetting('EventMaxAge', $currentEventMaxAge, $this.EventMaxAge, $currentEventMaxAge.Value)\n        $this.SetAdvancedSetting('TaskMaxAgeEnabled', $currentTaskMaxAgeEnabled, $this.TaskMaxAgeEnabled, $currentTaskMaxAgeEnabled.Value)\n        $this.SetAdvancedSetting('TaskMaxAge', $currentTaskMaxAge, $this.TaskMaxAge, $currentTaskMaxAge.Value)\n    \t$this.SetAdvancedSetting('Motd', $currentMotd, $this.Motd, $currentMotd.Value, $this.MotdClear)\n    \t$this.SetAdvancedSetting('Issue', $currentIssue, $this.Issue, $currentIssue.Value, $this.IssueClear)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the advanced settings from the server.\n    #>\n    [void] PopulateResult($result) {\n        $vCenterCurrentAdvancedSettings = $this.GetvCenterAdvancedSettings()\n\n        $currentLogLevel = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.LogLevelSettingName }\n        $currentEventMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeEnabledSettingName }\n        $currentEventMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeSettingName }\n        $currentTaskMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeEnabledSettingName }\n        $currentTaskMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeSettingName }\n        $currentMotd = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n        $currentIssue = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $result.LoggingLevel = $currentLogLevel.Value\n        $result.EventMaxAgeEnabled = $currentEventMaxAgeEnabled.Value\n        $result.EventMaxAge = $currentEventMaxAge.Value\n        $result.TaskMaxAgeEnabled = $currentTaskMaxAgeEnabled.Value\n        $result.TaskMaxAge = $currentTaskMaxAge.Value\n        $result.Motd = $currentMotd.Value\n        $result.Issue = $currentIssue.Value\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/vCenterStatistics.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass vCenterStatistics : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    The unit of period. Statistics can be stored separatelly for each of the {Day, Week, Month, Year} period units.\n    #>\n    [DscProperty(Key)]\n    [Period] $Period\n\n    <#\n    .DESCRIPTION\n\n    Period for which the statistics are saved.\n    #>\n    [DscProperty()]\n    [nullable[long]] $PeriodLength\n\n    <#\n    .DESCRIPTION\n\n    Specified Level value for the vCenter Statistics.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Level\n\n    <#\n    .DESCRIPTION\n\n    If collecting statistics for the specified period unit is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Interval in Minutes, indicating the period for collecting statistics.\n    #>\n    [DscProperty()]\n    [nullable[long]] $IntervalMinutes\n\n    hidden [int] $SecondsInAMinute = 60\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $performanceManager = $this.GetPerformanceManager()\n            $currentPerformanceInterval = $this.GetPerformanceInterval($performanceManager)\n\n            $this.UpdatePerformanceInterval($performanceManager, $currentPerformanceInterval)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $performanceManager = $this.GetPerformanceManager()\n            $currentPerformanceInterval = $this.GetPerformanceInterval($performanceManager)\n\n            $result = !((\n                $this.ShouldUpdateDscResourceSetting('Level', $currentPerformanceInterval.Level, $this.Level),\n                $this.ShouldUpdateDscResourceSetting('Enabled', $currentPerformanceInterval.Enabled, $this.Enabled),\n                $this.ShouldUpdateDscResourceSetting('IntervalMinutes', $currentPerformanceInterval.SamplingPeriod / $this.SecondsInAMinute, $this.IntervalMinutes),\n                $this.ShouldUpdateDscResourceSetting('PeriodLength', $currentPerformanceInterval.Length / $this.Period, $this.PeriodLength)\n            ) -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [vCenterStatistics] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [vCenterStatistics]::new()\n            $result.Server = $this.Server\n            $result.Period = $this.Period\n\n            $performanceManager = $this.GetPerformanceManager()\n            $currentPerformanceInterval = $this.GetPerformanceInterval($performanceManager)\n\n            $result.Level = $currentPerformanceInterval.Level\n            $result.Enabled = $currentPerformanceInterval.Enabled\n\n            # Converts the Sampling Period from seconds to minutes\n            $result.IntervalMinutes = $currentPerformanceInterval.SamplingPeriod / $this.SecondsInAMinute\n\n            # Converts the PeriodLength from seconds to the specified Period type\n            $result.PeriodLength = $currentPerformanceInterval.Length / $this.Period\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Performance Manager for the specified vCenter.\n    #>\n    [PSObject] GetPerformanceManager() {\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $this.Connection.ExtensionData.Content.PerfManager\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        return Get-View @getViewParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Performance Interval for which the new statistics settings should be applied.\n    #>\n    [PSObject] GetPerformanceInterval($performanceManager) {\n        $currentPerformanceInterval = $performanceManager.HistoricalInterval | Where-Object { $_.Name -Match $this.Period }\n\n        return $currentPerformanceInterval\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the value to set for the Performance Interval Setting.\n    #>\n    [PSObject] SpecifiedOrCurrentValue($desiredValue, $currentValue) {\n        if ($null -eq $desiredValue) {\n            # Desired value is not specified\n            return $currentValue\n        }\n        else {\n            return $desiredValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Performance Interval with the specified settings for vCenter Statistics.\n    #>\n    [void] UpdatePerformanceInterval($performanceManager, $currentPerformanceInterval) {\n        $performanceIntervalArgs = @{\n            Key = $currentPerformanceInterval.Key\n            Name = $currentPerformanceInterval.Name\n            Enabled = $this.SpecifiedOrCurrentValue($this.Enabled, $currentPerformanceInterval.Enabled)\n            Level = $this.SpecifiedOrCurrentValue($this.Level, $currentPerformanceInterval.Level)\n            SamplingPeriod = $this.SpecifiedOrCurrentValue($this.IntervalMinutes * $this.SecondsInAMinute, $currentPerformanceInterval.SamplingPeriod)\n            Length = $this.SpecifiedOrCurrentValue($this.PeriodLength * $this.Period, $currentPerformanceInterval.Length)\n        }\n\n        $desiredPerformanceInterval = New-PerformanceInterval @performanceIntervalArgs\n\n        try {\n            Update-PerfInterval -PerformanceManager $performanceManager -PerformanceInterval $desiredPerformanceInterval\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/DSCResources/vCenterVMHost.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n[DscResource()]\nclass vCenterVMHost : DatacenterInventoryBaseDSC {\n    vCenterVMHost() {\n        $this.InventoryItemFolderType = [FolderType]::Host\n    }\n\n    <#\n    .DESCRIPTION\n\n    Credentials needed for authenticating with the VMHost.\n    #>\n    [DscProperty(Mandatory)]\n    [PSCredential] $VMHostCredential\n\n    <#\n    .DESCRIPTION\n\n    Specifies the port on the VMHost used for the connection.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Port\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the VMHost is added to the vCenter if the authenticity of the VMHost SSL certificate cannot be verified.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Resource Pool in the Cluster. Location consists of 0 or more Resource Pools. The Root Resource Pool of the Cluster is not part of the location.\n    If '/' location is passed, the Resource Pool is the Root Resource Pool of the Cluster. Resource Pools names in the location are separated by '/'.\n    The VMHost's Root Resource Pool becomes the last Resource Pool specified in the location and the VMHost Resource Pool hierarchy is imported into the new nested Resource Pool.\n    Example location for a Resource Pool: 'MyResourcePoolOne/MyResourcePoolTwo'.\n    #>\n    [DscProperty()]\n    [string] $ResourcePoolLocation\n\n    hidden [string] $ClusterType = 'VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster'\n\n    hidden [string] $AddVMHostTovCenterMessage = \"Adding VMHost {0} to vCenter {1} and location {2}.\"\n    hidden [string] $MoveVMHostToDestinationMessage = \"Moving VMHost {0} to location {1} on vCenter {2}.\"\n    hidden [string] $RemoveVMHostFromvCenterMessage = \"Removing VMHost {0} from vCenter {1}.\"\n\n    hidden [string] $FoundLocationIsNotAClusterMessage = \"Resource Pool location {0} is specified but the found location {1} for VMHost {2} is not a Cluster.\"\n    hidden [string] $CouldNotRetrieveRootResourcePoolOfClusterMessage = \"Could not retrieve Root Resource Pool of Cluster {0}. For more information: {1}\"\n    hidden [string] $InvalidResourcePoolLocationInClusterMessage = \"Resource Pool location {0} is not valid in Cluster {2}.\"\n    hidden [string] $CouldNotAddVMHostTovCenterMessage = \"Could not add VMHost {0} to vCenter {1} and location {2}. For more information: {3}\"\n    hidden [string] $CouldNotMoveVMHostToDestinationMessage = \"Could not move VMHost {0} to location {1} on vCenter {2}. For more information: {3}\"\n    hidden [string] $CouldNotRemoveVMHostFromvCenterMessage = \"Could not remove VMHost {0} from vCenter {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $datacenter = $this.GetDatacenter()\n                $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n                $vmHostLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n                if (![string]::IsNullOrEmpty($this.ResourcePoolLocation)) {\n                    <#\n                    If the Resource Pool location is specified it means that the desired VMHost location should be a Cluster and the Resource Pool needs to be passed to the cmdlets\n                    as VMHost location instead of the Cluster.\n                    #>\n                    if (!$this.IsVIObjectOfTheCorrectType($vmHostLocation, $this.ClusterType)) {\n                        throw ($this.FoundLocationIsNotAClusterMessage -f $this.ResourcePoolLocation, $vmHostLocation.Name, $this.Name)\n                    }\n                    $rootResourcePool = $this.GetRootResourcePoolOfCluster($vmHostLocation)\n                    $vmHostLocation = $this.GetClusterResourcePool($rootResourcePool, $vmHostLocation.Name)\n                }\n\n                if ($null -eq $vmHost) {\n                    $this.AddVMHost($vmHostLocation)\n                }\n                else {\n                    if ($vmHost.ParentId -ne $vmHostLocation.Id) {\n                        $this.MoveVMHost($vmHost, $vmHostLocation)\n                    }\n                }\n            }\n            else {\n                if ($null -ne $vmHost) {\n                    $this.RemoveVMHost($vmHost)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHost) {\n                    $result = $false\n                }\n                else {\n                    $datacenter = $this.GetDatacenter()\n                    $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n                    $vmHostLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n                    $result = ($vmHost.ParentId -eq $vmHostLocation.Id)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHost)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [vCenterVMHost] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [vCenterVMHost]::new()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost with the specified name if it is on the vCenter Server system.\n    #>\n    [PSObject] GetVMHost() {\n        return Get-VMHost -Server $this.Connection -Name $this.Name -ErrorAction SilentlyContinue -Verbose:$false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Root Resource Pool of the specified Cluster.\n    #>\n    [PSObject] GetRootResourcePoolOfCluster($cluster) {\n        try {\n            $rootResourcePool = Get-ResourcePool -Server $this.Connection -Location $cluster -ErrorAction Stop -Verbose:$false |\n                                Where-Object -FilterScript { $_.ParentId -eq $cluster.Id }\n            return $rootResourcePool\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRootResourcePoolOfClusterMessage -f $cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Resource Pool with the specified name from the specified Cluster.\n    #>\n    [PSObject] GetClusterResourcePool($rootResourcePool, $clusterName) {\n        $clusterResourcePool = $null\n\n        if ($this.ResourcePoolLocation -eq '/') {\n            # Special case where the Resource Pool location does not contain any Resource Pools. So the Root Resource Pool is the searched Resource Pool from the Cluster.\n            $clusterResourcePool = $rootResourcePool\n        }\n        elseif ($this.ResourcePoolLocation -NotMatch '/') {\n            # Special case where the Resource Pool location is just one Resource Pool.\n            $clusterResourcePool = Get-Inventory -Server $this.Connection -Name $this.ResourcePoolLocation -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false |\n                                           Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n        }\n        else {\n            $resourcePoolLocationItems = $this.ResourcePoolLocation -Split '/'\n\n            # Reverse the Resource Pool location items so that we can start from the bottom and go to the Root Resource Pool.\n            [array]::Reverse($resourcePoolLocationItems)\n\n            $resourcePoolName = $resourcePoolLocationItems[0]\n            $foundResourcePools = Get-Inventory -Server $this.Connection -Name $resourcePoolName -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false\n\n            # Remove the name of the Resource Pool from the Resource Pool location items array as we already retrieved it.\n            $resourcePoolLocationItems = $resourcePoolLocationItems[1..($resourcePoolLocationItems.Length - 1)]\n\n            <#\n            For every found Resource Pool in the Cluster with the specified name we start to go up through the parents to check if the Resource Pool location is valid.\n            If one of the Parents does not meet the criteria of the Resource Pool location, we continue with the next found Resource Pool.\n            If we find a valid Resource Pool location we stop iterating through the Resource Pools and mark it as the searched Resource Pool from the Cluster.\n            #>\n            foreach ($foundResourcePool in $foundResourcePools) {\n                $foundResourcePoolAsViewObject = Get-View -Server $this.Connection -Id $foundResourcePool.Id -Property Parent -Verbose:$false\n                $validResourcePoolLocation = $true\n\n                foreach ($resourcePoolLocationItem in $resourcePoolLocationItems) {\n                    $foundResourcePoolAsViewObject = Get-View -Server $this.Connection -Id $foundResourcePoolAsViewObject.Parent -Property Name, Parent -Verbose:$false\n                    if ($foundResourcePoolAsViewObject.Name -ne $resourcePoolLocationItem) {\n                        $validResourcePoolLocation = $false\n                        break\n                    }\n                }\n\n                if ($validResourcePoolLocation) {\n                    $clusterResourcePool = $foundResourcePool\n                    break\n                }\n            }\n        }\n\n        if ($null -eq $clusterResourcePool) {\n            throw ($this.InvalidResourcePoolLocationInClusterMessage -f $this.ResourcePoolLocation, $clusterName)\n        }\n\n        return $clusterResourcePool\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the VMHost to the specified location and to be managed by the vCenter Server system.\n    #>\n    [void] AddVMHost($vmHostLocation) {\n        $addVMHostParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Location = $vmHostLocation\n            Credential = $this.VMHostCredential\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Port) { $addVMHostParams.Port = $this.Port }\n        if ($null -ne $this.Force) { $addVMHostParams.Force = $this.Force }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddVMHostTovCenterMessage, @($this.Name, $this.Connection.Name, $vmHostLocation.Name))\n\n            Add-VMHost @addVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotAddVMHostTovCenterMessage -f $this.Name, $this.Connection.Name, $vmHostLocation.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Moves the VMHost to the specified location on the vCenter Server system.\n    #>\n    [void] MoveVMHost($vmHost, $vmHostLocation) {\n        $moveVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Destination = $vmHostLocation\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.MoveVMHostToDestinationMessage, @($vmHost.Name, $vmHostLocation.Name, $this.Connection.Name))\n\n            Move-VMHost @moveVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotMoveVMHostToDestinationMessage -f $vmHost.Name, $vmHostLocation.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMHost from the vCenter Server system.\n    #>\n    [void] RemoveVMHost($vmHost) {\n        $removeVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveVMHostFromvCenterMessage, @($vmHost.Name, $this.Connection.Name))\n\n            Remove-VMHost @removeVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveVMHostFromvCenterMessage -f $vmHost.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Location = $this.Location\n        $result.DatacenterName = $this.DatacenterName\n        $result.DatacenterLocation = $this.DatacenterLocation\n        $result.Force = $this.Force\n        $result.ResourcePoolLocation = $this.ResourcePoolLocation\n\n        if ($null -ne $vmHost) {\n            $result.Name = $vmHost.Name\n            $result.Ensure = [Ensure]::Present\n            $result.Port = $vmHost.ExtensionData.Summary.Config.Port\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.Port = $this.Port\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/AcceptanceLevel.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum AcceptanceLevel {\n    VMwareCertified\n    VMwareAccepted\n    PartnerSupported\n    CommunitySupported\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/ChapType.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum ChapType {\n    Prohibited\n    Discouraged\n    Preferred\n    Required\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Cluster/DrsAutomationLevel.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum DrsAutomationLevel {\n    FullyAutomated\n    Manual\n    PartiallyAutomated\n    Disabled\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Cluster/HAIsolationResponse.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum HAIsolationResponse {\n    PowerOff\n    DoNothing\n    Shutdown\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Cluster/HARestartPriority.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum HARestartPriority {\n    Disabled\n    Low\n    Medium\n    High\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/DRSRuleType.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum DRSRuleType {\n    VMAffinity\n    VMAntiAffinity\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Datastore/AccessMode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum AccessMode {\n    ReadWrite\n    ReadOnly\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Datastore/AuthenticationMethod.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum AuthenticationMethod {\n    AUTH_SYS\n    Kerberos\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/DomainAction.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum DomainAction {\n    Join\n    Leave\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Duplex.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum Duplex {\n    Full\n    Half\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Ensure.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum Ensure {\n    Absent\n    Present\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/EntityType.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum EntityType {\n    Folder\n    Datacenter\n    Cluster\n    Datastore\n    DatastoreCluster\n    VMHost\n    ResourcePool\n    VApp\n    VM\n    Template\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/FolderType.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum FolderType {\n    Network\n    Datastore\n    Vm\n    Host\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/GraphicsType.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum GraphicsType {\n    Shared\n    SharedDirect\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/IScsiHbaTargetType.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum IScsiHbaTargetType {\n    Static\n    Send\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/LinkDiscovertProtocolOperation.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum LinkDiscoveryProtocolOperation {\n    Advertise\n    Both\n    Listen\n    None\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/LinkDiscoveryProtocolProtocol.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum LinkDiscoveryProtocolProtocol {\n    CDP\n    LLDP\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/LoadBalancingPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum LoadBalancingPolicy {\n    LoadBalanceIP\n    LoadBalanceSrcMac\n    LoadBalanceSrcId\n    ExplicitFailover\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/LoggingLevel.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum LoggingLevel {\n    Unset\n    None\n    Error\n    Warning\n    Info\n    Verbose\n    Trivia\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/MultipathPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum MultipathPolicy {\n    Fixed\n    MostRecentlyUsed\n    RoundRobin\n    Unknown\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/NetworkFailoverDetectionPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum NetworkFailoverDetectionPolicy {\n    LinkStatus\n    BeaconProbing\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/Period.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum Period {\n    Day = 86400\n    Week = 604800\n    Month = 2629800\n    Year = 31556926\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/PortBinding.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum PortBinding {\n    Static\n    Dynamic\n    Ephemeral\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/PowerCLISettings/BadCertificateAction.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum BadCertificateAction {\n    Ignore\n    Warn\n    Prompt\n    Fail\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/PowerCLISettings/DefaultVIServerMode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum DefaultVIServerMode {\n    Single\n    Multiple\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/PowerCLISettings/PowerCLISettingsScope.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum PowerCLISettingsScope {\n    LCM\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/PowerCLISettings/ProxyPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum ProxyPolicy {\n    NoProxy\n    UseSystemProxy\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/PowerPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum PowerPolicy {\n    HighPerformance = 1\n    Balanced = 2\n    LowPower = 3\n    Custom = 4\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/ServicePolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum ServicePolicy {\n    Unset\n    On\n    Off\n    Automatic\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/SharedPassthruAssignmentPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum SharedPassthruAssignmentPolicy {\n    Performance\n    Consolidation\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/VMHostState.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum VMHostState {\n    Connected\n    Disconnected\n    Maintenance\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/VMHostVss/NicTeamingPolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum NicTeamingPolicy {\n    Loadbalance_ip\n    Loadbalance_srcmac\n    Loadbalance_srcid\n    Failover_explicit\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/VMSwapfilePolicy.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum VMSwapfilePolicy {\n    InHostDatastore\n    WithVM\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Enums/VsanDataMigrationMode.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nenum VsanDataMigrationMode {\n    Full\n    EnsureAccessibility\n    NoDataMigration\n    Unset\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/ExportVMHostConfiguration.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nusing module VMware.vSphereDSC\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNull()]\n    [System.Management.Automation.PSCredential]\n    $Credential,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $OutputPath,\n\n    [Parameter()]\n    [string[]]\n    $VMHostDscResourcesToExport\n)\n\n$script:viServer = $null\n$script:vmHost = $null\n$script:scsiLuns = $null\n$script:iScsiHbas = $null\n\n$script:availableVSphereDscResources = $null\n$script:vSphereDscResourcesPropertiesToExclude = $null\n$script:vmHostConfigurationName = \"VMHost_Config\"\n$script:vmHostConfigurationFileName = $script:vmHostConfigurationName + '_' + (Get-Date -Format 'yyyy-MM-dd') + '.ps1'\n$script:vmHostDscConfigContent = New-Object -TypeName 'System.Text.StringBuilder'\n\n<#\n.DESCRIPTION\n\nImports the required modules that are needed for extracting the DSC Configuration of the specified VMHost.\n#>\nfunction Import-RequiredModules {\n    <#\n        The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n        when importing the 'VMware.VimAutomation.Core' Module.\n    #>\n    $savedVerbosePreference = $global:VerbosePreference\n    $global:VerbosePreference = 'SilentlyContinue'\n\n    Import-Module -Name VMware.VimAutomation.Core\n\n    $global:VerbosePreference = $savedVerbosePreference\n}\n\n<#\n.DESCRIPTION\n\nConnects to the specified vSphere Server with the passed Credentials.\n#>\nfunction Connect-VSphereServer {\n    try {\n        Write-Host \"Connecting to vSphere Server $Server...\" -BackgroundColor DarkGreen -ForegroundColor White\n        Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n    }\n    catch {\n        throw \"Cannot establish connection to vSphere Server $Server. For more information: $($_.Exception.Message)\"\n    }\n}\n\n<#\n.DESCRIPTION\n\nRetrieves the VMHost with the specified name from the specified vSphere Server.\n#>\nfunction Get-VSphereVMHost {\n    try {\n        Write-Host \"Retrieving VMHost $VMHostName from vSphere Server $($script:viServer.Name)...\" -BackgroundColor DarkGreen -ForegroundColor White\n        Get-VMHost -Server $script:viServer -Name $VMHostName -ErrorAction Stop -Verbose:$false\n    }\n    catch {\n        throw \"Could not retrieve VMHost $VMHostName from vSphere Server $($script:viServer.Name). For more information: $($_.Exception.Message)\"\n    }\n}\n\n<#\n.DESCRIPTION\n\nRetrieves all SCSI devices that are available on the specified VMHost.\n#>\nfunction Get-ScsiDevices {\n    if ($null -eq $script:scsiLuns) {\n        try {\n            $script:scsiLuns = Get-ScsiLun -Server $script:viServer -VmHost $script:vmHost -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw \"Could not retrieve SCSI devices from VMHost $VMHostName on vSphere Server $($script:viServer.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nRetrieves all iSCSI Host Bus Adapters that are available on the specified VMHost.\n#>\nfunction Get-IScsiHostBusAdapters {\n    if ($null -eq $script:iScsiHbas) {\n        try {\n            $script:iScsiHbas = Get-VMHostHba -Server $script:viServer -VMHost $script:vmHost -Type 'iSCSI' -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw \"Could not retrieve iSCSI Host Bus Adapters from VMHost $VMHostName on vSphere Server $($script:viServer.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nCloses the last open connection to the specified vSphere Server.\n#>\nfunction Disconnect-VSphereServer {\n    try {\n        Write-Host \"Closing connection to vSphere Server $($script:viServer.Name)...\" -BackgroundColor DarkGreen -ForegroundColor White\n        Disconnect-VIServer -Server $script:viServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n    }\n    catch {\n        throw \"Cannot close connection to vSphere Server $($script:viServer.Name). For more information: $($_.Exception.Message)\"\n    }\n}\n\n<#\n.DESCRIPTION\n\nSets the parameters for the VMHost DSC Configuration - Server, Credential and VMHostNames.\n#>\nfunction Set-ConfigurationParameters {\n    [void] $script:vmHostDscConfigContent.Append(\"Param(`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [Parameter(Mandatory = `$true)]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [ValidateNotNullOrEmpty()]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [string]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    `$Server,`r`n`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [Parameter(Mandatory = `$true)]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [ValidateNotNull()]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [System.Management.Automation.PSCredential]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    `$Credential,`r`n`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [Parameter(Mandatory = `$true)]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [ValidateNotNullOrEmpty()]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    [string[]]`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    `$VMHostNames`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\")`r`n`r`n\")\n}\n\n<#\n.DESCRIPTION\n\nSets the DSC Configuration Data for the VMHost DSC Configuration.\n#>\nfunction Set-ConfigurationData {\n    [void] $script:vmHostDscConfigContent.Append(\"`$script:configurationData = @{`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    AllNodes = @(`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"        @{`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"            NodeName = 'localhost'`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"            PSDscAllowPlainTextPassword = `$true`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"            Server = `$Server`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"            Credential = `$Credential`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"            VMHostNames = `$VMHostNames`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"        }`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    )`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"}`r`n`r`n\")\n}\n\n<#\n.DESCRIPTION\nGets the list of the properties for the specified VMHost DSC Resource that are going to be populated in the VMHost DSC Configuration.\nThe common properties for all VMHost DSC Resources - Server and Credential as well as one of VMHostName and Name (depending on the base class of the DSC Resource) are not\npart of the returned list of properties because they are populated automatically.\n\n.PARAMETER VMHostDscResource\nThe VMHost DSC Resource which properties are going to be retrieved.\n#>\nfunction Get-VMHostDscResourceProperties {\n    [CmdletBinding()]\n    [OutputType([array])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [object]\n        $VMHostDscResource\n    )\n\n    $vmHostDscResourcePropertiesToExclude = $script:vSphereDscResourcesPropertiesToExclude\n\n    # VMHostRole DSC Resource does not have a property for VMHost.\n    if ($VMHostDscResource.Name -ne 'VMHostRole') {\n        if ($VMHostDscResource.Properties.Name -Contains 'VMHostName') {\n            $vmHostDscResourcePropertiesToExclude += 'VMHostName'\n            [void] $script:vmHostDscConfigContent.Append(\"                VMHostName = `$vmHostName`r`n\")\n        }\n        elseif ($VMHostDscResource.Properties.Name -Contains 'Name') {\n            $vmHostDscResourcePropertiesToExclude += 'Name'\n            [void] $script:vmHostDscConfigContent.Append(\"                Name = `$vmHostName`r`n\")\n        }\n    }\n\n    $VMHostDscResource.Properties | Where-Object -FilterScript { $vmHostDscResourcePropertiesToExclude -NotContains $_.Name }\n}\n\n<#\n.DESCRIPTION\nPushes the specified string property to the VMHost DSC Resource block with the following syntax: <propertyName> = '<propertyValue>'.\n\n.PARAMETER PropertyName\nThe name of the string property that is going to be pushed to the VMHost DSC Resource block.\n\n.PARAMETER PropertyValue\nThe value of the string property that is going to be pushed to the VMHost DSC Resource block.\n#>\nfunction Push-StringPropertyToVMHostDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $PropertyName,\n\n        [Parameter()]\n        [string]\n        $PropertyValue\n    )\n\n    [void] $script:vmHostDscConfigContent.Append(\"                $propertyName = '$propertyValue'`r`n\")\n}\n\n<#\n.DESCRIPTION\nPushes the specified bool property to the VMHost DSC Resource block with the following syntax: <propertyName> = $<propertyValue>.\nThe property is pushed only when its value is not $null.\n\n.PARAMETER PropertyName\nThe name of the bool property that is going to be pushed to the VMHost DSC Resource block.\n\n.PARAMETER PropertyValue\nThe value of the bool property that is going to be pushed to the VMHost DSC Resource block.\n#>\nfunction Push-BoolPropertyToVMHostDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $PropertyName,\n\n        [Parameter()]\n        [nullable[bool]]\n        $PropertyValue\n    )\n\n    if ($null -ne $PropertyValue) {\n        [void] $script:vmHostDscConfigContent.Append(\"                $PropertyName = `$$($PropertyValue.ToString().ToLower())`r`n\")\n    }\n}\n\n<#\n.DESCRIPTION\nPushes the specified string array property to the VMHost DSC Resource block with the following syntax: <propertyName> = @('<arrayValue1>', '<arrayValue2>').\nIf the property is $null, empty array is pushed: @().\n\n.PARAMETER PropertyName\nThe name of the string array property that is going to be pushed to the VMHost DSC Resource block.\n\n.PARAMETER PropertyValue\nThe value of the string array property that is going to be pushed to the VMHost DSC Resource block.\n#>\nfunction Push-StringArrayPropertyToVMHostDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $PropertyName,\n\n        [Parameter()]\n        [string[]]\n        $PropertyValue\n    )\n\n    if ($null -eq $PropertyValue) {\n        [void] $script:vmHostDscConfigContent.Append(\"                $PropertyName = @()`r`n\")\n    }\n    else {\n        $arrayProperty = '@('\n        for ($i = 0; $i -lt $PropertyValue.Length; $i++) {\n            if ($i -eq $PropertyValue.Length - 1) {\n                $arrayProperty += \"'$($PropertyValue[$i])'\"\n            }\n            else {\n                $arrayProperty += \"'$($PropertyValue[$i])', \"\n            }\n        }\n        $arrayProperty += ')'\n\n        [void] $script:vmHostDscConfigContent.Append(\"                $PropertyName = $arrayProperty`r`n\")\n    }\n}\n\n<#\n.DESCRIPTION\nPushes the specified value type property to the VMHost DSC Resource block with the following syntax: <propertyName> = <propertyValue>.\nThe property is pushed only when its value is not $null.\n\n.PARAMETER PropertyName\nThe name of the value type property that is going to be pushed to the VMHost DSC Resource block.\n\n.PARAMETER PropertyValue\nThe value of the value type property that is going to be pushed to the VMHost DSC Resource block.\n#>\nfunction Push-ValueTypePropertyToVMHostDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $PropertyName,\n\n        [Parameter()]\n        [System.ValueType]\n        $PropertyValue\n    )\n\n    if ($null -ne $PropertyValue) {\n        [void] $script:vmHostDscConfigContent.Append(\"                $PropertyName = $PropertyValue`r`n\")\n    }\n}\n\n<#\n.DESCRIPTION\nPushes the specified hashtable property to the VMHost DSC Resource block with the following syntax: <propertyName> = @{ <key1> = '<value1>', <key2> = '<value2>' }.\nIf the property is $null, empty hashtable is pushed: @{}.\n\n.PARAMETER PropertyName\nThe name of the hashtable property that is going to be pushed to the VMHost DSC Resource block.\n\n.PARAMETER PropertyValue\nThe value of the hashtable property that is going to be pushed to the VMHost DSC Resource block.\n#>\nfunction Push-HashtablePropertyToVMHostDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $PropertyName,\n\n        [Parameter()]\n        [hashtable]\n        $PropertyValue\n    )\n\n    if ($null -eq $PropertyValue) {\n        [void] $script:vmHostDscConfigContent.Append(\"                $PropertyName = @{}`r`n\")\n    }\n    else {\n        $hashtableProperty = \"@{`r`n\"\n        foreach ($key in $PropertyValue.Keys) {\n            if ($null -eq $PropertyValue.$key) { $hashtableProperty += \"                    '$key' = `$null`r`n\" }\n            else { $hashtableProperty += \"                    '$key' = '$($PropertyValue.$key)'`r`n\" }\n        }\n        $hashtableProperty += '                }'\n\n        [void] $script:vmHostDscConfigContent.Append(\"                $PropertyName = $hashtableProperty`r`n\")\n    }\n}\n\n<#\n.DESCRIPTION\nAdds a new DSC Resource block in the VMHost DSC Configuration for the specified DSC Resource with the information retrieved from the Get() method of the DSC Resource.\n\n.PARAMETER VMHostDscResourceName\nThe name of the DSC Resource that is going to be added to the VMHost DSC Configuration as a DSC Resource block.\n\n.PARAMETER VMHostDscResourceInstanceName\nThe name of the instance of the DSC Resource with the specified name that is going to be added to the VMHost DSC Configuration as a DSC Resource block.\n\n.PARAMETER VMHostDscGetMethodResult\nThe result of the Get() method of the specified DSC Resource that is going to be added to the VMHost DSC Configuration as a DSC Resource block.\n#>\nfunction New-VMHostDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostDscResourceName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostDscResourceInstanceName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [object]\n        $VMHostDscGetMethodResult\n    )\n\n    [void] $script:vmHostDscConfigContent.Append(\"            $VMHostDscResourceName '$VMHostDscResourceInstanceName' {`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"                Server = `$AllNodes.Server`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"                Credential = `$AllNodes.Credential`r`n\")\n\n    $vmHostDscResource = $script:availableVSphereDscResources | Where-Object -FilterScript { $_.Name -eq $VMHostDscResourceName }\n    $vmHostDscResourceProperties = Get-VMHostDscResourceProperties -VMHostDscResource $vmHostDscResource\n\n    foreach ($vmHostDscResourceProperty in $vmHostDscResourceProperties) {\n        $propertyName = $vmHostDscResourceProperty.Name\n        $propertyValue = $VMHostDscGetMethodResult.$propertyName\n\n        if ($vmHostDscResourceProperty.PropertyType -eq '[string]') { Push-StringPropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue }\n        elseif ($vmHostDscResourceProperty.PropertyType -eq '[bool]') { Push-BoolPropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue }\n        elseif ($vmHostDscResourceProperty.PropertyType -eq '[string[]]') { Push-StringArrayPropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue }\n        elseif ($vmHostDscResourceProperty.PropertyType -eq '[Int32]' -or $vmHostDscResourceProperty.PropertyType -eq '[Int64]' -or $vmHostDscResourceProperty.PropertyType -eq '[double]') {\n            Push-ValueTypePropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue\n        }\n        elseif ($vmHostDscResourceProperty.PropertyType -eq '[Nullable`1]') {\n            if ($propertyValue -is [bool]) { Push-BoolPropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue }\n            else { Push-ValueTypePropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue }\n        }\n        elseif ($vmHostDscResourceProperty.PropertyType -eq '[HashTable]') { Push-HashtablePropertyToVMHostDscResourceBlock -PropertyName $propertyName -PropertyValue $propertyValue }\n    }\n\n    <#\n        Depending on the type of DependsOn in the Get method result, the dependencies are\n        appended to the configuration content differently: for array of dependencies, each dependency in\n        the array is appended with quotes. Otherwise the single dependency is appended with quotes.\n    #>\n    if ($null -ne $VMHostDscGetMethodResult.DependsOn) {\n        if ($VMHostDscGetMethodResult.DependsOn -is [array]) {\n            [void] $script:vmHostDscConfigContent.Append(\"                DependsOn = @(\")\n            for ($i = 0; $i -lt $VMHostDscGetMethodResult.DependsOn.Length; $i++) {\n                if ($i -eq $VMHostDscGetMethodResult.DependsOn.Length - 1) {\n                    [void] $script:vmHostDscConfigContent.Append(\"'$($VMHostDscGetMethodResult.DependsOn[$i])'\")\n                }\n                else {\n                    [void] $script:vmHostDscConfigContent.Append(\"'$($VMHostDscGetMethodResult.DependsOn[$i])', \")\n                }\n            }\n            [void] $script:vmHostDscConfigContent.Append(\")`r`n\")\n        }\n        else {\n            [void] $script:vmHostDscConfigContent.Append(\"                DependsOn = '$($VMHostDscGetMethodResult.DependsOn)'`r`n\")\n        }\n    }\n\n    [void] $script:vmHostDscConfigContent.Append(\"            }`r`n`r`n\")\n}\n\n<#\n.SYNOPSIS\nChecks if the specified VMHost DSC Resource should be exported.\n\n.DESCRIPTION\nChecks if the specified VMHost DSC Resource should be exported. If the VMHost DSC Resource is specified\nin the VMHostDscResourcesToExport array or the array is not passed, the VMHost DSC Resource will be exported.\nOtherwise the VMHost DSC Resource will not be exported.\n\n.PARAMETER VMHostDscResourceName\nThe name of the VMHost DSC Resource that will be checked whether to be exported.\n#>\nfunction Test-ExportVMHostDscResource {\n    [CmdletBinding()]\n    [OutputType([bool])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostDscResourceName\n    )\n\n    $result = $false\n    if ($VMHostDscResourcesToExport.Count -eq 0 -or $VMHostDscResourcesToExport -Contains $VMHostDscResourceName) {\n        $result = $true\n    }\n\n    $result\n}\n\n<#\n.SYNOPSIS\nReads the information about the specified DSC Resource and exposes it in the VMHost DSC Configuration.\n\n.DESCRIPTION\nReads the information about the specified DSC Resource and exposes it in the VMHost DSC Configuration.\nThe user is notified with a message about the currently exported VMHost DSC Resource.\n\n.PARAMETER VMHostDscResourceName\nThe name of the VMHost DSC Resource that is going to be exposed in the VMHost DSC Configuration.\n\n.PARAMETER Message\nThe message that is shown to the user when the specified VMHost DSC Resource is exported.\n#>\nfunction Read-VMHostDscResourceInfo {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostDscResourceName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $Message\n    )\n\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName $VMHostDscResourceName)) {\n        return\n    }\n\n    Write-Host $Message -BackgroundColor DarkGreen -ForegroundColor White\n\n    $vmHostDscResourceKeyProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Name = $VMHostName\n    }\n\n    $vmHostDscResource = New-Object -TypeName $VMHostDscResourceName -Property $vmHostDscResourceKeyProperties\n    $getMethodResult = $vmHostDscResource.Get()\n\n    New-VMHostDscResourceBlock -VMHostDscResourceName $VMHostDscResourceName -VMHostDscResourceInstanceName $VMHostDscResourceName -VMHostDscGetMethodResult $getMethodResult\n}\n\n<#\n.DESCRIPTION\n\nReads the information about SCSI devices on the specified VMHost and exposes them in the VMHost DSC Configuration\nwith the VMHostScsiLun DSC Resource.\n#>\nfunction Read-ScsiDevices {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostScsiLun')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about SCSI devices on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    Get-ScsiDevices\n\n    if ($script:scsiLuns.Length -gt 0) {\n        Write-Warning -Message 'DeletePartitions property of VMHostScsiLun DSC Resource will not be exported in the configuration.'\n    }\n\n    foreach ($scsiLun in $script:scsiLuns) {\n        $vmHostScsiLunDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            CanonicalName = $scsiLun.CanonicalName\n        }\n\n        $vmHostScsiLunDscResource = New-Object -TypeName 'VMHostScsiLun' -Property $vmHostScsiLunDscResourceKeyProperties\n        $vmHostScsiLunDscResourceGetMethodResult = $vmHostScsiLunDscResource.Get()\n\n        # The DSC engine requires a required resource name to be in the format '[<typename>]<name>', with alphanumeric characters, spaces, '_', '-', '.' and '\\'.\n        $formattedScsiLunCanonicalName = $scsiLun.CanonicalName -Replace ':', ''\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostScsiLun' -VMHostDscResourceInstanceName \"VMHostScsiLun_$formattedScsiLunCanonicalName\" -VMHostDscGetMethodResult $vmHostScsiLunDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about paths to SCSI devices on the specified VMHost and exposes them in the VMHost DSC Configuration\nwith the VMHostScsiLunPath DSC Resource.\n#>\nfunction Read-ScsiDevicesPaths {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostScsiLunPath')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about paths to SCSI devices on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    Get-ScsiDevices\n\n    foreach ($scsiLun in $script:scsiLuns) {\n        $scsiLunPaths = Get-ScsiLunPath -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n        foreach ($scsiLunPath in $scsiLunPaths) {\n            $vmHostScsiLunPathDscResourceKeyProperties = @{\n                Server = $Server\n                Credential = $Credential\n                VMHostName = $VMHostName\n                Name = $scsiLunPath.Name\n                ScsiLunCanonicalName = $scsiLun.CanonicalName\n            }\n\n            $vmHostScsiLunPathDscResource = New-Object -TypeName 'VMHostScsiLunPath' -Property $vmHostScsiLunPathDscResourceKeyProperties\n            $vmHostScsiLunPathDscResourceGetMethodResult = $vmHostScsiLunPathDscResource.Get()\n\n            if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostScsiLun') {\n                # The DSC engine requires a required resource name to be in the format '[<typename>]<name>', with alphanumeric characters, spaces, '_', '-', '.' and '\\'.\n                $formattedScsiLunCanonicalName = $scsiLun.CanonicalName -Replace ':', ''\n\n                $vmHostScsiLunPathDscResourceResult = @{\n                    Name = $vmHostScsiLunPathDscResourceGetMethodResult.Name\n                    ScsiLunCanonicalName = $vmHostScsiLunPathDscResourceGetMethodResult.ScsiLunCanonicalName\n                    Active = $vmHostScsiLunPathDscResourceGetMethodResult.Active\n                    Preferred = $vmHostScsiLunPathDscResourceGetMethodResult.Preferred\n                    DependsOn = \"[VMHostScsiLun]VMHostScsiLun_$formattedScsiLunCanonicalName\"\n                }\n\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostScsiLunPath' -VMHostDscResourceInstanceName \"VMHostScsiLunPath_$($scsiLunPath.Name)\" -VMHostDscGetMethodResult $vmHostScsiLunPathDscResourceResult\n            }\n            else {\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostScsiLunPath' -VMHostDscResourceInstanceName \"VMHostScsiLunPath_$($scsiLunPath.Name)\" -VMHostDscGetMethodResult $vmHostScsiLunPathDscResourceGetMethodResult\n            }\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about iSCSI Host Bus Adapters on the specified VMHost and exposes them in the VMHost DSC Configuration\nwith the VMHostIScsiHba DSC Resource.\n#>\nfunction Read-IScsiHbas {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostIScsiHba')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about iSCSI Host Bus Adapters on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    Get-IScsiHostBusAdapters\n\n    if ($script:iScsiHbas.Length -gt 0) {\n        Write-Warning -Message 'Force, ChapPassword and MutualChapPassword properties of VMHostIScsiHba DSC Resource will not be exported in the configuration.'\n        if ($script:vSphereDscResourcesPropertiesToExclude -NotContains 'ChapPassword') { $script:vSphereDscResourcesPropertiesToExclude += 'ChapPassword' }\n        if ($script:vSphereDscResourcesPropertiesToExclude -NotContains 'MutualChapPassword') { $script:vSphereDscResourcesPropertiesToExclude += 'MutualChapPassword' }\n    }\n\n    foreach ($iScsiHba in $script:iScsiHbas) {\n        $vmHostIScsiHbaDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $iScsiHba.Name\n        }\n\n        $vmHostIScsiHbaDscResource = New-Object -TypeName 'VMHostIScsiHba' -Property $vmHostIScsiHbaDscResourceKeyProperties\n        $vmHostIScsiHbaDscResourceGetMethodResult = $vmHostIScsiHbaDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostIScsiHba' -VMHostDscResourceInstanceName \"VMHostIScsiHba_$($iScsiHba.Name)\" -VMHostDscGetMethodResult $vmHostIScsiHbaDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about iSCSI Host Bus Adapter targets on the specified VMHost and exposes them in the VMHost DSC Configuration\nwith the VMHostIScsiHbaTarget DSC Resource.\n#>\nfunction Read-IScsiHbaTargets {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostIScsiHbaTarget')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about iSCSI Host Bus Adapter targets on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    Get-IScsiHostBusAdapters\n\n    if ($script:iScsiHbas.Length -gt 0) {\n        Write-Warning -Message 'Force, ChapPassword and MutualChapPassword properties of VMHostIScsiHbaTarget DSC Resource will not be exported in the configuration.'\n        if ($script:vSphereDscResourcesPropertiesToExclude -NotContains 'ChapPassword') { $script:vSphereDscResourcesPropertiesToExclude += 'ChapPassword' }\n        if ($script:vSphereDscResourcesPropertiesToExclude -NotContains 'MutualChapPassword') { $script:vSphereDscResourcesPropertiesToExclude += 'MutualChapPassword' }\n    }\n\n    foreach ($iScsiHba in $script:iScsiHbas) {\n        $iScsiHbaTargets = Get-IScsiHbaTarget -Server $script:viServer -IScsiHba $iScsiHba -ErrorAction Stop -Verbose:$false\n        foreach ($iScsiHbaTarget in $iScsiHbaTargets) {\n            $vmHostIScsiHbaTargetDscResourceKeyProperties = @{\n                Server = $Server\n                Credential = $Credential\n                VMHostName = $VMHostName\n                Address = $iScsiHbaTarget.Address\n                Port = $iScsiHbaTarget.Port\n                IScsiHbaName = $iScsiHba.Name\n                TargetType = $iScsiHbaTarget.Type\n            }\n\n            $vmHostIScsiHbaTargetDscResource = New-Object -TypeName 'VMHostIScsiHbaTarget' -Property $vmHostIScsiHbaTargetDscResourceKeyProperties\n            $vmHostIScsiHbaTargetDscResourceGetMethodResult = $vmHostIScsiHbaTargetDscResource.Get()\n\n            if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostIScsiHba') {\n                $vmHostIScsiHbaTargetDscResourceResult = @{\n                    Address = $vmHostIScsiHbaTargetDscResourceGetMethodResult.Address\n                    Port = $vmHostIScsiHbaTargetDscResourceGetMethodResult.Port\n                    IScsiHbaName = $vmHostIScsiHbaTargetDscResourceGetMethodResult.IScsiHbaName\n                    TargetType = $vmHostIScsiHbaTargetDscResourceGetMethodResult.TargetType\n                    Ensure = $vmHostIScsiHbaTargetDscResourceGetMethodResult.Ensure\n                    IScsiName = $vmHostIScsiHbaTargetDscResourceGetMethodResult.IScsiName\n                    InheritChap = $vmHostIScsiHbaTargetDscResourceGetMethodResult.InheritChap\n                    ChapType = $vmHostIScsiHbaTargetDscResourceGetMethodResult.ChapType\n                    ChapName = $vmHostIScsiHbaTargetDscResourceGetMethodResult.ChapName\n                    InheritMutualChap = $vmHostIScsiHbaTargetDscResourceGetMethodResult.InheritMutualChap\n                    MutualChapEnabled = $vmHostIScsiHbaTargetDscResourceGetMethodResult.MutualChapEnabled\n                    MutualChapName = $vmHostIScsiHbaTargetDscResourceGetMethodResult.MutualChapName\n                    DependsOn = \"[VMHostIScsiHba]VMHostIScsiHba_$($iScsiHba.Name)\"\n                }\n\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostIScsiHbaTarget' -VMHostDscResourceInstanceName \"VMHostIScsiHbaTarget_$($iScsiHbaTarget.Address):$($iScsiHbaTarget.Port)_$($iScsiHbaTarget.Type)\" -VMHostDscGetMethodResult $vmHostIScsiHbaTargetDscResourceResult\n            }\n            else {\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostIScsiHbaTarget' -VMHostDscResourceInstanceName \"VMHostIScsiHbaTarget_$($iScsiHbaTarget.Address):$($iScsiHbaTarget.Port)_$($iScsiHbaTarget.Type)\" -VMHostDscGetMethodResult $vmHostIScsiHbaTargetDscResourceGetMethodResult\n            }\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about Datastores on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VmfsDatastore and NfsDatastore DSC Resources.\n#>\nfunction Read-Datastores {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VmfsDatastore') -and !(Test-ExportVMHostDscResource -VMHostDscResourceName 'NfsDatastore')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about Datastores on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $datastores = Get-Datastore -Server $script:viServer -VMHost $script:vmHost -ErrorAction Stop -Verbose:$false\n\n    foreach ($datastore in $datastores) {\n        $datastoreDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $datastore.Name\n        }\n\n        if ($datastore.Type -eq 'VMFS' -and (Test-ExportVMHostDscResource -VMHostDscResourceName 'VmfsDatastore')) {\n            $datastoreDscResourceKeyProperties.Path = $datastore.ExtensionData.Info.Vmfs.Extent.DiskName\n            $vmfsDatastoreDscResource = New-Object -TypeName 'VmfsDatastore' -Property $datastoreDscResourceKeyProperties\n            $vmfsDatastoreDscResourceGetMethodResult = $vmfsDatastoreDscResource.Get()\n\n            if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostScsiLun') {\n                # The DSC engine requires a required resource name to be in the format '[<typename>]<name>', with alphanumeric characters, spaces, '_', '-', '.' and '\\'.\n                $formattedScsiLunCanonicalName = $vmfsDatastoreDscResourceGetMethodResult.Path -Replace ':', ''\n\n                $vmfsDatastoreDscResourceResult = @{\n                    Name = $vmfsDatastoreDscResourceGetMethodResult.Name\n                    Path = $vmfsDatastoreDscResourceGetMethodResult.Path\n                    Ensure = $vmfsDatastoreDscResourceGetMethodResult.Ensure\n                    FileSystemVersion = $vmfsDatastoreDscResourceGetMethodResult.FileSystemVersion\n                    BlockSizeMB = $vmfsDatastoreDscResourceGetMethodResult.BlockSizeMB\n                    CongestionThresholdMillisecond = $vmfsDatastoreDscResourceGetMethodResult.CongestionThresholdMillisecond\n                    StorageIOControlEnabled = $vmfsDatastoreDscResourceGetMethodResult.StorageIOControlEnabled\n                    DependsOn = \"[VMHostScsiLun]VMHostScsiLun_$formattedScsiLunCanonicalName\"\n                }\n\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VmfsDatastore' -VMHostDscResourceInstanceName \"VmfsDatastore_$($datastore.Name)\" -VMHostDscGetMethodResult $vmfsDatastoreDscResourceResult\n            }\n            else {\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VmfsDatastore' -VMHostDscResourceInstanceName \"VmfsDatastore_$($datastore.Name)\" -VMHostDscGetMethodResult $vmfsDatastoreDscResourceGetMethodResult\n            }\n        }\n        elseif ($datastore.Type -eq 'NFS' -and (Test-ExportVMHostDscResource -VMHostDscResourceName 'NfsDatastore')) {\n            $datastoreDscResourceKeyProperties.NfsHost = $datastore.RemoteHost\n            $datastoreDscResourceKeyProperties.Path = $datastore.RemotePath\n            $nfsDatastoreDscResource = New-Object -TypeName 'NfsDatastore' -Property $datastoreDscResourceKeyProperties\n            $nfsDatastoreDscResourceGetMethodResult = $nfsDatastoreDscResource.Get()\n\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'NfsDatastore' -VMHostDscResourceInstanceName \"NfsDatastore_$($datastore.Name)\" -VMHostDscGetMethodResult $nfsDatastoreDscResourceGetMethodResult\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about Physical Network Adapters on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostPhysicalNic DSC Resource.\n#>\nfunction Read-VMHostPhysicalNetworkAdapters {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostPhysicalNic')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about Physical Network Adapters on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $physicalNetworkAdapters = Get-VMHostNetworkAdapter -Server $script:viServer -VMHost $script:vmHost -Physical -ErrorAction Stop -Verbose:$false\n\n    foreach ($physicalNetworkAdapter in $physicalNetworkAdapters) {\n        $vmHostPhysicalNicDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $physicalNetworkAdapter.Name\n        }\n\n        $vmHostPhysicalNicDscResource = New-Object -TypeName 'VMHostPhysicalNic' -Property $vmHostPhysicalNicDscResourceKeyProperties\n        $vmHostPhysicalNicDscResourceGetMethodResult = $vmHostPhysicalNicDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostPhysicalNic' -VMHostDscResourceInstanceName \"VMHostPhysicalNic_$($physicalNetworkAdapter.Name)\" -VMHostDscGetMethodResult $vmHostPhysicalNicDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about Standard Switches on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the StandardSwitch Composite DSC Resource.\n#>\nfunction Read-StandardSwitches {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'StandardSwitch')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about Standard Switches on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $standardSwitches = Get-VirtualSwitch -Server $script:viServer -VMHost $script:vmHost -Standard -ErrorAction Stop -Verbose:$false\n\n    foreach ($standardSwitch in $standardSwitches) {\n        $vmHostVssDscResourcesKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            VssName = $standardSwitch.Name\n        }\n\n        $vmHostVssDscResource = New-Object -TypeName 'VMHostVss' -Property $vmHostVssDscResourcesKeyProperties\n        $vmHostVssDscResourceGetMethodResult = $vmHostVssDscResource.Get()\n\n        $vmHostVssBridgeDscResource = New-Object -TypeName 'VMHostVssBridge' -Property $vmHostVssDscResourcesKeyProperties\n        $vmHostVssBridgeDscResourceGetMethodResult = $vmHostVssBridgeDscResource.Get()\n\n        $vmHostVssSecurityDscResource = New-Object -TypeName 'VMHostVssSecurity' -Property $vmHostVssDscResourcesKeyProperties\n        $vmHostVssSecurityDscResourceGetMethodResult = $vmHostVssSecurityDscResource.Get()\n\n        $vmHostVssShapingDscResource = New-Object -TypeName 'VMHostVssShaping' -Property $vmHostVssDscResourcesKeyProperties\n        $vmHostVssShapingDscResourceGetMethodResult = $vmHostVssShapingDscResource.Get()\n\n        $vmHostVssTeamingDscResource = New-Object -TypeName 'VMHostVssTeaming' -Property $vmHostVssDscResourcesKeyProperties\n        $vmHostVssTeamingDscResourceGetMethodResult = $vmHostVssTeamingDscResource.Get()\n\n        <#\n            If only one NIC device is bridged to the Standard Switch, the DependsOn type is 'string'.\n            Otherwise for more than one NIC device the type is 'string[]'.\n        #>\n        $standardSwitchDscResourceDependencies = $null\n        if ($vmHostVssBridgeDscResourceGetMethodResult.NicDevice.Length -ne 0) {\n            if ($vmHostVssBridgeDscResourceGetMethodResult.NicDevice.Length -eq 1) {\n                $standardSwitchDscResourceDependencies = \"[VMHostPhysicalNic]VMHostPhysicalNic_$($vmHostVssBridgeDscResourceGetMethodResult.NicDevice)\"\n            }\n            else {\n                $standardSwitchDscResourceDependencies = @()\n                for ($i = 0; $i -lt $vmHostVssBridgeDscResourceGetMethodResult.NicDevice.Length; $i++) {\n                    $standardSwitchDscResourceDependencies += \"[VMHostPhysicalNic]VMHostPhysicalNic_$($vmHostVssBridgeDscResourceGetMethodResult.NicDevice[$i])\"\n                }\n            }\n        }\n\n        $standardSwitchDscResourceResult = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $standardSwitch.Name\n            Ensure = $vmHostVssDscResourceGetMethodResult.Ensure\n            Mtu = $vmHostVssDscResourceGetMethodResult.Mtu\n            NicDevice = $vmHostVssBridgeDscResourceGetMethodResult.NicDevice\n            BeaconInterval = $vmHostVssBridgeDscResourceGetMethodResult.BeaconInterval\n            LinkDiscoveryProtocolType = $vmHostVssBridgeDscResourceGetMethodResult.LinkDiscoveryProtocolProtocol\n            LinkDiscoveryProtocolOperation = $vmHostVssBridgeDscResourceGetMethodResult.LinkDiscoveryProtocolOperation\n            AllowPromiscuous = $vmHostVssSecurityDscResourceGetMethodResult.AllowPromiscuous\n            ForgedTransmits = $vmHostVssSecurityDscResourceGetMethodResult.ForgedTransmits\n            MacChanges = $vmHostVssSecurityDscResourceGetMethodResult.MacChanges\n            AverageBandwidth = $vmHostVssShapingDscResourceGetMethodResult.AverageBandwidth\n            BurstSize = $vmHostVssShapingDscResourceGetMethodResult.BurstSize\n            Enabled = $vmHostVssShapingDscResourceGetMethodResult.Enabled\n            PeakBandwidth = $vmHostVssShapingDscResourceGetMethodResult.PeakBandwidth\n            CheckBeacon = $vmHostVssTeamingDscResourceGetMethodResult.CheckBeacon\n            ActiveNic = $vmHostVssTeamingDscResourceGetMethodResult.ActiveNic\n            StandbyNic = $vmHostVssTeamingDscResourceGetMethodResult.StandbyNic\n            NotifySwitches = $vmHostVssTeamingDscResourceGetMethodResult.NotifySwitches\n            Policy = $vmHostVssTeamingDscResourceGetMethodResult.Policy\n            RollingOrder = $vmHostVssTeamingDscResourceGetMethodResult.RollingOrder\n        }\n\n        if ($null -ne $standardSwitchDscResourceDependencies -and (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostPhysicalNic')) {\n            $standardSwitchDscResourceResult.DependsOn = $standardSwitchDscResourceDependencies\n        }\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'StandardSwitch' -VMHostDscResourceInstanceName \"StandardSwitch_$($standardSwitch.Name)\" -VMHostDscGetMethodResult $standardSwitchDscResourceResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about Standard Port Groups on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the StandardPortGroup Composite DSC Resource.\n#>\nfunction Read-StandardPortGroups {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'StandardPortGroup')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about Standard Port Groups on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $standardPortGroups = Get-VirtualPortGroup -Server $script:viServer -VMHost $script:vmHost -Standard -ErrorAction Stop -Verbose:$false\n\n    foreach ($standardPortGroup in $standardPortGroups) {\n        $vmHostVssPortGroupDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $standardPortGroup.Name\n            VssName = $standardPortGroup.VirtualSwitchName\n        }\n\n        $vmHostVssPortGroupDscResourcesKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $standardPortGroup.Name\n        }\n\n        $vmHostVssPortGroupDscResource = New-Object -TypeName 'VMHostVssPortGroup' -Property $vmHostVssPortGroupDscResourceKeyProperties\n        $vmHostVssPortGroupDscResourceGetMethodResult = $vmHostVssPortGroupDscResource.Get()\n\n        $vmHostVssPortGroupSecurityDscResource = New-Object -TypeName 'VMHostVssPortGroupSecurity' -Property $vmHostVssPortGroupDscResourcesKeyProperties\n        $vmHostVssPortGroupSecurityDscResourceGetMethodResult = $vmHostVssPortGroupSecurityDscResource.Get()\n\n        $vmHostVssPortGroupShapingDscResource = New-Object -TypeName 'VMHostVssPortGroupShaping' -Property $vmHostVssPortGroupDscResourcesKeyProperties\n        $vmHostVssPortGroupShapingDscResourceGetMethodResult = $vmHostVssPortGroupShapingDscResource.Get()\n\n        $vmHostVssPortGroupTeamingDscResource = New-Object -TypeName 'VMHostVssPortGroupTeaming' -Property $vmHostVssPortGroupDscResourcesKeyProperties\n        $vmHostVssPortGroupTeamingDscResourceGetMethodResult = $vmHostVssPortGroupTeamingDscResource.Get()\n\n        $standardPortGroupDscResourceResult = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $standardPortGroup.Name\n            VssName = $standardPortGroup.VirtualSwitchName\n            Ensure = $vmHostVssPortGroupDscResourceGetMethodResult.Ensure\n            VLanId = $vmHostVssPortGroupDscResourceGetMethodResult.VLanId\n            AllowPromiscuous = $vmHostVssPortGroupSecurityDscResourceGetMethodResult.AllowPromiscuous\n            AllowPromiscuousInherited = $vmHostVssPortGroupSecurityDscResourceGetMethodResult.AllowPromiscuousInherited\n            ForgedTransmits = $vmHostVssPortGroupSecurityDscResourceGetMethodResult.ForgedTransmits\n            ForgedTransmitsInherited = $vmHostVssPortGroupSecurityDscResourceGetMethodResult.ForgedTransmitsInherited\n            MacChanges = $vmHostVssPortGroupSecurityDscResourceGetMethodResult.MacChanges\n            MacChangesInherited = $vmHostVssPortGroupSecurityDscResourceGetMethodResult.MacChangesInherited\n            Enabled = $vmHostVssPortGroupShapingDscResourceGetMethodResult.Enabled\n            AverageBandwidth = $vmHostVssPortGroupShapingDscResourceGetMethodResult.AverageBandwidth\n            PeakBandwidth = $vmHostVssPortGroupShapingDscResourceGetMethodResult.PeakBandwidth\n            BurstSize = $vmHostVssPortGroupShapingDscResourceGetMethodResult.BurstSize\n            FailbackEnabled = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.FailbackEnabled\n            LoadBalancingPolicy = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.LoadBalancingPolicy\n            ActiveNic = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.ActiveNic\n            StandbyNic = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.StandbyNic\n            UnusedNic = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.UnusedNic\n            NetworkFailoverDetectionPolicy = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.NetworkFailoverDetectionPolicy\n            InheritFailback = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.InheritFailback\n            InheritFailoverOrder = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.InheritFailoverOrder\n            InheritLoadBalancingPolicy = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.InheritLoadBalancingPolicy\n            InheritNetworkFailoverDetectionPolicy = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.InheritNetworkFailoverDetectionPolicy\n            InheritNotifySwitches = $vmHostVssPortGroupTeamingDscResourceGetMethodResult.InheritNotifySwitches\n        }\n\n        if (Test-ExportVMHostDscResource -VMHostDscResourceName 'StandardSwitch') {\n            $standardPortGroupDscResourceResult.DependsOn = \"[StandardSwitch]StandardSwitch_$($standardPortGroup.VirtualSwitchName)\"\n        }\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'StandardPortGroup' -VMHostDscResourceInstanceName \"StandardPortGroup_$($standardPortGroup.Name)\" -VMHostDscGetMethodResult $standardPortGroupDscResourceResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about VMKernel Network Adapters on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostVssNic DSC Resource.\n#>\nfunction Read-VMKernelNetworkAdapters {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostVssNic')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMKernel Network Adapters on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmKernelNetworkAdapters = Get-VMHostNetworkAdapter -Server $script:viServer -VMHost $script:vmHost -VMKernel -ErrorAction Stop -Verbose:$false\n\n    foreach ($vmKernelNetworkAdapter in $vmKernelNetworkAdapters) {\n        $getVirtualPortGroupParams = @{\n            Server = $script:viServer\n            VMHost = $script:vmHost\n            Name = $vmKernelNetworkAdapter.PortGroupName\n            Standard = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $portGroup = Get-VirtualPortGroup @getVirtualPortGroupParams\n        if ($null -eq $portGroup) {\n            # The Port Group is a Distributed Port Group, so the VMKernel Network Adapter should not be exported through the VMHostVssNic DSC Resource.\n            continue\n        }\n\n        $vmHostVssNicDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VssName = $portGroup.VirtualSwitchName\n            PortGroupName = $vmKernelNetworkAdapter.PortGroupName\n        }\n\n        $vmHostVssNicDscResource = New-Object -TypeName 'VMHostVssNic' -Property $vmHostVssNicDscResourceKeyProperties\n        $vmHostVssNicDscResourceGetMethodResult = $vmHostVssNicDscResource.Get()\n\n        if ($vmHostVssNicDscResourceGetMethodResult.Ensure.ToString() -eq 'Absent') {\n            <#\n                There could be a Distributed and Standard Port Groups with the same name and\n                the VMKernel Network Adapter could be connected to the Distributed Port Group. So the VMHostVssNic will\n                not find a VMKernel Network Adapter for the Standard Port Group and Switch and it should be skipped in the\n                exported configuration.\n            #>\n            continue\n        }\n\n        if (Test-ExportVMHostDscResource -VMHostDscResourceName 'StandardPortGroup') {\n            $vmHostVssNicDscResourceResult = @{\n                VssName = $vmHostVssNicDscResourceGetMethodResult.VssName\n                PortGroupName = $vmHostVssNicDscResourceGetMethodResult.PortGroupName\n                Ensure = $vmHostVssNicDscResourceGetMethodResult.Ensure\n                Dhcp = $vmHostVssNicDscResourceGetMethodResult.Dhcp\n                IP = $vmHostVssNicDscResourceGetMethodResult.IP\n                SubnetMask = $vmHostVssNicDscResourceGetMethodResult.SubnetMask\n                Mac = $vmHostVssNicDscResourceGetMethodResult.Mac\n                AutomaticIPv6 = $vmHostVssNicDscResourceGetMethodResult.AutomaticIPv6\n                IPv6 = $vmHostVssNicDscResourceGetMethodResult.IPv6\n                IPv6ThroughDhcp = $vmHostVssNicDscResourceGetMethodResult.IPv6ThroughDhcp\n                Mtu = $vmHostVssNicDscResourceGetMethodResult.Mtu\n                IPv6Enabled = $vmHostVssNicDscResourceGetMethodResult.IPv6Enabled\n                ManagementTrafficEnabled = $vmHostVssNicDscResourceGetMethodResult.ManagementTrafficEnabled\n                FaultToleranceLoggingEnabled = $vmHostVssNicDscResourceGetMethodResult.FaultToleranceLoggingEnabled\n                VMotionEnabled = $vmHostVssNicDscResourceGetMethodResult.VMotionEnabled\n                VsanTrafficEnabled = $vmHostVssNicDscResourceGetMethodResult.VsanTrafficEnabled\n                DependsOn = \"[StandardPortGroup]StandardPortGroup_$($vmKernelNetworkAdapter.PortGroupName)\"\n            }\n\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostVssNic' -VMHostDscResourceInstanceName \"VMHostVssNic_$($vmKernelNetworkAdapter.Name)\" -VMHostDscGetMethodResult $vmHostVssNicDscResourceResult\n        }\n        else {\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostVssNic' -VMHostDscResourceInstanceName \"VMHostVssNic_$($vmKernelNetworkAdapter.Name)\" -VMHostDscGetMethodResult $vmHostVssNicDscResourceGetMethodResult\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about DNS settings on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostDnsSettings DSC Resource.\n#>\nfunction Read-VMHostDnsSettings {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostDnsSettings')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about DNS settings on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n\n    $vmHostDnsSettingsDscResourceKeyProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Name = $VMHostName\n    }\n\n    $vmHostDnsSettingsDscResource = New-Object -TypeName 'VMHostDnsSettings' -Property $vmHostDnsSettingsDscResourceKeyProperties\n    $vmHostDnsSettingsDscResourceGetMethodResult = $vmHostDnsSettingsDscResource.Get()\n\n    if (\n        (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostVssNic') -and\n        (![string]::IsNullOrEmpty($vmHostDnsSettingsDscResourceGetMethodResult.VirtualNicDevice) -or\n        ![string]::IsNullOrEmpty($vmHostDnsSettingsDscResourceGetMethodResult.Ipv6VirtualNicDevice))\n    ) {\n        $vmHostDnsSettingsDscResourceDependencies = @()\n        if (![string]::IsNullOrEmpty($vmHostDnsSettingsDscResourceGetMethodResult.VirtualNicDevice)) {\n            $vmHostDnsSettingsDscResourceDependencies += \"[VMHostVssNic]VMHostVssNic_$($vmHostDnsSettingsDscResourceGetMethodResult.VirtualNicDevice)\"\n        }\n\n        if (![string]::IsNullOrEmpty($vmHostDnsSettingsDscResourceGetMethodResult.Ipv6VirtualNicDevice) -and $vmHostDnsSettingsDscResourceGetMethodResult.Ipv6VirtualNicDevice -ne $vmHostDnsSettingsDscResourceGetMethodResult.VirtualNicDevice) {\n            $vmHostDnsSettingsDscResourceDependencies += \"[VMHostVssNic]VMHostVssNic_$($vmHostDnsSettingsDscResourceGetMethodResult.Ipv6VirtualNicDevice)\"\n        }\n\n        $vmHostDnsSettingsDscResourceResult = @{\n            Address = $vmHostDnsSettingsDscResourceGetMethodResult.Address\n            Dhcp = $vmHostDnsSettingsDscResourceGetMethodResult.Dhcp\n            DomainName = $vmHostDnsSettingsDscResourceGetMethodResult.DomainName\n            HostName = $vmHostDnsSettingsDscResourceGetMethodResult.HostName\n            Ipv6VirtualNicDevice = $vmHostDnsSettingsDscResourceGetMethodResult.Ipv6VirtualNicDevice\n            SearchDomain = $vmHostDnsSettingsDscResourceGetMethodResult.SearchDomain\n            VirtualNicDevice = $vmHostDnsSettingsDscResourceGetMethodResult.VirtualNicDevice\n            DependsOn = $vmHostDnsSettingsDscResourceDependencies\n        }\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostDnsSettings' -VMHostDscResourceInstanceName 'VMHostDnsSettings' -VMHostDscGetMethodResult $vmHostDnsSettingsDscResourceResult\n    }\n    else {\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostDnsSettings' -VMHostDscResourceInstanceName 'VMHostDnsSettings' -VMHostDscGetMethodResult $vmHostDnsSettingsDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about IP Routes on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostIPRoute DSC Resource.\n#>\nfunction Read-VMHostIPRoutes {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostIPRoute')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about IP Routes on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $ipRoutes = Get-VMHostRoute -Server $script:viServer -VMHost $script:vmHost -ErrorAction Stop -Verbose:$false\n\n    foreach ($ipRoute in $ipRoutes) {\n        $vmHostIPRouteDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Gateway = $ipRoute.Gateway\n            Destination = $ipRoute.Destination\n            PrefixLength = $ipRoute.PrefixLength\n        }\n\n        $vmHostIPRouteDscResource = New-Object -TypeName 'VMHostIPRoute' -Property $vmHostIPRouteDscResourceKeyProperties\n        $vmHostIPRouteDscResourceGetMethodResult = $vmHostIPRouteDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostIPRoute' -VMHostDscResourceInstanceName \"VMHostIPRoute_$($ipRoute.Gateway)_$($ipRoute.Destination)\" -VMHostDscGetMethodResult $vmHostIPRouteDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about network core dump configuration on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostNetworkCoreDump DSC Resource.\n#>\nfunction Read-VMHostNetworkCoreDump {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostNetworkCoreDump')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) network core dump configuration...\" -BackgroundColor DarkGreen -ForegroundColor White\n\n    $vmHostNetworkCoreDumpDscResourceKeyProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Name = $VMHostName\n    }\n\n    $vmHostNetworkCoreDumpDscResource = New-Object -TypeName 'VMHostNetworkCoreDump' -Property $vmHostNetworkCoreDumpDscResourceKeyProperties\n    $vmHostNetworkCoreDumpDscResourceGetMethodResult = $vmHostNetworkCoreDumpDscResource.Get()\n\n    if (\n        ![string]::IsNullOrEmpty($vmHostNetworkCoreDumpDscResourceGetMethodResult.InterfaceName) -and\n        (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostVssNic')\n    ) {\n        $vmHostNetworkCoreDumpDscResourceResult = @{\n            Enable = $vmHostNetworkCoreDumpDscResourceGetMethodResult.Enable\n            InterfaceName = $vmHostNetworkCoreDumpDscResourceGetMethodResult.InterfaceName\n            ServerIp = $vmHostNetworkCoreDumpDscResourceGetMethodResult.ServerIp\n            ServerPort = $vmHostNetworkCoreDumpDscResourceGetMethodResult.ServerPort\n            DependsOn = \"[VMHostVssNic]VMHostVssNic_$($vmHostNetworkCoreDumpDscResourceGetMethodResult.InterfaceName)\"\n        }\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostNetworkCoreDump' -VMHostDscResourceInstanceName 'VMHostNetworkCoreDump' -VMHostDscGetMethodResult $vmHostNetworkCoreDumpDscResourceResult\n    }\n    else {\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostNetworkCoreDump' -VMHostDscResourceInstanceName 'VMHostNetworkCoreDump' -VMHostDscGetMethodResult $vmHostNetworkCoreDumpDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about advanced settings on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostAdvancedSettings DSC Resource.\n#>\nfunction Read-VMHostAdvancedSettings {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAdvancedSettings')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) advanced settings...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostAdvancedSettings = Get-AdvancedSetting -Server $script:viServer -Entity $script:vmHost -ErrorAction Stop -Verbose:$false\n    $advancedSettings = @{}\n\n    foreach ($vmHostAdvancedSetting in $vmHostAdvancedSettings) {\n        $advancedSettingName = $vmHostAdvancedSetting.Name\n        $advancedSettingValue = $vmHostAdvancedSetting.Value\n        $advancedSettings.$advancedSettingName = $advancedSettingValue\n    }\n\n    $vmHostAdvancedSettingsDscResourceKeyProperties = @{\n        Server = $Server\n        Credential = $Credential\n        Name = $VMHostName\n        AdvancedSettings = $advancedSettings\n    }\n\n    $vmHostAdvancedSettingsDscResource = New-Object -TypeName 'VMHostAdvancedSettings' -Property $vmHostAdvancedSettingsDscResourceKeyProperties\n    $vmHostAdvancedSettingsDscResourceGetMethodResult = $vmHostAdvancedSettingsDscResource.Get()\n\n    New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostAdvancedSettings' -VMHostDscResourceInstanceName 'VMHostAdvancedSettings' -VMHostDscGetMethodResult $vmHostAdvancedSettingsDscResourceGetMethodResult\n}\n\n<#\n.DESCRIPTION\n\nReads the information about graphics devices on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostGraphicsDevice DSC Resource.\n#>\nfunction Read-VMHostGraphicsDevices {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostGraphicsDevice')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about graphics devices on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostGraphicsManager = Get-View -Server $script:viServer -Id $script:vmHost.ExtensionData.ConfigManager.GraphicsManager -ErrorAction Stop -Verbose:$false\n    $graphicsDevices = $vmHostGraphicsManager.GraphicsConfig.DeviceType\n\n    foreach ($graphicsDevice in $graphicsDevices) {\n        $vmHostGraphicsDeviceDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Id = $graphicsDevice.DeviceId\n        }\n\n        $vmHostGraphicsDeviceDscResource = New-Object -TypeName 'VMHostGraphicsDevice' -Property $vmHostGraphicsDeviceDscResourceKeyProperties\n        $vmHostGraphicsDeviceDscResourceGetMethodResult = $vmHostGraphicsDeviceDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostGraphicsDevice' -VMHostDscResourceInstanceName \"VMHostGraphicsDevice_$($graphicsDevice.DeviceId)\" -VMHostDscGetMethodResult $vmHostGraphicsDeviceDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about software devices, VMKernel modules, vSan network configuration and VMKernel dump files on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostSoftwareDevice, VMHostVMKernelModule, VMHostvSANNetworkConfiguration and VMHostVMKernelDumpFile DSC Resources.\n#>\nfunction Read-VMHostEsxCliInfo {\n    $esxCli = Get-EsxCli -Server $script:viServer -VMHost $script:vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    # If no software devices are present on the VMHost, an exception will be thrown when the Invoke() method is executed.\n    if (\n        $null -ne $esxCli.device.software.list -and\n        (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostSoftwareDevice')\n    ) {\n        Write-Host \"Retrieving information about software devices on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n        $vmHostSoftwareDevices = $esxCli.device.software.list.Invoke()\n        foreach ($vmHostSoftwareDevice in $vmHostSoftwareDevices) {\n            $vmHostSoftwareDeviceDscResourceKeyProperties = @{\n                Server = $Server\n                Credential = $Credential\n                Name = $VMHostName\n                DeviceIdentifier = $vmHostSoftwareDevice.DeviceID\n            }\n\n            $vmHostSoftwareDeviceDscResource = New-Object -TypeName 'VMHostSoftwareDevice' -Property $vmHostSoftwareDeviceDscResourceKeyProperties\n            $vmHostSoftwareDeviceDscResourceGetMethodResult = $vmHostSoftwareDeviceDscResource.Get()\n\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostSoftwareDevice' -VMHostDscResourceInstanceName \"VMHostSoftwareDevice_$($vmHostSoftwareDevice.DeviceID)\" -VMHostDscGetMethodResult $vmHostSoftwareDeviceDscResourceGetMethodResult\n        }\n    }\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostVMKernelModule') {\n        Write-Host \"Retrieving information about VMKernel modules on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n        $vmHostVMKernelModules = $esxCli.system.module.list.Invoke()\n\n        if ($vmHostVMKernelModules.Length -gt 0) {\n            Write-Warning -Message 'Force property of VMHostVMKernelModule DSC Resource will not be exported in the configuration.'\n        }\n\n        foreach ($vmHostVMKernelModule in $vmHostVMKernelModules) {\n            $vmHostVMKernelModuleDscResourceKeyProperties = @{\n                Server = $Server\n                Credential = $Credential\n                Name = $VMHostName\n                Module = $vmHostVMKernelModule.Name\n            }\n\n            $vmHostVMKernelModuleDscResource = New-Object -TypeName 'VMHostVMKernelModule' -Property $vmHostVMKernelModuleDscResourceKeyProperties\n            $vmHostVMKernelModuleDscResourceGetMethodResult = $vmHostVMKernelModuleDscResource.Get()\n\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostVMKernelModule' -VMHostDscResourceInstanceName \"VMHostVMKernelModule_$($vmHostVMKernelModule.Name)\" -VMHostDscGetMethodResult $vmHostVMKernelModuleDscResourceGetMethodResult\n        }\n    }\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostvSANNetworkConfiguration') {\n        Write-Host \"Retrieving information about vSan network configuration on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n        $vmHostvSanNetworkConfigurations = $esxCli.vsan.network.list.Invoke()\n\n        if ($null -ne $vmHostvSanNetworkConfigurations.VmkNicName) {\n            Write-Warning -Message 'Force property of VMHostvSANNetworkConfiguration DSC Resource will not be exported in the configuration.'\n            foreach ($vmHostvSanNetworkConfiguration in $vmHostvSanNetworkConfigurations) {\n                if ($null -ne $vmHostvSanNetworkConfiguration) {\n                    $vmHostvSANNetworkConfigurationDscResourceKeyProperties = @{\n                        Server = $Server\n                        Credential = $Credential\n                        Name = $VMHostName\n                        InterfaceName = $vmHostvSanNetworkConfiguration.VmkNicName\n                    }\n\n                    $vmHostvSANNetworkConfigurationDscResource = New-Object -TypeName 'VMHostvSANNetworkConfiguration' -Property $vmHostvSANNetworkConfigurationDscResourceKeyProperties\n                    $vmHostvSANNetworkConfigurationDscResourceGetMethodResult = $vmHostvSANNetworkConfigurationDscResource.Get()\n\n                    New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostvSANNetworkConfiguration' -VMHostDscResourceInstanceName \"VMHostvSANNetworkConfiguration_$($vmHostvSanNetworkConfiguration.VmkNicName)\" -VMHostDscGetMethodResult $vmHostvSANNetworkConfigurationDscResourceGetMethodResult\n                }\n            }\n        }\n    }\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostVMKernelDumpFile') {\n        Write-Host \"Retrieving information about VMKernel dump files on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n        $vmHostVMKernelDumpFiles = $esxCli.system.coredump.file.list.Invoke()\n\n        if ($null -ne $vmHostVMKernelDumpFiles.Path) {\n            foreach ($vmHostVMKernelDumpFile in $vmHostVMKernelDumpFiles) {\n                $vmHostVMKernelDumpFileParts = $vmHostVMKernelDumpFile.Path -Split '/'\n                $vmHostVMKernelDumpFileName = ($vmHostVMKernelDumpFileParts[5] -Split '\\.')[0]\n                $vmHostVMKernelDumpFileDatastoreName = $null\n\n                $fileSystems = $esxCli.storage.filesystem.list.Invoke(@{})\n                foreach ($fileSystem in $fileSystems) {\n                    if ($fileSystem.UUID -eq $vmHostVMKernelDumpFileParts[3] -or $fileSystem.VolumeName -eq $vmHostVMKernelDumpFileParts[3]) {\n                        $vmHostVMKernelDumpFileDatastoreName = $fileSystem.VolumeName\n                        break\n                    }\n                }\n\n                $vmHostVMKernelDumpFileDscResourceKeyProperties = @{\n                    Server = $Server\n                    Credential = $Credential\n                    Name = $VMHostName\n                    DatastoreName = $vmHostVMKernelDumpFileDatastoreName\n                    FileName = $vmHostVMKernelDumpFileName\n                }\n\n                $vmHostVMKernelDumpFileDscResource = New-Object -TypeName 'VMHostVMKernelDumpFile' -Property $vmHostVMKernelDumpFileDscResourceKeyProperties\n                $vmHostVMKernelDumpFileDscResourceGetMethodResult = $vmHostVMKernelDumpFileDscResource.Get()\n\n                New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostVMKernelDumpFile' -VMHostDscResourceInstanceName \"VMHostVMKernelDumpFile_$($vmHostVMKernelDumpFileDatastoreName)_$vmHostVMKernelDumpFileName\" -VMHostDscGetMethodResult $vmHostVMKernelDumpFileDscResourceGetMethodResult\n            }\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about Services on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostService DSC Resource.\n#>\nfunction Read-VMHostServices {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostService')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about Services on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostServices = Get-VMHostService -Server $script:viServer -VMHost $script:vmHost -ErrorAction Stop -Verbose:$false\n\n    foreach ($vmHostService in $vmHostServices) {\n        $vmHostServiceDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Key = $vmHostService.Key\n        }\n\n        $vmHostServiceDscResource = New-Object -TypeName 'VMHostService' -Property $vmHostServiceDscResourceKeyProperties\n        $vmHostServiceDscResourceGetMethodResult = $vmHostServiceDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostService' -VMHostDscResourceInstanceName \"VMHostService_$($vmHostService.Key)\" -VMHostDscGetMethodResult $vmHostServiceDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about firewall rulesets on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostFirewallRuleset DSC Resource.\n#>\nfunction Read-VMHostFirewallRulesets {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostFirewallRuleset')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about firewall rulesets on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostFirewallRulesets = Get-VMHostFirewallException -Server $script:viServer -VMHost $script:vmHost -ErrorAction Stop -Verbose:$false\n\n    foreach ($vmHostFirewallRuleset in $vmHostFirewallRulesets) {\n        $vmHostFirewallRulesetDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            Name = $vmHostFirewallRuleset.Name\n        }\n\n        $vmHostFirewallRulesetDscResource = New-Object -TypeName 'VMHostFirewallRuleset' -Property $vmHostFirewallRulesetDscResourceKeyProperties\n        $vmHostFirewallRulesetDscResourceGetMethodResult = $vmHostFirewallRulesetDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostFirewallRuleset' -VMHostDscResourceInstanceName \"VMHostFirewallRuleset_$($vmHostFirewallRuleset.Name)\" -VMHostDscGetMethodResult $vmHostFirewallRulesetDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about Pci passthrough devices on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostPciPassthrough DSC Resource.\n#>\nfunction Read-VMHostPciPassthrough {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostPciPassthrough')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about Pci passthrough devices on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostPciPassthruSystem = Get-View -Server $script:viServer -Id $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem -ErrorAction Stop -Verbose:$false\n    $vmHostPciDevices = $vmHostPciPassthruSystem.PciPassthruInfo | Where-Object -FilterScript { $_.PassthruCapable }\n\n    foreach ($vmHostPciDevice in $vmHostPciDevices) {\n        $vmHostPciPassthroughDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            Id = $vmHostPciDevice.Id\n        }\n\n        $vmHostPciPassthroughDscResource = New-Object -TypeName 'VMHostPciPassthrough' -Property $vmHostPciPassthroughDscResourceKeyProperties\n        $vmHostPciPassthroughDscResourceGetMethodResult = $vmHostPciPassthroughDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostPciPassthrough' -VMHostDscResourceInstanceName \"VMHostPciPassthrough_$($vmHostPciDevice.Name)\" -VMHostDscGetMethodResult $vmHostPciPassthroughDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about cache on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostCache DSC Resource.\n#>\nfunction Read-VMHostCache {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostCache')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about cache on VMHost $($script:vmHost)...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostCacheConfigurationManager = Get-View -Server $script:viServer -Id $script:vmHost.ExtensionData.ConfigManager.CacheConfigurationManager -ErrorAction Stop -Verbose:$false\n    $vmHostCacheConfigurationDatastores = $vmHostCacheConfigurationManager.CacheConfigurationInfo.Key\n\n    foreach ($vmHostCacheConfigurationDatastoreMoRef in $vmHostCacheConfigurationDatastores) {\n        $datastoreName = Get-Datastore -Server $script:viServer -VMHost $script:vmHost |\n                         Where-Object -FilterScript { $_.ExtensionData.MoRef -eq $vmHostCacheConfigurationDatastoreMoRef } |\n                         Select-Object -ExpandProperty Name\n\n        $vmHostCacheDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $VMHostName\n            DatastoreName = $datastoreName\n        }\n\n        $vmHostCacheDscResource = New-Object -TypeName 'VMHostCache' -Property $vmHostCacheDscResourceKeyProperties\n        $vmHostCacheDscResourceGetMethodResult = $vmHostCacheDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostCache' -VMHostDscResourceInstanceName \"VMHostCache_$datastoreName\" -VMHostDscGetMethodResult $vmHostCacheDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about roles on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostRole DSC Resource.\n#>\nfunction Read-VMHostRoles {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostRole')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) roles...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostRoles = Get-VIRole -Server $script:viServer -ErrorAction Stop -Verbose:$false\n\n    foreach ($vmHostRole in $vmHostRoles) {\n        $vmHostRoleDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Name = $vmHostRole.Name\n        }\n\n        $vmHostRoleDscResource = New-Object -TypeName 'VMHostRole' -Property $vmHostRoleDscResourceKeyProperties\n        $vmHostRoleDscResourceGetMethodResult = $vmHostRoleDscResource.Get()\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostRole' -VMHostDscResourceInstanceName \"VMHostRole_$($vmHostRole.Name)\" -VMHostDscGetMethodResult $vmHostRoleDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about accounts on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostAccount DSC Resource.\n#>\nfunction Read-VMHostAccounts {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAccount')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) accounts...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostAccounts = Get-VMHostAccount -Server $script:viServer -ErrorAction Stop -Verbose:$false\n\n    if ($vmHostAccounts.Length -gt 0) {\n        Write-Warning -Message 'AccountPassword property of VMHostAccount DSC Resource will not be exported in the configuration.'\n        $script:vSphereDscResourcesPropertiesToExclude += 'AccountPassword'\n    }\n\n    foreach ($vmHostAccount in $vmHostAccounts) {\n        $vmHostAccountDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            Id = $vmHostAccount.Id\n        }\n\n        $vmHostAccountDscResource = New-Object -TypeName 'VMHostAccount' -Property $vmHostAccountDscResourceKeyProperties\n        $vmHostAccountDscResourceGetMethodResult = $vmHostAccountDscResource.Get()\n\n        if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostRole') {\n            $vmHostAccountDscResourceResult = @{\n                Id = $vmHostAccountDscResourceGetMethodResult.Id\n                Ensure = $vmHostAccountDscResourceGetMethodResult.Ensure\n                Role = $vmHostAccountDscResourceGetMethodResult.Role\n                Description = $vmHostAccountDscResourceGetMethodResult.Description\n                DependsOn = \"[VMHostRole]VMHostRole_$($vmHostAccountDscResourceGetMethodResult.Role)\"\n            }\n\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostAccount' -VMHostDscResourceInstanceName \"VMHostAccount_$($vmHostAccount.Id)\" -VMHostDscGetMethodResult $vmHostAccountDscResourceResult\n        }\n        else {\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostAccount' -VMHostDscResourceInstanceName \"VMHostAccount_$($vmHostAccount.Id)\" -VMHostDscGetMethodResult $vmHostAccountDscResourceGetMethodResult\n        }\n    }\n}\n\n<#\n.DESCRIPTION\nRetrieves the location of the specified Entity. Location consists of 0 or more Inventory Items.\nInventory Item names in the location are separated by '/'.\n\n.PARAMETER Entity\nThe Entity which location needs to be retrieved.\n#>\nfunction Get-EntityLocation {\n    [CmdletBinding()]\n    [OutputType([string])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [object]\n        $Entity\n    )\n\n    $entityLocationAsArray = @()\n\n    if ($null -ne $Entity.Parent) {\n        $entityParent = $Entity.Parent\n\n        while ($null -ne $entityParent) {\n            $entityLocationAsArray += $entityParent\n            $entityParent = $entityParent.Parent\n        }\n    }\n\n    # The Parent of the Entity should be the last element in the array.\n    [array]::Reverse($entityLocationAsArray)\n    $entityLocationAsArray -Join '/'\n}\n\n<#\n.DESCRIPTION\nRetrieves the type of the specified Entity. Valid Entity types are: 'Datacenter', 'VMHost', 'Datastore', 'VM', 'ResourcePool' and 'VApp'.\n\n.PARAMETER Entity\nThe Entity which type needs to be retrieved.\n#>\nfunction Get-EntityType {\n    [CmdletBinding()]\n    [OutputType([string])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [object]\n        $Entity\n    )\n\n    $entityTypeNamespace = $Entity.GetType().FullName.Split('.')\n    $entityTypeName = $entityTypeNamespace[$entityTypeNamespace.Length - 1]\n\n    $entityType = $entityTypeName -Replace 'Impl', ''\n\n    <#\n        If the Entity type is a 'Folder', the Entity is the default root folder of the VMHost which is not a valid Entity type.\n        So the Entity type should be modified to 'VMHost'.\n    #>\n    if ($entityType -eq 'Folder') {\n        $entityType = 'VMHost'\n    }\n    elseif ($entityType -Match 'Datastore') {\n        # The extracted Datastore type is either 'VmfsDatastore' or 'NasDatastore'.\n        $entityType = 'Datastore'\n    }\n    elseif ($entityType -eq 'VirtualMachine') {\n        $entityType = 'VM'\n    }\n\n    $entityType\n}\n\n<#\n.DESCRIPTION\n\nReads the information about permissions on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostPermission DSC Resource.\n#>\nfunction Read-VMHostPermissions {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostPermission')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) permissions...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $vmHostPermissions = Get-VIPermission -Server $script:viServer -ErrorAction Stop -Verbose:$false\n\n    foreach ($vmHostPermission in $vmHostPermissions) {\n        $permissionEntity = $vmHostPermission.Entity\n\n        $entityName = $permissionEntity.Name\n        $entityLocation = Get-EntityLocation -Entity $permissionEntity\n        $entityType = Get-EntityType -Entity $permissionEntity\n        $principalName = $vmHostPermission.Principal\n\n        $vmHostPermissionDscResourceKeyProperties = @{\n            Server = $Server\n            Credential = $Credential\n            EntityName = $entityName\n            EntityLocation = $entityLocation\n            EntityType = $entityType\n            PrincipalName = $principalName\n        }\n\n        $vmHostPermissionDscResource = New-Object -TypeName 'VMHostPermission' -Property $vmHostPermissionDscResourceKeyProperties\n        $vmHostPermissionDscResourceGetMethodResult = $vmHostPermissionDscResource.Get()\n\n        $vmHostPermissionDscResourceDependencies = $null\n\n        if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAccount') {\n            if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostRole') {\n                $vmHostPermissionDscResourceDependencies = @(\"[VMHostAccount]VMHostAccount_$principalName\")\n            }\n            else {\n                $vmHostPermissionDscResourceDependencies = \"[VMHostAccount]VMHostAccount_$principalName\"\n            }\n        }\n\n        # Permission could exist without a Role.\n        if (\n            ![string]::IsNullOrEmpty($vmHostPermissionDscResourceGetMethodResult.RoleName) -and\n            (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostRole')\n        ) {\n            $vmHostPermissionDscResourceDependencies += \"[VMHostRole]VMHostRole_$($vmHostPermissionDscResourceGetMethodResult.RoleName)\"\n        }\n\n        $vmHostPermissionDscResourceResult = @{\n            Id = $vmHostPermissionDscResourceGetMethodResult.Id\n            EntityName = $vmHostPermissionDscResourceGetMethodResult.EntityName\n            EntityLocation = $vmHostPermissionDscResourceGetMethodResult.EntityLocation\n            EntityType = $vmHostPermissionDscResourceGetMethodResult.EntityType\n            PrincipalName = $vmHostPermissionDscResourceGetMethodResult.PrincipalName\n            RoleName = $vmHostPermissionDscResourceGetMethodResult.RoleName\n            Ensure = $vmHostPermissionDscResourceGetMethodResult.Ensure\n            Propagate = $vmHostPermissionDscResourceGetMethodResult.Propagate\n        }\n\n        if ($null -ne $vmHostPermissionDscResourceDependencies) {\n            $vmHostPermissionDscResourceResult.DependsOn = $vmHostPermissionDscResourceDependencies\n        }\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostPermission' -VMHostDscResourceInstanceName \"VMHostPermission_$($entityName)_$principalName\" -VMHostDscGetMethodResult $vmHostPermissionDscResourceResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about NFS user accounts on the specified VMHost and exposes them in the VMHost DSC Configuration\nwith the NfsUser DSC Resource.\n#>\nfunction Read-NfsUserAccounts {\n    if (!(Test-ExportVMHostDscResource -VMHostDscResourceName 'NfsUser')) {\n        return\n    }\n\n    Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) NFS user accounts...\" -BackgroundColor DarkGreen -ForegroundColor White\n    $nfsUser = Get-NfsUser -Server $script:viServer -VMHost $script:vmHost -ErrorAction Stop -Verbose:$false\n\n    $nfsUserDscResourceKeyProperties = @{\n        Server = $Server\n        Credential = $Credential\n        VMHostName = $VMHostName\n        Name = $nfsUser.Username\n    }\n\n    $nfsUserDscResource = New-Object -TypeName 'NfsUser' -Property $nfsUserDscResourceKeyProperties\n    $nfsUserDscResourceGetMethodResult = $nfsUserDscResource.Get()\n\n    Write-Warning -Message 'Password and Force properties of NfsUser DSC Resource will not be exported in the configuration.'\n    $script:vSphereDscResourcesPropertiesToExclude += 'Password'\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAuthentication') {\n        $nfsUserDscResourceResult = @{\n            Name = $nfsUserDscResourceGetMethodResult.Name\n            Ensure = $nfsUserDscResourceGetMethodResult.Ensure\n            Force = $nfsUserDscResourceGetMethodResult.Force\n            DependsOn = \"[VMHostAuthentication]VMHostAuthentication\"\n        }\n\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'NfsUser' -VMHostDscResourceInstanceName 'NfsUser' -VMHostDscGetMethodResult $nfsUserDscResourceResult\n    }\n    else {\n        New-VMHostDscResourceBlock -VMHostDscResourceName 'NfsUser' -VMHostDscResourceInstanceName 'NfsUser' -VMHostDscGetMethodResult $nfsUserDscResourceGetMethodResult\n    }\n}\n\n<#\n.DESCRIPTION\n\nReads the information about authentication on the specified VMHost and exposes it in the VMHost DSC Configuration\nwith the VMHostRole, VMHostAccount, VMHostPermission, VMHostAuthentication and NfsUser DSC Resources.\n#>\nfunction Read-VMHostAuthentication {\n    if (\n        (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostRole') -or\n        (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAccount') -or\n        (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostPermission')\n    ) {\n        if ($script:viServer.ProductLine -eq 'embeddedEsx') {\n            Read-VMHostRoles\n            Read-VMHostAccounts\n            Read-VMHostPermissions\n        }\n        else {\n            Write-Warning -Message \"VMHost $($script:vmHost) accounts, roles and permissions cannot be exported into the configuration because the connection is to vCenter Server instance. Connect directly to the ESXi to export them.\"\n        }\n    }\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAuthentication') {\n        Write-Host \"Retrieving information about VMHost $($script:vmHost.Name) authentication...\" -BackgroundColor DarkGreen -ForegroundColor White\n        $vmHostAuthenticationInfo = Get-VMHostAuthentication -Server $script:viServer -VMHost $script:vmHost -ErrorAction Stop -Verbose:$false\n\n        if ($null -ne $vmHostAuthenticationInfo.Domain) {\n            $vmHostAuthenticationDscResourceKeyProperties = @{\n                Server = $Server\n                Credential = $Credential\n                Name = $VMHostName\n                DomainName = $vmHostAuthenticationInfo.Domain\n                DomainAction = 'Join'\n            }\n\n            $vmHostAuthenticationDscResource = New-Object -TypeName 'VMHostAuthentication' -Property $vmHostAuthenticationDscResourceKeyProperties\n            $vmHostAuthenticationDscResourceGetMethodResult = $vmHostAuthenticationDscResource.Get()\n\n            Write-Warning -Message 'DomainCredential property of VMHostAuthentication DSC Resource will not be exported in the configuration.'\n            $script:vSphereDscResourcesPropertiesToExclude += 'DomainCredential'\n\n            New-VMHostDscResourceBlock -VMHostDscResourceName 'VMHostAuthentication' -VMHostDscResourceInstanceName 'VMHostAuthentication' -VMHostDscGetMethodResult $vmHostAuthenticationDscResourceGetMethodResult\n        }\n    }\n\n    Read-NfsUserAccounts\n}\n\n<#\n.DESCRIPTION\n\nThe main function for reading the current VMHost configuration. It acts as a call dispatcher, calling all required functions\nin the proper order to read the whole information of the VMHost that is exposed as DSC Resources.\n#>\nfunction Read-VMHostConfiguration {\n    $script:availableVSphereDscResources = Get-DscResource -Module 'VMware.vSphereDSC' -ErrorAction Stop -Verbose:$false\n    $script:vSphereDscResourcesPropertiesToExclude = @('Server', 'Credential', 'DependsOn', 'PsDscRunAsCredential')\n\n    # VMHost Storage DSC Resources\n    Read-ScsiDevices\n    Read-ScsiDevicesPaths\n    Read-IScsiHbas\n    Read-IScsiHbaTargets\n    Read-Datastores\n\n    # VMHost Network DSC Resources\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostNtpSettings' -Message \"Retrieving information about NTP settings on VMHost $($script:vmHost)...\"\n\n    Read-VMHostPhysicalNetworkAdapters\n    Read-StandardSwitches\n    Read-StandardPortGroups\n    Read-VMKernelNetworkAdapters\n    Read-VMHostDnsSettings\n    Read-VMHostIPRoutes\n    Read-VMHostNetworkCoreDump\n\n    # VMHost settings DSC Resources\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostConfiguration') {\n        if ($script:vmHost.VMSwapfilePolicy.ToString() -eq 'Inherit') {\n            Write-Warning -Message \"VMHost configuration with swapfile placement policy 'Inherited' will not be exported in the configuration.\"\n        }\n        else {\n            Write-Warning -Message 'Evacuate property of VMHostConfiguration DSC Resource will not be exported in the configuration.'\n            Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostConfiguration' -Message \"Retrieving information about VMHost $($script:vmHost.Name) configuration...\"\n        }\n    }\n\n    Read-VMHostAdvancedSettings\n\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostTpsSettings' -Message \"Retrieving information about TPS settings on VMHost $($script:vmHost)...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostSettings' -Message \"Retrieving information about VMHost $($script:vmHost.Name) settings...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostPowerPolicy' -Message \"Retrieving information about VMHost $($script:vmHost.Name) power policy...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostGraphics' -Message \"Retrieving information about VMHost $($script:vmHost.Name) graphics settings...\"\n\n    Read-VMHostGraphicsDevices\n\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostSyslog' -Message \"Retrieving information about VMHost $($script:vmHost.Name) syslog settings...\"\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostSNMPAgent') {\n        Write-Warning -Message 'Reset property of VMHostSNMPAgent DSC Resource will not be exported in the configuration.'\n        Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostSNMPAgent' -Message \"Retrieving information about VMHost $($script:vmHost.Name) SNMP agent settings...\"\n    }\n\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostSharedSwapSpace' -Message \"Retrieving information about VMHost $($script:vmHost.Name) shared swap space settings...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostDCUIKeyboard' -Message \"Retrieving information about VMHost $($script:vmHost.Name) DCUI keyboard...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostAcceptanceLevel' -Message \"Retrieving information about VMHost $($script:vmHost.Name) acceptance level...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostVMKernelActiveDumpPartition' -Message \"Retrieving information about VMHost $($script:vmHost.Name) VMKernel active dump partition settings...\"\n    Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostVMKernelActiveDumpFile' -Message \"Retrieving information about VMHost $($script:vmHost.Name) VMKernel active dump file settings...\"\n\n    Write-Warning -Message \"VMHost $($script:vmHost) SATP Claim Rules are not exported into the configuration.\"\n\n    Read-VMHostEsxCliInfo\n    Read-VMHostServices\n    Read-VMHostFirewallRulesets\n    Read-VMHostPciPassthrough\n    Read-VMHostCache\n    Read-VMHostAuthentication\n\n    if (Test-ExportVMHostDscResource -VMHostDscResourceName 'VMHostAgentVM') {\n        if ($script:viServer.ProductLine -eq 'vpx') {\n            Read-VMHostDscResourceInfo -VMHostDscResourceName 'VMHostAgentVM' -Message \"Retrieving information about VMHost $($script:vmHost.Name) AgentVM settings...\"\n        }\n        else {\n            Write-Warning -Message \"VMHost $($script:vmHost) AgentVM settings cannot be exported into the configuration because the connection is to ESXi. Connect directly to vCenter Server instance to export them.\"\n        }\n    }\n}\n\n<#\n.DESCRIPTION\n\nReturns the path to the output file of the VMHost DSC Configuration.\n#>\nfunction Get-VMHostDscConfigurationOutputFile {\n    [CmdletBinding()]\n    [OutputType([string])]\n    Param()\n\n    $vmHostDscConfigurationOutputFile = $OutputPath\n    if (!$OutputPath.EndsWith('\\') -and !$OutputPath.EndsWith('/')) {\n        $vmHostDscConfigurationOutputFile += '\\'\n    }\n\n    $vmHostDscConfigurationOutputFile += $script:vmHostConfigurationFileName\n    $vmHostDscConfigurationOutputFile\n}\n\n<#\n.DESCRIPTION\n\nThe main function for extracting the VMHost DSC Configuration. It acts as a call dispatcher, calling all required functions\nin the proper order to get the full Configuration.\n#>\nfunction Export-VMHostConfiguration {\n    Import-RequiredModules\n    $script:viServer = Connect-VSphereServer\n    $script:vmHost = Get-VSphereVMHost\n\n    Set-ConfigurationParameters\n    Set-ConfigurationData\n\n    [void] $script:vmHostDscConfigContent.Append(\"Configuration $script:vmHostConfigurationName {`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    Import-DscResource -ModuleName VMware.vSphereDSC`r`n`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"    Node `$AllNodes.NodeName {`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"        foreach (`$vmHostName in `$AllNodes.VMHostNames) {`r`n\")\n\n    Read-VMHostConfiguration\n\n    [void] $script:vmHostDscConfigContent.Append(\"        }`r`n\")\n\n    [void] $script:vmHostDscConfigContent.Append(\"    }`r`n\")\n    [void] $script:vmHostDscConfigContent.Append(\"}`r`n`r`n\")\n\n    [void] $script:vmHostDscConfigContent.Append(\"$script:vmHostConfigurationName -ConfigurationData `$script:configurationData\")\n\n    $outputFile = Get-VMHostDscConfigurationOutputFile\n    $script:vmHostDscConfigContent.ToString() | Out-File -FilePath $outputFile -Encoding Default\n\n    Disconnect-VSphereServer\n}\n\nExport-VMHostConfiguration\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/RequiredModules.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nRequiredModules = @(\n    #@{ \"ModuleName\" = \"VMware.VimAutomation.Vds\"; \"ModuleVersion\" = \"11.2.0.12483615\" },\n    #@{ \"ModuleName\" = \"VMware.VimAutomation.Storage\"; \"ModuleVersion\" = \"11.5.0.14901686\" }\n)\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Cluster/DrsCluster.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'DrsCluster'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenAddingClusterWithEmptyLocation = \"$($script:dscResourceName)_WhenAddingClusterWithEmptyLocation_Config\"\n$script:configWhenAddingClusterWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenAddingClusterWithLocationWithOneFolder_Config\"\n$script:configWhenAddingClusterWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenAddingClusterWithLocationWithTwoFolders_Config\"\n$script:configWhenUpdatingCluster = \"$($script:dscResourceName)_WhenUpdatingCluster_Config\"\n$script:configWhenRemovingClusterWithEmptyLocation = \"$($script:dscResourceName)_WhenRemovingClusterWithEmptyLocation_Config\"\n$script:configWhenRemovingClusterWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenRemovingClusterWithLocationWithOneFolder_Config\"\n$script:configWhenRemovingClusterWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenRemovingClusterWithLocationWithTwoFolders_Config\"\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenAddingClusterWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingClusterWithEmptyLocation)\\\"\n$script:mofFileWhenAddingClusterWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingClusterWithLocationWithOneFolder)\\\"\n$script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingClusterWithLocationWithTwoFolders)\\\"\n$script:mofFileWhenUpdatingClusterPath = \"$script:integrationTestsFolderPath\\$($script:configWhenUpdatingCluster)\\\"\n$script:mofFileWhenRemovingClusterWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingClusterWithEmptyLocation)\\\"\n$script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingClusterWithLocationWithOneFolder)\\\"\n$script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingClusterWithLocationWithTwoFolders)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenAddingClusterWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $clusterWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:drsClusterWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $clusterWithEmptyLocationResource.Server | Should -Be $Server\n            $clusterWithEmptyLocationResource.Name | Should -Be $script:clusterName\n            $clusterWithEmptyLocationResource.Location | Should -Be $script:clusterWithEmptyLocation\n            $clusterWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $clusterWithEmptyLocationResource.DrsEnabled | Should -Be $true\n            $clusterWithEmptyLocationResource.DrsAutomationLevel | Should -Be 'FullyAutomated'\n            $clusterWithEmptyLocationResource.DrsMigrationThreshold | Should -Be 5\n            $clusterWithEmptyLocationResource.DrsDistribution | Should -Be 0\n            $clusterWithEmptyLocationResource.MemoryLoadBalancing | Should -Be 100\n            $clusterWithEmptyLocationResource.CPUOverCommitment | Should -Be 500\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:drsClusterWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $clusterWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:drsClusterWithEmptyLocationResourceId }\n\n            # Assert\n            $clusterWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingClusterWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $clusterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:drsClusterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $clusterWithLocationWithOneFolderResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithOneFolderResource.Location | Should -Be $script:clusterWithLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n            $clusterWithLocationWithOneFolderResource.DrsEnabled | Should -Be $true\n            $clusterWithLocationWithOneFolderResource.DrsAutomationLevel | Should -Be 'Manual'\n            $clusterWithLocationWithOneFolderResource.DrsMigrationThreshold | Should -Be 3\n            $clusterWithLocationWithOneFolderResource.DrsDistribution | Should -Be 1\n            $clusterWithLocationWithOneFolderResource.MemoryLoadBalancing | Should -Be 200\n            $clusterWithLocationWithOneFolderResource.CPUOverCommitment | Should -Be 400\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:drsClusterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $clusterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:drsClusterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $clusterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingClusterWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n            $clusterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:drsClusterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $clusterWithLocationWithTwoFoldersResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithTwoFoldersResource.Location | Should -Be $script:clusterWithLocationWithTwoFolders\n            $clusterWithLocationWithTwoFoldersResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithTwoFoldersResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Present'\n            $clusterWithLocationWithTwoFoldersResource.DrsEnabled | Should -Be $true\n            $clusterWithLocationWithTwoFoldersResource.DrsAutomationLevel | Should -Be 'PartiallyAutomated'\n            $clusterWithLocationWithTwoFoldersResource.DrsMigrationThreshold | Should -Be 4\n            $clusterWithLocationWithTwoFoldersResource.DrsDistribution | Should -Be 2\n            $clusterWithLocationWithTwoFoldersResource.MemoryLoadBalancing | Should -Be 300\n            $clusterWithLocationWithTwoFoldersResource.CPUOverCommitment | Should -Be 100\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:drsClusterWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $clusterWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:drsClusterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $clusterWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenUpdatingCluster)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenUpdatingCluster = @{\n                Path = $script:mofFileWhenUpdatingClusterPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingClusterPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $script:clusterName\n            $configuration.Location | Should -Be $script:clusterWithEmptyLocation\n            $configuration.DatacenterName | Should -Be $script:datacenterName\n            $configuration.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.DrsEnabled | Should -Be $true\n            $configuration.DrsAutomationLevel | Should -Be 'PartiallyAutomated'\n            $configuration.DrsMigrationThreshold | Should -Be 4\n            $configuration.DrsDistribution | Should -Be 2\n            $configuration.MemoryLoadBalancing | Should -Be 300\n            $configuration.CPUOverCommitment | Should -Be 100\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingClusterWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingCluster = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $clusterWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:drsClusterWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $clusterWithEmptyLocationResource.Server | Should -Be $Server\n            $clusterWithEmptyLocationResource.Name | Should -Be $script:clusterName\n            $clusterWithEmptyLocationResource.Location | Should -Be $script:clusterWithEmptyLocation\n            $clusterWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $clusterWithEmptyLocationResource.DrsEnabled | Should -Be $null\n            $clusterWithEmptyLocationResource.DrsAutomationLevel | Should -Be 'Unset'\n            $clusterWithEmptyLocationResource.DrsMigrationThreshold | Should -Be $null\n            $clusterWithEmptyLocationResource.DrsDistribution | Should -Be $null\n            $clusterWithEmptyLocationResource.MemoryLoadBalancing | Should -Be $null\n            $clusterWithEmptyLocationResource.CPUOverCommitment | Should -Be $null\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:drsClusterWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:drsClusterWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingClusterWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingCluster = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $clusterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:drsClusterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $clusterWithLocationWithOneFolderResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithOneFolderResource.Location | Should -Be $script:clusterWithLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n            $clusterWithLocationWithOneFolderResource.DrsEnabled | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.DrsAutomationLevel | Should -Be 'Unset'\n            $clusterWithLocationWithOneFolderResource.DrsMigrationThreshold | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.DrsDistribution | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.MemoryLoadBalancing | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.CPUOverCommitment | Should -Be $null\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:drsClusterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:drsClusterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingClusterWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingCluster = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n            $clusterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:drsClusterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $clusterWithLocationWithTwoFoldersResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithTwoFoldersResource.Location | Should -Be $script:clusterWithLocationWithTwoFolders\n            $clusterWithLocationWithTwoFoldersResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithTwoFoldersResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Absent'\n            $clusterWithLocationWithTwoFoldersResource.DrsEnabled | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.DrsAutomationLevel | Should -Be 'Unset'\n            $clusterWithLocationWithTwoFoldersResource.DrsMigrationThreshold | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.DrsDistribution | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.MemoryLoadBalancing | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.CPUOverCommitment | Should -Be $null\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:drsClusterWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:drsClusterWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Cluster/HACluster.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'HACluster'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenAddingClusterWithEmptyLocation = \"$($script:dscResourceName)_WhenAddingClusterWithEmptyLocation_Config\"\n$script:configWhenAddingClusterWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenAddingClusterWithLocationWithOneFolder_Config\"\n$script:configWhenAddingClusterWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenAddingClusterWithLocationWithTwoFolders_Config\"\n$script:configWhenUpdatingCluster = \"$($script:dscResourceName)_WhenUpdatingCluster_Config\"\n$script:configWhenRemovingClusterWithEmptyLocation = \"$($script:dscResourceName)_WhenRemovingClusterWithEmptyLocation_Config\"\n$script:configWhenRemovingClusterWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenRemovingClusterWithLocationWithOneFolder_Config\"\n$script:configWhenRemovingClusterWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenRemovingClusterWithLocationWithTwoFolders_Config\"\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenAddingClusterWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingClusterWithEmptyLocation)\\\"\n$script:mofFileWhenAddingClusterWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingClusterWithLocationWithOneFolder)\\\"\n$script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingClusterWithLocationWithTwoFolders)\\\"\n$script:mofFileWhenUpdatingClusterPath = \"$script:integrationTestsFolderPath\\$($script:configWhenUpdatingCluster)\\\"\n$script:mofFileWhenRemovingClusterWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingClusterWithEmptyLocation)\\\"\n$script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingClusterWithLocationWithOneFolder)\\\"\n$script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingClusterWithLocationWithTwoFolders)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenAddingClusterWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $clusterWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:haClusterWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $clusterWithEmptyLocationResource.Server | Should -Be $Server\n            $clusterWithEmptyLocationResource.Name | Should -Be $script:clusterName\n            $clusterWithEmptyLocationResource.Location | Should -Be $script:clusterWithEmptyLocation\n            $clusterWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $clusterWithEmptyLocationResource.HAEnabled | Should -Be $true\n            $clusterWithEmptyLocationResource.HAAdmissionControlEnabled | Should -Be $true\n            $clusterWithEmptyLocationResource.HAFailoverLevel | Should -Be 3\n            $clusterWithEmptyLocationResource.HAIsolationResponse | Should -Be 'DoNothing'\n            $clusterWithEmptyLocationResource.HARestartPriority | Should -Be 'Low'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:haClusterWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $clusterWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:haClusterWithEmptyLocationResourceId }\n\n            # Assert\n            $clusterWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingClusterWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $clusterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:haClusterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $clusterWithLocationWithOneFolderResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithOneFolderResource.Location | Should -Be $script:clusterWithLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n            $clusterWithLocationWithOneFolderResource.HAEnabled | Should -Be $true\n            $clusterWithLocationWithOneFolderResource.HAAdmissionControlEnabled | Should -Be $true\n            $clusterWithLocationWithOneFolderResource.HAFailoverLevel | Should -Be 2\n            $clusterWithLocationWithOneFolderResource.HAIsolationResponse | Should -Be 'PowerOff'\n            $clusterWithLocationWithOneFolderResource.HARestartPriority | Should -Be 'High'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:haClusterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $clusterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:haClusterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $clusterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingClusterWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n            $clusterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:haClusterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $clusterWithLocationWithTwoFoldersResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithTwoFoldersResource.Location | Should -Be $script:clusterWithLocationWithTwoFolders\n            $clusterWithLocationWithTwoFoldersResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithTwoFoldersResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Present'\n            $clusterWithLocationWithTwoFoldersResource.HAEnabled | Should -Be $true\n            $clusterWithLocationWithTwoFoldersResource.HAAdmissionControlEnabled | Should -Be $true\n            $clusterWithLocationWithTwoFoldersResource.HAFailoverLevel | Should -Be 1\n            $clusterWithLocationWithTwoFoldersResource.HAIsolationResponse | Should -Be 'Shutdown'\n            $clusterWithLocationWithTwoFoldersResource.HARestartPriority | Should -Be 'Medium'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:haClusterWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $clusterWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:haClusterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $clusterWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenUpdatingCluster)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenUpdatingCluster = @{\n                Path = $script:mofFileWhenUpdatingClusterPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingClusterPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $script:clusterName\n            $configuration.Location | Should -Be $script:clusterWithEmptyLocation\n            $configuration.DatacenterName | Should -Be $script:datacenterName\n            $configuration.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.HAEnabled | Should -Be $true\n            $configuration.HAAdmissionControlEnabled | Should -Be $false\n            $configuration.HAFailoverLevel | Should -Be 3\n            $configuration.HAIsolationResponse | Should -Be 'PowerOff'\n            $configuration.HARestartPriority | Should -Be 'Disabled'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingClusterWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingCluster = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $clusterWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:haClusterWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $clusterWithEmptyLocationResource.Server | Should -Be $Server\n            $clusterWithEmptyLocationResource.Name | Should -Be $script:clusterName\n            $clusterWithEmptyLocationResource.Location | Should -Be $script:clusterWithEmptyLocation\n            $clusterWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $clusterWithEmptyLocationResource.HAEnabled | Should -Be $null\n            $clusterWithEmptyLocationResource.HAAdmissionControlEnabled | Should -Be $null\n            $clusterWithEmptyLocationResource.HAFailoverLevel | Should -Be $null\n            $clusterWithEmptyLocationResource.HAIsolationResponse | Should -Be 'Unset'\n            $clusterWithEmptyLocationResource.HARestartPriority | Should -Be 'Unset'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:haClusterWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:haClusterWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingClusterWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingCluster = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $clusterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:haClusterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $clusterWithLocationWithOneFolderResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithOneFolderResource.Location | Should -Be $script:clusterWithLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n            $clusterWithLocationWithOneFolderResource.HAEnabled | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.HAAdmissionControlEnabled | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.HAFailoverLevel | Should -Be $null\n            $clusterWithLocationWithOneFolderResource.HAIsolationResponse | Should -Be 'Unset'\n            $clusterWithLocationWithOneFolderResource.HARestartPriority | Should -Be 'Unset'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:haClusterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:haClusterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingClusterWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingCluster = @{\n                Path = $script:mofFileWhenAddingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingCluster = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingCluster\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingCluster\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingClusterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n            $clusterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:haClusterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n\n            $clusterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $clusterWithLocationWithTwoFoldersResource.Name | Should -Be $script:clusterName\n            $clusterWithLocationWithTwoFoldersResource.Location | Should -Be $script:clusterWithLocationWithTwoFolders\n            $clusterWithLocationWithTwoFoldersResource.DatacenterName | Should -Be $script:datacenterName\n            $clusterWithLocationWithTwoFoldersResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $clusterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Absent'\n            $clusterWithLocationWithTwoFoldersResource.HAEnabled | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.HAAdmissionControlEnabled | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.HAFailoverLevel | Should -Be $null\n            $clusterWithLocationWithTwoFoldersResource.HAIsolationResponse | Should -Be 'Unset'\n            $clusterWithLocationWithTwoFoldersResource.HARestartPriority | Should -Be 'Unset'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:haClusterWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:haClusterWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/Datacenter/Datacenter_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration Datacenter_WhenAddingDatacenterWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $script:datacenterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration Datacenter_WhenAddingDatacenterWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration Datacenter_WhenAddingDatacenterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration Datacenter_WhenRemovingDatacenterWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $script:datacenterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration Datacenter_WhenRemovingDatacenterWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration Datacenter_WhenRemovingDatacenterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $script:datacenterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithTwoFoldersResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nDatacenter_WhenAddingDatacenterWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\Datacenter_WhenAddingDatacenterWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nDatacenter_WhenAddingDatacenterWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\Datacenter_WhenAddingDatacenterWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nDatacenter_WhenAddingDatacenterWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\Datacenter_WhenAddingDatacenterWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\nDatacenter_WhenRemovingDatacenterWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\Datacenter_WhenRemovingDatacenterWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nDatacenter_WhenRemovingDatacenterWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\Datacenter_WhenRemovingDatacenterWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nDatacenter_WhenRemovingDatacenterWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\Datacenter_WhenRemovingDatacenterWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/DatacenterFolder/DatacenterFolder_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration DatacenterFolder_WhenAddingFolderWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration DatacenterFolder_WhenAddingFolderWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration DatacenterFolder_WhenAddingFolderWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithTwoFolders\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration DatacenterFolder_WhenRemovingFolderWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration DatacenterFolder_WhenRemovingFolderWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration DatacenterFolder_WhenRemovingFolderWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithTwoFolders\n            Ensure = 'Absent'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterFolderWithLocationWithTwoFoldersResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nDatacenterFolder_WhenAddingFolderWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\DatacenterFolder_WhenAddingFolderWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nDatacenterFolder_WhenAddingFolderWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\DatacenterFolder_WhenAddingFolderWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nDatacenterFolder_WhenAddingFolderWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\DatacenterFolder_WhenAddingFolderWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\nDatacenterFolder_WhenRemovingFolderWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\DatacenterFolder_WhenRemovingFolderWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nDatacenterFolder_WhenRemovingFolderWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\DatacenterFolder_WhenRemovingFolderWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nDatacenterFolder_WhenRemovingFolderWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\DatacenterFolder_WhenRemovingFolderWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/DrsCluster/DrsCluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration DrsCluster_WhenAddingClusterWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        DrsCluster $script:drsClusterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'FullyAutomated'\n            DrsMigrationThreshold = 5\n            DrsDistribution = 0\n            MemoryLoadBalancing = 100\n            CPUOverCommitment = 500\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration DrsCluster_WhenAddingClusterWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        DrsCluster $script:drsClusterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'Manual'\n            DrsMigrationThreshold = 3\n            DrsDistribution = 1\n            MemoryLoadBalancing = 200\n            CPUOverCommitment = 400\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration DrsCluster_WhenAddingClusterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DrsCluster $script:drsClusterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithTwoFolders\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DrsEnabled = $true\n            DrsAutomationLevel = 'PartiallyAutomated'\n            DrsMigrationThreshold = 4\n            DrsDistribution = 2\n            MemoryLoadBalancing = 300\n            CPUOverCommitment = 100\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration DrsCluster_WhenUpdatingCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DrsCluster $script:drsClusterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DrsAutomationLevel = 'PartiallyAutomated'\n            DrsMigrationThreshold = 4\n            DrsDistribution = 2\n            MemoryLoadBalancing = 300\n            CPUOverCommitment = 100\n        }\n    }\n}\n\nConfiguration DrsCluster_WhenRemovingClusterWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DrsCluster $script:drsClusterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:drsClusterWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration DrsCluster_WhenRemovingClusterWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DrsCluster $script:drsClusterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:drsClusterWithLocationWithOneFolderResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration DrsCluster_WhenRemovingClusterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DrsCluster $script:drsClusterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithTwoFolders\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:drsClusterWithLocationWithTwoFoldersResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nDrsCluster_WhenAddingClusterWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenAddingClusterWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nDrsCluster_WhenAddingClusterWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenAddingClusterWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nDrsCluster_WhenAddingClusterWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenAddingClusterWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\nDrsCluster_WhenUpdatingCluster_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenUpdatingCluster_Config\" -ConfigurationData $script:configurationData\nDrsCluster_WhenRemovingClusterWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenRemovingClusterWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nDrsCluster_WhenRemovingClusterWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenRemovingClusterWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nDrsCluster_WhenRemovingClusterWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\DrsCluster_WhenRemovingClusterWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/Folder/Folder_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration Folder_WhenAddingFolderWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $script:datacenterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterEmptyLocation\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration Folder_WhenAddingFolderWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration Folder_WhenAddingFolderWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithLocationWithTwoFoldersResourceId\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        Folder $script:folderWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithTwoFolders\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration Folder_WhenRemovingFolderWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterEmptyLocation\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n        }\n\n        Datacenter $script:datacenterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration Folder_WhenRemovingFolderWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration Folder_WhenRemovingFolderWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Folder $script:folderWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithTwoFolders\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithLocationWithTwoFoldersResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithTwoFolders\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithTwoFoldersResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nFolder_WhenAddingFolderWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\Folder_WhenAddingFolderWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nFolder_WhenAddingFolderWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\Folder_WhenAddingFolderWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nFolder_WhenAddingFolderWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\Folder_WhenAddingFolderWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\nFolder_WhenRemovingFolderWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\Folder_WhenRemovingFolderWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nFolder_WhenRemovingFolderWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\Folder_WhenRemovingFolderWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nFolder_WhenRemovingFolderWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\Folder_WhenRemovingFolderWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/HACluster/HACluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration HACluster_WhenAddingClusterWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        HACluster $script:haClusterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 3\n            HAIsolationResponse = 'DoNothing'\n            HARestartPriority = 'Low'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration HACluster_WhenAddingClusterWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        HACluster $script:haClusterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            HAEnabled = $true\n            HAFailoverLevel = 2\n            HAIsolationResponse = 'PowerOff'\n            HARestartPriority = 'High'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n    }\n}\n\nConfiguration HACluster_WhenAddingClusterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Present'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            DependsOn = $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        HACluster $script:haClusterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithTwoFolders\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            HAEnabled = $true\n            HAAdmissionControlEnabled = $true\n            HAFailoverLevel = 1\n            HAIsolationResponse = 'Shutdown'\n            HARestartPriority = 'Medium'\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration HACluster_WhenUpdatingCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        HACluster $script:haClusterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Present'\n            HAAdmissionControlEnabled = $false\n            HAIsolationResponse = 'PowerOff'\n            HARestartPriority = 'Disabled'\n        }\n    }\n}\n\nConfiguration HACluster_WhenRemovingClusterWithEmptyLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        HACluster $script:haClusterWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:haClusterWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration HACluster_WhenRemovingClusterWithLocationWithOneFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        HACluster $script:haClusterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:haClusterWithLocationWithOneFolderResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nConfiguration HACluster_WhenRemovingClusterWithLocationWithTwoFolders_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        HACluster $script:haClusterWithLocationWithTwoFoldersResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:clusterName\n            Location = $script:clusterWithLocationWithTwoFolders\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n        }\n\n        Folder $script:folderWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithLocationWithOneFolder\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:haClusterWithLocationWithTwoFoldersResourceId\n        }\n\n        Folder $script:folderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:folderName\n            Location = $script:folderWithEmptyLocation\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            FolderType = $script:folderType\n            DependsOn = $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        Datacenter $script:datacenterWithLocationWithOneFolderResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterName\n            Location = $script:datacenterLocationWithOneFolder\n            Ensure = 'Absent'\n            DependsOn = $script:folderWithEmptyLocationResourceId\n        }\n\n        DatacenterFolder $script:datacenterFolderWithEmptyLocationResourceName {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Name = $script:datacenterFolderName\n            Location = $script:datacenterFolderEmptyLocation\n            Ensure = 'Absent'\n            DependsOn = $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n}\n\nHACluster_WhenAddingClusterWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenAddingClusterWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nHACluster_WhenAddingClusterWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenAddingClusterWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nHACluster_WhenAddingClusterWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenAddingClusterWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\nHACluster_WhenUpdatingCluster_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenUpdatingCluster_Config\" -ConfigurationData $script:configurationData\nHACluster_WhenRemovingClusterWithEmptyLocation_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenRemovingClusterWithEmptyLocation_Config\" -ConfigurationData $script:configurationData\nHACluster_WhenRemovingClusterWithLocationWithOneFolder_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenRemovingClusterWithLocationWithOneFolder_Config\" -ConfigurationData $script:configurationData\nHACluster_WhenRemovingClusterWithLocationWithTwoFolders_Config -OutputPath \"$integrationTestsFolderPath\\HACluster_WhenRemovingClusterWithLocationWithTwoFolders_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/NfsDatastore/NfsDatastore_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration NfsDatastore_CreateNfsDatastoreWithReadOnlyAccessMode_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore $AllNodes.NfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.NfsPath\n            Ensure = 'Present'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            NfsHost = $AllNodes.NfsHost\n            AccessMode = $AllNodes.ReadOnlyAccessMode\n        }\n    }\n}\n\nConfiguration NfsDatastore_CreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore $AllNodes.NfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.NfsPath\n            Ensure = 'Present'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            NfsHost = $AllNodes.NfsHost\n            StorageIOControlEnabled = !$AllNodes.StorageIOControlEnabled\n            CongestionThresholdMillisecond = $AllNodes.MaxCongestionThresholdMillisecond\n        }\n    }\n}\n\nConfiguration NfsDatastore_ModifyNfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore $AllNodes.NfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.NfsPath\n            Ensure = 'Present'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            NfsHost = $AllNodes.NfsHost\n            StorageIOControlEnabled = $AllNodes.StorageIOControlEnabled\n            CongestionThresholdMillisecond = $AllNodes.MinCongestionThresholdMillisecond\n        }\n    }\n}\n\nConfiguration NfsDatastore_RemoveNfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsDatastore $AllNodes.NfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.NfsPath\n            Ensure = 'Absent'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            NfsHost = $AllNodes.NfsHost\n            StorageIOControlEnabled = $AllNodes.StorageIOControlEnabled\n            CongestionThresholdMillisecond = $AllNodes.DefaultCongestionThresholdMillisecond\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/NfsUser/NfsUser_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration NfsUser_JoinDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAuthentication $AllNodes.VMHostAuthenticationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DomainName = $AllNodes.DomainName\n            DomainAction = $AllNodes.DomainActionJoin\n            DomainCredential = $AllNodes.DomainCredential\n        }\n    }\n}\n\nConfiguration NfsUser_CreateNfsUser_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsUser $AllNodes.NfsUserResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.NfsUsername\n            Password = $AllNodes.NfsUserPasswordOne\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration NfsUser_ChangeNfsUserPassword_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsUser $AllNodes.NfsUserResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.NfsUsername\n            Password = $AllNodes.NfsUserPasswordTwo\n            Ensure = 'Present'\n            Force = $AllNodes.Force\n        }\n    }\n}\n\nConfiguration NfsUser_RemoveNfsUser_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        NfsUser $AllNodes.NfsUserResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.NfsUsername\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration NfsUser_LeaveDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAuthentication $AllNodes.VMHostAuthenticationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DomainName = $AllNodes.DomainName\n            DomainAction = $AllNodes.DomainActionLeave\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/PowerCLISettings/PowerCLISettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration PowerCLISettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        PowerCLISettings powerCLISettings {\n            SettingsScope = 'LCM'\n            ParticipateInCeip = $false\n            InvalidCertificateAction = 'Warn'\n            DefaultVIServerMode = 'Multiple'\n            DisplayDeprecationWarnings = $false\n        }\n    }\n}\n\nPowerCLISettings_Config -OutputPath \"$integrationTestsFolderPath\\PowerCLISettings_Config\"\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VDPortGroup/VDPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VDPortGroup_CreateDatacenterAndVDSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $AllNodes.DatacenterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n\n        VDSwitch $AllNodes.VDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDSwitchName\n            Location = $AllNodes.VDSwitchLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            DependsOn = $AllNodes.DatacenterResourceId\n        }\n    }\n}\n\nConfiguration VDPortGroup_CreateVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.VDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            Notes = $AllNodes.VDPortGroupNotes\n            NumPorts = $AllNodes.VDPortGroupNumPorts\n            PortBinding = $AllNodes.VDPortGroupPortBinding\n            VLanId = $AllNodes.VLanId\n        }\n    }\n}\n\nConfiguration VDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.ReferenceVDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ReferenceVDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            ReferenceVDPortGroupName = $AllNodes.VDPortGroupName\n        }\n    }\n}\n\nConfiguration VDPortGroup_ModifyVDPortGroupNotesAndNumPorts_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.VDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            Notes = $AllNodes.VDPortGroupDefaultNotes\n            NumPorts = $AllNodes.VDPortGroupDefaultNumPorts\n            PortBinding = $AllNodes.VDPortGroupPortBinding\n            VLanId = $AllNodes.VLanId\n        }\n    }\n}\n\nConfiguration VDPortGroup_ModifyVDPortGroupVLanId_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.VDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.ModifiedVLanId\n        }\n    }\n}\n\nConfiguration VDPortGroup_SetVDPortGroupVLanToNone_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.VDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.VLanNone\n        }\n    }\n}\n\nConfiguration VDPortGroup_RemoveVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.VDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VDPortGroup_RemoveDatacenterVDSwitchAndVDPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDPortGroup $AllNodes.ReferenceVDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ReferenceVDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Absent'\n        }\n\n        VDPortGroup $AllNodes.VDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.ReferenceVDPortGroupResourceId\n        }\n\n        VDSwitch $AllNodes.VDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDSwitchName\n            Location = $AllNodes.VDSwitchLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VDPortGroupResourceId\n        }\n\n        Datacenter $AllNodes.DatacenterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VDSwitchResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VDSwitch/VDSwitch_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VDSwitch_WhenAddingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $AllNodes.DatacenterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n\n        VDSwitch $AllNodes.DistributedSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DistributedSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            ContactDetails = $AllNodes.ContactDetails\n            ContactName = $AllNodes.ContactName\n            LinkDiscoveryProtocol = $AllNodes.LinkDiscoveryProtocol\n            LinkDiscoveryProtocolOperation = $AllNodes.LinkDiscoveryProtocolOperationAdvertise\n            MaxPorts = $AllNodes.MaxPorts\n            Mtu = $AllNodes.Mtu\n            Notes = $AllNodes.Notes\n            NumUplinkPorts = $AllNodes.NumUplinkPorts\n            Version = $AllNodes.Version\n            DependsOn = $AllNodes.DatacenterResourceId\n        }\n    }\n}\n\nConfiguration VDSwitch_WhenAddingDistributedSwitchViaReferenceVDSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.ReferenceVDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ReferenceVDSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            ReferenceVDSwitchName = $AllNodes.DistributedSwitchName\n            WithoutPortGroups = $AllNodes.WithoutPortGroups\n        }\n    }\n}\n\nConfiguration VDSwitch_WhenUpdatingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.DistributedSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DistributedSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            ContactName = $AllNodes.UpdatedContactName\n            LinkDiscoveryProtocolOperation = $AllNodes.LinkDiscoveryProtocolOperationListen\n            Mtu = $AllNodes.UpdatedMtu\n        }\n    }\n}\n\nConfiguration VDSwitch_WhenRemovingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.DistributedSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DistributedSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VDSwitch_WhenRemovingDistributedSwitchesAndDatacenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.ReferenceVDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ReferenceVDSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n\n        VDSwitch $AllNodes.DistributedSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DistributedSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.ReferenceVDSwitchResourceId\n        }\n\n        Datacenter $AllNodes.DatacenterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.DistributedSwitchResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VDSwitchVMHost/VDSwitchVMHost_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VDSwitchVMHost_WhenAddingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.DistributedSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DistributedSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VDSwitchVMHost_WhenAddingVMHostsToDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitchVMHost $AllNodes.DistributedSwitchVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VdsName = $AllNodes.DistributedSwitchName\n            VMHostNames = $AllNodes.VMHostNames\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VDSwitchVMHost_WhenRemovingVMHostsFromDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitchVMHost $AllNodes.DistributedSwitchVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VdsName = $AllNodes.DistributedSwitchName\n            VMHostNames = $AllNodes.VMHostNames\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VDSwitchVMHost_WhenRemovingDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.DistributedSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DistributedSwitchName\n            Location = $AllNodes.Location\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostAcceptanceLevel/VMHostAcceptanceLevel_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAcceptanceLevel $AllNodes.VMHostAcceptanceLevelResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Level = $AllNodes.VMHostAcceptanceLevel\n        }\n    }\n}\n\nConfiguration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevelToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAcceptanceLevel $AllNodes.VMHostAcceptanceLevelResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Level = $AllNodes.InitialVMHostAcceptanceLevel\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostAccount/VMHostAccount_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:vmHostAccountId = 'MyTestVMHostAccount'\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostAccount_WithAccountToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Id = $script:vmHostAccountId\n            Ensure = 'Present'\n            Role = 'Admin'\n            AccountPassword = 'MyTestAccountPass1!'\n            Description = 'MyTestVMHostAccount Description'\n        }\n    }\n}\n\nConfiguration VMHostAccount_WithAccountToUpdate_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Id = $script:vmHostAccountId\n            Ensure = 'Present'\n            Role = 'ReadOnly'\n            AccountPassword = 'MyTestAccountPass123!'\n            Description = 'MyTestVMHostAccount Description 2'\n        }\n    }\n}\n\nConfiguration VMHostAccount_WithAccountToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostAccount vmHostAccount {\n            Server = $Server\n            Credential = $script:viServerCredential\n            Id = $script:vmHostAccountId\n            Ensure = 'Absent'\n            Role = 'ReadOnly'\n        }\n    }\n}\n\nVMHostAccount_WithAccountToAdd_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAccount_WithAccountToAdd_Config\" -ConfigurationData $script:configurationData\nVMHostAccount_WithAccountToUpdate_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAccount_WithAccountToUpdate_Config\" -ConfigurationData $script:configurationData\nVMHostAccount_WithAccountToRemove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAccount_WithAccountToRemove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostAdvancedSettings/VMHostAdvancedSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostAdvancedSettings_WhenHashtableContainsAdvancedSettingsToUpdate_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAdvancedSettings vmHostAdvancedSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            AdvancedSettings = $script:advancedSettingsWithCustomValues\n        }\n    }\n}\n\nConfiguration VMHostAdvancedSettings_WhenHashtableDoesNotContainAdvancedSettingsToUpdate_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAdvancedSettings vmHostAdvancedSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            AdvancedSettings = $script:advancedSettingsWithDefaultValues\n        }\n    }\n}\n\nVMHostAdvancedSettings_WhenHashtableContainsAdvancedSettingsToUpdate_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAdvancedSettings_WhenHashtableContainsAdvancedSettingsToUpdate_Config\" -ConfigurationData $script:configurationData\nVMHostAdvancedSettings_WhenHashtableDoesNotContainAdvancedSettingsToUpdate_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAdvancedSettings_WhenHashtableDoesNotContainAdvancedSettingsToUpdate_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostAgentVM/VMHostAgentVM_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Datastore,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Network\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostAgentVM_WhenAgentVmSettingsAreNotPassed_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n        }\n    }\n}\n\nConfiguration VMHostAgentVM_WhenBothAgentVmSettingsArePassedAsNull_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            AgentVmDatastore = $null\n            AgentVmNetwork = $null\n        }\n    }\n}\n\nConfiguration VMHostAgentVM_WhenOnlyAgentVmDatastoreIsPassed_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            AgentVmDatastore = $Datastore\n            AgentVmNetwork = $null\n        }\n    }\n}\n\nConfiguration VMHostAgentVM_WhenOnlyAgentVmNetworkIsPassed_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            AgentVmDatastore = $null\n            AgentVmNetwork = $Network\n        }\n    }\n}\n\nConfiguration VMHostAgentVM_WhenBothAgentVmSettingsArePassed_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAgentVM vmHostAgentVM {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            AgentVmDatastore = $Datastore\n            AgentVmNetwork = $Network\n        }\n    }\n}\n\nVMHostAgentVM_WhenAgentVmSettingsAreNotPassed_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAgentVM_WhenAgentVmSettingsAreNotPassed_Config\" -ConfigurationData $script:configurationData\nVMHostAgentVM_WhenBothAgentVmSettingsArePassedAsNull_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAgentVM_WhenBothAgentVmSettingsArePassedAsNull_Config\" -ConfigurationData $script:configurationData\nVMHostAgentVM_WhenOnlyAgentVmDatastoreIsPassed_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAgentVM_WhenOnlyAgentVmDatastoreIsPassed_Config\" -ConfigurationData $script:configurationData\nVMHostAgentVM_WhenOnlyAgentVmNetworkIsPassed_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAgentVM_WhenOnlyAgentVmNetworkIsPassed_Config\" -ConfigurationData $script:configurationData\nVMHostAgentVM_WhenBothAgentVmSettingsArePassed_Config -OutputPath \"$integrationTestsFolderPath\\VMHostAgentVM_WhenBothAgentVmSettingsArePassed_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostAuthentication/VMHostAuthentication_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostAuthentication_JoinDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAuthentication $AllNodes.VMHostAuthenticationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DomainName = $AllNodes.DomainName\n            DomainAction = $AllNodes.DomainActionJoin\n            DomainCredential = $AllNodes.DomainCredential\n        }\n    }\n}\n\nConfiguration VMHostAuthentication_LeaveDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostAuthentication $AllNodes.VMHostAuthenticationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            DomainName = $AllNodes.DomainName\n            DomainAction = $AllNodes.DomainActionLeave\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostCache/VMHostCache_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $DatastoreName\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostCache_WhenSwapSizeIsZeroGigabytes_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostCache vmHostCache {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            DatastoreName = $DatastoreName\n            SwapSizeGB = $script:zeroGigabytesSwapSize\n        }\n    }\n}\n\nConfiguration VMHostCache_WhenSwapSizeIsOneGigabyte_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostCache vmHostCache {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            DatastoreName = $DatastoreName\n            SwapSizeGB = $script:oneGigabyteSwapSize\n        }\n    }\n}\n\nConfiguration VMHostCache_WhenSwapSizeIsTwoGigabytes_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostCache vmHostCache {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            DatastoreName = $DatastoreName\n            SwapSizeGB = $script:twoGigabytesSwapSize\n        }\n    }\n}\n\nVMHostCache_WhenSwapSizeIsZeroGigabytes_Config -OutputPath \"$integrationTestsFolderPath\\VMHostCache_WhenSwapSizeIsZeroGigabytes_Config\" -ConfigurationData $script:configurationData\nVMHostCache_WhenSwapSizeIsOneGigabyte_Config -OutputPath \"$integrationTestsFolderPath\\VMHostCache_WhenSwapSizeIsOneGigabyte_Config\" -ConfigurationData $script:configurationData\nVMHostCache_WhenSwapSizeIsTwoGigabytes_Config -OutputPath \"$integrationTestsFolderPath\\VMHostCache_WhenSwapSizeIsTwoGigabytes_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostConfiguration/VMHostConfiguration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostConfiguration_CreateVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostConfiguration_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration $AllNodes.VMHostConfigurationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            LicenseKey = $AllNodes.LicenseKey\n            TimeZoneName = $AllNodes.TimeZoneName\n            VMSwapfileDatastoreName = $AllNodes.DatastoreName\n            VMSwapfilePolicy = $AllNodes.VMSwapfilePolicy\n        }\n    }\n}\n\nConfiguration VMHostConfiguration_ModifyVMHostHostProfileAssociation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration $AllNodes.VMHostConfigurationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            LicenseKey = $AllNodes.InitialVMHostLicenseKey\n            TimeZoneName = $AllNodes.InititalVMHostTimeZoneName\n            VMSwapfileDatastoreName = $AllNodes.InitialVMSwapfileDatastoreName\n            VMSwapfilePolicy = $AllNodes.InitialVMSwapfilePolicy\n            HostProfileName = $AllNodes.HostProfileName\n        }\n    }\n}\n\nConfiguration VMHostConfiguration_ModifyVMHostConfigurationToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration $AllNodes.VMHostConfigurationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            LicenseKey = $AllNodes.InitialVMHostLicenseKey\n            TimeZoneName = $AllNodes.InitialVMHostTimeZoneName\n            VMSwapfilePolicy = $AllNodes.InitialVMSwapfilePolicy\n            HostProfileName = $AllNodes.InitialHostProfileName\n        }\n    }\n}\n\nConfiguration VMHostConfiguration_RemoveVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostDCUIKeyboard/VMHostDCUIKeyboard_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostDCUIKeyboard $AllNodes.VMHostDCUIKeyboardResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Layout = $AllNodes.VMHostDCUIKeyboardLayout\n        }\n    }\n}\n\nConfiguration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayoutToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostDCUIKeyboard $AllNodes.VMHostDCUIKeyboardResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Layout = $AllNodes.InitialVMHostDCUIKeyboardLayout\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostDnsSettings/VMHostDnsSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:hostName = \"esx-server1\"\n$script:domainName = \"eng.vmware.com\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostDnsSettings_WithDhcpDisabled_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostDnsSettings vmHostDnsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            HostName = $script:hostName\n            DomainName = $script:domainName\n            Dhcp = $false\n            Address = @(\"10.23.83.229\", \"10.23.108.1\")\n            SearchDomain = @(\"eng.vmware.com\")\n        }\n    }\n}\n\nConfiguration VMHostDnsSettings_WithoutAddressAndSearchDomain_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostDnsSettings vmHostDnsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            HostName = $script:hostName\n            DomainName = $script:domainName\n            Dhcp = $false\n        }\n    }\n}\n\nConfiguration VMHostDnsSettings_WithDhcpEnabled_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostDnsSettings vmHostDnsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            HostName = $script:hostName\n            DomainName = $script:domainName\n            Dhcp = $true\n            VirtualNicDevice = \"vmk0\"\n        }\n    }\n}\n\nVMHostDnsSettings_WithDhcpDisabled_Config -OutputPath \"$integrationTestsFolderPath\\VMHostDnsSettings_WithDhcpDisabled_Config\" -ConfigurationData $script:configurationData\nVMHostDnsSettings_WithoutAddressAndSearchDomain_Config -OutputPath \"$integrationTestsFolderPath\\VMHostDnsSettings_WithoutAddressAndSearchDomain_Config\" -ConfigurationData $script:configurationData\nVMHostDnsSettings_WithDhcpEnabled_Config -OutputPath \"$integrationTestsFolderPath\\VMHostDnsSettings_WithDhcpEnabled_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostFirewallRuleset/VMHostFirewallRuleset_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostFirewallRuleset_EnableVMHostFirewallRuleset_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            Enabled = $AllNodes.VMHostFirewallRulesetEnabled\n        }\n    }\n}\n\nConfiguration VMHostFirewallRuleset_DisableVMHostFirewallRuleset_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            Enabled = !$AllNodes.VMHostFirewallRulesetEnabled\n        }\n    }\n}\n\nConfiguration VMHostFirewallRuleset_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            AllIP = $AllNodes.VMHostFirewallRulesetForAllIPs\n            IPAddresses = $AllNodes.VMHostFirewallRulesetEmptyIPAddressesList\n        }\n    }\n}\n\nConfiguration VMHostFirewallRuleset_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            AllIP = $AllNodes.VMHostFirewallRulesetForAllIPs\n            IPAddresses = $AllNodes.VMHostFirewallRulesetIPAddressesList\n        }\n    }\n}\n\nConfiguration VMHostFirewallRuleset_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            AllIP = $AllNodes.VMHostFirewallRulesetForAllIPs\n            IPAddresses = $AllNodes.VMHostFirewallRulesetIPNetworksList\n        }\n    }\n}\n\nConfiguration VMHostFirewallRuleset_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            AllIP = !$AllNodes.VMHostFirewallRulesetForAllIPs\n            IPAddresses = $AllNodes.VMHostFirewallRulesetIPAddressesAndIPNetworksList\n        }\n    }\n}\n\nConfiguration VMHostFirewallRuleset_ModifyVMHostFirewallRulesetConfigurationToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostFirewallRuleset $AllNodes.VMHostFirewallRulesetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMHostFirewallRulesetName\n            Enabled = $AllNodes.InitialVMHostFirewallRulesetState\n            AllIP = $AllNodes.InitialVMHostFirewallRulesetForAllIPs\n            IPAddresses = $AllNodes.InitialVMHostFirewallRulesetIPAddressesAndIPNetworksList\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostGraphics/VMHostGraphics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostGraphics_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostGraphics vmHostGraphics {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            GraphicsType = $script:sharedGraphicsType\n            SharedPassthruAssignmentPolicy = $script:performanceSharedPassthruAssignmentPolicy\n        }\n    }\n}\n\nVMHostGraphics_Config -OutputPath \"$integrationTestsFolderPath\\VMHostGraphics_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostGraphicsDevice/VMHostGraphicsDevice_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $GraphicsDeviceId\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostGraphicsDevice_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostGraphicsDevice vmHostGraphicsDevice {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            Id = $GraphicsDeviceId\n            GraphicsType = $script:sharedGraphicsType\n        }\n    }\n}\n\nVMHostGraphicsDevice_Config -OutputPath \"$integrationTestsFolderPath\\VMHostGraphicsDevice_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostIPRoute/VMHostIPRoute_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostIPRoute_CreateVMHostIPRoute_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIPRoute $AllNodes.VMHostIPRouteResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Gateway = $AllNodes.VMHostDefaultGateway\n            Destination = $AllNodes.DestinationAddress\n            PrefixLength = $AllNodes.PrefixLength\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostIPRoute_RemoveVMHostIPRoute_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIPRoute $AllNodes.VMHostIPRouteResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Gateway = $AllNodes.VMHostDefaultGateway\n            Destination = $AllNodes.DestinationAddress\n            PrefixLength = $AllNodes.PrefixLength\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostIScsiHba/VMHostIScsiHba_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = $AllNodes.ChapTypeRequired\n            ChapName = $AllNodes.ChapName\n            ChapPassword = $AllNodes.ChapPassword\n            MutualChapEnabled = $AllNodes.MutualChapEnabled\n            MutualChapName = $AllNodes.MutualChapName\n            MutualChapPassword = $AllNodes.MutualChapPassword\n        }\n    }\n}\n\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = $AllNodes.ChapTypeProhibited\n            ChapName = $AllNodes.ChapName\n            ChapPassword = $AllNodes.ChapPassword\n            MutualChapEnabled = !$AllNodes.MutualChapEnabled\n            MutualChapName = $AllNodes.MutualChapName\n            MutualChapPassword = $AllNodes.MutualChapPassword\n        }\n    }\n}\n\nConfiguration VMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            IScsiName = $AllNodes.IScsiName\n        }\n    }\n}\n\nConfiguration VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = $AllNodes.InitialChapType\n        }\n    }\n}\n\nConfiguration VMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapterToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            IScsiName = $AllNodes.InitialIScsiName\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostIScsiHbaTarget_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = $AllNodes.ChapTypeRequired\n            ChapName = $AllNodes.ChapName\n            ChapPassword = $AllNodes.ChapPassword\n            MutualChapEnabled = $AllNodes.MutualChapEnabled\n            MutualChapName = $AllNodes.MutualChapName\n            MutualChapPassword = $AllNodes.MutualChapPassword\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget $AllNodes.VMHostIScsiHbaTargetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = $AllNodes.IScsiHbaTargetAddress\n            Port = $AllNodes.IScsiHbaTargetPort\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = $AllNodes.IScsiHbaSendTargetType\n            Ensure = 'Present'\n            IScsiName = $AllNodes.IScsiName\n            InheritChap = !$AllNodes.InheritChap\n            ChapType = $AllNodes.ChapTypeRequired\n            ChapName = $AllNodes.ChapName\n            ChapPassword = $AllNodes.ChapPassword\n            InheritMutualChap = !$AllNodes.InheritMutualChap\n            MutualChapEnabled = $AllNodes.MutualChapEnabled\n            MutualChapName = $AllNodes.MutualChapName\n            MutualChapPassword = $AllNodes.MutualChapPassword\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = $AllNodes.IScsiHbaTargetAddress\n            Port = $AllNodes.IScsiHbaTargetPort\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = $AllNodes.IScsiHbaStaticTargetType\n            Ensure = 'Present'\n            IScsiName = $AllNodes.IScsiName\n            InheritChap = $AllNodes.InheritChap\n            ChapType = $AllNodes.ChapTypeRequired\n            ChapName = $AllNodes.ChapName\n            ChapPassword = $AllNodes.ChapPassword\n            InheritMutualChap = $AllNodes.InheritMutualChap\n            MutualChapEnabled = $AllNodes.MutualChapEnabled\n            MutualChapName = $AllNodes.MutualChapName\n            MutualChapPassword = $AllNodes.MutualChapPassword\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaTarget_ConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget $AllNodes.VMHostIScsiHbaTargetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = $AllNodes.IScsiHbaTargetAddress\n            Port = $AllNodes.IScsiHbaTargetPort\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = $AllNodes.IScsiHbaSendTargetType\n            Ensure = 'Present'\n            IScsiName = $AllNodes.IScsiName\n            InheritChap = !$AllNodes.InheritChap\n            ChapType = $AllNodes.ChapTypeProhibited\n            ChapName = $AllNodes.ChapName\n            ChapPassword = $AllNodes.ChapPassword\n            InheritMutualChap = !$AllNodes.InheritMutualChap\n            MutualChapEnabled = !$AllNodes.MutualChapEnabled\n            MutualChapName = $AllNodes.MutualChapName\n            MutualChapPassword = $AllNodes.MutualChapPassword\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterSendTarget_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget $AllNodes.VMHostIScsiHbaTargetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = $AllNodes.IScsiHbaTargetAddress\n            Port = $AllNodes.IScsiHbaTargetPort\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = $AllNodes.IScsiHbaSendTargetType\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterStaticTarget_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaTarget $AllNodes.VMHostIScsiHbaTargetResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Address = $AllNodes.IScsiHbaTargetAddress\n            Port = $AllNodes.IScsiHbaTargetPort\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            TargetType = $AllNodes.IScsiHbaStaticTargetType\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaTarget_ConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHba $AllNodes.VMHostIScsiHbaResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.IScsiHbaName\n            ChapType = $AllNodes.InitialChapType\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostNetworkCoreDump/VMHostNetworkCoreDump_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostNetworkCoreDump $AllNodes.VMHostNetworkCoreDumpResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            Enable = $AllNodes.EnableNetworkCoreDump\n            InterfaceName = $AllNodes.NetworkCoreDumpInterfaceName\n            ServerIp = $AllNodes.NetworkCoreDumpServerIp\n            ServerPort = $AllNodes.NetworkCoreDumpServerPort\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostNtpSettings/VMHostNtpSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:ntpServerAddUseCase = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\", \"2.bg.pool.ntp.org\")\n$script:ntpServerRemoveUseCase = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\")\n$script:ntpServicePolicy = \"Automatic\"\n\n$script:vmhost = Get-VMHost -Name $Name\n$script:vmhostNtpServicePolicyValue = ($script:vmhost.ExtensionData.Config.Service.Service | Where-Object { $_.Key -eq \"ntpd\" }).Policy\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostNtpSettings_WithoutNtpServerAndNtpServicePolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n        }\n    }\n}\n\nConfiguration VMHostNtpSettings_WithEmptyArrayNtpServer_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            NtpServer = @()\n        }\n    }\n}\n\nConfiguration VMHostNtpSettings_WithNtpServerAddUseCase_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            NtpServer = $script:ntpServerAddUseCase\n        }\n    }\n}\n\nConfiguration VMHostNtpSettings_WithNtpServerRemoveUseCase_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            NtpServer = $script:ntpServerRemoveUseCase\n        }\n    }\n}\n\nConfiguration VMHostNtpSettings_WithTheSameNtpServicePolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            NtpServicePolicy = $script:vmhostNtpServicePolicyValue\n        }\n    }\n}\n\nConfiguration VMHostNtpSettings_WithNtpServicePolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            NtpServicePolicy = $script:ntpServicePolicy\n        }\n    }\n}\n\nVMHostNtpSettings_WithoutNtpServerAndNtpServicePolicy_Config -OutputPath \"$integrationTestsFolderPath\\VMHostNtpSettings_WithoutNtpServerAndNtpServicePolicy_Config\" -ConfigurationData $script:configurationData\nVMHostNtpSettings_WithEmptyArrayNtpServer_Config -OutputPath \"$integrationTestsFolderPath\\VMHostNtpSettings_WithEmptyArrayNtpServer_Config\" -ConfigurationData $script:configurationData\nVMHostNtpSettings_WithNtpServerAddUseCase_Config -OutputPath \"$integrationTestsFolderPath\\VMHostNtpSettings_WithNtpServerAddUseCase_Config\" -ConfigurationData $script:configurationData\nVMHostNtpSettings_WithNtpServerRemoveUseCase_Config -OutputPath \"$integrationTestsFolderPath\\VMHostNtpSettings_WithNtpServerRemoveUseCase_Config\" -ConfigurationData $script:configurationData\nVMHostNtpSettings_WithTheSameNtpServicePolicy_Config -OutputPath \"$integrationTestsFolderPath\\VMHostNtpSettings_WithTheSameNtpServicePolicy_Config\" -ConfigurationData $script:configurationData\nVMHostNtpSettings_WithNtpServicePolicy_Config -OutputPath \"$integrationTestsFolderPath\\VMHostNtpSettings_WithNtpServicePolicy_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostPciPassthrough/VMHostPciPassthrough_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $PciDeviceId\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostPciPassthrough_WhenEnablingPassthru_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPciPassthrough vmHostPciPassthrough {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            Id = $PciDeviceId\n            Enabled = $true\n        }\n    }\n}\n\nConfiguration VMHostPciPassthrough_WhenDisablingPassthru_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPciPassthrough vmHostPciPassthrough {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            Id = $PciDeviceId\n            Enabled = $false\n        }\n    }\n}\n\nVMHostPciPassthrough_WhenEnablingPassthru_Config -OutputPath \"$integrationTestsFolderPath\\VMHostPciPassthrough_WhenEnablingPassthru_Config\" -ConfigurationData $script:configurationData\nVMHostPciPassthrough_WhenDisablingPassthru_Config -OutputPath \"$integrationTestsFolderPath\\VMHostPciPassthrough_WhenDisablingPassthru_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostPermission/VMHostPermission_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostPermission_CreateVMHostRoles_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole ($AllNodes.VMHostRoleResourceName + $AllNodes.RoleOneName) {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleOneName\n            Ensure = 'Present'\n        }\n\n        VMHostRole ($AllNodes.VMHostRoleResourceName + $AllNodes.RoleTwoName) {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleTwoName\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForDatacenterEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.DatacenterEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'Datacenter'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForVMHostEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMHostEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'VMHost'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForDatastoreEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.DatastoreEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'Datastore'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForResourcePoolEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.ResourcePoolEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'ResourcePool'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForVMEntityWithEmptyEntityLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.OneResourcePoolEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_CreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.OneResourcePoolAndOneVAppEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Present'\n            Propagate = $AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_ModifyVMHostPermissionRoleAndPropagateBehaviour_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.OneResourcePoolAndOneVAppEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleTwoName\n            Ensure = 'Present'\n            Propagate = !$AllNodes.PropagatePermission\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForDatacenterEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.DatacenterEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'Datacenter'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForVMHostEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMHostEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'VMHost'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForDatastoreEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.DatastoreEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'Datastore'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForResourcePoolEntity_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.ResourcePoolEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'ResourcePool'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForVMEntityWithEmptyEntityLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.EmptyEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.OneResourcePoolEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPermission $AllNodes.VMHostPermissionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            EntityName = $AllNodes.VMEntityName\n            EntityLocation = $AllNodes.OneResourcePoolAndOneVAppEntityLocation\n            EntityType = 'VM'\n            PrincipalName = $AllNodes.VMHostUserAccountName\n            RoleName = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostPermission_RemoveVMHostRoles_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole ($AllNodes.VMHostRoleResourceName + $AllNodes.RoleOneName) {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleOneName\n            Ensure = 'Absent'\n        }\n\n        VMHostRole ($AllNodes.VMHostRoleResourceName + $AllNodes.RoleTwoName) {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleTwoName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostPhysicalNic/VMHostPhysicalNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostPhysicalNic_WhenSpeedAndDuplexSettingsAreConfiguredAutomatically_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPhysicalNic $AllNodes.PhysicalNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.PhysicalNetworkAdapter\n            AutoNegotiate = $true\n        }\n    }\n}\n\nConfiguration VMHostPhysicalNic_WhenAutoNegotiateIsNotSpecified_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPhysicalNic $AllNodes.PhysicalNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.PhysicalNetworkAdapter\n            Duplex = $AllNodes.FullDuplex\n            BitRatePerSecMb = $AllNodes.FullDuplexBitRatePerSecMb\n        }\n    }\n}\n\nConfiguration VMHostPhysicalNic_WhenAutoNegotiateIsSetToFalse_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPhysicalNic $AllNodes.PhysicalNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.PhysicalNetworkAdapter\n            Duplex = $AllNodes.HalfDuplex\n            BitRatePerSecMb = $AllNodes.HalfDuplexBitRatePerSecMb\n            AutoNegotiate = !$AllNodes.AutoNegotiate\n        }\n    }\n}\n\nConfiguration VMHostPhysicalNic_WhenAutoNegotiateIsSetToTrue_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPhysicalNic $AllNodes.PhysicalNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.PhysicalNetworkAdapter\n            Duplex = $AllNodes.FullDuplex\n            BitRatePerSecMb = $AllNodes.DefaultBitRatePerSecMb\n            AutoNegotiate = $AllNodes.AutoNegotiate\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostPowerPolicy/VMHostPowerPolicy_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:viServerCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostPowerPolicy_WhenPowerPolicyIsBalanced_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPowerPolicy vmHostPowerPolicy {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            PowerPolicy = $script:balancedPowerPolicy\n        }\n    }\n}\n\nConfiguration VMHostPowerPolicy_WhenPowerPolicyIsHighPerformance_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPowerPolicy vmHostPowerPolicy {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            PowerPolicy = $script:highPerformancePowerPolicy\n        }\n    }\n}\n\nConfiguration VMHostPowerPolicy_WhenPowerPolicyIsLowPower_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPowerPolicy vmHostPowerPolicy {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            PowerPolicy = $script:lowPowerPowerPolicy\n        }\n    }\n}\n\nConfiguration VMHostPowerPolicy_WhenPowerPolicyIsCustom_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostPowerPolicy vmHostPowerPolicy {\n            Name = $Name\n            Server = $Server\n            Credential = $script:viServerCredential\n            PowerPolicy = $script:customPowerPolicy\n        }\n    }\n}\n\nVMHostPowerPolicy_WhenPowerPolicyIsBalanced_Config -OutputPath \"$integrationTestsFolderPath\\VMHostPowerPolicy_WhenPowerPolicyIsBalanced_Config\" -ConfigurationData $script:configurationData\nVMHostPowerPolicy_WhenPowerPolicyIsHighPerformance_Config -OutputPath \"$integrationTestsFolderPath\\VMHostPowerPolicy_WhenPowerPolicyIsHighPerformance_Config\" -ConfigurationData $script:configurationData\nVMHostPowerPolicy_WhenPowerPolicyIsLowPower_Config -OutputPath \"$integrationTestsFolderPath\\VMHostPowerPolicy_WhenPowerPolicyIsLowPower_Config\" -ConfigurationData $script:configurationData\nVMHostPowerPolicy_WhenPowerPolicyIsCustom_Config -OutputPath \"$integrationTestsFolderPath\\VMHostPowerPolicy_WhenPowerPolicyIsCustom_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostRole/VMHostRole_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostRole_CreateRole_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole $AllNodes.VMHostRoleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleName\n            Ensure = 'Present'\n            PrivilegeIds = $AllNodes.SystemPrivilegeIds\n        }\n    }\n}\n\nConfiguration VMHostRole_CreateRoleWithPrivileges_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole $AllNodes.VMHostRoleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleName\n            Ensure = 'Present'\n            PrivilegeIds = $AllNodes.HostInventoryPrivilegeIds + $AllNodes.SystemPrivilegeIds\n        }\n    }\n}\n\nConfiguration VMHostRole_ModifyRolePrivileges_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole $AllNodes.VMHostRoleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleName\n            Ensure = 'Present'\n            PrivilegeIds = $AllNodes.DesiredPrivilegeIds\n        }\n    }\n}\n\nConfiguration VMHostRole_RemoveRole_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostRole $AllNodes.VMHostRoleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.RoleName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostSNMPAgent/VMHostSNMPAgent_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostSNMPAgent_ModifyVMHostSNMPAgentConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSNMPAgent $AllNodes.VMHostSNMPAgentResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Authentication = $AllNodes.SNMPAgentAuthenticationProtocol\n            Enable = $AllNodes.EnableSNMPAgent\n            Hwsrc = $AllNodes.SNMPAgentHwsrc\n            LargeStorage = $AllNodes.SNMPAgentLargeStorage\n            LogLevel = $AllNodes.SNMPAgentLogLevel\n            Port = $AllNodes.SNMPAgentPort\n            Privacy = $AllNodes.SNMPAgentPrivacyProtocol\n        }\n    }\n}\n\nConfiguration VMHostSNMPAgent_ResetVMHostSNMPAgentConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSNMPAgent $AllNodes.VMHostSNMPAgentResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Reset = $AllNodes.ResetSNMPAgent\n        }\n    }\n}\n\nConfiguration VMHostSNMPAgent_ModifyVMHostSNMPAgentConfigurationToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSNMPAgent $AllNodes.VMHostSNMPAgentResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Authentication = $AllNodes.InitialVMHostSNMPAgentAuthentication\n            Communities = $AllNodes.InitialVMHostSNMPAgentCommunities\n            Enable = $AllNodes.InitialVMHostSNMPAgentEnableState\n            EngineId = $AllNodes.InitialVMHostSNMPAgentEngineId\n            Hwsrc = $AllNodes.InitialVMHostSNMPAgentHwsrc\n            LargeStorage = $AllNodes.InitialVMHostSNMPAgentLargeStorage\n            LogLevel = $AllNodes.InitialVMHostSNMPAgentLogLevel\n            NoTraps = $AllNodes.InitialVMHostSNMPAgentNoTraps\n            Port = $AllNodes.InitialVMHostSNMPAgentPort\n            Privacy = $AllNodes.InitialVMHostSNMPAgentPrivacy\n            RemoteUsers = $AllNodes.InitialVMHostSNMPAgentRemoteUsers\n            SysContact = $AllNodes.InitialVMHostSNMPAgentSysContact\n            SysLocation = $AllNodes.InitialVMHostSNMPAgentSysLocation\n            Targets = $AllNodes.InitialVMHostSNMPAgentTargets\n            Users = $AllNodes.InitialVMHostSNMPAgentUsers\n            V3Targets = $AllNodes.InitialVMHostSNMPAgentV3Targets\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostSatpClaimRule/VMHostSatpClaimRule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:ruleName = \"VMW_SATP_LOCAL\"\n$script:pspOptions = \"VMW_SATP_LOCAL PSPOption\"\n$script:transport = \"VMW_SATP_LOCAL Transport\"\n$script:description = \"Description of VMW_SATP_LOCAL Claim Rule.\"\n$script:type = \"transport\"\n$script:psp = \"VMW_PSP_MRU\"\n$script:options = \"VMW_PSP_MRUOption\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostSatpClaimRule_WithClaimRuleToAdd_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSatpClaimRule vmHostSatpClaimRule {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Ensure = \"Present\"\n            RuleName = $script:ruleName\n            PSPOptions = $script:pspOptions\n            Transport = $script:transport\n            Description = $script:description\n            Type = $script:type\n            Psp = $script:psp\n            Options = $script:options\n        }\n    }\n}\n\nConfiguration VMHostSatpClaimRule_WithClaimRuleToRemove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSatpClaimRule vmHostSatpClaimRule {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Ensure = \"Absent\"\n            RuleName = $script:ruleName\n            PSPOptions = $script:pspOptions\n            Transport = $script:transport\n            Description = $script:description\n            Type = $script:type\n            Psp = $script:psp\n            Options = $script:options\n        }\n    }\n}\n\nVMHostSatpClaimRule_WithClaimRuleToAdd_Config -OutputPath \"$integrationTestsFolderPath\\VMHostSatpClaimRule_WithClaimRuleToAdd_Config\" -ConfigurationData $script:configurationData\nVMHostSatpClaimRule_WithClaimRuleToRemove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostSatpClaimRule_WithClaimRuleToRemove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostScsiLun/VMHostScsiLun_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLun $AllNodes.VMHostScsiLunResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            MultipathPolicy = $AllNodes.ScsiLunRoundRobinMultipathPolicy\n            PreferredScsiLunPathName = $AllNodes.ScsiLunPathName\n            BlocksToSwitchPath = $AllNodes.ScsiLunBlocksToSwitchPath\n            CommandsToSwitchPath = $AllNodes.ScsiLunCommandsToSwitchPath\n            IsLocal = $AllNodes.ScsiLunIsLocal\n            IsSsd = $AllNodes.ScsiLunIsSsd\n        }\n    }\n}\n\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLun $AllNodes.VMHostScsiLunResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            MultipathPolicy = $AllNodes.ScsiLunFixedMultipathPolicy\n            PreferredScsiLunPathName = $AllNodes.ScsiLunPathName\n            BlocksToSwitchPath = $AllNodes.ScsiLunBlocksToSwitchPath\n            CommandsToSwitchPath = $AllNodes.ScsiLunCommandsToSwitchPath\n            IsLocal = $AllNodes.ScsiLunIsLocal\n            IsSsd = $AllNodes.ScsiLunIsSsd\n        }\n    }\n}\n\nConfiguration VMHostScsiLun_ModifyVMHostScsiLunConfigurationToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLun $AllNodes.VMHostScsiLunResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            CanonicalName = $AllNodes.ScsiLunCanonicalName\n            MultipathPolicy = $AllNodes.InitialScsiLunMultipathPolicy\n            PreferredScsiLunPathName = $AllNodes.ScsiLunPathName\n            BlocksToSwitchPath = $AllNodes.InitialScsiLunBlocksToSwitchPath\n            CommandsToSwitchPath = $AllNodes.InitialScsiLunCommandsToSwitchPath\n            IsLocal = $AllNodes.InitialScsiLunIsLocal\n            IsSsd = $AllNodes.InitialScsiLunIsSsd\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostScsiLunPath/VMHostScsiLunPath_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostScsiLunPath_ConfigureScsiLunPathToBeActiveAndPreferred_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLunPath $AllNodes.VMHostScsiLunPathResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ScsiLunPathName\n            ScsiLunCanonicalName = $AllNodes.ScsiLunCanonicalName\n            Active = $AllNodes.ScsiLunPathActive\n            Preferred = $AllNodes.ScsiLunPathPreferred\n        }\n    }\n}\n\nConfiguration VMHostScsiLunPath_ConfigureScsiLunPathToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostScsiLunPath $AllNodes.VMHostScsiLunPathResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ScsiLunPathName\n            ScsiLunCanonicalName = $AllNodes.ScsiLunCanonicalName\n            Active = $AllNodes.InitialScsiLunPathState\n            Preferred = $AllNodes.InitialScsiLunPathPreferred\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostService/VMHostService_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:ServiceKey = 'TSM-SSH'\n$script:ServicePolicyUnset = 'Unset'\n$script:ServicePolicyOn = 'On'\n$script:ServicePolicyOff = 'Off'\n$script:ServiceRunningFalse = $false\n$script:ServiceRunningTrue = $true\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostService_WithServicePolicyUnset_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostService vmHostServiceSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Key = $script:ServiceKey\n            Policy = $script:ServicePolicyUnset\n            Running = $script:ServiceRunningFalse\n        }\n    }\n}\n\nConfiguration VMHostService_WithServicePolicyOn_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostService vmHostServiceSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Key = $script:ServiceKey\n            Policy = $script:ServicePolicyOn\n            Running = $script:ServiceRunningFalse\n        }\n    }\n}\n\nConfiguration VMHostService_WithServicePolicyOff_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostService vmHostServiceSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Key = $script:ServiceKey\n            Policy = $script:ServicePolicyOff\n            Running = $script:ServiceRunningFalse\n        }\n    }\n}\n\nConfiguration VMHostService_WithServicePolicyOnAndRunning_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostService vmHostServiceSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Key = $script:ServiceKey\n            Policy = $script:ServicePolicyOn\n            Running = $script:ServiceRunningTrue\n        }\n    }\n}\n\nVMHostService_WithServicePolicyUnset_Config -OutputPath \"$integrationTestsFolderPath\\VMHostService_WithServicePolicyUnset_Config\" -ConfigurationData $script:configurationData\nVMHostService_WithServicePolicyOn_Config -OutputPath \"$integrationTestsFolderPath\\VMHostService_WithServicePolicyOn_Config\" -ConfigurationData $script:configurationData\nVMHostService_WithServicePolicyOff_Config -OutputPath \"$integrationTestsFolderPath\\VMHostService_WithServicePolicyOff_Config\" -ConfigurationData $script:configurationData\nVMHostService_WithServicePolicyOnAndRunning_Config -OutputPath \"$integrationTestsFolderPath\\VMHostService_WithServicePolicyOnAndRunning_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostSettings/VMHostSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:motd = 'VMHostSettings motd test'\n$script:issue = 'VMHostSettings issue test'\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostSettings vmHostSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Motd = $script:motd\n            Issue = $script:issue\n        }\n    }\n}\n\nVMHostSettings_Config -OutputPath \"$integrationTestsFolderPath\\VMHostSettings_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostSharedSwapSpace/VMHostSharedSwapSpace_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostSharedSwapSpace_CreateVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostSharedSwapSpace_ModifySharedSwapSpaceConfiguration_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSharedSwapSpace $AllNodes.VMHostSharedSwapSpaceResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DatastoreEnabled = $AllNodes.DatastoreEnabled\n            DatastoreName = $AllNodes.DatastoreName\n            DatastoreOrder = $AllNodes.DatastoreOrder\n            HostCacheEnabled = $AllNodes.HostCacheEnabled\n            HostCacheOrder = $AllNodes.HostCacheOrder\n            HostLocalSwapEnabled = $AllNodes.HostLocalSwapEnabled\n            HostLocalSwapOrder = $AllNodes.HostLocalSwapOrder\n        }\n    }\n}\n\nConfiguration VMHostSharedSwapSpace_ModifySharedSwapSpaceConfigurationToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSharedSwapSpace $AllNodes.VMHostSharedSwapSpaceResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DatastoreEnabled = $AllNodes.InitialDatastoreEnabled\n            DatastoreName = $AllNodes.InitialDatastoreName\n            DatastoreOrder = $AllNodes.InitialDatastoreOrder\n            HostCacheEnabled = $AllNodes.InitialHostCacheEnabled\n            HostCacheOrder = $AllNodes.InitialHostCacheOrder\n            HostLocalSwapEnabled = $AllNodes.InitialHostLocalSwapEnabled\n            HostLocalSwapOrder = $AllNodes.InitialHostLocalSwapOrder\n        }\n    }\n}\n\nConfiguration VMHostSharedSwapSpace_RemoveVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostSoftwareDevice/VMHostSoftwareDevice_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostSoftwareDevice_AddSoftwareDevice_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSoftwareDevice $AllNodes.VMHostSoftwareDeviceResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DeviceIdentifier = $AllNodes.DeviceId\n            Ensure = 'Present'\n            InstanceAddress = $AllNodes.InstanceAddress\n        }\n    }\n}\n\nConfiguration VMHostSoftwareDevice_RemoveSoftwareDevice_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSoftwareDevice $AllNodes.VMHostSoftwareDeviceResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DeviceIdentifier = $AllNodes.DeviceId\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostSyslog/VMHostSyslog_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $LogHostOne,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $LogHostTwo\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\n. (Join-Path -Path (Join-Path -Path $integrationTestsFolderPath -ChildPath 'TestHelpers') -ChildPath 'IntegrationTests.Constants.ps1')\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\nConfiguration VMHostSyslog_WithDefaultSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSyslog vmHostSyslogSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Loghost = $LogHostOne\n            CheckSslCerts = $script:checkSslCerts\n            DefaultRotate = $script:defaultRotate\n            DefaultSize = $script:defaultSize\n            DefaultTimeout = $script:defaultTimeout\n            Logdir = $script:logdirOne\n            LogdirUnique = $script:logdirUnique\n            DropLogRotate = $script:dropLogRotate\n            DropLogSize = $script:dropLogSize\n            QueueDropMark = $script:queueDropMark\n        }\n    }\n}\n\nConfiguration VMHostSyslog_WithNotDefaultSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostSyslog vmHostSyslogSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            Loghost = $LogHostTwo\n            CheckSslCerts = !$script:checkSslCerts\n            DefaultRotate = $script:defaultRotate + 1\n            DefaultSize = $script:defaultSize + 1\n            DefaultTimeout = $script:defaultTimeout + 1\n            Logdir = $script:logdirTwo\n            LogdirUnique = !$script:logdirUnique\n            DropLogRotate = $script:dropLogRotate + 1\n            DropLogSize = $script:dropLogSize + 1\n            QueueDropMark = $script:queueDropMark + 1\n        }\n    }\n}\n\nVMHostSyslog_WithDefaultSettings_Config -OutputPath \"$integrationTestsFolderPath\\VMHostSyslog_WithDefaultSettings_Config\" -ConfigurationData $script:configurationData\nVMHostSyslog_WithNotDefaultSettings_Config -OutputPath \"$integrationTestsFolderPath\\VMHostSyslog_WithNotDefaultSettings_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostTpsSettings/VMHostTpsSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:shareScanTime = 50\n$script:shareForceSalting = 1\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostTpsSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostTpsSettings vmHostTpsSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            ShareScanTime = $script:shareScanTime\n            ShareForceSalting = $script:shareForceSalting\n        }\n    }\n}\n\nVMHostTpsSettings_Config -OutputPath \"$integrationTestsFolderPath\\VMHostTpsSettings_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVDSwitchMigration/VMHostVDSwitchMigration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVDSwitchMigration_CreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss $AllNodes.VMHostVssResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n        }\n\n        VMHostVssPortGroup $AllNodes.VMHostVssPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.PortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.PortGroupVLanId\n            DependsOn = $AllNodes.VMHostVssResourceId\n        }\n\n        VDSwitch $AllNodes.VDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDSwitchName\n            Location = $AllNodes.VDSwitchLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n\n        VDSwitchVMHost $AllNodes.VDSwitchVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VdsName = $AllNodes.VDSwitchName\n            VMHostNames = @($AllNodes.VMHostName)\n            Ensure = 'Present'\n            DependsOn = $AllNodes.VDSwitchResourceId\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_CreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.VMHostVssManagementNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.ManagementPortGroupName\n            Ensure = 'Present'\n            ManagementTrafficEnabled = $AllNodes.ManagementTrafficEnabled\n        }\n\n        VMHostVssNic $AllNodes.VMHostVssvMotionNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.VMotionPortGroupName\n            Ensure = 'Present'\n            VMotionEnabled = $AllNodes.VMotionEnabled\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateThreePhysicalNetworkAdaptersToStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration $AllNodes.VMHostVssMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateOneDisconnectedPhysicalNetworkAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = @($AllNodes.PhysicalNetworkAdapterNames[0])\n            MigratePhysicalNicsOnly = $AllNodes.MigratePhysicalNicsOnly\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateTwoDisconnectedPhysicalNetworkAdapters_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = @($AllNodes.PhysicalNetworkAdapterNames[0], $AllNodes.PhysicalNetworkAdapterNames[1])\n            MigratePhysicalNicsOnly = $AllNodes.MigratePhysicalNicsOnly\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n            MigratePhysicalNicsOnly = $AllNodes.MigratePhysicalNicsOnly\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = @($AllNodes.PhysicalNetworkAdapterNames[0])\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.PortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = @($AllNodes.PhysicalNetworkAdapterNames[0])\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.ManagementPortGroupName, $AllNodes.VMotionPortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = @($AllNodes.PhysicalNetworkAdapterNames[0], $AllNodes.PhysicalNetworkAdapterNames[1])\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.PortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = @($AllNodes.PhysicalNetworkAdapterNames[0], $AllNodes.PhysicalNetworkAdapterNames[1])\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.ManagementPortGroupName, $AllNodes.VMotionPortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.PortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.ManagementPortGroupName, $AllNodes.VMotionPortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_RemoveVDSwitchStandardSwitchAndStandardPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.VDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDSwitchName\n            Location = $AllNodes.VDSwitchLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n\n        VMHostVssPortGroup $AllNodes.VMHostVssPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.PortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VDSwitchResourceId\n        }\n\n        VMHostVss $AllNodes.VMHostVssResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VMHostVssPortGroupResourceId\n        }\n    }\n}\n\nConfiguration VMHostVDSwitchMigration_MigratePhysicalNetworkAdaptersToInitialVirtualSwitches_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($virtualSwitchName in $AllNodes.VirtualSwitches.Keys) {\n            VMHostVssBridge ($AllNodes.VMHostVssBridgeResourceName + $virtualSwitchName) {\n                Server = $AllNodes.Server\n                Credential = $AllNodes.Credential\n                Name = $AllNodes.VMHostName\n                VssName = $virtualSwitchName\n                Ensure = 'Present'\n                NicDevice = $AllNodes.VirtualSwitches.$virtualSwitchName.Nic\n                LinkDiscoveryProtocolOperation = $AllNodes.LinkDiscoveryProtocolOperation\n                LinkDiscoveryProtocolProtocol = $AllNodes.LinkDiscoveryProtocolProtocol\n            }\n\n            VMHostVssTeaming ($AllNodes.VMHostVssTeamingResourceName + $virtualSwitchName) {\n                Server = $AllNodes.Server\n                Credential = $AllNodes.Credential\n                Name = $AllNodes.VMHostName\n                VssName = $virtualSwitchName\n                Ensure = 'Present'\n                ActiveNic = $AllNodes.VirtualSwitches.$virtualSwitchName.ActiveNic\n                StandbyNic = $AllNodes.VirtualSwitches.$virtualSwitchName.StandbyNic\n                CheckBeacon = $AllNodes.VirtualSwitches.$virtualSwitchName.FailureCriteria.CheckBeacon\n                NotifySwitches = $AllNodes.VirtualSwitches.$virtualSwitchName.NotifySwitches\n                Policy = $AllNodes.VirtualSwitches.$virtualSwitchName.Policy\n                RollingOrder = $AllNodes.VirtualSwitches.$virtualSwitchName.RollingOrder\n                DependsOn = \"[$($AllNodes.VMHostVssBridgeResourceName)]$($AllNodes.VMHostVssBridgeResourceName)$virtualSwitchName\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVMKernelActiveDumpFile/VMHostVMKernelActiveDumpFile_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVMKernelActiveDumpFile_CreateVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostVMKernelActiveDumpFile_CreateVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelDumpFile $AllNodes.VMHostVMKernelDumpFileResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DatastoreName = $AllNodes.DatastoreName\n            FileName = $AllNodes.DumpFileName\n            Size = $AllNodes.DumpFileSize\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelActiveDumpFile $AllNodes.VMHostVMKernelActiveDumpFileResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enable = $AllNodes.EnableVMKernelDumpFile\n            Smart = $AllNodes.UseSmartAlgorithmForVMKernelDumpFile\n        }\n    }\n}\n\nConfiguration VMHostVMKernelActiveDumpFile_DisableVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelActiveDumpFile $AllNodes.VMHostVMKernelActiveDumpFileResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enable = $AllNodes.DisableVMKernelDumpFile\n        }\n    }\n}\n\nConfiguration VMHostVMKernelActiveDumpFile_RemoveVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelDumpFile $AllNodes.VMHostVMKernelDumpFileResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DatastoreName = $AllNodes.DatastoreName\n            FileName = $AllNodes.DumpFileName\n            Ensure = 'Absent'\n            Force = $AllNodes.Force\n        }\n    }\n}\n\nConfiguration VMHostVMKernelActiveDumpFile_RemoveVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVMKernelActiveDumpPartition/VMHostVMKernelActiveDumpPartition_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelActiveDumpPartition $AllNodes.VMHostVMKernelActiveDumpPartitionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enable = $AllNodes.EnableVMKernelDumpPartition\n            Smart = $AllNodes.UseSmartAlgorithmForVMKernelDumpPartition\n        }\n    }\n}\n\nConfiguration VMHostVMKernelActiveDumpPartition_DisableVMKernelDumpPartition_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelActiveDumpPartition $AllNodes.VMHostVMKernelActiveDumpPartitionResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enable = $AllNodes.DisableVMKernelDumpPartition\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVMKernelDumpFile_CreateVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostVMKernelDumpFile_CreateVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelDumpFile $AllNodes.VMHostVMKernelDumpFileResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DatastoreName = $AllNodes.DatastoreName\n            FileName = $AllNodes.DumpFileName\n            Size = $AllNodes.DumpFileSize\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostVMKernelDumpFile_RemoveVMKernelDumpFile_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelDumpFile $AllNodes.VMHostVMKernelDumpFileResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            DatastoreName = $AllNodes.DatastoreName\n            FileName = $AllNodes.DumpFileName\n            Ensure = 'Absent'\n            Force = $AllNodes.Force\n        }\n    }\n}\n\nConfiguration VMHostVMKernelDumpFile_RemoveVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVMKernelModule/VMHostVMKernelModule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVMKernelModule_EnableVMKernelModule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelModule $AllNodes.VMHostVMKernelModuleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Module = $AllNodes.VMKernelModuleName\n            Enabled = $AllNodes.EnableVMKernelModule\n            Force = $AllNodes.Force\n        }\n    }\n}\n\nConfiguration VMHostVMKernelModule_DisableVMKernelModule_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelModule $AllNodes.VMHostVMKernelModuleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Module = $AllNodes.VMKernelModuleName\n            Enabled = $AllNodes.DisableVMKernelModule\n        }\n    }\n}\n\nConfiguration VMHostVMKernelModule_ModifyVMKernelModuleToInitialState_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVMKernelModule $AllNodes.VMHostVMKernelModuleResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Module = $AllNodes.VMKernelModuleName\n            Enabled = $AllNodes.InitialVMKernelModuleState\n            Force = $AllNodes.Force\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVss/VMHostVss_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:VssName = 'VSSDSC'\n$script:EnsurePresent = 'Present'\n$script:EnsureAbsent = 'Absent'\n$script:Mtu = 1500\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostVss_New_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n    }\n}\n\nConfiguration VMHostVss_Modify_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu + 1\n        }\n    }\n}\n\nConfiguration VMHostVss_Remove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsureAbsent\n        }\n    }\n}\n\nVMHostVss_New_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVss_New_Config\" -ConfigurationData $script:configurationData\nVMHostVss_Modify_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVss_Modify_Config\" -ConfigurationData $script:configurationData\nVMHostVss_Remove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVss_Remove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssBridge/VMHostVssBridge_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [AllowEmptyCollection()]\n    [string[]]\n    $NicDevice,\n\n    [Parameter(Mandatory = $true)]\n    [AllowEmptyCollection()]\n    [string[]]\n    $NicDeviceAlt\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:VssName = 'VSSDSC'\n$script:Mtu = 1500\n$script:EnsurePresent = 'Present'\n$script:EnsureAbsent = 'Absent'\n$script:BeaconInterval = 1\n$script:BeaconIntervalAlt = 5\n$script:LinkDiscoveryProtocolProtocol = 'CDP'\n$script:LinkDiscoveryProtocolOperation = 'Listen'\n$script:LinkDiscoveryProtocolProtocolAlt = 'CDP'\n$script:LinkDiscoveryProtocolOperationAlt = 'Both'\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostVssBridge_Create_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssBridge vmHostVssBridgeSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            NicDevice = $NicDevice\n            BeaconInterval = $script:BeaconInterval\n            LinkDiscoveryProtocolProtocol = $script:LinkDiscoveryProtocolProtocol\n            LinkDiscoveryProtocolOperation = $script:LinkDiscoveryProtocolOperation\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nConfiguration VMHostVssBridge_Modify_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssBridge vmHostVssBridgeSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            NicDevice = $NicDeviceAlt\n            BeaconInterval = $script:BeaconIntervalAlt\n            LinkDiscoveryProtocolProtocol = $script:LinkDiscoveryProtocolProtocolAlt\n            LinkDiscoveryProtocolOperation = $script:LinkDiscoveryProtocolOperationAlt\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nConfiguration VMHostVssBridge_Remove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssBridge vmHostVssBridgeSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:Absent\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nVMHostVssBridge_Create_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssBridge_Create_Config\" -ConfigurationData $script:configurationData\nVMHostVssBridge_Modify_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssBridge_Modify_Config\" -ConfigurationData $script:configurationData\nVMHostVssBridge_Remove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssBridge_Remove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssMigration/VMHostVssMigration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVssMigration_CreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.VDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDSwitchName\n            Location = $AllNodes.VDSwitchLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n\n        VDPortGroup $AllNodes.ManagementVDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ManagementPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            DependsOn = $AllNodes.VDSwitchResourceId\n        }\n\n        VDPortGroup $AllNodes.VMotionVDPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMotionPortGroupName\n            VdsName = $AllNodes.VDSwitchName\n            Ensure = 'Present'\n            DependsOn = $AllNodes.VDSwitchResourceId\n        }\n\n        VMHostVss $AllNodes.VMHostVssResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n        }\n\n        VDSwitchVMHost $AllNodes.VDSwitchVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VdsName = $AllNodes.VDSwitchName\n            VMHostNames = @($AllNodes.VMHostName)\n            Ensure = 'Present'\n            DependsOn = $AllNodes.VDSwitchResourceId\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_MigrateThreePhysicalNetworkAdaptersToDistributedSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVDSwitchMigration $AllNodes.VMHostVDSwitchMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_MigrateThreePhysicalNetworkAdaptersToStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration $AllNodes.VMHostVssMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_MigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration $AllNodes.VMHostVssMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_MigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssMigration $AllNodes.VMHostVssMigrationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PhysicalNicNames = $AllNodes.PhysicalNetworkAdapterNames\n            VMKernelNicNames = $AllNodes.VMKernelNetworkAdapterNames\n            PortGroupNames = @($AllNodes.ManagementPortGroupName, $AllNodes.VMotionPortGroupName)\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_RemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.VMHostVssManagementNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroupNamesWithVMKernelPrefix[0]\n            Ensure = 'Absent'\n        }\n\n        VMHostVssNic $AllNodes.VMHostVssvMotionNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroupNamesWithVMKernelPrefix[1]\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_RemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.VMHostVssManagementNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.ManagementPortGroupName\n            Ensure = 'Absent'\n        }\n\n        VMHostVssNic $AllNodes.VMHostVssvMotionNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.VMotionPortGroupName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_RemoveVDSwitchAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VDSwitch $AllNodes.VDSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VDSwitchName\n            Location = $AllNodes.VDSwitchLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n\n        VMHostVssPortGroup $AllNodes.ManagementStandardPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ManagementPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n\n        VMHostVssPortGroup $AllNodes.VMotionStandardPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMotionPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n\n        foreach ($portGroupNameWithVMKernelPrefix in $AllNodes.PortGroupNamesWithVMKernelPrefix) {\n            VMHostVssPortGroup $portGroupNameWithVMKernelPrefix {\n                Server = $AllNodes.Server\n                Credential = $AllNodes.Credential\n                VMHostName = $AllNodes.VMHostName\n                Name = $portGroupNameWithVMKernelPrefix\n                VssName = $AllNodes.StandardSwitchName\n                Ensure = 'Absent'\n            }\n        }\n\n        VMHostVss $AllNodes.VMHostVssResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = @($AllNodes.ManagementStandardPortGroupResourceId, $AllNodes.VMotionStandardPortGroupResourceId)\n        }\n    }\n}\n\nConfiguration VMHostVssMigration_MigratePhysicalNetworkAdaptersToInitialVirtualSwitches_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        foreach ($virtualSwitchName in $AllNodes.VirtualSwitches.Keys) {\n            VMHostVssBridge ($AllNodes.VMHostVssBridgeResourceName + $virtualSwitchName) {\n                Server = $AllNodes.Server\n                Credential = $AllNodes.Credential\n                Name = $AllNodes.VMHostName\n                VssName = $virtualSwitchName\n                Ensure = 'Present'\n                NicDevice = $AllNodes.VirtualSwitches.$virtualSwitchName.Nic\n                LinkDiscoveryProtocolOperation = $AllNodes.LinkDiscoveryProtocolOperation\n                LinkDiscoveryProtocolProtocol = $AllNodes.LinkDiscoveryProtocolProtocol\n            }\n\n            VMHostVssTeaming ($AllNodes.VMHostVssTeamingResourceName + $virtualSwitchName) {\n                Server = $AllNodes.Server\n                Credential = $AllNodes.Credential\n                Name = $AllNodes.VMHostName\n                VssName = $virtualSwitchName\n                Ensure = 'Present'\n                ActiveNic = $AllNodes.VirtualSwitches.$virtualSwitchName.ActiveNic\n                StandbyNic = $AllNodes.VirtualSwitches.$virtualSwitchName.StandbyNic\n                CheckBeacon = $AllNodes.VirtualSwitches.$virtualSwitchName.FailureCriteria.CheckBeacon\n                NotifySwitches = $AllNodes.VirtualSwitches.$virtualSwitchName.NotifySwitches\n                Policy = $AllNodes.VirtualSwitches.$virtualSwitchName.Policy\n                RollingOrder = $AllNodes.VirtualSwitches.$virtualSwitchName.RollingOrder\n                DependsOn = \"[$($AllNodes.VMHostVssBridgeResourceName)]$($AllNodes.VMHostVssBridgeResourceName)$virtualSwitchName\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssNic/VMHostVssNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVssNic_WhenAddingVMKernelNetworkAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            Mtu = $AllNodes.StandardSwitchMtu\n        }\n\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Present'\n            IP = $AllNodes.IP1\n            SubnetMask = $AllNodes.SubnetMask1\n            Mac = $AllNodes.Mac\n            AutomaticIPv6 = $AllNodes.AutomaticIPv6\n            IPv6 = $AllNodes.IPv6\n            IPv6ThroughDhcp = $AllNodes.IPv6ThroughDhcp\n            Mtu = $AllNodes.VMKernelNetworkAdapterMtu\n            ManagementTrafficEnabled = $AllNodes.ManagementTrafficEnabled\n            FaultToleranceLoggingEnabled = $AllNodes.FaultToleranceLoggingEnabled\n            VMotionEnabled = $AllNodes.VMotionEnabled\n            VsanTrafficEnabled = $AllNodes.VsanTrafficEnabled\n            DependsOn = $AllNodes.StandardSwitchResourceId\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Present'\n            IP = $AllNodes.IP1\n            SubnetMask = $AllNodes.SubnetMask1\n            Mac = $AllNodes.Mac\n            IPv6 = $AllNodes.IPv6\n            Mtu = $AllNodes.VMKernelNetworkAdapterUpdatedMtu\n            ManagementTrafficEnabled = !$AllNodes.ManagementTrafficEnabled\n            FaultToleranceLoggingEnabled = !$AllNodes.FaultToleranceLoggingEnabled\n            VMotionEnabled = !$AllNodes.VMotionEnabled\n            VsanTrafficEnabled = !$AllNodes.VsanTrafficEnabled\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Present'\n            IP = $AllNodes.IP2\n            SubnetMask = $AllNodes.SubnetMask2\n            Mac = $AllNodes.Mac\n            IPv6 = $AllNodes.IPv6\n            Mtu = $AllNodes.VMKernelNetworkAdapterMtu\n            ManagementTrafficEnabled = $AllNodes.ManagementTrafficEnabled\n            FaultToleranceLoggingEnabled = $AllNodes.FaultToleranceLoggingEnabled\n            VMotionEnabled = $AllNodes.VMotionEnabled\n            VsanTrafficEnabled = $AllNodes.VsanTrafficEnabled\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenUpdatingVMKernelNetworkAdapterIPv6Settings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Present'\n            IP = $AllNodes.IP1\n            SubnetMask = $AllNodes.SubnetMask1\n            Mac = $AllNodes.Mac\n            AutomaticIPv6 = !$AllNodes.AutomaticIPv6\n            IPv6 = @()\n            IPv6ThroughDhcp = !$AllNodes.IPv6ThroughDhcp\n            Mtu = $AllNodes.VMKernelNetworkAdapterMtu\n            ManagementTrafficEnabled = $AllNodes.ManagementTrafficEnabled\n            FaultToleranceLoggingEnabled = $AllNodes.FaultToleranceLoggingEnabled\n            VMotionEnabled = $AllNodes.VMotionEnabled\n            VsanTrafficEnabled = $AllNodes.VsanTrafficEnabled\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Present'\n            IP = $AllNodes.DefaultIP\n            SubnetMask = $AllNodes.DefaultSubnetMask\n            Mac = $AllNodes.Mac\n            Dhcp = $AllNodes.Dhcp\n            AutomaticIPv6 = !$AllNodes.AutomaticIPv6\n            IPv6 = $AllNodes.DefaultIPv6\n            IPv6ThroughDhcp = !$AllNodes.IPv6ThroughDhcp\n            Mtu = $AllNodes.VMKernelNetworkAdapterMtu\n            IPv6Enabled = !$AllNodes.IPv6Enabled\n            ManagementTrafficEnabled = $AllNodes.ManagementTrafficEnabled\n            FaultToleranceLoggingEnabled = $AllNodes.FaultToleranceLoggingEnabled\n            VMotionEnabled = $AllNodes.VMotionEnabled\n            VsanTrafficEnabled = $AllNodes.VsanTrafficEnabled\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenRemovingVMKernelNetworkAdapter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostVssNic_WhenRemovingVMKernelNetworkAdapterAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.StandardSwitchNetworkAdapterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.PortGroup\n            Ensure = 'Absent'\n        }\n\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.PortGroup\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.StandardSwitchNetworkAdapterResourceId\n        }\n\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VirtualPortGroupResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssPortGroup/VMHostVssPortGroup_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVssPortGroup_WhenAddingVirtualStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            Mtu = $AllNodes.Mtu\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroup_WhenAddingVirtualPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroup_WhenAddingVirtualPortGroupWithVLanId_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.DefaultVLandId\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroup_WhenUpdatingVirtualPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.VLanId\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroup_WhenRemovingVirtualPortGroup_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroup_WhenRemovingVirtualPortGroupAndVirtualStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VirtualPortGroupResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssPortGroupSecurity/VMHostVssPortGroupSecurity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVssPortGroupSecurity_WhenAddingVirtualPortGroupAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            Mtu = $AllNodes.StandardSwitchMtu\n        }\n\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.VLanId\n            DependsOn = $AllNodes.StandardSwitchResourceId\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupSecurity_WhenUpdatingSecurityPolicyWithoutInheritSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupSecurity $AllNodes.VirtualPortGroupSecurityPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            AllowPromiscuous = $AllNodes.AllowPromiscuous\n            ForgedTransmits = $AllNodes.ForgedTransmits\n            MacChanges = $AllNodes.MacChanges\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupSecurity_WhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupSecurity $AllNodes.VirtualPortGroupSecurityPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            AllowPromiscuous = $AllNodes.AllowPromiscuous\n            AllowPromiscuousInherited = $AllNodes.AllowPromiscuousInherited\n            ForgedTransmits = $AllNodes.ForgedTransmits\n            ForgedTransmitsInherited = $AllNodes.ForgedTransmitsInherited\n            MacChanges = $AllNodes.MacChanges\n            MacChangesInherited = $AllNodes.MacChangesInherited\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupSecurity_WhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssSecurity $AllNodes.StandardSwitchSecurityPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            AllowPromiscuous = $AllNodes.AllowPromiscuous\n            ForgedTransmits = !$AllNodes.ForgedTransmits\n            MacChanges = !$AllNodes.MacChanges\n        }\n\n        VMHostVssPortGroupSecurity $AllNodes.VirtualPortGroupSecurityPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            AllowPromiscuous = $AllNodes.AllowPromiscuous\n            AllowPromiscuousInherited = !$AllNodes.AllowPromiscuousInherited\n            ForgedTransmits = !$AllNodes.ForgedTransmits\n            ForgedTransmitsInherited = !$AllNodes.ForgedTransmitsInherited\n            MacChanges = !$AllNodes.MacChanges\n            MacChangesInherited = !$AllNodes.MacChangesInherited\n            DependsOn = $AllNodes.StandardSwitchSecurityPolicyResourceId\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupSecurity_WhenRemovingVirtualPortGroupAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VirtualPortGroupResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssPortGroupShaping/VMHostVssPortGroupShaping_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVssPortGroupShaping_WhenAddingVirtualPortGroupAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            Mtu = $AllNodes.Mtu\n        }\n\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.VLanId\n            DependsOn = $AllNodes.StandardSwitchResourceId\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupShaping_WhenUpdatingShapingPolicyWithEnabledSetToTrue_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupShaping $AllNodes.VirtualPortGroupShapingPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            Enabled = $AllNodes.ShapingEnabled\n            AverageBandwidth = $AllNodes.AverageBandwidth\n            PeakBandwidth = $AllNodes.PeakBandwidth\n            BurstSize = $AllNodes.BurstSize\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupShaping_WhenUpdatingShapingPolicyWithEnabledSetToFalse_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupShaping $AllNodes.VirtualPortGroupShapingPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            Enabled = !$AllNodes.ShapingEnabled\n            BurstSize = $AllNodes.BurstSize\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupShaping_WhenRemovingVirtualPortGroupAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VirtualPortGroupResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssPortGroupTeaming/VMHostVssPortGroupTeaming_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVssPortGroupTeaming_WhenAddingVirtualPortGroupAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            Mtu = $AllNodes.Mtu\n        }\n\n        VMHostVssBridge $AllNodes.StandardSwitchBridgeResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            BeaconInterval = $AllNodes.BeaconInterval\n            LinkDiscoveryProtocolOperation = $AllNodes.LinkDiscoveryProtocolOperation\n            LinkDiscoveryProtocolProtocol = $AllNodes.LinkDiscoveryProtocolProtocol\n            NicDevice = $AllNodes.Nic\n            DependsOn = $AllNodes.StandardSwitchResourceId\n        }\n\n        VMHostVssTeaming $AllNodes.StandardSwitchTeamingPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            CheckBeacon = $AllNodes.CheckBeacon\n            ActiveNic = $AllNodes.StandardSwitchActiveNic\n            StandbyNic = $AllNodes.StandardSwitchStandbyNic\n            NotifySwitches = $AllNodes.NotifySwitches\n            Policy = $AllNodes.NicTeamingPolicy\n            RollingOrder = $AllNodes.RollingOrder\n            DependsOn = $AllNodes.StandardSwitchBridgeResourceId\n        }\n\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            VLanId = $AllNodes.VLanId\n            DependsOn = $AllNodes.StandardSwitchTeamingPolicyResourceId\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupTeaming_WhenUpdatingTeamingPolicyWithoutInheritSettings_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupTeaming $AllNodes.VirtualPortGroupTeamingPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            FailbackEnabled = $AllNodes.FailbackEnabled\n            LoadBalancingPolicy = $AllNodes.LoadBalancingPolicy\n            ActiveNic = $AllNodes.ActiveNic\n            StandbyNic = $AllNodes.StandbyNic\n            UnusedNic = $AllNodes.DefaultUnusedNic\n            NetworkFailoverDetectionPolicy = $AllNodes.NetworkFailoverDetectionPolicyLinkStatus\n            NotifySwitches = $AllNodes.NotifySwitches\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupTeaming_WhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupTeaming $AllNodes.VirtualPortGroupTeamingPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            FailbackEnabled = $AllNodes.FailbackEnabled\n            LoadBalancingPolicy = $AllNodes.LoadBalancingPolicy\n            ActiveNic = $AllNodes.ActiveNic\n            StandbyNic = $AllNodes.DefaultStandbyNic\n            UnusedNic = $AllNodes.UnusedNic\n            NetworkFailoverDetectionPolicy = $AllNodes.NetworkFailoverDetectionPolicyLinkStatus\n            NotifySwitches = $AllNodes.NotifySwitches\n            InheritFailback = $AllNodes.InheritFailback\n            InheritLoadBalancingPolicy = $AllNodes.InheritLoadBalancingPolicy\n            InheritNetworkFailoverDetectionPolicy = $AllNodes.InheritNetworkFailoverDetectionPolicy\n            InheritNotifySwitches = $AllNodes.InheritNotifySwitches\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupTeaming_WhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroupTeaming $AllNodes.VirtualPortGroupTeamingPolicyResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            Ensure = 'Present'\n            FailbackEnabled = $AllNodes.FailbackEnabled\n            LoadBalancingPolicy = $AllNodes.LoadBalancingPolicy\n            ActiveNic = $AllNodes.Nic\n            StandbyNic = $AllNodes.DefaultStandbyNic\n            UnusedNic = $AllNodes.DefaultUnusedNic\n            NetworkFailoverDetectionPolicy = $AllNodes.NetworkFailoverDetectionPolicyBeaconProbing\n            NotifySwitches = $AllNodes.NotifySwitches\n            InheritFailback = !$AllNodes.InheritFailback\n            InheritFailoverOrder = !$AllNodes.InheritFailoverOrder\n            InheritLoadBalancingPolicy = !$AllNodes.InheritLoadBalancingPolicy\n            InheritNetworkFailoverDetectionPolicy = !$AllNodes.InheritNetworkFailoverDetectionPolicy\n            InheritNotifySwitches = !$AllNodes.InheritNotifySwitches\n        }\n    }\n}\n\nConfiguration VMHostVssPortGroupTeaming_WhenRemovingVirtualPortGroupAndStandardSwitch_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVssPortGroup $AllNodes.VirtualPortGroupResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.Name\n            Name = $AllNodes.VirtualPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n        }\n\n        VMHostVss $AllNodes.StandardSwitchResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VirtualPortGroupResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssSecurity/VMHostVssSecurity_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:VssName = 'VSSDSC'\n$script:Mtu = 1500\n$script:EnsurePresent = 'Present'\n$script:EnsureAbsent = 'Absent'\n$script:AllowPromiscuous = $false\n$script:ForgedTransmits = $true\n$script:MacChanges = $true\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostVssSecurity_Modify_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssSecurity vmHostVssSecuritySettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            AllowPromiscuous = -not $script:AllowPromiscuous\n            ForgedTransmits = -not $script:ForgedTransmits\n            MacChanges = -not $script:MacChanges\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nConfiguration VMHostVssSecurity_Remove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssSecurity vmHostVssSecuritySettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:Absent\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nVMHostVssSecurity_Modify_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssSecurity_Modify_Config\" -ConfigurationData $script:configurationData\nVMHostVssSecurity_Remove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssSecurity_Remove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssShaping/VMHostVssShaping_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:VssName = 'VSSDSC'\n$script:Mtu = 1500\n$script:EnsurePresent = 'Present'\n$script:EnsureAbsent = 'Absent'\n$script:AverageBandwidth = 100000\n$script:BurstSize = 100000\n$script:Enabled = $false\n$script:PeakBandwidth = 100000\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostVssShaping_Modify_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssShaping vmHostVssShapingSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            AverageBandwidth = $script:AverageBandwidth + 1\n            BurstSize = $script:BurstSize + 1\n            Enabled = -not $script:Enabled\n            PeakBandwidth = $script:PeakBandwidth + 1\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n       }\n    }\n}\n\nConfiguration VMHostVssShaping_Remove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssShaping vmHostVssShapingSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsureAbsent\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n    }\n}\n\nVMHostVssShaping_Modify_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssShaping_Modify_Config\" -ConfigurationData $script:configurationData\nVMHostVssShaping_Remove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssShaping_Remove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostVssTeaming/VMHostVssTeaming_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [AllowEmptyCollection()]\n    [string[]]\n    $ActiveNic,\n\n    [Parameter(Mandatory = $true)]\n    [AllowEmptyCollection()]\n    [string[]]\n    $ActiveNicAlt,\n\n    [Parameter(Mandatory = $true)]\n    [AllowEmptyCollection()]\n    [string[]]\n    $StandbyNic,\n\n    [Parameter(Mandatory = $true)]\n    [AllowEmptyCollection()]\n    [string[]]\n    $StandbyNicAlt\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vmHostCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:VssName = 'VSSDSC'\n$script:Mtu = 1500\n$script:EnsurePresent = 'Present'\n$script:EnsureAbsent = 'Absent'\n$script:CheckBeacon = $false\n$script:NotifySwitches = $true\n$script:Policy = 'loadbalance_srcid'\n$script:PolicyAlt = 'loadbalance_ip'\n$script:RollingOrder = $false\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration VMHostVssTeaming_Modify_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssBridge vmHostVssBridge {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Ensure = $script:EnsurePresent\n            VssName = $script:VssName\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            NicDevice = $ActiveNic\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n\n        VMHostVssTeaming vmHostVssTeamingSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            CheckBeacon = -not $script:CheckBeacon\n            ActiveNic = $ActiveNic\n            StandbyNic = $StandbyNic\n            NotifySwitches = -not $script:NotifySwitches\n            Policy = $script:PolicyAlt\n            RollingOrder = -not $script:RollingOrder\n            DependsOn = \"[VMHostVssBridge]vmHostVssBridge\"\n        }\n    }\n}\n\nConfiguration VMHostVssTeaming_Remove_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVss vmHostVssSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:EnsurePresent\n            Mtu = $script:Mtu\n        }\n\n        VMHostVssBridge vmHostVssBridge {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            Ensure = $script:EnsurePresent\n            VssName = $script:VssName\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            NicDevice = $ActiveNic\n            DependsOn = \"[VMHostVss]vmHostVssSettings\"\n        }\n\n        VMHostVssTeaming vmHostVssTeamingSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $script:vmHostCredential\n            VssName = $script:VssName\n            Ensure = $script:Absent\n            CheckBeacon = $script:CheckBeacon\n            ActiveNic = $ActiveNicAlt\n            StandbyNic = $StandbyNicAlt\n            NotifySwitches = $script:NotifySwitches\n            Policy = $script:Policy\n            RollingOrder = $script:RollingOrder\n            DependsOn = \"[VMHostVssBridge]vmHostVssBridge\"\n        }\n    }\n}\n\nVMHostVssTeaming_Modify_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssTeaming_Modify_Config\" -ConfigurationData $script:configurationData\nVMHostVssTeaming_Remove_Config -OutputPath \"$integrationTestsFolderPath\\VMHostVssTeaming_Remove_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostvSANNetworkConfiguration_AddVMHostvSANNetworkConfigurationIPInterface_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostvSANNetworkConfiguration $AllNodes.VMHostvSANNetworkConfigurationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            InterfaceName = $AllNodes.InterfaceName\n            Ensure = 'Present'\n            AgentV6McAddr = $AllNodes.AgentGroupIPv6MulticastAddress\n            AgentMcAddr = $AllNodes.AgentGroupMulticastAddress\n            AgentMcPort = $AllNodes.AgentGroupMulticastPort\n            HostUcPort = $AllNodes.HostUnicastChannelBoundPort\n            MasterV6McAddr = $AllNodes.MasterGroupIPv6MulticastAddress\n            MasterMcAddr = $AllNodes.MasterGroupMulticastAddress\n            MasterMcPort = $AllNodes.MasterGroupMulticastPort\n            MulticastTtl = $AllNodes.MulticastTTL\n            TrafficType = $AllNodes.TrafficType\n        }\n    }\n}\n\nConfiguration VMHostvSANNetworkConfiguration_RemoveVMHostvSANNetworkConfigurationIPInterface_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostvSANNetworkConfiguration $AllNodes.VMHostvSANNetworkConfigurationResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.Name\n            InterfaceName = $AllNodes.InterfaceName\n            Ensure = 'Absent'\n            Force = $AllNodes.Force\n            AgentV6McAddr = $AllNodes.AgentGroupIPv6MulticastAddress\n            AgentMcAddr = $AllNodes.AgentGroupMulticastAddress\n            AgentMcPort = $AllNodes.AgentGroupMulticastPort\n            HostUcPort = $AllNodes.HostUnicastChannelBoundPort\n            MasterV6McAddr = $AllNodes.MasterGroupIPv6MulticastAddress\n            MasterMcAddr = $AllNodes.MasterGroupMulticastAddress\n            MasterMcPort = $AllNodes.MasterGroupMulticastPort\n            MulticastTtl = $AllNodes.MulticastTTL\n            TrafficType = $AllNodes.TrafficType\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/VmfsDatastore/VmfsDatastore_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VmfsDatastore_CreateVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            BlockSizeMB = $AllNodes.BlockSizeMB\n        }\n    }\n}\n\nConfiguration VmfsDatastore_CreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            BlockSizeMB = $AllNodes.BlockSizeMB\n            StorageIOControlEnabled = !$AllNodes.StorageIOControlEnabled\n            CongestionThresholdMillisecond = $AllNodes.MaxCongestionThresholdMillisecond\n        }\n    }\n}\n\nConfiguration VmfsDatastore_ModifyVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Present'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            BlockSizeMB = $AllNodes.BlockSizeMB\n            StorageIOControlEnabled = $AllNodes.StorageIOControlEnabled\n            CongestionThresholdMillisecond = $AllNodes.MinCongestionThresholdMillisecond\n        }\n    }\n}\n\nConfiguration VmfsDatastore_RemoveVmfsDatastore_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.DatastoreName\n            Path = $AllNodes.ScsiLunCanonicalName\n            Ensure = 'Absent'\n            FileSystemVersion = $AllNodes.FileSystemVersion\n            BlockSizeMB = $AllNodes.BlockSizeMB\n            StorageIOControlEnabled = $AllNodes.StorageIOControlEnabled\n            CongestionThresholdMillisecond = $AllNodes.DefaultCongestionThresholdMillisecond\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/vCenterSettings/vCenterSettings_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vCenterCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:loggingLevel = 'Warning'\n$script:eventMaxAgeEnabled = $false\n$script:eventMaxAge = 40\n$script:taskMaxAgeEnabled = $false\n$script:taskMaxAge = 40\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration vCenterSettings_WithLoggingLevel_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $script:vCenterCredential\n            LoggingLevel = $script:loggingLevel\n        }\n    }\n}\n\nConfiguration vCenterSettings_WithEventMaxAge_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $script:vCenterCredential\n            EventMaxAgeEnabled = $script:eventMaxAgeEnabled\n            EventMaxAge = $script:eventMaxAge\n        }\n    }\n}\n\nConfiguration vCenterSettings_WithTaskMaxAge_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $script:vCenterCredential\n            TaskMaxAgeEnabled = $script:taskMaxAgeEnabled\n            TaskMaxAge = $script:taskMaxAge\n        }\n    }\n}\n\nConfiguration vCenterSettings_WithMotdAndIssue_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterSettings vCenterSettings {\n            Server = $Server\n            Credential = $script:vCenterCredential\n            Motd = $script:motd\n            Issue = $script:issue\n        }\n    }\n}\n\nvCenterSettings_WithLoggingLevel_Config -OutputPath \"$integrationTestsFolderPath\\vCenterSettings_WithLoggingLevel_Config\" -ConfigurationData $script:configurationData\nvCenterSettings_WithEventMaxAge_Config -OutputPath \"$integrationTestsFolderPath\\vCenterSettings_WithEventMaxAge_Config\" -ConfigurationData $script:configurationData\nvCenterSettings_WithTaskMaxAge_Config -OutputPath \"$integrationTestsFolderPath\\vCenterSettings_WithTaskMaxAge_Config\" -ConfigurationData $script:configurationData\nvCenterSettings_WithMotdAndIssue_Config -OutputPath \"$integrationTestsFolderPath\\vCenterSettings_WithMotdAndIssue_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/vCenterStatistics/vCenterStatistics_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n$script:vCenterCredential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n$script:period = \"Day\"\n$script:level = 2\n$script:intervalMinutes = 3\n$script:periodLength = 3\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n        }\n    )\n}\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nConfiguration vCenterStatistics_WithPassedEnabledProperty_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterStatistics vCenterStatistics {\n            Server = $Server\n            Credential = $script:vCenterCredential\n            Period = $script:period\n            Level = $script:level\n            Enabled = $true\n            IntervalMinutes = $script:intervalMinutes\n            PeriodLength = $script:periodLength\n        }\n    }\n}\n\nConfiguration vCenterStatistics_WithoutEnabledProperty_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        vCenterStatistics vCenterStatistics {\n            Server = $Server\n            Credential = $script:vCenterCredential\n            Period = $script:period\n            Level = $script:level\n            IntervalMinutes = $script:intervalMinutes\n            PeriodLength = $script:periodLength\n        }\n    }\n}\n\nvCenterStatistics_WithPassedEnabledProperty_Config -OutputPath \"$integrationTestsFolderPath\\vCenterStatistics_WithPassedEnabledProperty_Config\" -ConfigurationData $script:configurationData\nvCenterStatistics_WithoutEnabledProperty_Config -OutputPath \"$integrationTestsFolderPath\\vCenterStatistics_WithoutEnabledProperty_Config\" -ConfigurationData $script:configurationData\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Configurations/vCenterVMHost/vCenterVMHost_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration vCenterVMHost_CreateDatacenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $AllNodes.DatacenterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration vCenterVMHost_CreateFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Folder $AllNodes.FolderResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.FolderName\n            Location = $AllNodes.FolderLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            FolderType = $AllNodes.HostFolderType\n        }\n    }\n}\n\nConfiguration vCenterVMHost_CreateCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Cluster $AllNodes.ClusterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ClusterName\n            Location = $AllNodes.ClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            DrsEnabled = $AllNodes.DrsEnabled\n        }\n    }\n}\n\nConfiguration vCenterVMHost_AddVMHostTovCenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost $AllNodes.vCenterVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostDatacenterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.VMHostCredential\n            Port = $AllNodes.VMHostPort\n            Force = $AllNodes.Force\n        }\n    }\n}\n\nConfiguration vCenterVMHost_MoveVMHostToFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost $AllNodes.vCenterVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostFolderLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.VMHostCredential\n        }\n    }\n}\n\nConfiguration vCenterVMHost_MoveVMHostToCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost $AllNodes.vCenterVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.VMHostCredential\n        }\n    }\n}\n\nConfiguration vCenterVMHost_MoveVMHostToClusterAndImportResourcePoolHierarchy_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost $AllNodes.vCenterVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.VMHostCredential\n            ResourcePoolLocation = $AllNodes.ResourcePoolLocation\n        }\n    }\n}\n\nConfiguration vCenterVMHost_RemoveVMHostFromvCenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost $AllNodes.vCenterVMHostResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostDatacenterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            VMHostCredential = $AllNodes.VMHostCredential\n        }\n    }\n}\n\nConfiguration vCenterVMHost_RemoveCluster_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Cluster $AllNodes.ClusterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ClusterName\n            Location = $AllNodes.ClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration vCenterVMHost_RemoveFolder_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Folder $AllNodes.FolderResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.FolderName\n            Location = $AllNodes.FolderLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            FolderType = $AllNodes.HostFolderType\n        }\n    }\n}\n\nConfiguration vCenterVMHost_RemoveDatacenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter $AllNodes.DatacenterResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DRSRule/DRSRule.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction Test-Setup {\n    <#\n    .SYNOPSIS\n\n    Creates two Virtual Machines on a VMHost located in a Datacenter on the specified vCenter Server.\n    Retrieves information about the VMHost and the Datacenter where the VMHost is located.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n\n        $script:VMHost = Get-VMHost -Server $script:VIServer | Select-Object -First 1\n        if ($null -eq $script:VMHost) {\n            throw \"Could not find a VMHost on vCenter Server $Server.\"\n        }\n\n        $script:Datastore = Get-Datastore -Server $script:VIServer -VMHost $script:VMHost | Select-Object -First 1\n        if ($null -eq $script:Datastore) {\n            throw \"Could not find a Datastore on VMHost $($script:VMHost.Name).\"\n        }\n\n        $script:VirtualMachineNames = @('DscVMOne', 'DscVMTwo')\n        foreach ($virtualMachineName in $script:VirtualMachineNames) {\n            $newVMParams = @{\n                Server = $script:VIServer\n                Name = $virtualMachineName\n                VMHost = $script:VMHost\n                MemoryMB = 4\n                DiskMB = 4\n                Datastore = $script:Datastore\n            }\n            New-VM @newVMParams\n        }\n\n        Get-DatacenterInformation\n        Get-VMHostInformation\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Test-CleanUp {\n    <#\n    .SYNOPSIS\n\n    Removes the two Virtual Machines on the VMHost located in a Cluster on the specified vCenter Server.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n\n        $getVMParams = @{\n            Server = $script:VIServer\n            Name = $script:VirtualMachineNames\n            Location = $script:VMHost\n            Datastore = $script:Datastore\n        }\n        Get-VM @getVMParams | Remove-VM -Server $script:VIServer -DeletePermanently:$true -Confirm:$false\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Get-DatacenterInformation {\n    <#\n    .SYNOPSIS\n\n    Retrieves the name and the location of the Datacenter in which the VMHost is located.\n    #>\n\n    $script:Datacenter = Get-Datacenter -Server $script:VIServer -VMHost $script:VMHost | Select-Object -First 1\n    if ($null -eq $script:Datacenter) {\n        throw \"Could not find a Datacenter on vCenter Server $Server.\"\n    }\n\n    $inventoryRootFolder = Get-Folder -Server $script:VIServer -NoRecursion\n\n    $datacenterLocationItems = @()\n    $datacenterFolder = $script:Datacenter.ParentFolder\n\n    $script:DatacenterLocation = $null\n    if ($datacenterFolder.Id -eq $inventoryRootFolder.Id) {\n        $script:DatacenterLocation = [string]::Empty\n    }\n    else {\n        $datacenterLocationItems += $datacenterFolder.Name\n        $currentFolder = $datacenterFolder.Parent\n        while ($true) {\n            if ($currentFolder.Id -eq $inventoryRootFolder.Id) {\n                break\n            }\n\n            $datacenterLocationItems += $currentFolder.Name\n            $currentFolder = $currentFolder.Parent\n        }\n\n        [array]::Reverse($datacenterLocationItems)\n\n        $script:DatacenterLocation = $datacenterLocationItems -Join '/'\n    }\n}\n\nfunction Get-VMHostInformation {\n    <#\n    .SYNOPSIS\n\n    Retrieves the location of the VMHost in the Datacenter.\n    #>\n\n    $getFolderParams = @{\n        Server = $script:VIServer\n        Location = $script:Datacenter\n        NoRecursion = $true\n        Type = 'HostAndCluster'\n    }\n    $datacenterHostFolder = Get-Folder @getFolderParams\n\n    $vmHostLocationItems = @()\n    $vmHostParent = $script:VMHost.Parent\n\n    $script:VMHostLocation = $null\n    if ($vmHostParent.Id -eq $datacenterHostFolder.Id) {\n        $script:VMHostLocation = [string]::Empty\n    }\n    else {\n        $vmHostLocationItems += $vmHostParent.Name\n        $currentInventoryItem = $vmHostParent.Parent\n        while ($true) {\n            if ($currentInventoryItem.Id -eq $datacenterHostFolder.Id) {\n                break\n            }\n\n            $vmHostLocationItems += $currentInventoryItem.Name\n            $currentInventoryItem = $currentInventoryItem.Parent\n        }\n\n        [array]::Reverse($vmHostLocationItems)\n\n        $script:VMHostLocation = $vmHostLocationItems -Join '/'\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DRSRule/DRSRule.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter()]\n    [string]\n    $Name\n)\n\n<#\n    The DRSRule DSC Resource Integration Tests require a vCenter Server with at\n    least one Datacenter and at least one VMHost located in that Datacenter.\n#>\n\n# The 'Name' parameter is not used in the Integration Tests, so it is set to $null.\n$Name = $null\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:DscResourceName = 'DRSRule'\n$script:ConfigurationsPath = Join-Path -Path $PSScriptRoot -ChildPath \"$($script:DscResourceName)_Config.ps1\"\n\n. \"$PSScriptRoot\\$script:DscResourceName.Integration.Tests.Helpers.ps1\"\nTest-Setup\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            DrsClusterDscResourceId = '[DrsCluster]DrsCluster'\n            DrsClusterDscResourceName = 'DrsCluster'\n            vCenterVMHostDscResourceId = '[vCenterVMHost]vCenterVMHost'\n            vCenterVMHostDscResourceName = 'vCenterVMHost'\n            DRSRuleDscResourceName = 'DRSRule'\n            VMHostConfigurationDscResourceId = '[VMHostConfiguration]VMHostConfiguration'\n            VMHostConfigurationDscResourceName = 'VMHostConfiguration'\n            ClusterName = 'DscDrsCluster'\n            ClusterLocation = [string]::Empty\n            ClusterDrsEnabled = $true\n            DatacenterName = $script:Datacenter.Name\n            DatacenterLocation = $script:DatacenterLocation\n            VMHostName = $script:VMHost.Name\n            VMHostClusterLocation = 'DscDrsCluster'\n            VMHostDatacenterLocation = $script:VMHostLocation\n            VMHostDisconnectedState = 'Disconnected'\n            VMHostOriginalState = [string] $script:VMHost.ConnectionState\n            DRSRuleName = 'DscDrsRule'\n            DRSRuleType = 'VMAffinity'\n            DRSRuleEnabled = $true\n            VirtualMachineNames = $script:VirtualMachineNames\n        }\n    )\n}\n\n. $script:ConfigurationsPath -Verbose:$true -ErrorAction Stop\n\n$script:CreateDrsClusterConfigurationName = \"$($script:DscResourceName)_CreateDrsClusterAndMoveVMHostInCluster_Config\"\n$script:CreateDRSRuleConfigurationName = \"$($script:DscResourceName)_CreateDRSRule_Config\"\n$script:RemoveDRSRuleConfigurationName = \"$($script:DscResourceName)_RemoveDRSRule_Config\"\n$script:ChangeVMHostStateConfigurationName = \"$($script:DscResourceName)_ChangeVMHostStateToDisconnected_Config\"\n$script:RemoveDrsClusterConfigurationName = \"$($script:DscResourceName)_MoveVMHostToDatacenterAndRemoveDrsCluster_Config\"\n\n$script:CreateDrsClusterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateDrsClusterConfigurationName\n$script:CreateDRSRuleMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateDRSRuleConfigurationName\n$script:RemoveDRSRuleMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveDRSRuleConfigurationName\n$script:ChangeVMHostStateMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:ChangeVMHostStateConfigurationName\n$script:RemoveDrsClusterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveDrsClusterConfigurationName\n\nDescribe \"$($script:DscResourceName)_Integration\" {\n    AfterAll {\n        # We need to remove the Virtual Machines to restore the initial state of the vCenter Server.\n        Test-CleanUp\n    }\n\n    Context 'When creating DRS rule' {\n        BeforeAll {\n            # Arrange\n            & $script:CreateDrsClusterConfigurationName `\n                -OutputPath $script:CreateDrsClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsCreateDrsCluster = @{\n                Path = $script:CreateDrsClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDrsCluster } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:CreateDRSRuleConfigurationName `\n                    -OutputPath $script:CreateDRSRuleMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsCreateDRSRule = @{\n                    Path = $script:CreateDRSRuleMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsCreateDRSRule } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:CreateDRSRuleMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:CreateDRSRuleMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:CreateDRSRuleConfigurationName\n                }\n            }\n\n            # Act\n            $DRSRuleDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $DRSRuleDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $DRSRuleDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.DRSRuleName\n            $DRSRuleDscResource.DatacenterName | Should -Be $script:ConfigurationData.AllNodes.DatacenterName\n            $DRSRuleDscResource.DatacenterLocation | Should -Be $script:ConfigurationData.AllNodes.DatacenterLocation\n            $DRSRuleDscResource.ClusterName | Should -Be $script:ConfigurationData.AllNodes.ClusterName\n            $DRSRuleDscResource.ClusterLocation | Should -Be $script:ConfigurationData.AllNodes.ClusterLocation\n            $DRSRuleDscResource.DRSRuleType | Should -Be $script:ConfigurationData.AllNodes.DRSRuleType\n            $DRSRuleDscResource.VMNames | Should -Be $script:ConfigurationData.AllNodes.VirtualMachineNames\n            $DRSRuleDscResource.Ensure | Should -Be 'Present'\n            $DRSRuleDscResource.Enabled | Should -Be $script:ConfigurationData.AllNodes.DRSRuleEnabled\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:RemoveDRSRuleConfigurationName `\n                -OutputPath $script:RemoveDRSRuleMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:ChangeVMHostStateConfigurationName `\n                -OutputPath $script:ChangeVMHostStateMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:RemoveDrsClusterConfigurationName `\n                -OutputPath $script:RemoveDrsClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsRemoveDRSRule = @{\n                Path = $script:RemoveDRSRuleMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsChangeVMHostState = @{\n                Path = $script:ChangeVMHostStateMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsRemoveDrsCluster = @{\n                Path = $script:RemoveDrsClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDRSRule } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsChangeVMHostState } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDrsCluster } | Should -Not -Throw\n\n            Remove-Item -Path $script:CreateDrsClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:CreateDRSRuleMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDRSRuleMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:ChangeVMHostStateMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDrsClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When removing DRS rule' {\n        BeforeAll {\n            # Arrange\n            & $script:CreateDrsClusterConfigurationName `\n                -OutputPath $script:CreateDrsClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:CreateDRSRuleConfigurationName `\n                -OutputPath $script:CreateDRSRuleMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsCreateDrsCluster = @{\n                Path = $script:CreateDrsClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsCreateDRSRule = @{\n                Path = $script:CreateDRSRuleMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDrsCluster } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDRSRule } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:RemoveDRSRuleConfigurationName `\n                    -OutputPath $script:RemoveDRSRuleMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsRemoveDRSRule = @{\n                    Path = $script:RemoveDRSRuleMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsRemoveDRSRule } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:RemoveDRSRuleMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:RemoveDRSRuleMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:RemoveDRSRuleConfigurationName\n                }\n            }\n\n            # Act\n            $DRSRuleDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $DRSRuleDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $DRSRuleDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.DRSRuleName\n            $DRSRuleDscResource.DatacenterName | Should -Be $script:ConfigurationData.AllNodes.DatacenterName\n            $DRSRuleDscResource.DatacenterLocation | Should -Be $script:ConfigurationData.AllNodes.DatacenterLocation\n            $DRSRuleDscResource.ClusterName | Should -Be $script:ConfigurationData.AllNodes.ClusterName\n            $DRSRuleDscResource.ClusterLocation | Should -Be $script:ConfigurationData.AllNodes.ClusterLocation\n            $DRSRuleDscResource.DRSRuleType | Should -Be $script:ConfigurationData.AllNodes.DRSRuleType\n            $DRSRuleDscResource.VMNames | Should -Be $script:ConfigurationData.AllNodes.VirtualMachineNames\n            $DRSRuleDscResource.Ensure | Should -Be 'Absent'\n            $DRSRuleDscResource.Enabled | Should -BeNull\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:ChangeVMHostStateConfigurationName `\n                -OutputPath $script:ChangeVMHostStateMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:RemoveDrsClusterConfigurationName `\n                -OutputPath $script:RemoveDrsClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsChangeVMHostState = @{\n                Path = $script:ChangeVMHostStateMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsRemoveDrsCluster = @{\n                Path = $script:RemoveDrsClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsChangeVMHostState } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDrsCluster } | Should -Not -Throw\n\n            Remove-Item -Path $script:CreateDrsClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:CreateDRSRuleMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDRSRuleMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:ChangeVMHostStateMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDrsClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DRSRule/DRSRule_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration DRSRule_CreateDrsClusterAndMoveVMHostInCluster_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DrsCluster $AllNodes.DrsClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ClusterName\n            Location = $AllNodes.ClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            DrsEnabled = $AllNodes.ClusterDrsEnabled\n        }\n\n        vCenterVMHost $AllNodes.vCenterVMHostDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.Credential\n            DependsOn = $AllNodes.DrsClusterDscResourceId\n        }\n    }\n}\n\nConfiguration DRSRule_CreateDRSRule_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DRSRule $AllNodes.DRSRuleDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DRSRuleName\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            ClusterName = $AllNodes.ClusterName\n            ClusterLocation = $AllNodes.ClusterLocation\n            DRSRuleType = $AllNodes.DRSRuleType\n            VMNames = $AllNodes.VirtualMachineNames\n            Ensure = 'Present'\n            Enabled = $AllNodes.DRSRuleEnabled\n        }\n    }\n}\n\nConfiguration DRSRule_RemoveDRSRule_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DRSRule $AllNodes.DRSRuleDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DRSRuleName\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            ClusterName = $AllNodes.ClusterName\n            ClusterLocation = $AllNodes.ClusterLocation\n            DRSRuleType = $AllNodes.DRSRuleType\n            VMNames = $AllNodes.VirtualMachineNames\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration DRSRule_ChangeVMHostStateToDisconnected_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostConfiguration $AllNodes.VMHostConfigurationDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            State = $AllNodes.VMHostDisconnectedState\n        }\n    }\n}\n\nConfiguration DRSRule_MoveVMHostToDatacenterAndRemoveDrsCluster_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        vCenterVMHost $AllNodes.vCenterVMHostDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Location = $AllNodes.VMHostDatacenterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            VMHostCredential = $AllNodes.Credential\n        }\n\n        VMHostConfiguration $AllNodes.VMHostConfigurationDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            State = $AllNodes.VMHostOriginalState\n            DependsOn = $AllNodes.vCenterVMHostDscResourceId\n        }\n\n        DrsCluster $AllNodes.DrsClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.ClusterName\n            Location = $AllNodes.ClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VMHostConfigurationDscResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Datacenter.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'Datacenter'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenAddingDatacenterWithEmptyLocation = \"$($script:dscResourceName)_WhenAddingDatacenterWithEmptyLocation_Config\"\n$script:configWhenAddingDatacenterWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenAddingDatacenterWithLocationWithOneFolder_Config\"\n$script:configWhenAddingDatacenterWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenAddingDatacenterWithLocationWithTwoFolders_Config\"\n$script:configWhenRemovingDatacenterWithEmptyLocation = \"$($script:dscResourceName)_WhenRemovingDatacenterWithEmptyLocation_Config\"\n$script:configWhenRemovingDatacenterWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenRemovingDatacenterWithLocationWithOneFolder_Config\"\n$script:configWhenRemovingDatacenterWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenRemovingDatacenterWithLocationWithTwoFolders_Config\"\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenAddingDatacenterWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingDatacenterWithEmptyLocation)\\\"\n$script:mofFileWhenAddingDatacenterWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingDatacenterWithLocationWithOneFolder)\\\"\n$script:mofFileWhenAddingDatacenterWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingDatacenterWithLocationWithTwoFolders)\\\"\n$script:mofFileWhenRemovingDatacenterWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingDatacenterWithEmptyLocation)\\\"\n$script:mofFileWhenRemovingDatacenterWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingDatacenterWithLocationWithOneFolder)\\\"\n$script:mofFileWhenRemovingDatacenterWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingDatacenterWithLocationWithTwoFolders)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenAddingDatacenterWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDatacenterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDatacenterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $script:datacenterName\n            $configuration.Location | Should -Be $script:datacenterEmptyLocation\n            $configuration.Ensure | Should -Be 'Present'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingDatacenterWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDatacenterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDatacenterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingDatacenterWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDatacenterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDatacenterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n            $datacenterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $datacenterWithLocationWithTwoFoldersResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithTwoFoldersResource.Location | Should -Be $script:datacenterLocationWithTwoFolders\n            $datacenterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Present'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingDatacenterWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingDatacenter = @{\n                Path = $script:mofFileWhenAddingDatacenterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingDatacenter = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingDatacenter\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $script:datacenterName\n            $configuration.Location | Should -Be $script:datacenterEmptyLocation\n            $configuration.Ensure | Should -Be 'Absent'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingDatacenterWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingDatacenter = @{\n                Path = $script:mofFileWhenAddingDatacenterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingDatacenter = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingDatacenter\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingDatacenterWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingDatacenter = @{\n                Path = $script:mofFileWhenAddingDatacenterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingDatacenter = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingDatacenter\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDatacenterWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n            $datacenterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $datacenterWithLocationWithTwoFoldersResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithTwoFoldersResource.Location | Should -Be $script:datacenterLocationWithTwoFolders\n            $datacenterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Absent'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DatacenterFolder.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'DatacenterFolder'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenAddingFolderWithEmptyLocation = \"$($script:dscResourceName)_WhenAddingFolderWithEmptyLocation_Config\"\n$script:configWhenAddingFolderWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenAddingFolderWithLocationWithOneFolder_Config\"\n$script:configWhenAddingFolderWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenAddingFolderWithLocationWithTwoFolders_Config\"\n$script:configWhenRemovingFolderWithEmptyLocation = \"$($script:dscResourceName)_WhenRemovingFolderWithEmptyLocation_Config\"\n$script:configWhenRemovingFolderWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenRemovingFolderWithLocationWithOneFolder_Config\"\n$script:configWhenRemovingFolderWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenRemovingFolderWithLocationWithTwoFolders_Config\"\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenAddingFolderWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingFolderWithEmptyLocation)\\\"\n$script:mofFileWhenAddingFolderWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingFolderWithLocationWithOneFolder)\\\"\n$script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingFolderWithLocationWithTwoFolders)\\\"\n$script:mofFileWhenRemovingFolderWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingFolderWithEmptyLocation)\\\"\n$script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingFolderWithLocationWithOneFolder)\\\"\n$script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingFolderWithLocationWithTwoFolders)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenAddingFolderWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $script:datacenterFolderName\n            $configuration.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $configuration.Ensure | Should -Be 'Present'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingFolderWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterFolderLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingFolderWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n            $datacenterFolderWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterFolderLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $datacenterFolderWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithTwoFoldersResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithTwoFoldersResource.Location | Should -Be $script:datacenterFolderLocationWithTwoFolders\n            $datacenterFolderWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Present'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingFolderWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingFolder = @{\n                Path = $script:mofFileWhenAddingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingFolder = @{\n                Path = $script:mofFileWhenRemovingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingFolder\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingFolder\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $script:datacenterFolderName\n            $configuration.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $configuration.Ensure | Should -Be 'Absent'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingFolderWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingFolder = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingFolder = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingFolder\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingFolder\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterFolderLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingFolderWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingFolder = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingFolder = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingFolder\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingFolder\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n            $datacenterFolderWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterFolderLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $datacenterFolderWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithTwoFoldersResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithTwoFoldersResource.Location | Should -Be $script:datacenterFolderLocationWithTwoFolders\n            $datacenterFolderWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Absent'\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Datastore/NfsDatastore.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string[]]\n    $NfsHost,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $NfsPath\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'NfsDatastore'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            NfsDatastoreResourceName = 'NfsDatastore'\n            DatastoreName = 'MyTestNfsDatastore'\n            NfsPath = $NfsPath\n            FileSystemVersion = '3'\n            NfsHost = $NfsHost\n            ReadWriteAccessMode = 'ReadWrite'\n            ReadOnlyAccessMode = 'ReadOnly'\n            AuthenticationMethod = 'AUTH_SYS'\n            StorageIOControlEnabled = $false\n            DefaultCongestionThresholdMillisecond = 30\n            MinCongestionThresholdMillisecond = 10\n            MaxCongestionThresholdMillisecond = 100\n        }\n    )\n}\n\n$script:configCreateNfsDatastoreWithReadOnlyAccessMode = \"$($script:dscResourceName)_CreateNfsDatastoreWithReadOnlyAccessMode_Config\"\n$script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond = \"$($script:dscResourceName)_CreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond_Config\"\n$script:configModifyNfsDatastore = \"$($script:dscResourceName)_ModifyNfsDatastore_Config\"\n$script:configRemoveNfsDatastore = \"$($script:dscResourceName)_RemoveNfsDatastore_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateNfsDatastoreWithReadOnlyAccessModePath = \"$script:integrationTestsFolderPath\\$script:configCreateNfsDatastoreWithReadOnlyAccessMode\\\"\n$script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath = \"$script:integrationTestsFolderPath\\$script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\\\"\n$script:mofFileModifyNfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configModifyNfsDatastore\\\"\n$script:mofFileRemoveNfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configRemoveNfsDatastore\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateNfsDatastoreWithReadOnlyAccessMode\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateNfsDatastoreWithReadOnlyAccessMode `\n                -OutputPath $script:mofFileCreateNfsDatastoreWithReadOnlyAccessModePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateNfsDatastoreWithReadOnlyAccessModePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateNfsDatastoreWithReadOnlyAccessModePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateNfsDatastoreWithReadOnlyAccessMode }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.NfsPath\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.FileSystemVersion | Should -BeLike \"$($script:configurationData.AllNodes.FileSystemVersion)*\"\n            $configuration.NfsHost | Should -Be $script:configurationData.AllNodes.NfsHost\n            $configuration.AccessMode | Should -Be $script:configurationData.AllNodes.ReadOnlyAccessMode\n            $configuration.AuthenticationMethod | Should -Be $script:configurationData.AllNodes.AuthenticationMethod\n            $configuration.StorageIOControlEnabled | Should -Be $script:configurationData.AllNodes.StorageIOControlEnabled\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.DefaultCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateNfsDatastoreWithReadOnlyAccessModePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveNfsDatastore `\n                -OutputPath $script:mofFileRemoveNfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateNfsDatastoreWithReadOnlyAccessModePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond `\n                -OutputPath $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.NfsPath\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.FileSystemVersion | Should -BeLike \"$($script:configurationData.AllNodes.FileSystemVersion)*\"\n            $configuration.NfsHost | Should -Be $script:configurationData.AllNodes.NfsHost\n            $configuration.AccessMode | Should -Be $script:configurationData.AllNodes.ReadWriteAccessMode\n            $configuration.AuthenticationMethod | Should -Be $script:configurationData.AllNodes.AuthenticationMethod\n            $configuration.StorageIOControlEnabled | Should -BeTrue\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.MaxCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveNfsDatastore `\n                -OutputPath $script:mofFileRemoveNfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyNfsDatastore\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond `\n                -OutputPath $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyNfsDatastore `\n                -OutputPath $script:mofFileModifyNfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond = @{\n                Path = $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyNfsDatastore = @{\n                Path = $script:mofFileModifyNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\n            Start-DscConfiguration @startDscConfigurationParametersModifyNfsDatastore\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyNfsDatastore }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.NfsPath\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.FileSystemVersion | Should -BeLike \"$($script:configurationData.AllNodes.FileSystemVersion)*\"\n            $configuration.NfsHost | Should -Be $script:configurationData.AllNodes.NfsHost\n            $configuration.AccessMode | Should -Be $script:configurationData.AllNodes.ReadWriteAccessMode\n            $configuration.AuthenticationMethod | Should -Be $script:configurationData.AllNodes.AuthenticationMethod\n            $configuration.StorageIOControlEnabled | Should -Be $script:configurationData.AllNodes.StorageIOControlEnabled\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.MinCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyNfsDatastorePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveNfsDatastore `\n                -OutputPath $script:mofFileRemoveNfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyNfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveNfsDatastore\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond `\n                -OutputPath $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveNfsDatastore `\n                -OutputPath $script:mofFileRemoveNfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond = @{\n                Path = $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveNfsDatastore = @{\n                Path = $script:mofFileRemoveNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\n            Start-DscConfiguration @startDscConfigurationParametersRemoveNfsDatastore\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveNfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveNfsDatastore }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.NfsPath\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.FileSystemVersion | Should -Be $script:configurationData.AllNodes.FileSystemVersion\n            $configuration.NfsHost | Should -Be $script:configurationData.AllNodes.NfsHost\n            $configuration.AccessMode | Should -Be $script:configurationData.AllNodes.ReadWriteAccessMode\n            $configuration.AuthenticationMethod | Should -Be $script:configurationData.AllNodes.AuthenticationMethod\n            $configuration.StorageIOControlEnabled | Should -Be $script:configurationData.AllNodes.StorageIOControlEnabled\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.DefaultCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveNfsDatastorePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Act\n            Remove-Item -Path $script:mofFileCreateNfsDatastoreWithReadWriteAccessModeAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Datastore/VmfsDatastore.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n<#\n.DESCRIPTION\n\nRetrieves the canonical name of the Scsi logical unit that will contain the Vmfs Datastore used in the Integration Tests.\n#>\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n\n    if ($null -eq $scsiLun) {\n        throw 'The Vmfs Datastore that is used in the Integration Tests requires one unused Scsi logical unit to be available.'\n    }\n\n    $script:scsiLunCanonicalName = $scsiLun.CanonicalName\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\nInvoke-TestSetup\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VmfsDatastore'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VmfsDatastoreResourceName = 'VmfsDatastore'\n            DatastoreName = 'MyTestVmfsDatastore'\n            ScsiLunCanonicalName = $script:scsiLunCanonicalName\n            FileSystemVersion = '5'\n            BlockSizeMB = 1\n            StorageIOControlEnabled = $false\n            DefaultCongestionThresholdMillisecond = 30\n            MinCongestionThresholdMillisecond = 10\n            MaxCongestionThresholdMillisecond = 100\n        }\n    )\n}\n\n$script:configCreateVmfsDatastore = \"$($script:dscResourceName)_CreateVmfsDatastore_Config\"\n$script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond = \"$($script:dscResourceName)_CreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond_Config\"\n$script:configModifyVmfsDatastore = \"$($script:dscResourceName)_ModifyVmfsDatastore_Config\"\n$script:configRemoveVmfsDatastore = \"$($script:dscResourceName)_RemoveVmfsDatastore_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configCreateVmfsDatastore\\\"\n$script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath = \"$script:integrationTestsFolderPath\\$script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\\\"\n$script:mofFileModifyVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configModifyVmfsDatastore\\\"\n$script:mofFileRemoveVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVmfsDatastore\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateVmfsDatastore\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastore `\n                -OutputPath $script:mofFileCreateVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVmfsDatastore }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.FileSystemVersion | Should -BeLike \"$($script:configurationData.AllNodes.FileSystemVersion)*\"\n            $configuration.BlockSizeMB | Should -Be $script:configurationData.AllNodes.BlockSizeMB\n            $configuration.StorageIOControlEnabled | Should -Be $script:configurationData.AllNodes.StorageIOControlEnabled\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.DefaultCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVmfsDatastorePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond `\n                -OutputPath $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.FileSystemVersion | Should -BeLike \"$($script:configurationData.AllNodes.FileSystemVersion)*\"\n            $configuration.BlockSizeMB | Should -Be $script:configurationData.AllNodes.BlockSizeMB\n            $configuration.StorageIOControlEnabled | Should -BeTrue\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.MaxCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyVmfsDatastore\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond `\n                -OutputPath $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVmfsDatastore `\n                -OutputPath $script:mofFileModifyVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond = @{\n                Path = $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyVmfsDatastore = @{\n                Path = $script:mofFileModifyVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\n            Start-DscConfiguration @startDscConfigurationParametersModifyVmfsDatastore\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVmfsDatastore }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.FileSystemVersion | Should -BeLike \"$($script:configurationData.AllNodes.FileSystemVersion)*\"\n            $configuration.BlockSizeMB | Should -Be $script:configurationData.AllNodes.BlockSizeMB\n            $configuration.StorageIOControlEnabled | Should -Be $script:configurationData.AllNodes.StorageIOControlEnabled\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.MinCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVmfsDatastorePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVmfsDatastore\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond `\n                -OutputPath $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond = @{\n                Path = $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVmfsDatastore = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecond\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVmfsDatastore\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVmfsDatastore }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.Path | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.FileSystemVersion | Should -Be $script:configurationData.AllNodes.FileSystemVersion\n            $configuration.BlockSizeMB | Should -Be $script:configurationData.AllNodes.BlockSizeMB\n            $configuration.StorageIOControlEnabled | Should -Be $script:configurationData.AllNodes.StorageIOControlEnabled\n            $configuration.CongestionThresholdMillisecond | Should -Be $script:configurationData.AllNodes.DefaultCongestionThresholdMillisecond\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVmfsDatastorePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Act\n            Remove-Item -Path $script:mofFileCreateVmfsDatastoreAndModifyStorageIOControlEnabledAndCongestionThresholdMillisecondPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DatastoreCluster/DatastoreCluster.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter()]\n    [string]\n    $Name\n)\n\n# The 'Name' parameter is not used in the Integration Tests, so it is set to $null.\n$Name = $null\n\n$script:Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$script:DscResourceName = 'DatastoreCluster'\n$script:ConfigurationsPath = Join-Path -Path $PSScriptRoot -ChildPath \"$($script:DscResourceName)_Config.ps1\"\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            DatacenterDscResourceName = 'Datacenter'\n            DatastoreClusterDscResourceName = 'DatastoreCluster'\n            DatacenterName = 'DscDatacenter'\n            DatacenterLocation = [string]::Empty\n            DatastoreClusterName = 'DscDatastoreCluster'\n            DatastoreClusterLocation = [string]::Empty\n            IOLoadBalanceEnabled = $true\n            DefaultIOLoadBalanceEnabled = $false\n            SdrsAutomationLevel = 'FullyAutomated'\n            DefaultSdrsAutomationLevel = 'Disabled'\n            IOLatencyThresholdMillisecond = 50\n            SpaceUtilizationThresholdPercent = 50\n        }\n    )\n}\n\n. $script:ConfigurationsPath -Verbose:$true -ErrorAction Stop\n\n$script:CreateDatacenterConfigurationName = \"$($script:DscResourceName)_CreateDatacenterInTheRootFolderOfTheInventory_Config\"\n$script:CreateDatastoreClusterConfigurationName = \"$($script:DscResourceName)_CreateDatastoreClusterWithoutModifyingTheDatastoreClusterConfiguration_Config\"\n$script:CreateAndModifyDatastoreClusterConfigurationName = \"$($script:DscResourceName)_CreateDatastoreClusterAndModifyTheDatastoreClusterConfiguration_Config\"\n$script:RemoveDatastoreClusterConfigurationName = \"$($script:DscResourceName)_RemoveDatastoreCluster_Config\"\n$script:RemoveDatacenterConfigurationName = \"$($script:DscResourceName)_RemoveDatacenter_Config\"\n\n$script:CreateDatacenterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateDatacenterConfigurationName\n$script:CreateDatastoreClusterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateDatastoreClusterConfigurationName\n$script:CreateAndModifyDatastoreClusterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateAndModifyDatastoreClusterConfigurationName\n$script:RemoveDatastoreClusterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveDatastoreClusterConfigurationName\n$script:RemoveDatacenterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveDatacenterConfigurationName\n\nDescribe \"$($script:DscResourceName)_Integration\" {\n    Context 'When creating Datastore Cluster without modifying the Datastore Cluster configuration' {\n        BeforeAll {\n            # Arrange\n            & $script:CreateDatacenterConfigurationName `\n                -OutputPath $script:CreateDatacenterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsCreateDatacenter = @{\n                Path = $script:CreateDatacenterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDatacenter } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:CreateDatastoreClusterConfigurationName `\n                    -OutputPath $script:CreateDatastoreClusterMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsCreateDatastoreCluster = @{\n                    Path = $script:CreateDatastoreClusterMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsCreateDatastoreCluster } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:CreateDatastoreClusterMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:CreateDatastoreClusterMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:CreateDatastoreClusterConfigurationName\n                }\n            }\n\n            # Act\n            $datastoreClusterDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $datastoreClusterDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $datastoreClusterDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterName\n            $datastoreClusterDscResource.Location | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterLocation\n            $datastoreClusterDscResource.DatacenterName | Should -Be $script:ConfigurationData.AllNodes.DatacenterName\n            $datastoreClusterDscResource.DatacenterLocation | Should -Be $script:ConfigurationData.AllNodes.DatacenterLocation\n            $datastoreClusterDscResource.Ensure | Should -Be 'Present'\n            $datastoreClusterDscResource.IOLatencyThresholdMillisecond | Should -BeNull\n            $datastoreClusterDscResource.IOLoadBalanceEnabled | Should -Be $script:ConfigurationData.AllNodes.DefaultIOLoadBalanceEnabled\n            $datastoreClusterDscResource.SdrsAutomationLevel | Should -Be $script:ConfigurationData.AllNodes.DefaultSdrsAutomationLevel\n            $datastoreClusterDscResource.SpaceUtilizationThresholdPercent | Should -BeNull\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:RemoveDatastoreClusterConfigurationName `\n                -OutputPath $script:RemoveDatastoreClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:RemoveDatacenterConfigurationName `\n                -OutputPath $script:RemoveDatacenterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsRemoveDatastoreCluster = @{\n                Path = $script:RemoveDatastoreClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsRemoveDatacenter = @{\n                Path = $script:RemoveDatacenterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDatastoreCluster } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDatacenter } | Should -Not -Throw\n\n            Remove-Item -Path $script:CreateDatacenterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:CreateDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatacenterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When creating Datastore Cluster and modifying the Datastore Cluster configuration' {\n        BeforeAll {\n            # Arrange\n            & $script:CreateDatacenterConfigurationName `\n                -OutputPath $script:CreateDatacenterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsCreateDatacenter = @{\n                Path = $script:CreateDatacenterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDatacenter } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:CreateAndModifyDatastoreClusterConfigurationName `\n                    -OutputPath $script:CreateAndModifyDatastoreClusterMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsCreateAndModifyDatastoreCluster = @{\n                    Path = $script:CreateAndModifyDatastoreClusterMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsCreateAndModifyDatastoreCluster } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:CreateAndModifyDatastoreClusterMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:CreateAndModifyDatastoreClusterMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:CreateAndModifyDatastoreClusterConfigurationName\n                }\n            }\n\n            # Act\n            $datastoreClusterDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $datastoreClusterDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $datastoreClusterDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterName\n            $datastoreClusterDscResource.Location | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterLocation\n            $datastoreClusterDscResource.DatacenterName | Should -Be $script:ConfigurationData.AllNodes.DatacenterName\n            $datastoreClusterDscResource.DatacenterLocation | Should -Be $script:ConfigurationData.AllNodes.DatacenterLocation\n            $datastoreClusterDscResource.Ensure | Should -Be 'Present'\n            $datastoreClusterDscResource.IOLatencyThresholdMillisecond | Should -Be $script:ConfigurationData.AllNodes.IOLatencyThresholdMillisecond\n            $datastoreClusterDscResource.IOLoadBalanceEnabled | Should -Be $script:ConfigurationData.AllNodes.IOLoadBalanceEnabled\n            $datastoreClusterDscResource.SdrsAutomationLevel | Should -Be $script:ConfigurationData.AllNodes.SdrsAutomationLevel\n            $datastoreClusterDscResource.SpaceUtilizationThresholdPercent | Should -Be $script:ConfigurationData.AllNodes.SpaceUtilizationThresholdPercent\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:RemoveDatastoreClusterConfigurationName `\n                -OutputPath $script:RemoveDatastoreClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:RemoveDatacenterConfigurationName `\n                -OutputPath $script:RemoveDatacenterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsRemoveDatastoreCluster = @{\n                Path = $script:RemoveDatastoreClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsRemoveDatacenter = @{\n                Path = $script:RemoveDatacenterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDatastoreCluster } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDatacenter } | Should -Not -Throw\n\n            Remove-Item -Path $script:CreateDatacenterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:CreateAndModifyDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatacenterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When removing Datastore Cluster' {\n        BeforeAll {\n            # Arrange\n            & $script:CreateDatacenterConfigurationName `\n                -OutputPath $script:CreateDatacenterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            & $script:CreateAndModifyDatastoreClusterConfigurationName `\n                -OutputPath $script:CreateAndModifyDatastoreClusterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsCreateDatacenter = @{\n                Path = $script:CreateDatacenterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParamsCreateAndModifyDatastoreCluster = @{\n                Path = $script:CreateAndModifyDatastoreClusterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDatacenter } | Should -Not -Throw\n            { Start-DscConfiguration @startDscConfigurationParamsCreateAndModifyDatastoreCluster } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:RemoveDatastoreClusterConfigurationName `\n                    -OutputPath $script:RemoveDatastoreClusterMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsRemoveDatastoreCluster = @{\n                    Path = $script:RemoveDatastoreClusterMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsRemoveDatastoreCluster } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:RemoveDatastoreClusterMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path -Path $script:RemoveDatastoreClusterMofFilePath -ChildPath \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:RemoveDatastoreClusterConfigurationName\n                }\n            }\n\n            # Act\n            $datastoreClusterDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $datastoreClusterDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $datastoreClusterDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterName\n            $datastoreClusterDscResource.Location | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterLocation\n            $datastoreClusterDscResource.DatacenterName | Should -Be $script:ConfigurationData.AllNodes.DatacenterName\n            $datastoreClusterDscResource.DatacenterLocation | Should -Be $script:ConfigurationData.AllNodes.DatacenterLocation\n            $datastoreClusterDscResource.Ensure | Should -Be 'Absent'\n            $datastoreClusterDscResource.IOLatencyThresholdMillisecond | Should -BeNull\n            $datastoreClusterDscResource.IOLoadBalanceEnabled | Should -BeNull\n            $datastoreClusterDscResource.SdrsAutomationLevel | Should -Be 'Unset'\n            $datastoreClusterDscResource.SpaceUtilizationThresholdPercent | Should -BeNull\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:RemoveDatacenterConfigurationName `\n                -OutputPath $script:RemoveDatacenterMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsRemoveDatacenter = @{\n                Path = $script:RemoveDatacenterMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDatacenter } | Should -Not -Throw\n\n            Remove-Item -Path $script:CreateDatacenterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:CreateAndModifyDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatacenterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DatastoreCluster/DatastoreCluster_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration DatastoreCluster_CreateDatacenterInTheRootFolderOfTheInventory_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        Datacenter $AllNodes.DatacenterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration DatastoreCluster_CreateDatastoreClusterWithoutModifyingTheDatastoreClusterConfiguration_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DatastoreCluster $AllNodes.DatastoreClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatastoreClusterName\n            Location = $AllNodes.DatastoreClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration DatastoreCluster_CreateDatastoreClusterAndModifyTheDatastoreClusterConfiguration_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DatastoreCluster $AllNodes.DatastoreClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatastoreClusterName\n            Location = $AllNodes.DatastoreClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n            IOLatencyThresholdMillisecond = $AllNodes.IOLatencyThresholdMillisecond\n            IOLoadBalanceEnabled = $AllNodes.IOLoadBalanceEnabled\n            SdrsAutomationLevel = $AllNodes.SdrsAutomationLevel\n            SpaceUtilizationThresholdPercent = $AllNodes.SpaceUtilizationThresholdPercent\n        }\n    }\n}\n\nConfiguration DatastoreCluster_RemoveDatastoreCluster_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DatastoreCluster $AllNodes.DatastoreClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatastoreClusterName\n            Location = $AllNodes.DatastoreClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n\nConfiguration DatastoreCluster_RemoveDatacenter_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        Datacenter $AllNodes.DatacenterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatacenterName\n            Location = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction Test-Setup {\n    <#\n    .SYNOPSIS\n\n    Retrieves information about the VMHost and the Datacenter where the VMHost is located.\n    It also retrieves the names of two unused Scsi logical units.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n\n        $script:VMHost = Get-VMHost -Server $script:VIServer | Select-Object -First 1\n        if ($null -eq $script:VMHost) {\n            throw \"Could not find a VMHost on vCenter Server $Server.\"\n        }\n\n        Get-DatacenterInformation\n        Get-ScsiLunInformation\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Get-DatacenterInformation {\n    <#\n    .SYNOPSIS\n\n    Retrieves the name and the location of the Datacenter in which the VMHost is located.\n    #>\n\n    $script:Datacenter = Get-Datacenter -Server $script:VIServer -VMHost $script:VMHost | Select-Object -First 1\n    if ($null -eq $script:Datacenter) {\n        throw \"Could not find a Datacenter on vCenter Server $Server.\"\n    }\n\n    $inventoryRootFolder = Get-Folder -Server $script:VIServer -NoRecursion\n\n    $datacenterLocationItems = @()\n    $datacenterFolder = $script:Datacenter.ParentFolder\n\n    $script:DatacenterLocation = $null\n    if ($datacenterFolder.Id -eq $inventoryRootFolder.Id) {\n        $script:DatacenterLocation = [string]::Empty\n    }\n    else {\n        $datacenterLocationItems += $datacenterFolder.Name\n        $currentFolder = $datacenterFolder.Parent\n        while ($true) {\n            if ($currentFolder.Id -eq $inventoryRootFolder.Id) {\n                break\n            }\n\n            $datacenterLocationItems += $currentFolder.Name\n            $currentFolder = $currentFolder.Parent\n        }\n\n        [array]::Reverse($datacenterLocationItems)\n\n        $script:DatacenterLocation = $datacenterLocationItems -Join '/'\n    }\n}\n\nfunction Get-ScsiLunInformation {\n    <#\n    .SYNOPSIS\n\n    Retrieves the names of two unused Scsi logical units.\n    #>\n\n    $datastoreSystem = Get-View -Server $script:VIServer -Id $script:VMHost.ExtensionData.ConfigManager.DatastoreSystem\n    $scsiLuns = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 2\n\n    if ($scsiLuns.Length -lt 2) {\n        throw 'The Integration Tests require two unused Scsi logical units to be available.'\n    }\n\n    $script:ScsiLunCanonicalNames = $scsiLuns | Select-Object -ExpandProperty CanonicalName\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter()]\n    [string]\n    $Name\n)\n\n<#\n    The DatastoreClusterAddDatastore DSC Resource Integration Tests require a vCenter Server with at\n    least one Datacenter and at least one VMHost located in that Datacenter.\n#>\n\n# The 'Name' parameter is not used in the Integration Tests, so it is set to $null.\n$Name = $null\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:DscResourceName = 'DatastoreClusterAddDatastore'\n$script:ConfigurationsPath = Join-Path -Path $PSScriptRoot -ChildPath \"$($script:DscResourceName)_Config.ps1\"\n\n. \"$PSScriptRoot\\$script:DscResourceName.Integration.Tests.Helpers.ps1\"\nTest-Setup\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            DatastoreClusterDscResourceId = '[DatastoreCluster]DatastoreCluster'\n            DatastoreClusterDscResourceName = 'DatastoreCluster'\n            VmfsDatastoreDscResourceIds = @('[VmfsDatastore]VmfsDatastoreOne', '[VmfsDatastore]VmfsDatastoreTwo')\n            VmfsDatastoreOneDscResourceName = 'VmfsDatastoreOne'\n            VmfsDatastoreTwoDscResourceName = 'VmfsDatastoreTwo'\n            DatastoreClusterAddDatastoreDscResourceName = 'DatastoreClusterAddDatastore'\n            DatastoreClusterName = 'DscDatastoreCluster'\n            DatastoreClusterLocation = [string]::Empty\n            DatacenterName = $script:Datacenter.Name\n            DatacenterLocation = $script:DatacenterLocation\n            VMHostName = $script:VMHost.Name\n            VmfsDatastoreOneName = 'DscVmfsDatastoreOne'\n            VmfsDatastoreTwoName = 'DscVmfsDatastoreTwo'\n            VmfsDatastoreNames = @('DscVmfsDatastoreOne', 'DscVmfsDatastoreTwo')\n            ScsiLunOneCanonicalName = $script:ScsiLunCanonicalNames[0]\n            ScsiLunTwoCanonicalName = $script:ScsiLunCanonicalNames[1]\n        }\n    )\n}\n\n. $script:ConfigurationsPath -Verbose:$true -ErrorAction Stop\n\n$script:CreateDatastoreClusterAndDatastoresConfigurationName = \"$($script:DscResourceName)_CreateDatastoreClusterAndTwoVmfsDatastores_Config\"\n$script:AddDatastoresToDatastoreClusterConfigurationName = \"$($script:DscResourceName)_AddTwoVmfsDatastoresToDatastoreCluster_Config\"\n$script:RemoveDatastoreClusterAndDatastoresConfigurationName = \"$($script:DscResourceName)_RemoveDatastoreClusterAndTwoVmfsDatastores_Config\"\n\n$script:CreateDatastoreClusterAndDatastoresMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateDatastoreClusterAndDatastoresConfigurationName\n$script:AddDatastoresToDatastoreClusterMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:AddDatastoresToDatastoreClusterConfigurationName\n$script:RemoveDatastoreClusterAndDatastoresMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveDatastoreClusterAndDatastoresConfigurationName\n\nDescribe \"$($script:DscResourceName)_Integration\" {\n    Context 'When adding two Datastores to Datastore Cluster' {\n        BeforeAll {\n            # Arrange\n            & $script:CreateDatastoreClusterAndDatastoresConfigurationName `\n                -OutputPath $script:CreateDatastoreClusterAndDatastoresMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsCreateDatastoreClusterAndDatastores = @{\n                Path = $script:CreateDatastoreClusterAndDatastoresMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsCreateDatastoreClusterAndDatastores } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:AddDatastoresToDatastoreClusterConfigurationName `\n                    -OutputPath $script:AddDatastoresToDatastoreClusterMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsAddDatastoresToDatastoreCluster = @{\n                    Path = $script:AddDatastoresToDatastoreClusterMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsAddDatastoresToDatastoreCluster } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:AddDatastoresToDatastoreClusterMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:AddDatastoresToDatastoreClusterMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:AddDatastoresToDatastoreClusterConfigurationName\n                }\n            }\n\n            # Act\n            $DatastoreClusterAddDatastoreDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $DatastoreClusterAddDatastoreDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $DatastoreClusterAddDatastoreDscResource.DatacenterName | Should -Be $script:ConfigurationData.AllNodes.DatacenterName\n            $DatastoreClusterAddDatastoreDscResource.DatacenterLocation | Should -Be $script:ConfigurationData.AllNodes.DatacenterLocation\n            $DatastoreClusterAddDatastoreDscResource.DatastoreClusterName | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterName\n            $DatastoreClusterAddDatastoreDscResource.DatastoreClusterLocation | Should -Be $script:ConfigurationData.AllNodes.DatastoreClusterLocation\n\n            $actualDatastoreNames = $DatastoreClusterAddDatastoreDscResource.DatastoreNames | Sort-Object\n            $expectedDatastoreNames = $script:ConfigurationData.AllNodes.VmfsDatastoreNames | Sort-Object\n            $actualDatastoreNames | Should -Be $expectedDatastoreNames\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:RemoveDatastoreClusterAndDatastoresConfigurationName `\n                -OutputPath $script:RemoveDatastoreClusterAndDatastoresMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsRemoveDatastoreClusterAndDatastores = @{\n                Path = $script:RemoveDatastoreClusterAndDatastoresMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveDatastoreClusterAndDatastores } | Should -Not -Throw\n\n            Remove-Item -Path $script:CreateDatastoreClusterAndDatastoresMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:AddDatastoresToDatastoreClusterMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:RemoveDatastoreClusterAndDatastoresMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration DatastoreClusterAddDatastore_CreateDatastoreClusterAndTwoVmfsDatastores_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DatastoreCluster $AllNodes.DatastoreClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatastoreClusterName\n            Location = $AllNodes.DatastoreClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Present'\n        }\n\n        VmfsDatastore $AllNodes.VmfsDatastoreOneDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VmfsDatastoreOneName\n            Path = $AllNodes.ScsiLunOneCanonicalName\n            Ensure = 'Present'\n            DependsOn = $AllNodes.DatastoreClusterDscResourceId\n        }\n\n        VmfsDatastore $AllNodes.VmfsDatastoreTwoDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VmfsDatastoreTwoName\n            Path = $AllNodes.ScsiLunTwoCanonicalName\n            Ensure = 'Present'\n            DependsOn = $AllNodes.DatastoreClusterDscResourceId\n        }\n    }\n}\n\nConfiguration DatastoreClusterAddDatastore_AddTwoVmfsDatastoresToDatastoreCluster_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        DatastoreClusterAddDatastore $AllNodes.DatastoreClusterAddDatastoreDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            DatastoreClusterName = $AllNodes.DatastoreClusterName\n            DatastoreClusterLocation = $AllNodes.DatastoreClusterLocation\n            DatastoreNames = $AllNodes.VmfsDatastoreNames\n        }\n    }\n}\n\nConfiguration DatastoreClusterAddDatastore_RemoveDatastoreClusterAndTwoVmfsDatastores_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VmfsDatastore $AllNodes.VmfsDatastoreOneDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VmfsDatastoreOneName\n            Path = $AllNodes.ScsiLunOneCanonicalName\n            Ensure = 'Absent'\n        }\n\n        VmfsDatastore $AllNodes.VmfsDatastoreTwoDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VmfsDatastoreTwoName\n            Path = $AllNodes.ScsiLunTwoCanonicalName\n            Ensure = 'Absent'\n        }\n\n        DatastoreCluster $AllNodes.DatastoreClusterDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.DatastoreClusterName\n            Location = $AllNodes.DatastoreClusterLocation\n            DatacenterName = $AllNodes.DatacenterName\n            DatacenterLocation = $AllNodes.DatacenterLocation\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VmfsDatastoreDscResourceIds\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostAcceptanceLevel/VMHostAcceptanceLevel.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the initial acceptance level of the specified VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostAcceptanceLevel {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    $initialVMHostAcceptanceLevel = $esxCli.software.acceptance.get.Invoke()\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $initialVMHostAcceptanceLevel\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostAcceptanceLevel/VMHostAcceptanceLevel.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostAcceptanceLevel.Integration.Tests.Helpers.ps1\"\n$script:initialVMHostAcceptanceLevel = Get-InitialVMHostAcceptanceLevel\n\n$script:dscResourceName = 'VMHostAcceptanceLevel'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostAcceptanceLevelResourceName = 'VMHostAcceptanceLevel'\n            InitialVMHostAcceptanceLevel = $script:initialVMHostAcceptanceLevel\n            VMHostAcceptanceLevel = 'CommunitySupported'\n        }\n    )\n}\n\n$script:configModifyVMHostAcceptanceLevel = \"$($script:dscResourceName)_ModifyVMHostAcceptanceLevel_Config\"\n$script:configModifyVMHostAcceptanceLevelToInitialState = \"$($script:dscResourceName)_ModifyVMHostAcceptanceLevelToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileModifyVMHostAcceptanceLevelPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostAcceptanceLevel\\\"\n$script:mofFileModifyVMHostAcceptanceLevelToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostAcceptanceLevelToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifyVMHostAcceptanceLevel\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostAcceptanceLevel `\n                -OutputPath $script:mofFileModifyVMHostAcceptanceLevelPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostAcceptanceLevelPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostAcceptanceLevelPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostAcceptanceLevel }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Level | Should -Be $script:configurationData.AllNodes.VMHostAcceptanceLevel\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostAcceptanceLevelPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostAcceptanceLevelToInitialState `\n                -OutputPath $script:mofFileModifyVMHostAcceptanceLevelToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostAcceptanceLevelToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyVMHostAcceptanceLevelPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostAcceptanceLevelToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostDCUIKeyboard/VMHostDCUIKeyboard.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the Keyboard Layout for the DCUI of the VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostDCUIKeyboardLayout {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $vmHostDCUIKeyboardLayout = $null\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    $vmHostDCUIKeyboardLayout = $esxCli.system.settings.keyboard.layout.get.Invoke()\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostDCUIKeyboardLayout\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostDCUIKeyboard/VMHostDCUIKeyboard.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostDCUIKeyboard.Integration.Tests.Helpers.ps1\"\n$script:initialVMHostDCUIKeyboardLayout = Get-InitialVMHostDCUIKeyboardLayout\n\n$script:dscResourceName = 'VMHostDCUIKeyboard'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostDCUIKeyboardResourceName = 'VMHostDCUIKeyboard'\n            InitialVMHostDCUIKeyboardLayout = $script:initialVMHostDCUIKeyboardLayout\n            VMHostDCUIKeyboardLayout = 'United Kingdom'\n        }\n    )\n}\n\n$script:configModifyVMHostDCUIKeyboardLayout = \"$($script:dscResourceName)_ModifyVMHostDCUIKeyboardLayout_Config\"\n$script:configModifyVMHostDCUIKeyboardLayoutToInitialState = \"$($script:dscResourceName)_ModifyVMHostDCUIKeyboardLayoutToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileModifyVMHostDCUIKeyboardLayoutPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostDCUIKeyboardLayout\\\"\n$script:mofFileModifyVMHostDCUIKeyboardLayoutToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostDCUIKeyboardLayoutToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifyVMHostDCUIKeyboardLayout\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostDCUIKeyboardLayout `\n                -OutputPath $script:mofFileModifyVMHostDCUIKeyboardLayoutPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostDCUIKeyboardLayoutPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostDCUIKeyboardLayoutPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostDCUIKeyboardLayout }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Layout | Should -Be $script:configurationData.AllNodes.VMHostDCUIKeyboardLayout\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostDCUIKeyboardLayoutPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostDCUIKeyboardLayoutToInitialState `\n                -OutputPath $script:mofFileModifyVMHostDCUIKeyboardLayoutToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostDCUIKeyboardLayoutToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyVMHostDCUIKeyboardLayoutPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostDCUIKeyboardLayoutToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostNetworkCoreDump/VMHostNetworkCoreDump.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the name of a VMKernel Network Adapter on the specified VMHost before the execution of the Integration Tests.\n#>\nfunction Get-VMKernelNetworkAdapterName {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $vmHostVMKernelNetworkAdapter = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VMKernel -ErrorAction Stop -Verbose:$false | Select-Object -First 1\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostVMKernelNetworkAdapter.Name\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostNetworkCoreDump/VMHostNetworkCoreDump.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostNetworkCoreDump.Integration.Tests.Helpers.ps1\"\n$script:vmHostVMKernelNetworkAdapterName = Get-VMKernelNetworkAdapterName\n\n$script:dscResourceName = 'VMHostNetworkCoreDump'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostNetworkCoreDumpResourceName = 'VMHostNetworkCoreDump'\n            EnableNetworkCoreDump = $true\n            NetworkCoreDumpInterfaceName = $script:vmHostVMKernelNetworkAdapterName\n            NetworkCoreDumpServerIp = '10.11.12.13'\n            NetworkCoreDumpServerPort = 6500\n        }\n    )\n}\n\n$script:configModifyVMHostNetworkCoreDumpConfiguration = \"$($script:dscResourceName)_ModifyVMHostNetworkCoreDumpConfiguration_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileModifyVMHostNetworkCoreDumpConfigurationPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostNetworkCoreDumpConfiguration\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifyVMHostNetworkCoreDumpConfiguration\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostNetworkCoreDumpConfiguration `\n                -OutputPath $script:mofFileModifyVMHostNetworkCoreDumpConfigurationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostNetworkCoreDumpConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostNetworkCoreDumpConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostNetworkCoreDumpConfiguration }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Enable | Should -Be $script:configurationData.AllNodes.EnableNetworkCoreDump\n            $configuration.InterfaceName | Should -Be $script:configurationData.AllNodes.NetworkCoreDumpInterfaceName\n            $configuration.ServerIp | Should -Be $script:configurationData.AllNodes.NetworkCoreDumpServerIp\n            $configuration.ServerPort | Should -Be $script:configurationData.AllNodes.NetworkCoreDumpServerPort\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostNetworkCoreDumpConfigurationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Remove-Item -Path $script:mofFileModifyVMHostNetworkCoreDumpConfigurationPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostSNMPAgent/VMHostSNMPAgent.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the SNMP Agent configuration of the specified VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostSNMPAgentConfiguration {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $vmHostSNMPAgentInitialConfiguration = @{}\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    $vmHostSNMPAgentConfiguration = $esxCli.system.snmp.get.Invoke()\n\n    $vmHostSNMPAgentInitialConfiguration.Authentication = $vmHostSNMPAgentConfiguration.authentication\n    $vmHostSNMPAgentInitialConfiguration.Communities = $vmHostSNMPAgentConfiguration.communities\n    $vmHostSNMPAgentInitialConfiguration.Enable = [System.Convert]::ToBoolean($vmHostSNMPAgentConfiguration.enable)\n    $vmHostSNMPAgentInitialConfiguration.EngineId = $vmHostSNMPAgentConfiguration.engineid\n    $vmHostSNMPAgentInitialConfiguration.Hwsrc = $vmHostSNMPAgentConfiguration.hwsrc\n    $vmHostSNMPAgentInitialConfiguration.LargeStorage = [System.Convert]::ToBoolean($vmHostSNMPAgentConfiguration.largestorage)\n    $vmHostSNMPAgentInitialConfiguration.LogLevel = $vmHostSNMPAgentConfiguration.loglevel\n    $vmHostSNMPAgentInitialConfiguration.NoTraps = $vmHostSNMPAgentConfiguration.notraps\n    $vmHostSNMPAgentInitialConfiguration.Port = [int] $vmHostSNMPAgentConfiguration.port\n    $vmHostSNMPAgentInitialConfiguration.Privacy = $vmHostSNMPAgentConfiguration.privacy\n    $vmHostSNMPAgentInitialConfiguration.RemoteUsers = $vmHostSNMPAgentConfiguration.remoteusers\n    $vmHostSNMPAgentInitialConfiguration.SysContact = $vmHostSNMPAgentConfiguration.syscontact\n    $vmHostSNMPAgentInitialConfiguration.SysLocation = $vmHostSNMPAgentConfiguration.syslocation\n    $vmHostSNMPAgentInitialConfiguration.Targets = $vmHostSNMPAgentConfiguration.targets\n    $vmHostSNMPAgentInitialConfiguration.Users = $vmHostSNMPAgentConfiguration.users\n    $vmHostSNMPAgentInitialConfiguration.V3Targets = $vmHostSNMPAgentConfiguration.v3targets\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostSNMPAgentInitialConfiguration\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostSNMPAgent/VMHostSNMPAgent.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostSNMPAgent.Integration.Tests.Helpers.ps1\"\n$script:vmHostSNMPAgentInitialConfiguration = Get-InitialVMHostSNMPAgentConfiguration\n\n$script:dscResourceName = 'VMHostSNMPAgent'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostSNMPAgentResourceName = 'VMHostSNMPAgent'\n            InitialVMHostSNMPAgentAuthentication = $script:vmHostSNMPAgentInitialConfiguration.Authentication\n            InitialVMHostSNMPAgentCommunities = $script:vmHostSNMPAgentInitialConfiguration.Communities\n            InitialVMHostSNMPAgentEnableState = $script:vmHostSNMPAgentInitialConfiguration.Enable\n            InitialVMHostSNMPAgentEngineId = $script:vmHostSNMPAgentInitialConfiguration.EngineId\n            InitialVMHostSNMPAgentHwsrc = $script:vmHostSNMPAgentInitialConfiguration.Hwsrc\n            InitialVMHostSNMPAgentLargeStorage = $script:vmHostSNMPAgentInitialConfiguration.LargeStorage\n            InitialVMHostSNMPAgentLogLevel = $script:vmHostSNMPAgentInitialConfiguration.LogLevel\n            InitialVMHostSNMPAgentNoTraps = $script:vmHostSNMPAgentInitialConfiguration.NoTraps\n            InitialVMHostSNMPAgentPort = $script:vmHostSNMPAgentInitialConfiguration.Port\n            InitialVMHostSNMPAgentPrivacy = $script:vmHostSNMPAgentInitialConfiguration.Privacy\n            InitialVMHostSNMPAgentRemoteUsers = $script:vmHostSNMPAgentInitialConfiguration.RemoteUsers\n            InitialVMHostSNMPAgentSysContact = $script:vmHostSNMPAgentInitialConfiguration.SysContact\n            InitialVMHostSNMPAgentSysLocation = $script:vmHostSNMPAgentInitialConfiguration.SysLocation\n            InitialVMHostSNMPAgentTargets = $script:vmHostSNMPAgentInitialConfiguration.Targets\n            InitialVMHostSNMPAgentUsers = $script:vmHostSNMPAgentInitialConfiguration.Users\n            InitialVMHostSNMPAgentV3Targets = $script:vmHostSNMPAgentInitialConfiguration.V3Targets\n            SNMPAgentAuthenticationProtocol = 'SHA1'\n            EnableSNMPAgent = $true\n            SNMPAgentHwsrc = 'indications'\n            SNMPAgentLargeStorage = $true\n            SNMPAgentLogLevel = 'info'\n            SNMPAgentPort = 161\n            SNMPAgentPrivacyProtocol = 'AES128'\n            ResetSNMPAgent = $true\n        }\n    )\n}\n\n$script:configModifyVMHostSNMPAgentConfiguration = \"$($script:dscResourceName)_ModifyVMHostSNMPAgentConfiguration_Config\"\n$script:configModifyVMHostSNMPAgentConfigurationToInitialState = \"$($script:dscResourceName)_ModifyVMHostSNMPAgentConfigurationToInitialState_Config\"\n$script:configResetVMHostSNMPAgentConfiguration = \"$($script:dscResourceName)_ResetVMHostSNMPAgentConfiguration_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileModifyVMHostSNMPAgentConfigurationPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostSNMPAgentConfiguration\\\"\n$script:mofFileModifyVMHostSNMPAgentConfigurationToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostSNMPAgentConfigurationToInitialState\\\"\n$script:mofFileResetVMHostSNMPAgentConfigurationPath = \"$script:integrationTestsFolderPath\\$script:configResetVMHostSNMPAgentConfiguration\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifyVMHostSNMPAgentConfiguration\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostSNMPAgentConfiguration `\n                -OutputPath $script:mofFileModifyVMHostSNMPAgentConfigurationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostSNMPAgentConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostSNMPAgentConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostSNMPAgentConfiguration }\n\n            # Assert\n\n            # If the initial EngineId value was $null, we need to retrieve the new value to compare it with the output of the DSC Resource.\n            $vmHostSNMPAgentEngineId = (Get-InitialVMHostSNMPAgentConfiguration).EngineId\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Authentication | Should -Be ([string] $script:configurationData.AllNodes.SNMPAgentAuthenticationProtocol)\n            $configuration.Communities | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentCommunities)\n            $configuration.Enable | Should -Be $script:configurationData.AllNodes.EnableSNMPAgent\n            $configuration.EngineId | Should -Be ([string] $vmHostSNMPAgentEngineId)\n            $configuration.Hwsrc | Should -Be ([string] $script:configurationData.AllNodes.SNMPAgentHwsrc)\n            $configuration.LargeStorage | Should -Be $script:configurationData.AllNodes.SNMPAgentLargeStorage\n            $configuration.LogLevel | Should -Be ([string] $script:configurationData.AllNodes.SNMPAgentLogLevel)\n            $configuration.NoTraps | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentNoTraps)\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.SNMPAgentPort\n            $configuration.Privacy | Should -Be ([string] $script:configurationData.AllNodes.SNMPAgentPrivacyProtocol)\n            $configuration.RemoteUsers | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentRemoteUsers)\n            $configuration.SysContact | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentSysContact)\n            $configuration.SysLocation | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentSysLocation)\n            $configuration.Targets | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentTargets)\n            $configuration.Users | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentUsers)\n            $configuration.V3Targets | Should -Be ([string] $script:configurationData.AllNodes.InitialVMHostSNMPAgentV3Targets)\n            $configuration.Reset | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostSNMPAgentConfigurationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configResetVMHostSNMPAgentConfiguration `\n                -OutputPath $script:mofFileResetVMHostSNMPAgentConfigurationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVMHostSNMPAgentConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostSNMPAgentConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersResetVMHostSNMPAgentConfiguration = @{\n                Path = $script:mofFileResetVMHostSNMPAgentConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyVMHostSNMPAgentConfigurationToInitialState = @{\n                Path = $script:mofFileModifyVMHostSNMPAgentConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersResetVMHostSNMPAgentConfiguration\n            Start-DscConfiguration @startDscConfigurationParametersModifyVMHostSNMPAgentConfigurationToInitialState\n\n            Remove-Item -Path $script:mofFileModifyVMHostSNMPAgentConfigurationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostSNMPAgentConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileResetVMHostSNMPAgentConfigurationPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostSharedSwapSpace/VMHostSharedSwapSpace.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the canonical name of the Scsi logical unit that will contain the Vmfs Datastore used in the Integration Tests.\n#>\nfunction Get-ScsiLunCanonicalName {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n\n    if ($null -eq $scsiLun) {\n        throw 'The Vmfs Datastore that is used in the Integration Tests requires one unused Scsi logical unit to be available.'\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $scsiLun.CanonicalName\n}\n\n<#\n.DESCRIPTION\n\nRetrieves the initial shared swap space configuration of the VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostSharedSwapSpaceConfiguration {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $vmHostSharedSwapSpaceInitialConfiguration = @{}\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    $vmHostSharedSwapSpaceConfiguration = $esxCli.sched.swap.system.get.Invoke()\n\n    $vmHostSharedSwapSpaceInitialConfiguration.DatastoreEnabled = [System.Convert]::ToBoolean($vmHostSharedSwapSpaceConfiguration.DatastoreEnabled)\n    $vmHostSharedSwapSpaceInitialConfiguration.DatastoreName = $vmHostSharedSwapSpaceConfiguration.DatastoreName\n    $vmHostSharedSwapSpaceInitialConfiguration.DatastoreOrder = [long] $vmHostSharedSwapSpaceConfiguration.DatastoreOrder\n    $vmHostSharedSwapSpaceInitialConfiguration.HostCacheEnabled = [System.Convert]::ToBoolean($vmHostSharedSwapSpaceConfiguration.HostcacheEnabled)\n    $vmHostSharedSwapSpaceInitialConfiguration.HostCacheOrder = [long] $vmHostSharedSwapSpaceConfiguration.HostcacheOrder\n    $vmHostSharedSwapSpaceInitialConfiguration.HostLocalSwapEnabled = [System.Convert]::ToBoolean($vmHostSharedSwapSpaceConfiguration.HostlocalswapEnabled)\n    $vmHostSharedSwapSpaceInitialConfiguration.HostLocalSwapOrder = [long] $vmHostSharedSwapSpaceConfiguration.HostlocalswapOrder\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostSharedSwapSpaceInitialConfiguration\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostSharedSwapSpace/VMHostSharedSwapSpace.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostSharedSwapSpace.Integration.Tests.Helpers.ps1\"\n$script:scsiLunCanonicalName = Get-ScsiLunCanonicalName\n$script:initialVMHostSharedSwapSpaceConfiguration = Get-InitialVMHostSharedSwapSpaceConfiguration\n\n$script:dscResourceName = 'VMHostSharedSwapSpace'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VmfsDatastoreResourceName = 'VmfsDatastore'\n            VMHostSharedSwapSpaceResourceName = 'VMHostSharedSwapSpace'\n            DatastoreName = 'MyTestVmfsDatastore'\n            ScsiLunCanonicalName = $script:scsiLunCanonicalName\n            InitialDatastoreEnabled = $script:initialVMHostSharedSwapSpaceConfiguration.DatastoreEnabled\n            InitialDatastoreName = $script:initialVMHostSharedSwapSpaceConfiguration.DatastoreName\n            InitialDatastoreOrder = $script:initialVMHostSharedSwapSpaceConfiguration.DatastoreOrder\n            InitialHostCacheEnabled = $script:initialVMHostSharedSwapSpaceConfiguration.HostCacheEnabled\n            InitialHostCacheOrder = $script:initialVMHostSharedSwapSpaceConfiguration.HostCacheOrder\n            InitialHostLocalSwapEnabled = $script:initialVMHostSharedSwapSpaceConfiguration.HostLocalSwapEnabled\n            InitialHostLocalSwapOrder = $script:initialVMHostSharedSwapSpaceConfiguration.HostLocalSwapOrder\n            DatastoreEnabled = $true\n            DatastoreOrder = 1\n            HostCacheEnabled = $false\n            HostCacheOrder = 2\n            HostLocalSwapEnabled = $false\n            HostLocalSwapOrder = 0\n        }\n    )\n}\n\n$script:configCreateVmfsDatastore = \"$($script:dscResourceName)_CreateVmfsDatastore_Config\"\n$script:configModifySharedSwapSpaceConfiguration = \"$($script:dscResourceName)_ModifySharedSwapSpaceConfiguration_Config\"\n$script:configModifySharedSwapSpaceConfigurationToInitialState = \"$($script:dscResourceName)_ModifySharedSwapSpaceConfigurationToInitialState_Config\"\n$script:configRemoveVmfsDatastore = \"$($script:dscResourceName)_RemoveVmfsDatastore_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configCreateVmfsDatastore\\\"\n$script:mofFileModifySharedSwapSpaceConfigurationPath = \"$script:integrationTestsFolderPath\\$script:configModifySharedSwapSpaceConfiguration\\\"\n$script:mofFileModifySharedSwapSpaceConfigurationToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifySharedSwapSpaceConfigurationToInitialState\\\"\n$script:mofFileRemoveVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVmfsDatastore\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifySharedSwapSpaceConfiguration\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastore `\n                -OutputPath $script:mofFileCreateVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifySharedSwapSpaceConfiguration `\n                -OutputPath $script:mofFileModifySharedSwapSpaceConfigurationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastore = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifySharedSwapSpaceConfiguration = @{\n                Path = $script:mofFileModifySharedSwapSpaceConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastore\n            Start-DscConfiguration @startDscConfigurationParametersModifySharedSwapSpaceConfiguration\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifySharedSwapSpaceConfigurationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifySharedSwapSpaceConfiguration }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.DatastoreEnabled | Should -Be $script:configurationData.AllNodes.DatastoreEnabled\n            $configuration.DatastoreName | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.DatastoreOrder | Should -Be $script:configurationData.AllNodes.DatastoreOrder\n            $configuration.HostCacheEnabled | Should -Be $script:configurationData.AllNodes.HostCacheEnabled\n            $configuration.HostCacheOrder | Should -Be $script:configurationData.AllNodes.HostCacheOrder\n            $configuration.HostLocalSwapEnabled | Should -Be $script:configurationData.AllNodes.HostLocalSwapEnabled\n            $configuration.HostLocalSwapOrder | Should -Be $script:configurationData.AllNodes.HostLocalSwapOrder\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifySharedSwapSpaceConfigurationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifySharedSwapSpaceConfigurationToInitialState `\n                -OutputPath $script:mofFileModifySharedSwapSpaceConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersModifySharedSwapSpaceConfigurationToInitialState = @{\n                Path = $script:mofFileModifySharedSwapSpaceConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVmfsDatastore = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersModifySharedSwapSpaceConfigurationToInitialState\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVmfsDatastore\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifySharedSwapSpaceConfigurationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifySharedSwapSpaceConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostSoftwareDevice/VMHostSoftwareDevice.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DeviceId\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostSoftwareDevice'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostSoftwareDeviceResourceName = 'VMHostSoftwareDevice'\n            DeviceId = $DeviceId\n            InstanceAddress = 0\n        }\n    )\n}\n\n$script:configAddSoftwareDevice = \"$($script:dscResourceName)_AddSoftwareDevice_Config\"\n$script:configRemoveSoftwareDevice = \"$($script:dscResourceName)_RemoveSoftwareDevice_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileAddSoftwareDevicePath = \"$script:integrationTestsFolderPath\\$script:configAddSoftwareDevice\\\"\n$script:mofFileRemoveSoftwareDevicePath = \"$script:integrationTestsFolderPath\\$script:configRemoveSoftwareDevice\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configAddSoftwareDevice\" {\n        BeforeAll {\n            # Arrange\n            & $script:configAddSoftwareDevice `\n                -OutputPath $script:mofFileAddSoftwareDevicePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileAddSoftwareDevicePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileAddSoftwareDevicePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configAddSoftwareDevice }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.DeviceIdentifier | Should -Be $script:configurationData.AllNodes.DeviceId\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.InstanceAddress | Should -Be $script:configurationData.AllNodes.InstanceAddress\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileAddSoftwareDevicePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveSoftwareDevice `\n                -OutputPath $script:mofFileRemoveSoftwareDevicePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveSoftwareDevicePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileAddSoftwareDevicePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveSoftwareDevicePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveSoftwareDevice\" {\n        BeforeAll {\n            # Arrange\n            & $script:configAddSoftwareDevice `\n                -OutputPath $script:mofFileAddSoftwareDevicePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveSoftwareDevice `\n                -OutputPath $script:mofFileRemoveSoftwareDevicePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersAddSoftwareDevice = @{\n                Path = $script:mofFileAddSoftwareDevicePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveSoftwareDevice = @{\n                Path = $script:mofFileRemoveSoftwareDevicePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersAddSoftwareDevice\n            Start-DscConfiguration @startDscConfigurationParametersRemoveSoftwareDevice\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveSoftwareDevicePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveSoftwareDevice }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.DeviceIdentifier | Should -Be $script:configurationData.AllNodes.DeviceId\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.InstanceAddress | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveSoftwareDevicePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Remove-Item -Path $script:mofFileAddSoftwareDevicePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveSoftwareDevicePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelActiveDumpFile/VMHostVMKernelActiveDumpFile.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the canonical name of the Scsi logical unit that will contain the Vmfs Datastore used in the Integration Tests.\n#>\nfunction Get-ScsiLunCanonicalName {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n\n    if ($null -eq $scsiLun) {\n        throw 'The Vmfs Datastore that is used in the Integration Tests requires one unused Scsi logical unit to be available.'\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $scsiLun.CanonicalName\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelActiveDumpFile/VMHostVMKernelActiveDumpFile.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostVMKernelActiveDumpFile.Integration.Tests.Helpers.ps1\"\n$script:scsiLunCanonicalName = Get-ScsiLunCanonicalName\n\n$script:dscResourceName = 'VMHostVMKernelActiveDumpFile'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VmfsDatastoreResourceName = 'VmfsDatastore'\n            VMHostVMKernelDumpFileResourceName = 'VMHostVMKernelDumpFile'\n            VMHostVMKernelActiveDumpFileResourceName = 'VMHostVMKernelActiveDumpFile'\n            DatastoreName = 'MyTestVmfsDatastore'\n            ScsiLunCanonicalName = $script:scsiLunCanonicalName\n            DumpFileName = 'MyTestDumpFile'\n            DumpFileSize = 1181\n            Force = $true\n            EnableVMKernelDumpFile = $true\n            DisableVMKernelDumpFile = $false\n            UseSmartAlgorithmForVMKernelDumpFile = $true\n        }\n    )\n}\n\n$script:configCreateVmfsDatastore = \"$($script:dscResourceName)_CreateVmfsDatastore_Config\"\n$script:configCreateVMKernelDumpFile = \"$($script:dscResourceName)_CreateVMKernelDumpFile_Config\"\n$script:configEnableVMKernelDumpFile = \"$($script:dscResourceName)_EnableVMKernelDumpFile_Config\"\n$script:configDisableVMKernelDumpFile = \"$($script:dscResourceName)_DisableVMKernelDumpFile_Config\"\n$script:configRemoveVMKernelDumpFile = \"$($script:dscResourceName)_RemoveVMKernelDumpFile_Config\"\n$script:configRemoveVmfsDatastore = \"$($script:dscResourceName)_RemoveVmfsDatastore_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configCreateVmfsDatastore\\\"\n$script:mofFileCreateVMKernelDumpFilePath = \"$script:integrationTestsFolderPath\\$script:configCreateVMKernelDumpFile\\\"\n$script:mofFileEnableVMKernelDumpFilePath = \"$script:integrationTestsFolderPath\\$script:configEnableVMKernelDumpFile\\\"\n$script:mofFileDisableVMKernelDumpFilePath = \"$script:integrationTestsFolderPath\\$script:configDisableVMKernelDumpFile\\\"\n$script:mofFileRemoveVMKernelDumpFilePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMKernelDumpFile\\\"\n$script:mofFileRemoveVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVmfsDatastore\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configEnableVMKernelDumpFile\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastore `\n                -OutputPath $script:mofFileCreateVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMKernelDumpFile `\n                -OutputPath $script:mofFileCreateVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configDisableVMKernelDumpFile `\n                -OutputPath $script:mofFileDisableVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configEnableVMKernelDumpFile `\n                -OutputPath $script:mofFileEnableVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastore = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMKernelDumpFile = @{\n                Path = $script:mofFileCreateVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersDisableVMKernelDumpFile = @{\n                Path = $script:mofFileDisableVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersEnableVMKernelDumpFile = @{\n                Path = $script:mofFileEnableVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastore\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMKernelDumpFile\n            Start-DscConfiguration @startDscConfigurationParametersDisableVMKernelDumpFile\n            Start-DscConfiguration @startDscConfigurationParametersEnableVMKernelDumpFile\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileEnableVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configEnableVMKernelDumpFile }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Enable | Should -Be $script:configurationData.AllNodes.EnableVMKernelDumpFile\n            $configuration.Smart | Should -Be $script:configurationData.AllNodes.UseSmartAlgorithmForVMKernelDumpFile\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileEnableVMKernelDumpFilePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMKernelDumpFile `\n                -OutputPath $script:mofFileRemoveVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMKernelDumpFile = @{\n                Path = $script:mofFileRemoveVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVmfsDatastore = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMKernelDumpFile\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVmfsDatastore\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileDisableVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileEnableVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelActiveDumpPartition/VMHostVMKernelActiveDumpPartition.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the state of the VMKernel dump partition of the VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostVMKernelDumpPartitionState {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $vmHostVMKernelDumpPartitionState = @{}\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    $vmHostVMKernelDumpPartition = $esxCli.system.coredump.partition.get.Invoke()\n\n    <#\n    The VMKernel dump partition settings can be in three states:\n    1. Active and configured.\n    2. Inactive but configured.\n    3. Neither active nor configured\n    #>\n    if ($null -ne $vmHostVMKernelDumpPartition.Active -and $null -ne $vmHostVMKernelDumpPartition.Configured) {\n        $vmHostVMKernelDumpPartitionState.Enable = $true\n        $vmHostVMKernelDumpPartitionState.Partition = $vmHostVMKernelDumpPartition.Configured\n    }\n    elseif ($null -eq $vmHostVMKernelDumpPartitionState.Active -and $null -ne $vmHostVMKernelDumpPartition.Configured) {\n        $vmHostVMKernelDumpPartitionState.Enable = $false\n        $vmHostVMKernelDumpPartitionState.Partition = $vmHostVMKernelDumpPartition.Configured\n    }\n    else {\n        $vmHostVMKernelDumpPartitionState.Enable = $false\n        $vmHostVMKernelDumpPartitionState.Partition = $null\n        $vmHostVMKernelDumpPartitionState.Unconfigure = $true\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostVMKernelDumpPartitionState\n}\n\n<#\n.DESCRIPTION\n\nRestores the initial state of the VMKernel dump partition of the VMHost.\n#>\nfunction Restore-VMHostVMKernelDumpPartitionToInitialState {\n    [CmdletBinding()]\n\n    $initialVMKernelDumpPartitionState = $script:configurationData.AllNodes.InitialVMKernelDumpPartitionState\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n    $coreDumpPartitionSetMethodArgs = $esxCli.system.coredump.partition.set.CreateArgs()\n\n    if ($initialVMKernelDumpPartitionState.Enable) {\n        $coreDumpPartitionSetMethodArgs.partition = $initialVMKernelDumpPartitionState.Partition\n\n        try {\n            $esxCli.system.coredump.partition.set.Invoke($coreDumpPartitionSetMethodArgs)\n        }\n        catch {\n            throw 'Could not restore VMKernel dump partition initial state. For more information: {0}' -f $_.Exception.Message\n        }\n    }\n    elseif ($null -ne $initialVMKernelDumpPartitionState.Partition) {\n        $coreDumpPartitionSetMethodArgs.partition = $initialVMKernelDumpPartitionState.Partition\n\n        try {\n            $esxCli.system.coredump.partition.set.Invoke($coreDumpPartitionSetMethodArgs)\n        }\n        catch {\n            throw 'Could not restore VMKernel dump partition initial state. For more information: {0}' -f $_.Exception.Message\n        }\n\n        # The partition is currently active and configured and needs to be made inactive.\n        $coreDumpPartitionSetMethodArgs = $esxCli.system.coredump.partition.set.CreateArgs()\n        $coreDumpPartitionSetMethodArgs = $initialVMKernelDumpPartitionState.Enable\n\n        try {\n            $esxCli.system.coredump.partition.set.Invoke($coreDumpPartitionSetMethodArgs)\n        }\n        catch {\n            throw 'Could not restore VMKernel dump partition initial state. For more information: {0}' -f $_.Exception.Message\n        }\n    }\n    else {\n        $coreDumpPartitionSetMethodArgs.unconfigure = $initialVMKernelDumpPartitionState.Unconfigure\n\n        try {\n            $esxCli.system.coredump.partition.set.Invoke($coreDumpPartitionSetMethodArgs)\n        }\n        catch {\n            throw 'Could not restore VMKernel dump partition initial state. For more information: {0}' -f $_.Exception.Message\n        }\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelActiveDumpPartition/VMHostVMKernelActiveDumpPartition.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostVMKernelActiveDumpPartition.Integration.Tests.Helpers.ps1\"\n$script:initialVMHostVMKernelDumpPartitionState = Get-InitialVMHostVMKernelDumpPartitionState\n\n$script:dscResourceName = 'VMHostVMKernelActiveDumpPartition'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostVMKernelActiveDumpPartitionResourceName = 'VMHostVMKernelActiveDumpPartition'\n            InitialVMKernelDumpPartitionState = $script:initialVMHostVMKernelDumpPartitionState\n            EnableVMKernelDumpPartition = $true\n            DisableVMKernelDumpPartition = $false\n            UseSmartAlgorithmForVMKernelDumpPartition = $true\n        }\n    )\n}\n\n$script:configEnableVMKernelDumpPartition = \"$($script:dscResourceName)_EnableVMKernelDumpPartition_Config\"\n$script:configDisableVMKernelDumpPartition = \"$($script:dscResourceName)_DisableVMKernelDumpPartition_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileEnableVMKernelDumpPartitionPath = \"$script:integrationTestsFolderPath\\$script:configEnableVMKernelDumpPartition\\\"\n$script:mofFileDisableVMKernelDumpPartitionPath = \"$script:integrationTestsFolderPath\\$script:configDisableVMKernelDumpPartition\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configEnableVMKernelDumpPartition\" {\n        BeforeAll {\n            # Arrange\n            & $script:configDisableVMKernelDumpPartition `\n                -OutputPath $script:mofFileDisableVMKernelDumpPartitionPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configEnableVMKernelDumpPartition `\n                -OutputPath $script:mofFileEnableVMKernelDumpPartitionPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersDisableVMKernelDumpPartition = @{\n                Path = $script:mofFileDisableVMKernelDumpPartitionPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersEnableVMKernelDumpPartition = @{\n                Path = $script:mofFileEnableVMKernelDumpPartitionPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersDisableVMKernelDumpPartition\n            Start-DscConfiguration @startDscConfigurationParametersEnableVMKernelDumpPartition\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileEnableVMKernelDumpPartitionPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configEnableVMKernelDumpPartition }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Enable | Should -Be $script:configurationData.AllNodes.EnableVMKernelDumpPartition\n            $configuration.Smart | Should -Be $script:configurationData.AllNodes.UseSmartAlgorithmForVMKernelDumpPartition\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileEnableVMKernelDumpPartitionPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Restore-VMHostVMKernelDumpPartitionToInitialState\n\n            Remove-Item -Path $script:mofFileDisableVMKernelDumpPartitionPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileEnableVMKernelDumpPartitionPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the canonical name of the Scsi logical unit that will contain the Vmfs Datastore used in the Integration Tests.\n#>\nfunction Get-ScsiLunCanonicalName {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n\n    if ($null -eq $scsiLun) {\n        throw 'The Vmfs Datastore that is used in the Integration Tests requires one unused Scsi logical unit to be available.'\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $scsiLun.CanonicalName\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostVMKernelDumpFile.Integration.Tests.Helpers.ps1\"\n$script:scsiLunCanonicalName = Get-ScsiLunCanonicalName\n\n$script:dscResourceName = 'VMHostVMKernelDumpFile'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VmfsDatastoreResourceName = 'VmfsDatastore'\n            VMHostVMKernelDumpFileResourceName = 'VMHostVMKernelDumpFile'\n            DatastoreName = 'MyTestVmfsDatastore'\n            ScsiLunCanonicalName = $script:scsiLunCanonicalName\n            DumpFileName = 'MyTestDumpFile'\n            DumpFileSize = 1181\n            Force = $true\n        }\n    )\n}\n\n$script:configCreateVmfsDatastore = \"$($script:dscResourceName)_CreateVmfsDatastore_Config\"\n$script:configCreateVMKernelDumpFile = \"$($script:dscResourceName)_CreateVMKernelDumpFile_Config\"\n$script:configRemoveVMKernelDumpFile = \"$($script:dscResourceName)_RemoveVMKernelDumpFile_Config\"\n$script:configRemoveVmfsDatastore = \"$($script:dscResourceName)_RemoveVmfsDatastore_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configCreateVmfsDatastore\\\"\n$script:mofFileCreateVMKernelDumpFilePath = \"$script:integrationTestsFolderPath\\$script:configCreateVMKernelDumpFile\\\"\n$script:mofFileRemoveVMKernelDumpFilePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMKernelDumpFile\\\"\n$script:mofFileRemoveVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVmfsDatastore\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateVMKernelDumpFile\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastore `\n                -OutputPath $script:mofFileCreateVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMKernelDumpFile `\n                -OutputPath $script:mofFileCreateVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastore = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMKernelDumpFile = @{\n                Path = $script:mofFileCreateVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastore\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMKernelDumpFile\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMKernelDumpFile }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.DatastoreName | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.FileName | Should -Be $script:configurationData.AllNodes.DumpFileName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Size | Should -Be $script:configurationData.AllNodes.DumpFileSize\n            $configuration.Force | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMKernelDumpFilePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMKernelDumpFile `\n                -OutputPath $script:mofFileRemoveVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMKernelDumpFile = @{\n                Path = $script:mofFileRemoveVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVmfsDatastore = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMKernelDumpFile\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVmfsDatastore\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVMKernelDumpFile\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastore `\n                -OutputPath $script:mofFileCreateVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMKernelDumpFile `\n                -OutputPath $script:mofFileCreateVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMKernelDumpFile `\n                -OutputPath $script:mofFileRemoveVMKernelDumpFilePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastore = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMKernelDumpFile = @{\n                Path = $script:mofFileCreateVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMKernelDumpFile = @{\n                Path = $script:mofFileRemoveVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastore\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMKernelDumpFile\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMKernelDumpFile\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMKernelDumpFilePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVMKernelDumpFile }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.DatastoreName | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.FileName | Should -Be $script:configurationData.AllNodes.DumpFileName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.Size | Should -BeNullOrEmpty\n            $configuration.Force | Should -Be $script:configurationData.AllNodes.Force\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVMKernelDumpFilePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMKernelDumpFilePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelModule/VMHostVMKernelModule.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the state of one of the VMKernel modules on the VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostVMKernelModuleState {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $vmHostVMKernelModuleState = @{}\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n\n    $vmHostVMKernelModule = $esxCli.system.module.list.Invoke() | Select-Object -First 1\n\n    $vmHostVMKernelModuleState.Module = $vmHostVMKernelModule.Name\n    $vmHostVMKernelModuleState.Enabled = [System.Convert]::ToBoolean($vmHostVMKernelModule.IsEnabled)\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostVMKernelModuleState\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelModule/VMHostVMKernelModule.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostVMKernelModule.Integration.Tests.Helpers.ps1\"\n$script:initialVMHostVMKernelModuleState = Get-InitialVMHostVMKernelModuleState\n\n$script:dscResourceName = 'VMHostVMKernelModule'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostVMKernelModuleResourceName = 'VMHostVMKernelModule'\n            VMKernelModuleName = $script:initialVMHostVMKernelModuleState.Module\n            InitialVMKernelModuleState = $script:initialVMHostVMKernelModuleState.Enabled\n            EnableVMKernelModule = $true\n            DisableVMKernelModule = $false\n            Force = $true\n        }\n    )\n}\n\n$script:configEnableVMKernelModule = \"$($script:dscResourceName)_EnableVMKernelModule_Config\"\n$script:configDisableVMKernelModule = \"$($script:dscResourceName)_DisableVMKernelModule_Config\"\n$script:configModifyVMKernelModuleToInitialState = \"$($script:dscResourceName)_ModifyVMKernelModuleToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileEnableVMKernelModulePath = \"$script:integrationTestsFolderPath\\$script:configEnableVMKernelModule\\\"\n$script:mofFileDisableVMKernelModulePath = \"$script:integrationTestsFolderPath\\$script:configDisableVMKernelModule\\\"\n$script:mofFileModifyVMKernelModuleToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMKernelModuleToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configEnableVMKernelModule\" {\n        BeforeAll {\n            # Arrange\n            & $script:configDisableVMKernelModule `\n                -OutputPath $script:mofFileDisableVMKernelModulePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configEnableVMKernelModule `\n                -OutputPath $script:mofFileEnableVMKernelModulePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersDisableVMKernelModule = @{\n                Path = $script:mofFileDisableVMKernelModulePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersEnableVMKernelModule = @{\n                Path = $script:mofFileEnableVMKernelModulePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersDisableVMKernelModule\n            Start-DscConfiguration @startDscConfigurationParametersEnableVMKernelModule\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileEnableVMKernelModulePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configEnableVMKernelModule }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Module | Should -Be $script:configurationData.AllNodes.VMKernelModuleName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.EnableVMKernelModule\n            $configuration.Force | Should -Be $script:configurationData.AllNodes.Force\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileEnableVMKernelModulePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMKernelModuleToInitialState `\n                -OutputPath $script:mofFileModifyVMKernelModuleToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMKernelModuleToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileEnableVMKernelModulePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileDisableVMKernelModulePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMKernelModuleToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configDisableVMKernelModule\" {\n        BeforeAll {\n            # Arrange\n            & $script:configEnableVMKernelModule `\n                -OutputPath $script:mofFileEnableVMKernelModulePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configDisableVMKernelModule `\n                -OutputPath $script:mofFileDisableVMKernelModulePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersEnableVMKernelModule = @{\n                Path = $script:mofFileEnableVMKernelModulePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersDisableVMKernelModule = @{\n                Path = $script:mofFileDisableVMKernelModulePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersEnableVMKernelModule\n            Start-DscConfiguration @startDscConfigurationParametersDisableVMKernelModule\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileDisableVMKernelModulePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configDisableVMKernelModule }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Module | Should -Be $script:configurationData.AllNodes.VMKernelModuleName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.DisableVMKernelModule\n            $configuration.Force | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileDisableVMKernelModulePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMKernelModuleToInitialState `\n                -OutputPath $script:mofFileModifyVMKernelModuleToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMKernelModuleToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileEnableVMKernelModulePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileDisableVMKernelModulePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMKernelModuleToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the name of a VMKernel Network Adapter on the specified VMHost before the execution of the Integration Tests.\n#>\nfunction Get-VMKernelNetworkAdapterName {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $vmHostVMKernelNetworkAdapter = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VMKernel -ErrorAction Stop -Verbose:$false | Select-Object -First 1\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostVMKernelNetworkAdapter.Name\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostvSANNetworkConfiguration.Integration.Tests.Helpers.ps1\"\n$script:vmHostVMKernelNetworkAdapterName = Get-VMKernelNetworkAdapterName\n\n$script:dscResourceName = 'VMHostvSANNetworkConfiguration'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostvSANNetworkConfigurationResourceName = 'VMHostvSANNetworkConfiguration'\n            InterfaceName = $script:vmHostVMKernelNetworkAdapterName\n            AgentGroupIPv6MulticastAddress = 'ff19::2:3:4'\n            AgentGroupMulticastAddress = '224.2.3.4'\n            AgentGroupMulticastPort = 23451\n            HostUnicastChannelBoundPort = 12321\n            MasterGroupIPv6MulticastAddress = 'ff19::1:2:3'\n            MasterGroupMulticastAddress = '224.1.2.3'\n            MasterGroupMulticastPort = 12345\n            MulticastTTL = 5\n            TrafficType = 'vsan'\n            Force = $true\n        }\n    )\n}\n\n$script:configAddVMHostvSANNetworkConfigurationIPInterface = \"$($script:dscResourceName)_AddVMHostvSANNetworkConfigurationIPInterface_Config\"\n$script:configRemoveVMHostvSANNetworkConfigurationIPInterface = \"$($script:dscResourceName)_RemoveVMHostvSANNetworkConfigurationIPInterface_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath = \"$script:integrationTestsFolderPath\\$script:configAddVMHostvSANNetworkConfigurationIPInterface\\\"\n$script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostvSANNetworkConfigurationIPInterface\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configAddVMHostvSANNetworkConfigurationIPInterface\" {\n        BeforeAll {\n            # Arrange\n            & $script:configAddVMHostvSANNetworkConfigurationIPInterface `\n                -OutputPath $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configAddVMHostvSANNetworkConfigurationIPInterface }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.InterfaceName | Should -Be $script:configurationData.AllNodes.InterfaceName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.AgentV6McAddr | Should -Be $script:configurationData.AllNodes.AgentGroupIPv6MulticastAddress\n            $configuration.AgentMcAddr | Should -Be $script:configurationData.AllNodes.AgentGroupMulticastAddress\n            $configuration.AgentMcPort | Should -Be $script:configurationData.AllNodes.AgentGroupMulticastPort\n            $configuration.HostUcPort | Should -Be $script:configurationData.AllNodes.HostUnicastChannelBoundPort\n            $configuration.MasterV6McAddr | Should -Be $script:configurationData.AllNodes.MasterGroupIPv6MulticastAddress\n            $configuration.MasterMcAddr | Should -Be $script:configurationData.AllNodes.MasterGroupMulticastAddress\n            $configuration.MasterMcPort | Should -Be $script:configurationData.AllNodes.MasterGroupMulticastPort\n            $configuration.MulticastTtl | Should -Be $script:configurationData.AllNodes.MulticastTTL\n            $configuration.TrafficType | Should -Be $script:configurationData.AllNodes.TrafficType\n            $configuration.Force | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostvSANNetworkConfigurationIPInterface `\n                -OutputPath $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVMHostvSANNetworkConfigurationIPInterface\" {\n        BeforeAll {\n            # Arrange\n            & $script:configAddVMHostvSANNetworkConfigurationIPInterface `\n                -OutputPath $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostvSANNetworkConfigurationIPInterface `\n                -OutputPath $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersAddVMHostvSANNetworkConfigurationIPInterface = @{\n                Path = $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostvSANNetworkConfigurationIPInterface = @{\n                Path = $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersAddVMHostvSANNetworkConfigurationIPInterface\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostvSANNetworkConfigurationIPInterface\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVMHostvSANNetworkConfigurationIPInterface }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.InterfaceName | Should -Be $script:configurationData.AllNodes.InterfaceName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.AgentV6McAddr | Should -Be $script:configurationData.AllNodes.AgentGroupIPv6MulticastAddress\n            $configuration.AgentMcAddr | Should -Be $script:configurationData.AllNodes.AgentGroupMulticastAddress\n            $configuration.AgentMcPort | Should -Be $script:configurationData.AllNodes.AgentGroupMulticastPort\n            $configuration.HostUcPort | Should -Be $script:configurationData.AllNodes.HostUnicastChannelBoundPort\n            $configuration.MasterV6McAddr | Should -Be $script:configurationData.AllNodes.MasterGroupIPv6MulticastAddress\n            $configuration.MasterMcAddr | Should -Be $script:configurationData.AllNodes.MasterGroupMulticastAddress\n            $configuration.MasterMcPort | Should -Be $script:configurationData.AllNodes.MasterGroupMulticastPort\n            $configuration.MulticastTtl | Should -Be $script:configurationData.AllNodes.MulticastTTL\n            $configuration.TrafficType | Should -Be $script:configurationData.AllNodes.TrafficType\n            $configuration.Force | Should -Be $script:configurationData.AllNodes.Force\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Remove-Item -Path $script:mofFileAddVMHostvSANNetworkConfigurationIPInterfacePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostvSANNetworkConfigurationIPInterfacePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/Folder.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'Folder'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenAddingFolderWithEmptyLocation = \"$($script:dscResourceName)_WhenAddingFolderWithEmptyLocation_Config\"\n$script:configWhenAddingFolderWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenAddingFolderWithLocationWithOneFolder_Config\"\n$script:configWhenAddingFolderWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenAddingFolderWithLocationWithTwoFolders_Config\"\n$script:configWhenRemovingFolderWithEmptyLocation = \"$($script:dscResourceName)_WhenRemovingFolderWithEmptyLocation_Config\"\n$script:configWhenRemovingFolderWithLocationWithOneFolder = \"$($script:dscResourceName)_WhenRemovingFolderWithLocationWithOneFolder_Config\"\n$script:configWhenRemovingFolderWithLocationWithTwoFolders = \"$($script:dscResourceName)_WhenRemovingFolderWithLocationWithTwoFolders_Config\"\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenAddingFolderWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingFolderWithEmptyLocation)\\\"\n$script:mofFileWhenAddingFolderWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingFolderWithLocationWithOneFolder)\\\"\n$script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingFolderWithLocationWithTwoFolders)\\\"\n$script:mofFileWhenRemovingFolderWithEmptyLocationPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingFolderWithEmptyLocation)\\\"\n$script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingFolderWithLocationWithOneFolder)\\\"\n$script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingFolderWithLocationWithTwoFolders)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenAddingFolderWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithEmptyLocationResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterWithEmptyLocationResource.Name | Should -Be $script:datacenterName\n            $datacenterWithEmptyLocationResource.Location | Should -Be $script:datacenterEmptyLocation\n            $datacenterWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterEmptyLocation\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithEmptyLocationResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingFolderWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingFolderWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n            $datacenterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n            $folderWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterFolderLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n\n            $datacenterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $datacenterWithLocationWithTwoFoldersResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithTwoFoldersResource.Location | Should -Be $script:datacenterLocationWithTwoFolders\n            $datacenterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Present'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithTwoFolders\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Present'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithTwoFolders\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Present'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $folderWithLocationWithTwoFoldersResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithTwoFoldersResource.Location | Should -Be $script:folderWithLocationWithTwoFolders\n            $folderWithLocationWithTwoFoldersResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithTwoFoldersResource.DatacenterLocation | Should -Be $script:datacenterLocationWithTwoFolders\n            $folderWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Present'\n            $folderWithLocationWithTwoFoldersResource.FolderType | Should -Be $script:folderType\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterFolderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterFolderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $folderWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingFolderWithEmptyLocation)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingFolder = @{\n                Path = $script:mofFileWhenAddingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingFolder = @{\n                Path = $script:mofFileWhenRemovingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingFolder\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingFolder\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithEmptyLocationPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithEmptyLocationResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterWithEmptyLocationResource.Name | Should -Be $script:datacenterName\n            $datacenterWithEmptyLocationResource.Location | Should -Be $script:datacenterEmptyLocation\n            $datacenterWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterEmptyLocation\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithEmptyLocationResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterWithEmptyLocationResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingFolderWithLocationWithOneFolder)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingFolder = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingFolder = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingFolder\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingFolder\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithOneFolderPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterLocationWithOneFolder\n            $datacenterWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterWithLocationWithOneFolderResourceId\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingFolderWithLocationWithTwoFolders)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParametersWhenAddingFolder = @{\n                Path = $script:mofFileWhenAddingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            $startDscConfigurationParametersWhenRemovingFolder = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingFolder\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingFolder\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingFolderWithLocationWithTwoFoldersPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            $datacenterFolderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n            $datacenterFolderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n            $datacenterWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n            $folderWithEmptyLocationResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n            $folderWithLocationWithOneFolderResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n            $folderWithLocationWithTwoFoldersResource = $configuration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.Server | Should -Be $Server\n            $datacenterFolderWithEmptyLocationResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithEmptyLocationResource.Location | Should -Be $script:datacenterFolderEmptyLocation\n            $datacenterFolderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n\n            $datacenterFolderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $datacenterFolderWithLocationWithOneFolderResource.Name | Should -Be $script:datacenterFolderName\n            $datacenterFolderWithLocationWithOneFolderResource.Location | Should -Be $script:datacenterFolderLocationWithOneFolder\n            $datacenterFolderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n\n            $datacenterWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $datacenterWithLocationWithTwoFoldersResource.Name | Should -Be $script:datacenterName\n            $datacenterWithLocationWithTwoFoldersResource.Location | Should -Be $script:datacenterLocationWithTwoFolders\n            $datacenterWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Absent'\n\n            $folderWithEmptyLocationResource.Server | Should -Be $Server\n            $folderWithEmptyLocationResource.Name | Should -Be $script:folderName\n            $folderWithEmptyLocationResource.Location | Should -Be $script:folderWithEmptyLocation\n            $folderWithEmptyLocationResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithEmptyLocationResource.DatacenterLocation | Should -Be $script:datacenterLocationWithTwoFolders\n            $folderWithEmptyLocationResource.Ensure | Should -Be 'Absent'\n            $folderWithEmptyLocationResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithOneFolderResource.Server | Should -Be $Server\n            $folderWithLocationWithOneFolderResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithOneFolderResource.Location | Should -Be $script:folderWithLocationWithOneFolder\n            $folderWithLocationWithOneFolderResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithOneFolderResource.DatacenterLocation | Should -Be $script:datacenterLocationWithTwoFolders\n            $folderWithLocationWithOneFolderResource.Ensure | Should -Be 'Absent'\n            $folderWithLocationWithOneFolderResource.FolderType | Should -Be $script:folderType\n\n            $folderWithLocationWithTwoFoldersResource.Server | Should -Be $Server\n            $folderWithLocationWithTwoFoldersResource.Name | Should -Be $script:folderName\n            $folderWithLocationWithTwoFoldersResource.Location | Should -Be $script:folderWithLocationWithTwoFolders\n            $folderWithLocationWithTwoFoldersResource.DatacenterName | Should -Be $script:datacenterName\n            $folderWithLocationWithTwoFoldersResource.DatacenterLocation | Should -Be $script:datacenterLocationWithTwoFolders\n            $folderWithLocationWithTwoFoldersResource.Ensure | Should -Be 'Absent'\n            $folderWithLocationWithTwoFoldersResource.FolderType | Should -Be $script:folderType\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithLocationWithOneFolderResourceName) should depend on Resource $($script:folderWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $folderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $folderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:folderWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:folderWithEmptyLocationResourceName) should depend on Resource $($script:folderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $folderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:folderWithEmptyLocationResourceId }\n\n            # Assert\n            $folderWithEmptyLocationResource.DependsOn | Should -Be $script:folderWithLocationWithOneFolderResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterWithLocationWithTwoFoldersResourceName) should depend on Resource $($script:folderWithEmptyLocationResourceName)\" {\n            # Arrange && Act\n            $datacenterWithLocationWithTwoFoldersResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterWithLocationWithTwoFoldersResourceId }\n\n            # Assert\n            $datacenterWithLocationWithTwoFoldersResource.DependsOn | Should -Be $script:folderWithEmptyLocationResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName) should depend on Resource $($script:datacenterWithLocationWithTwoFoldersResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithLocationWithOneFolderResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithLocationWithOneFolderResourceId }\n\n            # Assert\n            $datacenterFolderWithLocationWithOneFolderResource.DependsOn | Should -Be $script:datacenterWithLocationWithTwoFoldersResourceId\n        }\n\n        It \"Should have the following dependency: Resource $($script:datacenterFolderWithEmptyLocationResourceName) should depend on Resource $($script:datacenterFolderWithLocationWithOneFolderResourceName)\" {\n            # Arrange && Act\n            $datacenterFolderWithEmptyLocationResource = Get-DscConfiguration | Where-Object { $_.ResourceId -eq $script:datacenterFolderWithEmptyLocationResourceId }\n\n            # Assert\n            $datacenterFolderWithEmptyLocationResource.DependsOn | Should -Be $script:datacenterFolderWithLocationWithOneFolderResourceId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/NfsUser.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainUsername,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainPassword\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$DomainCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $DomainUsername, (ConvertTo-SecureString -String $DomainPassword -AsPlainText -Force)\n\n$script:dscResourceName = 'NfsUser'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            DomainName = $DomainName\n            DomainCredential = $DomainCredential\n            VMHostAuthenticationResourceName = 'VMHostAuthentication'\n            NfsUserResourceName = 'NfsUser'\n            DomainActionJoin = 'Join'\n            DomainActionLeave = 'Leave'\n            NfsUsername = 'MyTestNfsUsername'\n            NfsUserPasswordOne = 'MyTestNfsUserPasswordOne'\n            NfsUserPasswordTwo = 'MyTestNfsUserPasswordTwo'\n            Force = $true\n        }\n    )\n}\n\n$script:configJoinDomain = \"$($script:dscResourceName)_JoinDomain_Config\"\n$script:configCreateNfsUser = \"$($script:dscResourceName)_CreateNfsUser_Config\"\n$script:configChangeNfsUserPassword = \"$($script:dscResourceName)_ChangeNfsUserPassword_Config\"\n$script:configRemoveNfsUser = \"$($script:dscResourceName)_RemoveNfsUser_Config\"\n$script:configLeaveDomain = \"$($script:dscResourceName)_LeaveDomain_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileJoinDomainPath = \"$script:integrationTestsFolderPath\\$script:configJoinDomain\\\"\n$script:mofFileCreateNfsUserPath = \"$script:integrationTestsFolderPath\\$script:configCreateNfsUser\\\"\n$script:mofFileChangeNfsUserPasswordPath = \"$script:integrationTestsFolderPath\\$script:configChangeNfsUserPassword\\\"\n$script:mofFileRemoveNfsUserPath = \"$script:integrationTestsFolderPath\\$script:configRemoveNfsUser\\\"\n$script:mofFileLeaveDomainPath = \"$script:integrationTestsFolderPath\\$script:configLeaveDomain\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateNfsUser\" {\n        BeforeAll {\n            # Arrange\n            & $script:configJoinDomain `\n                -OutputPath $script:mofFileJoinDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateNfsUser `\n                -OutputPath $script:mofFileCreateNfsUserPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersJoinDomain = @{\n                Path = $script:mofFileJoinDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateNfsUser = @{\n                Path = $script:mofFileCreateNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersJoinDomain\n            Start-DscConfiguration @startDscConfigurationParametersCreateNfsUser\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateNfsUser }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.NfsUsername\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Force | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateNfsUserPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveNfsUser `\n                -OutputPath $script:mofFileRemoveNfsUserPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configLeaveDomain `\n                -OutputPath $script:mofFileLeaveDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveNfsUser = @{\n                Path = $script:mofFileRemoveNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersLeaveDomain = @{\n                Path = $script:mofFileLeaveDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveNfsUser\n            Start-DscConfiguration @startDscConfigurationParametersLeaveDomain\n\n            Remove-Item -Path $script:mofFileJoinDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateNfsUserPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsUserPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileLeaveDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configChangeNfsUserPassword\" {\n        BeforeAll {\n            # Arrange\n            & $script:configJoinDomain `\n                -OutputPath $script:mofFileJoinDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateNfsUser `\n                -OutputPath $script:mofFileCreateNfsUserPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configChangeNfsUserPassword `\n                -OutputPath $script:mofFileChangeNfsUserPasswordPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersJoinDomain = @{\n                Path = $script:mofFileJoinDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateNfsUser = @{\n                Path = $script:mofFileCreateNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersChangeNfsUserPassword = @{\n                Path = $script:mofFileChangeNfsUserPasswordPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersJoinDomain\n            Start-DscConfiguration @startDscConfigurationParametersCreateNfsUser\n            Start-DscConfiguration @startDscConfigurationParametersChangeNfsUserPassword\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileChangeNfsUserPasswordPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configChangeNfsUserPassword }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.NfsUsername\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Force | Should -Be $script:configurationData.AllNodes.Force\n        }\n\n        It 'Should return $false when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileChangeNfsUserPasswordPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $false\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveNfsUser `\n                -OutputPath $script:mofFileRemoveNfsUserPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configLeaveDomain `\n                -OutputPath $script:mofFileLeaveDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveNfsUser = @{\n                Path = $script:mofFileRemoveNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersLeaveDomain = @{\n                Path = $script:mofFileLeaveDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveNfsUser\n            Start-DscConfiguration @startDscConfigurationParametersLeaveDomain\n\n            Remove-Item -Path $script:mofFileJoinDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateNfsUserPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileChangeNfsUserPasswordPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsUserPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileLeaveDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveNfsUser\" {\n        BeforeAll {\n            # Arrange\n            & $script:configJoinDomain `\n                -OutputPath $script:mofFileJoinDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateNfsUser `\n                -OutputPath $script:mofFileCreateNfsUserPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveNfsUser `\n                -OutputPath $script:mofFileRemoveNfsUserPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersJoinDomain = @{\n                Path = $script:mofFileJoinDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateNfsUser = @{\n                Path = $script:mofFileCreateNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveNfsUser = @{\n                Path = $script:mofFileRemoveNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersJoinDomain\n            Start-DscConfiguration @startDscConfigurationParametersCreateNfsUser\n            Start-DscConfiguration @startDscConfigurationParametersRemoveNfsUser\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveNfsUserPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveNfsUser }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.NfsUsername\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.Force | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveNfsUserPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configLeaveDomain `\n                -OutputPath $script:mofFileLeaveDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileLeaveDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileJoinDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateNfsUserPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveNfsUserPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileLeaveDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/PowerCLISettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:dscResourceName = 'PowerCLISettings'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:config = \"$($script:dscResourceName)_Config\"\n. $script:configurationFile\n$script:mofFilePath = \"$script:integrationTestsFolderPath\\$($script:config)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:config)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.SettingsScope | Should -Be 'LCM'\n                $configuration.ParticipateInCeip | Should -Be $false\n                $configuration.InvalidCertificateAction | Should -Be 'Warn'\n                $configuration.DefaultVIServerMode | Should -Be 'Multiple'\n                $configuration.DisplayDeprecationWarnings | Should -Be $false\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/TestHelpers/IntegrationTests.Constants.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n# Datacenter Folder Constants\n$script:datacenterFolderName = 'MyTestDatacenterFolder'\n\n$script:datacenterFolderEmptyLocation = [string]::Empty\n$script:datacenterFolderLocationWithOneFolder = $script:datacenterFolderName\n$script:datacenterFolderLocationWithTwoFolders = \"$script:datacenterFolderName/$script:datacenterFolderName\"\n\n$script:datacenterFolderWithEmptyLocationResourceName = 'DatacenterFolder_With_EmptyLocation'\n$script:datacenterFolderWithLocationWithOneFolderResourceName = 'DatacenterFolder_With_LocationWithOneFolder'\n$script:datacenterFolderWithLocationWithTwoFoldersResourceName = 'DatacenterFolder_With_LocationWithTwoFolders'\n\n$script:datacenterFolderWithEmptyLocationResourceId = \"[DatacenterFolder]$script:datacenterFolderWithEmptyLocationResourceName\"\n$script:datacenterFolderWithLocationWithOneFolderResourceId = \"[DatacenterFolder]$script:datacenterFolderWithLocationWithOneFolderResourceName\"\n$script:datacenterFolderWithLocationWithTwoFoldersResourceId = \"[DatacenterFolder]$script:datacenterFolderWithLocationWithTwoFoldersResourceName\"\n\n# Datacenter Constants\n$script:datacenterName = 'MyTestDatacenter'\n\n$script:datacenterEmptyLocation = [string]::Empty\n$script:datacenterLocationWithOneFolder = $script:datacenterFolderName\n$script:datacenterLocationWithTwoFolders = \"$script:datacenterFolderName/$script:datacenterFolderName\"\n\n$script:datacenterWithEmptyLocationResourceName = 'Datacenter_With_EmptyLocation'\n$script:datacenterWithLocationWithOneFolderResourceName = 'Datacenter_With_LocationWithOneFolder'\n$script:datacenterWithLocationWithTwoFoldersResourceName = 'Datacenter_With_LocationWithTwoFolders'\n\n$script:datacenterWithEmptyLocationResourceId = \"[Datacenter]$script:datacenterWithEmptyLocationResourceName\"\n$script:datacenterWithLocationWithOneFolderResourceId = \"[Datacenter]$script:datacenterWithLocationWithOneFolderResourceName\"\n$script:datacenterWithLocationWithTwoFoldersResourceId = \"[Datacenter]$script:datacenterWithLocationWithTwoFoldersResourceName\"\n\n# Folder Constants\n$script:folderName = 'MyTestFolder'\n\n$script:folderWithEmptyLocation = [string]::Empty\n$script:folderWithLocationWithOneFolder = $script:folderName\n$script:folderWithLocationWithTwoFolders = \"$script:folderName/$script:folderName\"\n\n$script:folderType = 'Host'\n\n$script:folderWithEmptyLocationResourceName = 'Folder_With_EmptyLocation'\n$script:folderWithLocationWithOneFolderResourceName = 'Folder_With_LocationWithOneFolder'\n$script:folderWithLocationWithTwoFoldersResourceName = 'Folder_With_LocationWithTwoFolders'\n\n$script:folderWithEmptyLocationResourceId = \"[Folder]$script:folderWithEmptyLocationResourceName\"\n$script:folderWithLocationWithOneFolderResourceId = \"[Folder]$script:folderWithLocationWithOneFolderResourceName\"\n$script:folderWithLocationWithTwoFoldersResourceId = \"[Folder]$script:folderWithLocationWithTwoFoldersResourceName\"\n\n# Cluster Constants\n$script:clusterName = 'MyTestCluster'\n\n$script:clusterWithEmptyLocation = [string]::Empty\n$script:clusterWithLocationWithOneFolder = $script:folderName\n$script:clusterWithLocationWithTwoFolders = \"$script:folderName/$script:folderName\"\n\n$script:haClusterWithEmptyLocationResourceName = 'HACluster_With_EmptyLocation'\n$script:haClusterWithLocationWithOneFolderResourceName = 'HACluster_With_LocationWithOneFolder'\n$script:haClusterWithLocationWithTwoFoldersResourceName = 'HACluster_With_LocationWithTwoFolders'\n\n$script:haClusterWithEmptyLocationResourceId = \"[HACluster]$script:haClusterWithEmptyLocationResourceName\"\n$script:haClusterWithLocationWithOneFolderResourceId = \"[HACluster]$script:haClusterWithLocationWithOneFolderResourceName\"\n$script:haClusterWithLocationWithTwoFoldersResourceId = \"[HACluster]$script:haClusterWithLocationWithTwoFoldersResourceName\"\n\n$script:drsClusterWithEmptyLocationResourceName = 'DrsCluster_With_EmptyLocation'\n$script:drsClusterWithLocationWithOneFolderResourceName = 'DrsCluster_With_LocationWithOneFolder'\n$script:drsClusterWithLocationWithTwoFoldersResourceName = 'DrsCluster_With_LocationWithTwoFolders'\n\n$script:drsClusterWithEmptyLocationResourceId = \"[DrsCluster]$script:drsClusterWithEmptyLocationResourceName\"\n$script:drsClusterWithLocationWithOneFolderResourceId = \"[DrsCluster]$script:drsClusterWithLocationWithOneFolderResourceName\"\n$script:drsClusterWithLocationWithTwoFoldersResourceId = \"[DrsCluster]$script:drsClusterWithLocationWithTwoFoldersResourceName\"\n\n# Syslog Constants\n$script:checkSslCerts = $true\n$script:defaultRotate = 10\n$script:defaultSize = 100\n$script:defaultTimeout = 180\n$script:logdirOne = '/scratch/log'\n$script:logdirTwo = '/scratch/log2'\n$script:logdirUnique = $false\n$script:dropLogRotate = 10\n$script:dropLogSize = 100\n$script:queueDropMark = 90\n\n# VMHost Advanced Settings Constants\n$script:advancedSettingsWithDefaultValues = @{\n    'Annotations.WelcomeMessage' = [string]::Empty\n    'BufferCache.FlushInterval' = [long] 30000\n    'BufferCache.HardMaxDirty' = [long] 95\n    'CBRC.Enable' = $false\n    'Cpu.UseMwait' = [long] 2\n    'Config.Etc.issue' = [string]::Empty\n    'Config.HostAgent.plugins.solo.enableMob' = $false\n    'DataMover.MaxHeapSize' = [long] 64\n    'HBR.HbrBitmapVMMaxStorageGB' = [long] 65536\n    'HBR.HbrMinExtentSizeKB' = [long] 8\n    'Misc.WorldletLoadType' = 'medium'\n    'VMkernel.Boot.useReliableMem' = $true\n    'Vpx.Vpxa.config.workingDir' = '/var/log/vmware'\n    'UserVars.ProductLockerLocation' = '/locker/packages/vmtoolsRepo/'\n}\n\n$script:advancedSettingsWithCustomValues = @{\n    'Annotations.WelcomeMessage' = 'Hello from DSC'\n    'BufferCache.FlushInterval' = [long] 20000\n    'BufferCache.HardMaxDirty' = [long] 50\n    'CBRC.Enable' = $true\n    'Cpu.UseMwait' = [long] 1\n    'Config.Etc.issue' = 'Contents of /etc/issue'\n    'Config.HostAgent.plugins.solo.enableMob' = $true\n    'DataMover.MaxHeapSize' = [long] 32\n    'HBR.HbrBitmapVMMaxStorageGB' = [long] 65500\n    'HBR.HbrMinExtentSizeKB' = [long] 4\n    'Misc.WorldletLoadType' = 'low'\n    'VMkernel.Boot.useReliableMem' = $false\n    'Vpx.Vpxa.config.workingDir' = '/var/log/vmware/temp'\n    'UserVars.ProductLockerLocation' = '/locker/packages/vmtoolsRepo/temp/'\n}\n\n# VMHost Graphics Configuration Constants\n$script:sharedGraphicsType = 'Shared'\n$script:performanceSharedPassthruAssignmentPolicy = 'Performance'\n\n# VMHost Power Policy Constants\n$script:balancedPowerPolicy = 'Balanced'\n$script:highPerformancePowerPolicy = 'HighPerformance'\n$script:lowPowerPowerPolicy = 'LowPower'\n$script:customPowerPolicy = 'Custom'\n\n# VMHost Cache Constants\n$script:zeroGigabytesSwapSize = 0\n$script:oneGigabyteSwapSize = 1\n$script:twoGigabytesSwapSize = 2\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VDPortGroup.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name\n)\n\n# Mandatory Integration Tests parameter is not used so it is set to $null.\n$Name = $null\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VDPortGroup'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            DatacenterResourceName = 'Datacenter'\n            DatacenterResourceId = '[Datacenter]Datacenter'\n            VDSwitchResourceName = 'VDSwitch'\n            VDSwitchResourceId = '[VDSwitch]VDSwitch'\n            VDPortGroupResourceName = 'VDPortGroup'\n            VDPortGroupResourceId = '[VDPortGroup]VDPortGroup'\n            ReferenceVDPortGroupResourceName = 'VDPortGroupViaReferenceVDPortGroup'\n            ReferenceVDPortGroupResourceId = '[VDPortGroup]VDPortGroupViaReferenceVDPortGroup'\n            DatacenterName = 'MyTestDatacenter'\n            DatacenterLocation = [string]::Empty\n            VDSwitchName = 'MyTestVDSwitch'\n            VDSwitchLocation = [string]::Empty\n            VDPortGroupName = 'MyTestVDPortGroup'\n            ReferenceVDPortGroupName = 'MyTestVDPortGroupViaReferenceVDPortGroup'\n            VDPortGroupNotes = 'MyTestVDPortGroup Notes'\n            VDPortGroupDefaultNotes = [string]::Empty\n            VDPortGroupNumPorts = 256\n            VDPortGroupDefaultNumPorts = 128\n            VDPortGroupPortBinding = 'Static'\n            VLanId = 1\n            ModifiedVLanId = 10\n            VLanNone = 0\n        }\n    )\n}\n\n$script:configCreateDatacenterAndVDSwitch = \"$($script:dscResourceName)_CreateDatacenterAndVDSwitch_Config\"\n$script:configCreateVDPortGroup = \"$($script:dscResourceName)_CreateVDPortGroup_Config\"\n$script:configCreateVDPortGroupViaReferenceVDPortGroup = \"$($script:dscResourceName)_CreateVDPortGroupViaReferenceVDPortGroup_Config\"\n$script:configModifyVDPortGroupNotesAndNumPorts = \"$($script:dscResourceName)_ModifyVDPortGroupNotesAndNumPorts_Config\"\n$script:configModifyVDPortGroupVLanId = \"$($script:dscResourceName)_ModifyVDPortGroupVLanId_Config\"\n$script:configSetVDPortGroupVLanToNone = \"$($script:dscResourceName)_SetVDPortGroupVLanToNone_Config\"\n$script:configRemoveVDPortGroup = \"$($script:dscResourceName)_RemoveVDPortGroup_Config\"\n$script:configRemoveDatacenterVDSwitchAndVDPortGroup = \"$($script:dscResourceName)_RemoveDatacenterVDSwitchAndVDPortGroup_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateDatacenterAndVDSwitchPath = \"$script:integrationTestsFolderPath\\$script:configCreateDatacenterAndVDSwitch\\\"\n$script:mofFileCreateVDPortGroupPath = \"$script:integrationTestsFolderPath\\$script:configCreateVDPortGroup\\\"\n$script:mofFileCreateVDPortGroupViaReferenceVDPortGroupPath = \"$script:integrationTestsFolderPath\\$script:configCreateVDPortGroupViaReferenceVDPortGroup\\\"\n$script:mofFileModifyVDPortGroupNotesAndNumPortsPath = \"$script:integrationTestsFolderPath\\$script:configModifyVDPortGroupNotesAndNumPorts\\\"\n$script:mofFileModifyVDPortGroupVLanIdPath = \"$script:integrationTestsFolderPath\\$script:configModifyVDPortGroupVLanId\\\"\n$script:mofFileSetVDPortGroupVLanToNonePath = \"$script:integrationTestsFolderPath\\$script:configSetVDPortGroupVLanToNone\\\"\n$script:mofFileRemoveVDPortGroupPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVDPortGroup\\\"\n$script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath = \"$script:integrationTestsFolderPath\\$script:configRemoveDatacenterVDSwitchAndVDPortGroup\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateVDPortGroup\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenterAndVDSwitch `\n                -OutputPath $script:mofFileCreateDatacenterAndVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenterAndVDSwitch = @{\n                Path = $script:mofFileCreateDatacenterAndVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenterAndVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVDPortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VDPortGroupName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.VDPortGroupNotes\n            $configuration.NumPorts | Should -Be $script:configurationData.AllNodes.VDPortGroupNumPorts\n            $configuration.PortBinding | Should -Be $script:configurationData.AllNodes.VDPortGroupPortBinding\n            $configuration.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.VLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVDPortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenterVDSwitchAndVDPortGroup `\n                -OutputPath $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterAndVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVDPortGroupViaReferenceVDPortGroup\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenterAndVDSwitch `\n                -OutputPath $script:mofFileCreateDatacenterAndVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroupViaReferenceVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupViaReferenceVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenterAndVDSwitch = @{\n                Path = $script:mofFileCreateDatacenterAndVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroupViaReferenceVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupViaReferenceVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenterAndVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroupViaReferenceVDPortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVDPortGroupViaReferenceVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVDPortGroupViaReferenceVDPortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.ReferenceVDPortGroupName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.VDPortGroupNotes\n            $configuration.NumPorts | Should -Be $script:configurationData.AllNodes.VDPortGroupNumPorts\n            $configuration.PortBinding | Should -Be $script:configurationData.AllNodes.VDPortGroupPortBinding\n            $configuration.ReferenceVDPortGroupName | Should -Be $script:configurationData.AllNodes.VDPortGroupName\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.VLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVDPortGroupViaReferenceVDPortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenterVDSwitchAndVDPortGroup `\n                -OutputPath $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterAndVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupViaReferenceVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyVDPortGroupNotesAndNumPorts\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenterAndVDSwitch `\n                -OutputPath $script:mofFileCreateDatacenterAndVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVDPortGroupNotesAndNumPorts `\n                -OutputPath $script:mofFileModifyVDPortGroupNotesAndNumPortsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenterAndVDSwitch = @{\n                Path = $script:mofFileCreateDatacenterAndVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyVDPortGroupNotesAndNumPorts = @{\n                Path = $script:mofFileModifyVDPortGroupNotesAndNumPortsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenterAndVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersModifyVDPortGroupNotesAndNumPorts\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVDPortGroupNotesAndNumPortsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVDPortGroupNotesAndNumPorts }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VDPortGroupName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.VDPortGroupDefaultNotes\n            $configuration.NumPorts | Should -Be $script:configurationData.AllNodes.VDPortGroupDefaultNumPorts\n            $configuration.PortBinding | Should -Be $script:configurationData.AllNodes.VDPortGroupPortBinding\n            $configuration.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.VLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVDPortGroupNotesAndNumPortsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenterVDSwitchAndVDPortGroup `\n                -OutputPath $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterAndVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVDPortGroupNotesAndNumPortsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyVDPortGroupVLanId\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenterAndVDSwitch `\n                -OutputPath $script:mofFileCreateDatacenterAndVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVDPortGroupVLanId `\n                -OutputPath $script:mofFileModifyVDPortGroupVLanIdPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenterAndVDSwitch = @{\n                Path = $script:mofFileCreateDatacenterAndVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyVDPortGroupVLanId = @{\n                Path = $script:mofFileModifyVDPortGroupVLanIdPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenterAndVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersModifyVDPortGroupVLanId\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVDPortGroupVLanIdPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVDPortGroupVLanId }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VDPortGroupName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.VDPortGroupNotes\n            $configuration.NumPorts | Should -Be $script:configurationData.AllNodes.VDPortGroupNumPorts\n            $configuration.PortBinding | Should -Be $script:configurationData.AllNodes.VDPortGroupPortBinding\n            $configuration.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.ModifiedVLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVDPortGroupVLanIdPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenterVDSwitchAndVDPortGroup `\n                -OutputPath $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterAndVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVDPortGroupVLanIdPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configSetVDPortGroupVLanToNone\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenterAndVDSwitch `\n                -OutputPath $script:mofFileCreateDatacenterAndVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configSetVDPortGroupVLanToNone `\n                -OutputPath $script:mofFileSetVDPortGroupVLanToNonePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenterAndVDSwitch = @{\n                Path = $script:mofFileCreateDatacenterAndVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersSetVDPortGroupVLanToNone = @{\n                Path = $script:mofFileSetVDPortGroupVLanToNonePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenterAndVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersSetVDPortGroupVLanToNone\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileSetVDPortGroupVLanToNonePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configSetVDPortGroupVLanToNone }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VDPortGroupName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.VDPortGroupNotes\n            $configuration.NumPorts | Should -Be $script:configurationData.AllNodes.VDPortGroupNumPorts\n            $configuration.PortBinding | Should -Be $script:configurationData.AllNodes.VDPortGroupPortBinding\n            $configuration.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.VLanNone\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileSetVDPortGroupVLanToNonePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenterVDSwitchAndVDPortGroup `\n                -OutputPath $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterAndVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileSetVDPortGroupVLanToNonePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVDPortGroup\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenterAndVDSwitch `\n                -OutputPath $script:mofFileCreateDatacenterAndVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVDPortGroup `\n                -OutputPath $script:mofFileCreateVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVDPortGroup `\n                -OutputPath $script:mofFileRemoveVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenterAndVDSwitch = @{\n                Path = $script:mofFileCreateDatacenterAndVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVDPortGroup = @{\n                Path = $script:mofFileCreateVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVDPortGroup = @{\n                Path = $script:mofFileRemoveVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenterAndVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDPortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVDPortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VDPortGroupName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.Notes | Should -BeNullOrEmpty\n            $configuration.NumPorts | Should -BeNullOrEmpty\n            $configuration.PortBinding | Should -Be 'Unset'\n            $configuration.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.VLanNone\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVDPortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenterVDSwitchAndVDPortGroup `\n                -OutputPath $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterAndVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterVDSwitchAndVDPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VDSwitch.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name\n)\n\n# Mandatory Integration Tests parameter is not used so it is set to $null.\n$Name = $null\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VDSwitch'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            DatacenterResourceName = 'Datacenter'\n            DatacenterResourceId = '[Datacenter]Datacenter'\n            DistributedSwitchResourceName = 'DistributedSwitch'\n            DistributedSwitchResourceId = '[VDSwitch]DistributedSwitch'\n            ReferenceVDSwitchResourceName = 'DistributedSwitch_Via_ReferenceVDSwitch'\n            ReferenceVDSwitchResourceId = '[VDSwitch]DistributedSwitch_Via_ReferenceVDSwitch'\n            DatacenterName = 'MyTestDatacenter'\n            DatacenterLocation = [string]::Empty\n            DistributedSwitchName = 'MyTestDistributedSwitch'\n            ReferenceVDSwitchName = 'MyTestDistributedSwitchViaReferenceVDSwitch'\n            Location = [string]::Empty\n            ContactDetails = 'MyTestContactDetails'\n            ContactName = 'MyTestContactName'\n            UpdatedContactName = 'Updated MyTestContactName'\n            LinkDiscoveryProtocol = 'CDP'\n            LinkDiscoveryProtocolOperationAdvertise = 'Advertise'\n            LinkDiscoveryProtocolOperationListen = 'Listen'\n            MaxPorts = 100\n            Mtu = 2000\n            UpdatedMtu = 2200\n            Notes = 'MyTestNotesDescription'\n            NumUplinkPorts = 10\n            Version = '6.6.0'\n            WithoutPortGroups = $true\n        }\n    )\n}\n\n$script:configWhenAddingDistributedSwitch = \"$($script:dscResourceName)_WhenAddingDistributedSwitch_Config\"\n$script:configWhenAddingDistributedSwitchViaReferenceVDSwitch = \"$($script:dscResourceName)_WhenAddingDistributedSwitchViaReferenceVDSwitch_Config\"\n$script:configWhenUpdatingDistributedSwitch = \"$($script:dscResourceName)_WhenUpdatingDistributedSwitch_Config\"\n$script:configWhenRemovingDistributedSwitch = \"$($script:dscResourceName)_WhenRemovingDistributedSwitch_Config\"\n$script:configWhenRemovingDistributedSwitchesAndDatacenter = \"$($script:dscResourceName)_WhenRemovingDistributedSwitchesAndDatacenter_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingDistributedSwitch\\\"\n$script:mofFileWhenAddingDistributedSwitchViaReferenceVDSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingDistributedSwitchViaReferenceVDSwitch\\\"\n$script:mofFileWhenUpdatingDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingDistributedSwitch\\\"\n$script:mofFileWhenRemovingDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingDistributedSwitch\\\"\n$script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingDistributedSwitchesAndDatacenter\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configWhenAddingDistributedSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingDistributedSwitch `\n                -OutputPath $script:mofFileWhenAddingDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAddingDistributedSwitch }\n\n            $datacenterResource = $configuration | Where-Object { $_.ResourceId -eq $script:configurationData.AllNodes.DatacenterResourceId }\n            $distributedSwitchResource = $configuration | Where-Object { $_.ResourceId -eq $script:configurationData.AllNodes.DistributedSwitchResourceId }\n\n            # Assert\n            $datacenterResource.Server | Should -Be $script:configurationData.AllNodes.Server\n            $datacenterResource.Name | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $datacenterResource.Location | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $datacenterResource.Ensure | Should -Be 'Present'\n\n            $distributedSwitchResource.Server | Should -Be $script:configurationData.AllNodes.Server\n            $distributedSwitchResource.Name | Should -Be $script:configurationData.AllNodes.DistributedSwitchName\n            $distributedSwitchResource.Location | Should -Be $script:configurationData.AllNodes.Location\n            $distributedSwitchResource.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $distributedSwitchResource.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $distributedSwitchResource.Ensure | Should -Be 'Present'\n            $distributedSwitchResource.ContactDetails | Should -Be $script:configurationData.AllNodes.ContactDetails\n            $distributedSwitchResource.ContactName | Should -Be $script:configurationData.AllNodes.ContactName\n            $distributedSwitchResource.LinkDiscoveryProtocol | Should -Be $script:configurationData.AllNodes.LinkDiscoveryProtocol\n            $distributedSwitchResource.LinkDiscoveryProtocolOperation | Should -Be $script:configurationData.AllNodes.LinkDiscoveryProtocolOperationAdvertise\n            $distributedSwitchResource.MaxPorts | Should -Be $script:configurationData.AllNodes.MaxPorts\n            $distributedSwitchResource.Mtu | Should -Be $script:configurationData.AllNodes.Mtu\n            $distributedSwitchResource.Notes | Should -Be $script:configurationData.AllNodes.Notes\n            $distributedSwitchResource.NumUplinkPorts | Should -Be $script:configurationData.AllNodes.NumUplinkPorts\n            $distributedSwitchResource.Version | Should -Be $script:configurationData.AllNodes.Version\n            $distributedSwitchResource.ReferenceVDSwitchName | Should -BeNullOrEmpty\n            $distributedSwitchResource.WithoutPortGroups | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenAddingDistributedSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:configurationData.AllNodes.DistributedSwitchResourceName) should depend on Resource $($script:configurationData.AllNodes.DatacenterResourceName)\" {\n            # Arrange && Act\n            $distributedSwitchResource = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript {\n                $_.ConfigurationName -eq $script:configWhenAddingDistributedSwitch -and `\n                $_.ResourceId -eq $script:configurationData.AllNodes.DistributedSwitchResourceId\n            }\n\n            # Assert\n            $distributedSwitchResource.DependsOn | Should -Be $script:configurationData.AllNodes.DatacenterResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingDistributedSwitchesAndDatacenter `\n                -OutputPath $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenAddingDistributedSwitchViaReferenceVDSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingDistributedSwitch `\n                -OutputPath $script:mofFileWhenAddingDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenAddingDistributedSwitchViaReferenceVDSwitch `\n                -OutputPath $script:mofFileWhenAddingDistributedSwitchViaReferenceVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingDistributedSwitch = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenAddingDistributedSwitchViaReferenceVDSwitch = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchViaReferenceVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDistributedSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDistributedSwitchViaReferenceVDSwitch\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchViaReferenceVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAddingDistributedSwitchViaReferenceVDSwitch }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.ReferenceVDSwitchName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.Location\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.ContactDetails | Should -Be $script:configurationData.AllNodes.ContactDetails\n            $configuration.ContactName | Should -Be $script:configurationData.AllNodes.ContactName\n            $configuration.LinkDiscoveryProtocol | Should -Be $script:configurationData.AllNodes.LinkDiscoveryProtocol\n            $configuration.LinkDiscoveryProtocolOperation | Should -Be $script:configurationData.AllNodes.LinkDiscoveryProtocolOperationAdvertise\n            $configuration.MaxPorts | Should -Be $script:configurationData.AllNodes.MaxPorts\n            $configuration.Mtu | Should -Be $script:configurationData.AllNodes.Mtu\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.Notes\n            $configuration.NumUplinkPorts | Should -Be $script:configurationData.AllNodes.NumUplinkPorts\n            $configuration.Version | Should -Be $script:configurationData.AllNodes.Version\n            $configuration.ReferenceVDSwitchName | Should -Be $script:configurationData.AllNodes.DistributedSwitchName\n            $configuration.WithoutPortGroups | Should -Be $script:configurationData.AllNodes.WithoutPortGroups\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenAddingDistributedSwitchViaReferenceVDSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingDistributedSwitchesAndDatacenter `\n                -OutputPath $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchViaReferenceVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingDistributedSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingDistributedSwitch `\n                -OutputPath $script:mofFileWhenAddingDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingDistributedSwitch `\n                -OutputPath $script:mofFileWhenUpdatingDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingDistributedSwitch = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingDistributedSwitch = @{\n                Path = $script:mofFileWhenUpdatingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDistributedSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingDistributedSwitch\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingDistributedSwitch }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DistributedSwitchName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.Location\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.ContactDetails | Should -Be $script:configurationData.AllNodes.ContactDetails\n            $configuration.ContactName | Should -Be $script:configurationData.AllNodes.UpdatedContactName\n            $configuration.LinkDiscoveryProtocol | Should -Be $script:configurationData.AllNodes.LinkDiscoveryProtocol\n            $configuration.LinkDiscoveryProtocolOperation | Should -Be $script:configurationData.AllNodes.LinkDiscoveryProtocolOperationListen\n            $configuration.MaxPorts | Should -Be $script:configurationData.AllNodes.MaxPorts\n            $configuration.Mtu | Should -Be $script:configurationData.AllNodes.UpdatedMtu\n            $configuration.Notes | Should -Be $script:configurationData.AllNodes.Notes\n            $configuration.NumUplinkPorts | Should -Be $script:configurationData.AllNodes.NumUplinkPorts\n            $configuration.Version | Should -Be $script:configurationData.AllNodes.Version\n            $configuration.ReferenceVDSwitchName | Should -BeNullOrEmpty\n            $configuration.WithoutPortGroups | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingDistributedSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingDistributedSwitchesAndDatacenter `\n                -OutputPath $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenRemovingDistributedSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingDistributedSwitch `\n                -OutputPath $script:mofFileWhenAddingDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenRemovingDistributedSwitch `\n                -OutputPath $script:mofFileWhenRemovingDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingDistributedSwitch = @{\n                Path = $script:mofFileWhenAddingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenRemovingDistributedSwitch = @{\n                Path = $script:mofFileWhenRemovingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingDistributedSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingDistributedSwitch\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenRemovingDistributedSwitch }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.DistributedSwitchName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.Location\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.ContactDetails | Should -BeNullOrEmpty\n            $configuration.ContactName | Should -BeNullOrEmpty\n            $configuration.LinkDiscoveryProtocol | Should -Be 'Unset'\n            $configuration.LinkDiscoveryProtocolOperation | Should -Be 'Unset'\n            $configuration.MaxPorts | Should -BeNullOrEmpty\n            $configuration.Mtu | Should -BeNullOrEmpty\n            $configuration.Notes | Should -BeNullOrEmpty\n            $configuration.NumUplinkPorts | Should -BeNullOrEmpty\n            $configuration.Version | Should -BeNullOrEmpty\n            $configuration.ReferenceVDSwitchName | Should -BeNullOrEmpty\n            $configuration.WithoutPortGroups | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenRemovingDistributedSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingDistributedSwitchesAndDatacenter `\n                -OutputPath $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchesAndDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VDSwitchVMHost.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name\n)\n\n# Mandatory Integration Tests parameter is not used so it is set to $null.\n$Name = $null\n\n<#\nRetrieves the VMHosts on the specified server.\nIf there are no VMHosts or if there is only one VMHost on the specified server, it throws an exception.\n#>\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHosts = Get-VMHost -Server $viServer -ErrorAction SilentlyContinue\n\n    if ($null -eq $vmHosts -or $vmHosts.Length -lt 2) {\n        throw \"The Integration Tests require at least 2 VMHosts to be available on the specified server.\"\n    }\n\n    $script:vmHost1 = $vmHosts[0].Name\n    $script:vmHost2 = $vmHosts[1].Name\n}\n\nInvoke-TestSetup\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VDSwitchVMHost'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            DistributedSwitchResourceName = 'DistributedSwitch'\n            DistributedSwitchVMHostResourceName = 'DistributedSwitchVMHost'\n            DatacenterName = 'Datacenter'\n            DatacenterLocation = [string]::Empty\n            DistributedSwitchName = 'MyTestDistributedSwitch'\n            Location = [string]::Empty\n            VMHostNames = @($script:vmHost1, $script:vmHost2, '0.0.0.0')\n            ValidVMHostNames = @($script:vmHost1, $script:vmHost2)\n        }\n    )\n}\n\n$script:configWhenAddingDistributedSwitch = \"$($script:dscResourceName)_WhenAddingDistributedSwitch_Config\"\n$script:configWhenAddingVMHostsToDistributedSwitch = \"$($script:dscResourceName)_WhenAddingVMHostsToDistributedSwitch_Config\"\n$script:configWhenRemovingVMHostsFromDistributedSwitch = \"$($script:dscResourceName)_WhenRemovingVMHostsFromDistributedSwitch_Config\"\n$script:configWhenRemovingDistributedSwitch = \"$($script:dscResourceName)_WhenRemovingDistributedSwitch_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingDistributedSwitch\\\"\n$script:mofFileWhenAddingVMHostsToDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingVMHostsToDistributedSwitch\\\"\n$script:mofFileWhenRemovingVMHostsFromDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingVMHostsFromDistributedSwitch\\\"\n$script:mofFileWhenRemovingDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingDistributedSwitch\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $script:configWhenAddingVMHostsToDistributedSwitch\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAddingDistributedSwitch `\n                    -OutputPath $script:mofFileWhenAddingDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                & $script:configWhenAddingVMHostsToDistributedSwitch `\n                    -OutputPath $script:mofFileWhenAddingVMHostsToDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParametersWhenAddingDistributedSwitch = @{\n                    Path = $script:mofFileWhenAddingDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                $startDscConfigurationParametersWhenAddingVMHostsToDistributedSwitch = @{\n                    Path = $script:mofFileWhenAddingVMHostsToDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingDistributedSwitch\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMHostsToDistributedSwitch\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAddingVMHostsToDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAddingVMHostsToDistributedSwitch }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VdsName | Should -Be $script:configurationData.AllNodes.DistributedSwitchName\n                $configuration.VMHostNames | Should -Be $script:configurationData.AllNodes.ValidVMHostNames\n                $configuration.Ensure | Should -Be 'Present'\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenAddingVMHostsToDistributedSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenRemovingDistributedSwitch `\n                    -OutputPath $script:mofFileWhenRemovingDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenRemovingDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n\n                Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenAddingVMHostsToDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n\n        Context \"When using configuration $script:configWhenRemovingVMHostsFromDistributedSwitch\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAddingDistributedSwitch `\n                    -OutputPath $script:mofFileWhenAddingDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                & $script:configWhenAddingVMHostsToDistributedSwitch `\n                    -OutputPath $script:mofFileWhenAddingVMHostsToDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                & $script:configWhenRemovingVMHostsFromDistributedSwitch `\n                    -OutputPath $script:mofFileWhenRemovingVMHostsFromDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParametersWhenAddingDistributedSwitch = @{\n                    Path = $script:mofFileWhenAddingDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                $startDscConfigurationParametersWhenAddingVMHostsToDistributedSwitch = @{\n                    Path = $script:mofFileWhenAddingVMHostsToDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                $startDscConfigurationParametersWhenRemovingVMHostsFromDistributedSwitch = @{\n                    Path = $script:mofFileWhenRemovingVMHostsFromDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingDistributedSwitch\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMHostsToDistributedSwitch\n                Start-DscConfiguration @startDscConfigurationParametersWhenRemovingVMHostsFromDistributedSwitch\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenRemovingVMHostsFromDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenRemovingVMHostsFromDistributedSwitch }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VdsName | Should -Be $script:configurationData.AllNodes.DistributedSwitchName\n                $configuration.VMHostNames | Should -Be $script:configurationData.AllNodes.ValidVMHostNames\n                $configuration.Ensure | Should -Be 'Absent'\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenRemovingVMHostsFromDistributedSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenRemovingDistributedSwitch `\n                    -OutputPath $script:mofFileWhenRemovingDistributedSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenRemovingDistributedSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n\n                Remove-Item -Path $script:mofFileWhenAddingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenAddingVMHostsToDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenRemovingVMHostsFromDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenRemovingDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostAccount.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'VMHostAccount'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithVMHostAccountToAdd = \"$($script:dscResourceName)_WithAccountToAdd_Config\"\n$script:configWithVMHostAccountToUpdate = \"$($script:dscResourceName)_WithAccountToUpdate_Config\"\n$script:configWithVMHostAccountToRemove = \"$($script:dscResourceName)_WithAccountToRemove_Config\"\n\n$script:viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n\n$script:vmHostAccountId = 'MyTestVMHostAccount'\n\n$script:vmHostAccountToAdd = @{\n    Ensure = 'Present'\n    Role = 'Admin'\n    AccountPassword = 'MyTestAccountPass1!'\n    Description = 'MyTestVMHostAccount Description'\n}\n\n$script:vmHostAccountToUpdate = @{\n    Role = 'ReadOnly'\n    Description = 'MyTestVMHostAccount Description 2'\n}\n\n$script:vmHostAccountToRemove = @{\n    Ensure = 'Absent'\n    Description = [string]::Empty\n}\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWithVMHostAccountToAddPath = \"$script:integrationTestsFolderPath\\$($script:configWithVMHostAccountToAdd)\\\"\n$script:mofFileWithVMHostAccountToUpdatePath = \"$script:integrationTestsFolderPath\\$($script:configWithVMHostAccountToUpdate)\\\"\n$script:mofFileWithVMHostAccountToRemovePath = \"$script:integrationTestsFolderPath\\$($script:configWithVMHostAccountToRemove)\\\"\n\nfunction Invoke-TestSetup {\n    $vmHostAccountParams = @{\n        Server = $script:viServer\n        Id = $script:vmHostAccountId\n        Password = $script:vmHostAccountToAdd.AccountPassword\n        Description = $script:vmHostAccountToAdd.Description\n        Confirm = $false\n        ErrorAction = 'Stop'\n    }\n\n    New-VMHostAccount @vmHostAccountParams\n}\n\nfunction Invoke-TestCleanup {\n    Get-VMHostAccount -Server $script:viServer -Id $script:vmHostAccountId -ErrorAction SilentlyContinue | Remove-VMHostAccount -Server $script:viServer -Confirm:$false\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithVMHostAccountToAdd)\" {\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithVMHostAccountToAddPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithVMHostAccountToAddPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Id | Should -Be $script:vmHostAccountId\n                $configuration.Ensure | Should -Be $script:vmHostAccountToAdd.Ensure\n                $configuration.Role | Should -Be $script:vmHostAccountToAdd.Role\n                $configuration.Description | Should -Be $script:vmHostAccountToAdd.Description\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithVMHostAccountToUpdate)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithVMHostAccountToUpdatePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithVMHostAccountToUpdatePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Id | Should -Be $script:vmHostAccountId\n                $configuration.Ensure | Should -Be $script:vmHostAccountToAdd.Ensure\n                $configuration.Role | Should -Be $script:vmHostAccountToUpdate.Role\n                $configuration.Description | Should -Be $script:vmHostAccountToUpdate.Description\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithVMHostAccountToRemove)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithVMHostAccountToRemovePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithVMHostAccountToRemovePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Id | Should -Be $script:vmHostAccountId\n                $configuration.Ensure | Should -Be $script:vmHostAccountToRemove.Ensure\n                $configuration.Role | Should -Be $script:vmHostAccountToUpdate.Role\n                $configuration.Description | Should -Be $script:vmHostAccountToRemove.Description\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostAdvancedSettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostAdvancedSettings'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenHashtableContainsAdvancedSettingsToUpdate = \"$($script:dscResourceName)_WhenHashtableContainsAdvancedSettingsToUpdate_Config\"\n$script:configWhenHashtableDoesNotContainAdvancedSettingsToUpdate = \"$($script:dscResourceName)_WhenHashtableDoesNotContainAdvancedSettingsToUpdate_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenHashtableContainsAdvancedSettingsToUpdatePath = \"$script:integrationTestsFolderPath\\$($script:configWhenHashtableContainsAdvancedSettingsToUpdate)\\\"\n$script:mofFileWhenHashtableDoesNotContainAdvancedSettingsToUpdatePath = \"$script:integrationTestsFolderPath\\$($script:configWhenHashtableDoesNotContainAdvancedSettingsToUpdate)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenHashtableContainsAdvancedSettingsToUpdate)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenHashtableContainsAdvancedSettingsToUpdatePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenHashtableContainsAdvancedSettingsToUpdatePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n\n            foreach ($advancedSetting in $configuration.AdvancedSettings) {\n                $advancedSetting.Value | Should -Be $script:advancedSettingsWithCustomValues[$advancedSetting.Key].ToString()\n            }\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenHashtableDoesNotContainAdvancedSettingsToUpdatePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenHashtableDoesNotContainAdvancedSettingsToUpdate)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenHashtableDoesNotContainAdvancedSettingsToUpdatePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenHashtableDoesNotContainAdvancedSettingsToUpdatePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n\n            foreach ($advancedSetting in $configuration.AdvancedSettings) {\n                $advancedSetting.Value | Should -Be $script:advancedSettingsWithDefaultValues[$advancedSetting.Key].ToString()\n            }\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration | Should -Be $true\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostAgentVM.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the needed Datastore and Network from the Server. If there is no Datastore on the Server or no Network is available for the VMHost, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $vmHost = Get-VMHost -Server $viServer -Name $Name\n\n    $datastore = Get-Datastore -Server $viServer -RelatedObject $vmHost -ErrorAction SilentlyContinue | Select-Object -First 1\n    if ($null -eq $datastore) {\n        throw \"Integration Tests need one Datastore but no Datastore is found on the server $Server.\"\n    }\n\n    $network = $vmHost.ExtensionData.Network | Select-Object -First 1\n    if ($null -eq $network) {\n        throw \"Integration Tests require Network but no Network is available for the VMHost $($vmHost.Name).\"\n    }\n\n    $script:datastoreName = $datastore.Name\n    $script:networkName = (Get-View -Server $viServer -Id $network).Name\n}\n\nInvoke-TestSetup\n\n$script:dscResourceName = 'VMHostAgentVM'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenAgentVmSettingsAreNotPassed = \"$($script:dscResourceName)_WhenAgentVmSettingsAreNotPassed_Config\"\n$script:configWhenBothAgentVmSettingsArePassedAsNull = \"$($script:dscResourceName)_WhenBothAgentVmSettingsArePassedAsNull_Config\"\n$script:configWhenOnlyAgentVmDatastoreIsPassed = \"$($script:dscResourceName)_WhenOnlyAgentVmDatastoreIsPassed_Config\"\n$script:configWhenOnlyAgentVmNetworkIsPassed = \"$($script:dscResourceName)_WhenOnlyAgentVmNetworkIsPassed_Config\"\n$script:configWhenBothAgentVmSettingsArePassed = \"$($script:dscResourceName)_WhenBothAgentVmSettingsArePassed_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -Datastore $script:datastoreName -Network $script:networkName\n\n$script:mofFileWhenAgentVmSettingsAreNotPassedPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAgentVmSettingsAreNotPassed)\\\"\n$script:mofFileWhenBothAgentVmSettingsArePassedAsNullPath = \"$script:integrationTestsFolderPath\\$($script:configWhenBothAgentVmSettingsArePassedAsNull)\\\"\n$script:mofFileWhenOnlyAgentVmDatastoreIsPassedPath = \"$script:integrationTestsFolderPath\\$($script:configWhenOnlyAgentVmDatastoreIsPassed)\\\"\n$script:mofFileWhenOnlyAgentVmNetworkIsPassedPath = \"$script:integrationTestsFolderPath\\$($script:configWhenOnlyAgentVmNetworkIsPassed)\\\"\n$script:mofFileWhenBothAgentVmSettingsArePassedPath = \"$script:integrationTestsFolderPath\\$($script:configWhenBothAgentVmSettingsArePassed)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWhenAgentVmSettingsAreNotPassed)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAgentVmSettingsAreNotPassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAgentVmSettingsAreNotPassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n\n                <#\n                In the Resource Implementation when setting the property value to $null,\n                PowerShell converts it to an empty string, so the comparison should be against\n                empty string instead of $null.\n                #>\n                $agentVmSettingEmptyValue = [string]::Empty\n\n                $configuration.AgentVmDatastore | Should -Be $agentVmSettingEmptyValue\n                $configuration.AgentVmNetwork | Should -Be $agentVmSettingEmptyValue\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenBothAgentVmSettingsArePassedAsNull)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedAsNullPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedAsNullPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n\n                <#\n                In the Resource Implementation when setting the property value to $null,\n                PowerShell converts it to an empty string, so the comparison should be against\n                empty string instead of $null.\n                #>\n                $agentVmSettingEmptyValue = [string]::Empty\n\n                $configuration.AgentVmDatastore | Should -Be $agentVmSettingEmptyValue\n                $configuration.AgentVmNetwork | Should -Be $agentVmSettingEmptyValue\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenOnlyAgentVmDatastoreIsPassed)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenOnlyAgentVmDatastoreIsPassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenOnlyAgentVmDatastoreIsPassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n\n                <#\n                In the Resource Implementation when setting the property value to $null,\n                PowerShell converts it to an empty string, so the comparison should be against\n                empty string instead of $null.\n                #>\n                $agentVmSettingEmptyValue = [string]::Empty\n\n                $configuration.AgentVmDatastore | Should -Be $script:datastoreName\n                $configuration.AgentVmNetwork | Should -Be $agentVmSettingEmptyValue\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedAsNullPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenOnlyAgentVmNetworkIsPassed)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenOnlyAgentVmNetworkIsPassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenOnlyAgentVmNetworkIsPassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n\n                <#\n                In the Resource Implementation when setting the property value to $null,\n                PowerShell converts it to an empty string, so the comparison should be against\n                empty string instead of $null.\n                #>\n                $agentVmSettingEmptyValue = [string]::Empty\n\n                $configuration.AgentVmDatastore | Should -Be $agentVmSettingEmptyValue\n                $configuration.AgentVmNetwork | Should -Be $script:networkName\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedAsNullPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenBothAgentVmSettingsArePassed)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.AgentVmDatastore | Should -Be $script:datastoreName\n                $configuration.AgentVmNetwork | Should -Be $script:networkName\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenBothAgentVmSettingsArePassedAsNullPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostAuthentication.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainUsername,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $DomainPassword\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$DomainCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $DomainUsername, (ConvertTo-SecureString -String $DomainPassword -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostAuthentication'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            DomainName = $DomainName\n            DomainCredential = $DomainCredential\n            VMHostAuthenticationResourceName = 'VMHostAuthentication'\n            DomainActionJoin = 'Join'\n            DomainActionLeave = 'Leave'\n        }\n    )\n}\n\n$script:configJoinDomain = \"$($script:dscResourceName)_JoinDomain_Config\"\n$script:configLeaveDomain = \"$($script:dscResourceName)_LeaveDomain_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileJoinDomainPath = \"$script:integrationTestsFolderPath\\$script:configJoinDomain\\\"\n$script:mofFileLeaveDomainPath = \"$script:integrationTestsFolderPath\\$script:configLeaveDomain\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configJoinDomain\" {\n        BeforeAll {\n            # Arrange\n            & $script:configJoinDomain `\n                -OutputPath $script:mofFileJoinDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileJoinDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileJoinDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configJoinDomain }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.DomainName | Should -Be $script:configurationData.AllNodes.DomainName\n            $configuration.DomainAction | Should -Be $script:configurationData.AllNodes.DomainActionJoin\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileJoinDomainPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configLeaveDomain `\n                -OutputPath $script:mofFileLeaveDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileLeaveDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileJoinDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileLeaveDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configLeaveDomain\" {\n        BeforeAll {\n            # Arrange\n            & $script:configJoinDomain `\n                -OutputPath $script:mofFileJoinDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configLeaveDomain `\n                -OutputPath $script:mofFileLeaveDomainPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersJoinDomain = @{\n                Path = $script:mofFileJoinDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersLeaveDomain = @{\n                Path = $script:mofFileLeaveDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersJoinDomain\n            Start-DscConfiguration @startDscConfigurationParametersLeaveDomain\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileLeaveDomainPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configLeaveDomain }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.DomainName | Should -Be $script:configurationData.AllNodes.DomainName\n            $configuration.DomainAction | Should -Be $script:configurationData.AllNodes.DomainActionLeave\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileLeaveDomainPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Act\n            Remove-Item -Path $script:mofFileJoinDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileLeaveDomainPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostCache.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the needed SSD based Datastore from the Server. If there is no SSD based Datastore on the Server for the VMHost, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $vmHost = Get-VMHost -Server $viServer -Name $Name\n\n    $datastore = Get-Datastore -Server $viServer -RelatedObject $vmHost -ErrorAction SilentlyContinue | Where-Object { $_.ExtensionData.Info.Vmfs.Ssd -eq $true } | Select-Object -First 1\n    if ($null -eq $datastore) {\n        throw \"Integration Tests need one SSD based Datastore but no SSD based Datastore is found on the server $Server.\"\n    }\n\n    $script:datastoreName = $datastore.Name\n}\n\nInvoke-TestSetup\n\n$script:dscResourceName = 'VMHostCache'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenSwapSizeIsZeroGigabytes = \"$($script:dscResourceName)_WhenSwapSizeIsZeroGigabytes_Config\"\n$script:configWhenSwapSizeIsOneGigabyte = \"$($script:dscResourceName)_WhenSwapSizeIsOneGigabyte_Config\"\n$script:configWhenSwapSizeIsTwoGigabytes = \"$($script:dscResourceName)_WhenSwapSizeIsTwoGigabytes_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -DatastoreName $script:datastoreName\n\n$script:mofFileWhenSwapSizeIsZeroGigabytesPath = \"$script:integrationTestsFolderPath\\$($script:configWhenSwapSizeIsZeroGigabytes)\\\"\n$script:mofFileWhenSwapSizeIsOneGigabytePath = \"$script:integrationTestsFolderPath\\$($script:configWhenSwapSizeIsOneGigabyte)\\\"\n$script:mofFileWhenSwapSizeIsTwoGigabytesPath = \"$script:integrationTestsFolderPath\\$($script:configWhenSwapSizeIsTwoGigabytes)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWhenSwapSizeIsZeroGigabytes)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsZeroGigabytesPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsZeroGigabytesPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.DatastoreName | Should -Be $script:datastoreName\n                $configuration.SwapSizeGB | Should -Be $script:zeroGigabytesSwapSize\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration -Verbose | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenSwapSizeIsOneGigabyte)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsOneGigabytePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsOneGigabytePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.DatastoreName | Should -Be $script:datastoreName\n                $configuration.SwapSizeGB | Should -Be $script:oneGigabyteSwapSize\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration -Verbose | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsZeroGigabytesPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenSwapSizeIsTwoGigabytes)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsTwoGigabytesPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsTwoGigabytesPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.DatastoreName | Should -Be $script:datastoreName\n                $configuration.SwapSizeGB | Should -Be $script:twoGigabytesSwapSize\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration -Verbose | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSwapSizeIsZeroGigabytesPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostConfiguration/VMHostConfiguration.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the canonical name of the Scsi logical unit that will contain the Vmfs Datastore used in the Integration Tests.\n#>\nfunction Get-ScsiLunCanonicalName {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n\n    if ($null -eq $scsiLun) {\n        throw 'The Vmfs Datastore that is used in the Integration Tests requires one unused Scsi logical unit to be available.'\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $scsiLun.CanonicalName\n}\n\n<#\n.DESCRIPTION\n\nRetrieves the configuration of the VMHost before the execution of the Integration Tests.\n#>\nfunction Get-InitialVMHostConfiguration {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $initialVMHostConfiguration = @{}\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $hostProfileAssociatedWithVMHost = Get-VMHostProfile -Server $viServer -Entity $vmHost -ErrorAction Stop -Verbose:$false\n\n    $initialVMHostConfiguration.State = $vmHost.ConnectionState\n    $initialVMHostConfiguration.LicenseKey = $vmHost.LicenseKey\n    $initialVMHostConfiguration.TimeZoneName = $vmHost.TimeZone.Name\n    $initialVMHostConfiguration.VMSwapfileDatastoreName = if ($null -ne $vmHost.VMSwapfileDatastore) { $vmHost.VMSwapfileDatastore.Name } else { [string]::Empty }\n    $initialVMHostConfiguration.VMSwapfilePolicy = $vmHost.VMSwapfilePolicy.ToString()\n    $initialVMHostConfiguration.HostProfileName = if ($null -ne $hostProfileAssociatedWithVMHost) { $hostProfileAssociatedWithVMHost.Name } else { [string]::Empty }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $initialVMHostConfiguration\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Host Profile with the specified name based on the specified reference VMHost.\n#>\nfunction New-HostProfile {\n    [CmdletBinding()]\n\n    $hostProfileName = $script:configurationData.AllNodes.HostProfileName\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    New-VMHostProfile -Server $viServer -Name $hostProfileName -ReferenceHost $vmHost -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRestores the VMSwapfileDatastore of the VMHost to its initial state.\nIf another Datastore was used for storing VM swapfiles, the VMHost will start using it again.\nOtherwise no Datastore will be used for storing VM swapfiles.\n#>\nfunction Restore-VMHostVMSwapfileDatastoreToInitialState {\n    [CmdletBinding()]\n\n    $vmSwapfileDatastoreName = $script:configurationData.AllNodes.InitialVMSwapfileDatastoreName\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n\n    if ([string]::IsNullOrEmpty($vmSwapfileDatastoreName)) {\n        $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n        $datastoreSystem.UpdateLocalSwapDatastore($null)\n    }\n    else {\n        $datastore = Get-Datastore -Server $viServer -Name $vmSwapfileDatastoreName -VMHost $vmHost -ErrorAction Stop -Verbose:$false\n        Set-VMHost -Server $viServer -VMHost $vmHost -VMSwapfileDatastore $datastore -Confirm:$false -ErrorAction Stop -Verbose:$false\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Host Profile with the specified name.\n#>\nfunction Remove-HostProfile {\n    [CmdletBinding()]\n\n    $hostProfileName = $script:configurationData.AllNodes.HostProfileName\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n\n    $hostProfile = Get-VMHostProfile -Server $viServer -Name $hostProfileName -ReferenceHost $vmHost -ErrorAction Stop -Verbose:$false\n    $hostProfile | Remove-VMHostProfile -Server $viServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostConfiguration/VMHostConfiguration.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostConfiguration.Integration.Tests.Helpers.ps1\"\n$script:scsiLunCanonicalName = Get-ScsiLunCanonicalName\n$script:initialVMHostConfiguration = Get-InitialVMHostConfiguration\n\n$script:dscResourceName = 'VMHostConfiguration'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VmfsDatastoreResourceName = 'VmfsDatastore'\n            VMHostConfigurationResourceName = 'VMHostConfiguration'\n            DatastoreName = 'MyTestVmfsDatastore'\n            ScsiLunCanonicalName = $script:scsiLunCanonicalName\n            InitialVMHostState = $script:initialVMHostConfiguration.State\n            InitialVMHostLicenseKey = $script:initialVMHostConfiguration.LicenseKey\n            InitialVMHostTimeZoneName = $script:initialVMHostConfiguration.TimeZoneName\n            InitialVMSwapfileDatastoreName = $script:initialVMHostConfiguration.VMSwapfileDatastoreName\n            InitialVMSwapfilePolicy = $script:initialVMHostConfiguration.VMSwapfilePolicy\n            InitialHostProfileName = $script:initialVMHostConfiguration.HostProfileName\n            LicenseKey = '00000-00000-00000-00000-00000'\n            TimeZoneName = 'UTC'\n            VMSwapfilePolicy = 'InHostDatastore'\n            HostProfileName = 'MyTestHostProfile'\n        }\n    )\n}\n\n$script:configCreateVmfsDatastore = \"$($script:dscResourceName)_CreateVmfsDatastore_Config\"\n$script:configModifyVMHostHostProfileAssociation = \"$($script:dscResourceName)_ModifyVMHostHostProfileAssociation_Config\"\n$script:configModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy = \"$($script:dscResourceName)_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config\"\n$script:configModifyVMHostConfigurationToInitialState = \"$($script:dscResourceName)_ModifyVMHostConfigurationToInitialState_Config\"\n$script:configRemoveVmfsDatastore = \"$($script:dscResourceName)_RemoveVmfsDatastore_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configCreateVmfsDatastore\\\"\n$script:mofFileModifyVMHostHostProfileAssociationPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostHostProfileAssociation\\\"\n$script:mofFileModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicyPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy\\\"\n$script:mofFileModifyVMHostConfigurationToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostConfigurationToInitialState\\\"\n$script:mofFileRemoveVmfsDatastorePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVmfsDatastore\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVmfsDatastore `\n                -OutputPath $script:mofFileCreateVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy `\n                -OutputPath $script:mofFileModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVmfsDatastore = @{\n                Path = $script:mofFileCreateVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy = @{\n                Path = $script:mofFileModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVmfsDatastore\n            Start-DscConfiguration @startDscConfigurationParametersModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.State | Should -Be $script:configurationData.AllNodes.InitialVMHostState\n            $configuration.Evacuate | Should -BeNullOrEmpty\n            $configuration.VsanDataMigrationMode | Should -Be 'Unset'\n            $configuration.LicenseKey | Should -Be $script:configurationData.AllNodes.LicenseKey\n            $configuration.TimeZoneName | Should -Be $script:configurationData.AllNodes.TimeZoneName\n            $configuration.VMSwapfileDatastoreName | Should -Be $script:configurationData.AllNodes.DatastoreName\n            $configuration.VMSwapfilePolicy | Should -Be $script:configurationData.AllNodes.VMSwapfilePolicy\n            $configuration.HostProfileName | Should -Be $script:configurationData.AllNodes.InitialHostProfileName\n            $configuration.KmsClusterName | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicyPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVmfsDatastore `\n                -OutputPath $script:mofFileRemoveVmfsDatastorePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersModifyVMHostConfigurationToInitialState = @{\n                Path = $script:mofFileModifyVMHostConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVmfsDatastore = @{\n                Path = $script:mofFileRemoveVmfsDatastorePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Restore-VMHostVMSwapfileDatastoreToInitialState\n\n            Start-DscConfiguration @startDscConfigurationParametersModifyVMHostConfigurationToInitialState\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVmfsDatastore\n\n            Remove-Item -Path $script:mofFileCreateVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVmfsDatastorePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyVMHostHostProfileAssociation\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostHostProfileAssociation `\n                -OutputPath $script:mofFileModifyVMHostHostProfileAssociationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostHostProfileAssociationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-HostProfile\n\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostHostProfileAssociationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostHostProfileAssociation }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.State | Should -Be $script:configurationData.AllNodes.InitialVMHostState\n            $configuration.Evacuate | Should -BeNullOrEmpty\n            $configuration.VsanDataMigrationMode | Should -Be 'Unset'\n            $configuration.LicenseKey | Should -Be $script:configurationData.AllNodes.InitialVMHostLicenseKey\n            $configuration.TimeZoneName | Should -Be $script:configurationData.AllNodes.InitialVMHostTimeZoneName\n            $configuration.VMSwapfileDatastoreName | Should -Be $script:configurationData.AllNodes.InitialVMSwapfileDatastoreName\n            $configuration.VMSwapfilePolicy | Should -Be $script:configurationData.AllNodes.InitialVMSwapfilePolicy\n            $configuration.HostProfileName | Should -Be $script:configurationData.AllNodes.HostProfileName\n            $configuration.KmsClusterName | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostHostProfileAssociationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-HostProfile\n\n            Remove-Item -Path $script:mofFileModifyVMHostHostProfileAssociationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostDnsSettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostDnsSettings'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithDhcpDisabled = \"$($script:dscResourceName)_WithDhcpDisabled_Config\"\n$script:configWithoutAddressAndSearchDomain = \"$($script:dscResourceName)_WithoutAddressAndSearchDomain_Config\"\n$script:configWithDhcpEnabled = \"$($script:dscResourceName)_WithDhcpEnabled_Config\"\n\n$script:connection = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:vmHost = $null\n\n$script:dnsConfig = $null\n$script:dnsHostName = $null\n$script:dnsDomainName = $null\n$script:dnsAddress = $null\n$script:dnsSearchDomain = $null\n$script:dnsDhcp = $null\n$script:dnsVirtualNicDevice = $null\n\n$script:hostName = \"esx-server1\"\n$script:domainName = \"eng.vmware.com\"\n$script:address = @(\"10.23.83.229\", \"10.23.108.1\")\n$script:searchDomain = @(\"eng.vmware.com\")\n$script:virtualNicDevice = \"vmk0\"\n\n$script:resourceWithDhcpDisabled = @{\n    Name = $Name\n    Server = $Server\n    HostName = $script:hostName\n    DomainName = $script:domainName\n    Dhcp = $false\n    Address = $script:address\n    SearchDomain = $script:searchDomain\n}\n$script:resourceWithoutAddressAndSearchDomain = @{\n    Name = $Name\n    Server = $Server\n    HostName = $script:hostName\n    DomainName = $script:domainName\n    Dhcp = $false\n}\n$script:resourceWithDhcpEnabled = @{\n    Name = $Name\n    Server = $Server\n    HostName = $script:hostName\n    DomainName = $script:domainName\n    Dhcp = $true\n    VirtualNicDevice = $script:virtualNicDevice\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithDhcpDisabledPath = \"$script:integrationTestsFolderPath\\$($script:configWithDhcpDisabled)\\\"\n$script:mofFileWithoutAddressAndSearchDomainPath = \"$script:integrationTestsFolderPath\\$($script:configWithoutAddressAndSearchDomain)\\\"\n$script:mofFileWithDhcpEnabledPath = \"$script:integrationTestsFolderPath\\$($script:configWithDhcpEnabled)\\\"\n\nfunction Invoke-TestSetup {\n    $script:vmHost = Get-VMHost -Server $Server -Name $Name\n    $script:dnsConfig = $script:vmHost.ExtensionData.Config.Network.DnsConfig\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithDhcpDisabled)\" {\n            BeforeAll {\n                Invoke-TestSetup\n\n                $script:dnsHostName = $script:dnsConfig.HostName\n                $script:dnsDomainName = $script:dnsConfig.DomainName\n                $script:dnsAddress = $script:dnsConfig.Address\n                $script:dnsSearchDomain = $script:dnsConfig.SearchDomain\n            }\n\n            AfterAll {\n                $dnsConfig = New-Object VMware.Vim.HostDnsConfig\n\n                $dnsConfig.HostName = $script:dnsHostName\n                $dnsConfig.DomainName = $script:dnsDomainName\n                $dnsConfig.Address = $script:dnsAddress\n                $dnsConfig.SearchDomain = $script:dnsSearchDomain\n\n                $networkSystem = Get-View -Server $Server $script:vmHost.ExtensionData.ConfigManager.NetworkSystem\n                $networkSystem.UpdateDnsConfig($dnsConfig)\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithDhcpDisabledPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithDhcpDisabledPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithDhcpDisabled.Name\n                $configuration.Server | Should -Be $script:resourceWithDhcpDisabled.Server\n                $configuration.HostName | Should -Be $script:resourceWithDhcpDisabled.HostName\n                $configuration.DomainName | Should -Be $script:resourceWithDhcpDisabled.DomainName\n                $configuration.Dhcp | Should -Be $false\n                $configuration.Address | Should -Be $script:resourceWithDhcpDisabled.Address\n                $configuration.SearchDomain | Should -Be $script:resourceWithDhcpDisabled.SearchDomain\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithoutAddressAndSearchDomain)\" {\n            BeforeAll {\n                Invoke-TestSetup\n\n                $script:dnsHostName = $script:dnsConfig.HostName\n                $script:dnsDomainName = $script:dnsConfig.DomainName\n                $script:dnsAddress = $script:dnsConfig.Address\n                $script:dnsSearchDomain = $script:dnsConfig.SearchDomain\n            }\n\n            AfterAll {\n                $dnsConfig = New-Object VMware.Vim.HostDnsConfig\n\n                $dnsConfig.HostName = $script:dnsHostName\n                $dnsConfig.DomainName = $script:dnsDomainName\n                $dnsConfig.Address = $script:dnsAddress\n                $dnsConfig.SearchDomain = $script:dnsSearchDomain\n\n                $networkSystem = Get-View -Server $Server $script:vmHost.ExtensionData.ConfigManager.NetworkSystem\n                $networkSystem.UpdateDnsConfig($dnsConfig)\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithoutAddressAndSearchDomainPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithoutAddressAndSearchDomainPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithoutAddressAndSearchDomain.Name\n                $configuration.Server | Should -Be $script:resourceWithoutAddressAndSearchDomain.Server\n                $configuration.HostName | Should -Be $script:resourceWithoutAddressAndSearchDomain.HostName\n                $configuration.DomainName | Should -Be $script:resourceWithoutAddressAndSearchDomain.DomainName\n                $configuration.Dhcp | Should -Be $false\n                $configuration.Address | Should -Be $null\n                $configuration.SearchDomain | Should -Be $null\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithDhcpEnabled)\" {\n            BeforeAll {\n                Invoke-TestSetup\n\n                $script:dnsHostName = $script:dnsConfig.HostName\n                $script:dnsDomainName = $script:dnsConfig.DomainName\n                $script:dnsDhcp = $script:dnsConfig.Dhcp\n                $script:dnsVirtualNicDevice = $script:dnsConfig.VirtualNicDevice\n            }\n\n            AfterAll {\n                $dnsConfig = New-Object VMware.Vim.HostDnsConfig\n\n                $dnsConfig.HostName = $script:dnsHostName\n                $dnsConfig.DomainName = $script:dnsDomainName\n                $dnsConfig.Dhcp = $script:dnsDhcp\n                $dnsConfig.VirtualNicDevice = $script:dnsVirtualNicDevice\n\n                $networkSystem = Get-View -Server $Server $script:vmHost.ExtensionData.ConfigManager.NetworkSystem\n                $networkSystem.UpdateDnsConfig($dnsConfig)\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithDhcpEnabledPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithDhcpEnabledPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithDhcpEnabled.Name\n                $configuration.Server | Should -Be $script:resourceWithDhcpEnabled.Server\n                $configuration.HostName | Should -Be $script:resourceWithDhcpEnabled.HostName\n                $configuration.DomainName | Should -Be $script:resourceWithDhcpEnabled.DomainName\n                $configuration.Dhcp | Should -Be $true\n                $configuration.VirtualNicDevice | Should -Be $script:resourceWithDhcpEnabled.VirtualNicDevice\n                $configuration.Ipv6VirtualNicDevice | Should -Be \"\"\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostFirewallRuleset/VMHostFirewallRuleset.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the initial configuration of the VMHost firewall ruleset that is used in the Integration Tests.\n#>\nfunction Get-VMHostFirewallRulesetInitialConfiguration {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $vmHostFirewallRuleset = Get-VMHostFirewallException -Server $viServer -VMHost $vmHost -ErrorAction Stop -Verbose:$false |\n                             Select-Object -First 1\n\n    if ($null -eq $vmHostFirewallRuleset) {\n        throw \"No VMHost firewall rulesets available on VMHost $($vmHost.Name).\"\n    }\n\n    $vmHostFirewallRulesetAllowedHosts = $vmHostFirewallRuleset.ExtensionData.AllowedHosts\n    $ipNetworks = @()\n    foreach ($hostFirewallRulesetIpNetwork in $vmHostFirewallRulesetAllowedHosts.IpNetwork) {\n        $ipNetwork = $hostFirewallRulesetIpNetwork.Network + '/' + $hostFirewallRulesetIpNetwork.PrefixLength\n        $ipNetworks += $ipNetwork\n    }\n\n    $vmHostFirewallRulesetInitialConfiguration = @{\n        RulesetName = $vmHostFirewallRuleset.Name\n        RulesetEnabled = $vmHostFirewallRuleset.Enabled\n        AllIP = $vmHostFirewallRulesetAllowedHosts.AllIp\n        IPAddresses = $vmHostFirewallRulesetAllowedHosts.IpAddress + $ipNetworks\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostFirewallRulesetInitialConfiguration\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostFirewallRuleset/VMHostFirewallRuleset.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostFirewallRuleset.Integration.Tests.Helpers.ps1\"\n$script:vmHostFirewallRulesetInitialConfiguration = Get-VMHostFirewallRulesetInitialConfiguration\n\n$script:dscResourceName = 'VMHostFirewallRuleset'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostFirewallRulesetResourceName = 'VMHostFirewallRuleset'\n            VMHostFirewallRulesetName = $script:vmHostFirewallRulesetInitialConfiguration.RulesetName\n            InitialVMHostFirewallRulesetState = $script:vmHostFirewallRulesetInitialConfiguration.RulesetEnabled\n            InitialVMHostFirewallRulesetForAllIPs = $script:vmHostFirewallRulesetInitialConfiguration.AllIP\n            InitialVMHostFirewallRulesetIPAddressesAndIPNetworksList = $script:vmHostFirewallRulesetInitialConfiguration.IPAddresses\n            VMHostFirewallRulesetEnabled = $true\n            VMHostFirewallRulesetForAllIPs = $false\n            VMHostFirewallRulesetEmptyIPAddressesList = @()\n            VMHostFirewallRulesetIPAddressesList = @('192.0.20.10', '192.0.20.11', '192.0.20.12')\n            VMHostFirewallRulesetIPNetworksList = @('10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/24')\n            VMHostFirewallRulesetIPAddressesAndIPNetworksList = @('192.0.20.10', '192.0.20.11', '192.0.20.12', '10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/24')\n        }\n    )\n}\n\n$script:configEnableVMHostFirewallRuleset = \"$($script:dscResourceName)_EnableVMHostFirewallRuleset_Config\"\n$script:configDisableVMHostFirewallRuleset = \"$($script:dscResourceName)_DisableVMHostFirewallRuleset_Config\"\n$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList = \"$($script:dscResourceName)_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList_Config\"\n$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly = \"$($script:dscResourceName)_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly_Config\"\n$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly = \"$($script:dscResourceName)_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly_Config\"\n$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList = \"$($script:dscResourceName)_ModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList_Config\"\n$script:configModifyVMHostFirewallRulesetConfigurationToInitialState = \"$($script:dscResourceName)_ModifyVMHostFirewallRulesetConfigurationToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileEnableVMHostFirewallRulesetPath = \"$script:integrationTestsFolderPath\\$script:configEnableVMHostFirewallRuleset\\\"\n$script:mofFileDisableVMHostFirewallRulesetPath = \"$script:integrationTestsFolderPath\\$script:configDisableVMHostFirewallRuleset\\\"\n$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyListPath = \"$script:integrationTestsFolderPath\\$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList\\\"\n$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnlyPath = \"$script:integrationTestsFolderPath\\$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly\\\"\n$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnlyPath = \"$script:integrationTestsFolderPath\\$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly\\\"\n$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksListPath = \"$script:integrationTestsFolderPath\\$script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList\\\"\n$script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostFirewallRulesetConfigurationToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configEnableVMHostFirewallRuleset\" {\n        BeforeAll {\n            # Arrange\n            & $script:configEnableVMHostFirewallRuleset `\n                -OutputPath $script:mofFileEnableVMHostFirewallRulesetPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileEnableVMHostFirewallRulesetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileEnableVMHostFirewallRulesetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configEnableVMHostFirewallRuleset }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetEnabled\n            $configuration.AllIP | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetForAllIPs\n            $configuration.IPAddresses | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetIPAddressesAndIPNetworksList\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileEnableVMHostFirewallRulesetPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostFirewallRulesetConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileEnableVMHostFirewallRulesetPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configDisableVMHostFirewallRuleset\" {\n        BeforeAll {\n            # Arrange\n            & $script:configDisableVMHostFirewallRuleset `\n                -OutputPath $script:mofFileDisableVMHostFirewallRulesetPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileDisableVMHostFirewallRulesetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileDisableVMHostFirewallRulesetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configDisableVMHostFirewallRuleset }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetName\n            $configuration.Enabled | Should -Be (!$script:configurationData.AllNodes.VMHostFirewallRulesetEnabled)\n            $configuration.AllIP | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetForAllIPs\n            $configuration.IPAddresses | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetIPAddressesAndIPNetworksList\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileDisableVMHostFirewallRulesetPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostFirewallRulesetConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileDisableVMHostFirewallRulesetPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList `\n                -OutputPath $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyListPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyListPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyListPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyList }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetState\n            $configuration.AllIP | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetForAllIPs\n            $configuration.IPAddresses | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetEmptyIPAddressesList\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyListPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostFirewallRulesetConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToEmptyListPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly `\n                -OutputPath $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnlyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnlyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnlyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnly }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetState\n            $configuration.AllIP | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetForAllIPs\n            $configuration.IPAddresses | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetIPAddressesList\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnlyPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostFirewallRulesetConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesListOnlyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly `\n                -OutputPath $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnlyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnlyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnlyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnly }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetState\n            $configuration.AllIP | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetForAllIPs\n            $configuration.IPAddresses | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetIPNetworksList\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnlyPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostFirewallRulesetConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPNetworksListOnlyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList `\n                -OutputPath $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksListPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksListPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksListPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksList }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetName\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.InitialVMHostFirewallRulesetState\n            $configuration.AllIP | Should -Be (!$script:configurationData.AllNodes.VMHostFirewallRulesetForAllIPs)\n            $configuration.IPAddresses | Should -Be $script:configurationData.AllNodes.VMHostFirewallRulesetIPAddressesAndIPNetworksList\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksListPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostFirewallRulesetConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyAllowedIPAddressesListOfVMHostFirewallRulesetToIPAddressesAndIPNetworksListPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostFirewallRulesetConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostGraphics/VMHostGraphics.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostGraphics'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:config = \"$($script:dscResourceName)_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFilePath = \"$script:integrationTestsFolderPath\\$($script:config)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:config)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFilePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFilePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n            $configuration.GraphicsType | Should -Be $script:sharedGraphicsType\n            $configuration.SharedPassthruAssignmentPolicy | Should -Be $script:performanceSharedPassthruAssignmentPolicy\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration -Verbose | Should -Be $true\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostGraphics/VMHostGraphicsDevice.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the Id of the first Graphics Device in the DeviceType array of the Graphics Configuration. If there are no Graphics Devices, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $vmHost = Get-VMHost -Server $viServer -Name $Name\n    $graphicsManager = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.GraphicsManager\n\n    $graphicsDevice = $graphicsManager.GraphicsConfig.DeviceType | Select-Object -First 1\n    if ($null -eq $graphicsDevice) {\n        throw \"No Graphics Device found on the server $Server.\"\n    }\n\n    $script:graphicsDeviceId = $graphicsDevice.DeviceId\n}\n\nInvoke-TestSetup\n\n$script:dscResourceName = 'VMHostGraphicsDevice'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:config = \"$($script:dscResourceName)_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -GraphicsDeviceId $script:graphicsDeviceId\n\n$script:mofFilePath = \"$script:integrationTestsFolderPath\\$($script:config)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:config)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.Id | Should -Be $script:graphicsDeviceId\n                $configuration.GraphicsType | Should -Be $script:sharedGraphicsType\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration -Verbose | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHba/VMHostIScsiHba.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the iSCSI Host Bus Adapter with Prohibited CHAP type that is used in the Integration Tests.\n#>\nfunction Get-VMHostIScsiHba {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $iScsiHba = Get-VMHostHba -Server $viServer -VMHost $vmHost -Type 'iSCSI' -ErrorAction Stop -Verbose:$false |\n                Where-Object -FilterScript { $_.AuthenticationProperties.ChapType.ToString() -eq 'Prohibited' } |\n                Select-Object -First 1\n\n    if ($null -eq $iScsiHba) {\n        throw \"No iSCSI Host Bus Adapters with Prohibited CHAP type available on VMHost $($vmHost.Name).\"\n    }\n\n    $vmHostIScsiHba = @{\n        Name = $iScsiHba.Device\n        IScsiName = $iScsiHba.IScsiName\n        ChapType = $iScsiHba.AuthenticationProperties.ChapType.ToString()\n        ChapName = $iScsiHba.AuthenticationProperties.ChapName\n        MutualChapEnabled = $iScsiHba.AuthenticationProperties.MutualChapEnabled\n        MutualChapName = $iScsiHba.AuthenticationProperties.MutualChapName\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostIScsiHba\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHba/VMHostIScsiHba.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostIScsiHba.Integration.Tests.Helpers.ps1\"\n$script:vmHostIScsiHba = Get-VMHostIScsiHba\n\n<#\n    Example iSCSI name is: iqn.1998-01.com.vmware:esx-server1-7ccc38b8, with a random set of characters\n    appended to the end of the name: \"7ccc38b8\". So to test with a valid iSCSI name, we can remove this\n    set of characters.\n#>\n$script:iScsiName = $script:vmHostIScsiHba.IScsiName.Substring(0, $script:vmHostIScsiHba.IScsiName.LastIndexOf('-'))\n\n$script:dscResourceName = 'VMHostIScsiHba'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostIScsiHbaResourceName = 'VMHostIScsiHba'\n            IScsiHbaName = $script:vmHostIScsiHba.Name\n            InitialIScsiName = $script:vmHostIScsiHba.IScsiName\n            IScsiName = $script:iScsiName\n            InitialChapType = $script:vmHostIScsiHba.ChapType\n            ChapTypeRequired = 'Required'\n            ChapTypeProhibited = 'Prohibited'\n            InitialChapName = $script:vmHostIScsiHba.ChapName\n            ChapName = 'Admin'\n            ChapPassword = 'AdminPasswordOne'\n            InitialMutualChapEnabled = $script:vmHostIScsiHba.MutualChapEnabled\n            MutualChapEnabled = $true\n            InitialMutualChapName = $script:vmHostIScsiHba.MutualChapName\n            MutualChapName = 'Admin'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n    )\n}\n\n$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType = \"$($script:dscResourceName)_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config\"\n$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap = \"$($script:dscResourceName)_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap_Config\"\n$script:configModifyIScsiNameOfIScsiHostBusAdapter = \"$($script:dscResourceName)_ModifyIScsiNameOfIScsiHostBusAdapter_Config\"\n$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState = \"$($script:dscResourceName)_ConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState_Config\"\n$script:configModifyIScsiNameOfIScsiHostBusAdapterToInitialState = \"$($script:dscResourceName)_ModifyIScsiNameOfIScsiHostBusAdapterToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath = \"$script:integrationTestsFolderPath\\$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType\\\"\n$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChapPath = \"$script:integrationTestsFolderPath\\$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap\\\"\n$script:mofFileModifyIScsiNameOfIScsiHostBusAdapterPath = \"$script:integrationTestsFolderPath\\$script:configModifyIScsiNameOfIScsiHostBusAdapter\\\"\n$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState\\\"\n$script:mofFileModifyIScsiNameOfIScsiHostBusAdapterToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyIScsiNameOfIScsiHostBusAdapterToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType\" {\n        BeforeAll {\n            # Arrange\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.IScsiName | Should -Be $script:configurationData.AllNodes.InitialIScsiName\n            $configuration.ChapType | Should -Be $script:configurationData.AllNodes.ChapTypeRequired\n            $configuration.ChapName | Should -Be $script:configurationData.AllNodes.ChapName\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.MutualChapEnabled | Should -Be $script:configurationData.AllNodes.MutualChapEnabled\n            $configuration.MutualChapName | Should -Be $script:configurationData.AllNodes.MutualChapName\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap\" {\n        BeforeAll {\n            # Arrange\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChapPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChapPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType\n            Start-DscConfiguration @startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChapPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChap }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.IScsiName | Should -Be $script:configurationData.AllNodes.InitialIScsiName\n            $configuration.ChapType | Should -Be $script:configurationData.AllNodes.ChapTypeProhibited\n            $configuration.ChapName | Should -BeNullOrEmpty\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.MutualChapEnabled | Should -Be (!$script:configurationData.AllNodes.MutualChapEnabled)\n            $configuration.MutualChapName | Should -BeNullOrEmpty\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChapPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapTypeAndDisabledMutualChapPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyIScsiNameOfIScsiHostBusAdapter\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyIScsiNameOfIScsiHostBusAdapter `\n                -OutputPath $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyIScsiNameOfIScsiHostBusAdapter }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.IScsiName | Should -Be $script:configurationData.AllNodes.IScsiName\n            $configuration.ChapType | Should -Be $script:configurationData.AllNodes.InitialChapType\n            $configuration.ChapName | Should -Be ([string] $script:configurationData.AllNodes.InitialChapName)\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.MutualChapEnabled | Should -Be $script:configurationData.AllNodes.InitialMutualChapEnabled\n            $configuration.MutualChapName | Should -Be ([string] $script:configurationData.AllNodes.InitialMutualChapName)\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyIScsiNameOfIScsiHostBusAdapterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyIScsiNameOfIScsiHostBusAdapterToInitialState `\n                -OutputPath $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyIScsiNameOfIScsiHostBusAdapterToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the iSCSI Host Bus Adapter with Prohibited CHAP type that is used in the Integration Tests.\n#>\nfunction Get-VMHostIScsiHba {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $iScsiHba = Get-VMHostHba -Server $viServer -VMHost $vmHost -Type 'iSCSI' -ErrorAction Stop -Verbose:$false |\n                Where-Object -FilterScript { $_.AuthenticationProperties.ChapType.ToString() -eq 'Prohibited' } |\n                Select-Object -First 1\n\n    if ($null -eq $iScsiHba) {\n        throw \"No iSCSI Host Bus Adapters with Prohibited CHAP type available on VMHost $($vmHost.Name).\"\n    }\n\n    $vmHostIScsiHba = @{\n        Name = $iScsiHba.Device\n        IScsiName = $iScsiHba.IScsiName\n        ChapType = $iScsiHba.AuthenticationProperties.ChapType.ToString()\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostIScsiHba\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHbaTarget/VMHostIScsiHbaTarget.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostIScsiHbaTarget.Integration.Tests.Helpers.ps1\"\n$script:vmHostIScsiHba = Get-VMHostIScsiHba\n\n$script:dscResourceName = 'VMHostIScsiHbaTarget'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostIScsiHbaResourceName = 'VMHostIScsiHba'\n            VMHostIScsiHbaTargetResourceName = 'VMHostIScsiHbaTarget'\n            IScsiHbaName = $script:vmHostIScsiHba.Name\n            InitialChapType = $script:vmHostIScsiHba.ChapType\n            IScsiHbaTargetAddress = '10.23.84.73'\n            IScsiHbaTargetPort = 3260\n            IScsiHbaSendTargetType = 'Send'\n            IScsiHbaStaticTargetType = 'Static'\n            IScsiName = $script:vmHostIScsiHba.IScsiName\n            InheritChap = $true\n            ChapTypeRequired = 'Required'\n            ChapTypeProhibited = 'Prohibited'\n            ChapName = 'Admin'\n            ChapPassword = 'AdminPasswordOne'\n            InheritMutualChap = $true\n            MutualChapEnabled = $true\n            MutualChapName = 'Admin'\n            MutualChapPassword = 'AdminPasswordTwo'\n        }\n    )\n}\n\n$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType = \"$($script:dscResourceName)_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config\"\n$script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType = \"$($script:dscResourceName)_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config\"\n$script:configCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings = \"$($script:dscResourceName)_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config\"\n$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType = \"$($script:dscResourceName)_ConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType_Config\"\n$script:configRemoveIScsiHostBusAdapterSendTarget = \"$($script:dscResourceName)_RemoveIScsiHostBusAdapterSendTarget_Config\"\n$script:configRemoveIScsiHostBusAdapterStaticTarget = \"$($script:dscResourceName)_RemoveIScsiHostBusAdapterStaticTarget_Config\"\n$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState = \"$($script:dscResourceName)_ConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath = \"$script:integrationTestsFolderPath\\$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType\\\"\n$script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath = \"$script:integrationTestsFolderPath\\$script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType\\\"\n$script:mofFileCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettingsPath = \"$script:integrationTestsFolderPath\\$script:configCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings\\\"\n$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapTypePath = \"$script:integrationTestsFolderPath\\$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType\\\"\n$script:mofFileRemoveIScsiHostBusAdapterSendTargetPath = \"$script:integrationTestsFolderPath\\$script:configRemoveIScsiHostBusAdapterSendTarget\\\"\n$script:mofFileRemoveIScsiHostBusAdapterStaticTargetPath = \"$script:integrationTestsFolderPath\\$script:configRemoveIScsiHostBusAdapterStaticTarget\\\"\n$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType `\n                -OutputPath $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Address | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetAddress\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetPort\n            $configuration.IScsiHbaName | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.TargetType | Should -Be $script:configurationData.AllNodes.IScsiHbaSendTargetType\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IScsiName | Should -BeNullOrEmpty\n            $configuration.InheritChap | Should -Be (!$script:configurationData.AllNodes.InheritChap)\n            $configuration.ChapType | Should -Be $script:configurationData.AllNodes.ChapTypeRequired\n            $configuration.ChapName | Should -Be $script:configurationData.AllNodes.ChapName\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.InheritMutualChap | Should -Be (!$script:configurationData.AllNodes.InheritMutualChap)\n            $configuration.MutualChapEnabled | Should -Be $script:configurationData.AllNodes.MutualChapEnabled\n            $configuration.MutualChapName | Should -Be $script:configurationData.AllNodes.MutualChapName\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveIScsiHostBusAdapterSendTarget `\n                -OutputPath $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings\" {\n        BeforeAll {\n            # Arrange\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings `\n                -OutputPath $script:mofFileCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettingsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings = @{\n                Path = $script:mofFileCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettingsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType\n            Start-DscConfiguration @startDscConfigurationParametersCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettingsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Address | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetAddress\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetPort\n            $configuration.IScsiHbaName | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.TargetType | Should -Be $script:configurationData.AllNodes.IScsiHbaStaticTargetType\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IScsiName | Should -Be $script:configurationData.AllNodes.IScsiName\n            $configuration.InheritChap | Should -Be $script:configurationData.AllNodes.InheritChap\n            $configuration.ChapType | Should -Be $script:configurationData.AllNodes.ChapTypeRequired\n            $configuration.ChapName | Should -Be $script:configurationData.AllNodes.ChapName\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.InheritMutualChap | Should -Be $script:configurationData.AllNodes.InheritMutualChap\n            $configuration.MutualChapEnabled | Should -Be $script:configurationData.AllNodes.MutualChapEnabled\n            $configuration.MutualChapName | Should -Be $script:configurationData.AllNodes.MutualChapName\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettingsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveIScsiHostBusAdapterStaticTarget `\n                -OutputPath $script:mofFileRemoveIScsiHostBusAdapterStaticTargetPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveIScsiHostBusAdapterStaticTarget = @{\n                Path = $script:mofFileRemoveIScsiHostBusAdapterStaticTargetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveIScsiHostBusAdapterStaticTarget\n            Start-DscConfiguration @startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialState\n\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettingsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveIScsiHostBusAdapterStaticTargetPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType `\n                -OutputPath $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType `\n                -OutputPath $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateIScsiHostBusAdapterSendTargetWithRequiredChapType = @{\n                Path = $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateIScsiHostBusAdapterSendTargetWithRequiredChapType\n            Start-DscConfiguration @startDscConfigurationParametersConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapType }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Address | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetAddress\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetPort\n            $configuration.IScsiHbaName | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.TargetType | Should -Be $script:configurationData.AllNodes.IScsiHbaSendTargetType\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IScsiName | Should -BeNullOrEmpty\n            $configuration.InheritChap | Should -Be (!$script:configurationData.AllNodes.InheritChap)\n            $configuration.ChapType | Should -Be $script:configurationData.AllNodes.ChapTypeProhibited\n            $configuration.ChapName | Should -BeNullOrEmpty\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.InheritMutualChap | Should -Be (!$script:configurationData.AllNodes.InheritMutualChap)\n            $configuration.MutualChapEnabled | Should -Be (!$script:configurationData.AllNodes.MutualChapEnabled)\n            $configuration.MutualChapName | Should -BeNullOrEmpty\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapTypePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveIScsiHostBusAdapterSendTarget `\n                -OutputPath $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileConfigureCHAPSettingsOfIScsiHostBusAdapterSendTargetWithProhibitedChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveIScsiHostBusAdapterSendTarget\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateIScsiHostBusAdapterSendTargetWithRequiredChapType `\n                -OutputPath $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveIScsiHostBusAdapterSendTarget `\n                -OutputPath $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateIScsiHostBusAdapterSendTargetWithRequiredChapType = @{\n                Path = $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveIScsiHostBusAdapterSendTarget = @{\n                Path = $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateIScsiHostBusAdapterSendTargetWithRequiredChapType\n            Start-DscConfiguration @startDscConfigurationParametersRemoveIScsiHostBusAdapterSendTarget\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveIScsiHostBusAdapterSendTarget }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Address | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetAddress\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.IScsiHbaTargetPort\n            $configuration.IScsiHbaName | Should -Be $script:configurationData.AllNodes.IScsiHbaName\n            $configuration.TargetType | Should -Be $script:configurationData.AllNodes.IScsiHbaSendTargetType\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.IScsiName | Should -BeNullOrEmpty\n            $configuration.InheritChap | Should -BeNull\n            $configuration.ChapType | Should -Be 'Unset'\n            $configuration.ChapName | Should -BeNullOrEmpty\n            $configuration.ChapPassword | Should -BeNullOrEmpty\n            $configuration.InheritMutualChap | Should -BeNull\n            $configuration.MutualChapEnabled | Should -BeNull\n            $configuration.MutualChapName | Should -BeNullOrEmpty\n            $configuration.MutualChapPassword | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveIScsiHostBusAdapterSendTargetPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Remove-Item -Path $script:mofFileCreateIScsiHostBusAdapterSendTargetWithRequiredChapTypePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveIScsiHostBusAdapterSendTargetPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction Test-Setup {\n    <#\n    .SYNOPSIS\n\n    Retrieves the name of the iSCSI Host Bus Adapter that is used in the Integration Tests.\n    Retrieves the name of the Physical Network Adapter that is used in the Integration Tests.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n        $script:VMHost = Get-VMHost -Server $script:VIServer -Name $Name\n\n        $script:VMHostStorage = Get-VMHostStorage -Server $script:VIServer -VMHost $script:VMHost\n        if (!$script:VMHostStorage.SoftwareIScsiEnabled) {\n            throw 'The software iSCSI adapter should be enabled.'\n        }\n\n        $script:IscsiHba = Get-VMHostHba -Server $script:VIServer -VMHost $script:VMHost -Type 'iSCSI' |\n                           Select-Object -First 1\n\n        $script:IscsiHbaName = $script:IscsiHba.Device\n\n        $script:VMHostView = Get-View -Server $script:VIServer -Id $script:VMHost.Id -Property 'ConfigManager'\n        $script:IscsiManager = Get-View -Server $script:VIServer -Id $script:VMHostView.ConfigManager.IscsiManager\n\n        $script:PhysicalNicNames = $script:IscsiManager.QueryCandidateNics($script:IscsiHbaName) |\n            Where-Object -FilterScript { $_.VnicDevice -eq [string]::Empty } |\n            Select-Object -First 2 |\n            Select-Object -ExpandProperty PnicDevice\n        if ($script:PhysicalNicNames.Length -lt 2) {\n            throw \"At least two Physical Network Adapters should be available on VMHost $($script:VMHost.Name).\"\n        }\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Get-VMKernelNicNames {\n    <#\n    .SYNOPSIS\n\n    Retrieves the names of the VMKernel Network Adapters that are used in the Integration Tests.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n        $script:VMHost = Get-VMHost -Server $script:VIServer -Name $Name\n\n        $standardSwitchName = $script:configurationData.AllNodes.StandardSwitchName\n\n        $script:StandardSwitch = Get-VirtualSwitch -Server $script:VIServer -Name $standardSwitchName -VMHost $script:VMHost -Standard\n        $script:vmKernelNicNames = Get-VMHostNetworkAdapter -Server $script:VIServer -VirtualSwitch $script:StandardSwitch -VMKernel |\n            Select-Object -ExpandProperty Name\n\n        # Here we need to modify the Configuration Data passed to each Configuration to include the retrieved VMKernel Network Adapter names.\n        $script:configurationData.AllNodes[0].VMKernelNicNames = $script:vmKernelNicNames\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n<#\n    The VMHostIScsiHbaVMKernelNic DSC Resource Integration Tests require a VMHost with at\n    least one iSCSI Host Bus Adapter.\n#>\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:DscResourceName = 'VMHostIScsiHbaVMKernelNic'\n$script:ConfigurationsPath = Join-Path -Path $PSScriptRoot -ChildPath \"$($script:DscResourceName)_Config.ps1\"\n\n. \"$PSScriptRoot\\$script:DscResourceName.Integration.Tests.Helpers.ps1\"\nTest-Setup\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            VMHostName = $Name\n            StandardSwitchDscResourceName = 'StandardSwitch'\n            StandardSwitchDscResourceId = '[StandardSwitch]StandardSwitch'\n            ManagementStandardPortGroupDscResourceName = 'ManagementStandardPortGroup'\n            ManagementStandardPortGroupDscResourceId = '[StandardPortGroup]ManagementStandardPortGroup'\n            VMotionStandardPortGroupDscResourceName = 'VMotionStandardPortGroup'\n            VMotionStandardPortGroupDscResourceId = '[StandardPortGroup]VMotionStandardPortGroup'\n            ManagementVMHostVssNicResourceName = 'ManagementVMHostVssNic'\n            ManagementVMHostVssNicResourceId = '[VMHostVssNic]ManagementVMHostVssNic'\n            VMotionVMHostVssNicResourceName = 'VMotionVMHostVssNic'\n            VMotionVMHostVssNicResourceId = '[VMHostVssNic]VMotionVMHostVssNic'\n            VMHostIScsiHbaVMKernelNicDscResourceName = 'VMHostIScsiHbaVMKernelNic'\n            StandardSwitchName = 'MyTestStandardSwitch'\n            PhysicalNicNames = $script:PhysicalNicNames\n            ManagementStandardPortGroupName = 'MyTestManagementStandardPortGroup'\n            VMotionStandardPortGroupName = 'MyTestvMotionStandardPortGroup'\n            ManagementTrafficEnabled = $true\n            VMotionEnabled = $true\n            IScsiHbaName = $script:IScsiHbaName\n            UnbindVMKernelNicsForce = $true\n        }\n    )\n}\n\n. $script:ConfigurationsPath -Verbose:$true -ErrorAction Stop\n\n$script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsConfigurationName = \"$($script:DscResourceName)_CreateStandardSwitchStandardPortGroupsAndVMKernelNics_Config\"\n$script:BindVMKernelNicsToIscsiHbaConfigurationName = \"$($script:DscResourceName)_BindVMKernelNicsToIscsiHba_Config\"\n$script:UnbindVMKernelNicsToIscsiHbaConfigurationName = \"$($script:DscResourceName)_UnbindVMKernelNicsToIscsiHba_Config\"\n$script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsConfigurationName = \"$($script:DscResourceName)_RemoveStandardSwitchStandardPortGroupsAndVMKernelNics_Config\"\n\n$script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsConfigurationName\n$script:BindVMKernelNicsToIscsiHbaMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:BindVMKernelNicsToIscsiHbaConfigurationName\n$script:UnbindVMKernelNicsToIscsiHbaMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:UnbindVMKernelNicsToIscsiHbaConfigurationName\n$script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsConfigurationName\n\nDescribe \"$($script:DscResourceName)_Integration\" {\n    BeforeAll {\n        # Arrange\n        & $script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsConfigurationName `\n            -OutputPath $script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath `\n            -ConfigurationData $script:ConfigurationData `\n            -ErrorAction Stop\n\n        $startDscConfigurationParamsCreateStandardSwitchStandardPortGroupsAndVMKernelNics = @{\n            Path = $script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath\n            ComputerName = $script:ConfigurationData.AllNodes.NodeName\n            Wait = $true\n            Force = $true\n            Verbose = $true\n            ErrorAction = 'Stop'\n        }\n\n        # Act && Assert\n        { Start-DscConfiguration @startDscConfigurationParamsCreateStandardSwitchStandardPortGroupsAndVMKernelNics } | Should -Not -Throw\n\n        Get-VMKernelNicNames\n    }\n\n    AfterAll {\n        # Arrange\n        & $script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsConfigurationName `\n            -OutputPath $script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath `\n            -ConfigurationData $script:ConfigurationData `\n            -ErrorAction Stop\n\n        $startDscConfigurationParamsRemoveStandardSwitchStandardPortGroupsAndVMKernelNics = @{\n            Path = $script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath\n            ComputerName = $script:ConfigurationData.AllNodes.NodeName\n            Wait = $true\n            Force = $true\n            Verbose = $true\n            ErrorAction = 'Stop'\n        }\n\n        # Act && Assert\n        { Start-DscConfiguration @startDscConfigurationParamsRemoveStandardSwitchStandardPortGroupsAndVMKernelNics } | Should -Not -Throw\n\n        Remove-Item -Path $script:CreateStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath -Recurse -Confirm:$false -ErrorAction Stop\n        Remove-Item -Path $script:RemoveStandardSwitchStandardPortGroupsAndVMKernelNicsMofFilePath -Recurse -Confirm:$false -ErrorAction Stop\n    }\n\n    Context 'When binding VMKernel Network Adapters to iSCSI Host Bus Adapter' {\n        BeforeAll {\n            # Arrange\n            & $script:UnbindVMKernelNicsToIscsiHbaConfigurationName `\n                -OutputPath $script:UnbindVMKernelNicsToIscsiHbaMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsUnbindVMKernelNicsToIscsiHba = @{\n                Path = $script:UnbindVMKernelNicsToIscsiHbaMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsUnbindVMKernelNicsToIscsiHba } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:BindVMKernelNicsToIscsiHbaConfigurationName `\n                    -OutputPath $script:BindVMKernelNicsToIscsiHbaMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsBindVMKernelNicsToIscsiHba = @{\n                    Path = $script:BindVMKernelNicsToIscsiHbaMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsBindVMKernelNicsToIscsiHba } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:BindVMKernelNicsToIscsiHbaMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:BindVMKernelNicsToIscsiHbaMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:BindVMKernelNicsToIscsiHbaConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostIScsiHbaVMKernelNicDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostIScsiHbaVMKernelNicDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostIScsiHbaVMKernelNicDscResource.VMHostName | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostIScsiHbaVMKernelNicDscResource.IScsiHbaName | Should -Be $script:ConfigurationData.AllNodes.IScsiHbaName\n            $VMHostIScsiHbaVMKernelNicDscResource.VMKernelNicNames | Should -Be $script:ConfigurationData.AllNodes.VMKernelNicNames\n            $VMHostIScsiHbaVMKernelNicDscResource.Ensure | Should -Be 'Present'\n            $VMHostIScsiHbaVMKernelNicDscResource.Force | Should -BeNullOrEmpty\n        }\n\n        AfterAll {\n            & $script:UnbindVMKernelNicsToIscsiHbaConfigurationName `\n                -OutputPath $script:UnbindVMKernelNicsToIscsiHbaMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsUnbindVMKernelNicsToIscsiHba = @{\n                Path = $script:UnbindVMKernelNicsToIscsiHbaMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsUnbindVMKernelNicsToIscsiHba } | Should -Not -Throw\n\n            Remove-Item -Path $script:BindVMKernelNicsToIscsiHbaMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:UnbindVMKernelNicsToIscsiHbaMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When unbinding VMKernel Network Adapters from iSCSI Host Bus Adapter' {\n        BeforeAll {\n            # Arrange\n            & $script:BindVMKernelNicsToIscsiHbaConfigurationName `\n                -OutputPath $script:BindVMKernelNicsToIscsiHbaMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsBindVMKernelNicsToIscsiHba = @{\n                Path = $script:BindVMKernelNicsToIscsiHbaMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsBindVMKernelNicsToIscsiHba } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:UnbindVMKernelNicsToIscsiHbaConfigurationName `\n                    -OutputPath $script:UnbindVMKernelNicsToIscsiHbaMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsUnbindVMKernelNicsToIscsiHba = @{\n                    Path = $script:UnbindVMKernelNicsToIscsiHbaMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsUnbindVMKernelNicsToIscsiHba } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:UnbindVMKernelNicsToIscsiHbaMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:UnbindVMKernelNicsToIscsiHbaMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:UnbindVMKernelNicsToIscsiHbaConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostIScsiHbaVMKernelNicDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostIScsiHbaVMKernelNicDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostIScsiHbaVMKernelNicDscResource.VMHostName | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostIScsiHbaVMKernelNicDscResource.IScsiHbaName | Should -Be $script:ConfigurationData.AllNodes.IScsiHbaName\n            $VMHostIScsiHbaVMKernelNicDscResource.VMKernelNicNames | Should -Be $script:ConfigurationData.AllNodes.VMKernelNicNames\n            $VMHostIScsiHbaVMKernelNicDscResource.Ensure | Should -Be 'Absent'\n            $VMHostIScsiHbaVMKernelNicDscResource.Force | Should -Be $script:ConfigurationData.AllNodes.UnbindVMKernelNicsForce\n        }\n\n        AfterAll {\n            Remove-Item -Path $script:BindVMKernelNicsToIscsiHbaMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:UnbindVMKernelNicsToIscsiHbaMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostIScsiHbaVMKernelNic_CreateStandardSwitchStandardPortGroupsAndVMKernelNics_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        StandardSwitch $AllNodes.StandardSwitchDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            NicDevice = @($AllNodes.PhysicalNicNames)\n            ActiveNic = @($AllNodes.PhysicalNicNames)\n        }\n\n        StandardPortGroup $AllNodes.ManagementStandardPortGroupDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ManagementStandardPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            ActiveNic = $AllNodes.PhysicalNicNames[0]\n            DependsOn = $AllNodes.StandardSwitchDscResourceId\n        }\n\n        StandardPortGroup $AllNodes.VMotionStandardPortGroupDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMotionStandardPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Present'\n            ActiveNic = $AllNodes.PhysicalNicNames[1]\n            DependsOn = $AllNodes.StandardSwitchDscResourceId\n        }\n\n        VMHostVssNic $AllNodes.ManagementVMHostVssNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.ManagementStandardPortGroupName\n            Ensure = 'Present'\n            ManagementTrafficEnabled = $AllNodes.ManagementTrafficEnabled\n            DependsOn = $AllNodes.ManagementStandardPortGroupDscResourceId\n        }\n\n        VMHostVssNic $AllNodes.VMotionVMHostVssNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.VMotionStandardPortGroupName\n            Ensure = 'Present'\n            VMotionEnabled = $AllNodes.VMotionEnabled\n            DependsOn = $AllNodes.VMotionStandardPortGroupDscResourceId\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaVMKernelNic_BindVMKernelNicsToIscsiHba_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaVMKernelNic $AllNodes.VMHostIScsiHbaVMKernelNicDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            VMKernelNicNames = $AllNodes.VMKernelNicNames\n            Ensure = 'Present'\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaVMKernelNic_UnbindVMKernelNicsToIscsiHba_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostIScsiHbaVMKernelNic $AllNodes.VMHostIScsiHbaVMKernelNicDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            IScsiHbaName = $AllNodes.IScsiHbaName\n            VMKernelNicNames = $AllNodes.VMKernelNicNames\n            Ensure = 'Absent'\n            Force = $AllNodes.UnbindVMKernelNicsForce\n        }\n    }\n}\n\nConfiguration VMHostIScsiHbaVMKernelNic_RemoveStandardSwitchStandardPortGroupsAndVMKernelNics_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostVssNic $AllNodes.ManagementVMHostVssNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.ManagementStandardPortGroupName\n            Ensure = 'Absent'\n        }\n\n        VMHostVssNic $AllNodes.VMotionVMHostVssNicResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            VssName = $AllNodes.StandardSwitchName\n            PortGroupName = $AllNodes.VMotionStandardPortGroupName\n            Ensure = 'Absent'\n        }\n\n        StandardPortGroup $AllNodes.ManagementStandardPortGroupDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.ManagementStandardPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.ManagementVMHostVssNicResourceId\n        }\n\n        StandardPortGroup $AllNodes.VMotionStandardPortGroupDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.VMotionStandardPortGroupName\n            VssName = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = $AllNodes.VMotionVMHostVssNicResourceId\n        }\n\n        StandardSwitch $AllNodes.StandardSwitchDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            VMHostName = $AllNodes.VMHostName\n            Name = $AllNodes.StandardSwitchName\n            Ensure = 'Absent'\n            DependsOn = @($AllNodes.ManagementStandardPortGroupDscResourceId, $AllNodes.VMotionStandardPortGroupDscResourceId)\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostIPRoute/VMHostIPRoute.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the Default Gateway of the specified VMHost.\n#>\nfunction Get-VMHostDefaultGateway {\n    [CmdletBinding()]\n    [OutputType([string])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $vmHostDefaultGateway = $vmHost.ExtensionData.Config.Network.IpRouteConfig.DefaultGateway\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostDefaultGateway\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostIPRoute/VMHostIPRoute.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostIPRoute.Integration.Tests.Helpers.ps1\"\n$script:vmHostDefaultGateway = Get-VMHostDefaultGateway\n\n$script:dscResourceName = 'VMHostIPRoute'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            VMHostIPRouteResourceName = 'VMHostIPRoute'\n            VMHostDefaultGateway = $script:vmHostDefaultGateway\n            DestinationAddress = '192.168.100.0'\n            PrefixLength = 24\n        }\n    )\n}\n\n$script:configCreateVMHostIPRoute = \"$($script:dscResourceName)_CreateVMHostIPRoute_Config\"\n$script:configRemoveVMHostIPRoute = \"$($script:dscResourceName)_RemoveVMHostIPRoute_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVMHostIPRoutePath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostIPRoute\\\"\n$script:mofFileRemoveVMHostIPRoutePath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostIPRoute\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateVMHostIPRoute\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostIPRoute `\n                -OutputPath $script:mofFileCreateVMHostIPRoutePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostIPRoutePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostIPRoutePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostIPRoute }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Gateway | Should -Be $script:configurationData.AllNodes.VMHostDefaultGateway\n            $configuration.Destination | Should -Be $script:configurationData.AllNodes.DestinationAddress\n            $configuration.PrefixLength | Should -Be $script:configurationData.AllNodes.PrefixLength\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostIPRoutePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostIPRoute `\n                -OutputPath $script:mofFileRemoveVMHostIPRoutePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostIPRoutePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateVMHostIPRoutePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostIPRoutePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVMHostIPRoute\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostIPRoute `\n                -OutputPath $script:mofFileCreateVMHostIPRoutePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostIPRoute `\n                -OutputPath $script:mofFileRemoveVMHostIPRoutePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostIPRoute = @{\n                Path = $script:mofFileCreateVMHostIPRoutePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostIPRoute = @{\n                Path = $script:mofFileRemoveVMHostIPRoutePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostIPRoute\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostIPRoute\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostIPRoutePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVMHostIPRoute }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.Gateway | Should -Be $script:configurationData.AllNodes.VMHostDefaultGateway\n            $configuration.Destination | Should -Be $script:configurationData.AllNodes.DestinationAddress\n            $configuration.PrefixLength | Should -Be $script:configurationData.AllNodes.PrefixLength\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVMHostIPRoutePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange && Act\n            Remove-Item -Path $script:mofFileCreateVMHostIPRoutePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostIPRoutePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNetworkMigration/VMHostNetworkMigration.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the name and the location of the Datacenter where the specified VMHost is located.\nRetrieves one connected Physical Network Adapter and two disconnected Physical Network Adapters from the specified VMHost.\nThe connected Physical Network Adapter should not be part of a Standard Switch which has VMKernel Network Adapter that has\nManagement Traffic enabled.\nIf the criteria is not met, it throws an exception.\n#>\nfunction Invoke-TestSetup {\n    # Data that is going to be passed as Configuration Data in the Integration Tests.\n    $script:datacenterName = $null\n    $script:datacenterLocation = $null\n    $script:physicalNetworkAdapters = @()\n    $script:virtualSwitchesWithPhysicalNics = @{}\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $networkSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.NetworkSystem -ErrorAction Stop\n    $datacenter = Get-Datacenter -Server $viServer -VMHost $vmHost -ErrorAction Stop\n\n    $script:datacenterName = $datacenter.Name\n\n    # If the Parent of the Parent Folder is $null, the Datacenter is located in the Root Folder of the Inventory.\n    if ($null -eq $datacenter.ParentFolder.Parent) {\n        $script:datacenterLocation = [string]::Empty\n    }\n    else {\n        $locationItems = @()\n        $child = $datacenter.ParentFolder\n        $parent = $datacenter.ParentFolder.Parent\n\n        while ($true) {\n            if ($null -eq $parent) {\n                break\n            }\n\n            $locationItems += $child.Name\n            $child = $parent\n            $parent = $parent.Parent\n        }\n\n        # The Parent Folder of the Datacenter should be the last item in the array.\n        [array]::Reverse($locationItems)\n\n        # Folder names for Datacenter Location should be separated by '/'.\n        $script:datacenterLocation = [string]::Join('/', $locationItems)\n    }\n\n    $disconnectedPhysicalNetworkAdapters = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -Physical -ErrorAction Stop |\n                                           Where-Object -FilterScript { $_.BitRatePerSec -eq 0 } |\n                                           Select-Object -First 2\n    if ($disconnectedPhysicalNetworkAdapters.Length -lt 2) {\n        throw 'The Integration Tests require at least two disconnected Physical Network Adapters to be available on the ESXi node.'\n    }\n\n    $script:physicalNetworkAdapters += $disconnectedPhysicalNetworkAdapters[0].Name\n    $script:physicalNetworkAdapters += $disconnectedPhysicalNetworkAdapters[1].Name\n\n    <#\n    Store the initial Standard Switches for every Physical Network Adapter in the Virtual Switches hashtable, so\n    a migration can be performed after the Tests have executed. The Physical Network Adapter will be added again to\n    their initial Standard Switches.\n    #>\n    foreach ($physicalNetworkAdapter in $disconnectedPhysicalNetworkAdapters) {\n        $virtualSwitch = Get-VirtualSwitch -Server $viServer -VMHost $vmHost -ErrorAction Stop | Where-Object { $null -ne $_.Nic -and $_.Nic.Contains($physicalNetworkAdapter.Name) }\n        if ($null -eq $virtualSwitch) {\n            continue\n        }\n\n        $virtualSwitchName = $virtualSwitch.Name\n        $virtualSwitchNicTeamingPolicy = $networkSystem.NetworkConfig.Vswitch |\n                                         Where-Object { $_.Name -eq $virtualSwitch.Name } |\n                                         Select-Object -ExpandProperty Spec |\n                                         Select-Object -ExpandProperty Policy |\n                                         Select-Object -ExpandProperty NicTeaming\n\n        $script:virtualSwitchesWithPhysicalNics.$virtualSwitchName = @{\n            Nic = $virtualSwitch.Nic\n            ActiveNic = $virtualSwitchNicTeamingPolicy.NicOrder.ActiveNic\n            StandbyNic = $virtualSwitchNicTeamingPolicy.NicOrder.StandbyNic\n            CheckBeacon = $virtualSwitchNicTeamingPolicy.FailureCriteria.CheckBeacon\n            NotifySwitches = $virtualSwitchNicTeamingPolicy.NotifySwitches\n            Policy = $virtualSwitchNicTeamingPolicy.Policy\n            RollingOrder = $virtualSwitchNicTeamingPolicy.RollingOrder\n        }\n    }\n\n    $connectedPhysicalNetworkAdapters = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -Physical -ErrorAction Stop |\n                                        Where-Object -FilterScript { $_.BitRatePerSec -ne 0 }\n    if ($connectedPhysicalNetworkAdapters.Length -lt 1) {\n        throw 'The Integration Tests require at least one connected Physical Network Adapter to be available on the ESXi node.'\n    }\n\n    <#\n    Here we retrieve the names of the Port Groups to which VMKernel Network Adapters with Management Traffic enabled are connected.\n    #>\n    $portGroupNamesOfVMKernelsWithManagementTrafficEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VMKernel -ErrorAction Stop |\n                                                             Where-Object { $_.ManagementTrafficEnabled } |\n                                                             Select-Object -ExpandProperty PortGroupName\n\n    <#\n    For connected Physical Network Adapters, we need to retrieve only one of them that meets the following criteria:\n    The Physical Network Adapter should not be part of a Standard Switch or the Physical Network Adapter is part of a Standard Switch\n    that does not have a VMKernel Network Adapter that has Management Traffic enabled.\n    #>\n    foreach ($physicalNetworkAdapter in $connectedPhysicalNetworkAdapters) {\n        $virtualSwitch = Get-VirtualSwitch -Server $viServer -VMHost $vmHost -ErrorAction Stop | Where-Object { $null -ne $_.Nic -and $_.Nic.Contains($physicalNetworkAdapter.Name) }\n        if ($null -eq $virtualSwitch) {\n            $script:physicalNetworkAdapters += $physicalNetworkAdapter.Name\n            break\n        }\n\n        $virtualPortGroups = Get-VirtualPortGroup -Server $viServer -VMHost $vmHost -VirtualSwitch $virtualSwitch -ErrorAction Stop |\n                             Where-Object { $_.VirtualSwitchName -eq $virtualSwitch.Name -and $portGroupNamesOfVMKernelsWithManagementTrafficEnabled.Contains($_.Name) }\n        if ($virtualPortGroups.Length -gt 0) {\n            continue\n        }\n        else {\n            $script:physicalNetworkAdapters += $physicalNetworkAdapter.Name\n            $virtualSwitchName = $virtualSwitch.Name\n            $virtualSwitchNicTeamingPolicy = $networkSystem.NetworkConfig.Vswitch |\n                                         Where-Object { $_.Name -eq $virtualSwitch.Name } |\n                                         Select-Object -ExpandProperty Spec |\n                                         Select-Object -ExpandProperty Policy |\n                                         Select-Object -ExpandProperty NicTeaming\n\n            $script:virtualSwitchesWithPhysicalNics.$virtualSwitchName = @{\n                Nic = $virtualSwitch.Nic\n                ActiveNic = $virtualSwitchNicTeamingPolicy.NicOrder.ActiveNic\n                StandbyNic = $virtualSwitchNicTeamingPolicy.NicOrder.StandbyNic\n                CheckBeacon = $virtualSwitchNicTeamingPolicy.FailureCriteria.CheckBeacon\n                NotifySwitches = $virtualSwitchNicTeamingPolicy.NotifySwitches\n                Policy = $virtualSwitchNicTeamingPolicy.Policy\n                RollingOrder = $virtualSwitchNicTeamingPolicy.RollingOrder\n            }\n\n            break\n        }\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n\n<#\n.DESCRIPTION\n\nCreates two VMKernel Network Adapters on different Distributed Port Groups and on the same Distributed Switch.\n#>\nfunction New-VMKernelNetworkAdaptersOnDistributedSwitch {\n    [CmdletBinding()]\n\n    $distributedSwitchName = $script:configurationData.AllNodes.VDSwitchName\n    $managementPortGroupName = $script:configurationData.AllNodes.ManagementPortGroupName\n    $vMotionPortGroupName = $script:configurationData.AllNodes.VMotionPortGroupName\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $distributedSwitch = Get-VDSwitch -Server $viServer -Name $distributedSwitchName -ErrorAction Stop\n\n    New-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $managementPortGroupName -ManagementTrafficEnabled:$true -ErrorAction Stop\n    New-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $vMotionPortGroupName -VMotionEnabled:$true -ErrorAction Stop\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n\n<#\n.DESCRIPTION\n\nRetrieves the names of the VMKernel Network Adapters connected to Standard Switch used in the Integration Tests.\n#>\nfunction Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch {\n    [CmdletBinding()]\n\n    $standardSwitchName = $script:configurationData.AllNodes.StandardSwitchName\n    $managementPortGroupName = $script:configurationData.AllNodes.ManagementPortGroupName\n    $vMotionPortGroupName = $script:configurationData.AllNodes.VMotionPortGroupName\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $standardSwitch = Get-VirtualSwitch -Server $viServer -VMHost $vmHost -Name $standardSwitchName -ErrorAction Stop\n    $managementPortGroup = Get-VirtualPortGroup -Server $viServer -VMHost $vmHost -Name $managementPortGroupName -ErrorAction Stop\n    $vMotionPortGroup = Get-VirtualPortGroup -Server $viServer -VMHost $vmHost -Name $vMotionPortGroupName -ErrorAction Stop\n\n    $vmKernelNetworkAdapterWithManagementTrafficEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $standardSwitch -PortGroup $managementPortGroup -VMKernel -ErrorAction Stop\n    $vmKernelNetworkAdapterWithvMotionEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $standardSwitch -PortGroup $vMotionPortGroup -VMKernel -ErrorAction Stop\n\n    # Here we need to modify the Configuration Data passed to each Configuration to include the retrieved VMKernel Network Adapter names.\n    $script:configurationData.AllNodes[0].VMKernelNetworkAdapterNames = @($vmKernelNetworkAdapterWithManagementTrafficEnabled.Name, $vmKernelNetworkAdapterWithvMotionEnabled.Name)\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n\n<#\n.DESCRIPTION\n\nRetrieves the names of the VMKernel Network Adapters connected to Distributed Switch used in the Integration Tests.\n#>\nfunction Get-VMKernelNetworkAdapterNamesConnectedToDistributedSwitch {\n    [CmdletBinding()]\n\n    $distributedSwitchName = $script:configurationData.AllNodes.VDSwitchName\n    $managementPortGroupName = $script:configurationData.AllNodes.ManagementPortGroupName\n    $vMotionPortGroupName = $script:configurationData.AllNodes.VMotionPortGroupName\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $distributedSwitch = Get-VDSwitch -Server $viServer -Name $distributedSwitchName -ErrorAction Stop\n    $managementPortGroup = Get-VDPortgroup -Server $viServer -Name $managementPortGroupName -VDSwitch $distributedSwitch -ErrorAction Stop\n    $vMotionPortGroup = Get-VDPortgroup -Server $viServer -Name $vMotionPortGroupName -VDSwitch $distributedSwitch -ErrorAction Stop\n\n    $vmKernelNetworkAdapterWithManagementTrafficEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $managementPortGroup -VMKernel -ErrorAction Stop\n    $vmKernelNetworkAdapterWithvMotionEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $vMotionPortGroup -VMKernel -ErrorAction Stop\n\n    # Here we need to modify the Configuration Data passed to each Configuration to include the retrieved VMKernel Network Adapter names.\n    $script:configurationData.AllNodes[0].VMKernelNetworkAdapterNames = @($vmKernelNetworkAdapterWithManagementTrafficEnabled.Name, $vmKernelNetworkAdapterWithvMotionEnabled.Name)\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n\n<#\n.DESCRIPTION\n\nRetrieves the names of the Port Groups of the VMKernel Network Adapters used in the Integration Tests.\nWhen no Port Group names are passed to the VMHostVssMigration DSC Resource, for every passed VMKernel Network Adapter\na new Port Group with VMKernel prefix is created and the VMKernel Network Adapter is connected to it.\n#>\nfunction Get-PortGroupNamesWithVMKernelPrefix {\n    [CmdletBinding()]\n\n    $standardSwitchName = $script:configurationData.AllNodes.StandardSwitchName\n    $vmKernelNetworkAdapterWithManagementTrafficEnabledName = $script:configurationData.AllNodes.VMKernelNetworkAdapterNames[0]\n    $vmKernelNetworkAdapterWithvMotionEnabledName = $script:configurationData.AllNodes.VMKernelNetworkAdapterNames[1]\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $standardSwitch = Get-VirtualSwitch -Server $viServer -VMHost $vmHost -Name $standardSwitchName -ErrorAction Stop\n\n    $vmKernelNetworkAdapterWithManagementTrafficEnabled = Get-VMHostNetworkAdapter -Server $viServer -Name $vmKernelNetworkAdapterWithManagementTrafficEnabledName -VMHost $vmHost -VirtualSwitch $standardSwitch -VMKernel -ErrorAction Stop\n    $vmKernelNetworkAdapterWithvMotionEnabled = Get-VMHostNetworkAdapter -Server $viServer -Name $vmKernelNetworkAdapterWithvMotionEnabledName -VMHost $vmHost -VirtualSwitch $standardSwitch -VMKernel -ErrorAction Stop\n\n    # Here we need to modify the Configuration Data passed to each Configuration to include the retrieved Port Group names with VMKernel prefix.\n    $script:configurationData.AllNodes[0].PortGroupNamesWithVMKernelPrefix = @($vmKernelNetworkAdapterWithManagementTrafficEnabled.PortGroupName, $vmKernelNetworkAdapterWithvMotionEnabled.PortGroupName)\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n\n<#\n.DESCRIPTION\n\nRemoves VMKernel Network Adapters connected to the same Distributed Port Group.\n#>\nfunction Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToTheSamePortGroup {\n    [CmdletBinding()]\n\n    $distributedSwitchName = $script:configurationData.AllNodes.VDSwitchName\n    $portGroupName = $script:configurationData.AllNodes.PortGroupName\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $distributedSwitch = Get-VDSwitch -Server $viServer -Name $distributedSwitchName -ErrorAction Stop\n    $portGroup = Get-VDPortgroup -Server $viServer -Name $portGroupName -VDSwitch $distributedSwitch -ErrorAction Stop\n\n    $vmKernelNetworkAdapters = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $portGroup -VMKernel -ErrorAction Stop\n    $vmKernelNetworkAdapters | Remove-VMHostNetworkAdapter -Confirm:$false -ErrorAction Stop\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n\n<#\n.DESCRIPTION\n\nRemoves VMKernel Network Adapters connected to different Distributed Port Groups on the same Distributed Switch.\n#>\nfunction Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToDifferentPortGroups {\n    [CmdletBinding()]\n\n    $distributedSwitchName = $script:configurationData.AllNodes.VDSwitchName\n    $managementPortGroupName = $script:configurationData.AllNodes.ManagementPortGroupName\n    $vMotionPortGroupName = $script:configurationData.AllNodes.VMotionPortGroupName\n\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $distributedSwitch = Get-VDSwitch -Server $viServer -Name $distributedSwitchName -ErrorAction Stop\n    $managementPortGroup = Get-VDPortgroup -Server $viServer -Name $managementPortGroupName -VDSwitch $distributedSwitch -ErrorAction Stop\n    $vMotionPortGroup = Get-VDPortgroup -Server $viServer -Name $vMotionPortGroupName -VDSwitch $distributedSwitch -ErrorAction Stop\n\n    $vmKernelNetworkAdapterWithManagementTrafficEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $managementPortGroup -VMKernel -ErrorAction Stop\n    $vmKernelNetworkAdapterWithvMotionEnabled = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VirtualSwitch $distributedSwitch -PortGroup $vMotionPortGroup -VMKernel -ErrorAction Stop\n\n    $vmKernelNetworkAdapterWithManagementTrafficEnabled | Remove-VMHostNetworkAdapter -Confirm:$false -ErrorAction Stop\n    $vmKernelNetworkAdapterWithvMotionEnabled | Remove-VMHostNetworkAdapter -Confirm:$false -ErrorAction Stop\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNetworkMigration/VMHostVDSwitchMigration.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n. \"$PSScriptRoot\\VMHostNetworkMigration.Integration.Tests.Helpers.ps1\"\nInvoke-TestSetup\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVDSwitchMigration'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostVssResourceName = 'VMHostVss'\n            VMHostVssResourceId = '[VMHostVss]VMHostVss'\n            VMHostVssPortGroupResourceName = 'VMHostVssPortGroup'\n            VMHostVssPortGroupResourceId = '[VMHostVssPortGroup]VMHostVssPortGroup'\n            VDSwitchResourceName = 'VDSwitch'\n            VDSwitchResourceId = '[VDSwitch]VDSwitch'\n            VDSwitchVMHostResourceName = 'VDSwitchVMHost'\n            VMHostVssMigrationResourceName = 'VMHostVssMigration'\n            VMHostVDSwitchMigrationResourceName = 'VMHostVDSwitchMigration'\n            VMHostVssBridgeResourceName = 'VMHostVssBridge'\n            VMHostVssTeamingResourceName = 'VMHostVssTeaming'\n            VMHostVssManagementNicResourceName = 'VMHostVssManagementNic'\n            VMHostVssvMotionNicResourceName = 'VMHostVssvMotionNic'\n            StandardSwitchName = 'MyTestStandardSwitch'\n            VDSwitchName = 'MyTestVDSwitch'\n            VDSwitchLocation = [string]::Empty\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocation\n            PhysicalNetworkAdapterNames = $script:physicalNetworkAdapters\n            VirtualSwitches = $script:virtualSwitchesWithPhysicalNics\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            PortGroupName = 'Management Network'\n            PortGroupVLanId = 4094\n            ManagementPortGroupName = 'MyManagementPortGroup'\n            VMotionPortGroupName = 'MyvMotionPortGroup'\n            ManagementTrafficEnabled = $true\n            VMotionEnabled = $true\n            MigratePhysicalNicsOnly = $true\n        }\n    )\n}\n\n$script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = \"$($script:dscResourceName)_CreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch_Config\"\n$script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = \"$($script:dscResourceName)_CreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter_Config\"\n$script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch = \"$($script:dscResourceName)_MigrateThreePhysicalNetworkAdaptersToStandardSwitch_Config\"\n$script:configMigrateOneDisconnectedPhysicalNetworkAdapter = \"$($script:dscResourceName)_MigrateOneDisconnectedPhysicalNetworkAdapter_Config\"\n$script:configMigrateTwoDisconnectedPhysicalNetworkAdapters = \"$($script:dscResourceName)_MigrateTwoDisconnectedPhysicalNetworkAdapters_Config\"\n$script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters = \"$($script:dscResourceName)_MigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters_Config\"\n$script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup = \"$($script:dscResourceName)_MigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup_Config\"\n$script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups = \"$($script:dscResourceName)_MigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups_Config\"\n$script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup = \"$($script:dscResourceName)_MigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup_Config\"\n$script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups = \"$($script:dscResourceName)_MigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups_Config\"\n$script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup = \"$($script:dscResourceName)_MigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup_Config\"\n$script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups = \"$($script:dscResourceName)_MigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups_Config\"\n$script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup = \"$($script:dscResourceName)_RemoveVDSwitchStandardSwitchAndStandardPortGroup_Config\"\n$script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = \"$($script:dscResourceName)_MigratePhysicalNetworkAdaptersToInitialVirtualSwitches_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath = \"$script:integrationTestsFolderPath\\$script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\\\"\n$script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath = \"$script:integrationTestsFolderPath\\$script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\\\"\n$script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch\\\"\n$script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterPath = \"$script:integrationTestsFolderPath\\$script:configMigrateOneDisconnectedPhysicalNetworkAdapter\\\"\n$script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersPath = \"$script:integrationTestsFolderPath\\$script:configMigrateTwoDisconnectedPhysicalNetworkAdapters\\\"\n$script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersPath = \"$script:integrationTestsFolderPath\\$script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters\\\"\n$script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupPath = \"$script:integrationTestsFolderPath\\$script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup\\\"\n$script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath = \"$script:integrationTestsFolderPath\\$script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups\\\"\n$script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath = \"$script:integrationTestsFolderPath\\$script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup\\\"\n$script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath = \"$script:integrationTestsFolderPath\\$script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups\\\"\n$script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath = \"$script:integrationTestsFolderPath\\$script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup\\\"\n$script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath = \"$script:integrationTestsFolderPath\\$script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups\\\"\n$script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup\\\"\n$script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath = \"$script:integrationTestsFolderPath\\$script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configMigrateOneDisconnectedPhysicalNetworkAdapter\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateOneDisconnectedPhysicalNetworkAdapter `\n                -OutputPath $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateOneDisconnectedPhysicalNetworkAdapter = @{\n                Path = $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateOneDisconnectedPhysicalNetworkAdapter\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateOneDisconnectedPhysicalNetworkAdapter }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[0]\n            $configuration.VMKernelNicNames | Should -Be @()\n            $configuration.PortGroupNames | Should -Be @()\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateTwoDisconnectedPhysicalNetworkAdapters\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateTwoDisconnectedPhysicalNetworkAdapters `\n                -OutputPath $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateTwoDisconnectedPhysicalNetworkAdapters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateTwoDisconnectedPhysicalNetworkAdapters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateTwoDisconnectedPhysicalNetworkAdapters }\n\n            # Assert\n            # The Physical Network Adapters for a Distributed Switch are sorted by name on the Server.\n            $expectedPhysicalNetworkAdapterNames = @(\n                $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[0],\n                $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[1]\n            ) | Sort-Object\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $expectedPhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be @()\n            $configuration.PortGroupNames | Should -Be @()\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters `\n                -OutputPath $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdapters }\n\n            # Assert\n            # The Physical Network Adapters for a Distributed Switch are sorted by name on the Server.\n            $expectedPhysicalNetworkAdapterNames = $script:configurationData.AllNodes.PhysicalNetworkAdapterNames | Sort-Object\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $expectedPhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be @()\n            $configuration.PortGroupNames | Should -Be @()\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = @{\n                Path = $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch\n\n            & $script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup `\n                -OutputPath $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup = @{\n                Path = $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be @($script:configurationData.AllNodes.PhysicalNetworkAdapterNames[0])\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.PortGroupName, $script:configurationData.AllNodes.PortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToTheSamePortGroup\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = @{\n                Path = $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch\n\n            & $script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups `\n                -OutputPath $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups = @{\n                Path = $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroups }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be @($script:configurationData.AllNodes.PhysicalNetworkAdapterNames[0])\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.ManagementPortGroupName, $script:configurationData.AllNodes.VMotionPortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToDifferentPortGroups\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = @{\n                Path = $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch\n\n            & $script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup `\n                -OutputPath $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup = @{\n                Path = $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup }\n\n            # Assert\n            # The Physical Network Adapters for a Distributed Switch are sorted by name on the Server.\n            $expectedPhysicalNetworkAdapterNames = @(\n                $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[0],\n                $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[1]\n            ) | Sort-Object\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $expectedPhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.PortGroupName, $script:configurationData.AllNodes.PortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToTheSamePortGroup\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = @{\n                Path = $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch\n\n            & $script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups `\n                -OutputPath $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups = @{\n                Path = $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups }\n\n            # Assert\n            # The Physical Network Adapters for a Distributed Switch are sorted by name on the Server.\n            $expectedPhysicalNetworkAdapterNames = @(\n                $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[0],\n                $script:configurationData.AllNodes.PhysicalNetworkAdapterNames[1]\n            ) | Sort-Object\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $expectedPhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.ManagementPortGroupName, $script:configurationData.AllNodes.VMotionPortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToDifferentPortGroups\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = @{\n                Path = $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch\n\n            & $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup `\n                -OutputPath $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup = @{\n                Path = $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroup }\n\n            # Assert\n            # The Physical Network Adapters for a Distributed Switch are sorted by name on the Server.\n            $expectedPhysicalNetworkAdapterNames = $script:configurationData.AllNodes.PhysicalNetworkAdapterNames | Sort-Object\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $expectedPhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.PortGroupName, $script:configurationData.AllNodes.PortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToTheSamePortGroup\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter = @{\n                Path = $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToStandardSwitch\n\n            & $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups `\n                -OutputPath $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups = @{\n                Path = $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroups }\n\n            # Assert\n            # The Physical Network Adapters for a Distributed Switch are sorted by name on the Server.\n            $expectedPhysicalNetworkAdapterNames = $script:configurationData.AllNodes.PhysicalNetworkAdapterNames | Sort-Object\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VdsName | Should -Be $script:configurationData.AllNodes.VDSwitchName\n            $configuration.PhysicalNicNames | Should -Be $expectedPhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.ManagementPortGroupName, $script:configurationData.AllNodes.VMotionPortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchStandardSwitchAndStandardPortGroup `\n                -OutputPath $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup = @{\n                Path = $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Remove-ManagementAndvMotionVMKernelNetworkAdaptersConnectedToDifferentPortGroups\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchStandardSwitchAndStandardPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateStandardSwitchStandardPortGroupVDSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateManagementVMKernelNetworkAdapterAndvMotionVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateTwoDisconnectedAndOneConnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchStandardSwitchAndStandardPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNetworkMigration/VMHostVssMigration.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n. \"$PSScriptRoot\\VMHostNetworkMigration.Integration.Tests.Helpers.ps1\"\nInvoke-TestSetup\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVssMigration'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VDSwitchResourceName = 'VDSwitch'\n            VDSwitchResourceId = '[VDSwitch]VDSwitch'\n            ManagementVDPortGroupResourceName = 'ManagementVDPortGroup'\n            ManagementStandardPortGroupResourceName = 'ManagementStandardPortGroup'\n            ManagementStandardPortGroupResourceId = '[VMHostVssPortGroup]ManagementStandardPortGroup'\n            VMotionVDPortGroupResourceName = 'VMotionVDPortGroup'\n            VMotionStandardPortGroupResourceName = 'VMotionStandardPortGroup'\n            VMotionStandardPortGroupResourceId = '[VMHostVssPortGroup]VMotionStandardPortGroup'\n            VMHostVssResourceName = 'VMHostVss'\n            VDSwitchVMHostResourceName = 'VDSwitchVMHost'\n            VMHostVDSwitchMigrationResourceName = 'VMHostVDSwitchMigration'\n            VMHostVssMigrationResourceName = 'VMHostVssMigration'\n            VMHostVssManagementNicResourceName = 'VMHostVssManagementNic'\n            VMHostVssvMotionNicResourceName = 'VMHostVssvMotionNic'\n            VMHostVssBridgeResourceName = 'VMHostVssBridge'\n            VMHostVssTeamingResourceName = 'VMHostVssTeaming'\n            VDSwitchName = 'MyTestVDSwitch'\n            VDSwitchLocation = [string]::Empty\n            DatacenterName = $script:datacenterName\n            DatacenterLocation = $script:datacenterLocation\n            ManagementPortGroupName = 'MyManagementPortGroup'\n            VMotionPortGroupName = 'MyvMotionPortGroup'\n            StandardSwitchName = 'MyTestStandardSwitch'\n            PhysicalNetworkAdapterNames = $script:physicalNetworkAdapters\n            VirtualSwitches = $script:virtualSwitchesWithPhysicalNics\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n        }\n    )\n}\n\n$script:configCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch = \"$($script:dscResourceName)_CreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch_Config\"\n$script:configMigrateThreePhysicalNetworkAdaptersToDistributedSwitch = \"$($script:dscResourceName)_MigrateThreePhysicalNetworkAdaptersToDistributedSwitch_Config\"\n$script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch = \"$($script:dscResourceName)_MigrateThreePhysicalNetworkAdaptersToStandardSwitch_Config\"\n$script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch = \"$($script:dscResourceName)_MigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch_Config\"\n$script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch = \"$($script:dscResourceName)_MigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch_Config\"\n$script:configRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch = \"$($script:dscResourceName)_RemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch_Config\"\n$script:configRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch = \"$($script:dscResourceName)_RemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch_Config\"\n$script:configRemoveVDSwitchAndStandardSwitch = \"$($script:dscResourceName)_RemoveVDSwitchAndStandardSwitch_Config\"\n$script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = \"$($script:dscResourceName)_MigratePhysicalNetworkAdaptersToInitialVirtualSwitches_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath = \"$script:integrationTestsFolderPath\\$script:configCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch\\\"\n$script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath = \"$script:integrationTestsFolderPath\\$script:configMigrateThreePhysicalNetworkAdaptersToDistributedSwitch\\\"\n$script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch\\\"\n$script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch\\\"\n$script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch\\\"\n$script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch\\\"\n$script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch\\\"\n$script:mofFileRemoveVDSwitchAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVDSwitchAndStandardSwitch\\\"\n$script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath = \"$script:integrationTestsFolderPath\\$script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToDistributedSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToDistributedSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToDistributedSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToStandardSwitch\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateThreePhysicalNetworkAdaptersToStandardSwitch }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PhysicalNicNames | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be @()\n            $configuration.PortGroupNames | Should -Be @()\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVDSwitchAndStandardSwitch `\n                -OutputPath $script:mofFileRemoveVDSwitchAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVDSwitchAndStandardSwitch = @{\n                Path = $script:mofFileRemoveVDSwitchAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateThreePhysicalNetworkAdaptersToStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToDistributedSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToDistributedSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch\n\n            New-VMKernelNetworkAdaptersOnDistributedSwitch\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToDistributedSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToDistributedSwitch\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch\n\n            Get-PortGroupNamesWithVMKernelPrefix\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitch }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PhysicalNicNames | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be $script:configurationData.AllNodes.PortGroupNamesWithVMKernelPrefix\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch `\n                -OutputPath $script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVDSwitchAndStandardSwitch `\n                -OutputPath $script:mofFileRemoveVDSwitchAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch = @{\n                Path = $script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVDSwitchAndStandardSwitch = @{\n                Path = $script:mofFileRemoveVDSwitchAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersToStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersWithPortGroupsWithVMKernelPrefixFromStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch `\n                -OutputPath $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersToDistributedSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch = @{\n                Path = $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToDistributedSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitch\n\n            New-VMKernelNetworkAdaptersOnDistributedSwitch\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersToDistributedSwitch\n\n            Get-VMKernelNetworkAdapterNamesConnectedToDistributedSwitch\n\n            & $script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch `\n                -OutputPath $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            Start-DscConfiguration @startDscConfigurationParametersMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitch }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PhysicalNicNames | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapterNames\n            $configuration.VMKernelNicNames | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterNames\n            $configuration.PortGroupNames | Should -Be @($script:configurationData.AllNodes.ManagementPortGroupName, $script:configurationData.AllNodes.VMotionPortGroupName)\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitchPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch `\n                -OutputPath $script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVDSwitchAndStandardSwitch `\n                -OutputPath $script:mofFileRemoveVDSwitchAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMigratePhysicalNetworkAdaptersToInitialVirtualSwitches `\n                -OutputPath $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch = @{\n                Path = $script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVDSwitchAndStandardSwitch = @{\n                Path = $script:mofFileRemoveVDSwitchAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches = @{\n                Path = $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVDSwitchAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersMigratePhysicalNetworkAdaptersToInitialVirtualSwitches\n\n            Remove-Item -Path $script:mofFileCreateVDSwitchTwoVDPortGroupsStandardSwitchAndAddVMHostToVDSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateThreePhysicalNetworkAdaptersToDistributedSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigrateThreePhysicalNetworkAdaptersAndTwoVMKernelNetworkAdaptersWithPortGroupsToStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveManagementAndvMotionVMKernelNetworkAdaptersFromStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVDSwitchAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMigratePhysicalNetworkAdaptersToInitialVirtualSwitchesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNic/VMHostPhysicalNic.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n<#\nRetrieves one Physical Network Adapter from the specified VMHost.\nIf there are no Physical Network Adapters on the VMHost, it throws an exception.\n#>\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $physicalNetworkAdapter = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -Physical -ErrorAction Stop | Select-Object -First 1\n\n    if ($null -eq $physicalNetworkAdapter) {\n        throw \"No Physical Network Adapters available on the VMHost and the Integration Tests require at least 1 Physical Network Adapter to be available on the ESXi node.\"\n    }\n\n    $script:physicalNic = $physicalNetworkAdapter.Name\n}\n\nInvoke-TestSetup\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostPhysicalNic'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            PhysicalNetworkAdapterResourceName = 'VMHostPhysicalNetworkAdapter'\n            PhysicalNetworkAdapter = $script:physicalNic\n            FullDuplex = 'Full'\n            HalfDuplex = 'Half'\n            FullDuplexBitRatePerSecMb = 100\n            HalfDuplexBitRatePerSecMb = 10\n            DefaultBitRatePerSecMb = 1000\n            AutoNegotiate = $true\n        }\n    )\n}\n\n$script:configWhenSpeedAndDuplexSettingsAreConfiguredAutomatically = \"$($script:dscResourceName)_WhenSpeedAndDuplexSettingsAreConfiguredAutomatically_Config\"\n$script:configWhenAutoNegotiateIsNotSpecified = \"$($script:dscResourceName)_WhenAutoNegotiateIsNotSpecified_Config\"\n$script:configWhenAutoNegotiateIsSetToFalse = \"$($script:dscResourceName)_WhenAutoNegotiateIsSetToFalse_Config\"\n$script:configWhenAutoNegotiateIsSetToTrue = \"$($script:dscResourceName)_WhenAutoNegotiateIsSetToTrue_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath = \"$script:integrationTestsFolderPath\\$script:configWhenSpeedAndDuplexSettingsAreConfiguredAutomatically\\\"\n$script:mofFileWhenAutoNegotiateIsNotSpecifiedPath = \"$script:integrationTestsFolderPath\\$script:configWhenAutoNegotiateIsNotSpecified\\\"\n$script:mofFileWhenAutoNegotiateIsSetToFalsePath = \"$script:integrationTestsFolderPath\\$script:configWhenAutoNegotiateIsSetToFalse\\\"\n$script:mofFileWhenAutoNegotiateIsSetToTruePath = \"$script:integrationTestsFolderPath\\$script:configWhenAutoNegotiateIsSetToTrue\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $script:configWhenAutoNegotiateIsNotSpecified\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAutoNegotiateIsNotSpecified `\n                    -OutputPath $script:mofFileWhenAutoNegotiateIsNotSpecifiedPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAutoNegotiateIsNotSpecifiedPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n                Start-Sleep -Seconds 15\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAutoNegotiateIsNotSpecifiedPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAutoNegotiateIsNotSpecified }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n                $configuration.Name | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapter\n                $configuration.Duplex | Should -Be $script:configurationData.AllNodes.FullDuplex\n                $configuration.BitRatePerSecMb | Should -Be $script:configurationData.AllNodes.FullDuplexBitRatePerSecMb\n                $configuration.AutoNegotiate | Should -BeNullOrEmpty\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenAutoNegotiateIsNotSpecifiedPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenSpeedAndDuplexSettingsAreConfiguredAutomatically `\n                    -OutputPath $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n                Start-Sleep -Seconds 15\n\n                Remove-Item -Path $script:mofFileWhenAutoNegotiateIsNotSpecifiedPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n\n        Context \"When using configuration $script:configWhenAutoNegotiateIsSetToFalse\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAutoNegotiateIsSetToFalse `\n                    -OutputPath $script:mofFileWhenAutoNegotiateIsSetToFalsePath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAutoNegotiateIsSetToFalsePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n                Start-Sleep -Seconds 15\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAutoNegotiateIsSetToFalsePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAutoNegotiateIsSetToFalse }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n                $configuration.Name | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapter\n                $configuration.Duplex | Should -Be $script:configurationData.AllNodes.HalfDuplex\n                $configuration.BitRatePerSecMb | Should -Be $script:configurationData.AllNodes.HalfDuplexBitRatePerSecMb\n                $configuration.AutoNegotiate | Should -Be $false\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenAutoNegotiateIsSetToFalsePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenSpeedAndDuplexSettingsAreConfiguredAutomatically `\n                    -OutputPath $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n                Start-Sleep -Seconds 15\n\n                Remove-Item -Path $script:mofFileWhenAutoNegotiateIsSetToFalsePath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n\n        Context \"When using configuration $script:configWhenAutoNegotiateIsSetToTrue\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAutoNegotiateIsSetToTrue `\n                    -OutputPath $script:mofFileWhenAutoNegotiateIsSetToTruePath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAutoNegotiateIsSetToTruePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n                Start-Sleep -Seconds 15\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenAutoNegotiateIsSetToTruePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAutoNegotiateIsSetToTrue }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n                $configuration.Name | Should -Be $script:configurationData.AllNodes.PhysicalNetworkAdapter\n                $configuration.Duplex | Should -Be $script:configurationData.AllNodes.FullDuplex\n                $configuration.BitRatePerSecMb | Should -Be $script:configurationData.AllNodes.DefaultBitRatePerSecMb\n                $configuration.AutoNegotiate | Should -Be $script:configurationData.AllNodes.AutoNegotiate\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenAutoNegotiateIsSetToTruePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenSpeedAndDuplexSettingsAreConfiguredAutomatically `\n                    -OutputPath $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n                Start-Sleep -Seconds 15\n\n                Remove-Item -Path $script:mofFileWhenAutoNegotiateIsSetToTruePath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenSpeedAndDuplexSettingsAreConfiguredAutomaticallyPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction Test-Setup {\n    <#\n    .SYNOPSIS\n\n    Creates a new VDSwitch in the Datacenter of the retrieved VMHost.\n    Creates a new VDPortGroup in the VDSwitch.\n    Moves the VMHost to the VDSwitch.\n    Creates a new VMKernel NIC connected to the VDPortGroup.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n\n        $script:VMHost = Get-VMHost -Server $script:VIServer | Select-Object -First 1\n        if ($null -eq $script:VMHost) {\n            throw \"Could not find a VMHost on vCenter Server $Server.\"\n        }\n\n        $script:Datacenter = Get-Datacenter -Server $script:VIServer -VMHost $script:VMHost\n\n        $newVDSwitchParams = @{\n            Server = $script:VIServer\n            Name = 'DscVDSwitch'\n            Location = $script:Datacenter\n        }\n        $script:VDSwitch = New-VDSwitch @newVDSwitchParams\n\n        $newVDPortGroupParams = @{\n            Server = $script:VIServer\n            Name = 'DscVDPortGroup'\n            VDSwitch = $script:VDSwitch\n        }\n        $script:VDPortGroup = New-VDPortgroup @newVDPortGroupParams\n\n        $addVDSwitchVMHostParams = @{\n            Server = $script:VIServer\n            VDSwitch = $script:VDSwitch\n            VMHost = $script:VMHost\n        }\n        Add-VDSwitchVMHost @addVDSwitchVMHostParams\n\n        $newVMHostNetworkAdapterParams = @{\n            Server = $script:VIServer\n            VMHost = $script:VMHost\n            VirtualSwitch = $script:VDSwitch\n            PortGroup = $script:VDPortGroup\n        }\n        $script:VMKernelNic = New-VMHostNetworkAdapter @newVMHostNetworkAdapterParams\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Test-CleanUp {\n    <#\n    .SYNOPSIS\n\n    Moves the retrieved VMHost to its' original location.\n    Removes the VDSwitch from the Datacenter of the retrieved VMHost.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n\n        $moveVMHostParams = @{\n            Server = $script:VIServer\n            VMHost = $script:VMHost\n            Destination = $script:VMHost.Parent\n            Confirm = $false\n        }\n        Move-VMHost @moveVMHostParams\n\n        $removeVDSwitchParams = @{\n            Server = $script:VIServer\n            VDSwitch = $script:VDSwitch\n            Confirm = $false\n        }\n        Remove-VDSwitch @removeVDSwitchParams\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter()]\n    [string]\n    $Name\n)\n\n<#\n    The VMHostVdsNic DSC Resource Integration Tests require a vCenter Server with at\n    least one Datacenter and at least one VMHost located in that Datacenter.\n#>\n\n# The 'Name' parameter is not used in the Integration Tests, so it is set to $null.\n$Name = $null\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:DscResourceName = 'VMHostVdsNic'\n$script:ConfigurationsPath = Join-Path -Path $PSScriptRoot -ChildPath \"$($script:DscResourceName)_Config.ps1\"\n\n. \"$PSScriptRoot\\$script:DscResourceName.Integration.Tests.Helpers.ps1\"\nTest-Setup\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            VMHostVdsNicDscResourceName = 'VMHostVdsNic'\n            VMHostName = $script:VMHost.Name\n            VDSwitchName = $script:VDSwitch.Name\n            VDPortGroupName = $script:VDPortGroup.Name\n            VMKernelNicName = $script:VMKernelNic.Name\n            IP = '10.23.112.245'\n            SubnetMask = '255.255.255.0'\n            Mtu = 4000\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n        }\n    )\n}\n\n. $script:ConfigurationsPath -Verbose:$true -ErrorAction Stop\n\n$script:EnableVMotionAndVsanTrafficConfigurationName = \"$($script:DscResourceName)_EnableVMotionAndVsanTraffic_Config\"\n$script:UpdateIPSubnetMaskAndMTUConfigurationName = \"$($script:DscResourceName)_UpdateIPSubnetMaskAndMTU_Config\"\n$script:RemoveVMKernelNicConfigurationName = \"$($script:DscResourceName)_RemoveVMKernelNic_Config\"\n\n$script:EnableVMotionAndVsanTrafficMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:EnableVMotionAndVsanTrafficConfigurationName\n$script:UpdateIPSubnetMaskAndMTUMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:UpdateIPSubnetMaskAndMTUConfigurationName\n$script:RemoveVMKernelNicMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:RemoveVMKernelNicConfigurationName\n\nDescribe \"$($script:DscResourceName)_Integration\" {\n    AfterAll {\n        # Arrange\n        & $script:RemoveVMKernelNicConfigurationName `\n            -OutputPath $script:RemoveVMKernelNicMofFilePath `\n            -ConfigurationData $script:ConfigurationData `\n            -ErrorAction Stop\n\n        $startDscConfigurationParamsRemoveVMKernelNic = @{\n            Path = $script:RemoveVMKernelNicMofFilePath\n            ComputerName = $script:ConfigurationData.AllNodes.NodeName\n            Wait = $true\n            Force = $true\n            Verbose = $true\n            ErrorAction = 'Stop'\n        }\n\n        # Act && Assert\n        { Start-DscConfiguration @startDscConfigurationParamsRemoveVMKernelNic } | Should -Not -Throw\n        Test-CleanUp\n\n        Remove-Item -Path $script:RemoveVMKernelNicMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n    }\n\n    Context 'When enabling VMotion and Vsan traffic' {\n        BeforeAll {\n            # Arrange\n            & $script:EnableVMotionAndVsanTrafficConfigurationName `\n                -OutputPath $script:EnableVMotionAndVsanTrafficMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsEnableVMotionAndVsanTraffic = @{\n                Path = $script:EnableVMotionAndVsanTrafficMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsEnableVMotionAndVsanTraffic } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:EnableVMotionAndVsanTrafficConfigurationName `\n                    -OutputPath $script:EnableVMotionAndVsanTrafficMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsEnableVMotionAndVsanTraffic = @{\n                    Path = $script:EnableVMotionAndVsanTrafficMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsEnableVMotionAndVsanTraffic } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:EnableVMotionAndVsanTrafficMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:EnableVMotionAndVsanTrafficMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:EnableVMotionAndVsanTrafficConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostVdsNicDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostVdsNicDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostVdsNicDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.VMKernelNicName\n            $VMHostVdsNicDscResource.VMHostName | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostVdsNicDscResource.VdsName | Should -Be $script:ConfigurationData.AllNodes.VDSwitchName\n            $VMHostVdsNicDscResource.PortGroupName | Should -Be $script:ConfigurationData.AllNodes.VDPortGroupName\n            $VMHostVdsNicDscResource.Ensure | Should -Be 'Present'\n            $VMHostVdsNicDscResource.VMotionEnabled | Should -Be $script:ConfigurationData.AllNodes.VMotionEnabled\n            $VMHostVdsNicDscResource.VsanTrafficEnabled | Should -Be $script:ConfigurationData.AllNodes.VsanTrafficEnabled\n        }\n\n        AfterAll {\n            Remove-Item -Path $script:EnableVMotionAndVsanTrafficMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When updating the IP address, Subnet mask and MTU size' {\n        BeforeAll {\n            # Arrange\n            & $script:UpdateIPSubnetMaskAndMTUConfigurationName `\n                -OutputPath $script:UpdateIPSubnetMaskAndMTUMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsUpdateIPSubnetMaskAndMTU = @{\n                Path = $script:UpdateIPSubnetMaskAndMTUMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsUpdateIPSubnetMaskAndMTU } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:UpdateIPSubnetMaskAndMTUConfigurationName `\n                    -OutputPath $script:UpdateIPSubnetMaskAndMTUMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsUpdateIPSubnetMaskAndMTU = @{\n                    Path = $script:UpdateIPSubnetMaskAndMTUMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsUpdateIPSubnetMaskAndMTU } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:UpdateIPSubnetMaskAndMTUMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:UpdateIPSubnetMaskAndMTUMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:UpdateIPSubnetMaskAndMTUConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostVdsNicDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostVdsNicDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostVdsNicDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.VMKernelNicName\n            $VMHostVdsNicDscResource.VMHostName | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostVdsNicDscResource.VdsName | Should -Be $script:ConfigurationData.AllNodes.VDSwitchName\n            $VMHostVdsNicDscResource.PortGroupName | Should -Be $script:ConfigurationData.AllNodes.VDPortGroupName\n            $VMHostVdsNicDscResource.Ensure | Should -Be 'Present'\n            $VMHostVdsNicDscResource.IP | Should -Be $script:ConfigurationData.AllNodes.IP\n            $VMHostVdsNicDscResource.SubnetMask | Should -Be $script:ConfigurationData.AllNodes.SubnetMask\n            $VMHostVdsNicDscResource.Mtu | Should -Be $script:ConfigurationData.AllNodes.Mtu\n        }\n\n        AfterAll {\n            Remove-Item -Path $script:UpdateIPSubnetMaskAndMTUMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When removing the VMKernel NIC' {\n        BeforeAll {\n            # Arrange\n            & $script:RemoveVMKernelNicConfigurationName `\n                -OutputPath $script:RemoveVMKernelNicMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsRemoveVMKernelNic = @{\n                Path = $script:RemoveVMKernelNicMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsRemoveVMKernelNic } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:RemoveVMKernelNicConfigurationName `\n                    -OutputPath $script:RemoveVMKernelNicMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsRemoveVMKernelNic = @{\n                    Path = $script:RemoveVMKernelNicMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsRemoveVMKernelNic } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:RemoveVMKernelNicMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:RemoveVMKernelNicMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:RemoveVMKernelNicConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostVdsNicDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostVdsNicDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostVdsNicDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.VMKernelNicName\n            $VMHostVdsNicDscResource.VMHostName | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostVdsNicDscResource.VdsName | Should -Be $script:ConfigurationData.AllNodes.VDSwitchName\n            $VMHostVdsNicDscResource.PortGroupName | Should -Be $script:ConfigurationData.AllNodes.VDPortGroupName\n            $VMHostVdsNicDscResource.Ensure | Should -Be 'Absent'\n        }\n\n        AfterAll {\n            Remove-Item -Path $script:RemoveVMKernelNicMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostVdsNic_EnableVMotionAndVsanTraffic_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVdsNic $AllNodes.VMHostVdsNicDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMKernelNicName\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PortGroupName = $AllNodes.VDPortGroupName\n            Ensure = 'Present'\n            VMotionEnabled = $AllNodes.VMotionEnabled\n            VsanTrafficEnabled = $AllNodes.VsanTrafficEnabled\n        }\n    }\n}\n\nConfiguration VMHostVdsNic_UpdateIPSubnetMaskAndMTU_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVdsNic $AllNodes.VMHostVdsNicDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMKernelNicName\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PortGroupName = $AllNodes.VDPortGroupName\n            Ensure = 'Present'\n            IP = $AllNodes.IP\n            SubnetMask = $AllNodes.SubnetMask\n            Mtu = $AllNodes.Mtu\n        }\n    }\n}\n\nConfiguration VMHostVdsNic_RemoveVMKernelNic_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        VMHostVdsNic $AllNodes.VMHostVdsNicDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMKernelNicName\n            VMHostName = $AllNodes.VMHostName\n            VdsName = $AllNodes.VDSwitchName\n            PortGroupName = $AllNodes.VDPortGroupName\n            Ensure = 'Absent'\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostNic/VMHostVssNic.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVssNic'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            StandardSwitchResourceName = 'StandardSwitch'\n            StandardSwitchResourceId = '[VMHostVss]StandardSwitch'\n            VirtualPortGroupResourceName = 'VirtualPortGroup'\n            VirtualPortGroupResourceId = '[VMHostVssPortGroup]VirtualPortGroup'\n            StandardSwitchNetworkAdapterResourceName = 'StandardSwitchNetworkAdapter'\n            StandardSwitchNetworkAdapterResourceId = '[VMHostVssNic]StandardSwitchNetworkAdapter'\n            StandardSwitchName = 'MyStandardSwitch'\n            StandardSwitchMtu = 1500\n            PortGroup = 'MyVirtualPortGroup'\n            IP1 = '192.168.0.1'\n            IP2 = '10.23.123.234'\n            DefaultIP = '0.0.0.0'\n            SubnetMask1 = '255.255.255.0'\n            SubnetMask2 = '255.255.254.0'\n            DefaultSubnetMask = '0.0.0.0'\n            Mac = '00:50:56:63:5b:0e'\n            AutomaticIPv6 = $true\n            IPv6 = @('fe80::250:56ff:fe63:5b0e/64', '200:2342::1/32')\n            DefaultIPv6 = @('fe80::250:56ff:fe63:5b0e/64')\n            IPv6ThroughDhcp = $true\n            VMKernelNetworkAdapterMtu = 4000\n            VMKernelNetworkAdapterUpdatedMtu = 5000\n            ManagementTrafficEnabled = $true\n            FaultToleranceLoggingEnabled = $true\n            VMotionEnabled = $true\n            VsanTrafficEnabled = $true\n            Dhcp = $true\n            IPv6Enabled = $true\n        }\n    )\n}\n\n$script:configWhenAddingVMKernelNetworkAdapter = \"$($script:dscResourceName)_WhenAddingVMKernelNetworkAdapter_Config\"\n$script:configWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices = \"$($script:dscResourceName)_WhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices_Config\"\n$script:configWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask = \"$($script:dscResourceName)_WhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask_Config\"\n$script:configWhenUpdatingVMKernelNetworkAdapterIPv6Settings = \"$($script:dscResourceName)_WhenUpdatingVMKernelNetworkAdapterIPv6Settings_Config\"\n$script:configWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6 = \"$($script:dscResourceName)_WhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6_Config\"\n$script:configWhenRemovingVMKernelNetworkAdapter = \"$($script:dscResourceName)_WhenRemovingVMKernelNetworkAdapter_Config\"\n$script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch = \"$($script:dscResourceName)_WhenRemovingVMKernelNetworkAdapterAndStandardSwitch_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingVMKernelNetworkAdapterPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingVMKernelNetworkAdapter\\\"\n$script:mofFileWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServicesPath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices\\\"\n$script:mofFileWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMaskPath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask\\\"\n$script:mofFileWhenUpdatingVMKernelNetworkAdapterIPv6SettingsPath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingVMKernelNetworkAdapterIPv6Settings\\\"\n$script:mofFileWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6Path = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6\\\"\n$script:mofFileWhenRemovingVMKernelNetworkAdapterPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingVMKernelNetworkAdapter\\\"\n$script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configWhenAddingVMKernelNetworkAdapter\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenAddingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAddingVMKernelNetworkAdapter }\n\n            $standardSwitchResource = $configuration | Where-Object { $_.ResourceId -eq $script:configurationData.AllNodes.StandardSwitchResourceId }\n            $standardSwitchNetworkAdapterResource = $configuration | Where-Object { $_.ResourceId -eq $script:configurationData.AllNodes.StandardSwitchNetworkAdapterResourceId }\n\n            # Assert\n            $standardSwitchResource.Server | Should -Be $script:configurationData.AllNodes.Server\n            $standardSwitchResource.Name | Should -Be $script:configurationData.AllNodes.Name\n            $standardSwitchResource.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $standardSwitchResource.Ensure | Should -Be 'Present'\n            $standardSwitchResource.Mtu | Should -Be $script:configurationData.AllNodes.StandardSwitchMtu\n\n            $standardSwitchNetworkAdapterResource.Server | Should -Be $script:configurationData.AllNodes.Server\n            $standardSwitchNetworkAdapterResource.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $standardSwitchNetworkAdapterResource.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $standardSwitchNetworkAdapterResource.PortGroupName | Should -Be $script:configurationData.AllNodes.PortGroup\n            $standardSwitchNetworkAdapterResource.Ensure | Should -Be 'Present'\n            $standardSwitchNetworkAdapterResource.IP | Should -Be $script:configurationData.AllNodes.IP1\n            $standardSwitchNetworkAdapterResource.SubnetMask | Should -Be $script:configurationData.AllNodes.SubnetMask1\n            $standardSwitchNetworkAdapterResource.Mac | Should -Be $script:configurationData.AllNodes.Mac\n            $standardSwitchNetworkAdapterResource.AutomaticIPv6 | Should -Be $script:configurationData.AllNodes.AutomaticIPv6\n            $standardSwitchNetworkAdapterResource.IPv6 | Should -Be $script:configurationData.AllNodes.IPv6\n            $standardSwitchNetworkAdapterResource.IPv6ThroughDhcp | Should -Be $script:configurationData.AllNodes.IPv6ThroughDhcp\n            $standardSwitchNetworkAdapterResource.Mtu | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterMtu\n            $standardSwitchNetworkAdapterResource.ManagementTrafficEnabled | Should -Be $script:configurationData.AllNodes.ManagementTrafficEnabled\n            $standardSwitchNetworkAdapterResource.FaultToleranceLoggingEnabled | Should -Be $script:configurationData.AllNodes.FaultToleranceLoggingEnabled\n            $standardSwitchNetworkAdapterResource.VMotionEnabled | Should -Be $script:configurationData.AllNodes.VMotionEnabled\n            $standardSwitchNetworkAdapterResource.VsanTrafficEnabled | Should -Be $script:configurationData.AllNodes.VsanTrafficEnabled\n            $standardSwitchNetworkAdapterResource.Dhcp | Should -Be $false\n            $standardSwitchNetworkAdapterResource.IPv6Enabled | Should -Be $script:configurationData.AllNodes.IPv6Enabled\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenAddingVMKernelNetworkAdapterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:configurationData.AllNodes.StandardSwitchNetworkAdapterResourceName) should depend on Resource $($script:configurationData.AllNodes.StandardSwitchResourceName)\" {\n            # Arrange && Act\n            $standardSwitchNetworkAdapterResource = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript {\n                $_.ConfigurationName -eq $script:configWhenAddingVMKernelNetworkAdapter -and `\n                $_.ResourceId -eq $script:configurationData.AllNodes.StandardSwitchNetworkAdapterResourceId\n            }\n\n            # Assert\n            $standardSwitchNetworkAdapterResource.DependsOn | Should -Be $script:configurationData.AllNodes.StandardSwitchResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenAddingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices `\n                -OutputPath $script:mofFileWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServicesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServicesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServicesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServices }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PortGroupName | Should -Be $script:configurationData.AllNodes.PortGroup\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IP | Should -Be $script:configurationData.AllNodes.IP1\n            $configuration.SubnetMask | Should -Be $script:configurationData.AllNodes.SubnetMask1\n            $configuration.Mac | Should -Be $script:configurationData.AllNodes.Mac\n            $configuration.AutomaticIPv6 | Should -Be $script:configurationData.AllNodes.AutomaticIPv6\n            $configuration.IPv6 | Should -Be $script:configurationData.AllNodes.IPv6\n            $configuration.IPv6ThroughDhcp | Should -Be $script:configurationData.AllNodes.IPv6ThroughDhcp\n            $configuration.Mtu | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterUpdatedMtu\n            $configuration.ManagementTrafficEnabled | Should -Be $false\n            $configuration.FaultToleranceLoggingEnabled | Should -Be $false\n            $configuration.VMotionEnabled | Should -Be $false\n            $configuration.VsanTrafficEnabled | Should -Be $false\n            $configuration.Dhcp | Should -Be $false\n            $configuration.IPv6Enabled | Should -Be $script:configurationData.AllNodes.IPv6Enabled\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServicesPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingVMKernelNetworkAdapterMtuAndAvailableServicesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenAddingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask `\n                -OutputPath $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMaskPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMaskPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMaskPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMask }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PortGroupName | Should -Be $script:configurationData.AllNodes.PortGroup\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IP | Should -Be $script:configurationData.AllNodes.IP2\n            $configuration.SubnetMask | Should -Be $script:configurationData.AllNodes.SubnetMask2\n            $configuration.Mac | Should -Be $script:configurationData.AllNodes.Mac\n            $configuration.AutomaticIPv6 | Should -Be $script:configurationData.AllNodes.AutomaticIPv6\n            $configuration.IPv6 | Should -Be $script:configurationData.AllNodes.IPv6\n            $configuration.IPv6ThroughDhcp | Should -Be $script:configurationData.AllNodes.IPv6ThroughDhcp\n            $configuration.Mtu | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterMtu\n            $configuration.ManagementTrafficEnabled | Should -Be $script:configurationData.AllNodes.ManagementTrafficEnabled\n            $configuration.FaultToleranceLoggingEnabled | Should -Be $script:configurationData.AllNodes.FaultToleranceLoggingEnabled\n            $configuration.VMotionEnabled | Should -Be $script:configurationData.AllNodes.VMotionEnabled\n            $configuration.VsanTrafficEnabled | Should -Be $script:configurationData.AllNodes.VsanTrafficEnabled\n            $configuration.Dhcp | Should -Be $false\n            $configuration.IPv6Enabled | Should -Be $script:configurationData.AllNodes.IPv6Enabled\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMaskPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPAndSubnetMaskPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingVMKernelNetworkAdapterIPv6Settings\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenAddingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingVMKernelNetworkAdapterIPv6Settings `\n                -OutputPath $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPv6SettingsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterIPv6Settings = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPv6SettingsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterIPv6Settings\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPv6SettingsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingVMKernelNetworkAdapterIPv6Settings }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PortGroupName | Should -Be $script:configurationData.AllNodes.PortGroup\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IP | Should -Be $script:configurationData.AllNodes.IP1\n            $configuration.SubnetMask | Should -Be $script:configurationData.AllNodes.SubnetMask1\n            $configuration.Mac | Should -Be $script:configurationData.AllNodes.Mac\n            $configuration.AutomaticIPv6 | Should -Be $false\n            $configuration.IPv6 | Should -Be $script:configurationData.AllNodes.DefaultIPv6\n            $configuration.IPv6ThroughDhcp | Should -Be $false\n            $configuration.Mtu | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterMtu\n            $configuration.ManagementTrafficEnabled | Should -Be $script:configurationData.AllNodes.ManagementTrafficEnabled\n            $configuration.FaultToleranceLoggingEnabled | Should -Be $script:configurationData.AllNodes.FaultToleranceLoggingEnabled\n            $configuration.VMotionEnabled | Should -Be $script:configurationData.AllNodes.VMotionEnabled\n            $configuration.VsanTrafficEnabled | Should -Be $script:configurationData.AllNodes.VsanTrafficEnabled\n            $configuration.Dhcp | Should -Be $false\n            $configuration.IPv6Enabled | Should -Be $false\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingVMKernelNetworkAdapterIPv6SettingsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingVMKernelNetworkAdapterIPv6SettingsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenAddingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6 `\n                -OutputPath $script:mofFileWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6Path `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6 = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6Path\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6\n\n            <#\n            IP and SubnetMask values on the server are not updated instantly so we\n            need to suspend the activity before the execution of the tests begins.\n            #>\n            Start-Sleep -Seconds 30\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6Path\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6 }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PortGroupName | Should -Be $script:configurationData.AllNodes.PortGroup\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.IP | Should -Be $script:configurationData.AllNodes.DefaultIP\n            $configuration.SubnetMask | Should -Be $script:configurationData.AllNodes.DefaultSubnetMask\n            $configuration.Mac | Should -Be $script:configurationData.AllNodes.Mac\n            $configuration.AutomaticIPv6 | Should -Be $false\n            $configuration.IPv6 | Should -Be $script:configurationData.AllNodes.DefaultIPv6\n            $configuration.IPv6ThroughDhcp | Should -Be $false\n            $configuration.Mtu | Should -Be $script:configurationData.AllNodes.VMKernelNetworkAdapterMtu\n            $configuration.ManagementTrafficEnabled | Should -Be $script:configurationData.AllNodes.ManagementTrafficEnabled\n            $configuration.FaultToleranceLoggingEnabled | Should -Be $script:configurationData.AllNodes.FaultToleranceLoggingEnabled\n            $configuration.VMotionEnabled | Should -Be $script:configurationData.AllNodes.VMotionEnabled\n            $configuration.VsanTrafficEnabled | Should -Be $script:configurationData.AllNodes.VsanTrafficEnabled\n            $configuration.Dhcp | Should -Be $script:configurationData.AllNodes.Dhcp\n            $configuration.IPv6Enabled | Should -Be $false\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6Path\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingVMKernelNetworkAdapterDhcpAndIPv6Path -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenRemovingVMKernelNetworkAdapter\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenAddingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenRemovingVMKernelNetworkAdapter `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter = @{\n                Path = $script:mofFileWhenAddingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenRemovingVMKernelNetworkAdapter = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVMKernelNetworkAdapter\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingVMKernelNetworkAdapter\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenRemovingVMKernelNetworkAdapter }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.PortGroupName | Should -Be $script:configurationData.AllNodes.PortGroup\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.IP | Should -BeNullOrEmpty\n            $configuration.SubnetMask | Should -BeNullOrEmpty\n            $configuration.Mac | Should -BeNullOrEmpty\n            $configuration.AutomaticIPv6 | Should -BeNullOrEmpty\n            $configuration.IPv6 | Should -BeNullOrEmpty\n            $configuration.IPv6ThroughDhcp | Should -BeNullOrEmpty\n            $configuration.Mtu | Should -BeNullOrEmpty\n            $configuration.ManagementTrafficEnabled | Should -BeNullOrEmpty\n            $configuration.FaultToleranceLoggingEnabled | Should -BeNullOrEmpty\n            $configuration.VMotionEnabled | Should -BeNullOrEmpty\n            $configuration.VsanTrafficEnabled | Should -BeNullOrEmpty\n            $configuration.Dhcp | Should -BeNullOrEmpty\n            $configuration.IPv6Enabled | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenRemovingVMKernelNetworkAdapterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVMKernelNetworkAdapterAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVMKernelNetworkAdapterAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroup.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVssPortGroup'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            StandardSwitchResourceName = 'StandardSwitch'\n            VirtualPortGroupResourceName = 'VirtualPortGroup'\n            VirtualPortGroupResourceId = '[VMHostVssPortGroup]VirtualPortGroup'\n            StandardSwitchName = 'MyStandardSwitch'\n            Mtu = 1500\n            VirtualPortGroupName = 'MyVirtualPortGroup'\n            VLanId = 1\n            DefaultVLanId = 0\n        }\n    )\n}\n\n$script:configWhenAddingVirtualStandardSwitch = \"$($script:dscResourceName)_WhenAddingVirtualStandardSwitch_Config\"\n$script:configWhenAddingVirtualPortGroup = \"$($script:dscResourceName)_WhenAddingVirtualPortGroup_Config\"\n$script:configWhenAddingVirtualPortGroupWithVLanId = \"$($script:dscResourceName)_WhenAddingVirtualPortGroupWithVLanId_Config\"\n$script:configWhenUpdatingVirtualPortGroup = \"$($script:dscResourceName)_WhenUpdatingVirtualPortGroup_Config\"\n$script:configWhenRemovingVirtualPortGroup = \"$($script:dscResourceName)_WhenRemovingVirtualPortGroup_Config\"\n$script:configWhenRemovingVirtualPortGroupAndVirtualStandardSwitch = \"$($script:dscResourceName)_WhenRemovingVirtualPortGroupAndVirtualStandardSwitch_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingVirtualStandardSwitchPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingVirtualStandardSwitch)\\\"\n$script:mofFileWhenAddingVirtualPortGroupPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingVirtualPortGroup)\\\"\n$script:mofFileWhenAddingVirtualPortGroupWithVLanIdPath = \"$script:integrationTestsFolderPath\\$($script:configWhenAddingVirtualPortGroupWithVLanId)\\\"\n$script:mofFileWhenUpdatingVirtualPortGroupPath = \"$script:integrationTestsFolderPath\\$($script:configWhenUpdatingVirtualPortGroup)\\\"\n$script:mofFileWhenRemovingVirtualPortGroupPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingVirtualPortGroup)\\\"\n$script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath = \"$script:integrationTestsFolderPath\\$($script:configWhenRemovingVirtualPortGroupAndVirtualStandardSwitch)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenAddingVirtualPortGroup)\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenAddingVirtualPortGroup `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroup = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAddingVirtualPortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.DefaultVLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenAddingVirtualPortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenAddingVirtualPortGroupWithVLanId)\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenAddingVirtualPortGroupWithVLanId `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupWithVLanIdPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroupWithVLanId = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupWithVLanIdPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupWithVLanId\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupWithVLanIdPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenAddingVirtualPortGroupWithVLanId }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.DefaultVLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenAddingVirtualPortGroupWithVLanIdPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupWithVLanIdPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenUpdatingVirtualPortGroup)\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenAddingVirtualPortGroup `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingVirtualPortGroup `\n                -OutputPath $script:mofFileWhenUpdatingVirtualPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroup = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingVirtualPortGroup = @{\n                Path = $script:mofFileWhenUpdatingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingVirtualPortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingVirtualPortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.VLanId | Should -Be $script:configurationData.AllNodes.VLanId\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingVirtualPortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingVirtualPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenRemovingVirtualPortGroup)\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenAddingVirtualPortGroup `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenRemovingVirtualPortGroup `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroup = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenRemovingVirtualPortGroup = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroup\n            Start-DscConfiguration @startDscConfigurationParametersWhenRemovingVirtualPortGroup\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenRemovingVirtualPortGroup }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.VLanId | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenRemovingVirtualPortGroupPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndVirtualStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndVirtualStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroupSecurity.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVssPortGroupSecurity'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            StandardSwitchResourceName = 'StandardSwitch'\n            StandardSwitchResourceId = '[VMHostVss]StandardSwitch'\n            StandardSwitchSecurityPolicyResourceName = 'StandardSwitchSecurityPolicy'\n            StandardSwitchSecurityPolicyResourceId = '[VMHostVssSecurity]StandardSwitchSecurityPolicy'\n            VirtualPortGroupResourceName = 'VirtualPortGroup'\n            VirtualPortGroupResourceId = '[VMHostVssPortGroup]VirtualPortGroup'\n            VirtualPortGroupSecurityPolicyResourceName = 'VirtualPortGroupSecurityPolicy'\n            VirtualPortGroupSecurityPolicyResourceId = '[VMHostVssPortGroupSecurity]VirtualPortGroupSecurityPolicy'\n            StandardSwitchName = 'MyStandardSwitch'\n            StandardSwitchMtu = 1500\n            VirtualPortGroupName = 'MyVirtualPortGroup'\n            VlanId = 0\n            AllowPromiscuous = $true\n            AllowPromiscuousInherited = $false\n            ForgedTransmits = $true\n            ForgedTransmitsInherited = $false\n            MacChanges = $true\n            MacChangesInherited = $false\n        }\n    )\n}\n\n$script:configWhenAddingVirtualPortGroupAndStandardSwitch = \"$($script:dscResourceName)_WhenAddingVirtualPortGroupAndStandardSwitch_Config\"\n$script:configWhenUpdatingSecurityPolicyWithoutInheritSettings = \"$($script:dscResourceName)_WhenUpdatingSecurityPolicyWithoutInheritSettings_Config\"\n$script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse = \"$($script:dscResourceName)_WhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse_Config\"\n$script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue = \"$($script:dscResourceName)_WhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue_Config\"\n$script:configWhenRemovingVirtualPortGroupAndStandardSwitch = \"$($script:dscResourceName)_WhenRemovingVirtualPortGroupAndStandardSwitch_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingVirtualPortGroupAndStandardSwitch\\\"\n$script:mofFileWhenUpdatingSecurityPolicyWithoutInheritSettingsPath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingSecurityPolicyWithoutInheritSettings\\\"\n$script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalsePath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse\\\"\n$script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToTruePath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue\\\"\n$script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingVirtualPortGroupAndStandardSwitch\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configWhenUpdatingSecurityPolicyWithoutInheritSettings\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingSecurityPolicyWithoutInheritSettings `\n                -OutputPath $script:mofFileWhenUpdatingSecurityPolicyWithoutInheritSettingsPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingSecurityPolicyWithoutInheritSettings = @{\n                Path = $script:mofFileWhenUpdatingSecurityPolicyWithoutInheritSettingsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingSecurityPolicyWithoutInheritSettings\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingSecurityPolicyWithoutInheritSettingsPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingSecurityPolicyWithoutInheritSettings }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.AllowPromiscuous | Should -Be $script:configurationData.AllNodes.AllowPromiscuous\n            $configuration.AllowPromiscuousInherited | Should -Be $script:configurationData.AllNodes.AllowPromiscuousInherited\n            $configuration.ForgedTransmits | Should -Be $script:configurationData.AllNodes.ForgedTransmits\n            $configuration.ForgedTransmitsInherited | Should -Be $script:configurationData.AllNodes.ForgedTransmitsInherited\n            $configuration.MacChanges | Should -Be $script:configurationData.AllNodes.MacChanges\n            $configuration.MacChangesInherited | Should -Be $script:configurationData.AllNodes.MacChangesInherited\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingSecurityPolicyWithoutInheritSettingsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingSecurityPolicyWithoutInheritSettingsPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse `\n                -OutputPath $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalsePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse = @{\n                Path = $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalsePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalsePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalse }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.AllowPromiscuous | Should -Be $script:configurationData.AllNodes.AllowPromiscuous\n            $configuration.AllowPromiscuousInherited | Should -Be $script:configurationData.AllNodes.AllowPromiscuousInherited\n            $configuration.ForgedTransmits | Should -Be $script:configurationData.AllNodes.ForgedTransmits\n            $configuration.ForgedTransmitsInherited | Should -Be $script:configurationData.AllNodes.ForgedTransmitsInherited\n            $configuration.MacChanges | Should -Be $script:configurationData.AllNodes.MacChanges\n            $configuration.MacChangesInherited | Should -Be $script:configurationData.AllNodes.MacChangesInherited\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalsePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToFalsePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue `\n                -OutputPath $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToTruePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue = @{\n                Path = $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToTruePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToTruePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue }\n\n            $standardSwitchSecurityPolicyResource = $configuration | Where-Object { $_.ResourceId -eq $script:configurationData.AllNodes.StandardSwitchSecurityPolicyResourceId }\n            $virtualPortGroupSecurityPolicyResource = $configuration | Where-Object { $_.ResourceId -eq $script:configurationData.AllNodes.VirtualPortGroupSecurityPolicyResourceId }\n\n            $standardSwitchSecurityPolicyResource.Server | Should -Be $script:configurationData.AllNodes.Server\n            $standardSwitchSecurityPolicyResource.Name | Should -Be $script:configurationData.AllNodes.Name\n            $standardSwitchSecurityPolicyResource.VssName | Should -Be $script:configurationData.AllNodes.StandardSwitchName\n            $standardSwitchSecurityPolicyResource.Ensure | Should -Be 'Present'\n            $standardSwitchSecurityPolicyResource.AllowPromiscuous | Should -Be $script:configurationData.AllNodes.AllowPromiscuous\n            $standardSwitchSecurityPolicyResource.ForgedTransmits | Should -Be $false\n            $standardSwitchSecurityPolicyResource.MacChanges | Should -Be $false\n\n            # Assert\n            $virtualPortGroupSecurityPolicyResource.Server | Should -Be $script:configurationData.AllNodes.Server\n            $virtualPortGroupSecurityPolicyResource.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $virtualPortGroupSecurityPolicyResource.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $virtualPortGroupSecurityPolicyResource.Ensure | Should -Be 'Present'\n            $virtualPortGroupSecurityPolicyResource.AllowPromiscuous | Should -Be $script:configurationData.AllNodes.AllowPromiscuous\n            $virtualPortGroupSecurityPolicyResource.AllowPromiscuousInherited | Should -Be $true\n            $virtualPortGroupSecurityPolicyResource.ForgedTransmits | Should -Be $false\n            $virtualPortGroupSecurityPolicyResource.ForgedTransmitsInherited | Should -Be $true\n            $virtualPortGroupSecurityPolicyResource.MacChanges | Should -Be $false\n            $virtualPortGroupSecurityPolicyResource.MacChangesInherited | Should -Be $true\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToTruePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        It \"Should have the following dependency: Resource $($script:configurationData.AllNodes.VirtualPortGroupSecurityPolicyResourceName) should depend on Resource $($script:configurationData.AllNodes.StandardSwitchSecurityPolicyResourceName)\" {\n            # Arrange && Act\n            $virtualPortGroupSecurityPolicyResource = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript {\n                $_.ConfigurationName -eq $script:configWhenUpdatingSecurityPolicyWithInheritSettingsSetToTrue -and `\n                $_.ResourceId -eq $script:configurationData.AllNodes.VirtualPortGroupSecurityPolicyResourceId\n            }\n\n            # Assert\n            $virtualPortGroupSecurityPolicyResource.DependsOn | Should -Be $script:configurationData.AllNodes.StandardSwitchSecurityPolicyResourceId\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingSecurityPolicyWithInheritSettingsSetToTruePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroupShaping.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVssPortGroupShaping'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            StandardSwitchResourceName = 'StandardSwitch'\n            StandardSwitchResourceId = '[VMHostVss]StandardSwitch'\n            VirtualPortGroupResourceName = 'VirtualPortGroup'\n            VirtualPortGroupResourceId = '[VMHostVssPortGroup]VirtualPortGroup'\n            VirtualPortGroupShapingPolicyResourceName = 'VirtualPortGroupShapingPolicy'\n            VirtualPortGroupShapingPolicyResourceId = '[VMHostVssPortGroupShaping]VirtualPortGroupShapingPolicy'\n            StandardSwitchName = 'MyStandardSwitch'\n            Mtu = 1500\n            VirtualPortGroupName = 'MyVirtualPortGroup'\n            VlanId = 0\n            ShapingEnabled = $true\n            AverageBandwidth = 104857600000\n            PeakBandwidth = 104857600000\n            BurstSize = 107374182400\n        }\n    )\n}\n\n$script:configWhenAddingVirtualPortGroupAndStandardSwitch = \"$($script:dscResourceName)_WhenAddingVirtualPortGroupAndStandardSwitch_Config\"\n$script:configWhenUpdatingShapingPolicyWithEnabledSetToTrue = \"$($script:dscResourceName)_WhenUpdatingShapingPolicyWithEnabledSetToTrue_Config\"\n$script:configWhenUpdatingShapingPolicyWithEnabledSetToFalse = \"$($script:dscResourceName)_WhenUpdatingShapingPolicyWithEnabledSetToFalse_Config\"\n$script:configWhenRemovingVirtualPortGroupAndStandardSwitch = \"$($script:dscResourceName)_WhenRemovingVirtualPortGroupAndStandardSwitch_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingVirtualPortGroupAndStandardSwitch\\\"\n$script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToTruePath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingShapingPolicyWithEnabledSetToTrue\\\"\n$script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToFalsePath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingShapingPolicyWithEnabledSetToFalse\\\"\n$script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingVirtualPortGroupAndStandardSwitch\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configWhenUpdatingShapingPolicyWithEnabledSetToTrue\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingShapingPolicyWithEnabledSetToTrue `\n                -OutputPath $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToTruePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingShapingPolicyWithEnabledSetToTrue = @{\n                Path = $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToTruePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingShapingPolicyWithEnabledSetToTrue\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToTruePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingShapingPolicyWithEnabledSetToTrue }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Enabled | Should -Be $script:configurationData.AllNodes.ShapingEnabled\n            $configuration.AverageBandwidth | Should -Be $script:configurationData.AllNodes.AverageBandwidth\n            $configuration.PeakBandwidth | Should -Be $script:configurationData.AllNodes.PeakBandwidth\n            $configuration.BurstSize | Should -Be $script:configurationData.AllNodes.BurstSize\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToTruePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToTruePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configWhenUpdatingShapingPolicyWithEnabledSetToFalse\" {\n        BeforeAll {\n            # Arrange\n            & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configWhenUpdatingShapingPolicyWithEnabledSetToFalse `\n                -OutputPath $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToFalsePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWhenUpdatingShapingPolicyWithEnabledSetToFalse = @{\n                Path = $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToFalsePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n            Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingShapingPolicyWithEnabledSetToFalse\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToFalsePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingShapingPolicyWithEnabledSetToFalse }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Enabled | Should -Be $false\n            $configuration.AverageBandwidth | Should -BeNullOrEmpty\n            $configuration.PeakBandwidth | Should -BeNullOrEmpty\n            $configuration.BurstSize | Should -Be $script:configurationData.AllNodes.BurstSize\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToFalsePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenUpdatingShapingPolicyWithEnabledSetToFalsePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroupTeaming.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n<#\nRetrieves the Physical Nics that are not used by a Standard Switch from the specified VMHost.\nIf there are no available unused Physical Nics on the VMHost, it throws an exception.\n#>\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password -ErrorAction Stop\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop\n    $standardSwitches = Get-VirtualSwitch -Server $viServer -VMHost $vmHost -Standard -ErrorAction Stop\n    $physicalNetworkAdapters = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -Physical -ErrorAction Stop\n\n    $availablePhysicalNetworkAdapters = @()\n\n    foreach ($physicalNetworkAdapter in $physicalNetworkAdapters) {\n        $isPhysicalNicUsed = $false\n\n        foreach ($standardSwitch in $standardSwitches) {\n            $physicalNetworkAdapterExists = $standardSwitch.Nic | Where-Object -FilterScript { $_ -eq $physicalNetworkAdapter.Name }\n            if ($null -ne $physicalNetworkAdapterExists) {\n                $isPhysicalNicUsed = $true\n                break\n            }\n        }\n\n        if (!$isPhysicalNicUsed) {\n            $availablePhysicalNetworkAdapters += $physicalNetworkAdapter\n        }\n    }\n\n    if ($availablePhysicalNetworkAdapters.Length -lt 2) {\n        throw \"The Standard Switch that is used in the Integration Tests requires 2 unused Physical Network Adapters to be available on the ESXi node.\"\n    }\n\n    $script:physicalNic1 = $availablePhysicalNetworkAdapters[0].Name\n    $script:physicalNic2 = $availablePhysicalNetworkAdapters[1].Name\n}\n\nInvoke-TestSetup\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostVssPortGroupTeaming'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            Name = $Name\n            StandardSwitchResourceName = 'StandardSwitch'\n            StandardSwitchResourceId = '[VMHostVss]StandardSwitch'\n            StandardSwitchBridgeResourceName = 'StandardSwitchBridge'\n            StandardSwitchBridgeResourceId = '[VMHostVssBridge]StandardSwitchBridge'\n            StandardSwitchTeamingPolicyResourceName = 'StandardSwitchTeamingPolicy'\n            StandardSwitchTeamingPolicyResourceId = '[VMHostVssTeaming]StandardSwitchTeamingPolicy'\n            VirtualPortGroupResourceName = 'VirtualPortGroup'\n            VirtualPortGroupResourceId = '[VMHostVssPortGroup]VirtualPortGroup'\n            VirtualPortGroupTeamingPolicyResourceName = 'VirtualPortGroupTeamingPolicy'\n            VirtualPortGroupTeamingPolicyResourceId = '[VMHostVssPortGroupTeaming]VirtualPortGroupTeamingPolicy'\n            StandardSwitchName = 'MyStandardSwitch'\n            Mtu = 1500\n            BeaconInterval = 1\n            LinkDiscoveryProtocolOperation = 'Listen'\n            LinkDiscoveryProtocolProtocol = 'CDP'\n            Nic = @($script:physicalNic1, $script:physicalNic2)\n            StandardSwitchActiveNic = @($script:physicalNic1, $script:physicalNic2)\n            StandardSwitchStandbyNic = @()\n            CheckBeacon = $true\n            NotifySwitches = $false\n            NicTeamingPolicy = 'Loadbalance_ip'\n            RollingOrder = $true\n            VirtualPortGroupName = 'MyVirtualPortGroup'\n            VlanId = 0\n            FailbackEnabled = $false\n            LoadBalancingPolicy = 'LoadBalanceIP'\n            ActiveNic = @($script:physicalNic1)\n            StandbyNic = @($script:physicalNic2)\n            DefaultStandbyNic = @()\n            UnusedNic = @($script:physicalNic2)\n            DefaultUnusedNic = @()\n            NetworkFailoverDetectionPolicyLinkStatus = 'LinkStatus'\n            NetworkFailoverDetectionPolicyBeaconProbing = 'BeaconProbing'\n            InheritFailback = $false\n            InheritFailoverOrder = $false\n            InheritLoadBalancingPolicy = $false\n            InheritNetworkFailoverDetectionPolicy = $false\n            InheritNotifySwitches = $false\n        }\n    )\n}\n\n$script:configWhenAddingVirtualPortGroupAndStandardSwitch = \"$($script:dscResourceName)_WhenAddingVirtualPortGroupAndStandardSwitch_Config\"\n$script:configWhenUpdatingTeamingPolicyWithoutInheritSettings = \"$($script:dscResourceName)_WhenUpdatingTeamingPolicyWithoutInheritSettings_Config\"\n$script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse = \"$($script:dscResourceName)_WhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse_Config\"\n$script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue = \"$($script:dscResourceName)_WhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue_Config\"\n$script:configWhenRemovingVirtualPortGroupAndStandardSwitch = \"$($script:dscResourceName)_WhenRemovingVirtualPortGroupAndStandardSwitch_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenAddingVirtualPortGroupAndStandardSwitch\\\"\n$script:mofFileWhenUpdatingTeamingPolicyWithoutInheritSettingsPath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingTeamingPolicyWithoutInheritSettings\\\"\n$script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalsePath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse\\\"\n$script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToTruePath = \"$script:integrationTestsFolderPath\\$script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue\\\"\n$script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath = \"$script:integrationTestsFolderPath\\$script:configWhenRemovingVirtualPortGroupAndStandardSwitch\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $script:configWhenUpdatingTeamingPolicyWithoutInheritSettings\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                    -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                & $script:configWhenUpdatingTeamingPolicyWithoutInheritSettings `\n                    -OutputPath $script:mofFileWhenUpdatingTeamingPolicyWithoutInheritSettingsPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                    Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                $startDscConfigurationParametersWhenUpdatingTeamingPolicyWithoutInheritSettings = @{\n                    Path = $script:mofFileWhenUpdatingTeamingPolicyWithoutInheritSettingsPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n                Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingTeamingPolicyWithoutInheritSettings\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenUpdatingTeamingPolicyWithoutInheritSettingsPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingTeamingPolicyWithoutInheritSettings }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n                $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n                $configuration.Ensure | Should -Be 'Present'\n                $configuration.FailbackEnabled | Should -Be $script:configurationData.AllNodes.FailbackEnabled\n                $configuration.LoadBalancingPolicy | Should -Be $script:configurationData.AllNodes.LoadBalancingPolicy\n                $configuration.ActiveNic | Should -Be $script:configurationData.AllNodes.ActiveNic\n                $configuration.StandbyNic | Should -Be $script:configurationData.AllNodes.StandbyNic\n                $configuration.UnusedNic | Should -Be $script:configurationData.AllNodes.DefaultUnusedNic\n                $configuration.NetworkFailoverDetectionPolicy | Should -Be $script:configurationData.AllNodes.NetworkFailoverDetectionPolicyLinkStatus\n                $configuration.NotifySwitches | Should -Be $script:configurationData.AllNodes.NotifySwitches\n                $configuration.InheritFailback | Should -Be $script:configurationData.AllNodes.InheritFailback\n                $configuration.InheritFailoverOrder | Should -Be $script:configurationData.AllNodes.InheritFailoverOrder\n                $configuration.InheritLoadBalancingPolicy | Should -Be $script:configurationData.AllNodes.InheritLoadBalancingPolicy\n                $configuration.InheritNetworkFailoverDetectionPolicy | Should -Be $script:configurationData.AllNodes.InheritNetworkFailoverDetectionPolicy\n                $configuration.InheritNotifySwitches | Should -Be $script:configurationData.AllNodes.InheritNotifySwitches\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenUpdatingTeamingPolicyWithoutInheritSettingsPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                    -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n\n                Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenUpdatingTeamingPolicyWithoutInheritSettingsPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n\n        Context \"When using configuration $script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                    -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                & $script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse `\n                    -OutputPath $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalsePath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                    Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                $startDscConfigurationParametersWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse = @{\n                    Path = $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalsePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n                Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalsePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalse }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n                $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n                $configuration.Ensure | Should -Be 'Present'\n                $configuration.FailbackEnabled | Should -Be $script:configurationData.AllNodes.FailbackEnabled\n                $configuration.LoadBalancingPolicy | Should -Be $script:configurationData.AllNodes.LoadBalancingPolicy\n                $configuration.ActiveNic | Should -Be $script:configurationData.AllNodes.ActiveNic\n                $configuration.StandbyNic | Should -Be $script:configurationData.AllNodes.DefaultStandbyNic\n                $configuration.UnusedNic | Should -Be $script:configurationData.AllNodes.UnusedNic\n                $configuration.NetworkFailoverDetectionPolicy | Should -Be $script:configurationData.AllNodes.NetworkFailoverDetectionPolicyLinkStatus\n                $configuration.NotifySwitches | Should -Be $script:configurationData.AllNodes.NotifySwitches\n                $configuration.InheritFailback | Should -Be $script:configurationData.AllNodes.InheritFailback\n                $configuration.InheritFailoverOrder | Should -Be $script:configurationData.AllNodes.InheritFailoverOrder\n                $configuration.InheritLoadBalancingPolicy | Should -Be $script:configurationData.AllNodes.InheritLoadBalancingPolicy\n                $configuration.InheritNetworkFailoverDetectionPolicy | Should -Be $script:configurationData.AllNodes.InheritNetworkFailoverDetectionPolicy\n                $configuration.InheritNotifySwitches | Should -Be $script:configurationData.AllNodes.InheritNotifySwitches\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalsePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                    -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n\n                Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToFalsePath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n\n        Context \"When using configuration $script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue\" {\n            BeforeAll {\n                # Arrange\n                & $script:configWhenAddingVirtualPortGroupAndStandardSwitch `\n                    -OutputPath $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                & $script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue `\n                    -OutputPath $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToTruePath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch = @{\n                    Path = $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                $startDscConfigurationParametersWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue = @{\n                    Path = $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToTruePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParametersWhenAddingVirtualPortGroupAndStandardSwitch\n                Start-DscConfiguration @startDscConfigurationParametersWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue\n            }\n\n            It 'Should apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToTruePath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configWhenUpdatingTeamingPolicyWithInheritSettingsSetToTrue }\n\n                # Assert\n                $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n                $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.Name\n                $configuration.Name | Should -Be $script:configurationData.AllNodes.VirtualPortGroupName\n                $configuration.Ensure | Should -Be 'Present'\n                $configuration.FailbackEnabled | Should -Be $script:configurationData.AllNodes.FailbackEnabled\n                $configuration.LoadBalancingPolicy | Should -Be $script:configurationData.AllNodes.LoadBalancingPolicy\n                $configuration.ActiveNic | Should -Be $script:configurationData.AllNodes.Nic\n                $configuration.StandbyNic | Should -Be $script:configurationData.AllNodes.DefaultStandbyNic\n                $configuration.UnusedNic | Should -Be $script:configurationData.AllNodes.DefaultUnusedNic\n                $configuration.NetworkFailoverDetectionPolicy | Should -Be $script:configurationData.AllNodes.NetworkFailoverDetectionPolicyBeaconProbing\n                $configuration.NotifySwitches | Should -Be $script:configurationData.AllNodes.NotifySwitches\n                $configuration.InheritFailback | Should -Be $true\n                $configuration.InheritFailoverOrder | Should -Be $true\n                $configuration.InheritLoadBalancingPolicy | Should -Be $true\n                $configuration.InheritNetworkFailoverDetectionPolicy | Should -Be $true\n                $configuration.InheritNotifySwitches | Should -Be $true\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange\n                $testDscConfigurationParameters = @{\n                    ReferenceConfiguration = \"$script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToTruePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                & $script:configWhenRemovingVirtualPortGroupAndStandardSwitch `\n                    -OutputPath $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath `\n                    -ConfigurationData $script:configurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath\n                    ComputerName = $script:configurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n\n                Remove-Item -Path $script:mofFileWhenAddingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenUpdatingTeamingPolicyWithInheritSettingsSetToTruePath -Recurse -Confirm:$false -ErrorAction Stop\n                Remove-Item -Path $script:mofFileWhenRemovingVirtualPortGroupAndStandardSwitchPath -Recurse -Confirm:$false -ErrorAction Stop\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostNtpSettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostNtpSettings'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithoutNtpProperties = \"$($script:dscResourceName)_WithoutNtpServerAndNtpServicePolicy_Config\"\n$script:configWithEmptyArrayNtpServer = \"$($script:dscResourceName)_WithEmptyArrayNtpServer_Config\"\n$script:configWithNtpServerAddUseCase = \"$($script:dscResourceName)_WithNtpServerAddUseCase_Config\"\n$script:configWithNtpServerRemoveUseCase = \"$($script:dscResourceName)_WithNtpServerRemoveUseCase_Config\"\n$script:configWithTheSameNtpServicePolicy = \"$($script:dscResourceName)_WithTheSameNtpServicePolicy_Config\"\n$script:configWithNtpServicePolicy = \"$($script:dscResourceName)_WithNtpServicePolicy_Config\"\n\n$script:connection = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:vmHost = $null\n\n$script:ntpConfig = $null\n$script:ntpServer = $null\n$script:ntpServiceId = \"ntpd\"\n$script:ntpServicePolicy = $null\n\n$script:emptyArrayNtpServer = @()\n$script:ntpServerAddUseCase = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\", \"2.bg.pool.ntp.org\")\n$script:ntpServerRemoveUseCase = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\")\n$script:configurationNtpServicePolicy = \"Automatic\"\n\n$script:resourceWithoutNtpProperties = @{\n    Name = $Name\n    Server = $Server\n}\n$script:resourceWithEmptyArrayNtpServer = @{\n    Name = $Name\n    Server = $Server\n    NtpServer = $script:emptyArrayNtpServer\n}\n$script:resourceWithNtpServerAddUseCase = @{\n    Name = $Name\n    Server = $Server\n    NtpServer = $script:ntpServerAddUseCase\n}\n$script:resourceWithNtpServerRemoveUseCase = @{\n    Name = $Name\n    Server = $Server\n    NtpServer = $script:ntpServerRemoveUseCase\n}\n$script:resourceWithNtpServicePolicy = @{\n    Name = $Name\n    Server = $Server\n    NtpServicePolicy = $script:configurationNtpServicePolicy\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithoutNtpServerAndNtpServicePolicyPath = \"$script:integrationTestsFolderPath\\$($script:configWithoutNtpProperties)\\\"\n$script:mofFileWithEmptyArrayNtpServerPath = \"$script:integrationTestsFolderPath\\$($script:configWithEmptyArrayNtpServer)\\\"\n$script:mofFileWithNtpServerAddUseCasePath = \"$script:integrationTestsFolderPath\\$($script:configWithNtpServerAddUseCase)\\\"\n$script:mofFileWithNtpServerRemoveUseCasePath = \"$script:integrationTestsFolderPath\\$($script:configWithNtpServerRemoveUseCase)\\\"\n$script:mofFileWithTheSameNtpServicePolicyPath = \"$script:integrationTestsFolderPath\\$($script:configWithTheSameNtpServicePolicy)\\\"\n$script:mofFileWithNtpServicePolicyPath = \"$script:integrationTestsFolderPath\\$($script:configWithNtpServicePolicy)\\\"\n\nfunction Invoke-TestSetup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceWithoutNtpProperties.Name\n    $script:ntpConfig = $script:vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n    $script:ntpServer = $script:ntpConfig.Server\n\n    $vmHostService = $script:vmHost.ExtensionData.Config.Service\n    $vmHostNtpService = $vmHostService.Service | Where-Object { $_.Key -eq $script:ntpServiceId }\n    $script:ntpServicePolicy = $vmHostNtpService.Policy\n}\n\nfunction Invoke-TestCleanup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceWithoutNtpProperties.Name\n\n    $dateTimeConfig = New-Object VMware.Vim.HostDateTimeConfig\n    $dateTimeConfig.NtpConfig = New-Object VMware.Vim.HostNtpConfig\n    $dateTimeConfig.NtpConfig.Server = $script:ntpServer\n\n    $dateTimeSystem = Get-View -Server $script:connection $script:vmHost.ExtensionData.ConfigManager.DateTimeSystem\n    $dateTimeSystem.UpdateDateTimeConfig($dateTimeConfig)\n\n    $serviceSystem = Get-View -Server $script:connection $script:vmHost.ExtensionData.ConfigManager.ServiceSystem\n    $serviceSystem.UpdateServicePolicy($script:ntpServiceId, $script:ntpServicePolicy)\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithoutNtpProperties)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithoutNtpServerAndNtpServicePolicyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithoutNtpServerAndNtpServicePolicyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithoutNtpProperties.Name\n                $configuration.Server | Should -Be $script:resourceWithoutNtpProperties.Server\n                $configuration.NtpServer | Should -Be $script:ntpServer\n                $configuration.NtpServicePolicy | Should -Be $script:ntpServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithEmptyArrayNtpServer)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithEmptyArrayNtpServerPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithEmptyArrayNtpServerPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithEmptyArrayNtpServer.Name\n                $configuration.Server | Should -Be $script:resourceWithEmptyArrayNtpServer.Server\n                $configuration.NtpServer | Should -Be $script:resourceWithEmptyArrayNtpServer.NtpServer\n                $configuration.NtpServicePolicy | Should -Be $script:ntpServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithNtpServerAddUseCase)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNtpServerAddUseCasePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNtpServerAddUseCasePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithNtpServerAddUseCase.Name\n                $configuration.Server | Should -Be $script:resourceWithNtpServerAddUseCase.Server\n                $configuration.NtpServer | Should -Be $script:resourceWithNtpServerAddUseCase.NtpServer\n                $configuration.NtpServicePolicy | Should -Be $script:ntpServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithNtpServerRemoveUseCase)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNtpServerRemoveUseCasePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNtpServerRemoveUseCasePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithNtpServerRemoveUseCase.Name\n                $configuration.Server | Should -Be $script:resourceWithNtpServerRemoveUseCase.Server\n                $configuration.NtpServer | Should -Be $script:resourceWithNtpServerRemoveUseCase.NtpServer\n                $configuration.NtpServicePolicy | Should -Be $script:ntpServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithTheSameNtpServicePolicy)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithTheSameNtpServicePolicyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithTheSameNtpServicePolicyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $Name\n                $configuration.Server | Should -Be $Server\n                $configuration.NtpServer | Should -Be $script:ntpServer\n                $configuration.NtpServicePolicy | Should -Be $script:ntpServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithNtpServicePolicy)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNtpServicePolicyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNtpServicePolicyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithNtpServicePolicy.Name\n                $configuration.Server | Should -Be $script:resourceWithNtpServicePolicy.Server\n                $configuration.NtpServer | Should -Be $script:ntpServer\n                $configuration.NtpServicePolicy | Should -Be $script:resourceWithNtpServicePolicy.NtpServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostPciPassthrough.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the PCI Device Id of the first PCI Device which is Passthrough capable. If there are no PCI Devices which are Passthrough capable, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $vmHost = Get-VMHost -Server $viServer -Name $Name\n    $pciPassthruSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.PciPassthruSystem\n\n    $pciDevice = $pciPassthruSystem.PciPassthruInfo | Where-Object { $_.PassthruCapable } | Select-Object -First 1\n    if ($null -eq $pciDevice) {\n        throw \"No Passthrough capable PCI Device is found on the server $Server.\"\n    }\n\n    $script:pciDeviceId = $pciDevice.Id\n}\n\nInvoke-TestSetup\n\n$script:dscResourceName = 'VMHostPciPassthrough'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenEnablingPassthru = \"$($script:dscResourceName)_WhenEnablingPassthru_Config\"\n$script:configWhenDisablingPassthru = \"$($script:dscResourceName)_WhenDisablingPassthru_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -PciDeviceId $script:pciDeviceId\n\n$script:mofFileWhenEnablingPassthruPath = \"$script:integrationTestsFolderPath\\$($script:configWhenEnablingPassthru)\\\"\n$script:mofFileWhenDisablingPassthruPath = \"$script:integrationTestsFolderPath\\$($script:configWhenDisablingPassthru)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWhenEnablingPassthru)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenEnablingPassthruPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenEnablingPassthruPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.Id | Should -Be $script:pciDeviceId\n                $configuration.Enabled | Should -Be $true\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            AfterAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenDisablingPassthruPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n        }\n\n        Context \"When using configuration $($script:configWhenDisablingPassthru)\" {\n            BeforeAll {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenDisablingPassthruPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWhenDisablingPassthruPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $Server\n                $configuration.Name | Should -Be $Name\n                $configuration.Id | Should -Be $script:pciDeviceId\n                $configuration.Enabled | Should -Be $false\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostPermission/VMHostPermission.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the names of the Datacenter and VMHost entities used in the Integration Tests.\n#>\nfunction Get-EntityInformation {\n    [CmdletBinding()]\n\n    # Data that is going to be passed as Configuration Data in the Integration Tests.\n    $script:datacenterEntityName = $null\n    $script:vmHostEntityName = $null\n\n    $viServer = Connect-VIServer -Server $ESXiServer -User $ESXiUser -Password $ESXiPassword -ErrorAction Stop -Verbose:$false\n\n    $datacenter = Get-Datacenter -Server $viServer -ErrorAction Stop -Verbose:$false\n    $rootFolder = Get-Folder -Server $viServer -NoRecursion -ErrorAction Stop -Verbose:$false\n\n    $script:datacenterEntityName = $datacenter.Name\n    $script:vmHostEntityName = $rootFolder.Name\n\n    Disconnect-VIServer -Server $ESXiServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new VMHost User account with the specified name and password.\n#>\nfunction New-VMHostUserAccount {\n    [CmdletBinding()]\n\n    $vmHostUserAccountName = $script:configurationData.AllNodes.VMHostUserAccountName\n    $vmHostUserAccountPassword = $script:configurationData.AllNodes.VMHostUserAccountPassword\n\n    $viServer = Connect-VIServer -Server $ESXiServer -User $ESXiUser -Password $ESXiPassword -ErrorAction Stop -Verbose:$false\n\n    New-VMHostAccount -Server $viServer -Id $vmHostUserAccountName -Password $vmHostUserAccountPassword -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $ESXiServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Vmfs Datastore with the specified name on the specified VMHost.\n#>\nfunction New-VmfsDatastore {\n    [CmdletBinding()]\n\n    $datastoreName = $script:configurationData.AllNodes.DatastoreEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n\n    New-Datastore -Server $viServer -Name $datastoreName -VMHost $vmHost -Vmfs -Path $scsiLun.CanonicalName -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Resource Pool with the specified name and places it in the Root Resource Pool on the specified VMHost.\n#>\nfunction New-VMHostResourcePool {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n\n    New-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new vApp with the specified name and places it in the specified Resource Pool on the specified VMHost.\n#>\nfunction New-VMHostVApp {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n    $vAppName = $script:configurationData.AllNodes.VAppEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n\n    New-VApp -Server $viServer -Name $vAppName -Location $resourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Virtual Machine with the specified name and places it in the Root Resource Pool on the specified VMHost.\n#>\nfunction New-VirtualMachinePlacedInTheRootResourcePoolOfTheVMHost {\n    [CmdletBinding()]\n\n    $vmName = $script:configurationData.AllNodes.VMEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n\n    New-VM -Server $viServer -Name $vmName -VMHost $vmHost -ResourcePool $rootResourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Virtual Machine with the specified name and places it in the specified Resource Pool on the specified VMHost.\n#>\nfunction New-VirtualMachinePlacedInResourcePool {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n    $vmName = $script:configurationData.AllNodes.VMEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n\n    New-VM -Server $viServer -Name $vmName -VMHost $vmHost -ResourcePool $resourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Virtual Machine with the specified name and places it in the specified vApp on the specified VMHost.\n#>\nfunction New-VirtualMachinePlacedInVApp {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n    $vAppName = $script:configurationData.AllNodes.VAppEntityName\n    $vmName = $script:configurationData.AllNodes.VMEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n    $vApp = Get-VApp -Server $viServer -Name $vAppName -Location $resourcePool -ErrorAction Stop -Verbose:$false |\n            Where-Object -FilterScript { $_.ParentId -eq $resourcePool.Id }\n\n    New-VM -Server $viServer -Name $vmName -VMHost $vmHost -ResourcePool $vApp -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the VMHost User account with the specified name.\n#>\nfunction Remove-VMHostUserAccount {\n    [CmdletBinding()]\n\n    $vmHostUserAccountName = $script:configurationData.AllNodes.VMHostUserAccountName\n\n    $viServer = Connect-VIServer -Server $ESXiServer -User $ESXiUser -Password $ESXiPassword -ErrorAction Stop -Verbose:$false\n\n    $vmHostUserAccount = Get-VMHostAccount -Server $viServer -Id $vmHostUserAccountName -ErrorAction Stop -Verbose:$false\n    Remove-VMHostAccount -Server $viServer -HostAccount $vmHostUserAccount -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $ESXiServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Vmfs Datastore with the specified name from the specified VMHost.\n#>\nfunction Remove-VmfsDatastore {\n    [CmdletBinding()]\n\n    $datastoreName = $script:configurationData.AllNodes.DatastoreEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n\n    $vmfsDatastore = Get-Datastore -Server $viServer -Name $datastoreName -VMHost $vmHost -ErrorAction Stop -Verbose:$false\n    Remove-Datastore -Server $viServer -Datastore $vmfsDatastore -VMHost $vmHost -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Resource Pool with the specified name from the specified VMHost.\n#>\nfunction Remove-VMHostResourcePool {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n    Remove-ResourcePool -Server $viServer -ResourcePool $resourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the vApp with the specified name from the specified VMHost.\n#>\nfunction Remove-VMHostVApp {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n    $vAppName = $script:configurationData.AllNodes.VAppEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n\n    $vApp = Get-VApp -Server $viServer -Name $vAppName -Location $resourcePool -ErrorAction Stop -Verbose:$false |\n            Where-Object -FilterScript { $_.ParentId -eq $resourcePool.Id }\n    Remove-VApp -Server $viServer -VApp $vApp -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Virtual Machine with the specified name from the specified VMHost.\n#>\nfunction Remove-VirtualMachinePlacedInTheRootResourcePoolOfTheVMHost {\n    [CmdletBinding()]\n\n    $vmName = $script:configurationData.AllNodes.VMEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n\n    $vm = Get-VM -Server $viServer -Name $vmName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n          Where-Object -FilterScript { $_.ResourcePoolId -eq $rootResourcePool.Id }\n    Remove-VM -Server $viServer -VM $vm -DeletePermanently:$true -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Virtual Machine with the specified name from the specified VMHost.\n#>\nfunction Remove-VirtualMachinePlacedInResourcePool {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n    $vmName = $script:configurationData.AllNodes.VMEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n\n    $vm = Get-VM -Server $viServer -Name $vmName -Location $resourcePool -ErrorAction Stop -Verbose:$false |\n          Where-Object -FilterScript { $_.ResourcePoolId -eq $resourcePool.Id }\n    Remove-VM -Server $viServer -VM $vm -DeletePermanently:$true -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Virtual Machine with the specified name from the specified VMHost.\n#>\nfunction Remove-VirtualMachinePlacedInVApp {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolEntityName\n    $vAppName = $script:configurationData.AllNodes.VAppEntityName\n    $vmName = $script:configurationData.AllNodes.VMEntityName\n\n    $viServer = Connect-VIServer -Server $VCenterServer -User $VCenterUser -Password $VCenterPassword -ErrorAction Stop -Verbose:$false\n    $vmHost = Get-VMHost -Server $viServer -Name $ESXiServer -ErrorAction Stop -Verbose:$false\n    $resourcePoolsType = (Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Select-Object -First 1).GetType()\n    $rootResourcePool = Get-Inventory -Server $viServer -ErrorAction Stop -Verbose:$false |\n                        Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id -and $_.GetType() -eq $resourcePoolsType }\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n    $vApp = Get-VApp -Server $viServer -Name $vAppName -Location $resourcePool -ErrorAction Stop -Verbose:$false |\n            Where-Object -FilterScript { $_.ParentId -eq $resourcePool.Id }\n\n    $vm = Get-VM -Server $viServer -Name $vmName -Location $vApp -ErrorAction Stop -Verbose:$false |\n          Where-Object -FilterScript { $_.ResourcePoolId -eq $vApp.Id }\n    Remove-VM -Server $viServer -VM $vm -DeletePermanently:$true -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $VCenterServer -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostPermission/VMHostPermission.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VCenterServer,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VCenterUser,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VCenterPassword,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ESXiServer,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ESXiUser,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $ESXiPassword\n)\n\n. \"$PSScriptRoot\\VMHostPermission.Integration.Tests.Helpers.ps1\"\nGet-EntityInformation\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ESXiUser, (ConvertTo-SecureString -String $ESXiPassword -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostPermission'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n$script:secondsToSleep = 20\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $ESXiServer\n            Credential = $Credential\n            VMHostRoleResourceName = 'VMHostRole'\n            VMHostPermissionResourceName = 'VMHostPermission'\n            VMHostUserAccountName = 'MyTestPrincipal'\n            VMHostUserAccountPassword = 'MyAccountPass1!'\n            DatacenterEntityName = $script:datacenterEntityName\n            VMHostEntityName = $script:vmHostEntityName\n            DatastoreEntityName = 'MyTestVmfsDatastore'\n            ResourcePoolEntityName = 'MyTestResourcePool'\n            VAppEntityName = 'MyTestvApp'\n            VMEntityName = 'MyTestVM'\n            RoleOneName = 'MyTestDscRoleOne'\n            RoleTwoName = 'MyTestDscRoleTwo'\n            EmptyEntityLocation = [string]::Empty\n            OneResourcePoolEntityLocation = 'MyTestResourcePool'\n            OneResourcePoolAndOneVAppEntityLocation = 'MyTestResourcePool/MyTestvApp'\n            PropagatePermission = $true\n        }\n    )\n}\n\n$script:configCreateVMHostRoles = \"$($script:dscResourceName)_CreateVMHostRoles_Config\"\n$script:configCreateVMHostPermissionForDatacenterEntity = \"$($script:dscResourceName)_CreateVMHostPermissionForDatacenterEntity_Config\"\n$script:configCreateVMHostPermissionForVMHostEntity = \"$($script:dscResourceName)_CreateVMHostPermissionForVMHostEntity_Config\"\n$script:configCreateVMHostPermissionForDatastoreEntity = \"$($script:dscResourceName)_CreateVMHostPermissionForDatastoreEntity_Config\"\n$script:configCreateVMHostPermissionForResourcePoolEntity = \"$($script:dscResourceName)_CreateVMHostPermissionForResourcePoolEntity_Config\"\n$script:configCreateVMHostPermissionForVMEntityWithEmptyEntityLocation = \"$($script:dscResourceName)_CreateVMHostPermissionForVMEntityWithEmptyEntityLocation_Config\"\n$script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation = \"$($script:dscResourceName)_CreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation_Config\"\n$script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = \"$($script:dscResourceName)_CreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation_Config\"\n$script:configModifyVMHostPermissionRoleAndPropagateBehaviour = \"$($script:dscResourceName)_ModifyVMHostPermissionRoleAndPropagateBehaviour_Config\"\n$script:configRemoveVMHostPermissionForDatacenterEntity = \"$($script:dscResourceName)_RemoveVMHostPermissionForDatacenterEntity_Config\"\n$script:configRemoveVMHostPermissionForVMHostEntity = \"$($script:dscResourceName)_RemoveVMHostPermissionForVMHostEntity_Config\"\n$script:configRemoveVMHostPermissionForDatastoreEntity = \"$($script:dscResourceName)_RemoveVMHostPermissionForDatastoreEntity_Config\"\n$script:configRemoveVMHostPermissionForResourcePoolEntity = \"$($script:dscResourceName)_RemoveVMHostPermissionForResourcePoolEntity_Config\"\n$script:configRemoveVMHostPermissionForVMEntityWithEmptyEntityLocation = \"$($script:dscResourceName)_RemoveVMHostPermissionForVMEntityWithEmptyEntityLocation_Config\"\n$script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation = \"$($script:dscResourceName)_RemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation_Config\"\n$script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = \"$($script:dscResourceName)_RemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation_Config\"\n$script:configRemoveVMHostRoles = \"$($script:dscResourceName)_RemoveVMHostRoles_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateVMHostRolesPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostRoles\\\"\n$script:mofFileCreateVMHostPermissionForDatacenterEntityPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForDatacenterEntity\\\"\n$script:mofFileCreateVMHostPermissionForVMHostEntityPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForVMHostEntity\\\"\n$script:mofFileCreateVMHostPermissionForDatastoreEntityPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForDatastoreEntity\\\"\n$script:mofFileCreateVMHostPermissionForResourcePoolEntityPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForResourcePoolEntity\\\"\n$script:mofFileCreateVMHostPermissionForVMEntityWithEmptyEntityLocationPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForVMEntityWithEmptyEntityLocation\\\"\n$script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation\\\"\n$script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath = \"$script:integrationTestsFolderPath\\$script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\\\"\n$script:mofFileModifyVMHostPermissionRoleAndPropagateBehaviourPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostPermissionRoleAndPropagateBehaviour\\\"\n$script:mofFileRemoveVMHostPermissionForDatacenterEntityPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForDatacenterEntity\\\"\n$script:mofFileRemoveVMHostPermissionForVMHostEntityPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForVMHostEntity\\\"\n$script:mofFileRemoveVMHostPermissionForDatastoreEntityPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForDatastoreEntity\\\"\n$script:mofFileRemoveVMHostPermissionForResourcePoolEntityPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForResourcePoolEntity\\\"\n$script:mofFileRemoveVMHostPermissionForVMEntityWithEmptyEntityLocationPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForVMEntityWithEmptyEntityLocation\\\"\n$script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation\\\"\n$script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\\\"\n$script:mofFileRemoveVMHostRolesPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostRoles\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateVMHostPermissionForDatacenterEntity\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForDatacenterEntity `\n                -OutputPath $script:mofFileCreateVMHostPermissionForDatacenterEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForDatacenterEntity = @{\n                Path = $script:mofFileCreateVMHostPermissionForDatacenterEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForDatacenterEntity\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForDatacenterEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForDatacenterEntity }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.DatacenterEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.EmptyEntityLocation\n            $configuration.EntityType | Should -Be 'Datacenter'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForDatacenterEntityPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForDatacenterEntity `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForDatacenterEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForDatacenterEntity = @{\n                Path = $script:mofFileRemoveVMHostPermissionForDatacenterEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForDatacenterEntity\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForDatacenterEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForDatacenterEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVMHostPermissionForVMHostEntity\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForVMHostEntity `\n                -OutputPath $script:mofFileCreateVMHostPermissionForVMHostEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForVMHostEntity = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMHostEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForVMHostEntity\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMHostEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForVMHostEntity }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.VMHostEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.EmptyEntityLocation\n            $configuration.EntityType | Should -Be 'VMHost'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForVMHostEntityPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForVMHostEntity `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForVMHostEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForVMHostEntity = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMHostEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForVMHostEntity\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForVMHostEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForVMHostEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVMHostPermissionForDatastoreEntity\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForDatastoreEntity `\n                -OutputPath $script:mofFileCreateVMHostPermissionForDatastoreEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForDatastoreEntity = @{\n                Path = $script:mofFileCreateVMHostPermissionForDatastoreEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n            New-VmfsDatastore\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForDatastoreEntity\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForDatastoreEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForDatastoreEntity }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.DatastoreEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.EmptyEntityLocation\n            $configuration.EntityType | Should -Be 'Datastore'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForDatastoreEntityPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForDatastoreEntity `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForDatastoreEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForDatastoreEntity = @{\n                Path = $script:mofFileRemoveVMHostPermissionForDatastoreEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForDatastoreEntity\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n            Remove-VmfsDatastore\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForDatastoreEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForDatastoreEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVMHostPermissionForResourcePoolEntity\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForResourcePoolEntity `\n                -OutputPath $script:mofFileCreateVMHostPermissionForResourcePoolEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForResourcePoolEntity = @{\n                Path = $script:mofFileCreateVMHostPermissionForResourcePoolEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            New-VMHostResourcePool\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForResourcePoolEntity\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForResourcePoolEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForResourcePoolEntity }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.ResourcePoolEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.EmptyEntityLocation\n            $configuration.EntityType | Should -Be 'ResourcePool'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForResourcePoolEntityPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForResourcePoolEntity `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForResourcePoolEntityPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForResourcePoolEntity = @{\n                Path = $script:mofFileRemoveVMHostPermissionForResourcePoolEntityPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForResourcePoolEntity\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n            Remove-VMHostResourcePool\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForResourcePoolEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForResourcePoolEntityPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVMHostPermissionForVMEntityWithEmptyEntityLocation\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForVMEntityWithEmptyEntityLocation `\n                -OutputPath $script:mofFileCreateVMHostPermissionForVMEntityWithEmptyEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithEmptyEntityLocation = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithEmptyEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n            New-VirtualMachinePlacedInTheRootResourcePoolOfTheVMHost\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithEmptyEntityLocation\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithEmptyEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForVMEntityWithEmptyEntityLocation }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.VMEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.EmptyEntityLocation\n            $configuration.EntityType | Should -Be 'VM'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForVMEntityWithEmptyEntityLocationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForVMEntityWithEmptyEntityLocation `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForVMEntityWithEmptyEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithEmptyEntityLocation = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMEntityWithEmptyEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithEmptyEntityLocation\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n            Remove-VirtualMachinePlacedInTheRootResourcePoolOfTheVMHost\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForVMEntityWithEmptyEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForVMEntityWithEmptyEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation `\n                -OutputPath $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            New-VMHostResourcePool\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VirtualMachinePlacedInResourcePool\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.VMEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.OneResourcePoolEntityLocation\n            $configuration.EntityType | Should -Be 'VM'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocation\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n            Remove-VirtualMachinePlacedInResourcePool\n            Remove-VMHostResourcePool\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation `\n                -OutputPath $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            New-VMHostResourcePool\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VMHostVApp\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VirtualMachinePlacedInVApp\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.VMEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.OneResourcePoolAndOneVAppEntityLocation\n            $configuration.EntityType | Should -Be 'VM'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -Be $script:configurationData.AllNodes.PropagatePermission\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n            Remove-VirtualMachinePlacedInVApp\n            Remove-VMHostVApp\n            Remove-VMHostResourcePool\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyVMHostPermissionRoleAndPropagateBehaviour\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation `\n                -OutputPath $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVMHostPermissionRoleAndPropagateBehaviour `\n                -OutputPath $script:mofFileModifyVMHostPermissionRoleAndPropagateBehaviourPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyVMHostPermissionRoleAndPropagateBehaviour = @{\n                Path = $script:mofFileModifyVMHostPermissionRoleAndPropagateBehaviourPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            New-VMHostResourcePool\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VMHostVApp\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VirtualMachinePlacedInVApp\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\n            Start-DscConfiguration @startDscConfigurationParametersModifyVMHostPermissionRoleAndPropagateBehaviour\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostPermissionRoleAndPropagateBehaviourPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostPermissionRoleAndPropagateBehaviour }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.VMEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.OneResourcePoolAndOneVAppEntityLocation\n            $configuration.EntityType | Should -Be 'VM'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleTwoName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Propagate | Should -BeFalse\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostPermissionRoleAndPropagateBehaviourPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostRoles = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostRoles\n\n            Remove-VMHostUserAccount\n            Remove-VirtualMachinePlacedInVApp\n            Remove-VMHostVApp\n            Remove-VMHostResourcePool\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostPermissionRoleAndPropagateBehaviourPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateVMHostRoles `\n                -OutputPath $script:mofFileCreateVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation `\n                -OutputPath $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation `\n                -OutputPath $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateVMHostRoles = @{\n                Path = $script:mofFileCreateVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = @{\n                Path = $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            New-VMHostUserAccount\n\n            New-VMHostResourcePool\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VMHostVApp\n            Start-Sleep -Seconds $script:secondsToSleep\n\n            New-VirtualMachinePlacedInVApp\n\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostRoles\n            Start-DscConfiguration @startDscConfigurationParametersCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocation }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.EntityName | Should -Be $script:configurationData.AllNodes.VMEntityName\n            $configuration.EntityLocation | Should -Be $script:configurationData.AllNodes.OneResourcePoolAndOneVAppEntityLocation\n            $configuration.EntityType | Should -Be 'VM'\n            $configuration.PrincipalName | Should -Be $script:configurationData.AllNodes.VMHostUserAccountName\n            $configuration.RoleName | Should -Be $script:configurationData.AllNodes.RoleOneName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.Propagate | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostRoles `\n                -OutputPath $script:mofFileRemoveVMHostRolesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostRolesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-VMHostUserAccount\n            Remove-VirtualMachinePlacedInVApp\n            Remove-VMHostVApp\n            Remove-VMHostResourcePool\n\n            Remove-Item -Path $script:mofFileCreateVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostPermissionForVMEntityWithOneResourcePoolAndOneVAppEntityLocationPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostRolesPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostPowerPolicy.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostPowerPolicy'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWhenPowerPolicyIsBalanced = \"$($script:dscResourceName)_WhenPowerPolicyIsBalanced_Config\"\n$script:configWhenPowerPolicyIsHighPerformance = \"$($script:dscResourceName)_WhenPowerPolicyIsHighPerformance_Config\"\n$script:configWhenPowerPolicyIsLowPower = \"$($script:dscResourceName)_WhenPowerPolicyIsLowPower_Config\"\n$script:configWhenPowerPolicyIsCustom = \"$($script:dscResourceName)_WhenPowerPolicyIsCustom_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWhenPowerPolicyIsBalancedPath = \"$script:integrationTestsFolderPath\\$($script:configWhenPowerPolicyIsBalanced)\\\"\n$script:mofFileWhenPowerPolicyIsHighPerformancePath = \"$script:integrationTestsFolderPath\\$($script:configWhenPowerPolicyIsHighPerformance)\\\"\n$script:mofFileWhenPowerPolicyIsLowPowerPath = \"$script:integrationTestsFolderPath\\$($script:configWhenPowerPolicyIsLowPower)\\\"\n$script:mofFileWhenPowerPolicyIsCustomPath = \"$script:integrationTestsFolderPath\\$($script:configWhenPowerPolicyIsCustom)\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $($script:configWhenPowerPolicyIsBalanced)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsBalancedPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsBalancedPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n            $configuration.PowerPolicy | Should -Be $script:balancedPowerPolicy\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration -Verbose | Should -Be $true\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenPowerPolicyIsHighPerformance)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsHighPerformancePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsHighPerformancePath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n            $configuration.PowerPolicy | Should -Be $script:highPerformancePowerPolicy\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration -Verbose | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsBalancedPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenPowerPolicyIsLowPower)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsLowPowerPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsLowPowerPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n            $configuration.PowerPolicy | Should -Be $script:lowPowerPowerPolicy\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration -Verbose | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsBalancedPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n\n    Context \"When using configuration $($script:configWhenPowerPolicyIsCustom)\" {\n        BeforeAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsCustomPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should compile and apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsCustomPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose\n\n            # Assert\n            $configuration.Server | Should -Be $Server\n            $configuration.Name | Should -Be $Name\n            $configuration.PowerPolicy | Should -Be $script:customPowerPolicy\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange && Act && Assert\n            Test-DscConfiguration -Verbose | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileWhenPowerPolicyIsBalancedPath\n                ComputerName = 'localhost'\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostRole.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n$script:dscResourceName = 'VMHostRole'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostRoleResourceName = 'VMHostRole'\n            RoleName = 'MyTestRole'\n            SystemPrivilegeIds = @('System.Anonymous', 'System.Read', 'System.View')\n            HostInventoryPrivilegeIds = @('Host.Inventory.AddHostToCluster', 'Host.Inventory.AddStandaloneHost', 'Host.Inventory.RemoveHostFromCluster')\n            DesiredPrivilegeIds = @(\n                'Host.Inventory.AddStandaloneHost',\n                'Host.Inventory.CreateCluster',\n                'Host.Inventory.MoveHost',\n                'System.Anonymous',\n                'System.Read',\n                'System.View'\n            )\n        }\n    )\n}\n\n$script:configCreateRole = \"$($script:dscResourceName)_CreateRole_Config\"\n$script:configCreateRoleWithPrivileges = \"$($script:dscResourceName)_CreateRoleWithPrivileges_Config\"\n$script:configModifyRolePrivileges = \"$($script:dscResourceName)_ModifyRolePrivileges_Config\"\n$script:configRemoveRole = \"$($script:dscResourceName)_RemoveRole_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateRolePath = \"$script:integrationTestsFolderPath\\$script:configCreateRole\\\"\n$script:mofFileCreateRoleWithPrivilegesPath = \"$script:integrationTestsFolderPath\\$script:configCreateRoleWithPrivileges\\\"\n$script:mofFileModifyRolePrivilegesPath = \"$script:integrationTestsFolderPath\\$script:configModifyRolePrivileges\\\"\n$script:mofFileRemoveRolePath = \"$script:integrationTestsFolderPath\\$script:configRemoveRole\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configCreateRole\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateRole `\n                -OutputPath $script:mofFileCreateRolePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateRole }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.RoleName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.PrivilegeIds | Should -Be $script:configurationData.AllNodes.SystemPrivilegeIds\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateRolePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveRole `\n                -OutputPath $script:mofFileRemoveRolePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateRolePath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveRolePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configCreateRoleWithPrivileges\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateRoleWithPrivileges `\n                -OutputPath $script:mofFileCreateRoleWithPrivilegesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateRoleWithPrivilegesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileCreateRoleWithPrivilegesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configCreateRoleWithPrivileges }\n\n            # Assert\n            $expectedPrivilegeIds = $script:configurationData.AllNodes.HostInventoryPrivilegeIds + $script:configurationData.AllNodes.SystemPrivilegeIds\n\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.RoleName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.PrivilegeIds | Should -Be $expectedPrivilegeIds\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileCreateRoleWithPrivilegesPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveRole `\n                -OutputPath $script:mofFileRemoveRolePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateRoleWithPrivilegesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveRolePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyRolePrivileges\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateRoleWithPrivileges `\n                -OutputPath $script:mofFileCreateRoleWithPrivilegesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyRolePrivileges `\n                -OutputPath $script:mofFileModifyRolePrivilegesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateRoleWithPrivileges = @{\n                Path = $script:mofFileCreateRoleWithPrivilegesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersModifyRolePrivileges = @{\n                Path = $script:mofFileModifyRolePrivilegesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateRoleWithPrivileges\n            Start-DscConfiguration @startDscConfigurationParametersModifyRolePrivileges\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyRolePrivilegesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyRolePrivileges }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.RoleName\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.PrivilegeIds | Should -Be $script:configurationData.AllNodes.DesiredPrivilegeIds\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyRolePrivilegesPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveRole `\n                -OutputPath $script:mofFileRemoveRolePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateRoleWithPrivilegesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyRolePrivilegesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveRolePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveRole\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateRoleWithPrivileges `\n                -OutputPath $script:mofFileCreateRoleWithPrivilegesPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveRole `\n                -OutputPath $script:mofFileRemoveRolePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateRoleWithPrivileges = @{\n                Path = $script:mofFileCreateRoleWithPrivilegesPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveRole = @{\n                Path = $script:mofFileRemoveRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateRoleWithPrivileges\n            Start-DscConfiguration @startDscConfigurationParametersRemoveRole\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveRolePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveRole }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.RoleName\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.PrivilegeIds | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveRolePath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Act\n            Remove-Item -Path $script:mofFileCreateRoleWithPrivilegesPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveRolePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostSatpClaimRule.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostSatpClaimRule'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithClaimRuleToAdd = \"$($script:dscResourceName)_WithClaimRuleToAdd_Config\"\n$script:configWithClaimRuleToRemove = \"$($script:dscResourceName)_WithClaimRuleToRemove_Config\"\n\n$script:ruleName = \"VMW_SATP_LOCAL\"\n$script:pspOptions = \"VMW_SATP_LOCAL PSPOption\"\n$script:transport = \"VMW_SATP_LOCAL Transport\"\n$script:description = \"Description of VMW_SATP_LOCAL Claim Rule.\"\n$script:type = \"transport\"\n$script:psp = \"VMW_PSP_MRU\"\n$script:options = \"VMW_PSP_MRUOption\"\n\n$script:resourceWithClaimRuleToAdd = @{\n    Name = $Name\n    Server = $Server\n    Ensure = \"Present\"\n    RuleName = $script:ruleName\n    PSPOptions = $script:pspOptions\n    Transport = $script:transport\n    Description = $script:description\n    Type = $script:type\n    Psp = $script:psp\n    Options = $script:options\n}\n$script:resourceWithClaimRuleToRemove = @{\n    Name = $Name\n    Server = $Server\n    Ensure = \"Absent\"\n    RuleName = $script:ruleName\n    PSPOptions = $script:pspOptions\n    Transport = $script:transport\n    Description = $script:description\n    Type = $script:type\n    Psp = $script:psp\n    Options = $script:options\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithClaimRuleToAdd = \"$script:integrationTestsFolderPath\\$($script:configWithClaimRuleToAdd)\\\"\n$script:mofFileWithClaimRuleToRemove = \"$script:integrationTestsFolderPath\\$($script:configWithClaimRuleToRemove)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithClaimRuleToAdd)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithClaimRuleToAdd\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithClaimRuleToAdd\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange\n                $emptyProperty = [string]::Empty\n\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithClaimRuleToAdd.Name\n                $configuration.Server | Should -Be $script:resourceWithClaimRuleToAdd.Server\n                $configuration.Ensure | Should -Be $script:resourceWithClaimRuleToAdd.Ensure\n                $configuration.RuleName | Should -Be $script:resourceWithClaimRuleToAdd.RuleName\n                $configuration.PSPOptions | Should -Be $script:resourceWithClaimRuleToAdd.PSPOptions\n                $configuration.Transport | Should -Be $script:resourceWithClaimRuleToAdd.Transport\n                $configuration.Description | Should -Be $script:resourceWithClaimRuleToAdd.Description\n                $configuration.Vendor | Should -Be $emptyProperty\n                $configuration.Boot | Should -Be $false\n                $configuration.Type | Should -Be $script:resourceWithClaimRuleToAdd.Type\n                $configuration.Device | Should -Be $emptyProperty\n                $configuration.Driver | Should -Be $emptyProperty\n                $configuration.ClaimOptions | Should -Be $emptyProperty\n                $configuration.Psp | Should -Be $script:resourceWithClaimRuleToAdd.Psp\n                $configuration.Options | Should -Be $script:resourceWithClaimRuleToAdd.Options\n                $configuration.Model | Should -Be $emptyProperty\n                $configuration.Force | Should -Be $false\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithClaimRuleToRemove)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithClaimRuleToRemove\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithClaimRuleToRemove\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange\n                $emptyProperty = [string]::Empty\n\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithClaimRuleToRemove.Name\n                $configuration.Server | Should -Be $script:resourceWithClaimRuleToRemove.Server\n                $configuration.Ensure | Should -Be $script:resourceWithClaimRuleToRemove.Ensure\n                $configuration.RuleName | Should -Be $script:resourceWithClaimRuleToRemove.RuleName\n                $configuration.PSPOptions | Should -Be $script:resourceWithClaimRuleToRemove.PSPOptions\n                $configuration.Transport | Should -Be $script:resourceWithClaimRuleToRemove.Transport\n                $configuration.Description | Should -Be $script:resourceWithClaimRuleToRemove.Description\n                $configuration.Vendor | Should -Be $emptyProperty\n                $configuration.Boot | Should -Be $false\n                $configuration.Type | Should -Be $script:resourceWithClaimRuleToRemove.Type\n                $configuration.Device | Should -Be $emptyProperty\n                $configuration.Driver | Should -Be $emptyProperty\n                $configuration.ClaimOptions | Should -Be $emptyProperty\n                $configuration.Psp | Should -Be $script:resourceWithClaimRuleToRemove.Psp\n                $configuration.Options | Should -Be $script:resourceWithClaimRuleToRemove.Options\n                $configuration.Model | Should -Be $emptyProperty\n                $configuration.Force | Should -Be $false\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostScsiLun/VMHostScsiLun.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the initial configuration of the SCSI Lun used in the Integration Tests.\n#>\nfunction Get-VMHostScsiLunInitialConfiguration {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiDisk = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n    $scsiLun = Get-ScsiLun -Server $viServer -VmHost $vmHost -CanonicalName $scsiDisk.CanonicalName -ErrorAction Stop -Verbose:$false\n    $scsiLunPath = Get-ScsiLunPath -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false | Where-Object -FilterScript { $_.Preferred }\n\n    $vmHostScsiLunInitialConfiguration = @{\n        ScsiLunCanonicalName = $scsiLun.CanonicalName\n        ScsiLunMultipathPolicy = $scsiLun.MultipathPolicy.ToString()\n        ScsiLunBlocksToSwitchPath = [int] $scsiLun.BlocksToSwitchPath\n        ScsiLunCommandsToSwitchPath = [int] $scsiLun.CommandsToSwitchPath\n        ScsiLunIsLocal = $scsiLun.IsLocal\n        ScsiLunIsSsd = $scsiLun.IsSsd\n        ScsiLunPathName = [string] $scsiLunPath.Name\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostScsiLunInitialConfiguration\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostScsiLun/VMHostScsiLun.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostScsiLun.Integration.Tests.Helpers.ps1\"\n$script:vmHostScsiLunInitialConfiguration = Get-VMHostScsiLunInitialConfiguration\n\n$script:dscResourceName = 'VMHostScsiLun'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostScsiLunResourceName = 'VMHostScsiLun'\n            ScsiLunCanonicalName = $script:vmHostScsiLunInitialConfiguration.ScsiLunCanonicalName\n            InitialScsiLunMultipathPolicy = $script:vmHostScsiLunInitialConfiguration.ScsiLunMultipathPolicy\n            InitialScsiLunBlocksToSwitchPath = $script:vmHostScsiLunInitialConfiguration.ScsiLunBlocksToSwitchPath\n            InitialScsiLunCommandsToSwitchPath = $script:vmHostScsiLunInitialConfiguration.ScsiLunCommandsToSwitchPath\n            InitialScsiLunIsLocal = $script:vmHostScsiLunInitialConfiguration.ScsiLunIsLocal\n            InitialScsiLunIsSsd = $script:vmHostScsiLunInitialConfiguration.ScsiLunIsSsd\n            ScsiLunRoundRobinMultipathPolicy = 'RoundRobin'\n            ScsiLunFixedMultipathPolicy = 'Fixed'\n            ScsiLunBlocksToSwitchPath = 2048\n            ScsiLunCommandsToSwitchPath = 50\n            ScsiLunIsLocal = $script:vmHostScsiLunInitialConfiguration.ScsiLunIsLocal\n            ScsiLunIsSsd = $script:vmHostScsiLunInitialConfiguration.ScsiLunIsSsd\n            ScsiLunPathName = $script:vmHostScsiLunInitialConfiguration.ScsiLunPathName\n            ScsiLunDisabledBlocksToSwitchPath = 0\n            ScsiLunDisabledCommandsToSwitchPath = 0\n        }\n    )\n}\n\n$script:configModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy = \"$($script:dscResourceName)_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config\"\n$script:configModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy = \"$($script:dscResourceName)_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config\"\n$script:configModifyVMHostScsiLunConfigurationToInitialState = \"$($script:dscResourceName)_ModifyVMHostScsiLunConfigurationToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy\\\"\n$script:mofFileModifyVMHostScsiLunConfigurationWithFixedMultipathPolicyPath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy\\\"\n$script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configModifyVMHostScsiLunConfigurationToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy `\n                -OutputPath $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.CanonicalName | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.MultipathPolicy | Should -Be $script:configurationData.AllNodes.ScsiLunRoundRobinMultipathPolicy\n            $configuration.PreferredScsiLunPathName | Should -BeNullOrEmpty\n            $configuration.BlocksToSwitchPath | Should -Be $script:configurationData.AllNodes.ScsiLunBlocksToSwitchPath\n            $configuration.CommandsToSwitchPath | Should -Be $script:configurationData.AllNodes.ScsiLunCommandsToSwitchPath\n            $configuration.IsLocal | Should -Be $script:configurationData.AllNodes.ScsiLunIsLocal\n            $configuration.IsSsd | Should -Be $script:configurationData.AllNodes.ScsiLunIsSsd\n            $configuration.DeletePartitions | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostScsiLunConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy\" {\n        BeforeAll {\n            # Arrange\n            & $script:configModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy `\n                -OutputPath $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy `\n                -OutputPath $script:mofFileModifyVMHostScsiLunConfigurationWithFixedMultipathPolicyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersWithRoundRobinMultipathPolicy = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersWithFixedMultipathPolicy = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationWithFixedMultipathPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersWithRoundRobinMultipathPolicy\n            Start-DscConfiguration @startDscConfigurationParametersWithFixedMultipathPolicy\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationWithFixedMultipathPolicyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.CanonicalName | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.MultipathPolicy | Should -Be $script:configurationData.AllNodes.ScsiLunFixedMultipathPolicy\n            $configuration.PreferredScsiLunPathName | Should -Be $script:configurationData.AllNodes.ScsiLunPathName\n            $configuration.BlocksToSwitchPath | Should -Be $script:configurationData.AllNodes.ScsiLunDisabledBlocksToSwitchPath\n            $configuration.CommandsToSwitchPath | Should -Be $script:configurationData.AllNodes.ScsiLunDisabledCommandsToSwitchPath\n            $configuration.IsLocal | Should -Be $script:configurationData.AllNodes.ScsiLunIsLocal\n            $configuration.IsSsd | Should -Be $script:configurationData.AllNodes.ScsiLunIsSsd\n            $configuration.DeletePartitions | Should -BeNull\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileModifyVMHostScsiLunConfigurationWithFixedMultipathPolicyPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configModifyVMHostScsiLunConfigurationToInitialState `\n                -OutputPath $script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostScsiLunConfigurationWithFixedMultipathPolicyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileModifyVMHostScsiLunConfigurationToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostScsiLunPath/VMHostScsiLunPath.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the initial configuration of the SCSI Lun path used in the Integration Tests.\n#>\nfunction Get-VMHostScsiLunPathInitialConfiguration {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false\n    $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false\n    $scsiDisk = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1\n    $scsiLun = Get-ScsiLun -Server $viServer -VmHost $vmHost -CanonicalName $scsiDisk.CanonicalName -ErrorAction Stop -Verbose:$false\n    $scsiLunPath = Get-ScsiLunPath -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false | Select-Object -First 1\n\n    $vmHostScsiLunPathInitialConfiguration = @{\n        ScsiLunPathName = $scsiLunPath.Name\n        ScsiLunCanonicalName = $scsiLun.CanonicalName\n        State = if ($scsiLunPath.State.ToString() -eq 'Active') { $true } else { $false }\n        Preferred = $scsiLunPath.Preferred\n    }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $vmHostScsiLunPathInitialConfiguration\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostScsiLunPath/VMHostScsiLunPath.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n\n. \"$PSScriptRoot\\VMHostScsiLunPath.Integration.Tests.Helpers.ps1\"\n$script:vmHostScsiLunPathInitialConfiguration = Get-VMHostScsiLunPathInitialConfiguration\n\n$script:dscResourceName = 'VMHostScsiLunPath'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $Name\n            VMHostScsiLunPathResourceName = 'VMHostScsiLunPath'\n            ScsiLunPathName = $script:vmHostScsiLunPathInitialConfiguration.ScsiLunPathName\n            ScsiLunCanonicalName = $script:vmHostScsiLunPathInitialConfiguration.ScsiLunCanonicalName\n            InitialScsiLunPathState = $script:vmHostScsiLunPathInitialConfiguration.State\n            InitialScsiLunPathPreferred = $script:vmHostScsiLunPathInitialConfiguration.Preferred\n            ScsiLunPathActive = $true\n            ScsiLunPathPreferred = $true\n        }\n    )\n}\n\n$script:configConfigureScsiLunPathToBeActiveAndPreferred = \"$($script:dscResourceName)_ConfigureScsiLunPathToBeActiveAndPreferred_Config\"\n$script:configConfigureScsiLunPathToInitialState = \"$($script:dscResourceName)_ConfigureScsiLunPathToInitialState_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileConfigureScsiLunPathToBeActiveAndPreferredPath = \"$script:integrationTestsFolderPath\\$script:configConfigureScsiLunPathToBeActiveAndPreferred\\\"\n$script:mofFileConfigureScsiLunPathToInitialStatePath = \"$script:integrationTestsFolderPath\\$script:configConfigureScsiLunPathToInitialState\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configConfigureScsiLunPathToBeActiveAndPreferred\" {\n        BeforeAll {\n            # Arrange\n            & $script:configConfigureScsiLunPathToBeActiveAndPreferred `\n                -OutputPath $script:mofFileConfigureScsiLunPathToBeActiveAndPreferredPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureScsiLunPathToBeActiveAndPreferredPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureScsiLunPathToBeActiveAndPreferredPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configConfigureScsiLunPathToBeActiveAndPreferred }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.VMHostName | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.ScsiLunPathName\n            $configuration.ScsiLunCanonicalName | Should -Be $script:configurationData.AllNodes.ScsiLunCanonicalName\n            $configuration.Active | Should -Be $script:configurationData.AllNodes.ScsiLunPathActive\n            $configuration.Preferred | Should -Be $script:configurationData.AllNodes.ScsiLunPathPreferred\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileConfigureScsiLunPathToBeActiveAndPreferredPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configConfigureScsiLunPathToInitialState `\n                -OutputPath $script:mofFileConfigureScsiLunPathToInitialStatePath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileConfigureScsiLunPathToInitialStatePath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileConfigureScsiLunPathToBeActiveAndPreferredPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileConfigureScsiLunPathToInitialStatePath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostService.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostService'\n$script:dscConfig = $null\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithServicePolicyUnset = \"$($script:dscResourceName)_WithServicePolicyUnset_Config\"\n$script:configWithServicePolicyOn = \"$($script:dscResourceName)_WithServicePolicyOn_Config\"\n$script:configWithServicePolicyOff = \"$($script:dscResourceName)_WithServicePolicyOff_Config\"\n$script:configWithServicePolicyOnAndRunning = \"$($script:dscResourceName)_WithServicePolicyOnAndRunning_Config\"\n\n$script:connection = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:vmHost = $null\n$script:vmHostService = $null\n$script:vmHostServicePolicy = $null\n\n$script:Key = 'TSM-SSH'\n$script:PolicyUnset = 'Unset'\n$script:PolicyOff = 'Off'\n$script:PolicyOn = 'On'\n$script:RunningFalse = $false\n$script:RunningTrue = $true\n\n$script:resourceWithServicePolicyUnset = @{\n    Name = $Name\n    Server = $Server\n    Key = $script:Key\n    Policy = $script:PolicyUnset\n    Running = $script:RunningFalse\n}\n$script:resourceWithServicePolicyOn = @{\n    Name = $Name\n    Server = $Server\n    Key = $script:Key\n    Policy = $script:PolicyOn\n    Running = $script:RunningFalse\n}\n$script:resourceWithServicePolicyOff = @{\n    Name = $Name\n    Server = $Server\n    Key = $script:Key\n    Policy = $script:PolicyOff\n    Running = $script:RunningFalse\n}\n$script:resourceWithServicePolicyOnAndRunning = @{\n    Name = $Name\n    Server = $Server\n    Key = $script:Key\n    Policy = $script:PolicyOn\n    Running = $script:RunningTrue\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithServicePolicyUnset = \"$script:integrationTestsFolderPath\\$($script:configWithServicePolicyUnset)\\\"\n$script:mofFileWithServicePolicyOn = \"$script:integrationTestsFolderPath\\$($script:configWithServicePolicyOn)\\\"\n$script:mofFileWithServicePolicyOff = \"$script:integrationTestsFolderPath\\$($script:configWithServicePolicyOff)\\\"\n$script:mofFileWithServicePolicyOnAndRunning = \"$script:integrationTestsFolderPath\\$($script:configWithServicePolicyOnAndRunning)\\\"\n\nfunction Invoke-TestSetup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceWithServicePolicyUnset.Name\n    $script:vmHostService = Get-VMHostService -Server $script:connection -VMHost $script:vmHost | Where-Object { $_.Key -eq $script:resourceWithServicePolicyUnset.Key }\n    $script:vmHostServicePolicy = $script:vmHostService.Policy\n}\n\nfunction Invoke-TestCleanup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceWithServicePolicyUnset.Name\n    $script:vmHostService = Get-VMHostService -Server $script:connection -VMHost $script:vmHost | Where-Object { $_.Key -eq $script:resourceWithServicePolicyUnset.Key }\n\n    Set-VMHostService -HostService $script:vmHostService -Policy $script:vmHostServicePolicy -Confirm:$false\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithServicePolicyUnset)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyUnset\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyUnset\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithServicePolicyUnset.Name\n                $configuration.Server | Should -Be $script:resourceWithServicePolicyUnset.Server\n                $configuration.Key | Should -Be $script:resourceWithServicePolicyUnset.Key\n                $configuration.Policy | Should -Be $script:vmHostServicePolicy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithServicePolicyOn)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyOn\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyOn\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration} | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithServicePolicyOn.Name\n                $configuration.Server | Should -Be $script:resourceWithServicePolicyOn.Server\n                $configuration.Key | Should -Be $script:resourceWithServicePolicyOn.Key\n                $configuration.Policy | Should -Be $script:resourceWithServicePolicyOn.Policy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithServicePolicyOff)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyOff\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyOff\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithServicePolicyOff.Name\n                $configuration.Server | Should -Be $script:resourceWithServicePolicyOff.Server\n                $configuration.Key | Should -Be $script:resourceWithServicePolicyOff.Key\n                $configuration.Policy | Should -Be $script:resourceWithServicePolicyOff.Policy\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithServicePolicyOnAndRunning)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyOnAndRunning\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithServicePolicyOnAndRunning\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceWithServicePolicyOnAndRunning.Name\n                $configuration.Server | Should -Be $script:resourceWithServicePolicyOnAndRunning.Server\n                $configuration.Key | Should -Be $script:resourceWithServicePolicyOnAndRunning.Key\n                $configuration.Policy | Should -Be $script:resourceWithServicePolicyOnAndRunning.Policy\n                $configuration.Running | Should -Be $script:resourceWithServicePolicyOnAndRunning.Running\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostSettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostSettings'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:config = \"$($script:dscResourceName)_Config\"\n\n$script:connection = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:vmHost = $null\n\n$script:motd = $null\n$script:issue = $null\n\n$script:motdValue = 'VMHostSettings motd test'\n$script:issueValue = 'VMHostSettings issue test'\n\n$script:resourceProperties = @{\n    Name = $Name\n    Server = $Server\n    Motd = $script:motdValue\n    Issue = $script:issueValue\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFilePath = \"$script:integrationTestsFolderPath\\$($script:config)\\\"\n\nfunction Invoke-TestSetup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceProperties.Name\n\n    $script:motd = Get-AdvancedSetting -Server $script:connection -Entity $script:vmHost -Name \"Config.Etc.motd\"\n    $script:issue = Get-AdvancedSetting -Server $script:connection -Entity $script:vmHost -Name \"Config.Etc.issue\"\n}\n\nfunction Invoke-TestCleanup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceProperties.Name\n\n    Set-AdvancedSetting -AdvancedSetting $script:motd -Value $script:motd.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:issue -Value $script:issue.Value -Confirm:$false\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:config)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceProperties.Name\n                $configuration.Server | Should -Be $script:resourceProperties.Server\n                $configuration.Motd | Should -Be $script:resourceProperties.Motd\n                $configuration.Issue | Should -Be $script:resourceProperties.Issue\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostStorage/VMHostStorage.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction Test-Setup {\n    <#\n    .SYNOPSIS\n\n    Retrieves information about the VMHost storage for the specified VMHost.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n        $script:VMHost = Get-VMHost -Server $script:VIServer -Name $Name\n        $script:VMHostStorage = Get-VMHostStorage -Server $script:VIServer -VMHost $script:VMHost\n\n        $script:InitialSoftwareIScsiEnabled = $script:VMHostStorage.SoftwareIScsiEnabled\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Test-CleanUp {\n    <#\n    .SYNOPSIS\n\n    Restarts the specified VMHost after the Integration Tests.\n    #>\n\n    $defaultErrorActionPreference = $global:ErrorActionPreference\n    $global:ErrorActionPreference = 'Stop'\n\n    try {\n        $script:VIServer = Connect-VIServer -Server $Server -Credential $Credential\n        $script:VMHost = Get-VMHost -Server $script:VIServer -Name $Name\n\n        $script:VMHost = Set-VMHost -Server $script:VIServer -VMHost $script:VMHost -State Maintenance -Confirm:$false\n        Restart-VMHost -Server $script:VIServer -VMHost $script:VMHost -Confirm:$false\n\n        if ($script:VIServer.Connection.ProductLine -eq 'embeddedEsx') {\n            Assert-VMHostIsInDesiredState -VIServer $script:VIServer -DesiredState 'Maintenance' -RequiresVIServerConnection $true\n        }\n        else {\n            Assert-VMHostIsInDesiredState -VIServer $script:VIServer -DesiredState 'NotResponding' -RequiresVIServerConnection $false\n            Assert-VMHostIsInDesiredState -VIServer $script:VIServer -DesiredState 'Maintenance' -RequiresVIServerConnection $false\n        }\n\n        Get-VMHost -Server $script:VIServer -Name $Name | Set-VMHost -Server $script:VIServer -State Connected -Confirm:$false | Out-Null\n    }\n    finally {\n        $global:ErrorActionPreference = $defaultErrorActionPreference\n        Disconnect-VIServer -Server $Server -Confirm:$false\n    }\n}\n\nfunction Assert-VMHostIsInDesiredState {\n    <#\n    .SYNOPSIS\n\n    Asserts that the VMHost used in the Integration Tests is in the\n    specified desired state.\n    #>\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [PSObject] $VIServer,\n\n        [Parameter(Mandatory = $true)]\n        [string] $DesiredState,\n\n        [Parameter(Mandatory = $true)]\n        [bool] $RequiresVIServerConnection\n    )\n\n    $restartTimeoutMinutes = 5\n    $sleepTimeInSeconds = 10\n    $elapsedTimeInSeconds = 0\n\n    while ($true) {\n        $timeSpan = New-TimeSpan -Seconds $elapsedTimeInSeconds\n        if ($timeSpan.Minutes -gt $restartTimeoutMinutes) {\n            throw \"VMHost $Name is not in Maintenance mode.\"\n        }\n\n        Start-Sleep -Seconds $sleepTimeInSeconds\n        $elapsedTimeInSeconds += $sleepTimeInSeconds\n\n        try {\n            if ($RequiresVIServerConnection) {\n                $VIServer = Connect-VIServer -Server $Server -Credential $Credential\n            }\n\n            $vmHost = Get-VMHost -Server $VIServer -Name $Name\n            if ($vmHost.ConnectionState.ToString() -eq $DesiredState) {\n                break\n            }\n        }\n        catch {\n            Write-Verbose -Message \"VMHost $Name is still not in $DesiredState State.\"\n        }\n\n        $vmHost = Get-VMHost -Server $VIServer -Name $Name\n        if ($vmHost.ConnectionState.ToString() -eq $DesiredState) {\n            break\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostStorage/VMHostStorage.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Name\n)\n\n<#\n    The VMHostStorage DSC Resource Integration Tests require a vCenter Server with at\n    least one Datacenter and at least one VMHost located in that Datacenter.\n#>\n\n$newObjectParamsForCredential = @{\n    TypeName = 'System.Management.Automation.PSCredential'\n    ArgumentList = @(\n        $User,\n        (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n    )\n}\n$script:Credential = New-Object @newObjectParamsForCredential\n\n$script:DscResourceName = 'VMHostStorage'\n$script:ConfigurationsPath = Join-Path -Path $PSScriptRoot -ChildPath \"$($script:DscResourceName)_Config.ps1\"\n\n. \"$PSScriptRoot\\$script:DscResourceName.Integration.Tests.Helpers.ps1\"\nTest-Setup\n\n$script:ConfigurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $script:Credential\n            VMHostName = $Name\n            VMHostStorageDscResourceName = 'VMHostStorage'\n            InitialSoftwareIScsiEnabled = $script:InitialSoftwareIScsiEnabled\n            SoftwareIScsiEnabled = $true\n            SoftwareIScsiDisabled = $false\n        }\n    )\n}\n\n. $script:ConfigurationsPath -Verbose:$true -ErrorAction Stop\n\n$script:EnableSoftwareIscsiConfigurationName = \"$($script:DscResourceName)_EnableSoftwareIscsi_Config\"\n$script:DisableSoftwareIscsiConfigurationName = \"$($script:DscResourceName)_DisableSoftwareIscsi_Config\"\n$script:SoftwareIscsiToInitialStateConfigurationName = \"$($script:DscResourceName)_SoftwareIscsiToInitialState_Config\"\n\n$script:EnableSoftwareIscsiMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:EnableSoftwareIscsiConfigurationName\n$script:DisableSoftwareIscsiMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:DisableSoftwareIscsiConfigurationName\n$script:SoftwareIscsiToInitialStateMofFilePath = Join-Path -Path $PSScriptRoot -ChildPath $script:SoftwareIscsiToInitialStateConfigurationName\n\nDescribe \"$($script:DscResourceName)_Integration\" {\n    AfterAll {\n        # Arrange\n        & $script:SoftwareIscsiToInitialStateConfigurationName `\n            -OutputPath $script:SoftwareIscsiToInitialStateMofFilePath `\n            -ConfigurationData $script:ConfigurationData `\n            -ErrorAction Stop\n\n        $startDscConfigurationParamsSoftwareIscsiToInitialState = @{\n            Path = $script:SoftwareIscsiToInitialStateMofFilePath\n            ComputerName = $script:ConfigurationData.AllNodes.NodeName\n            Wait = $true\n            Force = $true\n            Verbose = $true\n            ErrorAction = 'Stop'\n        }\n\n        # Act && Assert\n        { Start-DscConfiguration @startDscConfigurationParamsSoftwareIscsiToInitialState } | Should -Not -Throw\n        Test-CleanUp\n\n        Remove-Item -Path $script:SoftwareIscsiToInitialStateMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n    }\n\n    Context 'When enabling software iSCSI' {\n        BeforeAll {\n            # Arrange\n            & $script:DisableSoftwareIscsiConfigurationName `\n                -OutputPath $script:DisableSoftwareIscsiMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsDisableSoftwareIscsi = @{\n                Path = $script:DisableSoftwareIscsiMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsDisableSoftwareIscsi } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:EnableSoftwareIscsiConfigurationName `\n                    -OutputPath $script:EnableSoftwareIscsiMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsEnableSoftwareIscsi = @{\n                    Path = $script:EnableSoftwareIscsiMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsEnableSoftwareIscsi } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:EnableSoftwareIscsiMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:EnableSoftwareIscsiMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:EnableSoftwareIscsiConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostStorageDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostStorageDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostStorageDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostStorageDscResource.Enabled | Should -Be $script:ConfigurationData.AllNodes.SoftwareIScsiEnabled\n        }\n\n        AfterAll {\n            Remove-Item -Path $script:DisableSoftwareIscsiMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:EnableSoftwareIscsiMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n\n    Context 'When disabling software iSCSI' {\n        BeforeAll {\n            # Arrange\n            & $script:EnableSoftwareIscsiConfigurationName `\n                -OutputPath $script:EnableSoftwareIscsiMofFilePath `\n                -ConfigurationData $script:ConfigurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParamsEnableSoftwareIscsi = @{\n                Path = $script:EnableSoftwareIscsiMofFilePath\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParamsEnableSoftwareIscsi } | Should -Not -Throw\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                & $script:DisableSoftwareIscsiConfigurationName `\n                    -OutputPath $script:DisableSoftwareIscsiMofFilePath `\n                    -ConfigurationData $script:ConfigurationData `\n                    -ErrorAction Stop\n\n                $startDscConfigurationParamsDisableSoftwareIscsi = @{\n                    Path = $script:DisableSoftwareIscsiMofFilePath\n                    ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                    Wait = $true\n                    Force = $true\n                    Verbose = $true\n                    ErrorAction = 'Stop'\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParamsDisableSoftwareIscsi } | Should -Not -Throw\n            }\n        }\n\n        It 'Should be able to call Test-DscConfiguration without throwing' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:DisableSoftwareIscsiMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Test-DscConfiguration @testDscConfigurationParams } | Should -Not -Throw\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $joinPathParams = @{\n                Path = $script:DisableSoftwareIscsiMofFilePath\n                ChildPath = \"$($script:ConfigurationData.AllNodes.NodeName).mof\"\n            }\n\n            $testDscConfigurationParams = @{\n                ReferenceConfiguration = Join-Path @joinPathParams\n                ComputerName = $script:ConfigurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParams).InDesiredState | Should -BeTrue\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose:$true -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange\n            $whereObjectParams = @{\n                FilterScript = {\n                    $_.ConfigurationName -eq $script:DisableSoftwareIscsiConfigurationName\n                }\n            }\n\n            # Act\n            $VMHostStorageDscResource = Get-DscConfiguration -Verbose:$true -ErrorAction Stop | Where-Object @whereObjectParams\n\n            # Assert\n            $VMHostStorageDscResource.Server | Should -Be $script:ConfigurationData.AllNodes.Server\n            $VMHostStorageDscResource.Name | Should -Be $script:ConfigurationData.AllNodes.VMHostName\n            $VMHostStorageDscResource.Enabled | Should -Be $script:ConfigurationData.AllNodes.SoftwareIScsiDisabled\n        }\n\n        AfterAll {\n            Remove-Item -Path $script:EnableSoftwareIscsiMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n            Remove-Item -Path $script:DisableSoftwareIscsiMofFilePath -Recurse -Confirm:$false -Verbose:$true -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostStorage/VMHostStorage_Config.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nConfiguration VMHostStorage_EnableSoftwareIscsi_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostStorage $AllNodes.VMHostStorageDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enabled = $AllNodes.SoftwareIScsiEnabled\n        }\n    }\n}\n\nConfiguration VMHostStorage_DisableSoftwareIscsi_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostStorage $AllNodes.VMHostStorageDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enabled = $AllNodes.SoftwareIScsiDisabled\n        }\n    }\n}\n\nConfiguration VMHostStorage_SoftwareIscsiToInitialState_Config {\n    Import-DscResource -ModuleName 'VMware.vSphereDSC'\n\n    Node $AllNodes.NodeName {\n        VMHostStorage $AllNodes.VMHostStorageDscResourceName {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = $AllNodes.VMHostName\n            Enabled = $AllNodes.InitialSoftwareIScsiEnabled\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostSyslog.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the needed LogHosts from the Server. If there are no LogHosts on the Server, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $vmHost = Get-VMHost -Server $viServer -Name $Name\n    $networkSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.NetworkSystem\n    $dnsAddress = $networkSystem.NetworkConfig.DnsConfig.Address\n    if ($dnsAddress.Length -lt 2) {\n        throw \"The DNS should have at least two configured addresses because they will be used in the Integration Tests for specifying the Remote Hosts for the Syslog config.\"\n    }\n\n    $script:logHostOne = \"udp://$($dnsAddress[0]):514\"\n    $script:logHostTwo = \"udp://$($dnsAddress[1]):514\"\n}\n\nInvoke-TestSetup\n\n$script:dscResourceName = 'VMHostSyslog'\n$script:moduleFolderPath = (Get-Module 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithDefaultSettings = \"$($script:dscResourceName)_WithDefaultSettings_Config\"\n$script:configWithNotDefaultSettings = \"$($script:dscResourceName)_WithNotDefaultSettings_Config\"\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -LogHostOne $script:logHostOne -LogHostTwo $script:logHostTwo\n\n$script:mofFileWithDefaultSettings = \"$script:integrationTestsFolderPath\\$($script:configWithDefaultSettings)\\\"\n$script:mofFileWithNotDefaultSettings = \"$script:integrationTestsFolderPath\\$($script:configWithNotDefaultSettings)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithDefaultSettings)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithDefaultSettings\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithDefaultSettings\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $Name\n                $configuration.Server | Should -Be $Server\n                $configuration.LogHost | Should -Be $script:logHostOne\n                $configuration.CheckSslCerts = $script:checkSslCerts\n                $configuration.DefaultRotate = $script:defaultRotate\n                $configuration.DefaultSize = $script:defaultSize\n                $configuration.DefaultTimeout = $script:defaultTimeout\n                $configuration.Logdir = $script:logdirOne\n                $configuration.LogdirUnique = $script:logdirUnique\n                $configuration.DropLogRotate = $script:dropLogRotate\n                $configuration.DropLogSize = $script:dropLogSize\n                $configuration.QueueDropMark = $script:queueDropMark\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithNotDefaultSettings)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNotDefaultSettings\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNotDefaultSettings\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $Name\n                $configuration.Server | Should -Be $Server\n                $configuration.LogHost | Should -Be $script:logHostTwo\n                $configuration.CheckSslCerts = !$script:checkSslCerts\n                $configuration.DefaultRotate = $script:defaultRotate + 1\n                $configuration.DefaultSize = $script:defaultSize + 1\n                $configuration.DefaultTimeout = $script:defaultTimeout + 1\n                $configuration.Logdir = $script:logdirTwo\n                $configuration.LogdirUnique = !$script:logdirUnique\n                $configuration.DropLogRotate = $script:dropLogRotate + 1\n                $configuration.DropLogSize = $script:dropLogSize + 1\n                $configuration.QueueDropMark = $script:queueDropMark + 1\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostTpsSettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:dscResourceName = 'VMHostTpsSettings'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:config = \"$($script:dscResourceName)_Config\"\n\n$script:connection = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:vmHost = $null\n\n$script:shareScanTime = $null\n$script:shareScanGHz = $null\n$script:shareRateMax = $null\n$script:shareForceSalting = $null\n\n$script:shareScanTimeTestValue = 50\n$script:shareForceSaltingTestValue = 1\n\n$script:resourceProperties = @{\n    Name = $Name\n    Server = $Server\n    ShareScanTime = $script:shareScanTimeTestValue\n    ShareForceSalting = $script:shareForceSaltingTestValue\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFilePath = \"$script:integrationTestsFolderPath\\$($script:config)\\\"\n\nfunction Invoke-TestSetup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceProperties.Name\n\n    $script:shareScanTime = Get-AdvancedSetting -Server $script:connection -Entity $script:vmHost -Name \"Mem.ShareScanTime\"\n    $script:shareScanGHz = Get-AdvancedSetting -Server $script:connection -Entity $script:vmHost -Name \"Mem.ShareScanGHz\"\n    $script:shareRateMax = Get-AdvancedSetting -Server $script:connection -Entity $script:vmHost -Name \"Mem.ShareRateMax\"\n    $script:shareForceSalting = Get-AdvancedSetting -Server $script:connection -Entity $script:vmHost -Name \"Mem.ShareForceSalting\"\n}\n\nfunction Invoke-TestCleanup {\n    $script:vmHost = Get-VMHost -Server $script:connection -Name $script:resourceProperties.Name\n\n    Set-AdvancedSetting -AdvancedSetting $script:shareScanTime -Value $script:shareScanTime.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:shareForceSalting -Value $script:shareForceSalting.Value -Confirm:$false\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:config)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFilePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act && Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Name | Should -Be $script:resourceProperties.Name\n                $configuration.Server | Should -Be $script:resourceProperties.Server\n                $configuration.ShareScanTime | Should -Be $script:shareScanTimeTestValue\n                $configuration.ShareScanGHz | Should -Be $script:shareScanGHz.Value\n                $configuration.ShareRateMax | Should -Be $script:shareRateMax.Value\n                $configuration.ShareForceSalting | Should -Be $script:shareForceSaltingTestValue\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostVss/VMHostVss.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:dscResourceName = 'VMHostVss'\n$script:moduleFolderPath = (Get-Module -Name $script:moduleName -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithNewVss = \"$($script:dscResourceName)_New_Config\"\n$script:configWithModifyVss = \"$($script:dscResourceName)_Modify_Config\"\n$script:configWithRemoveVss = \"$($script:dscResourceName)_Remove_Config\"\n\n$script:VssName = 'VSSDSC'\n$script:Mtu = 1500\n$script:Present = 'Present'\n$script:Absent = 'Absent'\n\n$script:resourceWithNewVss = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    Mtu = $script:Mtu\n}\n$script:resourceWithModifyVss = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    Mtu = $script:Mtu + 1\n}\n$script:resourceWithRemoveVss = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Absent\n    VssName = $script:VssName\n    Mtu = $script:Mtu\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithNewVss = \"$script:integrationTestsFolderPath\\$($script:configWithNewVss)\\\"\n$script:mofFileWithModifyVss = \"$script:integrationTestsFolderPath\\$($script:configWithModifyVss)\\\"\n$script:mofFileWithRemoveVss = \"$script:integrationTestsFolderPath\\$($script:configWithRemoveVss)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithNewVss)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNewVss\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithNewVss\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithNewVss.Server\n                $configuration.Name | Should -Be $script:resourceWithNewVss.Name\n                $configuration.Ensure | Should -Be $script:resourceWithNewVss.Ensure\n                $configuration.VssName | Should -Be $script:resourceWithNewVss.VssName\n                $configuration.Mtu | Should -Be $script:resourceWithNewVss.Mtu\n                $configuration.Ensure | Should -Be $script:resourceWithNewVss.Ensure\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithModifyVss)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVss\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVss\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithModifyVss.Server\n                $configuration.Name | Should -Be $script:resourceWithModifyVss.Name\n                $configuration.Ensure | Should -Be $script:resourceWithModifyVss.Ensure\n                $configuration.VssName | Should -Be $script:resourceWithModifyVss.VssName\n                $configuration.Mtu | Should -Be $script:resourceWithModifyVss.Mtu\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithRemoveVss)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVss\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVss\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithRemoveVss.Server\n                $configuration.Name | Should -Be $script:resourceWithRemoveVss.Name\n                $configuration.VssName | Should -Be $script:resourceWithRemoveVss.VssName\n                $configuration.Ensure | Should -Be $script:resourceWithRemoveVss.Ensure\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostVss/VMHostVssBridge.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the pNics that are unused from the Server. If there are not available unused pNics on the Server, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $availableNetworkAdapters = Get-VMHostNetworkAdapter -Server $viServer | Where-Object { $_.Id -Match 'PhysicalNic' -and $_.BitRatePerSec -eq 0 }\n    if ($availableNetworkAdapters.Length -lt 2) {\n        throw \"The VSS that is used in the Integration Tests requires 2 unused pNICs to be available on the ESXi node.\"\n    }\n\n    $script:nicDevice = @($availableNetworkAdapters[0].Name, $availableNetworkAdapters[1].Name)\n    $script:nicDeviceAlt = @($availableNetworkAdapters[0].Name)\n}\n\nInvoke-TestSetup\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:dscResourceName = 'VMHostVssBridge'\n$script:dscDependResourceName = 'VMHostVss'\n$script:moduleFolderPath = (Get-Module -Name $script:moduleName -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithCreateVssBridge = \"$($script:dscResourceName)_Create_Config\"\n$script:configWithModifyVssBridge = \"$($script:dscResourceName)_Modify_Config\"\n$script:configWithRemoveVssBridge = \"$($script:dscResourceName)_Remove_Config\"\n\n$script:VssName = 'VSSDSC'\n$script:BeaconInterval = 1\n$script:BeaconIntervalAlt = 5\n$script:LinkDiscoveryProtocolProtocol = 'CDP'\n$script:LinkDiscoveryProtocolOperation = 'Listen'\n$script:LinkDiscoveryProtocolProtocolAlt = 'CDP'\n$script:LinkDiscoveryProtocolOperationAlt = 'Both'\n$script:Present = 'Present'\n$script:Absent = 'Absent'\n\n$script:resourceWithCreateVssBridge = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    NicDevice = $script:nicDevice\n    BeaconInterval = $script:BeaconInterval\n    LinkDiscoveryProtocolProtocol = $script:LinkDiscoveryProtocolProtocol\n    LinkDiscoveryProtocolOperation = $script:LinkDiscoveryProtocolOperation\n    DependsOn = \"[VMHostVss]vmHostVssSettings\"\n}\n$script:resourceWithModifyVssBridge = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    NicDevice = $script:nicDeviceAlt\n    BeaconInterval = $script:BeaconIntervalAlt\n    LinkDiscoveryProtocolProtocol = $script:LinkDiscoveryProtocolProtocolAlt\n    LinkDiscoveryProtocolOperation = $script:LinkDiscoveryProtocolOperationAlt\n    DependsOn = \"[VMHostVss]vmHostVssSettings\"\n}\n$script:resourceWithRemoveVssBridge = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Absent\n    VssName = $script:VssName\n    DependsOn = \"[VMHostVss]vmHostVssSettings\"\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -NicDevice $script:nicDevice -NicDeviceAlt $script:nicDeviceAlt\n\n$script:mofFileWithCreateVssBridge = \"$script:integrationTestsFolderPath\\$($script:configWithCreateVssBridge)\\\"\n$script:mofFileWithModifyVssBridge = \"$script:integrationTestsFolderPath\\$($script:configWithModifyVssBridge)\\\"\n$script:mofFileWithRemoveVssBridge = \"$script:integrationTestsFolderPath\\$($script:configWithRemoveVssBridge)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithCreateVssBridge)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithCreateVssBridge\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithCreateVssBridge\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithCreateVssBridge.Server\n                $configuration.Name | Should -Be $script:resourceWithCreateVssBridge.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithCreateVssBridge.VssName\n                $configuration.NicDevice | Should  -Be $script:resourceWithCreateVssBridge.NicDevice\n                $configuration.BeaconInterval | Should  -Be $script:resourceWithCreateVssBridge.BeaconInterval\n                $configuration.LinkDiscoveryProtocolProtocol | Should  -Be $script:resourceWithCreateVssBridge.LinkDiscoveryProtocolProtocol\n                $configuration.LinkDiscoveryProtocolOperation | Should  -Be $script:resourceWithCreateVssBridge.LinkDiscoveryProtocolOperation\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n\n        Context \"When using configuration $($script:configWithModifyVssBridge)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssBridge\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssBridge\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithModifyVssBridge.Server\n                $configuration.Name | Should -Be $script:resourceWithModifyVssBridge.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithModifyVssBridge.VssName\n                $configuration.NicDevice | Should  -Be $script:resourceWithModifyVssBridge.NicDevice\n                $configuration.BeaconInterval | Should  -Be $script:resourceWithModifyVssBridge.BeaconInterval\n                $configuration.LinkDiscoveryProtocolProtocol | Should  -Be $script:resourceWithModifyVssBridge.LinkDiscoveryProtocolProtocol\n                $configuration.LinkDiscoveryProtocolOperation | Should  -Be $script:resourceWithModifyVssBridge.LinkDiscoveryProtocolOperation\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n\n        Context \"When using configuration $($script:configWithRemoveVssBridge)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssBridge\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssBridge\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithRemoveVssBridge.Server\n                $configuration.Name | Should -Be $script:resourceWithRemoveVssBridge.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithRemoveVssBridge.VssName\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostVss/VMHostVssSecurity.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:dscResourceName = 'VMHostVssSecurity'\n$script:dscDependResourceName = 'VMHostVss'\n$script:moduleFolderPath = (Get-Module -Name $script:moduleName -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithModifyVssSecurity = \"$($script:dscResourceName)_Modify_Config\"\n$script:configWithRemoveVssSecurity = \"$($script:dscResourceName)_Remove_Config\"\n\n$script:VssName = 'VSSDSC'\n$script:AllowPromiscuous = $false\n$script:ForgedTransmits = $true\n$script:MacChanges = $true\n$script:Present = 'Present'\n$script:Absent = 'Absent'\n\n$script:resourceWithModifyVssSecurity = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    AllowPromiscuous = -not $script:AllowPromiscuous\n    ForgedTransmits = -not $script:ForgedTransmits\n    MacChanges = -not $script:MacChanges\n}\n$script:resourceWithRemoveVssSecurity = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Absent\n    VssName = $script:VssName\n    AllowPromiscuous = $script:AllowPromiscuous\n    ForgedTransmits = $script:ForgedTransmits\n    MacChanges = $script:MacChanges\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithModifyVssSecurity = \"$script:integrationTestsFolderPath\\$($script:configWithModifyVssSecurity)\\\"\n$script:mofFileWithRemoveVssSecurity = \"$script:integrationTestsFolderPath\\$($script:configWithRemoveVssSecurity)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithModifyVssSecurity)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssSecurity\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssSecurity\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | where-object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithModifyVssSecurity.Server\n                $configuration.Name | Should -Be $script:resourceWithModifyVssSecurity.Name\n                $configuration.Ensure | Should -Be $script:resourceWithModifyVssSecurity.Ensure\n                $configuration.VssName | Should -Be $script:resourceWithModifyVssSecurity.VssName\n                $configuration.AllowPromiscuous | Should -Be $script:resourceWithModifyVssSecurity.AllowPromiscuous\n                $configuration.ForgedTransmits | Should -Be $script:resourceWithModifyVssSecurity.ForgedTransmits\n                $configuration.MacChanges | Should -Be $script:resourceWithModifyVssSecurity.MacChanges\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n\n        Context \"When using configuration $($script:configWithRemoveVssSecurity)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssSecurity\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Assert\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssSecurity\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | where-object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithRemoveVssSecurity.Server\n                $configuration.Name | Should -Be $script:resourceWithRemoveVssSecurity.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithRemoveVssSecurity.VssName\n                $configuration.AllowPromiscuous | Should -Be $script:resourceWithRemoveVssSecurity.AllowPromiscuous\n                $configuration.ForgedTransmits | Should -Be $script:resourceWithRemoveVssSecurity.ForgedTransmits\n                $configuration.MacChanges | Should -Be $script:resourceWithRemoveVssSecurity.MacChanges\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n    }\n}\nfinally {\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostVss/VMHostVssShaping.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:dscResourceName = 'VMHostVssShaping'\n$script:dscDependResourceName = 'VMHostVss'\n$script:moduleFolderPath = (Get-Module -Name $script:moduleName -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithModifyVssShaping = \"$($script:dscResourceName)_Modify_Config\"\n$script:configWithRemoveVssShaping = \"$($script:dscResourceName)_Remove_Config\"\n\n$script:VssName = 'VSSDSC'\n$script:AverageBandwidth = 100000\n$script:BurstSize = 100000\n$script:Enabled = $false\n$script:PeakBandwidth = 100000\n$script:Present = 'Present'\n$script:Absent = 'Absent'\n\n$script:resourceWithModifyVssShaping = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    AverageBandwidth = $script:AverageBandwidth + 1\n    BurstSize = $script:BurstSize + 1\n    Enabled = -not $script:Enabled\n    PeakBandwidth = $script:PeakBandwidth + 1\n}\n$script:resourceWithRemoveVssShaping = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Absent\n    VssName = $script:VssName\n    AverageBandwidth = $script:AverageBandwidth\n    BurstSize = $script:BurstSize\n    Enabled = $script:Enabled\n    PeakBandwidth = $script:PeakBandwidth\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password\n\n$script:mofFileWithModifyVssShaping = \"$script:integrationTestsFolderPath\\$($script:configWithModifyVssShaping)\\\"\n$script:mofFileWithRemoveVssShaping = \"$script:integrationTestsFolderPath\\$($script:configWithRemoveVssShaping)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithModifyVssShaping)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssShaping\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssShaping\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | where-object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithModifyVssShaping.Server\n                $configuration.Name | Should -Be $script:resourceWithModifyVssShaping.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithModifyVssShaping.VssName\n                $configuration.AverageBandwidth | Should -Be $script:resourceWithModifyVssShaping.AverageBandwidth\n                $configuration.BurstSize | Should -Be $script:resourceWithModifyVssShaping.BurstSize\n                $configuration.Enabled | Should -Be $script:resourceWithModifyVssShaping.Enabled\n                $configuration.PeakBandwidth | Should -Be $script:resourceWithModifyVssShaping.PeakBandwidth\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n\n        Context \"When using configuration $($script:configWithRemoveVssShaping)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssShaping\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Assert\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssShaping\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | where-object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithRemoveVssShaping.Server\n                $configuration.Name | Should -Be $script:resourceWithRemoveVssShaping.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithRemoveVssShaping.VssName\n                $configuration.AverageBandwidth | Should -Be $script:resourceWithRemoveVssShaping.AverageBandwidth\n                $configuration.BurstSize | Should -Be $script:resourceWithRemoveVssShaping.BurstSize\n                $configuration.Enabled | Should -Be $script:resourceWithRemoveVssShaping.Enabled\n                $configuration.PeakBandwidth | Should -Be $script:resourceWithRemoveVssShaping.PeakBandwidth\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVss' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n    }\n}\nfinally {\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/VMHostVss/VMHostVssTeaming.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Retrieves the pNics that are unused from the Server. If there are not available unused pNics on the Server, it throws an error.\nfunction Invoke-TestSetup {\n    $viServer = Connect-VIServer -Server $Server -User $User -Password $Password\n    $availableNetworkAdapters = Get-VMHostNetworkAdapter -Server $viServer | Where-Object { $_.Id -Match 'PhysicalNic' -and $_.BitRatePerSec -eq 0 }\n    if ($availableNetworkAdapters.Length -lt 2) {\n        throw \"The VSS that is used in the Integration Tests requires 2 unused pNICs to be available on the ESXi node.\"\n    }\n\n    $script:activeNic = @($availableNetworkAdapters[0].Name, $availableNetworkAdapters[1].Name)\n    $script:activeNicAlt = @($availableNetworkAdapters[0].Name)\n    $script:standbyNic = @()\n    $script:standbyNicAlt = @($availableNetworkAdapters[1].Name)\n}\n\nInvoke-TestSetup\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:dscResourceName = 'VMHostVssTeaming'\n$script:dscDependResourceName = 'VMHostVssBridge'\n$script:moduleFolderPath = (Get-Module -Name $script:moduleName -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithModifyVssTeaming = \"$($script:dscResourceName)_Modify_Config\"\n$script:configWithRemoveVssTeaming = \"$($script:dscResourceName)_Remove_Config\"\n\n$script:VssName = 'VSSDSC'\n$script:AverageBandwidth = 100000\n$script:CheckBeacon = $false\n$script:NotifySwitches = $true\n$script:Policy = 'loadbalance_srcid'\n$script:PolicyAlt = 'loadbalance_ip'\n$script:RollingOrder = $false\n$script:Present = 'Present'\n$script:Absent = 'Absent'\n\n$script:resourceWithModifyVssTeaming = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Present\n    VssName = $script:VssName\n    CheckBeacon = -not $script:CheckBeacon\n    ActiveNic = $script:activeNic\n    StandbyNic = $script:standbyNic\n    NotifySwitches = -not $script:NotifySwitches\n    Policy = $script:PolicyAlt\n    RollingOrder = -not $script:RollingOrder\n}\n$script:resourceWithRemoveVssTeaming = @{\n    Name = $Name\n    Server = $Server\n    Ensure = $script:Absent\n    VssName = $script:VssName\n    CheckBeacon = $script:CheckBeacon\n    ActiveNic = @()\n    StandbyNic = @()\n    NotifySwitches = $script:NotifySwitches\n    Policy = $script:Policy\n    RollingOrder = $script:RollingOrder\n}\n\n. $script:configurationFile -Name $Name -Server $Server -User $User -Password $Password -ActiveNic $script:activeNic -ActiveNicAlt $script:activeNicAlt -StandbyNic $script:standbyNic -StandbyNicAlt $script:standbyNicAlt\n\n$script:mofFileWithModifyVssTeaming = \"$script:integrationTestsFolderPath\\$($script:configWithModifyVssTeaming)\\\"\n$script:mofFileWithRemoveVssTeaming = \"$script:integrationTestsFolderPath\\$($script:configWithRemoveVssTeaming)\\\"\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithModifyVssTeaming)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssTeaming\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithModifyVssTeaming\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | where-object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithModifyVssTeaming.Server\n                $configuration.Name | Should -Be $script:resourceWithModifyVssTeaming.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithModifyVssTeaming.VssName\n                $configuration.CheckBeacon | Should -Be $script:resourceWithModifyVssTeaming.CheckBeacon\n                $configuration.ActiveNic | Should -Be $script:resourceWithModifyVssTeaming.ActiveNic\n                $configuration.StandbyNic | Should -Be $script:resourceWithModifyVssTeaming.StandbyNic\n                $configuration.NotifySwitches | Should -Be $script:resourceWithModifyVssTeaming.NotifySwitches\n                $configuration.Policy | Should -Be $script:resourceWithModifyVssTeaming.Policy\n                $configuration.RollingOrder | Should -Be $script:resourceWithModifyVssTeaming.RollingOrder\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVssBridge' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n\n        Context \"When using configuration $($script:configWithRemoveVssTeaming)\" {\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssTeaming\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithRemoveVssTeaming\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act & Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Act & Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all the parameters should match' {\n                # Act\n                $configuration = Get-DscConfiguration | where-object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithRemoveVssTeaming.Server\n                $configuration.Name | Should -Be $script:resourceWithRemoveVssTeaming.Name\n                $configuration.Ensure | Should -Be $script:Present\n                $configuration.VssName | Should -Be $script:resourceWithRemoveVssTeaming.VssName\n                $configuration.CheckBeacon | Should -Be $script:resourceWithRemoveVssTeaming.CheckBeacon\n                $configuration.ActiveNic | Should -Be $script:resourceWithRemoveVssTeaming.ActiveNic\n                $configuration.StandbyNic | Should -Be $script:resourceWithRemoveVssTeaming.StandbyNic\n                $configuration.NotifySwitches | Should -Be $script:resourceWithRemoveVssTeaming.NotifySwitches\n                $configuration.Policy | Should -Be $script:resourceWithRemoveVssTeaming.Policy\n                $configuration.RollingOrder | Should -Be $script:resourceWithRemoveVssTeaming.RollingOrder\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n\n            It 'Should depend on resource VMHostVssBridge' {\n                # Act\n                $currentResource = Get-DscConfiguration | Where-Object { $_.ResourceId -match $script:dscResourceName }\n\n                # Assert\n                $currentResource.DependsOn | Should -Match $script:dscDependResourceName\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/vCenterSettings.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'vCenterSettings'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithLoggingLevel = \"$($script:dscResourceName)_WithLoggingLevel_Config\"\n$script:configWithEventMaxAge = \"$($script:dscResourceName)_WithEventMaxAge_Config\"\n$script:configWithTaskMaxAge = \"$($script:dscResourceName)_WithTaskMaxAge_Config\"\n$script:configWithMotdAndIssue = \"$($script:dscResourceName)_WithMotdAndIssue_Config\"\n\n$script:vCenter = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:vCenterCurrentAdvancedSettings = $null\n$script:currentLoggingLevel = $null\n$script:currentEventMaxAgeEnabled = $null\n$script:currentEventMaxAge = $null\n$script:currentTaskMaxAgeEnabled = $null\n$script:currentTaskMaxAge = $null\n$script:currentMotd = $null\n$script:currentIssue = $null\n\n$script:loggingLevel = 'Warning'\n$script:eventMaxAgeEnabled = $false\n$script:eventMaxAge = 40\n$script:taskMaxAgeEnabled = $false\n$script:taskMaxAge = 40\n$script:motd = 'vCenterSettings motd test'\n$script:issue = 'vCenterSettings issue test'\n\n$script:resourceWithLoggingLevel = @{\n    Server = $Server\n    LoggingLevel = $script:loggingLevel\n}\n\n$script:resourceWithEventMaxAge = @{\n    Server = $Server\n    EventMaxAgeEnabled = $script:eventMaxAgeEnabled\n    EventMaxAge = $script:eventMaxAge\n}\n\n$script:resourceWithTaskMaxAge = @{\n    Server = $Server\n    TaskMaxAgeEnabled = $script:taskMaxAgeEnabled\n    TaskMaxAge = $script:taskMaxAge\n}\n\n$script:resourceWithMotdAndIssue = @{\n    Server = $Server\n    Motd = $script:motd\n    Issue = $script:issue\n}\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWithLoggingLevelPath = \"$script:integrationTestsFolderPath\\$($script:configWithLoggingLevel)\\\"\n$script:mofFileWithEventMaxAgePath = \"$script:integrationTestsFolderPath\\$($script:configWithEventMaxAge)\\\"\n$script:mofFileWithTaskMaxAgePath = \"$script:integrationTestsFolderPath\\$($script:configWithTaskMaxAge)\"\n$script:mofFileWithMotdAndIssuePath = \"$script:integrationTestsFolderPath\\$($script:configWithMotdAndIssue)\\\"\n\nfunction Invoke-TestSetup {\n    $script:vCenterCurrentAdvancedSettings = Get-AdvancedSetting -Server $script:vCenter -Entity $script:vCenter\n\n    $script:currentLoggingLevel = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"log.level\" }\n    $script:currentEventMaxAgeEnabled = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"event.maxAgeEnabled\" }\n    $script:currentEventMaxAge = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"event.maxAge\" }\n    $script:currentTaskMaxAgeEnabled = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"task.maxAgeEnabled\" }\n    $script:currentTaskMaxAge = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"task.maxAge\" }\n    $script:currentMotd = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"etc.motd\"}\n    $script:currentIssue = $script:vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq \"etc.issue\"}\n}\n\nfunction Invoke-TestCleanup {\n    Set-AdvancedSetting -AdvancedSetting $script:currentLoggingLevel -Value $script:currentLoggingLevel.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:currentEventMaxAgeEnabled -Value $script:currentEventMaxAgeEnabled.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:currentEventMaxAge -Value $script:currentEventMaxAge.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:currentTaskMaxAgeEnabled -Value $script:currentTaskMaxAgeEnabled.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:currentTaskMaxAge -Value $script:currentTaskMaxAge.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:currentMotd -Value $script:currentMotd.Value -Confirm:$false\n    Set-AdvancedSetting -AdvancedSetting $script:currentIssue -Value $script:currentIssue.Value -Confirm:$false\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithLoggingLevel)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithLoggingLevelPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithLoggingLevelPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithLoggingLevel.Server\n                $configuration.LoggingLevel | Should -Be $script:resourceWithLoggingLevel.LoggingLevel\n                $configuration.EventMaxAgeEnabled | Should -Be ($script:currentEventMaxAgeEnabled).Value\n                $configuration.EventMaxAge | Should -Be ($script:currentEventMaxAge).Value\n                $configuration.TaskMaxAgeEnabled | Should -Be ($script:currentTaskMaxAgeEnabled).Value\n                $configuration.TaskMaxAge | Should -Be ($script:currentTaskMaxAge).Value\n                $configuration.Motd | Should -Be ($script:currentMotd).Value\n                $configuration.Issue | Should -Be ($script:currentIssue).Value\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithEventMaxAge)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithEventMaxAgePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithEventMaxAgePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithEventMaxAge.Server\n                $configuration.LoggingLevel | Should -Be ($script:currentLoggingLevel).Value\n                $configuration.EventMaxAgeEnabled | Should -Be $script:resourceWithEventMaxAge.EventMaxAgeEnabled\n                $configuration.EventMaxAge | Should -Be $script:resourceWithEventMaxAge.EventMaxAge\n                $configuration.TaskMaxAgeEnabled | Should -Be ($script:currentTaskMaxAgeEnabled).Value\n                $configuration.TaskMaxAge | Should -Be ($script:currentTaskMaxAge).Value\n                $configuration.Motd | Should -Be ($script:currentMotd).Value\n                $configuration.Issue | Should -Be ($script:currentIssue).Value\n\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithTaskMaxAge)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithTaskMaxAgePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithTaskMaxAgePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithTaskMaxAge.Server\n                $configuration.LoggingLevel | Should -Be ($script:currentLoggingLevel).Value\n                $configuration.EventMaxAgeEnabled | Should -Be ($script:currentEventMaxAgeEnabled).Value\n                $configuration.EventMaxAge | Should -Be ($script:currentEventMaxAge).Value\n                $configuration.TaskMaxAgeEnabled | Should -Be $script:resourceWithTaskMaxAge.TaskMaxAgeEnabled\n                $configuration.TaskMaxAge | Should -Be $script:resourceWithTaskMaxAge.TaskMaxAge\n                $configuration.Motd | Should -Be ($script:currentMotd).Value\n                $configuration.Issue | Should -Be ($script:currentIssue).Value\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n        Context \"When using configuration $($script:configWithMotdAndIssue)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithMotdAndIssuePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithMotdAndIssuePath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithTaskMaxAge.Server\n                $configuration.LoggingLevel | Should -Be ($script:currentLoggingLevel).Value\n                $configuration.EventMaxAgeEnabled | Should -Be ($script:currentEventMaxAgeEnabled).Value\n                $configuration.EventMaxAge | Should -Be ($script:currentEventMaxAge).Value\n                $configuration.TaskMaxAgeEnabled | Should -Be ($script:currentTaskMaxAgeEnabled).Value\n                $configuration.TaskMaxAge | Should -Be ($script:currentTaskMaxAge).Value\n                $configuration.Motd | Should -Be $script:resourceWithMotdAndIssue.Motd\n                $configuration.Issue | Should -Be $script:resourceWithMotdAndIssue.Issue\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/vCenterStatistics.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n# Mandatory Integration Tests parameter unused so set to null.\n$Name = $null\n\n$script:dscResourceName = 'vCenterStatistics'\n$script:moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$($script:dscResourceName)\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configWithPassedEnabledProperty = \"$($script:dscResourceName)_WithPassedEnabledProperty_Config\"\n$script:configWithoutEnabledProperty = \"$($script:dscResourceName)_WithoutEnabledProperty_Config\"\n\n$script:vCenter = Connect-VIServer -Server $Server -User $User -Password $Password\n$script:performanceManager = $null\n$script:currentPerformanceInterval = $null\n$script:currentLevel = $null\n$script:currentEnabled = $null\n$script:currentSamplingPeriod = $null\n$script:currentLength = $null\n\n$script:period = \"Day\"\n$script:level = 2\n$script:intervalMinutes = 3\n$script:periodLength = 3\n\n$script:resourceWithPassedEnabledProperty = @{\n    Server = $Server\n    Period = $script:period\n    Level = $script:level\n    Enabled = $true\n    IntervalMinutes = $script:intervalMinutes\n    PeriodLength = $script:periodLength\n}\n\n$script:resourceWithoutEnabledProperty = @{\n    Server = $Server\n    Period = $script:period\n    Level = $script:level\n    IntervalMinutes = $script:intervalMinutes\n    PeriodLength = $script:periodLength\n}\n\n. $script:configurationFile -Server $Server -User $User -Password $Password\n\n$script:mofFileWithPassedEnabledPropertyPath = \"$script:integrationTestsFolderPath\\$($script:configWithPassedEnabledProperty)\\\"\n$script:mofFileWithoutEnabledPropertyPath = \"$script:integrationTestsFolderPath\\$($script:configWithoutEnabledProperty)\\\"\n\nfunction Invoke-TestSetup {\n    $script:performanceManager = Get-View -Server $script:vCenter $script:vCenter.ExtensionData.Content.PerfManager\n    $script:currentPerformanceInterval = $script:performanceManager.HistoricalInterval | Where-Object { $_.Name -Match $script:period }\n\n    $script:currentLevel = $script:currentPerformanceInterval.Level\n    $script:currentEnabled = $script:currentPerformanceInterval.Enabled\n    $script:currentSamplingPeriod = $script:currentPerformanceInterval.SamplingPeriod\n    $script:currentLength = $script:currentPerformanceInterval.Length\n}\n\nfunction Invoke-TestCleanup {\n    $script:performanceManager = Get-View -Server $script:vCenter $script:vCenter.ExtensionData.Content.PerfManager\n\n    $desiredPerformanceInterval = New-Object VMware.Vim.PerfInterval\n\n    $desiredPerformanceInterval.Key = $script:currentPerformanceInterval.Key\n    $desiredPerformanceInterval.Name = $script:currentPerformanceInterval.Name\n    $desiredPerformanceInterval.Level = $script:currentLevel\n    $desiredPerformanceInterval.Enabled = $script:currentEnabled\n    $desiredPerformanceInterval.SamplingPeriod = $script:currentSamplingPeriod\n    $desiredPerformanceInterval.Length = $script:currentLength\n\n    $script:performanceManager.UpdatePerfInterval($desiredPerformanceInterval)\n}\n\ntry {\n    Describe \"$($script:dscResourceName)_Integration\" {\n        Context \"When using configuration $($script:configWithPassedEnabledProperty)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithPassedEnabledPropertyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithPassedEnabledPropertyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithPassedEnabledProperty.Server\n                $configuration.Period | Should -Be $script:resourceWithPassedEnabledProperty.Period\n                $configuration.Level | Should -Be $script:resourceWithPassedEnabledProperty.Level\n                $configuration.Enabled | Should -Be $script:resourceWithPassedEnabledProperty.Enabled\n                $configuration.IntervalMinutes | Should -Be $script:resourceWithPassedEnabledProperty.IntervalMinutes\n                $configuration.PeriodLength | Should -Be $script:resourceWithPassedEnabledProperty.PeriodLength\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n\n        Context \"When using configuration $($script:configWithoutEnabledProperty)\" {\n            BeforeAll {\n                Invoke-TestSetup\n            }\n\n            AfterAll {\n                Invoke-TestCleanup\n            }\n\n            BeforeEach {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithoutEnabledPropertyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Act\n                Start-DscConfiguration @startDscConfigurationParameters\n            }\n\n            It 'Should compile and apply the MOF without throwing' {\n                # Arrange\n                $startDscConfigurationParameters = @{\n                    Path = $script:mofFileWithoutEnabledPropertyPath\n                    ComputerName = 'localhost'\n                    Wait = $true\n                    Force = $true\n                }\n\n                # Assert\n                { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration without throwing' {\n                # Arrange && Act && Assert\n                { Get-DscConfiguration } | Should -Not -Throw\n            }\n\n            It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n                # Arrange && Act\n                $configuration = Get-DscConfiguration\n\n                # Assert\n                $configuration.Server | Should -Be $script:resourceWithoutEnabledProperty.Server\n                $configuration.Period | Should -Be $script:resourceWithoutEnabledProperty.Period\n                $configuration.Level | Should -Be $script:resourceWithoutEnabledProperty.Level\n                $configuration.Enabled | Should -Be $script:currentEnabled\n                $configuration.IntervalMinutes | Should -Be $script:resourceWithoutEnabledProperty.IntervalMinutes\n                $configuration.PeriodLength | Should -Be $script:resourceWithoutEnabledProperty.PeriodLength\n            }\n\n            It 'Should return $true when Test-DscConfiguration is run' {\n                # Arrange && Act && Assert\n                Test-DscConfiguration | Should -Be $true\n            }\n        }\n    }\n}\nfinally {\n    Disconnect-VIServer -Server $Server -Confirm:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/vCenterVMHost/vCenterVMHost.Integration.Tests.Helpers.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.DESCRIPTION\n\nRetrieves the Root Resource Pool of the specified Cluster.\n#>\nfunction Get-RootResourcePoolOfCluster {\n    [CmdletBinding()]\n    [OutputType([PSObject])]\n\n    $datacenterName = $script:configurationData.AllNodes.DatacenterName\n    $clusterName = $script:configurationData.AllNodes.ClusterName\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $datacenter = Get-Datacenter -Server $viServer -Name $datacenterName -ErrorAction Stop -Verbose:$false\n    $cluster = Get-Cluster -Server $viServer -Name $clusterName -Location $datacenter -ErrorAction Stop -Verbose:$false\n    $rootResourcePool = Get-ResourcePool -Server $viServer -ErrorAction Stop -Verbose:$false | Where-Object -FilterScript { $_.ParentId -eq $cluster.Id }\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    $rootResourcePool\n}\n\n<#\n.DESCRIPTION\n\nCreates a new Resource Pool with the specified name and places it in the Root Resource Pool of the specified Cluster.\nCreates a new VApp with the specified name and places it in the newly created Resource Pool in the specified Cluster.\nCreates a second Resource Pool with the specified name and places it in the newly created VApp in the specified Cluster.\n#>\nfunction Invoke-ClusterSetup {\n    [CmdletBinding()]\n\n    $rootResourcePool = Get-RootResourcePoolOfCluster\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolName\n    $vAppName = $script:configurationData.AllNodes.VAppName\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $resourcePool = New-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n    $vApp = New-VApp -Server $viServer -Name $vAppName -Location $resourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n    New-ResourcePool -Server $viServer -Name $resourcePoolName -Location $vApp -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n\n<#\n.DESCRIPTION\n\nRemoves the Resource Pool with the specified name from the specified Cluster.\n#>\nfunction Invoke-ClusterCleanup {\n    [CmdletBinding()]\n\n    $resourcePoolName = $script:configurationData.AllNodes.ResourcePoolName\n\n    $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false\n\n    $rootResourcePool = Get-RootResourcePoolOfCluster\n    $resourcePool = Get-ResourcePool -Server $viServer -Name $resourcePoolName -Location $rootResourcePool -ErrorAction Stop -Verbose:$false |\n                    Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n    Remove-ResourcePool -Server $viServer -ResourcePool $resourcePool -Confirm:$false -ErrorAction Stop -Verbose:$false\n\n    Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Integration/vCenterVMHost/vCenterVMHost.Integration.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Password,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostName,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostUser,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $VMHostPassword\n)\n\n. \"$PSScriptRoot\\vCenterVMHost.Integration.Tests.Helpers.ps1\"\n\n$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (ConvertTo-SecureString -String $Password -AsPlainText -Force)\n$VMHostCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $VMHostUser, (ConvertTo-SecureString -String $VMHostPassword -AsPlainText -Force)\n\n$script:dscResourceName = 'vCenterVMHost'\n$script:moduleFolderPath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n$script:integrationTestsFolderPath = Join-Path -Path (Join-Path -Path $moduleFolderPath -ChildPath 'Tests') -ChildPath 'Integration'\n$script:configurationFile = \"$script:integrationTestsFolderPath\\Configurations\\$script:dscResourceName\\$($script:dscResourceName)_Config.ps1\"\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            PSDscAllowPlainTextPassword = $true\n            Server = $Server\n            Credential = $Credential\n            VMHostName = $VMHostName\n            VMHostCredential = $VMHostCredential\n            DatacenterResourceName = 'Datacenter'\n            FolderResourceName = 'Folder'\n            ClusterResourceName = 'Cluster'\n            vCenterVMHostResourceName = 'vCenterVMHost'\n            DatacenterName = 'MyTestDatacenter'\n            DatacenterLocation = [string]::Empty\n            FolderName = 'MyTestFolder'\n            FolderLocation = [string]::Empty\n            HostFolderType = 'Host'\n            ClusterName = 'MyTestCluster'\n            ClusterLocation = 'MyTestFolder'\n            DrsEnabled = $true\n            VAppName = 'MyTestVApp'\n            ResourcePoolName = 'MyTestResourcePool'\n            ResourcePoolLocation = 'MyTestResourcePool/MyTestVApp/MyTestResourcePool'\n            VMHostDatacenterLocation = [string]::Empty\n            VMHostFolderLocation = 'MyTestFolder'\n            VMHostClusterLocation = 'MyTestFolder/MyTestCluster'\n            VMHostPort = 443\n            Force = $true\n        }\n    )\n}\n\n$script:configCreateDatacenter = \"$($script:dscResourceName)_CreateDatacenter_Config\"\n$script:configCreateFolder = \"$($script:dscResourceName)_CreateFolder_Config\"\n$script:configCreateCluster = \"$($script:dscResourceName)_CreateCluster_Config\"\n$script:configAddVMHostTovCenter = \"$($script:dscResourceName)_AddVMHostTovCenter_Config\"\n$script:configMoveVMHostToFolder = \"$($script:dscResourceName)_MoveVMHostToFolder_Config\"\n$script:configMoveVMHostToCluster = \"$($script:dscResourceName)_MoveVMHostToCluster_Config\"\n$script:configMoveVMHostToClusterAndImportResourcePoolHierarchy = \"$($script:dscResourceName)_MoveVMHostToClusterAndImportResourcePoolHierarchy_Config\"\n$script:configRemoveVMHostFromvCenter = \"$($script:dscResourceName)_RemoveVMHostFromvCenter_Config\"\n$script:configRemoveCluster = \"$($script:dscResourceName)_RemoveCluster_Config\"\n$script:configRemoveFolder = \"$($script:dscResourceName)_RemoveFolder_Config\"\n$script:configRemoveDatacenter = \"$($script:dscResourceName)_RemoveDatacenter_Config\"\n\n. $script:configurationFile -ErrorAction Stop\n\n$script:mofFileCreateDatacenterPath = \"$script:integrationTestsFolderPath\\$script:configCreateDatacenter\\\"\n$script:mofFileCreateFolderPath = \"$script:integrationTestsFolderPath\\$script:configCreateFolder\\\"\n$script:mofFileCreateClusterPath = \"$script:integrationTestsFolderPath\\$script:configCreateCluster\\\"\n$script:mofFileAddVMHostTovCenterPath = \"$script:integrationTestsFolderPath\\$script:configAddVMHostTovCenter\\\"\n$script:mofFileMoveVMHostToFolderPath = \"$script:integrationTestsFolderPath\\$script:configMoveVMHostToFolder\\\"\n$script:mofFileMoveVMHostToClusterPath = \"$script:integrationTestsFolderPath\\$script:configMoveVMHostToCluster\\\"\n$script:mofFileMoveVMHostToClusterAndImportResourcePoolHierarchyPath = \"$script:integrationTestsFolderPath\\$script:configMoveVMHostToClusterAndImportResourcePoolHierarchy\\\"\n$script:mofFileRemoveVMHostFromvCenterPath = \"$script:integrationTestsFolderPath\\$script:configRemoveVMHostFromvCenter\\\"\n$script:mofFileRemoveClusterPath = \"$script:integrationTestsFolderPath\\$script:configRemoveCluster\\\"\n$script:mofFileRemoveFolderPath = \"$script:integrationTestsFolderPath\\$script:configRemoveFolder\\\"\n$script:mofFileRemoveDatacenterPath = \"$script:integrationTestsFolderPath\\$script:configRemoveDatacenter\\\"\n\nDescribe \"$($script:dscResourceName)_Integration\" {\n    Context \"When using configuration $script:configAddVMHostTovCenter\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenter `\n                -OutputPath $script:mofFileCreateDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configAddVMHostTovCenter `\n                -OutputPath $script:mofFileAddVMHostTovCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenter = @{\n                Path = $script:mofFileCreateDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersAddVMHostTovCenter = @{\n                Path = $script:mofFileAddVMHostTovCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersAddVMHostTovCenter\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileAddVMHostTovCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configAddVMHostTovCenter }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.VMHostDatacenterLocation\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.VMHostPort\n            $configuration.Force | Should -Be $script:configurationData.AllNodes.Force\n            $configuration.ResourcePoolLocation | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileAddVMHostTovCenterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostFromvCenter `\n                -OutputPath $script:mofFileRemoveVMHostFromvCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveDatacenter `\n                -OutputPath $script:mofFileRemoveDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostFromvCenter = @{\n                Path = $script:mofFileRemoveVMHostFromvCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveDatacenter = @{\n                Path = $script:mofFileRemoveDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostFromvCenter\n            Start-DscConfiguration @startDscConfigurationParametersRemoveDatacenter\n\n            Remove-Item -Path $script:mofFileCreateDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileAddVMHostTovCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostFromvCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMoveVMHostToFolder\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenter `\n                -OutputPath $script:mofFileCreateDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateFolder `\n                -OutputPath $script:mofFileCreateFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configAddVMHostTovCenter `\n                -OutputPath $script:mofFileAddVMHostTovCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMoveVMHostToFolder `\n                -OutputPath $script:mofFileMoveVMHostToFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenter = @{\n                Path = $script:mofFileCreateDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateFolder = @{\n                Path = $script:mofFileCreateFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersAddVMHostTovCenter = @{\n                Path = $script:mofFileAddVMHostTovCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMoveVMHostToFolder = @{\n                Path = $script:mofFileMoveVMHostToFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersCreateFolder\n            Start-DscConfiguration @startDscConfigurationParametersAddVMHostTovCenter\n            Start-DscConfiguration @startDscConfigurationParametersMoveVMHostToFolder\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMoveVMHostToFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMoveVMHostToFolder }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.VMHostFolderLocation\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.VMHostPort\n            $configuration.Force | Should -BeNullOrEmpty\n            $configuration.ResourcePoolLocation | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMoveVMHostToFolderPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveVMHostFromvCenter `\n                -OutputPath $script:mofFileRemoveVMHostFromvCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveFolder `\n                -OutputPath $script:mofFileRemoveFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveDatacenter `\n                -OutputPath $script:mofFileRemoveDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveVMHostFromvCenter = @{\n                Path = $script:mofFileRemoveVMHostFromvCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveFolder = @{\n                Path = $script:mofFileRemoveFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveDatacenter = @{\n                Path = $script:mofFileRemoveDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostFromvCenter\n            Start-DscConfiguration @startDscConfigurationParametersRemoveFolder\n            Start-DscConfiguration @startDscConfigurationParametersRemoveDatacenter\n\n            Remove-Item -Path $script:mofFileCreateDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileAddVMHostTovCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMoveVMHostToFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostFromvCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMoveVMHostToCluster\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenter `\n                -OutputPath $script:mofFileCreateDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateFolder `\n                -OutputPath $script:mofFileCreateFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateCluster `\n                -OutputPath $script:mofFileCreateClusterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configAddVMHostTovCenter `\n                -OutputPath $script:mofFileAddVMHostTovCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMoveVMHostToCluster `\n                -OutputPath $script:mofFileMoveVMHostToClusterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenter = @{\n                Path = $script:mofFileCreateDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateFolder = @{\n                Path = $script:mofFileCreateFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateCluster = @{\n                Path = $script:mofFileCreateClusterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersAddVMHostTovCenter = @{\n                Path = $script:mofFileAddVMHostTovCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMoveVMHostToCluster = @{\n                Path = $script:mofFileMoveVMHostToClusterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersCreateFolder\n            Start-DscConfiguration @startDscConfigurationParametersCreateCluster\n            Start-DscConfiguration @startDscConfigurationParametersAddVMHostTovCenter\n            Start-DscConfiguration @startDscConfigurationParametersMoveVMHostToCluster\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMoveVMHostToClusterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMoveVMHostToCluster }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.VMHostClusterLocation\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.VMHostPort\n            $configuration.Force | Should -BeNullOrEmpty\n            $configuration.ResourcePoolLocation | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMoveVMHostToClusterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveCluster `\n                -OutputPath $script:mofFileRemoveClusterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveFolder `\n                -OutputPath $script:mofFileRemoveFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveDatacenter `\n                -OutputPath $script:mofFileRemoveDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveCluster = @{\n                Path = $script:mofFileRemoveClusterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveFolder = @{\n                Path = $script:mofFileRemoveFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveDatacenter = @{\n                Path = $script:mofFileRemoveDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersRemoveCluster\n            Start-DscConfiguration @startDscConfigurationParametersRemoveFolder\n            Start-DscConfiguration @startDscConfigurationParametersRemoveDatacenter\n\n            Remove-Item -Path $script:mofFileCreateDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateClusterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileAddVMHostTovCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMoveVMHostToClusterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveClusterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configMoveVMHostToClusterAndImportResourcePoolHierarchy\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenter `\n                -OutputPath $script:mofFileCreateDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateFolder `\n                -OutputPath $script:mofFileCreateFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configCreateCluster `\n                -OutputPath $script:mofFileCreateClusterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configAddVMHostTovCenter `\n                -OutputPath $script:mofFileAddVMHostTovCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configMoveVMHostToClusterAndImportResourcePoolHierarchy `\n                -OutputPath $script:mofFileMoveVMHostToClusterAndImportResourcePoolHierarchyPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenter = @{\n                Path = $script:mofFileCreateDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateFolder = @{\n                Path = $script:mofFileCreateFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersCreateCluster = @{\n                Path = $script:mofFileCreateClusterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersAddVMHostTovCenter = @{\n                Path = $script:mofFileAddVMHostTovCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersMoveVMHostToClusterAndImportResourcePoolHierarchy = @{\n                Path = $script:mofFileMoveVMHostToClusterAndImportResourcePoolHierarchyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersCreateFolder\n            Start-DscConfiguration @startDscConfigurationParametersCreateCluster\n\n            Invoke-ClusterSetup\n\n            Start-DscConfiguration @startDscConfigurationParametersAddVMHostTovCenter\n            Start-DscConfiguration @startDscConfigurationParametersMoveVMHostToClusterAndImportResourcePoolHierarchy\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileMoveVMHostToClusterAndImportResourcePoolHierarchyPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configMoveVMHostToClusterAndImportResourcePoolHierarchy }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.VMHostClusterLocation\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Present'\n            $configuration.Port | Should -Be $script:configurationData.AllNodes.VMHostPort\n            $configuration.Force | Should -BeNullOrEmpty\n            $configuration.ResourcePoolLocation | Should -Be $script:configurationData.AllNodes.ResourcePoolLocation\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileMoveVMHostToClusterAndImportResourcePoolHierarchyPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveCluster `\n                -OutputPath $script:mofFileRemoveClusterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveFolder `\n                -OutputPath $script:mofFileRemoveFolderPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveDatacenter `\n                -OutputPath $script:mofFileRemoveDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersRemoveCluster = @{\n                Path = $script:mofFileRemoveClusterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveFolder = @{\n                Path = $script:mofFileRemoveFolderPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveDatacenter = @{\n                Path = $script:mofFileRemoveDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Invoke-ClusterCleanup\n\n            Start-DscConfiguration @startDscConfigurationParametersRemoveCluster\n            Start-DscConfiguration @startDscConfigurationParametersRemoveFolder\n            Start-DscConfiguration @startDscConfigurationParametersRemoveDatacenter\n\n            Remove-Item -Path $script:mofFileCreateDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileCreateClusterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileAddVMHostTovCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileMoveVMHostToClusterAndImportResourcePoolHierarchyPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveClusterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveFolderPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n\n    Context \"When using configuration $script:configRemoveVMHostFromvCenter\" {\n        BeforeAll {\n            # Arrange\n            & $script:configCreateDatacenter `\n                -OutputPath $script:mofFileCreateDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configAddVMHostTovCenter `\n                -OutputPath $script:mofFileAddVMHostTovCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            & $script:configRemoveVMHostFromvCenter `\n                -OutputPath $script:mofFileRemoveVMHostFromvCenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParametersCreateDatacenter = @{\n                Path = $script:mofFileCreateDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersAddVMHostTovCenter = @{\n                Path = $script:mofFileAddVMHostTovCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            $startDscConfigurationParametersRemoveVMHostFromvCenter = @{\n                Path = $script:mofFileRemoveVMHostFromvCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParametersCreateDatacenter\n            Start-DscConfiguration @startDscConfigurationParametersAddVMHostTovCenter\n            Start-DscConfiguration @startDscConfigurationParametersRemoveVMHostFromvCenter\n        }\n\n        It 'Should apply the MOF without throwing' {\n            # Arrange\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveVMHostFromvCenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            { Start-DscConfiguration @startDscConfigurationParameters } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration without throwing' {\n            # Arrange && Act && Assert\n            { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw\n        }\n\n        It 'Should be able to call Get-DscConfiguration and all parameters should match' {\n            # Arrange && Act\n            $configuration = Get-DscConfiguration -Verbose -ErrorAction Stop | Where-Object -FilterScript { $_.ConfigurationName -eq $script:configRemoveVMHostFromvCenter }\n\n            # Assert\n            $configuration.Server | Should -Be $script:configurationData.AllNodes.Server\n            $configuration.Name | Should -Be $script:configurationData.AllNodes.VMHostName\n            $configuration.Location | Should -Be $script:configurationData.AllNodes.VMHostDatacenterLocation\n            $configuration.DatacenterName | Should -Be $script:configurationData.AllNodes.DatacenterName\n            $configuration.DatacenterLocation | Should -Be $script:configurationData.AllNodes.DatacenterLocation\n            $configuration.Ensure | Should -Be 'Absent'\n            $configuration.Port | Should -BeNullOrEmpty\n            $configuration.Force | Should -BeNullOrEmpty\n            $configuration.ResourcePoolLocation | Should -BeNullOrEmpty\n        }\n\n        It 'Should return $true when Test-DscConfiguration is run' {\n            # Arrange\n            $testDscConfigurationParameters = @{\n                ReferenceConfiguration = \"$script:mofFileRemoveVMHostFromvCenterPath\\$($script:configurationData.AllNodes.NodeName).mof\"\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act && Assert\n            (Test-DscConfiguration @testDscConfigurationParameters).InDesiredState | Should -Be $true\n        }\n\n        AfterAll {\n            # Arrange\n            & $script:configRemoveDatacenter `\n                -OutputPath $script:mofFileRemoveDatacenterPath `\n                -ConfigurationData $script:configurationData `\n                -ErrorAction Stop\n\n            $startDscConfigurationParameters = @{\n                Path = $script:mofFileRemoveDatacenterPath\n                ComputerName = $script:configurationData.AllNodes.NodeName\n                Wait = $true\n                Force = $true\n                Verbose = $true\n                ErrorAction = 'Stop'\n            }\n\n            # Act\n            Start-DscConfiguration @startDscConfigurationParameters\n\n            Remove-Item -Path $script:mofFileCreateDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileAddVMHostTovCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveVMHostFromvCenterPath -Recurse -Confirm:$false -ErrorAction Stop\n            Remove-Item -Path $script:mofFileRemoveDatacenterPath -Recurse -Confirm:$false -ErrorAction Stop\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/IntegrationTests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam(\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Name,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $User,\n\n    [Parameter(Mandatory = $true)]\n    [string]\n    $Password\n)\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration'\n\nInvoke-Pester -Script @{\n    Path = \"$integrationTestsFolderPath\\*\"\n    Parameters = @{ Name = $Name; Server = $Server; Password = $Password; User = $User }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/TestRunner.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nparam (\n    [Parameter(Mandatory = $false)]\n    [switch] $Unit,\n\n    [Parameter(Mandatory = $false)]\n    [switch] $Integration\n)\n\ntry {\n    $moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n    $moduleTestsFolderPath = Join-Path $moduleFolderPath 'Tests'\n\n    if (($Unit -and $Integration) -or (!$Unit -and !$Integration)) {\n        Start-Process -FilePath \"powershell.exe\" -ArgumentList \"& '$moduleTestsFolderPath\\UnitTests.ps1'\" -Wait -NoNewWindow\n        Start-Process -FilePath \"powershell.exe\" -ArgumentList \"& '$moduleTestsFolderPath\\IntegrationTests.ps1'\" -Wait -NoNewWindow\n    }\n    elseif ($Unit) {\n        Start-Process -FilePath \"powershell.exe\" -ArgumentList \"& '$moduleTestsFolderPath\\UnitTests.ps1'\" -Wait -NoNewWindow\n    }\n    else {\n        Start-Process -FilePath \"powershell.exe\" -ArgumentList \"& '$moduleTestsFolderPath\\IntegrationTests.ps1'\" -Wait -NoNewWindow\n    }\n}\ncatch {\n    Write-Error \"Ran into an issue: $($PSItem.ToString())\"\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/BaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $baseDSCClassName = 'BaseDSC'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\BaseDSCMocks.ps1\"\n\n        Describe 'BaseDSC\\ShouldUpdateArraySetting' -Tag 'ShouldUpdateArraySetting' {\n            It 'Should return $false when the desired array is $null' {\n                # Arrange\n                $baseDSCClass = New-Object -TypeName $baseDSCClassName\n\n                # Act\n                $result = $baseDSCClass.ShouldUpdateArraySetting([string]::Empty, @(), $null)\n\n                # Assert\n                $result | Should -Be $false\n            }\n\n            It 'Should return $true when the desired array is an empty array and the current one has elements' {\n                # Arrange\n                $baseDSCClass = New-Object -TypeName $baseDSCClassName\n\n                # Act\n                $result = $baseDSCClass.ShouldUpdateArraySetting([string]::Empty, @(1), @())\n\n                # Assert\n                $result | Should -Be $true\n            }\n\n            It 'Should return $true when the current array does not contain at least one element from the desired array' {\n                # Arrange\n                $baseDSCClass = New-Object -TypeName $baseDSCClassName\n\n                # Act\n                $result = $baseDSCClass.ShouldUpdateArraySetting([string]::Empty, @(1, 2, 3), @(1, 2, 3, 4))\n\n                # Assert\n                $result | Should -Be $true\n            }\n\n            It 'Should return $true when the desired array is a subset of the current array.' {\n                # Arrange\n                $baseDSCClass = New-Object -TypeName $baseDSCClassName\n\n                # Act\n                $result = $baseDSCClass.ShouldUpdateArraySetting([string]::Empty, @(1, 2, 3), @(1, 2))\n\n                # Assert\n                $result | Should -Be $true\n            }\n\n            It 'Should return $false when the desired array has the same elements as the current array.' {\n                # Arrange\n                $baseDSCClass = New-Object -TypeName $baseDSCClassName\n\n                # Act\n                $result = $baseDSCClass.ShouldUpdateArraySetting([string]::Empty, @(1, 2, 3), @(1, 2, 3))\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Describe 'BaseDSC\\DisconnectVIServer' -Tag 'DisconnectVIServer' {\n            Context 'Invoking with Server that successfully closes the Connection' {\n                BeforeAll {\n                    # Arrange\n                    $baseDSCClassProperties = New-MocksWhenDisconnectVIServerClosesTheConnectionSuccessfully\n                    $baseDSCClass = New-Object -TypeName $baseDSCClassName -Property $baseDSCClassProperties\n\n                    $baseDSCClass.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $baseDSCClass.DisconnectVIServer()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Disconnect-VIServer mock once' {\n                    # Act\n                    $baseDSCClass.DisconnectVIServer()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Disconnect-VIServer'\n                        ParameterFilter = { $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Server that results in an Error when closing the Connection' {\n                BeforeAll {\n                    # Arrange\n                    $baseDSCClassProperties = New-MocksWhenDisconnectVIServerResultsInAnErrorWhenClosingTheConnection\n                    $baseDSCClass = New-Object -TypeName $baseDSCClassName -Property $baseDSCClassProperties\n\n                    $baseDSCClass.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $baseDSCClass.DisconnectVIServer()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when closing the Connection results in an Error' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $baseDSCClass.DisconnectVIServer() } | Should -Throw \"Could not close connection to vSphere Server $($script:viServer.Name). For more information: ScriptHalted\"\n                }\n            }\n        }\n    }\n\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Cluster/DrsCluster.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'DrsCluster'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\DrsClusterMocks.ps1\"\n\n        Describe 'DrsCluster\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDrsCluster\n            }\n\n            Context 'Invoking with Ensure Present, non existing Cluster and no Drs settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingClusterAndNoDrsSettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-Cluster mock without Drs settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-Cluster'\n                        ParameterFilter = { $Name -eq $resourceProperties.Name -and $Folder -eq $script:foundLocationsForCluster[0].ExtensionData -and $Spec -eq $script:clusterSpecWithoutDrsSettings }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, non existing Cluster and Drs settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingClusterAndDrsSettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-Cluster mock with Drs settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-Cluster'\n                        ParameterFilter = { $Name -eq $resourceProperties.Name -and $Folder -eq $script:foundLocationsForCluster[0].ExtensionData -and $Spec -eq $script:clusterSpecWithDrsSettings }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and no Drs settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndNoDrsSettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-ClusterComputeResource mock without Drs settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-ClusterComputeResource'\n                        ParameterFilter = { $ClusterComputeResource -eq $script:clusterComputeResource -and $Spec -eq $script:clusterSpecWithoutDrsSettings }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and Drs settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndDrsSettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-ClusterComputeResource mock with Drs settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-ClusterComputeResource'\n                        ParameterFilter = { $ClusterComputeResource -eq $script:clusterComputeResource -and $Spec -eq $script:clusterSpecWithDrsSettings }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-ClusterComputeResource mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-ClusterComputeResource'\n                        ParameterFilter = { $ClusterComputeResource -eq $script:clusterComputeResource }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-ClusterComputeResource mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-ClusterComputeResource'\n                        ParameterFilter = { $ClusterComputeResource -eq $script:clusterComputeResource }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'DrsCluster\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDrsCluster\n            }\n\n            Context 'Invoking with Ensure Present and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Cluster does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Cluster exists and the Drs settings are equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and non matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndNonMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Cluster exists and the Drs settings are not equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInTestWhenEnsureAbsentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Cluster does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInTestWhenEnsureAbsentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Cluster exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'DrsCluster\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDrsCluster\n            }\n\n            Context 'Invoking with Ensure Present and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsurePresentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.DrsEnabled | Should -Be $resourceProperties.DrsEnabled\n                    $result.DrsAutomationLevel | Should -Be $resourceProperties.DrsAutomationLevel\n                    $result.DrsMigrationThreshold | Should -Be $resourceProperties.DrsMigrationThreshold\n                    $result.DrsDistribution | Should -Be $resourceProperties.DrsDistribution\n                    $result.MemoryLoadBalancing | Should -Be $resourceProperties.MemoryLoadBalancing\n                    $result.CPUOverCommitment | Should -Be $resourceProperties.CPUOverCommitment\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsurePresentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:cluster.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.DrsEnabled | Should -Be $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Enabled\n                    $result.DrsAutomationLevel | Should -Be $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.DefaultVmBehavior.ToString()\n                    $result.DrsMigrationThreshold | Should -Be $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.VmotionRate\n                    $result.DrsDistribution | Should -Be ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[0]).Value\n                    $result.MemoryLoadBalancing | Should -Be ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[1]).Value\n                    $result.CPUOverCommitment | Should -Be ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[2]).Value\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsureAbsentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.DrsEnabled | Should -Be $resourceProperties.DrsEnabled\n                    $result.DrsAutomationLevel | Should -Be $resourceProperties.DrsAutomationLevel\n                    $result.DrsMigrationThreshold | Should -Be $resourceProperties.DrsMigrationThreshold\n                    $result.DrsDistribution | Should -Be $resourceProperties.DrsDistribution\n                    $result.MemoryLoadBalancing | Should -Be $resourceProperties.MemoryLoadBalancing\n                    $result.CPUOverCommitment | Should -Be $resourceProperties.CPUOverCommitment\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsureAbsentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:cluster.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.DrsEnabled | Should -Be $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Enabled\n                    $result.DrsAutomationLevel | Should -Be $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.DefaultVmBehavior.ToString()\n                    $result.DrsMigrationThreshold | Should -Be $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.VmotionRate\n                    $result.DrsDistribution | Should -Be ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[0]).Value\n                    $result.MemoryLoadBalancing | Should -Be ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[1]).Value\n                    $result.CPUOverCommitment | Should -Be ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[2]).Value\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Cluster/HACluster.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'HACluster'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\HAClusterMocks.ps1\"\n\n        Describe 'HACluster\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForHACluster\n            }\n\n            Context 'Invoking with Ensure Present, non existing Cluster and no HA settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingClusterAndNoHASettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-Cluster mock without HA settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Cluster'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:foundLocations[0] -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, non existing Cluster and HA settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingClusterAndHASettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-Cluster mock with HA settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Cluster'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:foundLocations[0] -and `\n                                            !$Confirm -and $HAEnabled -eq $script:constants.HAEnabled -and $HAAdmissionControlEnabled -eq $script:constants.HAAdmissionControlEnabled -and `\n                                            $HAFailoverLevel -eq $script:constants.HAFailoverLevel -and $HAIsolationResponse -eq $script:constants.HAIsolationResponse -and `\n                                            $HARestartPriority -eq $script:constants.HARestartPriority }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and no HA settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndNoHASettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-Cluster mock without HA settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-Cluster'\n                        ParameterFilter = { $Cluster -eq $script:cluster -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and HA settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndHASettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-Cluster mock with HA settings specified once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-Cluster'\n                        ParameterFilter = { $Cluster -eq $script:cluster -and $Server -eq $script:viServer -and !$Confirm -and $HAEnabled -eq !$script:constants.HAEnabled }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-Cluster mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Cluster'\n                        ParameterFilter = { $Cluster -eq $script:cluster -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-Cluster mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Cluster'\n                        ParameterFilter = { $Cluster -eq $script:cluster -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'HACluster\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForHACluster\n            }\n\n            Context 'Invoking with Ensure Present and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Cluster does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Cluster exists and the HA settings are equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Cluster and non matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingClusterAndNonMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Cluster exists and the HA settings are not equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInTestWhenEnsureAbsentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Cluster does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInTestWhenEnsureAbsentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Cluster exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'HACluster\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForHACluster\n            }\n\n            Context 'Invoking with Ensure Present and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsurePresentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.HAEnabled | Should -Be $resourceProperties.HAEnabled\n                    $result.HAAdmissionControlEnabled | Should -Be $resourceProperties.HAAdmissionControlEnabled\n                    $result.HAFailoverLevel | Should -Be $resourceProperties.HAFailoverLevel\n                    $result.HAIsolationResponse | Should -Be $resourceProperties.HAIsolationResponse\n                    $result.HARestartPriority | Should -Be $resourceProperties.HARestartPriority\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsurePresentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:cluster.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.HAEnabled | Should -Be $script:cluster.HAEnabled\n                    $result.HAAdmissionControlEnabled | Should -Be $script:cluster.HAAdmissionControlEnabled\n                    $result.HAFailoverLevel | Should -Be $script:cluster.HAFailoverLevel\n                    $result.HAIsolationResponse.ToString() | Should -Be $script:cluster.HAIsolationResponse.ToString()\n                    $result.HARestartPriority.ToString() | Should -Be $script:cluster.HARestartPriority.ToString()\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsureAbsentAndNonExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.HAEnabled | Should -Be $resourceProperties.HAEnabled\n                    $result.HAAdmissionControlEnabled | Should -Be $resourceProperties.HAAdmissionControlEnabled\n                    $result.HAFailoverLevel | Should -Be $resourceProperties.HAFailoverLevel\n                    $result.HAIsolationResponse | Should -Be $resourceProperties.HAIsolationResponse\n                    $result.HARestartPriority | Should -Be $resourceProperties.HARestartPriority\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInGetWhenEnsureAbsentAndExistingCluster\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:cluster.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.HAEnabled | Should -Be $script:cluster.HAEnabled\n                    $result.HAAdmissionControlEnabled | Should -Be $script:cluster.HAAdmissionControlEnabled\n                    $result.HAFailoverLevel | Should -Be $script:cluster.HAFailoverLevel\n                    $result.HAIsolationResponse.ToString() | Should -Be $script:cluster.HAIsolationResponse.ToString()\n                    $result.HARestartPriority.ToString() | Should -Be $script:cluster.HARestartPriority.ToString()\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Compare-Settings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.Helper.psm1'\n\nDescribe 'Compare-Settings' {\n    Context 'Desired and current settings match' {\n        $desiredState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n        $currentState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n\n        $result = Compare-Settings -DesiredState $desiredState -CurrentState $currentState\n\n        it 'Should return false' {\n            $result | Should -Be $false\n        }\n    }\n\n    Context 'Desired and current settings match' {\n        $desiredState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 5\"\n        }\n        $currentState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n\n        $result = Compare-Settings -DesiredState $desiredState -CurrentState $currentState\n\n        it 'Should return true' {\n            $result | Should -Be $true\n        }\n    }\n\n    Context 'Desired state has additional setting' {\n        $desiredState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n            key4 = \"value 4\"\n        }\n        $currentState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n\n        $result = Compare-Settings -DesiredState $desiredState -CurrentState $currentState\n\n        it 'Should return true' {\n            $result | Should -Be $true\n        }\n    }\n\n    Context 'Current state has additional setting' {\n        $desiredState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n        $currentState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n            key4 = \"value 4\"\n        }\n\n        $result = Compare-Settings -DesiredState $desiredState -CurrentState $currentState\n\n        it 'Should return false' {\n            $result | Should -Be $false\n        }\n    }\n\n    Context 'Current state not supplied' {\n        $desiredState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n\n        $result = Compare-Settings -DesiredState $desiredState\n\n        it 'Should return true' {\n            $result | Should -Be $true\n        }\n    }\n\n    Context 'Desired state not supplied' {\n        $currentState = @{\n            key1 = \"value 1\"\n            key2 = \"value 2\"\n            key3 = \"value 3\"\n        }\n\n        $result = Compare-Settings -CurrentState $currentState\n\n        it 'Should return false' {\n            $result | Should -Be $false\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DRSRule/DRSRule.Mocks.Data.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:Constants = @{\n    VIServer = '10.23.112.235'\n    VIServerUser = 'Admin1'\n    VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force\n    FolderType = 'Folder'\n    RootFolderValue = 'group-d1'\n    InventoryRootFolderId = 'Folder-group-d1'\n    InventoryRootFolderName = 'DscDatacenters'\n    DrsRuleName = 'DscDRSRule'\n    DatacenterId = 'dsc-datacenter-inventory-root-folder-parent-id'\n    DatacenterName = 'DscDatacenter'\n    DatacenterHostFolderId = 'group-h4'\n    DatacenterHostFolderName = 'DscDatacenterHostFolder'\n    ClusterId = 'ClusterComputeResource-domain-c29'\n    ClusterName = 'DscCluster'\n    VirtualMachineOneId = 'VirtualMachine-vm-27'\n    VirtualMachineOneName = 'DscVMOne'\n    VirtualMachineTwoId = 'VirtualMachine-vm-28'\n    VirtualMachineTwoName = 'DscVMTwo'\n    VirtualMachineIds = @('VirtualMachine-vm-27', 'VirtualMachine-vm-28')\n    VirtualMachineNames = @('DscVMOne', 'DscVMTwo')\n    DrsRuleType = 'VMAffinity'\n    DrsRuleEnabled = $true\n}\n\n$script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword)\n\n$script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:Constants.VIServer\n    User = $script:Constants.VIServerUser\n    ExtensionData = [VMware.Vim.ServiceInstance] @{\n        Content = [VMware.Vim.ServiceContent] @{\n            RootFolder = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:Constants.FolderType\n                Value = $script:Constants.RootFolderValue\n            }\n        }\n    }\n}\n\n$script:InventoryRootFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:Constants.InventoryRootFolderId\n    Name = $script:Constants.InventoryRootFolderName\n}\n\n$script:Datacenter = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:Constants.DatacenterId\n    Name = $script:Constants.DatacenterName\n    ParentFolderId = $script:Constants.InventoryRootFolderId\n    ExtensionData = [VMware.Vim.Datacenter] @{\n        HostFolder = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterHostFolderId\n        }\n    }\n}\n\n$script:DatacenterHostFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:Constants.DatacenterHostFolderId\n    Name = $script:Constants.DatacenterHostFolderName\n    ExtensionData = [VMware.Vim.Folder] @{\n        MoRef = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterHostFolderId\n        }\n    }\n}\n\n$script:Cluster = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ClusterImpl] @{\n    Id = $script:Constants.ClusterId\n    Name = $script:Constants.ClusterName\n    ParentId = $script:Constants.DatacenterHostFolderId\n}\n\n$script:VirtualMachineOne = [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl] @{\n    Id = $script:Constants.VirtualMachineOneId\n    Name = $script:Constants.VirtualMachineOneName\n}\n\n$script:VirtualMachineTwo = [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl] @{\n    Id = $script:Constants.VirtualMachineTwoId\n    Name = $script:Constants.VirtualMachineTwoName\n}\n\n$script:VirtualMachines = [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl[]] @(\n    $script:VirtualMachineOne,\n    $script:VirtualMachineTwo\n)\n\n$script:DrsRule = [VMware.VimAutomation.ViCore.Impl.V1.Cluster.DrsVMAffinityRuleImpl] @{\n    Name = $script:Constants.DrsRuleName\n    Type = $script:Constants.DrsRuleType\n    Cluster = $script:Cluster\n    VMIds = $script:Constants.VirtualMachineIds\n    Enabled = $script:Constants.DrsRuleEnabled\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DRSRule/DRSRule.Mocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DRSRuleDscResourceProperties {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = @{\n        Server = $script:Constants.VIServer\n        Credential = $script:Credential\n        Name = $script:Constants.DrsRuleName\n        DatacenterName = $script:Constants.DatacenterName\n        DatacenterLocation = [string]::Empty\n        ClusterName = $script:Constants.ClusterName\n        ClusterLocation = [string]::Empty\n        DRSRuleType = $script:Constants.DrsRuleType\n    }\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksForDRSRuleDscResource {\n    $viServerMock = $script:VIServer\n    $inventoryRootFolderMock = $script:InventoryRootFolder\n    $datacenterMock = $script:Datacenter\n    $datacenterHostFolderMock = $script:DatacenterHostFolder\n    $clusterMock = $script:Cluster\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $getInventoryMockParamsForInventoryRootFolder = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $inventoryRootFolderMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:VIServer.ExtensionData.Content.RootFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getInventoryMockParamsForInventoryRootFolder\n\n    $getDatacenterMockParams = @{\n        CommandName = 'Get-Datacenter'\n        MockWith = { return $datacenterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatacenterName -and\n            $Location -eq $script:InventoryRootFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatacenterMockParams\n\n    $getInventoryMockParamsForDatacenterHostFolder = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $datacenterHostFolderMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:Datacenter.ExtensionData.HostFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getInventoryMockParamsForDatacenterHostFolder\n\n    $getClusterMockParams = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $clusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.ClusterName -and\n            $Location -eq $script:DatacenterHostFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getClusterMockParams\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDRSRuleDoesNotExistAndErrorOccursWhileCreatingTheDRSRule {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n\n    $DRSRuleDscResourceProperties.VMNames = $script:Constants.VirtualMachineNames\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.VirtualMachineNames) -and\n            $Location -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    Mock -CommandName 'New-DrsRule' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDRSRuleDoesNotExistAndNoErrorOccursWhileCreatingTheDRSRule {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n\n    $DRSRuleDscResourceProperties.VMNames = $script:Constants.VirtualMachineNames\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n    $DRSRuleDscResourceProperties.Enabled = $script:Constants.DrsRuleEnabled\n\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.VirtualMachineNames) -and\n            $Location -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    Mock -CommandName 'New-DrsRule' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndErrorOccursWhileModifyingTheDRSRule {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n\n    $DRSRuleDscResourceProperties.VMNames = $script:Constants.VirtualMachineNames\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n\n    $drsRuleMock = $script:DrsRule\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.VirtualMachineNames) -and\n            $Location -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    Mock -CommandName 'Set-DrsRule' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndVirtualMachinesAreSpecified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n\n    $DRSRuleDscResourceProperties.VMNames = $script:Constants.VirtualMachineNames\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n    $DRSRuleDscResourceProperties.Enabled = !$script:Constants.DrsRuleEnabled\n\n    $drsRuleMock = $script:DrsRule\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.VirtualMachineNames) -and\n            $Location -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    Mock -CommandName 'Set-DrsRule' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheDRSRuleDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Absent'\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    Mock -CommandName 'Remove-DrsRule' -MockWith { return $null }.GetNewClosure()\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheDRSRuleExistsAndErrorOccursWhileRemovingTheDRSRule {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Absent'\n\n    $drsRuleMock = $script:DrsRule\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    Mock -CommandName 'Remove-DrsRule' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheDRSRuleExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Absent'\n\n    $drsRuleMock = $script:DrsRule\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    Mock -CommandName 'Remove-DrsRule' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndTheVirtualMachinesReferencedByTheDRSRuleShouldNotBeModified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n\n    $DRSRuleDscResourceProperties.VMNames = $script:Constants.VirtualMachineNames\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n    $DRSRuleDscResourceProperties.Enabled = $script:Constants.DrsRuleEnabled\n\n    $drsRuleMock = $script:DrsRule\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Id, [string[]] $script:Constants.VirtualMachineIds)\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndTheVirtualMachinesReferencedByTheDRSRuleShouldBeModified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n\n    $DRSRuleDscResourceProperties.VMNames = @($script:Constants.VirtualMachineOneName)\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n    $DRSRuleDscResourceProperties.Enabled = !$script:Constants.DrsRuleEnabled\n\n    $drsRuleMock = $script:DrsRule\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Id, [string[]] $script:Constants.VirtualMachineIds)\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheDRSRuleDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheDRSRuleExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Present'\n\n    $drsRuleMock = $script:DrsRule\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Id, [string[]] $script:Constants.VirtualMachineIds)\n        }\n        Verifiable = $true\n    }\n    Mock @getVMMockParams\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheDRSRuleDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Absent'\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $DRSRuleDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheDRSRuleExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DRSRuleDscResourceProperties = New-DRSRuleDscResourceProperties\n    $DRSRuleDscResourceProperties.Ensure = 'Absent'\n\n    $drsRuleMock = $script:DrsRule\n    $virtualMachinesMock = $script:VirtualMachines\n\n    $getDRSRuleMockParams = @{\n        CommandName = 'Get-DrsRule'\n        MockWith = { return $drsRuleMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DrsRuleName -and\n            $Cluster -eq $script:Cluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDRSRuleMockParams\n\n    $getVMMockParams = @{\n        CommandName = 'Get-VM'\n        MockWith = { return $virtualMachinesMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Id, [string[]] $script:Constants.VirtualMachineIds)\n        }\n    }\n    Mock @getVMMockParams\n\n    $DRSRuleDscResourceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DRSRule/DRSRule.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PSModulePath = $env:PSModulePath\n$script:ModuleName = 'VMware.vSphereDSC'\n\n$script:UnitTestsPath = Join-Path (Join-Path (Get-Module -Name $script:ModuleName -ListAvailable).ModuleBase 'Tests') 'Unit'\n. (Join-Path -Path (Join-Path -Path $script:UnitTestsPath -ChildPath 'TestHelpers') -ChildPath 'TestUtils.ps1')\n\nImport-VMwareVSphereDSCModule\n\n# Imports the mocked 'VMware.VimAutomation.Core' module in the current session before all tests are executed.\nInvoke-TestSetup\n\ntry {\n    InModuleScope -ModuleName $script:ModuleName {\n        $script:DscResourceName = 'DRSRule'\n\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'DRSRule.Mocks.Data.ps1')\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'DRSRule.Mocks.ps1')\n\n        Describe \"$script:DscResourceName\\Set\" -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDRSRuleDscResource\n            }\n\n            Context 'When Ensure is Present, the DRS rule does not exist and error occurs while creating the DRS rule' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDRSRuleDoesNotExistAndErrorOccursWhileCreatingTheDRSRule\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the DRS rule' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not create DRS rule {0} for Cluster {1}. For more information: ScriptHalted\" -f @(\n                        $dscResourceProperties.Name,\n                        $script:Cluster.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When Ensure is Present, the DRS rule does not exist and no error occurs while creating the DRS rule' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDRSRuleDoesNotExistAndNoErrorOccursWhileCreatingTheDRSRule\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-DrsRule mock with the specified name, Cluster location and Virtual Machines once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-DrsRule'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $Name -eq $dscResourceProperties.Name -and\n                            $Cluster -eq $script:Cluster -and\n                            $KeepTogether -eq $true -and\n                            [System.Linq.Enumerable]::SequenceEqual(\n                                $VM,\n                                [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]] $script:VirtualMachines\n                            ) -and\n                            $Enabled -eq $script:Constants.DrsRuleEnabled -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the DRS rule exists and error occurs while modifying the DRS rule' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndErrorOccursWhileModifyingTheDRSRule\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the DRS rule' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not modify DRS rule {0} for Cluster {1}. For more information: ScriptHalted\" -f @(\n                        $script:DrsRule.Name,\n                        $script:Cluster.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When Ensure is Present, the DRS rule exists and Virtual Machines are specified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndVirtualMachinesAreSpecified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-DrsRule mock with the specified DRS rule and Virtual Machines once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-DrsRule'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $Rule -eq $script:DrsRule -and\n                            [System.Linq.Enumerable]::SequenceEqual(\n                                $VM,\n                                [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]] $script:VirtualMachines\n                            ) -and\n                            $Enabled -eq !$script:Constants.DrsRuleEnabled -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the DRS rule does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheDRSRuleDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-DrsRule mock' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-DrsRule'\n                        ParameterFilter = {\n                            $Rule -eq $script:DrsRule -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent, the DRS rule exists and error occurs while removing the DRS rule' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentTheDRSRuleExistsAndErrorOccursWhileRemovingTheDRSRule\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while removing the DRS rule' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not remove DRS rule {0} for Cluster {1}. For more information: ScriptHalted\" -f @(\n                        $script:DrsRule.Name,\n                        $script:Cluster.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When Ensure is Absent and the DRS rule exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheDRSRuleExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-DrsRule mock with the specified DRS rule once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-DrsRule'\n                        ParameterFilter = {\n                            $Rule -eq $script:DrsRule -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Test\" -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDRSRuleDscResource\n            }\n\n            Context 'When Ensure is Present and the DRS rule does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTheDRSRuleDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the DRS rule does not exist' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Present, the DRS rule exists and the Virtual Machines referenced by the DRS rule should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndTheVirtualMachinesReferencedByTheDRSRuleShouldNotBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, DRS rule exists and the Virtual Machines referenced by the DRS rule should not be modified' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Present, the DRS rule exists and the Virtual Machines referenced by the DRS rule should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDRSRuleExistsAndTheVirtualMachinesReferencedByTheDRSRuleShouldBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the DRS rule exists and the Virtual Machines referenced by the DRS rule should be modified' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Absent and the DRS rule does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDRSRuleDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the DRS rule does not exist' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Absent and the DRS rule exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDRSRuleExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the DRS rule exists' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Get\" -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDRSRuleDscResource\n            }\n\n            Context 'When Ensure is Present and the DRS rule does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTheDRSRuleDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the DSC Resource properties' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $dscResourceProperties.Name\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $script:Datacenter.Name\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.ClusterName | Should -Be $script:Cluster.Name\n                    $dscResourceGetMethodResult.ClusterLocation | Should -Be $dscResourceProperties.ClusterLocation\n                    $dscResourceGetMethodResult.DRSRuleType | Should -Be $dscResourceProperties.DRSRuleType\n                    $dscResourceGetMethodResult.VMNames | Should -Be $dscResourceProperties.VMNames\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Absent'\n                    $dscResourceGetMethodResult.Enabled | Should -Be $dscResourceProperties.Enabled\n                }\n            }\n\n            Context 'When Ensure is Present and the DRS rule exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTheDRSRuleExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $script:DrsRule.Name\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $script:Datacenter.Name\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.ClusterName | Should -Be $script:Cluster.Name\n                    $dscResourceGetMethodResult.ClusterLocation | Should -Be $dscResourceProperties.ClusterLocation\n                    $dscResourceGetMethodResult.DRSRuleType | Should -Be ([string] $script:DrsRule.Type)\n                    $dscResourceGetMethodResult.VMNames | Should -Be $script:Constants.VirtualMachineNames\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Present'\n                    $dscResourceGetMethodResult.Enabled | Should -Be $script:DrsRule.Enabled\n                }\n            }\n\n            Context 'When Ensure is Absent and the DRS rule does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDRSRuleDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the DSC Resource properties' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $dscResourceProperties.Name\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $script:Datacenter.Name\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.ClusterName | Should -Be $script:Cluster.Name\n                    $dscResourceGetMethodResult.ClusterLocation | Should -Be $dscResourceProperties.ClusterLocation\n                    $dscResourceGetMethodResult.DRSRuleType | Should -Be $dscResourceProperties.DRSRuleType\n                    $dscResourceGetMethodResult.VMNames | Should -Be $dscResourceProperties.VMNames\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Absent'\n                    $dscResourceGetMethodResult.Enabled | Should -Be $dscResourceProperties.Enabled\n                }\n            }\n\n            Context 'When Ensure is Absent and the DRS rule exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDRSRuleExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $script:DrsRule.Name\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $script:Datacenter.Name\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.ClusterName | Should -Be $script:Cluster.Name\n                    $dscResourceGetMethodResult.ClusterLocation | Should -Be $dscResourceProperties.ClusterLocation\n                    $dscResourceGetMethodResult.DRSRuleType | Should -Be ([string] $script:DrsRule.Type)\n                    $dscResourceGetMethodResult.VMNames | Should -Be $script:Constants.VirtualMachineNames\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Present'\n                    $dscResourceGetMethodResult.Enabled | Should -Be $script:DrsRule.Enabled\n                }\n            }\n        }\n    }\n}\nfinally {\n    # Removes the mocked 'VMware.VimAutomation.Core' module from the current session after all tests have executed.\n    Invoke-TestCleanup -ModulePath $script:PSModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Datacenter.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'Datacenter'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\DatacenterMocks.ps1\"\n\n        Describe 'Datacenter\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatacenter\n            }\n\n            Context 'Invoking with Ensure Present and non existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndNonExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-Datacenter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datacenter'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:locationDatacenterLocationItemTwo -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the New-Datacenter mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datacenter'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:locationDatacenterLocationItemTwo -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndNonExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-Datacenter mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datacenter'\n                        ParameterFilter = { $Datacenter -eq $script:datacenterWithDatacenterLocationItemTwoAsParent -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-Datacenter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datacenter'\n                        ParameterFilter = { $Datacenter -eq $script:datacenterWithDatacenterLocationItemTwoAsParent -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'Datacenter\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatacenter\n            }\n\n            Context 'Invoking with Ensure Present and non existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Datacenter does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Datacenter exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Datacenter does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Datacenter exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'Datacenter\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatacenter\n            }\n\n            Context 'Invoking with Ensure Present and non existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:datacenterWithDatacenterLocationItemTwoAsParent.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingDatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:datacenterWithDatacenterLocationItemTwoAsParent.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatacenterFolder.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'DatacenterFolder'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\DatacenterFolderMocks.ps1\"\n\n        Describe 'DatacenterFolder\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForFolder\n            }\n\n            Context 'Invoking with Ensure Present and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-Folder mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Folder'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:locationDatacenterLocationItemTwo -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the New-Folder mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Folder'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:locationDatacenterLocationItemTwo -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-Folder mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Folder'\n                        ParameterFilter = { $Folder -eq $script:datacenterFolder -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-Folder mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Folder'\n                        ParameterFilter = { $Folder -eq $script:datacenterFolder -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'DatacenterFolder\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForFolder\n            }\n\n            Context 'Invoking with Ensure Present and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Folder does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Folder exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Folder does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Folder exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'DatacenterFolder\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForFolder\n            }\n\n            Context 'Invoking with Ensure Present and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:datacenterFolder.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:datacenterFolder.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatacenterInventoryBaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $datacenterInventoryBaseDSCClassName = 'DatacenterInventoryBaseDSC'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\DatacenterInventoryBaseDSCMocks.ps1\"\n\n        Describe 'DatacenterInventoryBaseDSC\\GetDatacenter' -Tag 'GetDatacenter' {\n            Context 'Empty Datacenter Location is passed and the Datacenter does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenEmptyDatacenterLocationIsPassedAndTheDatacenterDoesNotExist\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetDatacenter()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Datacenter does not exist' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetDatacenter() } | Should -Throw \"Datacenter $($datacenterInventoryBaseDSCProperties.DatacenterName) was not found at $($script:inventoryRootFolder.Name).\"\n                }\n            }\n\n            Context 'Empty Datacenter Location is passed and the Datacenter exists' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenEmptyDatacenterLocationIsPassedAndTheDatacenterExists\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetDatacenter()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Datacenter with the correct parent: MyDatacenter with parent Inventory Root Folder' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetDatacenter()\n\n                    # Assert\n                    $result | Should -Be $script:datacenterWithInventoryRootFolderAsParent\n                }\n            }\n\n            Context 'Datacenter Location consists of only one Folder and the Folder does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfOnlyOneFolderAndTheFolderDoesNotExist\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetDatacenter()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Folder Location does not exist' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetDatacenter() } | Should -Throw \"Folder $($script:constants.DatacenterLocationItemOne) was not found at $($script:inventoryRootFolder.Name).\"\n                }\n            }\n\n            Context 'Datacenter Location consists of only one Folder, the Folder exists and the Datacenter does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfOnlyOneFolderTheFolderExistsAndTheDatacenterDoesNotExist\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetDatacenter()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Datacenter does not exist' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetDatacenter() } | Should -Throw \"Datacenter $($datacenterInventoryBaseDSCProperties.DatacenterName) was not found at $($script:constants.DatacenterLocationItemOne).\"\n                }\n            }\n\n            Context 'Datacenter Location consists of only one Folder, the Folder exists and the Datacenter exists' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfOnlyOneFolderTheFolderExistsAndTheDatacenterExists\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetDatacenter()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Datacenter with the correct parent: MyDatacenter with parent Datacenter Location Item One' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetDatacenter()\n\n                    # Assert\n                    $result | Should -Be $script:datacenterWithDatacenterLocationItemOneAsParent\n                }\n            }\n\n            Context 'Datacenter Location consists of two Inventory Items and one of them is a Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfTwoInventoryItemsAndOneOfThemIsADatacenter\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetDatacenter()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Datacenter Location contains a Datacenter' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetDatacenter() } | Should -Throw \"The Location $($datacenterInventoryBaseDSCProperties.DatacenterLocation) contains another Datacenter $($script:constants.DatacenterName).\"\n                }\n            }\n\n            Context 'Datacenter Location consists of two Folders and the Location is not valid' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfTwoFoldersAndTheLocationIsNotValid\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetDatacenter()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Datacenter Location is not valid' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetDatacenter() } | Should -Throw \"Datacenter $($datacenterInventoryBaseDSCProperties.DatacenterName) with Location $($datacenterInventoryBaseDSCProperties.DatacenterLocation) was not found because $($script:constants.DatacenterLocationItemThree) folder cannot be found below $($script:InventoryRootFolder.Name).\"\n                }\n            }\n\n            Context 'Datacenter Location consists of two Folders, the Location is valid and the Datacenter does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfTwoFoldersTheLocationIsValidAndTheDatacenterDoesNotExist\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetDatacenter()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Datacenter does not exist' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetDatacenter() } | Should -Throw \"Datacenter $($datacenterInventoryBaseDSCProperties.DatacenterName) with Location $($datacenterInventoryBaseDSCProperties.DatacenterLocation) was not found.\"\n                }\n            }\n\n            Context 'Datacenter Location consists of two Folders, the Location is valid and the Datacenter exists' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenDatacenterLocationConsistsOfTwoFoldersTheLocationIsValidAndTheDatacenterExists\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetDatacenter()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Datacenter with the correct parent: MyDatacenter with parent Datacenter Location Item Two' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetDatacenter()\n\n                    # Assert\n                    $result | Should -Be $script:datacenterWithDatacenterLocationItemTwoAsParent\n                }\n            }\n        }\n\n        Describe 'DatacenterInventoryBaseDSC\\GetInventoryItemLocationInDatacenter' -Tag 'GetInventoryItemLocationInDatacenter' {\n            Context 'Empty Location is passed' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenEmptyLocationIsPassed\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Location with the correct parent: Datacenter Host Folder with parent My Datacenter' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n\n                    # Assert\n                    $result | Should -Be $script:datacenterHostFolder\n                }\n            }\n\n            Context 'Location consists of one Inventory Item and the Inventory Item does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfOneInventoryItemAndTheInventoryItemDoesNotExist\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Inventory Item from the Location does not exist' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder') } | Should -Throw \"Location $($datacenterInventoryBaseDSCProperties.Location) of Inventory Item $($datacenterInventoryBaseDSCProperties.Name) was not found in Folder $($script:datacenterHostFolder.Name).\"\n                }\n            }\n\n            Context 'Location consists of one Inventory Item and the Inventory Item exists' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfOneInventoryItemAndTheInventoryItemExists\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Location with the correct parent: Inventory Item Location Item One with parent Datacenter Host Folder' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n\n                    # Assert\n                    $result | Should -Be $script:inventoryItemLocationItemOne\n                }\n            }\n\n            Context 'Location consists of two Inventory Items and the Location is not valid' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfTwoInventoryItemsAndTheLocationIsNotValid\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Location is not valid' {\n                    # Act && Assert\n                    { $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder') } | Should -Throw \"Location $($datacenterInventoryBaseDSCProperties.Location) of Inventory Item $($datacenterInventoryBaseDSCProperties.Name) was not found in Datacenter $($datacenterInventoryBaseDSCProperties.DatacenterName).\"\n                }\n            }\n\n            Context 'Location consists of two Inventory Items and the Location is valid' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfTwoInventoryItemsAndTheLocationIsValid\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Location with the correct parent: Inventory Item Location Item Two with parent Inventory Item Location Item One' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n\n                    # Assert\n                    $result | Should -Be $script:foundLocations[0]\n                }\n            }\n        }\n\n        Describe 'DatacenterInventoryBaseDSC\\GetInventoryItem' -Tag 'GetInventoryItem' {\n            Context 'The Inventory Item does not exist at the specified Location' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenTheInventoryItemDoesNotExistAtTheSpecifiedLocation\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                    $inventoryItemLocation = $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetInventoryItem($inventoryItemLocation)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $null when the Inventory Item does not exist' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetInventoryItem($inventoryItemLocation)\n\n                    # Assert\n                    $result | Should -Be $null\n                }\n            }\n\n            Context 'The Inventory Item exists at the specified Location' {\n                BeforeAll {\n                    # Arrange\n                    $datacenterInventoryBaseDSCProperties = New-MocksWhenTheInventoryItemExistsAtTheSpecifiedLocation\n\n                    $datacenterInventoryBaseDSC = New-Object -TypeName $datacenterInventoryBaseDSCClassName -Property $datacenterInventoryBaseDSCProperties\n                    $datacenterInventoryBaseDSC.ConnectVIServer()\n                    $datacenter = $datacenterInventoryBaseDSC.GetDatacenter()\n                    $inventoryItemLocation = $datacenterInventoryBaseDSC.GetInventoryItemLocationInDatacenter($datacenter, 'HostFolder')\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $datacenterInventoryBaseDSC.GetInventoryItem($inventoryItemLocation)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the Inventory Item My Resource Pool at the specified Location' {\n                    # Act\n                    $result = $datacenterInventoryBaseDSC.GetInventoryItem($inventoryItemLocation)\n\n                    # Assert\n                    $result | Should -Be $script:inventoryItemWithInventoryItemLocationItemTwoAsParent\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Datastore/DatastoreBaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $datastoreBaseDSCClassName = 'DatastoreBaseDSC'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\DatastoreBaseDSCMocks.ps1\"\n\n        Describe 'DatastoreBaseDSC\\GetDatastore' -Tag 'GetDatastore' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreBaseDSC\n            }\n\n            Context 'When the Datastore does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenTheDatastoreDoesNotExist\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.GetDatastore()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $null when the Datastore does not exist' {\n                    # Act\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n\n                    # Assert\n                    $datastore | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When the Datastore exists' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenTheDatastoreExists\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.GetDatastore()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the Datastore with the specified name when the Datastore exists' {\n                    # Act\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n\n                    # Assert\n                    $datastore | Should -Be $script:datastore\n                }\n            }\n        }\n\n        Describe 'DatastoreBaseDSC\\ShouldModifyDatastore' -Tag 'ShouldModifyDatastore' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreBaseDSC\n            }\n\n            Context 'When CongestionThresholdMillisecond and StorageIOControlEnabled are not specified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenTheDatastoreExists\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.ShouldModifyDatastore($datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when CongestionThresholdMillisecond and StorageIOControlEnabled are not specified' {\n                    # Act\n                    $result = $datastoreBaseDSC.ShouldModifyDatastore($datastore)\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values do not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesDoNotNeedToBeModified\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.ShouldModifyDatastore($datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values do not need to be modified' {\n                    # Act\n                    $result = $datastoreBaseDSC.ShouldModifyDatastore($datastore)\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesNeedToBeModified\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.ShouldModifyDatastore($datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values need to be modified' {\n                    # Act\n                    $result = $datastoreBaseDSC.ShouldModifyDatastore($datastore)\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n        }\n\n        Describe 'DatastoreBaseDSC\\NewDatastore' -Tag 'NewDatastore' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreBaseDSC\n            }\n\n            Context 'When error occurs while creating the Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenErrorOccursWhileCreatingTheDatastore\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $newDatastoreParams = @{}\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $datastoreBaseDSC.NewDatastore($newDatastoreParams)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the Datastore' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $datastoreBaseDSC.NewDatastore($newDatastoreParams) } | Should -Throw \"Could not create Datastore $($datastoreBaseDSCProperties.Name) on VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When FileSystemVersion is not specified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenFileSystemVersionIsNotSpecified\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $newDatastoreParams = @{}\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.NewDatastore($newDatastoreParams)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the created Datastore' {\n                    # Act\n                    $datastore = $datastoreBaseDSC.NewDatastore($newDatastoreParams)\n\n                    # Assert\n                    $datastore | Should -Be $script:datastore\n                }\n            }\n\n            Context 'When FileSystemVersion is specified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenFileSystemVersionIsSpecified\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $newDatastoreParams = @{}\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.NewDatastore($newDatastoreParams)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the created Datastore' {\n                    # Act\n                    $datastore = $datastoreBaseDSC.NewDatastore($newDatastoreParams)\n\n                    # Assert\n                    $datastore | Should -Be $script:datastore\n                }\n            }\n        }\n\n        Describe 'DatastoreBaseDSC\\ModifyDatastore' -Tag 'ModifyDatastore' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreBaseDSC\n            }\n\n            Context 'When error occurs while modifying the Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenErrorOccursWhileModifyingTheDatastore\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $datastoreBaseDSC.ModifyDatastore($datastore)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while modifying the Datastore' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $datastoreBaseDSC.ModifyDatastore($datastore) } | Should -Throw \"Could not modify Datastore $($datastore.Name) on VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When StorageIOControlEnabled and CongestionThresholdMillisecond are not specified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenStorageIOControlEnabledAndCongestionThresholdMillisecondAreNotSpecified\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.ModifyDatastore($datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-Datastore mock without StorageIOControlEnabled and CongestionThresholdMillisecond once' {\n                    # Act\n                    $datastoreBaseDSC.ModifyDatastore($datastore)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:datastore -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When StorageIOControlEnabled and CongestionThresholdMillisecond are specified' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenStorageIOControlEnabledAndCongestionThresholdMillisecondAreSpecified\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.ModifyDatastore($datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-Datastore mock with the specified StorageIOControlEnabled and CongestionThresholdMillisecond once' {\n                    # Act\n                    $datastoreBaseDSC.ModifyDatastore($datastore)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:datastore -and\n                            $StorageIOControlEnabled -eq $script:constants.StorageIOControlEnabled -and\n                            $CongestionThresholdMillisecond -eq $script:constants.MaxCongestionThresholdMillisecond -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'DatastoreBaseDSC\\RemoveDatastore' -Tag 'RemoveDatastore' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreBaseDSC\n            }\n\n            Context 'When error occurs while removing the Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenErrorOccursWhileRemovingTheDatastore\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $datastoreBaseDSC.RemoveDatastore($datastore)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while removing the Datastore' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $datastoreBaseDSC.RemoveDatastore($datastore) } | Should -Throw \"Could not remove Datastore $($datastore.Name) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When no error occurs while removing the Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenNoErrorOccursWhileRemovingTheDatastore\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.RemoveDatastore($datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-Datastore mock with the specified Datastore and VMHost once' {\n                    # Act\n                    $datastoreBaseDSC.RemoveDatastore($datastore)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:datastore -and\n                            $VMHost -eq $script:vmHost -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'DatastoreBaseDSC\\PopulateResult' -Tag 'PopulateResult' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreBaseDSC\n            }\n\n            Context 'When the Datastore does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenTheDatastoreDoesNotExist\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $result = New-Object -TypeName $datastoreBaseDSCClassName\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.PopulateResult($result, $datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $datastoreBaseDSC.PopulateResult($result, $datastore)\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $datastoreBaseDSCProperties.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.FileSystemVersion | Should -BeNullOrEmpty\n                    $result.CongestionThresholdMillisecond | Should -BeNullOrEmpty\n                    $result.StorageIOControlEnabled | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When the Datastore exists' {\n                BeforeAll {\n                    # Arrange\n                    $datastoreBaseDSCProperties = New-MocksWhenTheDatastoreExists\n                    $datastoreBaseDSC = New-Object -TypeName $datastoreBaseDSCClassName -Property $datastoreBaseDSCProperties\n\n                    $datastoreBaseDSC.ConnectVIServer()\n                    $datastoreBaseDSC.RetrieveVMHost()\n                    $result = New-Object -TypeName $datastoreBaseDSCClassName\n                    $datastore = $datastoreBaseDSC.GetDatastore()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $datastoreBaseDSC.PopulateResult($result, $datastore)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $datastoreBaseDSC.PopulateResult($result, $datastore)\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $script:datastore.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.FileSystemVersion | Should -Be $script:datastore.FileSystemVersion\n                    $result.CongestionThresholdMillisecond | Should -Be $script:datastore.CongestionThresholdMillisecond\n                    $result.StorageIOControlEnabled | Should -Be $script:datastore.StorageIOControlEnabled\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Datastore/NfsDatastore.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'NfsDatastore'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\NfsDatastoreMocks.ps1\"\n\n        Describe 'NfsDatastore\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForNfsDatastore\n            }\n\n            Context 'When Ensure is Present, the Nfs Datastore is not created and AccessMode and AuthenticationMethod are not specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsDatastoreIsNotCreatedAndAccessModeAndAuthenticationMethodAreNotSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the New-Datastore mock without ReadOnly and Kerberos once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DatastoreName -and\n                            $VMHost -eq $script:vmHost -and\n                            $Path -eq $script:constants.NfsPath -and\n                            $Nfs -and\n                            $NfsHost -eq $script:constants.NfsHost -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs Datastore is not created and AccessMode and AuthenticationMethod are specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsDatastoreIsNotCreatedAndAccessModeAndAuthenticationMethodAreSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the New-Datastore mock with ReadOnly and Kerberos once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DatastoreName -and\n                            $VMHost -eq $script:vmHost -and\n                            $Path -eq $script:constants.NfsPath -and\n                            $Nfs -and\n                            $NfsHost -eq $script:constants.NfsHost -and\n                            $ReadOnly -and\n                            $Kerberos -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs Datastore is not created and StorageIOControlEnabled and CongestionThresholdMillisecond are specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsDatastoreIsNotCreatedAndStorageIOControlEnabledAndCongestionThresholdMillisecondAreSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the New-Datastore mock with the specified BlockSizeMB once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DatastoreName -and\n                            $VMHost -eq $script:vmHost -and\n                            $Path -eq $script:constants.NfsPath -and\n                            $Nfs -and\n                            $NfsHost -eq $script:constants.NfsHost -and\n                            $ReadOnly -and\n                            $Kerberos -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should invoke the Set-Datastore mock with the specified StorageIOControlEnabled and CongestionThresholdMillisecond once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:nfsDatastore -and\n                            $StorageIOControlEnabled -eq !$script:constants.StorageIOControlEnabled -and\n                            $CongestionThresholdMillisecond -eq $script:constants.CongestionThresholdMillisecond -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs Datastore is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsDatastoreIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should not invoke the Remove-Datastore mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:nfsDatastore -and\n                            $VMHost -eq $script:vmHost -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs Datastore is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsDatastoreIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the Remove-Datastore mock with the specified Datastore and VMHost once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:nfsDatastore -and\n                            $VMHost -eq $script:vmHost -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'NfsDatastore\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForNfsDatastore\n            }\n\n            Context 'When Ensure is Present and the Nfs Datastore is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheNfsDatastoreIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when Ensure is Present and the Nfs Datastore is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values do not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesDoNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $true when Ensure is Present, the Nfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values do not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when Ensure is Present, the Nfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs Datastore is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsDatastoreIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $true when Ensure is Absent and the Nfs Datastore is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs Datastore is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsDatastoreIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when Ensure is Absent and the Nfs Datastore is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'NfsDatastore\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForNfsDatastore\n            }\n\n            Context 'When the Nfs Datastore does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheNfsDatastoreDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.NfsHost | Should -Be $resourceProperties.NfsHost\n                    $result.Path | Should -Be $resourceProperties.Path\n                    $result.AccessMode | Should -Be $resource.AccessMode\n                    $result.AuthenticationMethod | Should -Be $resource.AuthenticationMethod\n                }\n            }\n\n            Context 'When the Nfs Datastore exists' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheNfsDatastoreExists\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.NfsHost | Should -Be $script:nfsDatastore.RemoteHost\n                    $result.Path | Should -Be $script:nfsDatastore.RemotePath\n                    $result.AccessMode | Should -Be $script:nfsDatastore.ExtensionData.Host.MountInfo.AccessMode\n                    $result.AuthenticationMethod | Should -Be $script:nfsDatastore.AuthenticationMethod.ToString()\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Datastore/VmfsDatastore.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VmfsDatastore'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VmfsDatastoreMocks.ps1\"\n\n        Describe 'VmfsDatastore\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVmfsDatastore\n            }\n\n            Context 'When Ensure is Present, the Vmfs Datastore is not created and BlockSizeMB is not specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsNotCreatedAndBlockSizeMBIsNotSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the New-Datastore mock without BlockSizeMB once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DatastoreName -and\n                            $VMHost -eq $script:vmHost -and\n                            $Path -eq $script:constants.ScsiLunCanonicalName -and\n                            $Vmfs -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Vmfs Datastore is not created and BlockSizeMB is specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsNotCreatedAndBlockSizeMBIsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the New-Datastore mock with the specified BlockSizeMB once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DatastoreName -and\n                            $VMHost -eq $script:vmHost -and\n                            $Path -eq $script:constants.ScsiLunCanonicalName -and\n                            $BlockSizeMB -eq $script:constants.BlockSizeMB\n                            $Vmfs -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Vmfs Datastore is not created and StorageIOControlEnabled and CongestionThresholdMillisecond are specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsNotCreatedAndStorageIOControlEnabledAndCongestionThresholdMillisecondAreSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the New-Datastore mock with the specified BlockSizeMB once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DatastoreName -and\n                            $VMHost -eq $script:vmHost -and\n                            $Path -eq $script:constants.ScsiLunCanonicalName -and\n                            $BlockSizeMB -eq $script:constants.BlockSizeMB\n                            $Vmfs -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should invoke the Set-Datastore mock with the specified StorageIOControlEnabled and CongestionThresholdMillisecond once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:datastore -and\n                            $StorageIOControlEnabled -eq !$script:constants.StorageIOControlEnabled -and\n                            $CongestionThresholdMillisecond -eq $script:constants.CongestionThresholdMillisecond -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Vmfs Datastore is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVmfsDatastoreIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should not invoke the Remove-Datastore mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:datastore -and\n                            $VMHost -eq $script:vmHost -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Vmfs Datastore is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVmfsDatastoreIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke the Remove-Datastore mock with the specified Datastore and VMHost once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Datastore -eq $script:datastore -and\n                            $VMHost -eq $script:vmHost -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VmfsDatastore\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVmfsDatastore\n            }\n\n            Context 'When Ensure is Present and the Vmfs Datastore is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheVmfsDatastoreIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when Ensure is Present and the Vmfs Datastore is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Vmfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values do not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesDoNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $true when Ensure is Present, the Vmfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values do not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Present, the Vmfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when Ensure is Present, the Vmfs Datastore is already created and Datastore CongestionThresholdMillisecond and StorageIOControlEnabled values need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Absent and the Vmfs Datastore is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVmfsDatastoreIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $true when Ensure is Absent and the Vmfs Datastore is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Vmfs Datastore is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVmfsDatastoreIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when Ensure is Absent and the Vmfs Datastore is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VmfsDatastore\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVmfsDatastore\n            }\n\n            Context 'When the Vmfs Datastore does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVmfsDatastoreDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.BlockSizeMB | Should -Be $resourceProperties.BlockSizeMB\n                    $result.Path | Should -Be $resourceProperties.Path\n                }\n            }\n\n            Context 'When the Vmfs Datastore exists' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVmfsDatastoreExists\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.BlockSizeMB | Should -Be $script:datastore.ExtensionData.Info.Vmfs.BlockSizeMB\n                    $result.Path | Should -Be $script:datastore.ExtensionData.Info.Vmfs.Extent.DiskName\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatastoreCluster/DatastoreCluster.Mocks.Data.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:Constants = @{\n    VIServer = '10.23.112.235'\n    VIServerUser = 'Admin1'\n    VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force\n    FolderType = 'Folder'\n    RootFolderValue = 'group-d1'\n    InventoryRootFolderId = 'Folder-group-d1'\n    InventoryRootFolderName = 'DscDatacenters'\n    DatastoreClusterId = 'StoragePod-group-p23'\n    DatastoreClusterName = 'DscDatastoreCluster'\n    DatacenterId = 'dsc-datacenter-inventory-root-folder-parent-id'\n    DatacenterName = 'DscDatacenter'\n    DatacenterDatastoreFolderId = 'group-s5'\n    DatacenterDatastoreFolderName = 'DscDatacenterDatastoreFolder'\n    IOLatencyThresholdMillisecond = 50\n    IOLoadBalanceEnabled = $true\n    SdrsAutomationLevel = 'FullyAutomated'\n    SpaceUtilizationThresholdPercent = 50\n}\n\n$script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword)\n\n$script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:Constants.VIServer\n    User = $script:Constants.VIServerUser\n    ExtensionData = [VMware.Vim.ServiceInstance] @{\n        Content = [VMware.Vim.ServiceContent] @{\n            RootFolder = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:Constants.FolderType\n                Value = $script:Constants.RootFolderValue\n            }\n        }\n    }\n}\n\n$script:RootFolderViewBaseObject = [VMware.Vim.Folder] @{\n    Name = $script:Constants.InventoryRootFolderName\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:Constants.FolderType\n        Value = $script:Constants.RootFolderValue\n    }\n}\n\n$script:InventoryRootFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:Constants.InventoryRootFolderId\n    Name = $script:Constants.InventoryRootFolderName\n}\n\n$script:Datacenter = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:Constants.DatacenterId\n    Name = $script:Constants.DatacenterName\n    ParentFolderId = $script:Constants.InventoryRootFolderId\n    ExtensionData = [VMware.Vim.Datacenter] @{\n        DatastoreFolder = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterDatastoreFolderId\n        }\n    }\n}\n\n$script:DatacenterDatastoreFolderViewBaseObject = [VMware.Vim.Folder] @{\n    Name = $script:Constants.DatacenterDatastoreFolderName\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:Constants.FolderType\n        Value = $script:Constants.DatacenterDatastoreFolderId\n    }\n}\n\n$script:DatacenterDatastoreFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:Constants.DatacenterDatastoreFolderId\n    Name = $script:Constants.DatacenterDatastoreFolderName\n    ExtensionData = [VMware.Vim.Folder] @{\n        MoRef = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterDatastoreFolderId\n        }\n    }\n}\n\n$script:DatastoreCluster = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.DatastoreClusterImpl] @{\n    Id = $script:Constants.DatastoreClusterId\n    Name = $script:Constants.DatastoreClusterName\n    IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    IOLoadBalanceEnabled = $script:Constants.IOLoadBalanceEnabled\n    SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n    ExtensionData = [VMware.Vim.StoragePod] @{\n        Parent = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterDatastoreFolderId\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatastoreCluster/DatastoreCluster.Mocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DatastoreClusterDscResourceProperties {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = @{\n        Server = $script:Constants.VIServer\n        Credential = $script:Credential\n        Name = $script:Constants.DatastoreClusterName\n        Location = [string]::Empty\n        DatacenterName = $script:Constants.DatacenterName\n        DatacenterLocation = [string]::Empty\n    }\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksForDatastoreClusterDscResource {\n    $viServerMock = $script:VIServer\n    $rootFolderViewBaseObjectMock = $script:RootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:InventoryRootFolder\n    $datacenterMock = $script:Datacenter\n    $datacenterDatastoreFolderViewBaseObjectMock = $script:DatacenterDatastoreFolderViewBaseObject\n    $datacenterDatastoreFolderMock = $script:DatacenterDatastoreFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    <#\n        The Get-View and Get-Inventory cmdlets should be mocked with Parameter filter\n        because they are executed twice in the DatacenterInventoryBaseDSC class.\n    #>\n    $getViewMockParamsForRootFolderViewBaseObject = @{\n        CommandName = 'Get-View'\n        MockWith = { return $rootFolderViewBaseObjectMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:VIServer.ExtensionData.Content.RootFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getViewMockParamsForRootFolderViewBaseObject\n\n    $getInventoryMockParamsForInventoryRootFolder = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $inventoryRootFolderMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:RootFolderViewBaseObject.MoRef\n        }\n        Verifiable = $true\n    }\n    Mock @getInventoryMockParamsForInventoryRootFolder\n\n    $getViewMockParamsForDatacenterDatastoreFolderViewBaseObject = @{\n        CommandName = 'Get-View'\n        MockWith = { return $datacenterDatastoreFolderViewBaseObjectMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:Datacenter.ExtensionData.DatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getViewMockParamsForDatacenterDatastoreFolderViewBaseObject\n\n    $getInventoryMockParamsForDatacenterDatastoreFolder = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $datacenterDatastoreFolderMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:DatacenterDatastoreFolderViewBaseObject.MoRef\n        }\n        Verifiable = $true\n    }\n    Mock @getInventoryMockParamsForDatacenterDatastoreFolder\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDatastoreClusterDoesNotExistAndErrorOccursWhileCreatingTheDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'New-DatastoreCluster' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDatastoreClusterDoesNotExistAndNoErrorOccursWhileCreatingTheDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'New-DatastoreCluster' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDatastoreClusterExistsAndErrorOccursWhileModifyingTheDatastoreClusterConfiguration {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n    $datastoreClusterDscResourceProperties.IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    $datastoreClusterDscResourceProperties.IOLoadBalanceEnabled = !$script:Constants.IOLoadBalanceEnabled\n    $datastoreClusterDscResourceProperties.SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    $datastoreClusterDscResourceProperties.SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'Set-DatastoreCluster' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDatastoreClusterDoesNotExistAndDatastoreClusterSettingsAreSpecified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n    $datastoreClusterDscResourceProperties.IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    $datastoreClusterDscResourceProperties.IOLoadBalanceEnabled = !$script:Constants.IOLoadBalanceEnabled\n    $datastoreClusterDscResourceProperties.SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    $datastoreClusterDscResourceProperties.SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'New-DatastoreCluster' -MockWith { return $datastoreClusterMock }.GetNewClosure() -Verifiable\n    Mock -CommandName 'Set-DatastoreCluster' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheDatastoreClusterDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Absent'\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'Remove-DatastoreCluster' -MockWith { return $null }.GetNewClosure()\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheDatastoreClusterExistsAndErrorOccursWhileRemovingTheDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Absent'\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'Remove-DatastoreCluster' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheDatastoreClusterExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Absent'\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    Mock -CommandName 'Remove-DatastoreCluster' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDatastoreClusterExistsAndTheDatastoreClusterConfigurationShouldNotBeModified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n    $datastoreClusterDscResourceProperties.IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    $datastoreClusterDscResourceProperties.IOLoadBalanceEnabled = $script:Constants.IOLoadBalanceEnabled\n    $datastoreClusterDscResourceProperties.SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    $datastoreClusterDscResourceProperties.SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheDatastoreClusterExistsAndTheDatastoreClusterConfigurationShouldBeModified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n    $datastoreClusterDscResourceProperties.IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    $datastoreClusterDscResourceProperties.IOLoadBalanceEnabled = !$script:Constants.IOLoadBalanceEnabled\n    $datastoreClusterDscResourceProperties.SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    $datastoreClusterDscResourceProperties.SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheDatastoreClusterDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n    $datastoreClusterDscResourceProperties.IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    $datastoreClusterDscResourceProperties.IOLoadBalanceEnabled = $script:Constants.IOLoadBalanceEnabled\n    $datastoreClusterDscResourceProperties.SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    $datastoreClusterDscResourceProperties.SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheDatastoreClusterExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Present'\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheDatastoreClusterDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n\n    $datastoreClusterDscResourceProperties.Ensure = 'Absent'\n    $datastoreClusterDscResourceProperties.IOLatencyThresholdMillisecond = $script:Constants.IOLatencyThresholdMillisecond\n    $datastoreClusterDscResourceProperties.IOLoadBalanceEnabled = $script:Constants.IOLoadBalanceEnabled\n    $datastoreClusterDscResourceProperties.SdrsAutomationLevel = $script:Constants.SdrsAutomationLevel\n    $datastoreClusterDscResourceProperties.SpaceUtilizationThresholdPercent = $script:Constants.SpaceUtilizationThresholdPercent\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    $datastoreClusterDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheDatastoreClusterExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreClusterDscResourceProperties = New-DatastoreClusterDscResourceProperties\n    $datastoreClusterDscResourceProperties.Ensure = 'Absent'\n\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n\n    $datastoreClusterDscResourceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatastoreCluster/DatastoreCluster.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PSModulePath = $env:PSModulePath\n$script:ModuleName = 'VMware.vSphereDSC'\n\n$script:UnitTestsPath = Join-Path (Join-Path (Get-Module -Name $script:ModuleName -ListAvailable).ModuleBase 'Tests') 'Unit'\n. (Join-Path -Path (Join-Path -Path $script:UnitTestsPath -ChildPath 'TestHelpers') -ChildPath 'TestUtils.ps1')\n\nImport-VMwareVSphereDSCModule\n\n# Imports the mocked 'VMware.VimAutomation.Core' module in the current session before all tests are executed.\nInvoke-TestSetup\n\ntry {\n    InModuleScope -ModuleName $script:ModuleName {\n        $script:DscResourceName = 'DatastoreCluster'\n\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'DatastoreCluster.Mocks.Data.ps1')\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'DatastoreCluster.Mocks.ps1')\n\n        Describe \"$script:DscResourceName\\Set\" -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreClusterDscResource\n            }\n\n            Context 'When Ensure is Present, the Datastore Cluster does not exist and error occurs while creating the Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDatastoreClusterDoesNotExistAndErrorOccursWhileCreatingTheDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the Datastore Cluster' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not create Datastore Cluster {0} in Folder {1}. For more information: ScriptHalted\" -f @(\n                        $dscResourceProperties.Name,\n                        $script:DatacenterDatastoreFolder.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When Ensure is Present, the Datastore Cluster does not exist and no error occurs while creating the Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDatastoreClusterDoesNotExistAndNoErrorOccursWhileCreatingTheDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-DatastoreCluster mock with the specified name and Datacenter Datastore Folder location once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-DatastoreCluster'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $Name -eq $dscResourceProperties.Name -and\n                            $Location -eq $script:DatacenterDatastoreFolder -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Datastore Cluster exists and error occurs while modifying the Datastore Cluster configuration' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDatastoreClusterExistsAndErrorOccursWhileModifyingTheDatastoreClusterConfiguration\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the Datastore Cluster' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not modify Datastore Cluster {0} configuration. For more information: ScriptHalted\" -f @(\n                        $script:DatastoreCluster.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When Ensure is Present, the Datastore Cluster does not exist and Datastore Cluster settings are specified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDatastoreClusterDoesNotExistAndDatastoreClusterSettingsAreSpecified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-DatastoreCluster mock with the specified name and Datacenter Datastore Folder location once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-DatastoreCluster'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $Name -eq $dscResourceProperties.Name -and\n                            $Location -eq $script:DatacenterDatastoreFolder -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should invoke the Set-DatastoreCluster mock with the specified Datastore Cluster settings once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-DatastoreCluster'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $DatastoreCluster -eq $script:DatastoreCluster -and\n                            $IOLatencyThresholdMillisecond -eq $script:Constants.IOLatencyThresholdMillisecond -and\n                            $IOLoadBalanceEnabled -eq !$script:Constants.IOLoadBalanceEnabled -and\n                            $SdrsAutomationLevel -eq $script:Constants.SdrsAutomationLevel -and\n                            $SpaceUtilizationThresholdPercent -eq $script:Constants.SpaceUtilizationThresholdPercent -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Datastore Cluster does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheDatastoreClusterDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-DatastoreCluster mock' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-DatastoreCluster'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $DatastoreCluster -eq $script:DatastoreCluster -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent, the Datastore Cluster exists and error occurs while removing the Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentTheDatastoreClusterExistsAndErrorOccursWhileRemovingTheDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the Datastore Cluster' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not remove Datastore Cluster {0}. For more information: ScriptHalted\" -f @(\n                        $script:DatastoreCluster.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When Ensure is Absent and the Datastore Cluster exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheDatastoreClusterExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-DatastoreCluster mock with the specified Datastore Cluster once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-DatastoreCluster'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            $DatastoreCluster -eq $script:DatastoreCluster -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Test\" -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreClusterDscResource\n            }\n\n            Context 'When Ensure is Present and the Datastore Cluster does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTheDatastoreClusterDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the Datastore Cluster does not exist' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Present, the Datastore Cluster exists and the Datastore Cluster configuration should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDatastoreClusterExistsAndTheDatastoreClusterConfigurationShouldNotBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, the Datastore Cluster exists and the Datastore Cluster configuration should not be modified' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Present, the Datastore Cluster exists and the Datastore Cluster configuration should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheDatastoreClusterExistsAndTheDatastoreClusterConfigurationShouldBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the Datastore Cluster exists and the Datastore Cluster configuration should be modified' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Absent and the Datastore Cluster does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDatastoreClusterDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the Datastore Cluster does not exist' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Absent and the Datastore Cluster exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDatastoreClusterExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the Datastore Cluster exists' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Get\" -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreClusterDscResource\n            }\n\n            Context 'When Ensure is Present and the Datastore Cluster does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTheDatastoreClusterDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the DSC Resource properties' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $dscResourceProperties.Name\n                    $dscResourceGetMethodResult.Location | Should -Be $dscResourceProperties.Location\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $dscResourceProperties.DatacenterName\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Absent'\n                    $dscResourceGetMethodResult.IOLatencyThresholdMillisecond | Should -Be $dscResourceProperties.IOLatencyThresholdMillisecond\n                    $dscResourceGetMethodResult.IOLoadBalanceEnabled | Should -Be $dscResourceProperties.IOLoadBalanceEnabled\n                    $dscResourceGetMethodResult.SdrsAutomationLevel | Should -Be $dscResourceProperties.SdrsAutomationLevel\n                    $dscResourceGetMethodResult.SpaceUtilizationThresholdPercent | Should -Be $dscResourceProperties.SpaceUtilizationThresholdPercent\n                }\n            }\n\n            Context 'When Ensure is Present and the Datastore Cluster exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTheDatastoreClusterExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $script:DatastoreCluster.Name\n                    $dscResourceGetMethodResult.Location | Should -Be $dscResourceProperties.Location\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $dscResourceProperties.DatacenterName\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Present'\n                    $dscResourceGetMethodResult.IOLatencyThresholdMillisecond | Should -Be $script:DatastoreCluster.IOLatencyThresholdMillisecond\n                    $dscResourceGetMethodResult.IOLoadBalanceEnabled | Should -Be $script:DatastoreCluster.IOLoadBalanceEnabled\n                    $dscResourceGetMethodResult.SdrsAutomationLevel | Should -Be $script:DatastoreCluster.SdrsAutomationLevel.ToString()\n                    $dscResourceGetMethodResult.SpaceUtilizationThresholdPercent | Should -Be $script:DatastoreCluster.SpaceUtilizationThresholdPercent\n                }\n            }\n\n            Context 'When Ensure is Absent and the Datastore Cluster does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDatastoreClusterDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the DSC Resource properties' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $dscResourceProperties.Name\n                    $dscResourceGetMethodResult.Location | Should -Be $dscResourceProperties.Location\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $dscResourceProperties.DatacenterName\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Absent'\n                    $dscResourceGetMethodResult.IOLatencyThresholdMillisecond | Should -Be $dscResourceProperties.IOLatencyThresholdMillisecond\n                    $dscResourceGetMethodResult.IOLoadBalanceEnabled | Should -Be $dscResourceProperties.IOLoadBalanceEnabled\n                    $dscResourceGetMethodResult.SdrsAutomationLevel | Should -Be $dscResourceProperties.SdrsAutomationLevel\n                    $dscResourceGetMethodResult.SpaceUtilizationThresholdPercent | Should -Be $dscResourceProperties.SpaceUtilizationThresholdPercent\n                }\n            }\n\n            Context 'When Ensure is Absent and the Datastore Cluster exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheDatastoreClusterExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.Name | Should -Be $script:DatastoreCluster.Name\n                    $dscResourceGetMethodResult.Location | Should -Be $dscResourceProperties.Location\n                    $dscResourceGetMethodResult.DatacenterName | Should -Be $dscResourceProperties.DatacenterName\n                    $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Present'\n                    $dscResourceGetMethodResult.IOLatencyThresholdMillisecond | Should -Be $script:DatastoreCluster.IOLatencyThresholdMillisecond\n                    $dscResourceGetMethodResult.IOLoadBalanceEnabled | Should -Be $script:DatastoreCluster.IOLoadBalanceEnabled\n                    $dscResourceGetMethodResult.SdrsAutomationLevel | Should -Be $script:DatastoreCluster.SdrsAutomationLevel.ToString()\n                    $dscResourceGetMethodResult.SpaceUtilizationThresholdPercent | Should -Be $script:DatastoreCluster.SpaceUtilizationThresholdPercent\n                }\n            }\n        }\n    }\n}\nfinally {\n    # Removes the mocked 'VMware.VimAutomation.Core' module from the current session after all tests have executed.\n    Invoke-TestCleanup -ModulePath $script:PSModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore.Mocks.Data.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:Constants = @{\n    VIServer = '10.23.112.235'\n    VIServerUser = 'Admin1'\n    VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force\n    FolderType = 'Folder'\n    RootFolderValue = 'group-d1'\n    InventoryRootFolderId = 'Folder-group-d1'\n    InventoryRootFolderName = 'DscDatacenters'\n    DatacenterId = 'dsc-datacenter-inventory-root-folder-parent-id'\n    DatacenterName = 'DscDatacenter'\n    DatacenterDatastoreFolderId = 'group-s5'\n    DatacenterDatastoreFolderName = 'DscDatacenterDatastoreFolder'\n    DatastoreClusterId = 'StoragePod-group-p23'\n    DatastoreClusterName = 'DscDatastoreCluster'\n    DatastoreOneId = 'Datastore-datastore-11'\n    DatastoreOneName = 'DscDatastoreOne'\n    DatastoreTwoId = 'Datastore-datastore-12'\n    DatastoreTwoName = 'DscDatastoreTwo'\n    DatastoreThreeId = 'Datastore-datastore-13'\n    DatastoreThreeName = 'DscDatastoreThree'\n    DatastoreNames = @('DscDatastoreOne', 'DscDatastoreTwo')\n}\n\n$script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword)\n\n$script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:Constants.VIServer\n    User = $script:Constants.VIServerUser\n    ExtensionData = [VMware.Vim.ServiceInstance] @{\n        Content = [VMware.Vim.ServiceContent] @{\n            RootFolder = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:Constants.FolderType\n                Value = $script:Constants.RootFolderValue\n            }\n        }\n    }\n}\n\n$script:InventoryRootFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:Constants.InventoryRootFolderId\n    Name = $script:Constants.InventoryRootFolderName\n}\n\n$script:Datacenter = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:Constants.DatacenterId\n    Name = $script:Constants.DatacenterName\n    ParentFolderId = $script:Constants.InventoryRootFolderId\n    ExtensionData = [VMware.Vim.Datacenter] @{\n        DatastoreFolder = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterDatastoreFolderId\n        }\n    }\n}\n\n$script:DatacenterDatastoreFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:Constants.DatacenterDatastoreFolderId\n    Name = $script:Constants.DatacenterDatastoreFolderName\n    ExtensionData = [VMware.Vim.Folder] @{\n        MoRef = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterDatastoreFolderId\n        }\n    }\n}\n\n$script:DatastoreCluster = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.DatastoreClusterImpl] @{\n    Id = $script:Constants.DatastoreClusterId\n    Name = $script:Constants.DatastoreClusterName\n    ExtensionData = [VMware.Vim.StoragePod] @{\n        Parent = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:Constants.FolderType\n            Value = $script:Constants.DatacenterDatastoreFolderId\n        }\n    }\n}\n\n$script:DatastoreOne = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Id = $script:Constants.DatastoreOneId\n    Name = $script:Constants.DatastoreOneName\n    ParentFolderId = $script:Constants.DatacenterDatastoreFolderId\n}\n\n$script:DatastoreTwo = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Id = $script:Constants.DatastoreTwoId\n    Name = $script:Constants.DatastoreTwoName\n    ParentFolderId = $script:Constants.DatacenterDatastoreFolderId\n}\n\n$script:DatastoreThree = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Id = $script:Constants.DatastoreThreeId\n    Name = $script:Constants.DatastoreThreeName\n    ParentFolderId = $script:Constants.DatastoreClusterId\n}\n\n$script:Datastores = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl[]] @(\n    $script:DatastoreOne,\n    $script:DatastoreTwo\n)\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore.Mocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DatastoreClusterAddDatastoreDscResourceProperties {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DatastoreClusterAddDatastoreDscResourceProperties = @{\n        Server = $script:Constants.VIServer\n        Credential = $script:Credential\n        DatacenterName = $script:Constants.DatacenterName\n        DatacenterLocation = [string]::Empty\n        DatastoreClusterName = $script:Constants.DatastoreClusterName\n        DatastoreClusterLocation = [string]::Empty\n    }\n\n    $DatastoreClusterAddDatastoreDscResourceProperties\n}\n\nfunction New-MocksForDatastoreClusterAddDatastoreDscResource {\n    $viServerMock = $script:VIServer\n    $inventoryRootFolderMock = $script:InventoryRootFolder\n    $datacenterMock = $script:Datacenter\n    $datacenterDatastoreFolderMock = $script:DatacenterDatastoreFolder\n    $datastoreClusterMock = $script:DatastoreCluster\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $getInventoryMockParamsForInventoryRootFolder = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $inventoryRootFolderMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:VIServer.ExtensionData.Content.RootFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getInventoryMockParamsForInventoryRootFolder\n\n    $getDatacenterMockParams = @{\n        CommandName = 'Get-Datacenter'\n        MockWith = { return $datacenterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatacenterName -and\n            $Location -eq $script:InventoryRootFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatacenterMockParams\n\n    $getInventoryMockParamsForDatacenterDatastoreFolder = @{\n        CommandName = 'Get-Inventory'\n        MockWith = { return $datacenterDatastoreFolderMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Id -eq $script:Datacenter.ExtensionData.DatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getInventoryMockParamsForDatacenterDatastoreFolder\n\n    $getDatastoreClusterMockParams = @{\n        CommandName = 'Get-DatastoreCluster'\n        MockWith = { return $datastoreClusterMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.DatastoreClusterName -and\n            $Location -eq $script:DatacenterDatastoreFolder\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreClusterMockParams\n}\n\nfunction New-MocksWhenErrorOccursWhileAddingDatastoresToDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DatastoreClusterAddDatastoreDscResourceProperties = New-DatastoreClusterAddDatastoreDscResourceProperties\n    $DatastoreClusterAddDatastoreDscResourceProperties.DatastoreNames = $script:Constants.DatastoreNames\n\n    $datastoresMock = $script:Datastores\n\n    $getDatastoreMockParams = @{\n        CommandName = 'Get-Datastore'\n        MockWith = { return $datastoresMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.DatastoreNames) -and\n            $Location -eq $script:Datacenter\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreMockParams\n\n    Mock -CommandName 'Move-Datastore' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $DatastoreClusterAddDatastoreDscResourceProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileAddingDatastoresToDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DatastoreClusterAddDatastoreDscResourceProperties = New-DatastoreClusterAddDatastoreDscResourceProperties\n    $DatastoreClusterAddDatastoreDscResourceProperties.DatastoreNames = $script:Constants.DatastoreNames\n\n    $datastoresMock = $script:Datastores\n\n    $getDatastoreMockParams = @{\n        CommandName = 'Get-Datastore'\n        MockWith = { return $datastoresMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.DatastoreNames) -and\n            $Location -eq $script:Datacenter\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreMockParams\n\n    Mock -CommandName 'Move-Datastore' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $DatastoreClusterAddDatastoreDscResourceProperties\n}\n\nfunction New-MocksWhenDatastoresShouldBeAddedToDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DatastoreClusterAddDatastoreDscResourceProperties = New-DatastoreClusterAddDatastoreDscResourceProperties\n    $DatastoreClusterAddDatastoreDscResourceProperties.DatastoreNames = $script:Constants.DatastoreNames\n\n    $datastoresMock = $script:Datastores\n\n    $getDatastoreMockParams = @{\n        CommandName = 'Get-Datastore'\n        MockWith = { return $datastoresMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.DatastoreNames) -and\n            $Location -eq $script:Datacenter\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreMockParams\n\n    $DatastoreClusterAddDatastoreDscResourceProperties\n}\n\nfunction New-MocksWhenDatastoresShouldNotBeAddedToDatastoreCluster {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DatastoreClusterAddDatastoreDscResourceProperties = New-DatastoreClusterAddDatastoreDscResourceProperties\n    $DatastoreClusterAddDatastoreDscResourceProperties.DatastoreNames = @($script:Constants.DatastoreThreeName)\n\n    $datastoresMock = @($script:DatastoreThree)\n\n    $getDatastoreMockParams = @{\n        CommandName = 'Get-Datastore'\n        MockWith = { return $datastoresMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            [System.Linq.Enumerable]::SequenceEqual($Name, [string[]] $script:Constants.DatastoreThreeName) -and\n            $Location -eq $script:Datacenter\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreMockParams\n\n    $DatastoreClusterAddDatastoreDscResourceProperties\n}\n\nfunction New-MocksInGet {\n    [OutputType([System.Collections.Hashtable])]\n\n    $DatastoreClusterAddDatastoreDscResourceProperties = New-DatastoreClusterAddDatastoreDscResourceProperties\n\n    $datastoresMock = $script:Datastores\n\n    $getDatastoreMockParams = @{\n        CommandName = 'Get-Datastore'\n        MockWith = { return $datastoresMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Location -eq $script:DatastoreCluster\n        }\n        Verifiable = $true\n    }\n    Mock @getDatastoreMockParams\n\n    $DatastoreClusterAddDatastoreDscResourceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/DatastoreClusterAddDatastore/DatastoreClusterAddDatastore.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PSModulePath = $env:PSModulePath\n$script:ModuleName = 'VMware.vSphereDSC'\n\n$script:UnitTestsPath = Join-Path (Join-Path (Get-Module -Name $script:ModuleName -ListAvailable).ModuleBase 'Tests') 'Unit'\n. (Join-Path -Path (Join-Path -Path $script:UnitTestsPath -ChildPath 'TestHelpers') -ChildPath 'TestUtils.ps1')\n\nImport-VMwareVSphereDSCModule\n\n# Imports the mocked 'VMware.VimAutomation.Core' module in the current session before all tests are executed.\nInvoke-TestSetup\n\ntry {\n    InModuleScope -ModuleName $script:ModuleName {\n        $script:DscResourceName = 'DatastoreClusterAddDatastore'\n\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'DatastoreClusterAddDatastore.Mocks.Data.ps1')\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'DatastoreClusterAddDatastore.Mocks.ps1')\n\n        Describe \"$script:DscResourceName\\Set\" -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreClusterAddDatastoreDscResource\n            }\n\n            Context 'When error occurs while adding Datastores to Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenErrorOccursWhileAddingDatastoresToDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while adding Datastores to Datastore Cluster' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not add Datastores {0} to Datastore Cluster {1}. For more information: ScriptHalted\" -f @(\n                        ($script:Datastores.Name -Join ', '),\n                        $script:DatastoreCluster.Name\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When no error occurs while adding Datastores to Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenNoErrorOccursWhileAddingDatastoresToDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Move-Datastore mock with the specified Datastores and Datastore Cluster once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Move-Datastore'\n                        ParameterFilter = {\n                            $Server -eq $script:VIServer -and\n                            [System.Linq.Enumerable]::SequenceEqual(\n                                $Datastore,\n                                [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]] $script:Datastores\n                            ) -and\n                            $Destination -eq $script:DatastoreCluster -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Test\" -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreClusterAddDatastoreDscResource\n            }\n\n            Context 'When Datastores should be added to Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenDatastoresShouldBeAddedToDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Datastores should be added to Datastore Cluster' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Datastores should not be added to Datastore Cluster' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenDatastoresShouldNotBeAddedToDatastoreCluster\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Datastores should not be added to Datastore Cluster' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Get\" -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForDatastoreClusterAddDatastoreDscResource\n\n                $dscResourceProperties = New-MocksInGet\n                $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                # Act\n                $dscResourceGetMethodResult = $dscResource.Get()\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values from the server' {\n                # Assert\n                $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                $dscResourceGetMethodResult.DatacenterName | Should -Be $script:Datacenter.Name\n                $dscResourceGetMethodResult.DatacenterLocation | Should -Be $dscResourceProperties.DatacenterLocation\n                $dscResourceGetMethodResult.DatastoreClusterName | Should -Be $script:DatastoreCluster.Name\n                $dscResourceGetMethodResult.DatastoreClusterLocation | Should -Be $dscResourceProperties.DatastoreClusterLocation\n                $dscResourceGetMethodResult.DatastoreNames | Should -Be ($script:Datastores | Select-Object -ExpandProperty Name)\n            }\n        }\n    }\n}\nfinally {\n    # Removes the mocked 'VMware.VimAutomation.Core' module from the current session after all tests have executed.\n    Invoke-TestCleanup -ModulePath $script:PSModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/EsxCliBaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $esxCliBaseDSCClassName = 'EsxCliBaseDSC'\n        $esxCliBaseDSCChildClassName = 'EsxCliBaseDSCChild'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\EsxCliBaseDSCMocks.ps1\"\n\n        Describe 'EsxCliBaseDSC\\GetEsxCli' -Tag 'GetEsxCli' {\n            BeforeAll {\n                # Arrange\n                New-MocksForEsxCliBaseDSC\n            }\n\n            Context 'When error occurs while retrieving the EsxCli interface' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCProperties = New-MocksWhenErrorOccursWhileRetrievingTheEsxCliInterface\n                    $esxCliBaseDSC = New-Object -TypeName $esxCliBaseDSCClassName -Property $esxCliBaseDSCProperties\n\n                    $esxCliBaseDSC.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSC.GetVMHost()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $esxCliBaseDSC.GetEsxCli($vmHost)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while retrieving the EsxCli interface' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $esxCliBaseDSC.GetEsxCli($vmHost) } | Should -Throw \"Could not retrieve EsxCli interface for VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the EsxCli interface is retrieved successfully' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCProperties = New-MocksWhenTheEsxCliInterfaceIsRetrievedSuccessfully\n                    $esxCliBaseDSC = New-Object -TypeName $esxCliBaseDSCClassName -Property $esxCliBaseDSCProperties\n\n                    $esxCliBaseDSC.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSC.GetVMHost()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $esxCliBaseDSC.GetEsxCli($vmHost)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should populate the EsxCli property of the class with the EsxCli interface' {\n                    # Act\n                    $esxCliBaseDSC.GetEsxCli($vmHost)\n\n                    # Assert\n                    $esxCliBaseDSC.EsxCli | Should -Be $script:esxCli\n                }\n            }\n        }\n\n        Describe 'EsxCliBaseDSC\\ExecuteEsxCliModifyMethod' -Tag 'ExecuteEsxCliModifyMethod' {\n            BeforeAll {\n                # Arrange\n                New-MocksForEsxCliBaseDSC\n\n                # A child class is needed to test the arguments population inside ExecuteEsxCliModifyMethod().\n                class EsxCliBaseDSCChild : EsxCliBaseDSC {\n                    [string] $Layout\n                    [nullable[bool]] $Enable\n                    [nullable[long]] $Size\n                    [int[]] $ParameterKeys\n                }\n            }\n\n            Context 'When error occurs while creating the arguments for the EsxCli command' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCProperties = New-MocksWhenErrorOccursWhileCreatingTheArgumentsForTheEsxCliCommand\n                    $esxCliBaseDSC = New-Object -TypeName $esxCliBaseDSCClassName -Property $esxCliBaseDSCProperties\n\n                    $esxCliBaseDSC.EsxCliCommand = $script:constants.EsxCliDCUIKeyboardCommand\n\n                    $esxCliBaseDSC.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSC.GetVMHost()\n                    $esxCliBaseDSC.GetEsxCli($vmHost)\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $esxCliBaseDSC.ExecuteEsxCliModifyMethod($script:constants.EsxCliCommandSetMethodName)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the arguments for the EsxCli command' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $esxCliBaseDSC.ExecuteEsxCliModifyMethod($script:constants.EsxCliCommandSetMethodName) } | Should -Throw \"Could not create arguments for $($script:constants.EsxCliCommandSetMethodName) method. For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When error occurs while invoking the EsxCli command method' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCProperties = New-MocksWhenErrorOccursWhileInvokingTheEsxCliCommandMethod\n                    $esxCliBaseDSC = New-Object -TypeName $esxCliBaseDSCClassName -Property $esxCliBaseDSCProperties\n\n                    $esxCliBaseDSC.EsxCliCommand = $script:constants.EsxCliDCUIKeyboardCommand\n\n                    $esxCliBaseDSC.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSC.GetVMHost()\n                    $esxCliBaseDSC.GetEsxCli($vmHost)\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $esxCliBaseDSC.ExecuteEsxCliModifyMethod($script:constants.EsxCliCommandSetMethodName)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while invoking the EsxCli command method' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $esxCliBaseDSC.ExecuteEsxCliModifyMethod($script:constants.EsxCliCommandSetMethodName) } | Should -Throw \"EsxCli command esxcli.$($script:constants.EsxCliDCUIKeyboardCommand) failed to execute successfully. For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the EsxCli command method is executed successfully' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCChildProperties = New-MocksWhenTheEsxCliCommandMethodIsExecutedSuccessfully\n                    $esxCliBaseDSCChild = New-Object -TypeName $esxCliBaseDSCChildClassName -Property $esxCliBaseDSCChildProperties\n\n                    $esxCliBaseDSCChild.Layout = $script:constants.EsxCliSetMethodPopulatedArgs.layout\n                    $esxCliBaseDSCChild.Size = $script:constants.EsxCliSetMethodPopulatedArgs.size\n                    $esxCliBaseDSCChild.ParameterKeys = $script:constants.EsxCliSetMethodPopulatedArgs.parameterkeys\n                    $esxCliBaseDSCChild.EsxCliCommand = $script:constants.EsxCliDCUIKeyboardCommand\n\n                    $esxCliBaseDSCChild.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSCChild.GetVMHost()\n                    $esxCliBaseDSCChild.GetEsxCli($vmHost)\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $esxCliBaseDSCChild.ExecuteEsxCliModifyMethod($script:constants.EsxCliCommandSetMethodName)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Invoke-EsxCliCommandMethod mock with the specified EsxCli command method and arguments hashtable once' {\n                    # Act\n                    $esxCliBaseDSCChild.ExecuteEsxCliModifyMethod($script:constants.EsxCliCommandSetMethodName)\n\n                    # Assert\n\n                    # The 'enable' key of the arguments hashtable is not populated, so it should have a default value in the cloned arguments hashtable before the comparison.\n                    $expectedEsxCliSetMethodArgs = $script:constants.EsxCliSetMethodPopulatedArgs.Clone()\n                    $expectedEsxCliSetMethodArgs.enable = $script:constants.EsxCliSetMethodArgs.enable\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Invoke-EsxCliCommandMethod'\n                        ParameterFilter = {\n                            $EsxCli -eq $script:esxCli -and\n                            $EsxCliCommandMethod -eq $script:constants.EsxCliSetMethodInvoke -and\n                            (Compare-Hashtables -HashtableOne $EsxCliCommandMethodArguments -HashtableTwo $expectedEsxCliSetMethodArgs)\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'EsxCliBaseDSC\\ExecuteEsxCliRetrievalMethod' -Tag 'ExecuteEsxCliRetrievalMethod' {\n            BeforeAll {\n                # Arrange\n                New-MocksForEsxCliBaseDSC\n            }\n\n            Context 'When error occurs while invoking the EsxCli command retrieval method' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCProperties = New-MocksWhenErrorOccursWhileInvokingTheEsxCliCommandRetrievalMethod\n                    $esxCliBaseDSC = New-Object -TypeName $esxCliBaseDSCClassName -Property $esxCliBaseDSCProperties\n\n                    $esxCliBaseDSC.EsxCliCommand = $script:constants.EsxCliDCUIKeyboardCommand\n\n                    $esxCliBaseDSC.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSC.GetVMHost()\n                    $esxCliBaseDSC.GetEsxCli($vmHost)\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $esxCliBaseDSC.ExecuteEsxCliRetrievalMethod($script:constants.EsxCliCommandGetMethodName)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while invoking the EsxCli command method' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $esxCliBaseDSC.ExecuteEsxCliRetrievalMethod($script:constants.EsxCliCommandGetMethodName) } | Should -Throw \"EsxCli command esxcli.$($script:constants.EsxCliDCUIKeyboardCommand) failed to execute successfully. For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the EsxCli command retrieval method is executed successfully' {\n                BeforeAll {\n                    # Arrange\n                    $esxCliBaseDSCProperties = New-MocksWhenTheEsxCliCommandRetrievalMethodIsExecutedSuccessfully\n                    $esxCliBaseDSC = New-Object -TypeName $esxCliBaseDSCClassName -Property $esxCliBaseDSCProperties\n\n                    $esxCliBaseDSC.EsxCliCommand = $script:constants.EsxCliDCUIKeyboardCommand\n\n                    $esxCliBaseDSC.ConnectVIServer()\n                    $vmHost = $esxCliBaseDSC.GetVMHost()\n                    $esxCliBaseDSC.GetEsxCli($vmHost)\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $esxCliBaseDSC.ExecuteEsxCliRetrievalMethod($script:constants.EsxCliCommandGetMethodName)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct retrieval method result' {\n                    # Act\n                    $esxCliGetMethodResult = $esxCliBaseDSC.ExecuteEsxCliRetrievalMethod($script:constants.EsxCliCommandGetMethodName)\n\n                    # Assert\n                    $esxCliGetMethodResult | Should -Be $script:constants.DCUIKeyboardUSDefaultLayout\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostAcceptanceLevel.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostAcceptanceLevel'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostAcceptanceLevelMocks.ps1\"\n\n        Describe 'VMHostAcceptanceLevel\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostAcceptanceLevel\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostAcceptanceLevel\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAcceptanceLevel\n            }\n\n            Context 'When the VMHost acceptance level should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostAcceptanceLevelShouldBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost acceptance level should be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost acceptance level should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostAcceptanceLevelShouldNotBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost acceptance level should not be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostAcceptanceLevel\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostAcceptanceLevel\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Level | Should -Be $script:constants.VMwareCertifiedAcceptanceLevel\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostDCUIKeyboard.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostDCUIKeyboard'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostDCUIKeyboardMocks.ps1\"\n\n        Describe 'VMHostDCUIKeyboard\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostDCUIKeyboard\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostDCUIKeyboard\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostDCUIKeyboard\n            }\n\n            Context 'When the VMHost DCUI Keyboard Layout does not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostDCUIKeyboardLayoutDoesNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost DCUI Keyboard Layout does not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost DCUI Keyboard Layout needs to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostDCUIKeyboardLayoutNeedsToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost DCUI Keyboard Layout needs to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostDCUIKeyboard\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostDCUIKeyboard\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Layout | Should -Be $script:constants.DCUIKeyboardUSDefaultLayout\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostNetworkCoreDump.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostNetworkCoreDump'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostNetworkCoreDumpMocks.ps1\"\n\n        Describe 'VMHostNetworkCoreDump\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostNetworkCoreDump\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostNetworkCoreDump\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNetworkCoreDump\n            }\n\n            Context 'When the VMHost network coredump configuration should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostNetworkCoreDumpConfigurationShouldBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost network coredump configuration should be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost network coredump configuration should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostNetworkCoreDumpConfigurationShouldNotBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost network coredump configuration should not be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostNetworkCoreDump\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostNetworkCoreDump\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Enable | Should -Be $script:constants.NetworkCoreDumpEnabled\n                $result.InterfaceName | Should -Be $script:constants.NetworkCoreDumpInterfaceName\n                $result.ServerIp | Should -Be $script:constants.NetworkCoreDumpServerIP\n                $result.ServerPort | Should -Be $script:constants.NetworkCoreDumpServerPort\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostSNMPAgent.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostSNMPAgent'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostSNMPAgentMocks.ps1\"\n\n        Describe 'VMHostSNMPAgent\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostSNMPAgent\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostSNMPAgent\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostSNMPAgent\n            }\n\n            Context 'When the VMHost SNMP Agent should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSNMPAgentShouldBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost SNMP Agent should be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost SNMP Agent should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSNMPAgentShouldNotBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost SNMP Agent should not be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostSNMPAgent\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostSNMPAgent\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Authentication | Should -Be $script:constants.SNMPAgentAuthenticationProtocol\n                $result.Communities | Should -Be $script:constants.SNMPAgentCommunities\n                $result.Enable | Should -Be $script:constants.EnableSNMPAgent\n                $result.EngineId | Should -Be $script:constants.SNMPAgentEngineId\n                $result.Hwsrc | Should -Be $script:constants.SNMPAgentHwsrc\n                $result.LargeStorage | Should -Be $script:constants.SNMPAgentLargeStorage\n                $result.LogLevel | Should -Be $script:constants.SNMPAgentLogLevel\n                $result.NoTraps | Should -Be $script:constants.SNMPAgentNoTraps\n                $result.Port | Should -Be $script:constants.SNMPAgentPort\n                $result.Privacy | Should -Be $script:constants.SNMPAgentPrivacyProtocol\n                $result.RemoteUsers | Should -Be $script:constants.SNMPAgentRemoteUsers\n                $result.SysContact | Should -Be $script:constants.SNMPAgentSysContact\n                $result.SysLocation | Should -Be $script:constants.SNMPAgentSystemLocation\n                $result.Targets | Should -Be $script:constants.SNMPAgentTargets\n                $result.Users | Should -Be $script:constants.SNMPAgentUsers\n                $result.V3Targets | Should -Be $script:constants.SNMPAgentV3Targets\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostSharedSwapSpace.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostSharedSwapSpace'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostSharedSwapSpaceMocks.ps1\"\n\n        Describe 'VMHostSharedSwapSpace\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostSharedSwapSpace\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostSharedSwapSpace\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostSharedSwapSpace\n            }\n\n            Context 'When the VMHost shared swap space configuration should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSharedSwapSpaceConfigurationShouldBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost shared swap space configuration should be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost shared swap space configuration should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSharedSwapSpaceConfigurationShouldNotBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost shared swap space configuration should not be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostSharedSwapSpace\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostSharedSwapSpace\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.DatastoreEnabled | Should -Be $script:constants.DatastoreEnabled\n                $result.DatastoreName | Should -Be $script:constants.DatastoreName\n                $result.DatastoreOrder | Should -Be $script:constants.DatastoreOrder\n                $result.HostCacheEnabled | Should -Be $script:constants.HostCacheEnabled\n                $result.HostCacheOrder | Should -Be $script:constants.HostCacheOrder\n                $result.HostLocalSwapEnabled | Should -Be $script:constants.HostLocalSwapEnabled\n                $result.HostLocalSwapOrder | Should -Be $script:constants.HostLocalSwapOrder\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostSoftwareDevice.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostSoftwareDevice'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostSoftwareDeviceMocks.ps1\"\n\n        Describe 'VMHostSoftwareDevice\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostSoftwareDevice\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostSoftwareDevice\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostSoftwareDevice\n            }\n\n            Context 'When the VMHost Software device does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost Software device does not exist and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost Software device exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost Software device exists and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost Software device does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost Software device does not exist and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost Software device exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost Software device exists and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostSoftwareDevice\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostSoftwareDevice\n            }\n\n            Context 'When the VMHost Software device does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DeviceIdentifier | Should -Be $resourceProperties.DeviceIdentifier\n                    $result.InstanceAddress | Should -Be $resourceProperties.InstanceAddress\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'When the VMHost Software device exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DeviceIdentifier | Should -Be $script:constants.SoftwareDeviceId\n                    $result.InstanceAddress | Should -Be $script:constants.SoftwareDeviceInstanceAddress\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n\n            Context 'When the VMHost Software device does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DeviceIdentifier | Should -Be $resourceProperties.DeviceIdentifier\n                    $result.InstanceAddress | Should -Be $resourceProperties.InstanceAddress\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'When the VMHost Software device exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostSoftwareDeviceExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DeviceIdentifier | Should -Be $script:constants.SoftwareDeviceId\n                    $result.InstanceAddress | Should -Be $script:constants.SoftwareDeviceInstanceAddress\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostVMKernelActiveDumpFile.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVMKernelActiveDumpFile'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVMKernelActiveDumpFileMocks.ps1\"\n\n        Describe 'VMHostVMKernelActiveDumpFile\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostVMKernelActiveDumpFile\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostVMKernelActiveDumpFile\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVMKernelActiveDumpFile\n            }\n\n            Context 'When the VMHost VMKernel dump file is Active and Configured and Enable is $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileIsActiveAndConfiguredAndEnableIsTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost VMKernel dump file is Active and Configured and Enable is $true' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file is Active and Configured and Enable is $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileIsActiveAndConfiguredAndEnableIsFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost VMKernel dump file is Active and Configured and Enable is $false' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Enable is not passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnableIsNotPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Enable is not passed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVMKernelActiveDumpFile\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostVMKernelActiveDumpFile\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Enable | Should -BeTrue\n                $result.Smart | Should -BeTrue\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostVMKernelActiveDumpPartition.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVMKernelActiveDumpPartition'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVMKernelActiveDumpPartitionMocks.ps1\"\n\n        Describe 'VMHostVMKernelActiveDumpPartition\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostVMKernelActiveDumpPartition\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostVMKernelActiveDumpPartition\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVMKernelActiveDumpPartition\n            }\n\n            Context 'When the VMHost VMKernel dump partition is Active and Configured and Enable is $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpPartitionIsActiveAndConfiguredAndEnableIsTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost VMKernel dump partition is Active and Configured and Enable is $true' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump partition is Active and Configured and Enable is $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpPartitionIsActiveAndConfiguredAndEnableIsFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost VMKernel dump partition is Active and Configured and Enable is $false' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Enable is not passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnableIsNotPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Enable is not passed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVMKernelActiveDumpPartition\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostVMKernelActiveDumpPartition\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Enable | Should -BeTrue\n                $result.Smart | Should -BeTrue\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostVMKernelDumpFile.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVMKernelDumpFile'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVMKernelDumpFileMocks.ps1\"\n\n        Describe 'VMHostVMKernelDumpFile\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostVMKernelDumpFile\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostVMKernelDumpFile\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVMKernelDumpFile\n            }\n\n            Context 'When the VMHost VMKernel dump file does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost VMKernel dump file does not exist and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost VMKernel dump file exists and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost VMKernel dump file does not exist and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost VMKernel dump file exists and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostVMKernelDumpFile\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVMKernelDumpFile\n            }\n\n            Context 'When the VMHost VMKernel dump file does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DatastoreName | Should -Be $resourceProperties.DatastoreName\n                    $result.FileName | Should -Be $resourceProperties.FileName\n                    $result.Size | Should -Be $resourceProperties.Size\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DatastoreName | Should -Be $script:constants.DatastoreName\n                    $result.FileName | Should -Be $script:constants.DumpFileName\n                    $result.Size | Should -Be $script:constants.DumpFileSizeInMB\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DatastoreName | Should -Be $resourceProperties.DatastoreName\n                    $result.FileName | Should -Be $resourceProperties.FileName\n                    $result.Size | Should -Be $resourceProperties.Size\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n\n            Context 'When the VMHost VMKernel dump file exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelDumpFileExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DatastoreName | Should -Be $script:constants.DatastoreName\n                    $result.FileName | Should -Be $script:constants.DumpFileName\n                    $result.Size | Should -Be $script:constants.DumpFileSizeInMB\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostVMKernelModule.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVMKernelModule'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVMKernelModuleMocks.ps1\"\n\n        Describe 'VMHostVMKernelModule\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostVMKernelModule\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostVMKernelModule\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVMKernelModule\n            }\n\n            Context 'When the VMHost VMKernel module is enabled and Enabled is $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelModuleIsEnabledAndEnabledIsFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost VMKernel module is enabled and Enabled is $false' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost VMKernel module is enabled and Enabled is $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostVMKernelModuleIsEnabledAndEnabledIsTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost VMKernel module is enabled and Enabled is $true' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVMKernelModule\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksForVMHostVMKernelModule\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.Name | Should -Be $script:vmHost.Name\n                $result.Module | Should -Be $script:vmKernelModule.Name\n                $result.Enabled | Should -Be $script:vmKernelModule.IsEnabled\n                $result.Force | Should -BeNullOrEmpty\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/EsxCli/VMHostvSANNetworkConfiguration.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostvSANNetworkConfiguration'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostvSANNetworkConfigurationMocks.ps1\"\n\n        Describe 'VMHostvSANNetworkConfiguration\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                $resourceProperties = New-MocksInSetForVMHostvSANNetworkConfiguration\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n        }\n\n        Describe 'VMHostvSANNetworkConfiguration\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostvSANNetworkConfiguration\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost vSan network configuration IP Interface does not exist and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost vSan network configuration IP Interface exists and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost vSan network configuration IP Interface does not exist and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost vSan network configuration IP Interface exists and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostvSANNetworkConfiguration\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostvSANNetworkConfiguration\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.InterfaceName | Should -Be $script:constants.VMHostvSanNetworkConfigurationInterfaceTwoName\n                    $result.AgentV6McAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationAgentGroupIPv6MulticastAddress\n                    $result.AgentMcAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastAddress\n                    $result.AgentMcPort | Should -Be $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastPort\n                    $result.HostUcPort | Should -Be $script:constants.VMHostvSanNetworkConfigurationHostUnicastChannelBoundPort\n                    $result.MasterV6McAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationMasterGroupIPv6MulticastAddress\n                    $result.MasterMcAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastAddress\n                    $result.MasterMcPort | Should -Be $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastPort\n                    $result.MulticastTtl | Should -Be $script:constants.VMHostvSanNetworkConfigurationMulticastTTL\n                    $result.TrafficType | Should -Be $script:constants.VMHostvSanNetworkConfigurationTrafficType\n                    $result.Force | Should -BeNullOrEmpty\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.InterfaceName | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.VmkNicName\n                    $result.AgentV6McAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.AgentGroupIPv6MulticastAddress\n                    $result.AgentMcAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.AgentGroupMulticastAddress\n                    $result.AgentMcPort | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.AgentGroupMulticastPort\n                    $result.HostUcPort | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.HostUnicastChannelBoundPort\n                    $result.MasterV6McAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MasterGroupIPv6MulticastAddress\n                    $result.MasterMcAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MasterGroupMulticastAddress\n                    $result.MasterMcPort | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MasterGroupMulticastPort\n                    $result.MulticastTtl | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MulticastTTL\n                    $result.TrafficType | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.TrafficType\n                    $result.Force | Should -BeNullOrEmpty\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the class properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.InterfaceName | Should -Be $script:constants.VMHostvSanNetworkConfigurationInterfaceTwoName\n                    $result.AgentV6McAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationAgentGroupIPv6MulticastAddress\n                    $result.AgentMcAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastAddress\n                    $result.AgentMcPort | Should -Be $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastPort\n                    $result.HostUcPort | Should -Be $script:constants.VMHostvSanNetworkConfigurationHostUnicastChannelBoundPort\n                    $result.MasterV6McAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationMasterGroupIPv6MulticastAddress\n                    $result.MasterMcAddr | Should -Be $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastAddress\n                    $result.MasterMcPort | Should -Be $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastPort\n                    $result.MulticastTtl | Should -Be $script:constants.VMHostvSanNetworkConfigurationMulticastTTL\n                    $result.TrafficType | Should -Be $script:constants.VMHostvSanNetworkConfigurationTrafficType\n                    $result.Force | Should -BeNullOrEmpty\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'When the VMHost vSan network configuration IP Interface exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.InterfaceName | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.VmkNicName\n                    $result.AgentV6McAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.AgentGroupIPv6MulticastAddress\n                    $result.AgentMcAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.AgentGroupMulticastAddress\n                    $result.AgentMcPort | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.AgentGroupMulticastPort\n                    $result.HostUcPort | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.HostUnicastChannelBoundPort\n                    $result.MasterV6McAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MasterGroupIPv6MulticastAddress\n                    $result.MasterMcAddr | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MasterGroupMulticastAddress\n                    $result.MasterMcPort | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MasterGroupMulticastPort\n                    $result.MulticastTtl | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.MulticastTTL\n                    $result.TrafficType | Should -Be $script:vmHostvSanNetworkConfigurationIPInterface.TrafficType\n                    $result.Force | Should -BeNullOrEmpty\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/Folder.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'Folder'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\FolderMocks.ps1\"\n\n        Describe 'Folder\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForFolder\n            }\n\n            Context 'Invoking with Ensure Present and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-Folder mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Folder'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:foundLocations[0] -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the New-Folder mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-Folder'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $resourceProperties.Name -and $Location -eq $script:foundLocations[0] -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-Folder mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Folder'\n                        ParameterFilter = { $Folder -eq $script:folder -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-Folder mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-Folder'\n                        ParameterFilter = { $Folder -eq $script:folder -and $Server -eq $script:viServer -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'Folder\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForFolder\n            }\n\n            Context 'Invoking with Ensure Present and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Folder does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Folder exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Folder does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Folder exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'Folder\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForFolder\n            }\n\n            Context 'Invoking with Ensure Present and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.FolderType | Should -Be $resourceProperties.FolderType\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:folder.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.FolderType | Should -Be $resourceProperties.FolderType\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.FolderType | Should -Be $resourceProperties.FolderType\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Folder' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingFolder\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:folder.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.FolderType | Should -Be $resourceProperties.FolderType\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/InventoryBaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $inventoryBaseDSCClassName = 'InventoryBaseDSC'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\InventoryBaseDSCMocks.ps1\"\n\n        Describe 'InventoryBaseDSC\\GetInventoryItemLocation' -Tag 'GetInventoryItemLocation' {\n            Context 'Empty Location is passed' {\n                BeforeAll {\n                    # Arrange\n                    $inventoryBaseDSCProperties = New-MocksWhenEmptyLocationIsPassed\n\n                    $inventoryBaseDSC = New-Object -TypeName $inventoryBaseDSCClassName -Property $inventoryBaseDSCProperties\n                    $inventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $inventoryBaseDSC.GetInventoryItemLocation()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Location: Inventory Root Folder' {\n                    # Act\n                    $result = $inventoryBaseDSC.GetInventoryItemLocation()\n\n                    # Assert\n                    $result | Should -Be $script:inventoryRootFolder\n                }\n            }\n\n            Context 'Location consists of only one Folder and the Folder does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $inventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfOnlyOneFolderAndTheFolderDoesNotExist\n\n                    $inventoryBaseDSC = New-Object -TypeName $inventoryBaseDSCClassName -Property $inventoryBaseDSCProperties\n                    $inventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $inventoryBaseDSC.GetInventoryItemLocation()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Location does not exist' {\n                    # Act && Assert\n                    { $inventoryBaseDSC.GetInventoryItemLocation() } | Should -Throw \"Folder $($inventoryBaseDSCProperties.Location) was not found at $($script:inventoryRootFolder.Name).\"\n                }\n            }\n\n            Context 'Location consists of only one Folder and the Folder exists' {\n                BeforeAll {\n                    # Arrange\n                    $inventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfOnlyOneFolderAndTheFolderExists\n\n                    $inventoryBaseDSC = New-Object -TypeName $inventoryBaseDSCClassName -Property $inventoryBaseDSCProperties\n                    $inventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $inventoryBaseDSC.GetInventoryItemLocation()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Location: Datacenter Location Item One' {\n                    # Act\n                    $result = $inventoryBaseDSC.GetInventoryItemLocation()\n\n                    # Assert\n                    $result | Should -Be $script:locationDatacenterLocationItemOne\n                }\n            }\n\n            Context 'Location consists of two Inventory Items and one of them is a Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $inventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfTwoInventoryItemsAndOneOfThemIsADatacenter\n\n                    $inventoryBaseDSC = New-Object -TypeName $inventoryBaseDSCClassName -Property $inventoryBaseDSCProperties\n                    $inventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $inventoryBaseDSC.GetInventoryItemLocation()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Location contains a Datacenter' {\n                    # Act && Assert\n                    { $inventoryBaseDSC.GetInventoryItemLocation() } | Should -Throw \"The Location $($inventoryBaseDSCProperties.Location) contains Datacenter $($script:constants.DatacenterName) which is not valid.\"\n                }\n            }\n\n            Context 'Location consists of two Folders and the Location is not valid' {\n                BeforeAll {\n                    # Arrange\n                    $inventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfTwoFoldersAndTheLocationIsNotValid\n\n                    $inventoryBaseDSC = New-Object -TypeName $inventoryBaseDSCClassName -Property $inventoryBaseDSCProperties\n                    $inventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $inventoryBaseDSC.GetInventoryItemLocation()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Location is not valid' {\n                    # Act && Assert\n                    { $inventoryBaseDSC.GetInventoryItemLocation() } | Should -Throw \"Inventory Item $($inventoryBaseDSCProperties.Name) with Location $($inventoryBaseDSCProperties.Location) was not found because $($script:constants.DatacenterLocationItemThree) folder cannot be found below $($script:constants.InventoryRootFolderName).\"\n                }\n            }\n\n            Context 'Location consists of two Folders and the Location is valid' {\n                BeforeAll {\n                    # Arrange\n                    $inventoryBaseDSCProperties = New-MocksWhenLocationConsistsOfTwoFoldersAndTheLocationIsValid\n\n                    $inventoryBaseDSC = New-Object -TypeName $inventoryBaseDSCClassName -Property $inventoryBaseDSCProperties\n                    $inventoryBaseDSC.ConnectVIServer()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $inventoryBaseDSC.GetInventoryItemLocation()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct Location: Datacenter Location Item Two' {\n                    # Act\n                    $result = $inventoryBaseDSC.GetInventoryItemLocation()\n\n                    # Assert\n                    $result | Should -Be $script:locationDatacenterLocationItemTwo\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/NfsUser.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'NfsUser'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\NfsUserMocks.ps1\"\n\n        Describe 'NfsUser\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForNfsUser\n            }\n\n            Context 'When Ensure is Present, the Nfs User is not created and error occurs while creating the Nfs User' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsNotCreatedAndErrorOccursWhileCreatingTheNfsUser\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the Nfs User' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not create Nfs User $($script:constants.NfsUsername) on VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs User is not created and no error occurs while creating the Nfs User' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsNotCreatedAndNoErrorOccursWhileCreatingTheNfsUser\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-NfsUser mock with the specified username and password once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-NfsUser'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Username -eq $script:constants.NfsUsername -and\n                            $VMHost -eq $script:vmHost -and\n                            $Password -eq $script:constants.NfsUserPasswordOne -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs User is already created and error occurs while changing the password of the Nfs User' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndErrorOccursWhileChangingThePasswordOfTheNfsUser\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while changing the password of the Nfs User' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not change Nfs User $($script:constants.NfsUsername) password on VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs User is already created and the password should be changed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndThePasswordShouldBeChanged\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-NfsUser mock with the specified Nfs User and password once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-NfsUser'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $NfsUser -eq $script:nfsUser -and\n                            $Password -eq $script:constants.NfsUserPasswordTwo -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs User is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsUserIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-NfsUser mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-NfsUser'\n                        ParameterFilter = {\n                            $NfsUser -eq $script:nfsUser -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent, the Nfs User is not removed and error occurs while removing the Nfs User' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheNfsUserIsNotRemovedAndErrorOccursWhileRemovingTheNfsUser\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while removing the Nfs User' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not remove Nfs User $($script:constants.NfsUsername) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Absent, the Nfs User is not removed and no error occurs while removing the Nfs User' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheNfsUserIsNotRemovedAndNoErrorOccursWhileRemovingTheNfsUser\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-NfsUser mock with the specified Nfs User once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-NfsUser'\n                        ParameterFilter = {\n                            $NfsUser -eq $script:nfsUser -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'NfsUser\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForNfsUser\n            }\n\n            Context 'When Ensure is Present and the Nfs User is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheNfsUserIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the Nfs User is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs User is already created and Force property is specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndForcePropertyIsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the Nfs User is already created and Force property is specified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Nfs User is already created and Force property is not specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndForcePropertyIsNotSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, the Nfs User is already created and Force property is not specified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs User is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsUserIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the Nfs User is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs User is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsUserIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the Nfs User is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'NfsUser\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForNfsUser\n            }\n\n            Context 'When Ensure is Present and the Nfs User is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheNfsUserIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n\n            Context 'When Ensure is Present and the Nfs User is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndForcePropertyIsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $script:nfsUser.Username\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs User is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsUserIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n\n            Context 'When Ensure is Absent and the Nfs User is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheNfsUserIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $script:nfsUser.Username\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Force | Should -Be $resourceProperties.Force\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/PowerCLISettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'PowerCLISettings'\n\n$script:resourceProperties = @{\n    SettingsScope = 'LCM'\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'PowerCLISettings\\Set' -Tag 'Set' {\n        Context 'Invoking without PowerCLIConfiguration properties passed' {\n            BeforeAll {\n                # Arrange\n                Mock -CommandName Set-PowerCLIConfiguration -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Set-PowerCLIConfiguration mock with only the User Scope once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-PowerCLIConfiguration `\n                                  -ParameterFilter { $Scope -eq 'User' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with CEIPDataTransferProxyPolicy, DefaultVIServerMode, InvalidCertificateAction and ProxyPolicy PowerCLIConfiguration properties passed' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.CEIPDataTransferProxyPolicy = 'UseSystemProxy'\n                $script:resourceProperties.DefaultVIServerMode = 'Multiple'\n                $script:resourceProperties.InvalidCertificateAction = 'Fail'\n                $script:resourceProperties.ProxyPolicy = 'UseSystemProxy'\n\n                Mock -CommandName Set-PowerCLIConfiguration -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            AfterAll {\n                $script:resourceProperties.CEIPDataTransferProxyPolicy = 'Unset'\n                $script:resourceProperties.DefaultVIServerMode = 'Unset'\n                $script:resourceProperties.InvalidCertificateAction = 'Unset'\n                $script:resourceProperties.ProxyPolicy = 'Unset'\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Set-PowerCLIConfiguration mock with User Scope, DefaultVIServerMode, InvalidCertificateAction and ProxyPolicy once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-PowerCLIConfiguration `\n                                  -ParameterFilter { $Scope -eq 'User' -and $DefaultVIServerMode -eq 'Multiple' -and $InvalidCertificateAction -eq 'Fail' -and $ProxyPolicy -eq 'UseSystemProxy' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with DisplayDeprecationWarnings, ParticipateInCeip and WebOperationTimeoutSeconds PowerCLIConfiguration properties passed' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.DisplayDeprecationWarnings = $true\n                $script:resourceProperties.ParticipateInCeip = $false\n                $script:resourceProperties.WebOperationTimeoutSeconds = 100\n\n                Mock -CommandName Set-PowerCLIConfiguration -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            AfterAll {\n                $script:resourceProperties.DisplayDeprecationWarnings = $null\n                $script:resourceProperties.ParticipateInCeip = $null\n                $script:resourceProperties.WebOperationTimeoutSeconds = $null\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Set-PowerCLIConfiguration mock with User Scope, DisplayDeprecationWarnings, ParticipateInCeip and WebOperationTimeoutSeconds once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-PowerCLIConfiguration `\n                                  -ParameterFilter { $Scope -eq 'User' -and $DisplayDeprecationWarnings -eq $true -and $ParticipateInCeip -eq $false -and $WebOperationTimeoutSeconds -eq 100 } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n    }\n\n    Describe 'PowerCLISettings\\Test' -Tag 'Test' {\n        Context 'Invoking with equal PowerCLIConfiguration properties passed' {\n            BeforeAll {\n                # Arrange\n                $powerCLIConfigurationMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.PowerCLIConfigurationImpl] @{ Scope = 'User'; CEIPDataTransferProxyPolicy = [VMware.VimAutomation.ViCore.Types.V1.ProxyPolicy]::UseSystemProxy; `\n                                                                 DisplayDeprecationWarnings = $true; WebOperationTimeoutSeconds = 100 }\n                }\n\n                $script:resourceProperties.CEIPDataTransferProxyPolicy = 'UseSystemProxy'\n                $script:resourceProperties.DisplayDeprecationWarnings = $true\n                $script:resourceProperties.WebOperationTimeoutSeconds = 100\n\n                Mock -CommandName Get-PowerCLIConfiguration -MockWith $powerCLIConfigurationMock -ModuleName $script:moduleName\n            }\n\n            AfterAll {\n                $script:resourceProperties.CEIPDataTransferProxyPolicy = 'Unset'\n                $script:resourceProperties.DisplayDeprecationWarnings = $null\n                $script:resourceProperties.WebOperationTimeoutSeconds = $null\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Get-PowerCLIConfiguration mock with User Scope once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-PowerCLIConfiguration `\n                                  -ParameterFilter { $Scope -eq 'User' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call return $true (The configuration properties are equal)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with not equal PowerCLIConfiguration properties passed' {\n            BeforeAll {\n                # Arrange\n                $powerCLIConfigurationMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.PowerCLIConfigurationImpl] @{ Scope = 'User'; CEIPDataTransferProxyPolicy = [VMware.VimAutomation.ViCore.Types.V1.ProxyPolicy]::UseSystemProxy; `\n                                                                 DisplayDeprecationWarnings = $true; WebOperationTimeoutSeconds = 100 }\n                }\n\n                $script:resourceProperties.CEIPDataTransferProxyPolicy = 'UseSystemProxy'\n                $script:resourceProperties.DisplayDeprecationWarnings = $true\n                $script:resourceProperties.WebOperationTimeoutSeconds = 200\n\n                Mock -CommandName Get-PowerCLIConfiguration -MockWith $powerCLIConfigurationMock -ModuleName $script:moduleName\n            }\n\n            AfterAll {\n                $script:resourceProperties.CEIPDataTransferProxyPolicy = 'Unset'\n                $script:resourceProperties.DisplayDeprecationWarnings = $null\n                $script:resourceProperties.WebOperationTimeoutSeconds = $null\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Get-PowerCLIConfiguration mock with User Scope once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-PowerCLIConfiguration `\n                                  -ParameterFilter { $Scope -eq 'User' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call return $false (The configuration properties are not equal)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n    }\n\n    Describe 'PowerCLISettings\\Get' -Tag 'Get' {\n        BeforeAll {\n            # Arrange\n            $powerCLIConfigurationMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.PowerCLIConfigurationImpl] @{ Scope = 'User'; CEIPDataTransferProxyPolicy = [VMware.VimAutomation.ViCore.Types.V1.ProxyPolicy]::UseSystemProxy; `\n                                                             DefaultVIServerMode = [VMware.VimAutomation.ViCore.Types.V1.DefaultVIServerMode]::Multiple; InvalidCertificateAction = [VMware.VimAutomation.ViCore.Types.V1.BadCertificateAction]::Fail; `\n                                                             ParticipateInCeip = $false; ProxyPolicy = [VMware.VimAutomation.ViCore.Types.V1.ProxyPolicy]::UseSystemProxy; DisplayDeprecationWarnings = $true; `\n                                                             WebOperationTimeoutSeconds = 100 }\n            }\n\n            Mock -CommandName Get-PowerCLIConfiguration -MockWith $powerCLIConfigurationMock -ModuleName $script:moduleName\n        }\n\n        # Arrange\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Get-PowerCLIConfiguration mock with User Scope once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Get-PowerCLIConfiguration `\n                              -ParameterFilter { $Scope -eq 'User' } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.SettingsScope | Should -Be $script:resourceProperties.SettingsScope\n            $result.CEIPDataTransferProxyPolicy | Should -Be 'UseSystemProxy'\n            $result.DefaultVIServerMode | Should -Be 'Multiple'\n            $result.DisplayDeprecationWarnings | Should -Be $true\n            $result.InvalidCertificateAction | Should -Be 'Fail'\n            $result.ParticipateInCeip | Should -Be $false\n            $result.ProxyPolicy | Should -Be 'UseSystemProxy'\n            $result.WebOperationTimeoutSeconds | Should -Be 100\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/BaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-BaseDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $baseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n    }\n\n    $baseDSCProperties\n}\n\nfunction New-MocksWhenDisconnectVIServerClosesTheConnectionSuccessfully {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $baseDSCProperties = New-BaseDSCProperties\n\n    $viServerMock = $script:viServer\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:constants.VIServerName -and $Credential -eq $script:credential } -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $baseDSCProperties\n}\n\nfunction New-MocksWhenDisconnectVIServerResultsInAnErrorWhenClosingTheConnection {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $baseDSCProperties = New-BaseDSCProperties\n\n    $viServerMock = $script:viServer\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:constants.VIServerName -and $Credential -eq $script:credential } -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $baseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/DatacenterFolderMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-FolderProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n        Location = \"$($script:constants.DatacenterLocationItemOne)/$($script:constants.DatacenterLocationItemTwo)\"\n    }\n\n    $folderProperties\n}\n\nfunction New-MocksForFolder {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n    $datacenterLocationItemTwoMock = $script:datacenterLocationItemTwo\n    $datacenterLocationItemThreeMock = $script:datacenterLocationItemThree\n    $locationDatacenterLocationItemTwoMock = $script:locationDatacenterLocationItemTwo\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemOne.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemTwo.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $locationDatacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterLocationItemTwo.MoRef } -Verifiable\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    Mock -CommandName Get-Folder -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName New-Folder -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    $folderMock = $script:datacenterFolder\n\n    Mock -CommandName Get-Folder -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName New-Folder -MockWith { return $null }.GetNewClosure()\n\n    $folderProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Folder -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName Remove-Folder -MockWith { return $null }.GetNewClosure()\n\n    $folderProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    $folderMock = $script:datacenterFolder\n\n    Mock -CommandName Get-Folder -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName Remove-Folder -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    Mock -CommandName Get-Folder -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    $folderMock = $script:datacenterFolder\n\n    Mock -CommandName Get-Folder -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Folder -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    $folderMock = $script:datacenterFolder\n\n    Mock -CommandName Get-Folder -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $folderProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/DatacenterInventoryBaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DatacenterInventoryBaseDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n        DatacenterName = $script:constants.DatacenterName\n    }\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenEmptyDatacenterLocationIsPassedAndTheDatacenterDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = [string]::Empty\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenEmptyDatacenterLocationIsPassedAndTheDatacenterExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = [string]::Empty\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterWithInventoryRootFolderAsParentMock = $script:datacenterWithInventoryRootFolderAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithInventoryRootFolderAsParentMock }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfOnlyOneFolderAndTheFolderDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfOnlyOneFolderTheFolderExistsAndTheDatacenterDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfOnlyOneFolderTheFolderExistsAndTheDatacenterExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfTwoInventoryItemsAndOneOfThemIsADatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterName)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterChildEntityMock = $script:datacenterChildEntity\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterChildEntityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfTwoFoldersAndTheLocationIsNotValid {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemThree)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfTwoFoldersTheLocationIsValidAndTheDatacenterDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n    $datacenterLocationItemTwoMock = $script:datacenterLocationItemTwo\n    $datacenterLocationItemThreeMock = $script:datacenterLocationItemThree\n    $locationDatacenterLocationItemTwoMock = $script:locationDatacenterLocationItemTwo\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemOne.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemTwo.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $locationDatacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterLocationItemTwo.MoRef } -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenDatacenterLocationConsistsOfTwoFoldersTheLocationIsValidAndTheDatacenterExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n    $datacenterLocationItemTwoMock = $script:datacenterLocationItemTwo\n    $datacenterLocationItemThreeMock = $script:datacenterLocationItemThree\n    $locationDatacenterLocationItemTwoMock = $script:locationDatacenterLocationItemTwo\n    $datacenterWithDatacenterLocationItemTwoAsParentMock = $script:datacenterWithDatacenterLocationItemTwoAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemOne.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemTwo.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $locationDatacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterLocationItemTwo.MoRef } -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemTwoAsParentMock }.GetNewClosure() -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenEmptyLocationIsPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = [string]::Empty\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfOneInventoryItemAndTheInventoryItemDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = \"$($script:constants.InventoryItemLocationItemOne)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemOne -and $Location -eq $script:datacenterHostFolder } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfOneInventoryItemAndTheInventoryItemExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = \"$($script:constants.InventoryItemLocationItemOne)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $inventoryItemLocationItemOneMock = $script:inventoryItemLocationItemOne\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryItemLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemOne -and $Location -eq $script:datacenterHostFolder } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfTwoInventoryItemsAndTheLocationIsNotValid {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsMock = $script:foundLocations\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithDatacenterHostFolderAsParentMock = $script:inventoryItemLocationWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithDatacenterHostFolderAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfTwoInventoryItemsAndTheLocationIsValid {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsMock = $script:foundLocations\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock = $script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenTheInventoryItemDoesNotExistAtTheSpecifiedLocation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsMock = $script:foundLocations\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock = $script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenTheInventoryItemExistsAtTheSpecifiedLocation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterInventoryBaseDSCProperties = New-DatacenterInventoryBaseDSCProperties\n    $datacenterInventoryBaseDSCProperties.DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    $datacenterInventoryBaseDSCProperties.Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsMock = $script:foundLocations\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock = $script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent\n    $inventoryItemWithInventoryItemLocationItemTwoAsParentMock = $script:inventoryItemWithInventoryItemLocationItemTwoAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryItemWithInventoryItemLocationItemTwoAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $datacenterInventoryBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/DatacenterMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DatacenterProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n        Location = \"$($script:constants.DatacenterLocationItemOne)/$($script:constants.DatacenterLocationItemTwo)\"\n    }\n\n    $datacenterProperties\n}\n\nfunction New-MocksForDatacenter {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n    $datacenterLocationItemTwoMock = $script:datacenterLocationItemTwo\n    $datacenterLocationItemThreeMock = $script:datacenterLocationItemThree\n    $locationDatacenterLocationItemTwoMock = $script:locationDatacenterLocationItemTwo\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemOne.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemTwo.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $locationDatacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterLocationItemTwo.MoRef } -Verifiable\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndNonExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName New-Datacenter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datacenterProperties\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n\n    $datacenterMock = $script:datacenterWithDatacenterLocationItemTwoAsParent\n\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName New-Datacenter -MockWith { return $null }.GetNewClosure()\n\n    $datacenterProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndNonExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n    $datacenterProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName Remove-Datacenter -MockWith { return $null }.GetNewClosure()\n\n    $datacenterProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n    $datacenterProperties.Ensure = 'Absent'\n\n    $datacenterMock = $script:datacenterWithDatacenterLocationItemTwoAsParent\n\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n    Mock -CommandName Remove-Datacenter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datacenterProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $datacenterProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n\n    $datacenterMock = $script:datacenterWithDatacenterLocationItemTwoAsParent\n\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $datacenterProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n    $datacenterProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Datacenter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $datacenterProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingDatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datacenterProperties = New-DatacenterProperties\n    $datacenterProperties.Ensure = 'Absent'\n\n    $datacenterMock = $script:datacenterWithDatacenterLocationItemTwoAsParent\n\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:locationDatacenterLocationItemTwo } -Verifiable\n\n    $datacenterProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/DatastoreBaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DatastoreDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.DatastoreName\n        Path = $script:constants.ScsiLunCanonicalName\n    }\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksForDatastoreBaseDSC {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenTheDatastoreDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenTheDatastoreExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesDoNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreBaseDSCProperties.StorageIOControlEnabled = $script:constants.StorageIOControlEnabled\n    $datastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.MaxCongestionThresholdMillisecond\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreBaseDSCProperties.StorageIOControlEnabled = !$script:constants.StorageIOControlEnabled\n    $datastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.CongestionThresholdMillisecond\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileCreatingTheDatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    Mock -CommandName New-Datastore -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost -and $Path -eq $script:constants.ScsiLunCanonicalName -and !$Confirm } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenFileSystemVersionIsNotSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost -and $Path -eq $script:constants.ScsiLunCanonicalName -and !$Confirm } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenFileSystemVersionIsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreBaseDSCProperties.FileSystemVersion = $script:constants.FileSystemVersion\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost -and $Path -eq $script:constants.ScsiLunCanonicalName -and $FileSystemVersion -eq $script:constants.FileSystemVersion -and !$Confirm } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileModifyingTheDatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-Datastore -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Datastore -eq $script:datastore -and !$Confirm } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenStorageIOControlEnabledAndCongestionThresholdMillisecondAreNotSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-Datastore -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenStorageIOControlEnabledAndCongestionThresholdMillisecondAreSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreBaseDSCProperties.StorageIOControlEnabled = $script:constants.StorageIOControlEnabled\n    $datastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.MaxCongestionThresholdMillisecond\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-Datastore -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileRemovingTheDatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-Datastore -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Datastore -eq $script:datastore -and $VMHost -eq $script:vmHost -and !$Confirm } -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileRemovingTheDatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $datastoreBaseDSCProperties = New-DatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-Datastore -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $datastoreBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/DrsClusterMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DrsClusterProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n        Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n        DatacenterName = $script:constants.DatacenterName\n        DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    }\n\n    $drsClusterProperties\n}\n\nfunction New-MocksForDrsCluster {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsForClusterMock = $script:foundLocationsForCluster\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock = $script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsForClusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingClusterAndNoDrsSettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n    Mock -CommandName Add-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingClusterAndDrsSettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.DrsEnabled = $script:constants.DrsEnabled\n    $drsClusterProperties.DrsAutomationLevel = $script:constants.DrsAutomationLevel\n    $drsClusterProperties.DrsMigrationThreshold = $script:constants.DrsMigrationThreshold\n    $drsClusterProperties.DrsDistribution = $script:constants.DrsDistribution\n    $drsClusterProperties.MemoryLoadBalancing = $script:constants.MemoryLoadBalancing\n    $drsClusterProperties.CPUOverCommitment = $script:constants.CPUOverCommitment\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n    Mock -CommandName Add-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndNoDrsSettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n    Mock -CommandName Update-ClusterComputeResource -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndDrsSettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.DrsEnabled = $script:constants.DrsEnabled\n    $drsClusterProperties.DrsAutomationLevel = $script:constants.DrsAutomationLevel\n    $drsClusterProperties.DrsMigrationThreshold = $script:constants.DrsMigrationThreshold\n    $drsClusterProperties.DrsDistribution = $script:constants.DrsDistribution\n    $drsClusterProperties.MemoryLoadBalancing = $script:constants.MemoryLoadBalancing\n    $drsClusterProperties.CPUOverCommitment = $script:constants.CPUOverCommitment\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n    Mock -CommandName Update-ClusterComputeResource -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n    $drsClusterProperties.Ensure = 'Absent'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n    Mock -CommandName Remove-ClusterComputeResource -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n    $drsClusterProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n    Mock -CommandName Remove-ClusterComputeResource -MockWith { return $null }.GetNewClosure()\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.DrsEnabled = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Enabled\n    $drsClusterProperties.DrsAutomationLevel = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.DefaultVmBehavior.ToString()\n    $drsClusterProperties.DrsMigrationThreshold = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.VmotionRate\n    $drsClusterProperties.DrsDistribution = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[0]).Value\n    $drsClusterProperties.MemoryLoadBalancing = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[1]).Value\n    $drsClusterProperties.CPUOverCommitment = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[2]).Value\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndNonMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.DrsEnabled = $script:constants.DrsEnabled\n    $drsClusterProperties.DrsAutomationLevel = $script:constants.DrsAutomationLevel\n    $drsClusterProperties.DrsMigrationThreshold = $script:constants.DrsMigrationThreshold\n    $drsClusterProperties.DrsDistribution = $script:constants.DrsDistribution\n    $drsClusterProperties.MemoryLoadBalancing = $script:constants.MemoryLoadBalancing\n    $drsClusterProperties.CPUOverCommitment = $script:constants.CPUOverCommitment\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksInTestWhenEnsureAbsentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n    $drsClusterProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksInTestWhenEnsureAbsentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n    $drsClusterProperties.Ensure = 'Absent'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsurePresentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.DrsEnabled = $script:constants.DrsEnabled\n    $drsClusterProperties.DrsAutomationLevel = $script:constants.DrsAutomationLevel\n    $drsClusterProperties.DrsMigrationThreshold = $script:constants.DrsMigrationThreshold\n    $drsClusterProperties.DrsDistribution = $script:constants.DrsDistribution\n    $drsClusterProperties.MemoryLoadBalancing = $script:constants.MemoryLoadBalancing\n    $drsClusterProperties.CPUOverCommitment = $script:constants.CPUOverCommitment\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsurePresentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.DrsEnabled = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Enabled\n    $drsClusterProperties.DrsAutomationLevel = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.DefaultVmBehavior.ToString()\n    $drsClusterProperties.DrsMigrationThreshold = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.VmotionRate\n    $drsClusterProperties.DrsDistribution = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[0]).Value\n    $drsClusterProperties.MemoryLoadBalancing = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[1]).Value\n    $drsClusterProperties.CPUOverCommitment = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[2]).Value\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsureAbsentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.Ensure = 'Absent'\n    $drsClusterProperties.DrsEnabled = $script:constants.DrsEnabled\n    $drsClusterProperties.DrsAutomationLevel = $script:constants.DrsAutomationLevel\n    $drsClusterProperties.DrsMigrationThreshold = $script:constants.DrsMigrationThreshold\n    $drsClusterProperties.DrsDistribution = $script:constants.DrsDistribution\n    $drsClusterProperties.MemoryLoadBalancing = $script:constants.MemoryLoadBalancing\n    $drsClusterProperties.CPUOverCommitment = $script:constants.CPUOverCommitment\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsureAbsentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $drsClusterProperties = New-DrsClusterProperties\n\n    $drsClusterProperties.Ensure = 'Absent'\n    $drsClusterProperties.DrsEnabled = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Enabled\n    $drsClusterProperties.DrsAutomationLevel = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.DefaultVmBehavior.ToString()\n    $drsClusterProperties.DrsMigrationThreshold = $script:cluster.ExtensionData.ConfigurationEx.DrsConfig.VmotionRate\n    $drsClusterProperties.DrsDistribution = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[0]).Value\n    $drsClusterProperties.MemoryLoadBalancing = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[1]).Value\n    $drsClusterProperties.CPUOverCommitment = ($script:cluster.ExtensionData.ConfigurationEx.DrsConfig.Option[2]).Value\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocationsForCluster[0] } -Verifiable\n\n    $drsClusterProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/EsxCliBaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-EsxCliDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksForEsxCliBaseDSC {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenErrorOccursWhileRetrievingTheEsxCliInterface {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    Mock -CommandName Get-EsxCli -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksWhenTheEsxCliInterfaceIsRetrievedSuccessfully {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    $esxCliMock = $script:esxCli\n\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileCreatingTheArgumentsForTheEsxCliCommand {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    $esxCliMock = $script:esxCli\n\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { throw }.GetNewClosure() -ParameterFilter { $Command -eq $script:constants.EsxCliSetMethodCreateArgs } -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileInvokingTheEsxCliCommandMethod {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -ParameterFilter { $Command -eq $script:constants.EsxCliSetMethodCreateArgs } -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { throw }.GetNewClosure() -ParameterFilter { $EsxCli -eq $script:esxCli -and $EsxCliCommandMethod -eq $script:constants.EsxCliSetMethodInvoke -and $null -eq (Compare-Object -ReferenceObject $EsxCliCommandMethodArguments.Values -DifferenceObject $script:constants.EsxCliSetMethodArgs.Values) } -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksWhenTheEsxCliCommandMethodIsExecutedSuccessfully {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -ParameterFilter { $Command -eq $script:constants.EsxCliSetMethodCreateArgs } -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileInvokingTheEsxCliCommandRetrievalMethod {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    $esxCliMock = $script:esxCli\n\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { throw }.GetNewClosure() -ParameterFilter { $Command -eq $script:constants.EsxCliGetMethodInvoke } -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction New-MocksWhenTheEsxCliCommandRetrievalMethodIsExecutedSuccessfully {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $esxCliBaseDSCProperties = New-EsxCliDSCProperties\n\n    $esxCliMock = $script:esxCli\n    $esxCliGetMethodMock = $script:constants.DCUIKeyboardUSDefaultLayout\n\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $V2 } -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -ParameterFilter { $Command -eq $script:constants.EsxCliGetMethodInvoke } -Verifiable\n\n    $esxCliBaseDSCProperties\n}\n\nfunction Compare-Hashtables {\n    [CmdletBinding()]\n    [OutputType([bool])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [hashtable]\n        $HashtableOne,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [hashtable]\n        $HashtableTwo\n    )\n\n    $result = $true\n    if ($HashtableOne.Keys.Count -ne $HashtableTwo.Keys.Count) {\n        $result = $false\n    }\n    else {\n        $hashtableTwoKeys = $HashtableTwo.Keys\n        foreach ($key in $HashtableOne.Keys) {\n            if ($hashtableTwoKeys -NotContains $key) {\n                $result = $false\n                break\n            }\n\n            $hashtableOneValue = $HashtableOne.$key\n            $hashtableTwoValue = $HashtableTwo.$key\n\n            if ($hashtableOneValue -is [array] -and $hashtableTwoValue -is [array]) {\n                $elementsToAdd = $hashtableOneValue | Where-Object -FilterScript { $hashtableTwoValue -NotContains $_ }\n                $elementsToRemove = $hashtableTwoValue | Where-Object -FilterScript { $hashtableOneValue -NotContains $_ }\n\n                if ($null -ne $elementsToAdd -or $null -ne $elementsToRemove) {\n                    $result = $false\n                    break\n                }\n            }\n            elseif ($hashtableOneValue -is [hashtable] -and $hashtableTwoValue -is [hashtable]) {\n                $areEqual = Compare-Hashtables -HashtableOne $hashtableOneValue -HashtableTwo $hashtableTwoValue\n                if (!$areEqual) {\n                    $result = $false\n                    break\n                }\n            }\n            else {\n                if ($hashtableOneValue -ne $hashtableTwoValue) {\n                    $result = $false\n                    break\n                }\n            }\n        }\n    }\n\n    return $result\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/FolderMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-FolderProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n        Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n        DatacenterName = $script:constants.DatacenterName\n        DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n        FolderType = 'Host'\n    }\n\n    $folderProperties\n}\n\nfunction New-MocksForFolder {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsMock = $script:foundLocations\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock = $script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName New-Folder -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    $folderMock = $script:folder\n\n    Mock -CommandName Get-Inventory -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName New-Folder -MockWith { return $null }.GetNewClosure()\n\n    $folderProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName Remove-Folder -MockWith { return $null }.GetNewClosure()\n\n    $folderProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    $folderMock = $script:folder\n\n    Mock -CommandName Get-Inventory -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName Remove-Folder -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n\n    $folderMock = $script:folder\n\n    Mock -CommandName Get-Inventory -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $folderProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingFolder {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $folderProperties = New-FolderProperties\n    $folderProperties.Ensure = 'Absent'\n\n    $folderMock = $script:folder\n\n    Mock -CommandName Get-Inventory -MockWith { return $folderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $folderProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/HAClusterMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-HAClusterProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n        Location = \"$($script:constants.InventoryItemLocationItemOne)/$($script:constants.InventoryItemLocationItemTwo)\"\n        DatacenterName = $script:constants.DatacenterName\n        DatacenterLocation = \"$($script:constants.DatacenterLocationItemOne)\"\n    }\n\n    $haClusterProperties\n}\n\nfunction New-MocksForHACluster {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $foundLocationsMock = $script:foundLocations\n    $inventoryItemLocationViewBaseObjectMock = $script:inventoryItemLocationViewBaseObject\n    $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock = $script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $foundLocationsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemLocationItemTwo -and $Location -eq $script:datacenterHostFolder } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:constants.InventoryItemLocationItemTwoId } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $inventoryItemLocationWithInventoryItemLocationItemOneAsParentMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:inventoryItemLocationViewBaseObject.Parent } -Verifiable\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingClusterAndNoHASettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName New-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingClusterAndHASettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.HAEnabled = $script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = $script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel\n    $haClusterProperties.HAIsolationResponse = $script:constants.HAIsolationResponse\n    $haClusterProperties.HARestartPriority = $script:constants.HARestartPriority\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName New-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndNoHASettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName Set-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndHASettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.HAEnabled = !$script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = !$script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel\n    $haClusterProperties.HAIsolationResponse = $script:constants.HAIsolationResponse\n    $haClusterProperties.HARestartPriority = $script:constants.HARestartPriority\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName Set-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n    $haClusterProperties.Ensure = 'Absent'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName Remove-Cluster -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n    $haClusterProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n    Mock -CommandName Remove-Cluster -MockWith { return $null }.GetNewClosure()\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.HAEnabled = $script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = $script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel\n    $haClusterProperties.HAIsolationResponse = $script:constants.HAIsolationResponse\n    $haClusterProperties.HARestartPriority = $script:constants.HARestartPriority\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingClusterAndNonMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.HAEnabled = $script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = $script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel\n    $haClusterProperties.HAIsolationResponse = $script:constants.HAIsolationResponse\n    $haClusterProperties.HARestartPriority = 'Disabled'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksInTestWhenEnsureAbsentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n    $haClusterProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksInTestWhenEnsureAbsentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n    $haClusterProperties.Ensure = 'Absent'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsurePresentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.HAEnabled = $script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = $script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel\n    $haClusterProperties.HAIsolationResponse = $script:constants.HAIsolationResponse\n    $haClusterProperties.HARestartPriority = $script:constants.HARestartPriority\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsurePresentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.HAEnabled = !$script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = !$script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel + 1\n    $haClusterProperties.HAIsolationResponse = 'Shutdown'\n    $haClusterProperties.HARestartPriority = 'Disabled'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsureAbsentAndNonExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.Ensure = 'Absent'\n    $haClusterProperties.HAEnabled = $script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = $script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel\n    $haClusterProperties.HAIsolationResponse = $script:constants.HAIsolationResponse\n    $haClusterProperties.HARestartPriority = $script:constants.HARestartPriority\n\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n\nfunction New-MocksInGetWhenEnsureAbsentAndExistingCluster {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $haClusterProperties = New-HAClusterProperties\n\n    $haClusterProperties.Ensure = 'Absent'\n    $haClusterProperties.HAEnabled = !$script:constants.HAEnabled\n    $haClusterProperties.HAAdmissionControlEnabled = !$script:constants.HAAdmissionControlEnabled\n    $haClusterProperties.HAFailoverLevel = $script:constants.HAFailoverLevel + 1\n    $haClusterProperties.HAIsolationResponse = 'Shutdown'\n    $haClusterProperties.HARestartPriority = 'Disabled'\n\n    $clusterMock = $script:cluster\n\n    Mock -CommandName Get-Inventory -MockWith { return $clusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.InventoryItemName -and $Location -eq $script:foundLocations[0] } -Verifiable\n\n    $haClusterProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/InventoryBaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-InventoryBaseDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.InventoryItemName\n        Ensure = 'Present'\n    }\n\n    $inventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenEmptyLocationIsPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = New-InventoryBaseDSCProperties\n    $inventoryBaseDSCProperties.Location = [string]::Empty\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -Verifiable\n\n    $inventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfOnlyOneFolderAndTheFolderDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = New-InventoryBaseDSCProperties\n    $inventoryBaseDSCProperties.Location = $script:constants.DatacenterLocationItemOne\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $inventoryBaseDSCProperties.Location -and $Location -eq $script:inventoryRootFolder } -Verifiable\n\n    $inventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfOnlyOneFolderAndTheFolderExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = New-InventoryBaseDSCProperties\n    $inventoryBaseDSCProperties.Location = $script:constants.DatacenterLocationItemOne\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $inventoryBaseDSCProperties.Location -and $Location -eq $script:inventoryRootFolder } -Verifiable\n\n    $inventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfTwoInventoryItemsAndOneOfThemIsADatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = New-InventoryBaseDSCProperties\n    $inventoryBaseDSCProperties.Location = \"$($script:constants.DatacenterName)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterChildEntityMock = $script:datacenterChildEntity\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterChildEntityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n\n    $inventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfTwoFoldersAndTheLocationIsNotValid {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = New-InventoryBaseDSCProperties\n    $inventoryBaseDSCProperties.Location = \"$($script:constants.DatacenterLocationItemThree)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n\n    $inventoryBaseDSCProperties\n}\n\nfunction New-MocksWhenLocationConsistsOfTwoFoldersAndTheLocationIsValid {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $inventoryBaseDSCProperties = New-InventoryBaseDSCProperties\n    $inventoryBaseDSCProperties.Location = \"$($script:constants.DatacenterLocationItemOne)/$($script:constants.DatacenterLocationItemTwo)\"\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $datacenterLocationItemOneMock = $script:datacenterLocationItemOne\n    $datacenterLocationItemTwoMock = $script:datacenterLocationItemTwo\n    $datacenterLocationItemThreeMock = $script:datacenterLocationItemThree\n    $locationDatacenterLocationItemTwoMock = $script:locationDatacenterLocationItemTwo\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:inventoryRootFolder.ExtensionData.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemOne.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterLocationItemThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and (($Id | ConvertTo-Json) -eq ($script:datacenterLocationItemTwo.ChildEntity | ConvertTo-Json)) } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $locationDatacenterLocationItemTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterLocationItemTwo.MoRef } -Verifiable\n\n    $inventoryBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/MockData.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:constants = @{\n    VIServerName = 'TestServer'\n    VIServerUser = 'TestUser'\n    VIServerPassword = 'TestPassword' | ConvertTo-SecureString -AsPlainText -Force\n    vCenterProductId = 'vpx'\n    ESXiProductId = 'embeddedEsx'\n    InventoryItemName = 'TestInventoryItem'\n    FolderType = 'Folder'\n    DatacenterType = 'Datacenter'\n    ResourcePoolType = 'Resource Pool'\n    ResourcePoolValue = 'my-resource-pool-id'\n    RootFolderValue = 'group-d1'\n    InventoryRootFolderId = 'Folder-group-d1'\n    InventoryRootFolderName = 'Datacenters'\n    DatacenterLocationItemOneId = 'my-datacenter-folder-one-id'\n    DatacenterLocationItemOne = 'MyDatacenterFolderOne'\n    DatacenterLocationItemTwoId = 'my-datacenter-folder-two-id'\n    DatacenterLocationItemTwo = 'MyDatacenterFolderTwo'\n    DatacenterLocationItemThree = 'MyDatacenterFolderThree'\n    DatacenterId = 'my-datacenter-inventory-root-folder-parent-id'\n    DatacenterName = 'MyDatacenter'\n    DatacenterHostFolderId = 'group-h4'\n    DatacenterHostFolderName = 'HostFolder'\n    DatacenterNetworkFolderId = 'group-h3'\n    DatacenterNetworkFolderName = 'NetworkFolder'\n    InventoryItemLocationItemOneId = 'my-inventory-item-location-item-one'\n    InventoryItemLocationItemOne = 'MyInventoryItemOne'\n    InventoryItemLocationItemTwoId = 'my-inventory-item-location-item-two'\n    InventoryItemLocationItemTwo = 'MyInventoryItemTwo'\n    ResourcePoolId = 'my-resource-pool-id'\n    ResourcePoolName = 'MyResourcePool'\n    ClusterId = 'my-cluster-id'\n    ClusterName = 'MyCluster'\n    HAEnabled = $true\n    HAAdmissionControlEnabled = $true\n    HAFailoverLevel = 4\n    HAIsolationResponse = 'DoNothing'\n    HARestartPriority = 'High'\n    DrsEnabled = $true\n    DrsAutomationLevel = 'FullyAutomated'\n    DrsMigrationThreshold = 5\n    DrsDistribution = 0\n    MemoryLoadBalancing = 100\n    CPUOverCommitment = 500\n    FolderId = 'my-folder-id'\n    FolderName = 'MyFolder'\n    DatacenterFolderId = 'my-datacenter-folder-id'\n    DatacenterFolderName = 'MyDatacenterFolder'\n    VMHostId = 'HostSystem-host-1'\n    VMHostName = 'MyVMHost'\n    VMHostConnectionState = 'Maintenance'\n    VMHostPort = 443\n    DefaultVMHostRestartTimeoutMinutes = 5\n    OptionManagerType = 'OptionManager'\n    OptionManagerValue = 'EsxHostAdvSettings-1'\n    BufferCacheFlushIntervalAdvancedSettingName = 'BufferCache.FlushInterval'\n    BufferCacheFlushIntervalAdvancedSettingValue = 30000\n    BufferCacheHardMaxDirtyAdvancedSettingName = 'BufferCache.HardMaxDirty'\n    BufferCacheHardMaxDirtyAdvancedSettingValue = 95\n    CBRCEnableAdvancedSettingName = 'CBRC.Enable'\n    CBRCEnableAdvancedSettingValue = $false\n    VpxVpxaConfigWorkingDirAdvancedSettingName = 'Vpx.Vpxa.config.workingDir'\n    VpxVpxaConfigWorkingDirAdvancedSettingValue = '/var/log/vmware'\n    EsxAgentHostManagerType = 'HostEsxAgentHostManager'\n    EsxAgentHostManagerValue = 'esxAgentHostManager-1'\n    DatastoreId = 'datastore-1'\n    DatastoreName = 'MyDatastore'\n    DatastoreType = 'Datastore'\n    DatastoreValue = 'datastore-1'\n    ScsiLunCanonicalName = 'mpx.vmhba0:C0:T0:L0'\n    FileSystemVersion = 3\n    NfsHost = 'MyNfsHost'\n    NfsPath = 'MyNfsPath'\n    AuthenticationMethod = 'Kerberos'\n    AccessMode = 'ReadOnly'\n    BlockSizeMB = 1\n    MaxCongestionThresholdMillisecond = 100\n    CongestionThresholdMillisecond = 50\n    StorageIOControlEnabled = $true\n    NetworkName = 'MyNetwork'\n    NetworkType = 'Network'\n    NetworkValue = 'network-1'\n    PciDeviceId = '0000:00:00.0'\n    PciDeviceEnabled = $true\n    PciPassthruSystemType = 'HostPciPassthruSystem'\n    PciPassthruSystemValue = 'pciPassthruSystem-1'\n    PciDeviceCapable = $false\n    GraphicsManagerType = 'HostGraphicsManager'\n    GraphicsManagerValue = 'graphicsManager-1'\n    DefaultGraphicsType = 'Shared'\n    SharedPassthruAssignmentPolicy = 'Performance'\n    GraphicsDeviceId = '0000:00:00.0'\n    PowerSystemType = 'HostPowerSystem'\n    PowerSystemValue = 'powerSystem-1'\n    PowerPolicy = @{\n        HighPerformance = 1\n        Balanced = 2\n        LowPower = 3\n        Custom = 4\n    }\n    CacheConfigurationManagerType = 'HostCacheConfigurationManager'\n    CacheConfigurationManagerValue = 'cacheConfigManager-1'\n    NegativeSwapSize = -1\n    OverflowingSwapSize = 9\n    SwapSizeMB = 1024\n    SwapSizeGB = 1\n    ConfigureHostCacheTaskName = 'ConfigureHostCache_Task'\n    TaskType = 'Task'\n    TaskValue = 'task-1'\n    TaskSuccessState = 'Success'\n    TaskErrorState = 'Error'\n    VirtualSwitchName = 'vSwitch0'\n    VirtualPortGroupName = 'MyVirtualPortGroup'\n    VlanTypeVlan = 'Vlan'\n    VLanId = 4095\n    ModifiedVLanId = 10\n    VLanNone = 0\n    AllowPromiscuous = $true\n    AllowPromiscuousInherited = $false\n    ForgedTransmits = $true\n    ForgedTransmitsInherited = $false\n    MacChanges = $true\n    MacChangesInherited = $false\n    FailbackEnabled = $true\n    LoadBalancingPolicyIP = 'LoadBalanceIP'\n    LoadBalancingPolicySrcMac = 'LoadBalanceSrcMac'\n    NetworkFailoverDetectionPolicy = 'LinkStatus'\n    NotifySwitches = $true\n    ActiveNic = @('vmnic0', 'vmnic1')\n    ActiveNicSubset = @('vmnic0')\n    StandbyNic = @('vmnic2')\n    UnusedNic = @('vmnic3')\n    UnusedNicEmpty = @()\n    InheritFailback = $false\n    InheritFailoverOrder = $false\n    InheritLoadBalancingPolicy = $false\n    InheritNetworkFailoverDetectionPolicy = $false\n    InheritNotifySwitches = $false\n    NetworkSystemType = 'HostNetworkSystem'\n    NetworkSystemValue = 'networkSystem-1'\n    ShapingEnabled = $true\n    AverageBandwidth = 104857600000\n    PeakBandwidth = 104857600000\n    BurstSize = 107374182400\n    PhysicalNetworkAdapterName = 'vmnic1'\n    FullDuplex = 'Full'\n    HalfDuplex = 'Half'\n    BitRatePerSecMb = 1000\n    AutoNegotiate = $true\n    VMKernelNetworkAdapterName = 'MyVMKernelNetworkAdapter'\n    VMKernelNetworkAdapterIP = '192.168.0.1'\n    VMKernelNetworkAdapterSubnetMask = '255.255.255.0'\n    VMKernelNetworkAdapterMac = '00:50:56:63:5b:0e'\n    VMKernelNetworkAdapterDhcp = $true\n    VMKernelNetworkAdapterAutomaticIPv6 = $true\n    VMKernelNetworkAdapterIPv6ThroughDhcp = $true\n    VMKernelNetworkAdapterMtu = 4000\n    VMKernelNetworkAdapterIPv6Enabled = $true\n    VMKernelNetworkAdapterManagementTrafficEnabled = $true\n    VMKernelNetworkAdapterFaultToleranceLoggingEnabled = $true\n    VMKernelNetworkAdapterVMotionEnabled = $true\n    VMKernelNetworkAdapterVsanTrafficEnabled = $true\n    VMKernelNetworkAdapterPortId = '100'\n    DistributedSwitchName = 'MyDistributedSwitch'\n    DistributedSwitchContactDetails = 'Distributed Switch Contact Details'\n    DistributedSwitchContactName = 'Distributed Switch Contact Name'\n    DistributedSwitchLinkDiscoveryProtocol = 'CDP'\n    DistributedSwitchLinkDiscoveryProtocolOperation = 'Advertise'\n    DistributedSwitchMaxPorts = 100\n    DistributedSwitchMtu = 2000\n    DistributedSwitchNotes = 'Distributed Switch Description'\n    DistributedSwitchNumUplinkPorts = 10\n    DistributedSwitchVersion = '6.6.0'\n    ReferenceDistributedSwitchName = 'MyReferenceDistributedSwitch'\n    WithoutPortGroups = $true\n    DistributedPortGroupName = 'MyDistributedPortGroup'\n    DistributedPortGroupNotes = 'Distributed Port Group Description'\n    DistributedPortGroupNumPorts = 128\n    DistributedPortGroupStaticPortBinding = 'Static'\n    DistributedPortGroupDynamicPortBinding = 'Dynamic'\n    ReferenceDistributedPortGroupName = 'MyReferenceDistributedPortGroup'\n    VMHostAddedToDistributedSwitchOneName = 'MyVMHostAddedToDistributedSwitchOne'\n    VMHostAddedToDistributedSwitchTwoName = 'MyVMHostAddedToDistributedSwitchTwo'\n    VMHostRemovedFromDistributedSwitchOneName = 'MyVMHostRemovedFromDistributedSwitchOne'\n    VMHostRemovedFromDistributedSwitchTwoName = 'MyVMHostRemovedFromDistributedSwitchTwo'\n    ConnectedPhysicalNetworkAdapterOneName = 'MyConnectedPhysicalNetworkAdapterOne'\n    ConnectedPhysicalNetworkAdapterTwoName = 'MyConnectedPhysicalNetworkAdapterTwo'\n    ConnectedPhysicalNetworkAdapterBitRatePerSecMb = 1000\n    DisconnectedPhysicalNetworkAdapterOneName = 'MyDisconnectedPhysicalNetworkAdapterOne'\n    DisconnectedPhysicalNetworkAdapterTwoName = 'MyDisconnectedPhysicalNetworkAdapterTwo'\n    DisconnectedPhysicalNetworkAdapterBitRatePerSecMb = 0\n    VMKernelNetworkAdapterOneName = 'MyVMKernelNetworkAdapterOne'\n    VMKernelNetworkAdapterTwoName = 'MyVMKernelNetworkAdapterTwo'\n    VMKernelNicAttachedToPortGroupWithVLanName = 'MyVMKernelNetworkAdapterAttachedToPortGroupWithVLanName'\n    PortGroupOneName = 'MyPortGroupOneName'\n    PortGroupTwoName = 'MyPortGroupTwoName'\n    PortGroupWithVLanName = 'MyPortGroupWithVLanName'\n    PortGroupWithVLanVLanId = 4094\n    DistributedSwitchWithoutAddedPhysicalNetworkAdaptersName = 'MyDistributedSwitchWithoutAddedPhysicalNetworkAdapters'\n    DomainName = 'MyDomain'\n    DomainUsername = 'MyDomainUsername'\n    DomainPassword = 'MyDomainPassword' | ConvertTo-SecureString -AsPlainText -Force\n    DomainActionJoin = 'Join'\n    DomainActionLeave = 'Leave'\n    RoleName = 'MyRole'\n    PrivilegeIds = @('System.Anonymous', 'System.View', 'System.Read')\n    PrivilegeToAddIds = @('System.Anonymous', 'System.View', 'VirtualMachine.Inventory.Create')\n    PrivilegeToRemoveIds = @('System.Read')\n    RootResourcePoolId = 'rootResourcePool-1'\n    RootResourcePoolName = 'MyRootResourcePool'\n    RootResourcePoolType = 'Resource Pool'\n    RootResourcePoolValue = 'rootResourcePool-1'\n    VAppId = 'vapp-1'\n    VAppName = 'MyVApp'\n    VMId = 'virtualMachine-1'\n    VMName = 'MyVirtualMachine'\n    PrincipalName = 'MyPrincipalName'\n    PropagatePermission = $true\n    NfsUsername = 'MyNfsUsername'\n    NfsUserPasswordOne = 'MyNfsUserPasswordOne'\n    NfsUserPasswordTwo = 'MyNfsUserPasswordTwo'\n    VMHostConnectedState = 'Connected'\n    VMHostMaintenanceState = 'Maintenance'\n    EvacuateVMs = $true\n    VsanDataMigrationMode = 'Full'\n    VMHostLicenseKeyOne = '00000-00000-00000-00000-00000'\n    VMHostLicenseKeyTwo = '11111-11111-11111-11111-11111'\n    InHostDatastoreVMSwapfilePolicy = 'InHostDatastore'\n    WithVMDatastoreVMSwapfilePolicy = 'WithVM'\n    VMHostUTCTimeZoneName = 'UTC'\n    VMHostGMTTimeZoneName = 'GMT'\n    VMSwapfileDatastoreOneName = 'MyDatastoreOne'\n    VMSwapfileDatastoreTwoName = 'MyDatastoreTwo'\n    HostProfileName = 'MyHostProfile'\n    ClusterManualAutomationLevel = 'Manual'\n    EnterMaintenanceModeTaskName = 'EnterMaintenanceMode_Task'\n    ApplyDrsRecommendationTaskName = 'ApplyDrsRecommendation_Task'\n    KmsClusterId = 'kmsCluster-1'\n    KmsClusterName = 'MyKmsCluster'\n    EsxCliCommandSetMethodName = 'set'\n    EsxCliCommandGetMethodName = 'get'\n    EsxCliDCUIKeyboardCommand = 'system.settings.keyboard.layout'\n    EsxCliSetMethodCreateArgs = '$this.EsxCli.system.settings.keyboard.layout.set.CreateArgs()'\n    EsxCliSetMethodArgs = @{\n        layout = 'Unset'\n        enable = 'Unset'\n        size = 'Unset'\n        parameterkeys = 'Unset'\n    }\n    EsxCliSetMethodPopulatedArgs = @{\n        layout = 'United Kingdom'\n        enable = $false\n        size = 100000\n        parameterkeys = [int[]] @(1, 2, 3, 4, 5)\n    }\n    EsxCliSetMethodInvoke = 'system.settings.keyboard.layout.set.Invoke({0})'\n    EsxCliGetMethodInvoke = '$this.EsxCli.system.settings.keyboard.layout.get.Invoke()'\n    DCUIKeyboardUSDefaultLayout = 'US Default'\n    DCUIKeyboardUnitedKingdomLayout = 'United Kingdom'\n    Gateway = '192.168.0.1'\n    Destination = '192.168.100.0'\n    PrefixLength = 32\n    EnableVMKernelDumpPartition = $true\n    UseSmartAlgorithmForVMKernelDumpPartition = $true\n    DumpFileName = 'MyTestDumpFile'\n    DumpFileSizeInMB = 1181\n    DumpFileSizeInBytes = 1238368256\n    EnableVMKernelDumpFile = $true\n    UseSmartAlgorithmForVMKernelDumpFile = $true\n    VMKernelModuleName = 's2io'\n    VMKernelModuleEnabled = $true\n    SNMPAgentAuthenticationProtocol = 'SHA1'\n    SNMPAgentCommunities = 'community1'\n    EnableSNMPAgent = $true\n    SNMPAgentEngineId = '0x0-9a-f'\n    SNMPAgentHwsrc = 'indications'\n    SNMPAgentLargeStorage = $true\n    SNMPAgentLogLevel = 'info'\n    SNMPAgentNoTraps = 'reset'\n    SNMPAgentPort = 161\n    SNMPAgentPrivacyProtocol = 'AES128'\n    SNMPAgentRemoteUsers = '0x0-9a-f/SHA1/AES128'\n    SNMPAgentSysContact = 'System contact'\n    SNMPAgentSystemLocation = 'System location'\n    SNMPAgentTargets = 'MyTestVMHost udp/162'\n    SNMPAgentUsers = 'localUser'\n    SNMPAgentV3Targets = 'MyTestVMHost udp/162'\n    ResetSNMPAgent = $true\n    SoftwareDeviceId = 'com.vmware.iscsi_vmk'\n    SoftwareDeviceDefaultInstanceAddress = 0\n    SoftwareDeviceInstanceAddress = 1\n    DatastoreEnabled = $true\n    DatastoreOrder = 0\n    HostCacheEnabled = $true\n    HostCacheOrder = 1\n    HostLocalSwapEnabled = $true\n    HostLocalSwapOrder = 2\n    NetworkCoreDumpEnabled = $true\n    NetworkCoreDumpInterfaceName = 'vmk0'\n    NetworkCoreDumpServerIP = '10.11.12.13'\n    NetworkCoreDumpServerPort = 6500\n    VMwareCertifiedAcceptanceLevel = 'VMwareCertified'\n    VMwareAcceptedAcceptanceLevel = 'VMwareAccepted'\n    VMHostvSanNetworkConfigurationInterfaceOneName = 'vmk0'\n    VMHostvSanNetworkConfigurationInterfaceTwoName = 'vmk1'\n    VMHostvSanNetworkConfigurationAgentGroupIPv6MulticastAddress = 'ff19::2:3:4'\n    VMHostvSanNetworkConfigurationAgentGroupMulticastAddress = '224.2.3.4'\n    VMHostvSanNetworkConfigurationAgentGroupMulticastPort = 23451\n    VMHostvSanNetworkConfigurationHostUnicastChannelBoundPort = 12321\n    VMHostvSanNetworkConfigurationMasterGroupIPv6MulticastAddress = 'ff19::1:2:3'\n    VMHostvSanNetworkConfigurationMasterGroupMulticastAddress = '224.1.2.3'\n    VMHostvSanNetworkConfigurationMasterGroupMulticastPort = 12345\n    VMHostvSanNetworkConfigurationMulticastTTL = 5\n    VMHostvSanNetworkConfigurationTrafficType = 'vsan'\n    VMHostScsiLunCanonicalName = 'mpx.vmhba1:C0:T3:L1'\n    VMHostScsiLunMultipathPolicy = 'Fixed'\n    VMHostScsiLunBlocksToSwitchPath = 100\n    VMHostScsiLunCommandsToSwitchPath = 10\n    VMHostScsiLunDeletePartitions = $true\n    VMHostScsiLunIsLocal = $true\n    VMHostScsiLunIsSsd = $true\n    VMHostScsiLunPathName = 'vmhba1:C0:T3:L1'\n    VMHostScsiLunPathState = 'Active'\n    VMHostActiveScsiLunPath = $true\n    VMHostPreferredScsiLunPath = $true\n    DiskPartition = 1\n    FirewallSystemType = 'HostFirewallSystem'\n    FirewallSystemValue = 'firewallSystem-1'\n    FirewallRulesetKey = 'CIMHttpServer'\n    FirewallRulesetName = 'CIM Server'\n    FirewallRulesetEnabled = $true\n    FirewallRulesetAllIP = $false\n    FirewallRulesetIPAddressesOne = @('192.0.20.10', '192.0.20.11', '192.0.20.12')\n    FirewallRulesetIPAddressesTwo = @('192.0.20.10', '192.0.20.11', '192.0.20.13')\n    FirewallRulesetIPNetworksOne = @('10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/24')\n    FirewallRulesetIPNetworksTwo = @('10.20.120.12/22', '10.20.120.12/23', '10.20.120.12/25')\n    IScsiHbaDeviceName = 'vmhba65'\n    IScsiDeviceType = 'iSCSI'\n    ChapTypeProhibited = 'Prohibited'\n    ChapTypeRequired = 'Required'\n    ChapInherited = $true\n    ChapName = 'MyChapName'\n    ChapPassword = 'MyChapPassword'\n    MutualChapInherited = $true\n    MutualChapEnabled = $true\n    MutualChapName = 'MyMutualChapName'\n    MutualChapPassword = 'MyMutualChapPassword'\n    IScsiHbaTargetAddress = '10.23.84.73'\n    IScsiHbaTargetPort = 3260\n    IScsiIPEndPoint = '10.23.84.73:3260'\n    IScsiHbaSendTargetType = 'Send'\n    IScsiHbaStaticTargetType = 'Static'\n    IScsiName = 'iqn.com.vmware:esx-server'\n    IScsiNameTwo = 'iqn.com.vmware:esx-server-two'\n}\n\n$script:credential = New-Object System.Management.Automation.PSCredential($script:constants.VIServerUser, $script:constants.VIServerPassword)\n$script:domainCredential = New-Object System.Management.Automation.PSCredential($script:constants.DomainUsername, $script:constants.DomainPassword)\n\n$script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:constants.VIServerName\n    User = $script:constants.VIServerUser\n    ExtensionData = [VMware.Vim.ServiceInstance] @{\n        Content = [VMware.Vim.ServiceContent] @{\n            RootFolder = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.FolderType\n                Value = $script:constants.RootFolderValue\n            }\n        }\n    }\n    ProductLine = $script:constants.vCenterProductId\n}\n\n$script:esxiServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:constants.VIServerName\n    User = $script:constants.VIServerUser\n    ProductLine = $script:constants.ESXiProductId\n}\n\n$script:rootFolderViewBaseObject = [VMware.Vim.Folder] @{\n    Name = $script:constants.InventoryRootFolderName\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FolderType\n        Value = $script:constants.RootFolderValue\n    }\n    ChildEntity = @(\n        [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:constants.FolderType\n            Value = $script:constants.DatacenterLocationItemOne\n        }\n    )\n}\n\n$script:inventoryRootFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.InventoryRootFolderId\n    Name = $script:constants.InventoryRootFolderName\n    ExtensionData = [VMware.Vim.Folder] @{\n        ChildEntity = @(\n            [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.FolderType\n                Value = $script:constants.DatacenterLocationItemOne\n            },\n            [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.DatacenterType\n                Value = $script:constants.DatacenterName\n            }\n        )\n    }\n}\n\n$script:datacenterLocationItemOne = [VMware.Vim.Folder] @{\n    Name = $script:constants.DatacenterLocationItemOne\n    ChildEntity = @(\n        [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:constants.FolderType\n            Value = $script:constants.DatacenterLocationItemTwo\n        }\n    )\n}\n\n$script:datacenterLocationItemTwo = [VMware.Vim.Folder] @{\n    Name = $script:constants.DatacenterLocationItemTwo\n    ChildEntity = @(\n        [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:constants.FolderType\n            Value = $script:constants.DatacenterLocationItemThree\n        }\n    )\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FolderType\n        Value = $script:constants.DatacenterLocationItemTwoId\n    }\n}\n\n$script:datacenterLocationItemThree = [VMware.Vim.Folder] @{\n    Name = $script:constants.DatacenterLocationItemThree\n}\n\n$script:datacenterChildEntity = [VMware.Vim.Datacenter] @{\n    Name = $script:constants.DatacenterName\n}\n\n$script:locationDatacenterLocationItemOne = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.DatacenterLocationItemOneId\n    Name = $script:constants.DatacenterLocationItemOne\n    ParentId = $script:constants.InventoryRootFolderId\n}\n\n$script:locationDatacenterLocationItemTwo = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.DatacenterLocationItemTwoId\n    Name = $script:constants.DatacenterLocationItemTwo\n    ParentId = $script:constants.DatacenterLocationItemOneId\n}\n\n$script:datacenterWithInventoryRootFolderAsParent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:constants.DatacenterId\n    Name = $script:constants.DatacenterName\n    ParentFolderId = $script:constants.InventoryRootFolderId\n}\n\n$script:datacenterWithDatacenterLocationItemOneAsParent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:constants.DatacenterId\n    Name = $script:constants.DatacenterName\n    ParentFolderId = $script:constants.DatacenterLocationItemOneId\n    ExtensionData = [VMware.Vim.Datacenter] @{\n        HostFolder = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:constants.FolderType\n            Value = $script:constants.DatacenterHostFolderId\n        }\n        NetworkFolder = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:constants.FolderType\n            Value = $script:constants.DatacenterNetworkFolderId\n        }\n    }\n}\n\n$script:datacenterWithDatacenterLocationItemTwoAsParent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:constants.DatacenterId\n    Name = $script:constants.DatacenterName\n    ParentFolderId = $script:constants.DatacenterLocationItemTwoId\n}\n\n$script:datacenterHostFolderViewBaseObject = [VMware.Vim.Folder] @{\n    Name = $script:constants.DatacenterHostFolderName\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FolderType\n        Value = $script:constants.DatacenterHostFolderId\n    }\n}\n\n$script:datacenterHostFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.DatacenterHostFolderId\n    Name = $script:constants.DatacenterHostFolderName\n    Parent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n        Name = $script:constants.DatacenterName\n    }\n}\n\n$script:datacenterNetworkFolderViewBaseObject = [VMware.Vim.Folder] @{\n    Name = $script:constants.DatacenterNetworkFolderName\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FolderType\n        Value = $script:constants.DatacenterNetworkFolderId\n    }\n}\n\n$script:datacenterNetworkFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.DatacenterNetworkFolderId\n    Name = $script:constants.DatacenterNetworkFolderName\n    Parent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n        Name = $script:constants.DatacenterName\n    }\n}\n\n$script:inventoryItemLocationItemOne = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.InventoryItemLocationItemOneId\n    Name = $script:constants.InventoryItemLocationItemOne\n    ParentId = $script:constants.DatacenterHostFolderId\n}\n\n$script:foundLocations = @(\n    [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ResourcePoolImpl] @{\n        Id = $script:constants.InventoryItemLocationItemTwoId\n        Name = $script:constants.InventoryItemLocationItemTwo\n        Parent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n            Id = $script:constants.InventoryItemLocationItemOneId\n            Name = $script:constants.InventoryItemLocationItemOne\n        }\n    }\n)\n\n$script:foundLocationsForCluster = @(\n    [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n        Id = $script:constants.InventoryItemLocationItemTwoId\n        Name = $script:constants.InventoryItemLocationItemTwo\n        Parent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n            Id = $script:constants.InventoryItemLocationItemOneId\n            Name = $script:constants.InventoryItemLocationItemOne\n        }\n        ExtensionData = [VMware.Vim.Folder] @{\n            Name = $script:constants.InventoryItemLocationItemTwo\n            MoRef = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.FolderType\n                Value = $script:constants.InventoryItemLocationItemTwoId\n            }\n        }\n    }\n)\n\n$script:inventoryItemLocationViewBaseObject = [VMware.Vim.ResourcePool] @{\n    Name = $script:constants.InventoryItemLocationItemTwo\n    Parent = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.ResourcePoolType\n        Value = $script:constants.InventoryItemLocationItemOneId\n    }\n}\n\n$script:inventoryItemLocationWithDatacenterHostFolderAsParent = [VMware.Vim.Folder] @{\n    Name = $script:constants.DatacenterHostFolderName\n    Parent = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FolderType\n        Value = $script:constants.DatacenterHostFolderId\n    }\n}\n\n$script:inventoryItemLocationWithInventoryItemLocationItemOneAsParent = [VMware.Vim.Folder] @{\n    Name = $script:constants.InventoryItemLocationItemOne\n    Parent = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FolderType\n        Value = $script:constants.InventoryItemLocationItemOneId\n    }\n}\n\n$script:inventoryItemWithInventoryItemLocationItemTwoAsParent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ResourcePoolImpl] @{\n    Id = $script:constants.ResourcePoolId\n    Name = $script:constants.ResourcePoolName\n    ParentId = $script:constants.InventoryItemLocationItemTwoId\n}\n\n$script:cluster = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ClusterImpl] @{\n    Id = $script:constants.ClusterId\n    Name = $script:constants.ClusterName\n    ParentId = $script:constants.InventoryItemLocationItemTwoId\n    HAEnabled = $script:constants.HAEnabled\n    HAAdmissionControlEnabled = $script:constants.HAAdmissionControlEnabled\n    HAFailoverLevel = $script:constants.HAFailoverLevel\n    HAIsolationResponse = $script:constants.HAIsolationResponse\n    HARestartPriority = $script:constants.HARestartPriority\n    ExtensionData = [VMware.Vim.ClusterComputeResource] @{\n        ConfigurationEx = [VMware.Vim.ClusterConfigInfoEx] @{\n            DrsConfig = [VMware.Vim.ClusterDrsConfigInfo] @{\n                Enabled = $true\n                DefaultVmBehavior = 'Manual'\n                VmotionRate = 3\n                Option = @(\n                    [VMware.Vim.OptionValue] @{\n                        Key = 'LimitVMsPerESXHostPercent'\n                        Value = '10'\n                    },\n                    [VMware.Vim.OptionValue] @{\n                        Key = 'PercentIdleMBInMemDemand'\n                        Value = '200'\n                    },\n                    [VMware.Vim.OptionValue] @{\n                        Key = 'MaxVcpusPerClusterPct'\n                        Value = '400'\n                    }\n                )\n            }\n        }\n    }\n}\n\n$script:clusterSpecWithoutDrsSettings = [VMware.Vim.ClusterConfigSpecEx] @{\n    DrsConfig = [VMware.Vim.ClusterDrsConfigInfo] @{\n        Option = @(\n        )\n    }\n}\n\n$script:clusterSpecWithDrsSettings = [VMware.Vim.ClusterConfigSpecEx] @{\n    DrsConfig = [VMware.Vim.ClusterDrsConfigInfo] @{\n        Enabled = $script:constants.DrsEnabled\n        DefaultVmBehavior = $script:constants.DrsAutomationLevel\n        VmotionRate = $script:constants.DrsMigrationThreshold\n        Option = @(\n            [VMware.Vim.OptionValue] @{\n                Key = 'LimitVMsPerESXHostPercent'\n                Value = ($script:constants.DrsDistribution).ToString()\n            },\n            [VMware.Vim.OptionValue] @{\n                Key = 'PercentIdleMBInMemDemand'\n                Value = ($script:constants.MemoryLoadBalancing).ToString()\n            },\n            [VMware.Vim.OptionValue] @{\n                Key = 'MaxVcpusPerClusterPct'\n                Value = ($script:constants.CPUOverCommitment).ToString()\n            }\n        )\n    }\n}\n\n$script:clusterComputeResource = [VMware.Vim.ClusterComputeResource] @{\n    ConfigurationEx = [VMware.Vim.ClusterConfigInfoEx] @{\n        DrsConfig = [VMware.Vim.ClusterDrsConfigInfo] @{\n            Enabled = $true\n            DefaultVmBehavior = 'Manual'\n            VmotionRate = 3\n            Option = @(\n                [VMware.Vim.OptionValue] @{\n                    Key = 'LimitVMsPerESXHostPercent'\n                    Value = '10'\n                },\n                [VMware.Vim.OptionValue] @{\n                    Key = 'PercentIdleMBInMemDemand'\n                    Value = '200'\n                },\n                [VMware.Vim.OptionValue] @{\n                    Key = 'MaxVcpusPerClusterPct'\n                    Value = '400'\n                }\n            )\n        }\n    }\n}\n\n$script:folder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.FolderId\n    Name = $script:constants.FolderName\n    ParentId = $script:constants.InventoryItemLocationItemTwoId\n}\n\n$script:datacenterFolder = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.FolderImpl] @{\n    Id = $script:constants.DatacenterFolderId\n    Name = $script:constants.DatacenterFolderName\n    ParentId = $script:constants.DatacenterLocationItemTwoId\n}\n\n$script:vmHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Id = $script:constants.VMHostId\n    Name = $script:constants.VMHostName\n    ConnectionState = $script:constants.VMHostConnectionState\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Config = [VMware.Vim.HostConfigInfo] @{\n            PowerSystemInfo = [VMware.Vim.PowerSystemInfo] @{\n                CurrentPolicy = [VMware.Vim.HostPowerPolicy] @{\n                    Key = $script:constants.PowerPolicy.Balanced\n                }\n            }\n        }\n        ConfigManager = [VMware.Vim.HostConfigManager] @{\n            AdvancedOption = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.OptionManagerType\n                Value = $script:constants.OptionManagerValue\n            }\n            CacheConfigurationManager = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.CacheConfigurationManagerType\n                Value = $script:constants.CacheConfigurationManagerValue\n            }\n            EsxAgentHostManager = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.EsxAgentHostManagerType\n                Value = $script:constants.EsxAgentHostManagerValue\n            }\n            FirewallSystem = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.FirewallSystemType\n                Value = $script:constants.FirewallSystemValue\n            }\n            GraphicsManager = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.GraphicsManagerType\n                Value = $script:constants.GraphicsManagerValue\n            }\n            NetworkSystem = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.NetworkSystemType\n                Value = $script:constants.NetworkSystemValue\n            }\n            PciPassthruSystem = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.PciPassthruSystemType\n                Value = $script:constants.PciPassthruSystemValue\n            }\n            PowerSystem = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.PowerSystemType\n                Value = $script:constants.PowerSystemValue\n            }\n        }\n        Network = @(\n            [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.NetworkType\n                Value = $script:constants.NetworkValue\n            }\n        )\n    }\n}\n\n$script:optionManager = [VMware.Vim.OptionManager] @{\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.OptionManagerType\n        Value = $script:constants.OptionManagerValue\n    }\n}\n\n$script:vmHostAdvancedSettings = @(\n    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{\n        Name = $script:constants.BufferCacheFlushIntervalAdvancedSettingName\n        Value = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue\n    },\n    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{\n        Name = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName\n        Value = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue\n    },\n    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{\n        Name = $script:constants.CBRCEnableAdvancedSettingName\n        Value = $script:constants.CBRCEnableAdvancedSettingValue\n    },\n    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{\n        Name = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName\n        Value = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue\n    }\n)\n\n$script:allAdvancedOptionsToUpdate = @(\n    [VMware.Vim.OptionValue] @{\n        Key = $script:constants.BufferCacheFlushIntervalAdvancedSettingName\n        Value = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue + 1\n    },\n    [VMware.Vim.OptionValue] @{\n        Key = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName\n        Value = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue + 1\n    },\n    [VMware.Vim.OptionValue] @{\n        Key = $script:constants.CBRCEnableAdvancedSettingName\n        Value = $true\n    },\n    [VMware.Vim.OptionValue] @{\n        Key = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName\n        Value = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue + '/vpxa'\n    }\n)\n\n$script:notAllAdvancedOptionsToUpdate = @(\n    [VMware.Vim.OptionValue] @{\n        Key = $script:constants.BufferCacheFlushIntervalAdvancedSettingName\n        Value = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue + 1\n    },\n    [VMware.Vim.OptionValue] @{\n        Key = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName\n        Value = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue + '/vpxa'\n    }\n)\n\n$script:esxAgentHostManagerConfigInfoWithNullAgentVmSettings = [VMware.Vim.HostEsxAgentHostManagerConfigInfo] @{\n    AgentVmDatastore = $null\n    AgentVmNetwork = $null\n}\n\n$script:esxAgentHostManagerWithNullAgentVmSettings = [VMware.Vim.HostEsxAgentHostManager] @{\n    ConfigInfo = $script:esxAgentHostManagerConfigInfoWithNullAgentVmSettings\n}\n\n$script:datastore = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Name = $script:constants.DatastoreName\n    FreeSpaceGB = $script:constants.SwapSizeGB * 8\n    FileSystemVersion = $script:constants.FileSystemVersion\n    StorageIOControlEnabled = $script:constants.StorageIOControlEnabled\n    CongestionThresholdMillisecond = $script:constants.MaxCongestionThresholdMillisecond\n    ExtensionData = [VMware.Vim.Datastore] @{\n        Name = $script:constants.DatastoreName\n        MoRef = [VMware.Vim.ManagedObjectReference] @{\n            Type = $script:constants.DatastoreType\n            Value = $script:constants.DatastoreValue\n        }\n        Info = [VMware.Vim.VmfsDatastoreInfo] @{\n            Vmfs = [VMware.Vim.HostVmfsVolume] @{\n                BlockSizeMB = $script:constants.BlockSizeMB\n                Extent = @(\n                    [VMware.Vim.HostScsiDiskPartition] @{\n                        DiskName = $script:constants.ScsiLunCanonicalName\n                    }\n                )\n            }\n        }\n    }\n}\n\n$script:nfsDatastore = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.NasDatastoreImpl] @{\n    Name = $script:constants.DatastoreName\n    RemoteHost = $script:constants.NfsHost\n    RemotePath = $script:constants.NfsPath\n    AuthenticationMethod = $script:constants.AuthenticationMethod\n    FileSystemVersion = $script:constants.FileSystemVersion\n    StorageIOControlEnabled = $script:constants.StorageIOControlEnabled\n    CongestionThresholdMillisecond = $script:constants.MaxCongestionThresholdMillisecond\n    ExtensionData = [VMware.Vim.Datastore] @{\n        Host = @(\n            [VMware.Vim.DatastoreHostMount] @{\n                MountInfo = [VMware.Vim.HostMountInfo] @{\n                    AccessMode = $script:constants.AccessMode\n                }\n            }\n        )\n    }\n}\n\n$script:network = [VMware.Vim.Network] @{\n    Name = $script:constants.NetworkName\n}\n\n$script:esxAgentHostManagerConfigWithNotNullAgentVmSettings = [VMware.Vim.HostEsxAgentHostManagerConfigInfo] @{\n    AgentVmDatastore = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.DatastoreType\n        Value = $script:constants.DatastoreValue\n    }\n    AgentVmNetwork = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.NetworkType\n        Value = $script:constants.NetworkValue\n    }\n}\n\n$script:esxAgentHostManagerWithNotNullAgentVmSettings = [VMware.Vim.HostEsxAgentHostManager] @{\n    ConfigInfo = $script:esxAgentHostManagerConfigWithNotNullAgentVmSettings\n}\n\n$script:vmHostPciPassthruSystem = [VMware.Vim.HostPciPassthruSystem] @{\n    PciPassthruInfo = @(\n        [VMware.Vim.HostPciPassthruInfo] @{\n            Id = $script:constants.PciDeviceId + '.0'\n            PassthruEnabled = $script:constants.PciDeviceEnabled\n            PassthruCapable = $script:constants.PciDeviceCapable\n        },\n        [VMware.Vim.HostPciPassthruInfo] @{\n            Id = $script:constants.PciDeviceId\n            PassthruEnabled = $script:constants.PciDeviceEnabled\n            PassthruCapable = !$script:constants.PciDeviceCapable\n        }\n    )\n}\n\n$script:vmHostPciPassthruConfig = [VMware.Vim.HostPciPassthruConfig] @{\n    Id = $script:constants.PciDeviceId\n    PassthruEnabled = $script:constants.PciDeviceEnabled\n}\n\n$script:vmHostGraphicsConfigWithoutGraphicsDevice = [VMware.Vim.HostGraphicsConfig] @{\n    HostDefaultGraphicsType = $script:constants.DefaultGraphicsType.ToLower()\n    SharedPassthruAssignmentPolicy = $script:constants.SharedPassthruAssignmentPolicy.ToLower()\n}\n\n$script:vmHostGraphicsConfigWithGraphicsDevice = [VMware.Vim.HostGraphicsConfig] @{\n    HostDefaultGraphicsType = $script:constants.DefaultGraphicsType.ToLower()\n    SharedPassthruAssignmentPolicy = $script:constants.SharedPassthruAssignmentPolicy.ToLower()\n    DeviceType = @(\n        [VMware.Vim.HostGraphicsConfigDeviceType] @{\n            DeviceId = $script:constants.GraphicsDeviceId\n            GraphicsType = $script:constants.DefaultGraphicsType.ToLower()\n        }\n    )\n}\n\n$script:vmHostGraphicsManager = [VMware.Vim.HostGraphicsManager] @{\n    GraphicsConfig = $script:vmHostGraphicsConfigWithGraphicsDevice\n}\n\n$script:vmHostPowerSystem = [VMware.Vim.HostPowerSystem] @{\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.PowerSystemType\n        Value = $script:constants.PowerSystemValue\n    }\n}\n\n$script:vmHostCacheConfigurationManager = [VMware.Vim.HostCacheConfigurationManager] @{\n    CacheConfigurationInfo = @(\n        [VMware.Vim.HostCacheConfigurationInfo] @{\n            Key = [VMware.Vim.ManagedObjectReference] @{\n                Type = $script:constants.DatastoreType\n                Value = $script:constants.DatastoreValue\n            }\n            SwapSize = $script:constants.SwapSizeMB\n        }\n    )\n}\n\n$script:hostCacheConfigurationSpec = [VMware.Vim.HostCacheConfigurationSpec] @{\n    Datastore = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.DatastoreType\n        Value = $script:constants.DatastoreValue\n    }\n    SwapSize = $script:constants.SwapSizeMB\n}\n\n$script:hostCacheConfigurationResult = [VMware.Vim.ManagedObjectReference] @{\n    Type = $script:constants.TaskType\n    Value = $script:constants.TaskValue\n}\n\n$script:hostCacheConfigurationErrorTask = [VMware.VimAutomation.ViCore.Impl.V1.Task.TaskImpl] @{\n    Name = $script:constants.ConfigureHostCacheTaskName\n    State = $script:constants.TaskErrorState\n}\n\n$script:hostCacheConfigurationSuccessTask = [VMware.VimAutomation.ViCore.Impl.V1.Task.TaskImpl] @{\n    Name = $script:constants.ConfigureHostCacheTaskName\n    State = $script:constants.TaskSuccessState\n}\n\n$script:virtualSwitch = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualSwitchImpl] @{\n    Name = $script:constants.VirtualSwitchName\n    VMHost = $script:vmHost\n}\n\n$script:virtualPortGroup = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualPortGroupImpl] @{\n    Name = $script:constants.VirtualPortGroupName\n    VirtualSwitch = $script:virtualSwitch\n    VirtualSwitchName = $script:constants.VirtualSwitchName\n    VLanId = $script:constants.VLanId\n    ExtensionData = [VMware.Vim.HostPortGroup] @{\n        Spec = [VMware.Vim.HostPortGroupSpec] @{\n            Policy = [VMware.Vim.HostNetworkPolicy] @{\n                ShapingPolicy = [VMware.Vim.HostNetworkTrafficShapingPolicy] @{\n                    Enabled = $script:constants.ShapingEnabled\n                    AverageBandwidth = $script:constants.AverageBandwidth\n                    PeakBandwidth = $script:constants.PeakBandwidth\n                    BurstSize = $script:constants.BurstSize\n                }\n            }\n        }\n    }\n}\n\n$script:virtualPortGroupSecurityPolicy = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualPortgroupSecurityPolicyImpl] @{\n    VirtualPortGroup = $script:virtualPortGroup\n    AllowPromiscuous = $script:constants.AllowPromiscuous\n    AllowPromiscuousInherited = $script:constants.AllowPromiscuousInherited\n    ForgedTransmits = $script:constants.ForgedTransmits\n    ForgedTransmitsInherited = $script:constants.ForgedTransmitsInherited\n    MacChanges = $script:constants.MacChanges\n    MacChangesInherited = $script:constants.MacChangesInherited\n}\n\n$script:virtualPortGroupTeamingPolicy = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.NicTeamingVirtualPortGroupPolicyImpl] @{\n    VirtualPortGroup = $script:virtualPortGroup\n    FailbackEnabled = $script:constants.FailbackEnabled\n    LoadBalancingPolicy = $script:constants.LoadBalancingPolicyIP\n    NetworkFailoverDetectionPolicy = $script:constants.NetworkFailoverDetectionPolicy\n    NotifySwitches = $script:constants.NotifySwitches\n    ActiveNic = $script:constants.ActiveNic\n    StandbyNic = $script:constants.StandbyNic\n    UnusedNic = $script:constants.UnusedNic\n    IsFailbackInherited = $script:constants.InheritFailback\n    IsFailoverOrderInherited = $script:constants.InheritFailoverOrder\n    IsLoadBalancingInherited = $script:constants.InheritLoadBalancingPolicy\n    IsNetworkFailoverDetectionInherited = $script:constants.InheritNetworkFailoverDetectionPolicy\n    IsNotifySwitchesInherited = $script:constants.InheritNotifySwitches\n}\n\n$script:vmHostNetworkSystem = [VMware.Vim.HostNetworkSystem] @{\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.NetworkSystemType\n        Value = $script:constants.NetworkSystemValue\n    }\n}\n\n$script:virtualPortGroupSpec = [VMware.Vim.HostPortGroupSpec] @{\n    Name = $script:virtualPortGroup.Name\n    VswitchName = $script:virtualPortGroup.VirtualSwitchName\n    VlanId = $script:virtualPortGroup.VLanId\n    Policy = [VMware.Vim.HostNetworkPolicy] @{\n        ShapingPolicy = [VMware.Vim.HostNetworkTrafficShapingPolicy] @{\n            Enabled = $script:constants.ShapingEnabled\n            AverageBandwidth = $script:constants.AverageBandwidth\n            PeakBandwidth = $script:constants.PeakBandwidth\n            BurstSize = $script:constants.BurstSize\n        }\n    }\n}\n\n$script:physicalNetworkAdapter = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.PhysicalNicImpl] @{\n    Name = $script:constants.PhysicalNetworkAdapterName\n    FullDuplex = $true\n    BitRatePerSec = $script:constants.BitRatePerSecMb\n    ExtensionData = [VMware.Vim.PhysicalNic] @{\n        Spec = [VMware.Vim.PhysicalNicSpec] @{\n            LinkSpeed = [VMware.Vim.PhysicalNicLinkInfo] @{\n                SpeedMb = $script:constants.BitRatePerSecMb\n                Duplex = $true\n            }\n        }\n    }\n}\n\n$script:vmHostNetworkAdapter = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:constants.VMKernelNetworkAdapterName\n    VMHost = $script:vmHost\n    PortGroupName = $script:constants.VirtualPortGroupName\n    IP = $script:constants.VMKernelNetworkAdapterIP\n    SubnetMask = $script:constants.VMKernelNetworkAdapterSubnetMask\n    Mac = $script:constants.VMKernelNetworkAdapterMac\n    DhcpEnabled = $script:constants.VMKernelNetworkAdapterDhcp\n    AutomaticIPv6 = $script:constants.VMKernelNetworkAdapterAutomaticIPv6\n    IPv6 = @()\n    IPv6ThroughDhcp = $script:constants.VMKernelNetworkAdapterIPv6ThroughDhcp\n    Mtu = $script:constants.VMKernelNetworkAdapterMtu\n    IPv6Enabled = $script:constants.VMKernelNetworkAdapterIPv6Enabled\n    ManagementTrafficEnabled = $script:constants.VMKernelNetworkAdapterManagementTrafficEnabled\n    FaultToleranceLoggingEnabled = $script:constants.VMKernelNetworkAdapterFaultToleranceLoggingEnabled\n    VMotionEnabled = $script:constants.VMKernelNetworkAdapterVMotionEnabled\n    VsanTrafficEnabled = $script:constants.VMKernelNetworkAdapterVsanTrafficEnabled\n}\n\n$script:distributedSwitch = [VMware.VimAutomation.Vds.Impl.V1.VmwareVDSwitchImpl] @{\n    Name = $script:constants.DistributedSwitchName\n    ContactDetails = $script:constants.DistributedSwitchContactDetails\n    ContactName = $script:constants.DistributedSwitchContactName\n    LinkDiscoveryProtocol = $script:constants.DistributedSwitchLinkDiscoveryProtocol\n    LinkDiscoveryProtocolOperation = $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation\n    MaxPorts = $script:constants.DistributedSwitchMaxPorts\n    Mtu = $script:constants.DistributedSwitchMtu\n    Notes = $script:constants.DistributedSwitchNotes\n    NumUplinkPorts = $script:constants.DistributedSwitchNumUplinkPorts\n    Version = $script:constants.DistributedSwitchVersion\n}\n\n$script:distributedPortGroup = [VMware.VimAutomation.Vds.Impl.V1.VmwareVDPortgroupImpl] @{\n    Name = $script:constants.DistributedPortGroupName\n    Notes = $script:constants.DistributedPortGroupNotes\n    NumPorts = $script:constants.DistributedPortGroupNumPorts\n    PortBinding = $script:constants.DistributedPortGroupStaticPortBinding\n    VDSwitch = $script:distributedSwitch\n    VlanConfiguration = [VMware.VimAutomation.Vds.Impl.V1.SingleVlanConfigurationImpl] @{\n        VlanType = $script:constants.VlanTypeVlan\n        VlanId = $script:constants.VLanId\n    }\n}\n\n$script:proxySwitch = [VMware.Vim.HostProxySwitch] @{\n    DvsName = $script:constants.DistributedSwitchName\n}\n\n$script:vmHostAddedToDistributedSwitchOne = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:constants.VMHostAddedToDistributedSwitchOneName\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Config = [VMware.Vim.HostConfigInfo] @{\n            Network = [VMware.Vim.HostNetworkInfo] @{\n                ProxySwitch = @(\n                    $script:proxySwitch\n                )\n            }\n        }\n    }\n}\n\n$script:vmHostAddedToDistributedSwitchTwo = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:constants.VMHostAddedToDistributedSwitchTwoName\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Config = [VMware.Vim.HostConfigInfo] @{\n            Network = [VMware.Vim.HostNetworkInfo] @{\n                ProxySwitch = @(\n                    $script:proxySwitch\n                )\n            }\n        }\n    }\n}\n\n$script:vmHostRemovedFromDistributedSwitchOne = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:constants.VMHostRemovedFromDistributedSwitchOneName\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Config = [VMware.Vim.HostConfigInfo] @{\n            Network = [VMware.Vim.HostNetworkInfo] @{\n                ProxySwitch = @()\n            }\n        }\n    }\n}\n\n$script:vmHostRemovedFromDistributedSwitchTwo = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:constants.VMHostRemovedFromDistributedSwitchTwoName\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Config = [VMware.Vim.HostConfigInfo] @{\n            Network = [VMware.Vim.HostNetworkInfo] @{\n                ProxySwitch = @()\n            }\n        }\n    }\n}\n\n$script:connectedPhysicalNetworkAdapterOne = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.PhysicalNicImpl] @{\n    Name = $script:constants.ConnectedPhysicalNetworkAdapterOneName\n    BitRatePerSec = $script:constants.ConnectedPhysicalNetworkAdapterBitRatePerSecMb\n}\n\n$script:connectedPhysicalNetworkAdapterTwo = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.PhysicalNicImpl] @{\n    Name = $script:constants.ConnectedPhysicalNetworkAdapterTwoName\n    BitRatePerSec = $script:constants.ConnectedPhysicalNetworkAdapterBitRatePerSecMb\n}\n\n$script:disconnectedPhysicalNetworkAdapterOne = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.PhysicalNicImpl] @{\n    Name = $script:constants.DisconnectedPhysicalNetworkAdapterOneName\n    BitRatePerSec = $script:constants.DisconnectedPhysicalNetworkAdapterBitRatePerSecMb\n}\n\n$script:disconnectedPhysicalNetworkAdapterTwo = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.PhysicalNicImpl] @{\n    Name = $script:constants.DisconnectedPhysicalNetworkAdapterTwoName\n    BitRatePerSec = $script:constants.DisconnectedPhysicalNetworkAdapterBitRatePerSecMb\n}\n\n$script:vmKernelNetworkAdapterOne = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:constants.VMKernelNetworkAdapterOneName\n    VMHost = $script:vmHostAddedToDistributedSwitchOne\n    PortGroupName = $script:constants.PortGroupOneName\n}\n\n$script:vmKernelNetworkAdapterTwo = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:constants.VMKernelNetworkAdapterTwoName\n    VMHost = $script:vmHostAddedToDistributedSwitchOne\n    PortGroupName = $script:constants.PortGroupTwoName\n}\n\n$script:vmKernelNicAttachedToPortGroupWithVLan = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:constants.VMKernelNicAttachedToPortGroupWithVLanName\n    VMHost = $script:vmHostAddedToDistributedSwitchOne\n    PortGroupName = $script:constants.PortGroupWithVLanName\n}\n\n$script:portGroupWithVLan = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualPortGroupImpl] @{\n    Name = $script:constants.PortGroupWithVLanName\n    VLanId = $script:constants.PortGroupWithVLanVLanId\n}\n\n$script:distributedSwitchWithoutAddedPhysicalNetworkAdapters = [VMware.VimAutomation.Vds.Impl.V1.VmwareVDSwitchImpl] @{\n    Name = $script:constants.DistributedSwitchWithoutAddedPhysicalNetworkAdaptersName\n    ExtensionData = [VMware.Vim.VmwareDistributedVirtualSwitch] @{\n        Config = [VMware.Vim.VMwareDVSConfigInfo] @{\n            Host = @(\n                [VMware.Vim.DistributedVirtualSwitchHostMember] @{\n                    Config = [VMware.Vim.DistributedVirtualSwitchHostMemberConfigInfo] @{\n                        Backing = [VMware.Vim.DistributedVirtualSwitchHostMemberPnicBacking] @{\n                            PnicSpec = @()\n                        }\n                    }\n                }\n            )\n        }\n    }\n}\n\n$script:distributedSwitchWithAddedPhysicalNetworkAdapters = [VMware.VimAutomation.Vds.Impl.V1.VmwareVDSwitchImpl] @{\n    Name = $script:constants.DistributedSwitchName\n    ExtensionData = [VMware.Vim.VmwareDistributedVirtualSwitch] @{\n        Config = [VMware.Vim.VMwareDVSConfigInfo] @{\n            Host = @(\n                [VMware.Vim.DistributedVirtualSwitchHostMember] @{\n                    Config = [VMware.Vim.DistributedVirtualSwitchHostMemberConfigInfo] @{\n                        Backing = [VMware.Vim.DistributedVirtualSwitchHostMemberPnicBacking] @{\n                            PnicSpec = @(\n                                [VMware.Vim.DistributedVirtualSwitchHostMemberPnicSpec] @{\n                                    PnicDevice = $script:constants.ConnectedPhysicalNetworkAdapterOneName\n                                },\n                                [VMware.Vim.DistributedVirtualSwitchHostMemberPnicSpec] @{\n                                    PnicDevice = $script:constants.DisconnectedPhysicalNetworkAdapterOneName\n                                }\n                            )\n                        }\n                    }\n                }\n            )\n        }\n    }\n}\n\n$script:vmHostAuthenticationInfoWithoutDomain = [VMware.VimAutomation.ViCore.Impl.V1.Host.VMHostAuthenticationImpl] @{\n    VMHost = $script:vmHost\n}\n\n$script:vmHostAuthenticationInfoWithDomain = [VMware.VimAutomation.ViCore.Impl.V1.Host.VMHostAuthenticationImpl] @{\n    Domain = $script:constants.DomainName\n    VMHost = $script:vmHost\n}\n\n$script:standardSwitchWithOnePhysicalNetworkAdapter = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualSwitchImpl] @{\n    Name = $script:constants.VirtualSwitchName\n    VMHost = $script:vmHost\n    Nic = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n}\n\n$script:vmKernelNetworkAdapterToMigrateToStandardSwitch = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:constants.VMKernelNetworkAdapterOneName\n    VMHost = $script:vmHost\n    PortGroupName = $script:constants.PortGroupOneName\n}\n\n$script:portGroupWithAttachedVMKernelNetworkAdapter = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualPortGroupImpl] @{\n    Name = $script:constants.PortGroupOneName\n    VirtualSwitch = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    VirtualSwitchName = $script:constants.VirtualSwitchName\n}\n\n$script:anonymousPrivilege = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PrivilegeImpl] @{\n    Server = $script:esxiServer\n    Id = $script:constants.PrivilegeIds[0]\n    Name = 'Anonymous'\n}\n\n$script:viewPrivilege = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PrivilegeImpl] @{\n    Server = $script:esxiServer\n    Id = $script:constants.PrivilegeIds[1]\n    Name = 'View'\n}\n\n$script:readPrivilege = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PrivilegeImpl] @{\n    Server = $script:esxiServer\n    Id = $script:constants.PrivilegeIds[2]\n    Name = 'Read'\n}\n\n$script:createPrivilege = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PrivilegeImpl] @{\n    Server = $script:esxiServer\n    Id = $script:constants.PrivilegeToAddIds[2]\n    Name = 'Create'\n}\n\n$script:vmHostRole = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.RoleImpl] @{\n    Server = $script:esxiServer\n    Name = $script:constants.RoleName\n    PrivilegeList = $script:constants.PrivilegeIds\n}\n\n$script:rootResourcePool = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ResourcePoolImpl] @{\n    Id = $script:constants.RootResourcePoolId\n    Name = $script:constants.RootResourcePoolName\n    ParentId = $script:vmHost.Id\n    Parent = $script:vmHost\n}\n\n$script:datacenterEntity = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.DatacenterImpl] @{\n    Id = $script:constants.DatacenterId\n    Name = $script:constants.DatacenterName\n}\n\n$script:datastoreEntity = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Id = $script:constants.DatastoreId\n    Name = $script:constants.DatastoreName\n    Datacenter = $script:datacenterEntity\n}\n\n$script:resourcePoolEntity = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ResourcePoolImpl] @{\n    Id = $script:constants.ResourcePoolId\n    Name = $script:constants.ResourcePoolName\n    ParentId = $script:rootResourcePool.Id\n    Parent = $script:rootResourcePool\n}\n\n$script:vAppEntity = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ResourcePoolImpl] @{\n    Id = $script:constants.VAppId\n    Name = $script:constants.VAppName\n    ParentId = $script:resourcePoolEntity.Id\n    Parent = $script:resourcePoolEntity\n}\n\n$script:vmEntity = [VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl] @{\n    Id = $script:constants.VMId\n    Name = $script:constants.VMName\n    VMHost = $script:vmHost\n    ResourcePool = $script:rootResourcePool\n}\n\n$script:resourcePoolViewBaseObject = [VMware.Vim.ResourcePool] @{\n    Name = $script:constants.ResourcePoolName\n    Parent = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.RootResourcePoolType\n        Value = $script:constants.RootResourcePoolValue\n    }\n}\n\n$script:vAppViewBaseObject = [VMware.Vim.ResourcePool] @{\n    Parent = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.ResourcePoolType\n        Value = $script:constants.ResourcePoolValue\n    }\n}\n\n$script:principal = [VMware.VimAutomation.ViCore.Impl.V1.Host.Account.HostUserAccountImpl] @{\n    Server = $script:esxiServer\n    Name = $script:constants.PrincipalName\n}\n\n$script:vmHostPermission = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PermissionImpl] @{\n    Entity = $script:datacenterEntity\n    Principal = $script:constants.PrincipalName\n    Role = $script:constants.RoleName\n    Propagate = $script:constants.PropagatePermission\n}\n\n$script:nfsUser = [VMware.VimAutomation.Storage.Impl.V1.Nfs.NfsUserImpl] @{\n    Username = $script:constants.NfsUsername\n    VMHost = $script:vmHost\n}\n\n$script:vmHostWithDatacenterHostFolderAsParent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Id = $script:constants.VMHostId\n    Name = $script:constants.VMHostName\n    ParentId = $script:constants.DatacenterHostFolderId\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Summary = [VMware.Vim.HostListSummary] @{\n            Config = [VMware.Vim.HostConfigSummary] @{\n                Port = $script:constants.VMHostPort\n            }\n        }\n    }\n}\n\n$script:vmHostWithInventoryItemLocationItemOneAsParent = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Id = $script:constants.VMHostId\n    Name = $script:constants.VMHostName\n    ParentId = $script:constants.InventoryItemLocationItemOneId\n}\n\n$script:vmHostUTCTimeZone = [VMware.VimAutomation.ViCore.Impl.V1.Host.VMHostTimeZoneImpl] @{\n    Name = $script:constants.VMHostUTCTimeZoneName\n    Key = $script:constants.VMHostUTCTimeZoneName\n    VMHost = $script:vmHostWithSettingsToModify\n}\n\n$script:vmHostGMTTimeZone = [VMware.VimAutomation.ViCore.Impl.V1.Host.VMHostTimeZoneImpl] @{\n    Name = $script:constants.VMHostGMTTimeZoneName\n    Key = $script:constants.VMHostGMTTimeZoneName\n    VMHost = $script:vmHostWithSettingsToModify\n}\n\n$script:vmSwapfileDatastoreOne = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Id = $script:constants.DatastoreId\n    Name = $script:constants.VMSwapfileDatastoreOneName\n}\n\n$script:vmSwapfileDatastoreTwo = [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] @{\n    Id = $script:constants.DatastoreId\n    Name = $script:constants.VMSwapfileDatastoreTwoName\n}\n\n$script:hostProfile = [VMware.VimAutomation.ViCore.Impl.V1.Host.Profile.VMHostProfileImpl] @{\n    Name = $script:constants.HostProfileName\n    Server = $script:viServer\n    ReferenceHost = $script:vmHostWithSettingsToModify\n}\n\n$script:clusterWithManualDrsAutomationLevel = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ClusterImpl] @{\n    Id = $script:constants.ClusterId\n    Name = $script:constants.ClusterName\n    DrsEnabled = $script:constants.DrsEnabled\n    DrsAutomationLevel = $script:constants.ClusterManualAutomationLevel\n}\n\n$script:clusterWithFullyAutomatedDrsAutomationLevel = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.ClusterImpl] @{\n    Id = $script:constants.ClusterId\n    Name = $script:constants.ClusterName\n    DrsEnabled = $script:constants.DrsEnabled\n    DrsAutomationLevel = $script:constants.DrsAutomationLevel\n}\n\n$script:kmsCluster = [VMware.VimAutomation.Storage.Impl.V1.Encryption.KmsClusterImpl] @{\n    Id = $script:constants.KmsClusterId\n    Name = $script:constants.KmsClusterName\n}\n\n$script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Id = $script:constants.VMHostId\n    Name = $script:constants.VMHostName\n    Parent = $script:clusterWithManualDrsAutomationLevel\n    ConnectionState = $script:constants.VMHostConnectedState\n    LicenseKey = $script:constants.VMHostLicenseKeyOne\n    TimeZone = $script:vmHostGMTTimeZone\n    VMSwapfileDatastore = $script:vmSwapfileDatastoreOne\n    VMSwapfilePolicy = $script:constants.InHostDatastoreVMSwapfilePolicy\n}\n\n$script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Id = $script:constants.VMHostId\n    Name = $script:constants.VMHostName\n    Parent = $script:clusterWithFullyAutomatedDrsAutomationLevel\n    ConnectionState = $script:constants.VMHostConnectedState\n    LicenseKey = $script:constants.VMHostLicenseKeyOne\n    TimeZone = $script:vmHostGMTTimeZone\n    VMSwapfileDatastore = $script:vmSwapfileDatastoreOne\n    VMSwapfilePolicy = $script:constants.InHostDatastoreVMSwapfilePolicy\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Runtime = [VMware.Vim.HostRuntimeInfo] @{\n            CryptoKeyId = [VMware.Vim.CryptoKeyId] @{\n                ProviderId = [VMware.Vim.KeyProviderId] @{\n                    Id = $script:constants.KmsClusterId + $script:constants.KmsClusterName\n                }\n            }\n        }\n    }\n}\n\n$script:vmHostWithoutSettingsToModify = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Id = $script:constants.VMHostId\n    Name = $script:constants.VMHostName\n    ConnectionState = $script:constants.VMHostMaintenanceState\n    LicenseKey = $script:constants.VMHostLicenseKeyTwo\n    TimeZone = $script:vmHostUTCTimeZone\n    VMSwapfileDatastore = $script:vmSwapfileDatastoreTwo\n    VMSwapfilePolicy = $script:constants.WithVMDatastoreVMSwapfilePolicy\n}\n\n$script:clusterDrsRecommendation = [VMware.VimAutomation.ViCore.Impl.V1.Cluster.DrsRecommendationImpl] @{\n    ClusterId = $script:constants.ClusterId\n    Cluster = $script:clusterWithManualDrsAutomationLevel\n}\n\n$script:enterMaintenanceModeSuccessTask = [VMware.VimAutomation.ViCore.Impl.V1.Task.TaskImpl] @{\n    Name = $script:constants.EnterMaintenanceModeTaskName\n    State = $script:constants.TaskSuccessState\n}\n\n$script:applyDrsRecommendationSuccessTask = [VMware.VimAutomation.ViCore.Impl.V1.Task.TaskImpl] @{\n    Name = $script:constants.ApplyDrsRecommendationTaskName\n    State = $script:constants.TaskSuccessState\n}\n\n$script:esxCli = [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl] @{\n    VMHost = $script:vmHost\n}\n\n$script:vmHostIPRouteOne = [VMware.VimAutomation.ViCore.Impl.V1.Host.VMHostRouteImpl] @{\n    VMHost = $script:vmHost\n    Gateway = $script:constants.Gateway\n    Destination = $script:constants.Destination\n    PrefixLength = $script:constants.PrefixLength\n}\n\n$script:vmKernelDumpPartition = @{\n    Active = 'mpx.vmhba32:C0:T0:L0:7'\n    Configured = 'mpx.vmhba32:C0:T0:L0:7'\n}\n\n$script:vmKernelDumpFile = @{\n    Active = 'mpx.vmhba32:C0:T0:L0:7'\n    Configured = 'mpx.vmhba32:C0:T0:L0:7'\n    Path = '/vmfs/volumes/{0}/vmkdump/{1}.dumpfile' -f $script:constants.DatastoreName, $script:constants.DumpFileName\n    Size = $script:constants.DumpFileSizeInBytes\n}\n\n$script:fileSystem = @{\n    UUID = [Guid]::NewGuid()\n    VolumeName = $script:constants.DatastoreName\n}\n\n$script:vmKernelModule = @{\n    Name = $script:constants.VMKernelModuleName\n    IsEnabled = $script:constants.VMKernelModuleEnabled\n}\n\n$script:vmHostSNMPAgent = @{\n    authentication = $script:constants.SNMPAgentAuthenticationProtocol\n    communities = $script:constants.SNMPAgentCommunities\n    enable = $script:constants.EnableSNMPAgent\n    engineid = $script:constants.SNMPAgentEngineId\n    hwsrc = $script:constants.SNMPAgentHwsrc\n    largestorage = $script:constants.SNMPAgentLargeStorage\n    loglevel = $script:constants.SNMPAgentLogLevel\n    notraps = $script:constants.SNMPAgentNoTraps\n    port = $script:constants.SNMPAgentPort\n    privacy = $script:constants.SNMPAgentPrivacyProtocol\n    remoteusers = $script:constants.SNMPAgentRemoteUsers\n    syscontact = $script:constants.SNMPAgentSysContact\n    syslocation = $script:constants.SNMPAgentSystemLocation\n    targets = $script:constants.SNMPAgentTargets\n    users = $script:constants.SNMPAgentUsers\n    v3targets = $script:constants.SNMPAgentV3Targets\n}\n\n$script:vmHostSoftwareDevices = @(\n    @{\n        DeviceID = $script:constants.SoftwareDeviceId\n        Instance = $script:constants.SoftwareDeviceInstanceAddress\n    }\n)\n\n$script:vmHostSharedSwapSpaceConfiguration = @{\n    DatastoreEnabled = $script:constants.DatastoreEnabled\n    DatastoreName = $script:constants.DatastoreName\n    DatastoreOrder = $script:constants.DatastoreOrder\n    HostcacheEnabled = $script:constants.HostCacheEnabled\n    HostcacheOrder = $script:constants.HostCacheOrder\n    HostlocalswapEnabled = $script:constants.HostLocalSwapEnabled\n    HostlocalswapOrder = $script:constants.HostLocalSwapOrder\n}\n\n$script:vmHostNetworkCoreDumpConfiguration = @{\n    Enabled = $script:constants.NetworkCoreDumpEnabled\n    HostVNic = $script:constants.NetworkCoreDumpInterfaceName\n    NetworkServerIP = $script:constants.NetworkCoreDumpServerIP\n    NetworkServerPort = $script:constants.NetworkCoreDumpServerPort\n}\n\n$script:vmHostvSanNetworkConfigurationIPInterface = @{\n    VmkNicName = $script:constants.VMHostvSanNetworkConfigurationInterfaceOneName\n    AgentGroupIPv6MulticastAddress = $script:constants.VMHostvSanNetworkConfigurationAgentGroupIPv6MulticastAddress\n    AgentGroupMulticastAddress = $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastAddress\n    AgentGroupMulticastPort = $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastPort\n    HostUnicastChannelBoundPort = $script:constants.VMHostvSanNetworkConfigurationHostUnicastChannelBoundPort\n    MasterGroupIPv6MulticastAddress = $script:constants.VMHostvSanNetworkConfigurationMasterGroupIPv6MulticastAddress\n    MasterGroupMulticastAddress = $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastAddress\n    MasterGroupMulticastPort = $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastPort\n    MulticastTTL = $script:constants.VMHostvSanNetworkConfigurationMulticastTTL\n    TrafficType = $script:constants.VMHostvSanNetworkConfigurationTrafficType\n}\n\n$script:vmHostScsiLun = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.Scsi.ScsiLunImpl] @{\n    CanonicalName = $script:constants.VMHostScsiLunCanonicalName\n    VMHost = $script:vmHost\n    MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    IsLocal = $script:constants.VMHostScsiLunIsLocal\n    IsSsd = $script:constants.VMHostScsiLunIsSsd\n}\n\n$script:vmHostScsiLunPath = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.Scsi.ScsiLunPathImpl] @{\n    Name = $script:constants.VMHostScsiLunPathName\n    ScsiLun = $script:vmHostScsiLun\n    State = $script:constants.VMHostScsiLunPathState\n    Preferred = $script:constants.VMHostPreferredScsiLunPath\n}\n\n$script:notPreferredVMHostScsiLunPath = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.Scsi.ScsiLunPathImpl] @{\n    Name = $script:constants.VMHostScsiLunPathName\n    ScsiLun = $script:vmHostScsiLun\n    State = $script:constants.VMHostScsiLunPathState\n    Preferred = !$script:constants.VMHostPreferredScsiLunPath\n}\n\n$script:vmHostDisk = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.VMHostDiskImpl] @{\n    VMHost = $script:vmHost\n    ScsiLun = $script:vmHostScsiLun\n    ExtensionData = [VMware.Vim.HostDiskPartitionInfo] @{\n        Spec = [VMware.Vim.HostDiskPartitionSpec] @{}\n    }\n}\n\n$script:vmHostDiskWithPartitions = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.VMHostDiskImpl] @{\n    VMHost = $script:vmHost\n    ScsiLun = $script:vmHostScsiLun\n    ExtensionData = [VMware.Vim.HostDiskPartitionInfo] @{\n        Spec = [VMware.Vim.HostDiskPartitionSpec] @{\n            Partition = @(\n                [VMware.Vim.HostDiskPartitionAttributes] @{\n                    Partition = $script:constants.DiskPartition\n                }\n            )\n        }\n    }\n}\n\n$script:firewallRulesetIPNetworksOne = @(\n        [VMware.Vim.HostFirewallRulesetIpNetwork] @{\n            Network = '10.20.120.12'\n            PrefixLength = '22'\n        },\n        [VMware.Vim.HostFirewallRulesetIpNetwork] @{\n            Network = '10.20.120.12'\n            PrefixLength = '23'\n        },\n        [VMware.Vim.HostFirewallRulesetIpNetwork] @{\n            Network = '10.20.120.12'\n            PrefixLength = '24'\n        }\n)\n\n$script:firewallRulesetIPNetworksTwo = @(\n    [VMware.Vim.HostFirewallRulesetIpNetwork] @{\n        Network = '10.20.120.12'\n        PrefixLength = '22'\n    },\n    [VMware.Vim.HostFirewallRulesetIpNetwork] @{\n        Network = '10.20.120.12'\n        PrefixLength = '23'\n    },\n    [VMware.Vim.HostFirewallRulesetIpNetwork] @{\n        Network = '10.20.120.12'\n        PrefixLength = '25'\n    }\n)\n\n$script:vmHostFirewallSystem = [VMware.Vim.HostFirewallSystem] @{\n    MoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:constants.FirewallSystemType\n        Value = $script:constants.FirewallSystemValue\n    }\n}\n\n$script:vmHostFirewallRulesetSpec = [VMware.Vim.HostFirewallRulesetRulesetSpec] @{\n    AllowedHosts = [VMware.Vim.HostFirewallRulesetIpList] @{\n        AllIp = !$script:constants.FirewallRulesetAllIP\n        IpAddress = $script:constants.FirewallRulesetIPAddressesTwo\n        IpNetwork = $script:firewallRulesetIPNetworksTwo\n    }\n}\n\n$script:vmHostFirewallRuleset = [VMware.VimAutomation.ViCore.Impl.V1.Host.VMHostFirewallExceptionImpl] @{\n    Name = $script:constants.FirewallRulesetName\n    VMHost = $script:vmHost\n    Enabled = $script:constants.FirewallRulesetEnabled\n    ExtensionData = [VMware.Vim.HostFirewallRuleset] @{\n        Key = $script:constants.FirewallRulesetKey\n        AllowedHosts = [VMware.Vim.HostFirewallRulesetIpList] @{\n            AllIp = $script:constants.FirewallRulesetAllIP\n            IpAddress = $script:constants.FirewallRulesetIPAddressesOne\n            IpNetwork = $script:firewallRulesetIPNetworksOne\n        }\n    }\n}\n\n$script:iScsiHba = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.IScsiHbaImpl] @{\n    Device = $script:constants.IScsiHbaDeviceName\n    VMHost = $script:vmHost\n    IScsiName = $script:constants.IScsiName\n    AuthenticationProperties = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.IScsiHbaAuthenticationPropertiesImpl] @{\n        ChapType = $script:constants.ChapTypeRequired\n        ChapName = $script:constants.ChapName\n        MutualChapEnabled = $script:constants.MutualChapEnabled\n        MutualChapName = $script:constants.MutualChapName\n    }\n}\n\n$script:iScsiHbaTarget = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.IScsiHbaTargetImpl] @{\n    Address = $script:constants.IScsiHbaTargetAddress\n    Port = $script:constants.IScsiHbaTargetPort\n    Type = $script:constants.IScsiHbaSendTargetType\n    IScsiHbaName = $script:constants.IScsiHbaDeviceName\n    AuthenticationProperties = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.IScsiHbaAuthenticationPropertiesImpl] @{\n        ChapType = $script:constants.ChapTypeRequired\n        ChapInherited = $script:constants.ChapInherited\n        ChapName = $script:constants.ChapName\n        MutualChapInherited = $script:constants.MutualChapInherited\n        MutualChapEnabled = $script:constants.MutualChapEnabled\n        MutualChapName = $script:constants.MutualChapName\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/NfsDatastoreMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-NfsDatastoreDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.DatastoreName\n        Path = $script:constants.NfsPath\n        NfsHost = $script:constants.NfsHost\n    }\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksForNfsDatastore {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsDatastoreIsNotCreatedAndAccessModeAndAuthenticationMethodAreNotSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Present'\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure()\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsDatastoreIsNotCreatedAndAccessModeAndAuthenticationMethodAreSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $nfsDatastoreBaseDSCProperties.AccessMode = $script:constants.AccessMode\n    $nfsDatastoreBaseDSCProperties.AuthenticationMethod = $script:constants.AuthenticationMethod\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure()\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsDatastoreIsNotCreatedAndStorageIOControlEnabledAndCongestionThresholdMillisecondAreSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $nfsDatastoreBaseDSCProperties.AccessMode = $script:constants.AccessMode\n    $nfsDatastoreBaseDSCProperties.AuthenticationMethod = $script:constants.AuthenticationMethod\n    $nfsDatastoreBaseDSCProperties.StorageIOControlEnabled = !$script:constants.StorageIOControlEnabled\n    $nfsDatastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.CongestionThresholdMillisecond\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure()\n    Mock -CommandName Set-Datastore -MockWith { return $null }.GetNewClosure()\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheNfsDatastoreIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName Remove-Datastore -MockWith { return $null }.GetNewClosure()\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheNfsDatastoreIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Absent'\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName Remove-Datastore -MockWith { return $null }.GetNewClosure()\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheNfsDatastoreIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesDoNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $nfsDatastoreBaseDSCProperties.StorageIOControlEnabled = $script:constants.StorageIOControlEnabled\n    $nfsDatastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.MaxCongestionThresholdMillisecond\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $nfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $nfsDatastoreBaseDSCProperties.StorageIOControlEnabled = !$script:constants.StorageIOControlEnabled\n    $nfsDatastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.CongestionThresholdMillisecond\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenTheNfsDatastoreDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $nfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenTheNfsDatastoreExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsDatastoreBaseDSCProperties = New-NfsDatastoreDSCProperties\n\n    $datastoreMock = $script:nfsDatastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $nfsDatastoreBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/NfsUserMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-NfsUserProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.NfsUsername\n    }\n\n    $nfsUserProperties\n}\n\nfunction New-MocksForNfsUser {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsUserIsNotCreatedAndErrorOccursWhileCreatingTheNfsUser {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Password = $script:constants.NfsUserPasswordOne\n    $nfsUserProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-NfsUser -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName New-NfsUser -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost -and $Password -eq $script:constants.NfsUserPasswordOne -and !$Confirm } -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsUserIsNotCreatedAndNoErrorOccursWhileCreatingTheNfsUser {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Password = $script:constants.NfsUserPasswordOne\n    $nfsUserProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-NfsUser -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName New-NfsUser -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndErrorOccursWhileChangingThePasswordOfTheNfsUser {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Password = $script:constants.NfsUserPasswordTwo\n    $nfsUserProperties.Ensure = 'Present'\n    $nfsUserProperties.Force = $true\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-NfsUser -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $NfsUser -eq $script:nfsUser -and $Password -eq $script:constants.NfsUserPasswordTwo -and !$Confirm } -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndThePasswordShouldBeChanged {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Password = $script:constants.NfsUserPasswordTwo\n    $nfsUserProperties.Ensure = 'Present'\n    $nfsUserProperties.Force = $true\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-NfsUser -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheNfsUserIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-NfsUser -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-NfsUser -MockWith { return $null }.GetNewClosure()\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheNfsUserIsNotRemovedAndErrorOccursWhileRemovingTheNfsUser {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Absent'\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-NfsUser -MockWith { throw }.GetNewClosure() -ParameterFilter { $NfsUser -eq $script:nfsUser -and !$Confirm } -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheNfsUserIsNotRemovedAndNoErrorOccursWhileRemovingTheNfsUser {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Absent'\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-NfsUser -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheNfsUserIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-NfsUser -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndForcePropertyIsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Present'\n    $nfsUserProperties.Force = $true\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheNfsUserIsAlreadyCreatedAndForcePropertyIsNotSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Present'\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $nfsUserProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheNfsUserIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $nfsUserProperties = New-NfsUserProperties\n\n    $nfsUserProperties.Ensure = 'Absent'\n\n    $nfsUserMock = $script:nfsUser\n\n    Mock -CommandName Get-NfsUser -MockWith { return $nfsUserMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Username -eq $script:constants.NfsUsername -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $nfsUserProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VDPortGroupMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VDPortGroupProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.DistributedPortGroupName\n        VdsName = $script:constants.DistributedSwitchName\n        Ensure = 'Present'\n    }\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksForVDPortGroup {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenDistributedPortGroupDoesNotExistDistributedPortGroupSettingsAreNotPassedAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupDoesNotExistDistributedPortGroupSettingsArePassedAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Notes = $script:constants.DistributedPortGroupNotes\n    $vdPortGroupProperties.NumPorts = $script:constants.DistributedPortGroupNumPorts\n    $vdPortGroupProperties.PortBinding = $script:constants.DistributedPortGroupStaticPortBinding\n    $vdPortGroupProperties.VLanId = $script:constants.VLanId\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupDoesNotExistReferenceDistributedPortGroupIsPassedAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.ReferenceVDPortGroupName = $script:constants.ReferenceDistributedPortGroupName\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsDistributedPortGroupSettingsArePassedAndNeedToBeUpdatedAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.NumPorts = $script:constants.DistributedPortGroupNumPorts + $script:constants.DistributedPortGroupNumPorts\n    $vdPortGroupProperties.PortBinding = $script:constants.DistributedPortGroupDynamicPortBinding\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Set-VDPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsVlanId0IsPassedAndNeedsToBeUpdatedAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.VLanId = $script:constants.VLanNone\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Set-VDVlanConfiguration -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsVlanIdIsPassedAndNeedsToBeUpdatedAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.VLanId = $script:constants.ModifiedVLanId\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Set-VDVlanConfiguration -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksInSetWhenDistributedPortGroupDoesNotExistAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Remove-VDPortGroup -MockWith { return $null }.GetNewClosure()\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksInSetWhenDistributedPortGroupExistsAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Ensure = 'Absent'\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Remove-VDPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupDoesNotExistAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsPassedDistributedPortGroupSettingsAreEqualToTheServerSettingsAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Notes = $script:constants.DistributedPortGroupNotes\n    $vdPortGroupProperties.NumPorts = $script:constants.DistributedPortGroupNumPorts\n    $vdPortGroupProperties.PortBinding = $script:constants.DistributedPortGroupStaticPortBinding\n    $vdPortGroupProperties.VLanId = $script:constants.VLanId\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsPassedDistributedPortGroupSettingsAreNotEqualToTheServerSettingsAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Notes = $script:constants.DistributedPortGroupNotes\n    $vdPortGroupProperties.NumPorts = $script:constants.DistributedPortGroupNumPorts + $script:constants.DistributedPortGroupNumPorts\n    $vdPortGroupProperties.PortBinding = $script:constants.DistributedPortGroupDynamicPortBinding\n    $vdPortGroupProperties.VLanId = $script:constants.VLanNone\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupDoesNotExistAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n\n    $vdPortGroupProperties\n}\n\nfunction New-MocksWhenDistributedPortGroupExistsAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdPortGroupProperties = New-VDPortGroupProperties\n\n    $vdPortGroupProperties.Ensure = 'Absent'\n\n    $distributedPortGroupMock = $script:distributedPortGroup\n\n    Mock -CommandName Get-VDPortGroup -MockWith { return $distributedPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedPortGroupName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n\n    $vdPortGroupProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VDSwitchMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VDSwitchProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.DistributedSwitchName\n        Ensure = 'Present'\n        Location = [string]::Empty\n        DatacenterName = $script:constants.DatacenterName\n        DatacenterLocation = $script:constants.DatacenterLocationItemOne\n    }\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksForVDSwitch {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterNetworkFolderViewBaseObjectMock = $script:datacenterNetworkFolderViewBaseObject\n    $datacenterNetworkFolderMock = $script:datacenterNetworkFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterNetworkFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.NetworkFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterNetworkFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterNetworkFolderViewBaseObject.MoRef } -Verifiable\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingDistributedSwitchAndNoDistributedSwitchSettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n    Mock -CommandName New-VDSwitch -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingDistributedSwitchAndDistributedSwitchSettingsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.ContactDetails = $script:constants.DistributedSwitchContactDetails\n    $vdSwitchProperties.ContactName = $script:constants.DistributedSwitchContactName\n    $vdSwitchProperties.LinkDiscoveryProtocol = $script:constants.DistributedSwitchLinkDiscoveryProtocol\n    $vdSwitchProperties.LinkDiscoveryProtocolOperation = $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation\n    $vdSwitchProperties.MaxPorts = $script:constants.DistributedSwitchMaxPorts\n    $vdSwitchProperties.Mtu = $script:constants.DistributedSwitchMtu\n    $vdSwitchProperties.Notes = $script:constants.DistributedSwitchNotes\n    $vdSwitchProperties.NumUplinkPorts = $script:constants.DistributedSwitchNumUplinkPorts\n    $vdSwitchProperties.Version = $script:constants.DistributedSwitchVersion\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n    Mock -CommandName New-VDSwitch -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentNonExistingDistributedSwitchAndReferenceDistributedSwitchNameSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.ReferenceVDSwitchName = $script:constants.ReferenceDistributedSwitchName\n    $vdSwitchProperties.WithoutPortGroups = $script:constants.WithoutPortGroups\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n    Mock -CommandName New-VDSwitch -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.ContactDetails = $script:constants.DistributedSwitchContactDetails + $script:constants.DistributedSwitchContactDetails\n    $vdSwitchProperties.ContactName = $script:constants.DistributedSwitchContactName + $script:constants.DistributedSwitchContactName\n    $vdSwitchProperties.MaxPorts = $script:constants.DistributedSwitchMaxPorts + 1\n    $vdSwitchProperties.Mtu = $script:constants.DistributedSwitchMtu + 1\n\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n    Mock -CommandName Set-VDSwitch -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.Ensure = 'Absent'\n\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n    Mock -CommandName Remove-VDSwitch -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndNonExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n    Mock -CommandName Remove-VDSwitch -MockWith { return $null }.GetNewClosure()\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingDistributedSwitchAndMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.ContactDetails = $script:constants.DistributedSwitchContactDetails\n    $vdSwitchProperties.ContactName = $script:constants.DistributedSwitchContactName\n    $vdSwitchProperties.LinkDiscoveryProtocol = $script:constants.DistributedSwitchLinkDiscoveryProtocol\n    $vdSwitchProperties.LinkDiscoveryProtocolOperation = $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation\n    $vdSwitchProperties.MaxPorts = $script:constants.DistributedSwitchMaxPorts\n    $vdSwitchProperties.Mtu = $script:constants.DistributedSwitchMtu\n    $vdSwitchProperties.Notes = $script:constants.DistributedSwitchNotes\n    $vdSwitchProperties.NumUplinkPorts = $script:constants.DistributedSwitchNumUplinkPorts\n    $vdSwitchProperties.Version = $script:constants.DistributedSwitchVersion\n\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingDistributedSwitchAndNonMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.ContactName = $script:constants.DistributedSwitchContactName + $script:constants.DistributedSwitchContactName\n    $vdSwitchProperties.Mtu = $script:constants.DistributedSwitchMtu + 1\n\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.ContactDetails = $script:constants.DistributedSwitchContactDetails\n    $vdSwitchProperties.ContactName = $script:constants.DistributedSwitchContactName\n    $vdSwitchProperties.LinkDiscoveryProtocol = $script:constants.DistributedSwitchLinkDiscoveryProtocol\n    $vdSwitchProperties.LinkDiscoveryProtocolOperation = $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation\n    $vdSwitchProperties.MaxPorts = $script:constants.DistributedSwitchMaxPorts\n    $vdSwitchProperties.Mtu = $script:constants.DistributedSwitchMtu\n    $vdSwitchProperties.Notes = $script:constants.DistributedSwitchNotes\n    $vdSwitchProperties.NumUplinkPorts = $script:constants.DistributedSwitchNumUplinkPorts\n    $vdSwitchProperties.Version = $script:constants.DistributedSwitchVersion\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.Ensure = 'Absent'\n    $vdSwitchProperties.ContactDetails = $script:constants.DistributedSwitchContactDetails\n    $vdSwitchProperties.ContactName = $script:constants.DistributedSwitchContactName\n    $vdSwitchProperties.LinkDiscoveryProtocol = $script:constants.DistributedSwitchLinkDiscoveryProtocol\n    $vdSwitchProperties.LinkDiscoveryProtocolOperation = $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation\n    $vdSwitchProperties.MaxPorts = $script:constants.DistributedSwitchMaxPorts\n    $vdSwitchProperties.Mtu = $script:constants.DistributedSwitchMtu\n    $vdSwitchProperties.Notes = $script:constants.DistributedSwitchNotes\n    $vdSwitchProperties.NumUplinkPorts = $script:constants.DistributedSwitchNumUplinkPorts\n    $vdSwitchProperties.Version = $script:constants.DistributedSwitchVersion\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchProperties = New-VDSwitchProperties\n\n    $vdSwitchProperties.Ensure = 'Absent'\n\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder } -Verifiable\n\n    $vdSwitchProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VDSwitchVMHostMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VDSwitchVMHostProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VdsName = $script:constants.DistributedSwitchName\n    }\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksForVDSwitchVMHost {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n}\n\nfunction New-MocksWhenEnsurePresentTwoVMHostsAndOneOfThemIsAlreadyAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostAddedToDistributedSwitchOneName, $script:constants.VMHostRemovedFromDistributedSwitchOneName)\n    $vdSwitchVMHostProperties.Ensure = 'Present'\n\n    $vmHostOneMock = $script:vmHostAddedToDistributedSwitchOne\n    $vmHostTwoMock = $script:vmHostRemovedFromDistributedSwitchOne\n\n    # Mock Write-WarningLog to avoid the warning output when executing the Unit Tests.\n    Mock -CommandName Write-WarningLog -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Add-VDSwitchVMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndTwoVMHostsThatAreNotAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostRemovedFromDistributedSwitchOneName, $script:constants.VMHostRemovedFromDistributedSwitchTwoName)\n    $vdSwitchVMHostProperties.Ensure = 'Present'\n\n    $vmHostOneMock = $script:vmHostRemovedFromDistributedSwitchOne\n    $vmHostTwoMock = $script:vmHostRemovedFromDistributedSwitchTwo\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchTwoName } -Verifiable\n    Mock -CommandName Add-VDSwitchVMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsureAbsentTwoVMHostsAndOneOfThemIsAlreadyRemovedFromTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostAddedToDistributedSwitchOneName, $script:constants.VMHostRemovedFromDistributedSwitchOneName)\n    $vdSwitchVMHostProperties.Ensure = 'Absent'\n\n    $vmHostOneMock = $script:vmHostAddedToDistributedSwitchOne\n    $vmHostTwoMock = $script:vmHostRemovedFromDistributedSwitchOne\n\n    # Mock Write-WarningLog to avoid the warning output when executing the Unit Tests.\n    Mock -CommandName Write-WarningLog -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Remove-VDSwitchVMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndTwoVMHostsThatAreNotRemovedFromTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostAddedToDistributedSwitchOneName, $script:constants.VMHostAddedToDistributedSwitchTwoName)\n    $vdSwitchVMHostProperties.Ensure = 'Absent'\n\n    $vmHostOneMock = $script:vmHostAddedToDistributedSwitchOne\n    $vmHostTwoMock = $script:vmHostAddedToDistributedSwitchTwo\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchTwoName } -Verifiable\n    Mock -CommandName Remove-VDSwitchVMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndVMHostThatIsNotAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostRemovedFromDistributedSwitchOneName)\n    $vdSwitchVMHostProperties.Ensure = 'Present'\n\n    $vmHostMock = $script:vmHostRemovedFromDistributedSwitchOne\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchOneName } -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndVMHostThatIsAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostAddedToDistributedSwitchOneName)\n    $vdSwitchVMHostProperties.Ensure = 'Present'\n\n    $vmHostMock = $script:vmHostAddedToDistributedSwitchOne\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchOneName } -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndVMHostThatIsNotRemovedFromTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostAddedToDistributedSwitchOneName)\n    $vdSwitchVMHostProperties.Ensure = 'Absent'\n\n    $vmHostMock = $script:vmHostAddedToDistributedSwitchOne\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchOneName } -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndVMHostThatIsRemovedFromTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @($script:constants.VMHostRemovedFromDistributedSwitchOneName)\n    $vdSwitchVMHostProperties.Ensure = 'Absent'\n\n    $vmHostMock = $script:vmHostRemovedFromDistributedSwitchOne\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchOneName } -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vdSwitchVMHostProperties = New-VDSwitchVMHostProperties\n\n    $vdSwitchVMHostProperties.VMHostNames = @(\n        $script:constants.VMHostAddedToDistributedSwitchOneName,\n        $script:constants.VMHostAddedToDistributedSwitchTwoName,\n        $script:constants.VMHostRemovedFromDistributedSwitchOneName,\n        $script:constants.VMHostRemovedFromDistributedSwitchTwoName\n    )\n    $vdSwitchVMHostProperties.Ensure = 'Present'\n\n    $vmHostOneMock = $script:vmHostAddedToDistributedSwitchOne\n    $vmHostTwoMock = $script:vmHostAddedToDistributedSwitchTwo\n    $vmHostThreeMock = $script:vmHostRemovedFromDistributedSwitchOne\n    $vmHostFourMock = $script:vmHostRemovedFromDistributedSwitchTwo\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostAddedToDistributedSwitchTwoName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchOneName } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostFourMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostRemovedFromDistributedSwitchTwoName } -Verifiable\n\n    $vdSwitchVMHostProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostAcceptanceLevelMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostAcceptanceLevelProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAcceptanceLevelProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostAcceptanceLevelProperties\n}\n\nfunction New-MocksInSetForVMHostAcceptanceLevel {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAcceptanceLevelProperties = New-VMHostAcceptanceLevelProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    $vmHostAcceptanceLevelProperties.Level = $script:constants.VMwareCertifiedAcceptanceLevel\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostAcceptanceLevelProperties\n}\n\nfunction New-MocksForVMHostAcceptanceLevel {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAcceptanceLevelProperties = New-VMHostAcceptanceLevelProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliGetMethodMock = $script:constants.VMwareCertifiedAcceptanceLevel\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostAcceptanceLevelProperties\n}\n\nfunction New-MocksWhenTheVMHostAcceptanceLevelShouldBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAcceptanceLevelProperties = New-VMHostAcceptanceLevelProperties\n\n    $vmHostAcceptanceLevelProperties.Level = $script:constants.VMwareAcceptedAcceptanceLevel\n\n    $vmHostAcceptanceLevelProperties\n}\n\nfunction New-MocksWhenTheVMHostAcceptanceLevelShouldNotBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAcceptanceLevelProperties = New-VMHostAcceptanceLevelProperties\n\n    $vmHostAcceptanceLevelProperties.Level = $script:constants.VMwareCertifiedAcceptanceLevel\n\n    $vmHostAcceptanceLevelProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostAdvancedSettingsMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostAdvancedSettingsProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAdvancedSettingsProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostAdvancedSettingsProperties\n}\n\nfunction New-MocksForVMHostAdvancedSettingsWithOptionManager {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $optionManagerMock = $script:optionManager\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $optionManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.AdvancedOption } -Verifiable\n}\n\nfunction New-MocksForVMHostAdvancedSettings {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksInSetWhenHashtableContainsAdvancedSettingsAndAllOfThemNeedToBeUpdated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $advancedSettingsHashtable = @{\n        $script:constants.BufferCacheFlushIntervalAdvancedSettingName = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue + 1\n        $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue + 1\n        $script:constants.CBRCEnableAdvancedSettingName = $true\n        $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue + '/vpxa'\n    }\n\n    $vmHostAdvancedSettingsProperties = New-VMHostAdvancedSettingsProperties\n    $vmHostAdvancedSettingsProperties.AdvancedSettings = $advancedSettingsHashtable\n\n    $vmHostAdvancedSettingsMock = $script:vmHostAdvancedSettings\n\n    Mock -CommandName Get-AdvancedSetting -MockWith { return $vmHostAdvancedSettingsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHost } -Verifiable\n    Mock -CommandName Update-VMHostAdvancedSettings -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostAdvancedSettingsProperties\n}\n\nfunction New-MocksInSetWhenHashtableContainsAdvancedSettingsAndNotAllOfThemNeedToBeUpdated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $advancedSettingsHashtable = @{\n        $script:constants.BufferCacheFlushIntervalAdvancedSettingName = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue + 1\n        $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue\n        $script:constants.CBRCEnableAdvancedSettingName = $script:constants.CBRCEnableAdvancedSettingValue\n        $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue + '/vpxa'\n    }\n\n    $vmHostAdvancedSettingsProperties = New-VMHostAdvancedSettingsProperties\n    $vmHostAdvancedSettingsProperties.AdvancedSettings = $advancedSettingsHashtable\n\n    $vmHostAdvancedSettingsMock = $script:vmHostAdvancedSettings\n\n    Mock -CommandName Get-AdvancedSetting -MockWith { return $vmHostAdvancedSettingsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHost } -Verifiable\n    Mock -CommandName Update-VMHostAdvancedSettings -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostAdvancedSettingsProperties\n}\n\nfunction New-MocksInSetWhenHashtableContainsAdvancedSettingsAndNoneOfThemNeedToBeUpdated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $advancedSettingsHashtable = @{\n        $script:constants.BufferCacheFlushIntervalAdvancedSettingName = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue\n        $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue\n        $script:constants.CBRCEnableAdvancedSettingName = $script:constants.CBRCEnableAdvancedSettingValue\n        $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue\n    }\n\n    $vmHostAdvancedSettingsProperties = New-VMHostAdvancedSettingsProperties\n    $vmHostAdvancedSettingsProperties.AdvancedSettings = $advancedSettingsHashtable\n\n    $vmHostAdvancedSettingsMock = $script:vmHostAdvancedSettings\n\n    Mock -CommandName Get-AdvancedSetting -MockWith { return $vmHostAdvancedSettingsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHost } -Verifiable\n    Mock -CommandName Update-VMHostAdvancedSettings -MockWith { return $null }.GetNewClosure()\n\n    $vmHostAdvancedSettingsProperties\n}\n\nfunction New-MocksWhenHashtableContainsAtLeastOneAdvancedSettingThatNeedsToBeUpdated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $advancedSettingsHashtable = @{\n        $script:constants.BufferCacheFlushIntervalAdvancedSettingName = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue\n        $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue\n        $script:constants.CBRCEnableAdvancedSettingName = $true\n        $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue\n    }\n\n    $vmHostAdvancedSettingsProperties = New-VMHostAdvancedSettingsProperties\n    $vmHostAdvancedSettingsProperties.AdvancedSettings = $advancedSettingsHashtable\n\n    $vmHostAdvancedSettingsMock = $script:vmHostAdvancedSettings\n\n    Mock -CommandName Get-AdvancedSetting -MockWith { return $vmHostAdvancedSettingsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHost } -Verifiable\n\n    $vmHostAdvancedSettingsProperties\n}\n\nfunction New-MocksWhenHashtableDoesNotContainAdvancedSettingsThatNeedToBeUpdated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $advancedSettingsHashtable = @{\n        $script:constants.BufferCacheFlushIntervalAdvancedSettingName = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue\n        $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue\n        $script:constants.CBRCEnableAdvancedSettingName = $false\n        $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue\n    }\n\n    $vmHostAdvancedSettingsProperties = New-VMHostAdvancedSettingsProperties\n    $vmHostAdvancedSettingsProperties.AdvancedSettings = $advancedSettingsHashtable\n\n    $vmHostAdvancedSettingsMock = $script:vmHostAdvancedSettings\n\n    Mock -CommandName Get-AdvancedSetting -MockWith { return $vmHostAdvancedSettingsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHost } -Verifiable\n\n    $vmHostAdvancedSettingsProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $advancedSettingsHashtable = @{\n        $script:constants.BufferCacheFlushIntervalAdvancedSettingName = $script:constants.BufferCacheFlushIntervalAdvancedSettingValue\n        $script:constants.BufferCacheHardMaxDirtyAdvancedSettingName = $script:constants.BufferCacheHardMaxDirtyAdvancedSettingValue\n        $script:constants.CBRCEnableAdvancedSettingName = $false\n        $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingName = $script:constants.VpxVpxaConfigWorkingDirAdvancedSettingValue\n    }\n\n    $vmHostAdvancedSettingsProperties = New-VMHostAdvancedSettingsProperties\n    $vmHostAdvancedSettingsProperties.AdvancedSettings = $advancedSettingsHashtable\n\n    $vmHostAdvancedSettingsMock = $script:vmHostAdvancedSettings\n\n    Mock -CommandName Get-AdvancedSetting -MockWith { return $vmHostAdvancedSettingsMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHost } -Verifiable\n\n    $vmHostAdvancedSettingsProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostAgentVMMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostAgentVMProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksForVMHostAgentVMWithEsxAgentHostManagerWithNullAgentVmSettings {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNullAgentVmSettings\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n    Mock -CommandName Update-AgentVMConfiguration -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksForVMHostAgentVM {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenAgentVmDatastoreIsAnExistingDatastoreAndAgentVmNetworkIsAnExistingNetwork {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n    $vmHostAgentVMProperties.AgentVmDatastore = $script:constants.DatastoreName\n    $vmHostAgentVMProperties.AgentVmNetwork = $script:constants.NetworkName\n\n    $datastoreMock = $script:datastore\n    $networkMock = $script:network\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $networkMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.Network[0] } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmDatastoreIsNotAnExistingDatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n    $vmHostAgentVMProperties.AgentVmDatastore = $script:constants.DatastoreName\n\n    Mock -CommandName Get-Datastore -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmNetworkIsNotAnExistingNetwork {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n    $vmHostAgentVMProperties.AgentVmNetwork = $script:constants.NetworkName\n\n    Mock -CommandName Get-View -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.Network[0] } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsAreSetToNullAndServerValuesAreNotEqualToNull {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNotNullAgentVmSettings\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsAreSetToNullAndServerValuesAreEqualToNull {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNullAgentVmSettings\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsAreNotSetToNullAndServerValuesAreEqualToNull {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n    $vmHostAgentVMProperties.AgentVmDatastore = $script:constants.DatastoreName\n    $vmHostAgentVMProperties.AgentVmNetwork = $script:constants.NetworkName\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNullAgentVmSettings\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsAreNotEqualToServerValues {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n    $vmHostAgentVMProperties.AgentVmDatastore = $script:constants.DatastoreName\n    $vmHostAgentVMProperties.AgentVmNetwork = $script:constants.NetworkName + $script:constants.NetworkName\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNotNullAgentVmSettings\n    $datastoreMock = $script:datastore.ExtensionData\n    $networkMock = $script:network\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:esxAgentHostManagerWithNotNullAgentVmSettings.ConfigInfo.AgentVmDatastore } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $networkMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:esxAgentHostManagerWithNotNullAgentVmSettings.ConfigInfo.AgentVmNetwork } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsAreEqualToServerValues {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n    $vmHostAgentVMProperties.AgentVmDatastore = $script:constants.DatastoreName\n    $vmHostAgentVMProperties.AgentVmNetwork = $script:constants.NetworkName\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNotNullAgentVmSettings\n    $datastoreMock = $script:datastore.ExtensionData\n    $networkMock = $script:network\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:esxAgentHostManagerWithNotNullAgentVmSettings.ConfigInfo.AgentVmDatastore } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $networkMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:esxAgentHostManagerWithNotNullAgentVmSettings.ConfigInfo.AgentVmNetwork } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsFromTheServerAreEqualToNull {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNullAgentVmSettings\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n\nfunction New-MocksWhenAgentVmSettingsFromTheServerAreNotEqualToNull {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAgentVMProperties = New-VMHostAgentVMProperties\n\n    $esxAgentHostManagerMock = $script:esxAgentHostManagerWithNotNullAgentVmSettings\n    $datastoreMock = $script:datastore.ExtensionData\n    $networkMock = $script:network\n\n    Mock -CommandName Get-View -MockWith { return $esxAgentHostManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.EsxAgentHostManager } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:esxAgentHostManagerWithNotNullAgentVmSettings.ConfigInfo.AgentVmDatastore } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $networkMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:esxAgentHostManagerWithNotNullAgentVmSettings.ConfigInfo.AgentVmNetwork } -Verifiable\n\n    $vmHostAgentVMProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostAuthenticationMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostAuthenticationProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n        DomainName = $script:constants.DomainName\n    }\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksForVMHostAuthentication {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenDomainActionIsJoinAndErrorOccursWhileIncludingTheVMHostToTheDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionJoin\n    $vmHostAuthenticationProperties.DomainCredential = $script:domainCredential\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithoutDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-VMHostAuthentication -MockWith { throw }.GetNewClosure() -ParameterFilter { $VMHostAuthentication -eq $script:vmHostAuthenticationInfoWithoutDomain -and $Domain -eq $script:constants.DomainName -and $Credential -eq $script:domainCredential -and $JoinDomain -and !$Confirm } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsJoin {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionJoin\n    $vmHostAuthenticationProperties.DomainCredential = $script:domainCredential\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithoutDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-VMHostAuthentication -MockWith { return $null }.GetNewClosure() -ParameterFilter { $VMHostAuthentication -eq $script:vmHostAuthenticationInfoWithoutDomain -and $Domain -eq $script:constants.DomainName -and $Credential -eq $script:domainCredential -and $JoinDomain -and !$Confirm } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsLeaveAndErrorOccursWhileExcludingTheVMHostFromTheDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionLeave\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-VMHostAuthentication -MockWith { throw }.GetNewClosure() -ParameterFilter { $VMHostAuthentication -eq $script:vmHostAuthenticationInfoWithDomain -and $LeaveDomain -and $Force -and !$Confirm } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsLeave {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionLeave\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-VMHostAuthentication -MockWith { return $null }.GetNewClosure() -ParameterFilter { $VMHostAuthentication -eq $script:vmHostAuthenticationInfoWithDomain -and $LeaveDomain -and $Force -and !$Confirm } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileRetrievingTheVMHostAuthenticationInfo {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsJoinAndTheVMHostIsNotIncludedInTheSpecifiedDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionJoin\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithoutDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsJoinAndTheVMHostIsIncludedInTheSpecifiedDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionJoin\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsLeaveAndTheVMHostIsNotExcludedFromTheSpecifiedDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionLeave\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenDomainActionIsLeaveAndTheVMHostIsExcludedFromTheSpecifiedDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationProperties.DomainAction = $script:constants.DomainActionLeave\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithoutDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenTheVMHostIsIncludedInTheSpecifiedDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n\nfunction New-MocksWhenTheVMHostIsExcludedFromTheSpecifiedDomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostAuthenticationProperties = New-VMHostAuthenticationProperties\n\n    $vmHostAuthenticationInfoMock = $script:vmHostAuthenticationInfoWithoutDomain\n\n    Mock -CommandName Get-VMHostAuthentication -MockWith { return $vmHostAuthenticationInfoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostAuthenticationProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostCacheMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostCacheProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksForVMHostCache {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $vmHostCacheConfigurationManagerMock = $script:vmHostCacheConfigurationManager\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $vmHostCacheConfigurationManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.CacheConfigurationManager } -Verifiable\n}\n\nfunction New-MocksWhenPassedSwapSizeIsNegative {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.NegativeSwapSize\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksWhenPassedSwapSizeIsBiggerThanDatastoreFreeSpace {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.OverflowingSwapSize\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksWhenUpdateCacheConfigurationResultsInError {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.SwapSizeGB\n\n    $datastoreMock = $script:datastore\n    $hostCacheConfigurationResultMock = $script:hostCacheConfigurationResult\n    $hostCacheConfigurationTaskMock = $script:hostCacheConfigurationErrorTask\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n    Mock -CommandName Update-HostCacheConfiguration -MockWith { return $hostCacheConfigurationResultMock }.GetNewClosure() -ParameterFilter { $VMHostCacheConfigurationManager -eq $script:vmHostCacheConfigurationManager -and $Spec -eq $script:hostCacheConfigurationSpec } -Verifiable\n    Mock -CommandName Get-Task -MockWith { return $hostCacheConfigurationTaskMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:hostCacheConfigurationResult } -Verifiable\n    Mock -CommandName Wait-Task -MockWith { throw }.GetNewClosure() -ParameterFilter { $Task -eq $script:hostCacheConfigurationErrorTask } -Verifiable\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksWhenUpdateCacheConfigurationResultsInSuccess {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.SwapSizeGB\n\n    $datastoreMock = $script:datastore\n    $hostCacheConfigurationResultMock = $script:hostCacheConfigurationResult\n    $hostCacheConfigurationTaskMock = $script:hostCacheConfigurationSuccessTask\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n    Mock -CommandName Update-HostCacheConfiguration -MockWith { return $hostCacheConfigurationResultMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Task -MockWith { return $hostCacheConfigurationTaskMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Wait-Task -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksWhenSwapSizeIsNotEqualToCurrentSwapSize {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.SwapSizeGB * 2\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksWhenSwapSizeIsEqualToCurrentSwapSize {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.SwapSizeGB\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n\n    $vmHostCacheProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostCacheProperties = New-VMHostCacheProperties\n    $vmHostCacheProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostCacheProperties.SwapSizeGB = $script:constants.SwapSizeGB\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $RelatedObject -eq $script:vmHost } -Verifiable\n\n    $vmHostCacheProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostConfigurationMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostConfigurationProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n        State = $script:constants.VMHostMaintenanceState\n        Evacuate = $script:constants.EvacuateVMs\n        VsanDataMigrationMode = $script:constants.VsanDataMigrationMode\n        LicenseKey = $script:constants.VMHostLicenseKeyTwo\n        TimeZoneName = $script:constants.VMHostUTCTimeZoneName\n        VMSwapfileDatastoreName = $script:constants.VMSwapfileDatastoreTwoName\n        VMSwapfilePolicy = $script:constants.WithVMDatastoreVMSwapfilePolicy\n    }\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksForVMHostConfiguration {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedAndErrorOccursWhileRetrievingTheTimeZone {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostMock = $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostAvailableTimeZone -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostUTCTimeZoneName -and $VMHost -eq $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedAndErrorOccursWhileRetrievingTheVMSwapFileDatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostMock = $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify\n    $vmHostTimeZoneMock = $script:vmHostUTCTimeZone\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostAvailableTimeZone -MockWith { return $vmHostTimeZoneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostUTCTimeZoneName -and $VMHost -eq $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-Datastore -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMSwapfileDatastoreTwoName -and $VMHost -eq $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedAndDrsRecommendationShouldBeGeneratedAndApplied {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostConfigurationProperties.HostProfileName = $script:constants.HostProfileName\n\n    $vmHostMock = $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify\n    $vmHostTimeZoneMock = $script:vmHostUTCTimeZone\n    $datastoreMock = $script:vmSwapfileDatastoreTwo\n    $hostProfileMock = $script:hostProfile\n    $enterMaintenanceModeTaskMock = $script:enterMaintenanceModeSuccessTask\n    $clusterDrsRecommendationMock = $script:clusterDrsRecommendation\n    $applyDrsRecommendationTaskMock = $script:applyDrsRecommendationSuccessTask\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostAvailableTimeZone -MockWith { return $vmHostTimeZoneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostUTCTimeZoneName -and $VMHost -eq $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMSwapfileDatastoreTwoName -and $VMHost -eq $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-VMHostProfile -MockWith { return $hostProfileMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.HostProfileName } -Verifiable\n    Mock -CommandName Set-VMHost -MockWith { return $enterMaintenanceModeTaskMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Start-Sleep -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Seconds -eq 5 } -Verifiable\n    Mock -CommandName Get-DrsRecommendation -MockWith { return $clusterDrsRecommendationMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Cluster -eq $script:clusterWithManualDrsAutomationLevel -and $Refresh } -Verifiable\n    Mock -CommandName Apply-DrsRecommendation -MockWith { return $applyDrsRecommendationTaskMock }.GetNewClosure() -ParameterFilter { $DrsRecommendation -eq $script:clusterDrsRecommendation -and $RunAsync -and !$Confirm } -Verifiable\n    Mock -CommandName Wait-Task -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Task -eq $script:applyDrsRecommendationSuccessTask } -Verifiable\n    Mock -CommandName Wait-Task -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Task -eq $script:enterMaintenanceModeSuccessTask } -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedWithoutGeneratingADrsRecommendation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostConfigurationProperties.HostProfileName = $script:constants.HostProfileName\n\n    $vmHostMock = $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify\n    $vmHostTimeZoneMock = $script:vmHostUTCTimeZone\n    $datastoreMock = $script:vmSwapfileDatastoreTwo\n    $hostProfileMock = $script:hostProfile\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostAvailableTimeZone -MockWith { return $vmHostTimeZoneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostUTCTimeZoneName -and $VMHost -eq $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMSwapfileDatastoreTwoName -and $VMHost -eq $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-VMHostProfile -MockWith { return $hostProfileMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.HostProfileName } -Verifiable\n    Mock -CommandName Set-VMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheCryptoKeyOfTheVMHostNeedsToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostConfigurationProperties.HostProfileName = $script:constants.HostProfileName\n    $vmHostConfigurationProperties.KmsClusterName = $script:constants.KmsClusterName\n\n    $vmHostMock = $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify\n    $vmHostTimeZoneMock = $script:vmHostUTCTimeZone\n    $datastoreMock = $script:vmSwapfileDatastoreTwo\n    $hostProfileMock = $script:hostProfile\n    $kmsClusterMock = $script:kmsCluster\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostAvailableTimeZone -MockWith { return $vmHostTimeZoneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostUTCTimeZoneName -and $VMHost -eq $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMSwapfileDatastoreTwoName -and $VMHost -eq $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify } -Verifiable\n    Mock -CommandName Get-VMHostProfile -MockWith { return $hostProfileMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.HostProfileName } -Verifiable\n    Mock -CommandName Get-KmsCluster -MockWith { return $kmsClusterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.KmsClusterName } -Verifiable\n    Mock -CommandName Set-VMHost -MockWith { return $null }.GetNewClosure() -ParameterFilter { $KmsCluster -eq $script:kmsCluster } -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostConfigurationDoesNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostMock = $script:vmHostWithoutSettingsToModify\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostConfigurationNeedsToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostMock = $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n\n    $vmHostConfigurationProperties\n}\n\nfunction New-MocksWhenTheHostProfileAndKmsClusterNamesAreNotSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostConfigurationProperties = New-VMHostConfigurationProperties\n\n    $vmHostMock = $script:vmHostWithoutSettingsToModify\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostProfile -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Entity -eq $script:vmHostWithoutSettingsToModify } -Verifiable\n\n    $vmHostConfigurationProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostDCUIKeyboardMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostDCUIKeyboardProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostDCUIKeyboardProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostDCUIKeyboardProperties\n}\n\nfunction New-MocksInSetForVMHostDCUIKeyboard {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostDCUIKeyboardProperties = New-VMHostDCUIKeyboardProperties\n\n    $vmHostDCUIKeyboardProperties.Layout = $script:constansts.DCUIKeyboardUSDefaultLayout\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostDCUIKeyboardProperties\n}\n\nfunction New-MocksForVMHostDCUIKeyboard {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostDCUIKeyboardProperties = New-VMHostDCUIKeyboardProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliGetMethodMock = $script:constants.DCUIKeyboardUSDefaultLayout\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostDCUIKeyboardProperties\n}\n\nfunction New-MocksWhenTheVMHostDCUIKeyboardLayoutDoesNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostDCUIKeyboardProperties = New-VMHostDCUIKeyboardProperties\n\n    $vmHostDCUIKeyboardProperties.Layout = $script:constants.DCUIKeyboardUSDefaultLayout\n\n    $vmHostDCUIKeyboardProperties\n}\n\nfunction New-MocksWhenTheVMHostDCUIKeyboardLayoutNeedsToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostDCUIKeyboardProperties = New-VMHostDCUIKeyboardProperties\n\n    $vmHostDCUIKeyboardProperties.Layout = $script:constants.DCUIKeyboardUnitedKingdomLayout\n\n    $vmHostDCUIKeyboardProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostFirewallRulesetMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostFirewallRulesetProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.FirewallRulesetName\n    }\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksForVMHostFirewallRuleset {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $vmHostFirewallRulesetMock = $script:vmHostFirewallRuleset\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostFirewallException -MockWith { return $vmHostFirewallRulesetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.FirewallRulesetName -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenErrorOccursWhileModifyingTheStateOfTheVMHostFirewallRuleset {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.Enabled = !$script:constants.FirewallRulesetEnabled\n\n    Mock -CommandName Set-VMHostFirewallException -MockWith { throw }.GetNewClosure() -ParameterFilter { $Exception -eq $script:vmHostFirewallRuleset -and $Enabled -eq !$script:constants.FirewallRulesetEnabled -and !$Confirm } -Verifiable\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileModifyingTheStateOfTheVMHostFirewallRuleset {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.Enabled = !$script:constants.FirewallRulesetEnabled\n\n    Mock -CommandName Set-VMHostFirewallException -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenErrorOccursWhileModifyingTheAllowedIPAddressesListOfTheVMHostFirewallRuleset {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.AllIP = !$script:constants.FirewallRulesetAllIP\n    $vmHostFirewallRulesetProperties.IPAddresses = $script:constants.FirewallRulesetIPAddressesTwo + $script:constants.FirewallRulesetIPNetworksTwo\n\n    $vmHostFirewallSystemMock = $script:vmHostFirewallSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostFirewallSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.FirewallSystem } -Verifiable\n    Mock -CommandName Update-VMHostFirewallRuleset -MockWith { throw }.GetNewClosure() -ParameterFilter { $VMHostFirewallSystem -eq $script:vmHostFirewallSystem -and $VMHostFirewallRulesetId -eq $script:vmHostFirewallRuleset.ExtensionData.Key -and $VMHostFirewallRulesetSpec -eq $script:vmHostFirewallRulesetSpec } -Verifiable\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileModifyingTheAllowedIPAddressesListOfTheVMHostFirewallRuleset {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.AllIP = !$script:constants.FirewallRulesetAllIP\n    $vmHostFirewallRulesetProperties.IPAddresses = $script:constants.FirewallRulesetIPAddressesTwo + $script:constants.FirewallRulesetIPNetworksTwo\n\n    $vmHostFirewallSystemMock = $script:vmHostFirewallSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostFirewallSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.FirewallSystem } -Verifiable\n    Mock -CommandName Update-VMHostFirewallRuleset -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenTheStateOfTheVMHostFirewallRulesetDoesNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.Enabled = $script:constants.FirewallRulesetEnabled\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenTheStateOfTheVMHostFirewallRulesetNeedsToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.Enabled = !$script:constants.FirewallRulesetEnabled\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenTheAllowedIPAddressesListOfTheVMHostFirewallRulesetDoesNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.AllIP = $script:constants.FirewallRulesetAllIP\n    $vmHostFirewallRulesetProperties.IPAddresses = $script:constants.FirewallRulesetIPAddressesOne + $script:constants.FirewallRulesetIPNetworksOne\n\n    $vmHostFirewallRulesetProperties\n}\n\nfunction New-MocksWhenTheAllowedIPAddressesListOfTheVMHostFirewallRulesetNeedsToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostFirewallRulesetProperties = New-VMHostFirewallRulesetProperties\n\n    $vmHostFirewallRulesetProperties.AllIP = !$script:constants.FirewallRulesetAllIP\n    $vmHostFirewallRulesetProperties.IPAddresses = $script:constants.FirewallRulesetIPAddressesTwo + $script:constants.FirewallRulesetIPNetworksTwo\n\n    $vmHostFirewallRulesetProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostGraphicsDeviceMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostGraphicsDeviceProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsDeviceProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostGraphicsDeviceProperties\n}\n\nfunction New-MocksForVMHostGraphicsDevice {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $vmHostGraphicsManagerMock = $script:vmHostGraphicsManager\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $vmHostGraphicsManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.GraphicsManager } -Verifiable\n}\n\nfunction New-MocksInSet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsDeviceProperties = New-VMHostGraphicsDeviceProperties\n    $vmHostGraphicsDeviceProperties.Id = $script:constants.GraphicsDeviceId\n    $vmHostGraphicsDeviceProperties.GraphicsType = $script:constants.DefaultGraphicsType\n\n    Mock -CommandName Update-GraphicsConfig -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Restart-VMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Start-Sleep -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostGraphicsDeviceProperties\n}\n\nfunction New-MocksWhenGraphicsDeviceIsNotExisting {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsDeviceProperties = New-VMHostGraphicsDeviceProperties\n    $vmHostGraphicsDeviceProperties.Id = $script:constants.GraphicsDeviceId + $script:constants.GraphicsDeviceId\n    $vmHostGraphicsDeviceProperties.GraphicsType = $script:constants.DefaultGraphicsType\n\n    $vmHostGraphicsDeviceProperties\n}\n\nfunction New-MocksWhenGraphicsDeviceIsExisting {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsDeviceProperties = New-VMHostGraphicsDeviceProperties\n    $vmHostGraphicsDeviceProperties.Id = $script:constants.GraphicsDeviceId\n    $vmHostGraphicsDeviceProperties.GraphicsType = $script:constants.DefaultGraphicsType\n\n    $vmHostGraphicsDeviceProperties\n}\n\nfunction New-MocksWhenGraphicsDeviceTypeValueIsNotEqualToGraphicsConfigurationGraphicsDeviceTypeValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsDeviceProperties = New-VMHostGraphicsDeviceProperties\n    $vmHostGraphicsDeviceProperties.Id = $script:constants.GraphicsDeviceId\n    $vmHostGraphicsDeviceProperties.GraphicsType = 'SharedDirect'\n\n    $vmHostGraphicsDeviceProperties\n}\n\nfunction New-MocksWhenGraphicsDeviceTypeValueIsEqualToGraphicsConfigurationGraphicsDeviceTypeValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsDeviceProperties = New-VMHostGraphicsDeviceProperties\n    $vmHostGraphicsDeviceProperties.Id = $script:constants.GraphicsDeviceId\n    $vmHostGraphicsDeviceProperties.GraphicsType = $script:constants.DefaultGraphicsType\n\n    $vmHostGraphicsDeviceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostGraphicsMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostGraphicsProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostGraphicsProperties\n}\n\nfunction New-MocksForVMHostGraphics {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $vmHostGraphicsManagerMock = $script:vmHostGraphicsManager\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $vmHostGraphicsManagerMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.GraphicsManager } -Verifiable\n}\n\nfunction New-MocksInSet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsProperties = New-VMHostGraphicsProperties\n    $vmHostGraphicsProperties.GraphicsType = $script:constants.DefaultGraphicsType\n    $vmHostGraphicsProperties.SharedPassthruAssignmentPolicy = $script:constants.SharedPassthruAssignmentPolicy\n\n    Mock -CommandName Update-GraphicsConfig -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Restart-VMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Start-Sleep -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostGraphicsProperties\n}\n\nfunction New-MocksWhenDefaultGraphicsTypeValueIsNotEqualToGraphicsConfigurationDefaultGraphicsTypeValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsProperties = New-VMHostGraphicsProperties\n    $vmHostGraphicsProperties.GraphicsType = 'SharedDirect'\n\n    $vmHostGraphicsProperties\n}\n\nfunction New-MocksWhenSharedPassthruAssignmentPolicyValueIsNotEqualToGraphicsConfigurationSharedPassthruAssignmentPolicyValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsProperties = New-VMHostGraphicsProperties\n    $vmHostGraphicsProperties.GraphicsType = $script:constants.DefaultGraphicsType\n    $vmHostGraphicsProperties.SharedPassthruAssignmentPolicy = 'Consolidation'\n\n    $vmHostGraphicsProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostGraphicsProperties = New-VMHostGraphicsProperties\n    $vmHostGraphicsProperties.GraphicsType = $script:constants.DefaultGraphicsType\n    $vmHostGraphicsProperties.SharedPassthruAssignmentPolicy = $script:constants.SharedPassthruAssignmentPolicy\n\n    $vmHostGraphicsProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostIPRouteMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostIPRouteProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n        Gateway = $script:constants.Gateway\n        Destination = $script:constants.Destination\n        PrefixLength = $script:constants.PrefixLength\n    }\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksForVMHostIPRoute {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheIPRouteIsNotCreatedAndErrorOccursWhileCreatingTheIPRoute {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName New-VMHostRoute -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $Gateway -eq $script:constants.Gateway -and $Destination -eq $script:constants.Destination -and $PrefixLength -eq $script:constants.PrefixLength -and !$Confirm } -Verifiable\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheIPRouteIsNotCreatedAndNoErrorOccursWhileCreatingTheIPRoute {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName New-VMHostRoute -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheIPRouteIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-VMHostRoute -MockWith { return $null }.GetNewClosure()\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheIPRouteIsNotRemovedAndErrorOccursWhileRemovingTheIPRoute {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Absent'\n\n    $vmHostIPRouteMock = $script:vmHostIPRouteOne\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $vmHostIPRouteMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-VMHostRoute -MockWith { throw }.GetNewClosure() -ParameterFilter { $VMHostRoute -eq $script:vmHostIPRouteOne -and !$Confirm } -Verifiable\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheIPRouteIsNotRemovedAndNoErrorOccursWhileRemovingTheIPRoute {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Absent'\n\n    $vmHostIPRouteMock = $script:vmHostIPRouteOne\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $vmHostIPRouteMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-VMHostRoute -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheIPRouteIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheIPRouteIsAlreadyCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Present'\n\n    $vmHostIPRouteMock = $script:vmHostIPRouteOne\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $vmHostIPRouteMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostIPRouteProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheIPRouteIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIPRouteProperties = New-VMHostIPRouteProperties\n\n    $vmHostIPRouteProperties.Ensure = 'Absent'\n\n    $vmHostIPRouteMock = $script:vmHostIPRouteOne\n\n    Mock -CommandName Get-VMHostRoute -MockWith { return $vmHostIPRouteMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostIPRouteProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostIScsiHbaBaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostIScsiHbaBaseDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n    }\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksForVMHostIScsiHbaBaseDSC {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenErrorOccursWhileRetrievingTheiSCSIHostBusAdapter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    Mock -CommandName Get-VMHostHba -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $Device -eq $script:constants.IScsiHbaDeviceName -and $Type -eq $script:constants.IScsiDeviceType } -Verifiable\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenTheiSCSIHostBusAdapterIsRetrievedSuccessfully {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $iScsiHbaMock = $script:iScsiHba\n\n    Mock -CommandName Get-VMHostHba -MockWith { return $iScsiHbaMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $Device -eq $script:constants.IScsiHbaDeviceName -and $Type -eq $script:constants.IScsiDeviceType } -Verifiable\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterDoNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeRequired\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = $script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.Force = $false\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeProhibited\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = $script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.Force = $false\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenInheritChapAndInheritMutualChapAreNotSpecifiedAndChapTypeIsRequired {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeRequired\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.ChapPassword = $script:constants.ChapPassword\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = $script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapPassword = $script:constants.MutualChapPassword\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenInheritChapAndInheritMutualChapAreNotSpecifiedAndChapTypeIsProhibited {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeProhibited\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.ChapPassword = $script:constants.ChapPassword\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = $script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapPassword = $script:constants.MutualChapPassword\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenInheritChapAndInheritMutualChapAreNotSpecifiedChapTypeIsRequiredAndMutualChapEnabledIsFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeRequired\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.ChapPassword = $script:constants.ChapPassword\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = !$script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapPassword = $script:constants.MutualChapPassword\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenInheritChapAndInheritMutualChapAreBothSpecifiedWithFalseValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeRequired\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.ChapPassword = $script:constants.ChapPassword\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = $script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapPassword = $script:constants.MutualChapPassword\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n\nfunction New-MocksWhenInheritChapAndInheritMutualChapAreBothSpecifiedWithTrueValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaBaseDSCProperties = New-VMHostIScsiHbaBaseDSCProperties\n\n    $vmHostIScsiHbaBaseDSCProperties.ChapType = $script:constants.ChapTypeRequired\n    $vmHostIScsiHbaBaseDSCProperties.ChapName = $script:constants.ChapName\n    $vmHostIScsiHbaBaseDSCProperties.ChapPassword = $script:constants.ChapPassword\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapEnabled = $script:constants.MutualChapEnabled\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapName = $script:constants.MutualChapName\n    $vmHostIScsiHbaBaseDSCProperties.MutualChapPassword = $script:constants.MutualChapPassword\n\n    $vmHostIScsiHbaBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostIScsiHbaMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostIScsiHbaProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.IScsiHbaDeviceName\n        ChapType = $script:constants.ChapTypeProhibited\n        ChapName = $script:constants.ChapName\n        ChapPassword = $script:constants.ChapPassword\n        MutualChapEnabled = $script:constants.MutualChapEnabled\n        MutualChapName = $script:constants.MutualChapName\n        MutualChapPassword = $script:constants.MutualChapPassword\n    }\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksForVMHostIScsiHba {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $iScsiHbaMock = $script:iScsiHba\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostHba -MockWith { return $iScsiHbaMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenErrorOccursWhileConfiguringTheiSCSIHostBusAdapterCHAPSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    Mock -CommandName Set-VMHostHba -MockWith { throw }.GetNewClosure() -ParameterFilter { $IScsiHba -eq $script:iScsiHba -and $ChapType -eq $script:constants.ChapTypeProhibited -and !$Confirm } -Verifiable\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileConfiguringTheiSCSIHostBusAdapterCHAPSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    Mock -CommandName Set-VMHostHba -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksWhenModifyingTheIScsiNameOfTheIScsiHostBusAdapter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    $vmHostIScsiHbaProperties.IScsiName = $script:constants.IScsiName\n\n    Mock -CommandName Set-VMHostHba -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterDoNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    $vmHostIScsiHbaProperties.ChapType = $script:constants.ChapTypeRequired\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksWhenTheIScsiNameOfTheIScsiHostBusAdapterDoesNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    $vmHostIScsiHbaProperties.IScsiName = $script:constants.IScsiName\n    $vmHostIScsiHbaProperties.ChapType = $script:constants.ChapTypeRequired\n\n    $vmHostIScsiHbaProperties\n}\n\nfunction New-MocksWhenTheIScsiNameOfTheIScsiHostBusAdapterNeedsToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaProperties = New-VMHostIScsiHbaProperties\n\n    $vmHostIScsiHbaProperties.IScsiName = $script:constants.IScsiNameTwo\n\n    $vmHostIScsiHbaProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostIScsiHbaTargetMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostIScsiHbaTargetProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Address = $script:constants.IScsiHbaTargetAddress\n        Port = $script:constants.IScsiHbaTargetPort\n        IScsiHbaName = $script:constants.IScsiHbaDeviceName\n        TargetType = $script:constants.IScsiHbaSendTargetType\n        IScsiName = $script:constants.IScsiName\n    }\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksForVMHostIScsiHbaTarget {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $iScsiHbaMock = $script:iScsiHba\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostHba -MockWith { return $iScsiHbaMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsNotCreatedAndErrorOccursWhileCreatingTheiSCSIHostBusAdapterTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName New-IScsiHbaTarget -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Address -eq $script:constants.IScsiHbaTargetAddress -and $Port -eq $script:constants.IScsiHbaTargetPort -and $IScsiHba -eq $script:iScsiHba -and $Type -eq $script:constants.IScsiHbaSendTargetType -and !$Confirm } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsNotCreatedAndNoErrorOccursWhileCreatingTheiSCSIHostBusAdapterSendTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName New-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsNotCreatedAndNoErrorOccursWhileCreatingTheiSCSIHostBusAdapterStaticTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.TargetType = $script:constants.IScsiHbaStaticTargetType\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint } -Verifiable\n    Mock -CommandName New-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndErrorOccursWhileModifyingTheCHAPSettingsOfTheiSCSIHostBusAdapterTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName Set-IScsiHbaTarget -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Target -eq $script:iScsiHbaTarget -and !$Confirm } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndNoErrorOccursWhileModifyingTheCHAPSettingsOfTheiSCSIHostBusAdapterTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName Set-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName Remove-IScsiHbaTarget -MockWith { return $null }.GetNewClosure()\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheiSCSIHostBusAdapterTargetIsNotRemovedAndErrorOccursWhileRemovingTheiSCSIHostBusAdapterTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Absent'\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName Remove-IScsiHbaTarget -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Target -eq $script:iScsiHbaTarget -and !$Confirm } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheiSCSIHostBusAdapterTargetIsNotRemovedAndNoErrorOccursWhileRemovingTheiSCSIHostBusAdapterTarget {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Absent'\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n    Mock -CommandName Remove-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheiSCSIHostBusAdapterTargetIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndCHAPSettingsDoNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndCHAPSettingsNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Present'\n    $vmHostIScsiHbaTargetProperties.InheritChap = !$script:constants.ChapInherited\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaTargetProperties = New-VMHostIScsiHbaTargetProperties\n\n    $vmHostIScsiHbaTargetProperties.Ensure = 'Absent'\n\n    $iScsiHbaTargetMock = $script:iScsiHbaTarget\n\n    Mock -CommandName Get-IScsiHbaTarget -MockWith { return $iScsiHbaTargetMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $IScsiHba -eq $script:iScsiHba -and $IPEndPoint -eq $script:constants.IScsiIPEndPoint -and $Type -eq $script:constants.IScsiHbaSendTargetType } -Verifiable\n\n    $vmHostIScsiHbaTargetProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostNetworkCoreDumpMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostNetworkCoreDumpProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkCoreDumpProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostNetworkCoreDumpProperties\n}\n\nfunction New-MocksInSetForVMHostNetworkCoreDump {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkCoreDumpProperties = New-VMHostNetworkCoreDumpProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    $vmHostNetworkCoreDumpProperties.Enable = $script:constants.NetworkCoreDumpEnabled\n    $vmHostNetworkCoreDumpProperties.InterfaceName = $script:constants.NetworkCoreDumpInterfaceName\n    $vmHostNetworkCoreDumpProperties.ServerIp = $script:constants.NetworkCoreDumpServerIP\n    $vmHostNetworkCoreDumpProperties.ServerPort = $script:constants.NetworkCoreDumpServerPort\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkCoreDumpProperties\n}\n\nfunction New-MocksForVMHostNetworkCoreDump {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkCoreDumpProperties = New-VMHostNetworkCoreDumpProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliGetMethodMock = $script:vmHostNetworkCoreDumpConfiguration\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkCoreDumpProperties\n}\n\nfunction New-MocksWhenTheVMHostNetworkCoreDumpConfigurationShouldBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkCoreDumpProperties = New-VMHostNetworkCoreDumpProperties\n\n    $vmHostNetworkCoreDumpProperties.Enable = !$script:constants.NetworkCoreDumpEnabled\n    $vmHostNetworkCoreDumpProperties.InterfaceName = $script:constants.NetworkCoreDumpInterfaceName\n    $vmHostNetworkCoreDumpProperties.ServerIp = $script:constants.NetworkCoreDumpServerIP\n    $vmHostNetworkCoreDumpProperties.ServerPort = $script:constants.NetworkCoreDumpServerPort\n\n    $vmHostNetworkCoreDumpProperties\n}\n\nfunction New-MocksWhenTheVMHostNetworkCoreDumpConfigurationShouldNotBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkCoreDumpProperties = New-VMHostNetworkCoreDumpProperties\n\n    $vmHostNetworkCoreDumpProperties.Enable = $script:constants.NetworkCoreDumpEnabled\n    $vmHostNetworkCoreDumpProperties.InterfaceName = $script:constants.NetworkCoreDumpInterfaceName\n    $vmHostNetworkCoreDumpProperties.ServerIp = $script:constants.NetworkCoreDumpServerIP\n    $vmHostNetworkCoreDumpProperties.ServerPort = $script:constants.NetworkCoreDumpServerPort\n\n    $vmHostNetworkCoreDumpProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostNicBaseDSCMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostNicBaseDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        PortGroupName = $script:constants.VirtualPortGroupName\n        Ensure = 'Present'\n        IP = $script:constants.VMKernelNetworkAdapterIP\n        SubnetMask = $script:constants.VMKernelNetworkAdapterSubnetMask\n        Mac = $script:constants.VMKernelNetworkAdapterMac\n        AutomaticIPv6 = $script:constants.VMKernelNetworkAdapterAutomaticIPv6\n        IPv6 = @()\n        IPv6ThroughDhcp = $script:constants.VMKernelNetworkAdapterIPv6ThroughDhcp\n        Mtu = $script:constants.VMKernelNetworkAdapterMtu\n        ManagementTrafficEnabled = $script:constants.VMKernelNetworkAdapterManagementTrafficEnabled\n        FaultToleranceLoggingEnabled = $script:constants.VMKernelNetworkAdapterFaultToleranceLoggingEnabled\n        VMotionEnabled = $script:constants.VMKernelNetworkAdapterVMotionEnabled\n        VsanTrafficEnabled = $script:constants.VMKernelNetworkAdapterVsanTrafficEnabled\n    }\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksForVMHostNicBaseDSC {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenVMKernelNetworkAdapterExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenVMKernelNetworkAdapterDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenVMKernelNetworkAdapterSettingsMatch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenVMKernelNetworkAdapterSettingsDoesNotMatch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterBaseDSCProperties.Mac = $vmHostNetworkAdapterBaseDSCProperties.Mac + $vmHostNetworkAdapterBaseDSCProperties.Mac\n    $vmHostNetworkAdapterBaseDSCProperties.Dhcp = $false\n    $vmHostNetworkAdapterBaseDSCProperties.ManagementTrafficEnabled = $false\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenVMKernelNetworkAdapterSettingsResultsInAnError {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName New-VMHostNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenAddingVMKernelNetworkAdapter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName New-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenUpdatingVMKernelNetworkAdapterSettingsResultsInAnError {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenUpdatingVMKernelNetworkAdapterWithoutDhcpAndIPv6Enabled {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterBaseDSCProperties.Mac = $vmHostNetworkAdapterBaseDSCProperties.Mac + $vmHostNetworkAdapterBaseDSCProperties.Mac\n    $vmHostNetworkAdapterBaseDSCProperties.ManagementTrafficEnabled = $false\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenUpdatingVMKernelNetworkAdapterWithDhcpAndIPv6Enabled {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterBaseDSCProperties.Dhcp = !($script:constants.VMKernelNetworkAdapterDhcp)\n    $vmHostNetworkAdapterBaseDSCProperties.IPv6Enabled = !($script:constants.VMKernelNetworkAdapterIPv6Enabled)\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenRemovingVMKernelNetworkAdapterResultsInAnError {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Remove-VMHostNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n\nfunction New-MocksWhenRemovingVMKernelNetworkAdapter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostNetworkAdapterBaseDSCProperties = New-VMHostNicBaseDSCProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Remove-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostNetworkAdapterBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostPciPassthroughMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostPciPassthroughProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostPciPassthroughProperties\n}\n\nfunction New-MocksForVMHostPciPassthrough {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenPCIDeviceIsNotExisting {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = New-VMHostPciPassthroughProperties\n    $vmHostPciPassthroughProperties.Id = $script:constants.PciDeviceId + $script:constants.PciDeviceId\n    $vmHostPciPassthroughProperties.Enabled = $script:constants.PciDeviceEnabled\n\n    $vmHostPciPassthruSystemMock = $script:vmHostPciPassthruSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostPciPassthruSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem } -Verifiable\n\n    $vmHostPciPassthroughProperties\n}\n\nfunction New-MocksWhenPCIDeviceIsExistingButIsNotPassthroughCapable {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = New-VMHostPciPassthroughProperties\n    $vmHostPciPassthroughProperties.Id = $script:constants.PciDeviceId + '.0'\n    $vmHostPciPassthroughProperties.Enabled = $script:constants.PciDeviceEnabled\n\n    $vmHostPciPassthruSystemMock = $script:vmHostPciPassthruSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostPciPassthruSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem } -Verifiable\n\n    $vmHostPciPassthroughProperties\n}\n\nfunction New-MocksWhenPCIDeviceIsExisting {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = New-VMHostPciPassthroughProperties\n    $vmHostPciPassthroughProperties.Id = $script:constants.PciDeviceId\n    $vmHostPciPassthroughProperties.Enabled = $script:constants.PciDeviceEnabled\n\n    $vmHostPciPassthruSystemMock = $script:vmHostPciPassthruSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostPciPassthruSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem } -Verifiable\n    Mock -CommandName Update-PassthruConfig -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Restart-VMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Start-Sleep -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPciPassthroughProperties\n}\n\nfunction New-MocksWhenEnabledValueIsNotEqualToPCIDevicePassthroughEnabledValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = New-VMHostPciPassthroughProperties\n    $vmHostPciPassthroughProperties.Id = $script:constants.PciDeviceId\n    $vmHostPciPassthroughProperties.Enabled = !$script:constants.PciDeviceEnabled\n\n    $vmHostPciPassthruSystemMock = $script:vmHostPciPassthruSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostPciPassthruSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem } -Verifiable\n\n    $vmHostPciPassthroughProperties\n}\n\nfunction New-MocksWhenEnabledValueIsEqualToPCIDevicePassthroughEnabledValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = New-VMHostPciPassthroughProperties\n    $vmHostPciPassthroughProperties.Id = $script:constants.PciDeviceId\n    $vmHostPciPassthroughProperties.Enabled = $script:constants.PciDeviceEnabled\n\n    $vmHostPciPassthruSystemMock = $script:vmHostPciPassthruSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostPciPassthruSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem } -Verifiable\n\n    $vmHostPciPassthroughProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPciPassthroughProperties = New-VMHostPciPassthroughProperties\n    $vmHostPciPassthroughProperties.Id = $script:constants.PciDeviceId\n    $vmHostPciPassthroughProperties.Enabled = $script:constants.PciDeviceEnabled\n\n    $vmHostPciPassthruSystemMock = $script:vmHostPciPassthruSystem\n\n    Mock -CommandName Get-View -MockWith { return $vmHostPciPassthruSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PciPassthruSystem } -Verifiable\n\n    $vmHostPciPassthroughProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostPermissionMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostPermissionProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n    }\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksForVMHostPermission {\n    [CmdletBinding()]\n\n    $viServerMock = $script:esxiServer\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsADatacenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsAVMHost {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.VMHostName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'VMHost'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $entityMock = $script:vmHost\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VMHost -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:vmHost -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsADatastore {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatastoreName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datastore'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $entityMock = $script:datastoreEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-Datastore -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.DatastoreName } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datastoreEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsAResourcePool {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.ResourcePoolName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'ResourcePool'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $vmHostMock = $script:vmHost\n    $rootResourcePoolMock = $script:rootResourcePool\n    $entityMock = $script:resourcePoolEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-ResourcePool -MockWith { return $rootResourcePoolMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-ResourcePool -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.ResourcePoolName -and $Location -eq $script:rootResourcePool } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:resourcePoolEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedTheEntityIsAVMAndEmptyEntityLocationIsPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.VMName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'VM'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $vmHostMock = $script:vmHost\n    $rootResourcePoolMock = $script:rootResourcePool\n    $entityMock = $script:vmEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-ResourcePool -MockWith { return $rootResourcePoolMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VM -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.VMName -and $Location -eq $script:rootResourcePool } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:vmEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedTheEntityIsAVMAndEntityLocationIsOneResourcePool {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.VMName\n    $vmHostPermissionProperties.EntityLocation = $script:constants.ResourcePoolName\n    $vmHostPermissionProperties.EntityType = 'VM'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $vmHostMock = $script:vmHost\n    $rootResourcePoolMock = $script:rootResourcePool\n    $resourcePoolMock = $script:resourcePoolEntity\n    $entityMock = $script:vmEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-ResourcePool -MockWith { return $rootResourcePoolMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-ResourcePool -MockWith { return $resourcePoolMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.ResourcePoolName -and $Location -eq $script:rootResourcePool } -Verifiable\n    Mock -CommandName Get-VM -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.VMName -and $Location -eq $script:resourcePoolEntity } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:vmEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedTheEntityIsAVMAndEntityLocationIsOneResourcePoolAndOneVApp {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.VMName\n    $vmHostPermissionProperties.EntityLocation = \"$($script:constants.ResourcePoolName)/$($script:constants.VAppName)\"\n    $vmHostPermissionProperties.EntityType = 'VM'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $vmHostMock = $script:vmHost\n    $rootResourcePoolMock = $script:rootResourcePool\n    $vAppMock = $script:vAppEntity\n    $vAppViewBaseObjectMock = $script:vAppViewBaseObject\n    $resourcePoolViewBaseObjectMock = $script:resourcePoolViewBaseObject\n    $entityMock = $script:vmEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-ResourcePool -MockWith { return $rootResourcePoolMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $vAppMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.VAppName -and $Location -eq $script:rootResourcePool } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $vAppViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:vAppEntity.Id } -Verifiable\n    Mock -CommandName Get-View -MockWith { return $resourcePoolViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:vAppViewBaseObject.Parent } -Verifiable\n    Mock -CommandName Get-VM -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.VMName -and $Location -eq $script:vAppEntity } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:vmEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName New-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsPresentAndThePermissionIsAlreadyCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName + $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $roleMock = $script:vmHostRole\n    $permissionMock = $script:vmHostPermission\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIRole -MockWith { return $roleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq ($script:constants.RoleName + $script:constants.RoleName) } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $permissionMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName Set-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndThePermissionIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Absent'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName Remove-VIPermission -MockWith { return $null }.GetNewClosure()\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndThePermissionIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Absent'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $permissionMock = $script:vmHostPermission\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $permissionMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n    Mock -CommandName Remove-VIPermission -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenThePrincipalIsPartOfADomain {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.DomainName + '\\' + $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndThePermissionIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndThePermissionIsAlreadyCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $permissionMock = $script:vmHostPermission\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $permissionMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsAlreadyCreatedAndTheDesiredRoleAndPropagateBehaviourAreDifferentFromTheCurrentRoleAndPropagateBehaviour {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName + $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = !$script:constants.PropagatePermission\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $permissionMock = $script:vmHostPermission\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $permissionMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentThePermissionIsAlreadyCreatedAndTheDesiredRoleAndPropagateBehaviourAreTheSameAsTheCurrentRoleAndPropagateBehaviour {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Present'\n    $vmHostPermissionProperties.Propagate = $script:constants.PropagatePermission\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $permissionMock = $script:vmHostPermission\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $permissionMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndThePermissionIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Absent'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n\n    $vmHostPermissionProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndThePermissionIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPermissionProperties = New-VMHostPermissionProperties\n\n    $vmHostPermissionProperties.EntityName = $script:constants.DatacenterName\n    $vmHostPermissionProperties.EntityLocation = [string]::Empty\n    $vmHostPermissionProperties.EntityType = 'Datacenter'\n    $vmHostPermissionProperties.PrincipalName = $script:constants.PrincipalName\n    $vmHostPermissionProperties.RoleName = $script:constants.RoleName\n    $vmHostPermissionProperties.Ensure = 'Absent'\n\n    $entityMock = $script:datacenterEntity\n    $principalMock = $script:principal\n    $permissionMock = $script:vmHostPermission\n\n    Mock -CommandName Get-Datacenter -MockWith { return $entityMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer } -Verifiable\n    Mock -CommandName Get-VIAccount -MockWith { return $principalMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrincipalName } -Verifiable\n    Mock -CommandName Get-VIPermission -MockWith { return $permissionMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Entity -eq $script:datacenterEntity -and $Principal -eq $script:principal } -Verifiable\n\n    $vmHostPermissionProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostPhysicalNicMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostPhysicalNicProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.PhysicalNetworkAdapterName\n    }\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksForVMHostPhysicalNic {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $physicalNetworkAdapterMock = $script:physicalNetworkAdapter\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PhysicalNetworkAdapterName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n}\n\nfunction New-MocksWhenAutoNegotiateIsNotPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.FullDuplex\n    $vmHostPhysicalNicProperties.BitRatePerSecMb = $script:constants.BitRatePerSecMb\n\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksWhenAutoNegotiateIsSetToFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.FullDuplex\n    $vmHostPhysicalNicProperties.BitRatePerSecMb = $script:constants.BitRatePerSecMb\n    $vmHostPhysicalNicProperties.AutoNegotiate = !$script:constants.AutoNegotiate\n\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksWhenAutoNegotiateIsSetToTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.FullDuplex\n    $vmHostPhysicalNicProperties.BitRatePerSecMb = $script:constants.BitRatePerSecMb\n    $vmHostPhysicalNicProperties.AutoNegotiate = $script:constants.AutoNegotiate\n\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksWhenThePhysicalNetworkAdapterIsWithFullDuplex {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.HalfDuplex\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksWhenThePhysicalNetworkAdapterIsWithHalfDuplex {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.FullDuplex\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksInTestWhenAutoNegotiateIsSetToFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.FullDuplex\n    $vmHostPhysicalNicProperties.BitRatePerSecMb = $script:constants.BitRatePerSecMb\n    $vmHostPhysicalNicProperties.AutoNegotiate = !$script:constants.AutoNegotiate\n\n    $vmHostPhysicalNicProperties\n}\n\nfunction New-MocksInTestWhenAutoNegotiateIsSetToTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPhysicalNicProperties = New-VMHostPhysicalNicProperties\n\n    $vmHostPhysicalNicProperties.Duplex = $script:constants.FullDuplex\n    $vmHostPhysicalNicProperties.BitRatePerSecMb = $script:constants.BitRatePerSecMb\n    $vmHostPhysicalNicProperties.AutoNegotiate = $script:constants.AutoNegotiate\n\n    $vmHostPhysicalNicProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostPowerPolicyMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostPowerPolicyProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPowerPolicyProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostPowerPolicyProperties\n}\n\nfunction New-MocksForVMHostPowerPolicy {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenPowerPolicyIsBalancedAndNoServerErrors {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPowerPolicyProperties = New-VMHostPowerPolicyProperties\n    $vmHostPowerPolicyProperties.PowerPolicy = 'Balanced'\n\n    $powerSystemMock = $script:vmHostPowerSystem\n\n    Mock -CommandName Get-View -MockWith { return $powerSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PowerSystem } -Verifiable\n    Mock -CommandName Update-PowerPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostPowerPolicyProperties\n}\n\nfunction New-MocksWhenPowerPolicyIsHighPerformanceAndPowerSystemServerError {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPowerPolicyProperties = New-VMHostPowerPolicyProperties\n    $vmHostPowerPolicyProperties.PowerPolicy = 'HighPerformance'\n\n    Mock -CommandName Get-View -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PowerSystem } -Verifiable\n\n    $vmHostPowerPolicyProperties\n}\n\nfunction New-MocksWhenPowerPolicyIsCustomAndUpdatePowerPolicyServerError {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPowerPolicyProperties = New-VMHostPowerPolicyProperties\n    $vmHostPowerPolicyProperties.PowerPolicy = 'Custom'\n\n    $powerSystemMock = $script:vmHostPowerSystem\n\n    Mock -CommandName Get-View -MockWith { return $powerSystemMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:vmHost.ExtensionData.ConfigManager.PowerSystem } -Verifiable\n    Mock -CommandName Update-PowerPolicy -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostPowerPolicyProperties\n}\n\nfunction New-MocksWhenDesiredPowerPolicyIsNotEqualToCurrentPowerPolicy {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPowerPolicyProperties = New-VMHostPowerPolicyProperties\n    $vmHostPowerPolicyProperties.PowerPolicy = 'Custom'\n\n    $vmHostPowerPolicyProperties\n}\n\nfunction New-MocksWhenDesiredPowerPolicyIsEqualToCurrentPowerPolicy {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostPowerPolicyProperties = New-VMHostPowerPolicyProperties\n    $vmHostPowerPolicyProperties.PowerPolicy = 'Balanced'\n\n    $vmHostPowerPolicyProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostRoleMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostRoleProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.RoleName\n    }\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksForVMHostRole {\n    [CmdletBinding()]\n\n    $viServerMock = $script:esxiServer\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheRoleIsNotCreatedAndThereAreNoPassedPrivileges {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName New-VIRole -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheRoleIsNotCreatedAndThereArePassedPrivileges {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n    $vmHostRoleProperties.PrivilegeIds = $script:constants.PrivilegeIds\n\n    $anonymousPrivilegeMock = $script:anonymousPrivilege\n    $viewPrivilegeMock = $script:viewPrivilege\n    $readPrivilegeMock = $script:readPrivilege\n\n    Mock -CommandName Get-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $anonymousPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeIds[0] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $viewPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeIds[1] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $readPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeIds[2] } -Verifiable\n    Mock -CommandName New-VIRole -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsPresentTheRoleIsAlreadyCreatedAndTheDesiredPrivilegeListIsDifferentFromTheCurrentPrivilegeList {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n    $vmHostRoleProperties.PrivilegeIds = $script:constants.PrivilegeToAddIds\n\n    $vmHostRoleMock = $script:vmHostRole\n    $anonymousPrivilegeMock = $script:anonymousPrivilege\n    $viewPrivilegeMock = $script:viewPrivilege\n    $createPrivilegeMock = $script:createPrivilege\n    $readPrivilegeMock = $script:readPrivilege\n\n    Mock -CommandName Get-VIRole -MockWith { return $vmHostRoleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $anonymousPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeToAddIds[0] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $viewPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeToAddIds[1] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $createPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeToAddIds[2] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $readPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:vmHostRole.PrivilegeList[2] } -Verifiable\n    Mock -CommandName Set-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Role -eq $script:vmHostRole -and !$Confirm } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheRoleIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Remove-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Role -eq $script:vmHostRole -and $Force -and !$Confirm }\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheRoleIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Absent'\n\n    $vmHostRoleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VIRole -MockWith { return $vmHostRoleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Remove-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Role -eq $script:vmHostRole -and $Force -and !$Confirm } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheRoleIsAlreadyCreatedAndTheDesiredPrivilegeListIsDifferentFromTheCurrentPrivilegeList {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n    $vmHostRoleProperties.PrivilegeIds = $script:constants.PrivilegeToAddIds\n\n    $vmHostRoleMock = $script:vmHostRole\n    $anonymousPrivilegeMock = $script:anonymousPrivilege\n    $viewPrivilegeMock = $script:viewPrivilege\n    $createPrivilegeMock = $script:createPrivilege\n\n    Mock -CommandName Get-VIRole -MockWith { return $vmHostRoleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $anonymousPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeToAddIds[0] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $viewPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeToAddIds[1] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $createPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeToAddIds[2] } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheRoleIsAlreadyCreatedAndTheDesiredPrivilegeListIsTheSameAsTheCurrentPrivilegeList {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n    $vmHostRoleProperties.PrivilegeIds = $script:constants.PrivilegeIds\n\n    $vmHostRoleMock = $script:vmHostRole\n    $anonymousPrivilegeMock = $script:anonymousPrivilege\n    $viewPrivilegeMock = $script:viewPrivilege\n    $readPrivilegeMock = $script:readPrivilege\n\n    Mock -CommandName Get-VIRole -MockWith { return $vmHostRoleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $anonymousPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeIds[0] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $viewPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeIds[1] } -Verifiable\n    Mock -CommandName Get-VIPrivilege -MockWith { return $readPrivilegeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Id -eq $script:constants.PrivilegeIds[2] } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheRoleIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n    $vmHostRoleProperties.PrivilegeIds = $script:constants.PrivilegeToAddIds\n\n    Mock -CommandName Get-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheRoleIsAlreadyCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Present'\n\n    $vmHostRoleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VIRole -MockWith { return $vmHostRoleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheRoleIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Absent'\n    $vmHostRoleProperties.PrivilegeIds = $script:constants.PrivilegeToAddIds\n\n    Mock -CommandName Get-VIRole -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n\n    $vmHostRoleProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheRoleIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostRoleProperties = New-VMHostRoleProperties\n\n    $vmHostRoleProperties.Ensure = 'Absent'\n\n    $vmHostRoleMock = $script:vmHostRole\n\n    Mock -CommandName Get-VIRole -MockWith { return $vmHostRoleMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:esxiServer -and $Name -eq $script:constants.RoleName } -Verifiable\n\n    $vmHostRoleProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostSNMPAgentMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostSNMPAgentProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSNMPAgentProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostSNMPAgentProperties\n}\n\nfunction New-MocksInSetForVMHostSNMPAgent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSNMPAgentProperties = New-VMHostSNMPAgentProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostSNMPAgentProperties\n}\n\nfunction New-MocksForVMHostSNMPAgent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSNMPAgentProperties = New-VMHostSNMPAgentProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliGetMethodMock = $script:vmHostSNMPAgent\n\n    $vmHostSNMPAgentProperties.Authentication = $script:constants.SNMPAgentAuthenticationProtocol\n    $vmHostSNMPAgentProperties.Communities = $script:constants.SNMPAgentCommunities\n    $vmHostSNMPAgentProperties.Enable = $script:constants.EnableSNMPAgent\n    $vmHostSNMPAgentProperties.EngineId = $script:constants.SNMPAgentEngineId\n    $vmHostSNMPAgentProperties.Hwsrc = $script:constants.SNMPAgentHwsrc\n    $vmHostSNMPAgentProperties.LargeStorage = $script:constants.SNMPAgentLargeStorage\n    $vmHostSNMPAgentProperties.LogLevel = $script:constants.SNMPAgentLogLevel\n    $vmHostSNMPAgentProperties.NoTraps = $script:constants.SNMPAgentNoTraps\n    $vmHostSNMPAgentProperties.Port = $script:constants.SNMPAgentPort\n    $vmHostSNMPAgentProperties.Privacy = $script:constants.SNMPAgentPrivacyProtocol\n    $vmHostSNMPAgentProperties.RemoteUsers = $script:constants.SNMPAgentRemoteUsers\n    $vmHostSNMPAgentProperties.SysContact = $script:constants.SNMPAgentSysContact\n    $vmHostSNMPAgentProperties.SysLocation = $script:constants.SNMPAgentSystemLocation\n    $vmHostSNMPAgentProperties.Targets = $script:constants.SNMPAgentTargets\n    $vmHostSNMPAgentProperties.Users = $script:constants.SNMPAgentUsers\n    $vmHostSNMPAgentProperties.V3Targets = $script:constants.SNMPAgentV3Targets\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostSNMPAgentProperties\n}\n\nfunction New-MocksWhenTheVMHostSNMPAgentShouldBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSNMPAgentProperties = New-VMHostSNMPAgentProperties\n\n    $vmHostSNMPAgentProperties.Reset = $script:constants.ResetSNMPAgent\n\n    $vmHostSNMPAgentProperties\n}\n\nfunction New-MocksWhenTheVMHostSNMPAgentShouldNotBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSNMPAgentProperties = New-VMHostSNMPAgentProperties\n\n    $vmHostSNMPAgentProperties.Reset = !$script:constants.ResetSNMPAgent\n\n    $vmHostSNMPAgentProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostScsiLunMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostScsiLunProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        CanonicalName = $script:constants.VMHostScsiLunCanonicalName\n    }\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksForVMHostScsiLun {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenErrorOccursWhileModifyingTheScsiLunConfiguration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n    $vmHostScsiLunProperties.BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    $vmHostScsiLunProperties.CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    $vmHostScsiLunProperties.DeletePartitions = $script:constants.VMHostScsiLunDeletePartitions\n    $vmHostScsiLunProperties.IsLocal = $script:constants.VMHostScsiLunIsLocal\n    $vmHostScsiLunProperties.IsSsd = $script:constants.VMHostScsiLunIsSsd\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Set-ScsiLun -MockWith { throw }.GetNewClosure() -ParameterFilter { $ScsiLun -eq $script:vmHostScsiLun -and $MultipathPolicy -eq $script:constants.VMHostScsiLunMultipathPolicy -and $PreferredPath -eq $script:vmHostScsiLunPath -and $DeletePartitions -eq $script:constants.VMHostScsiLunDeletePartitions -and $IsLocal -eq $script:constants.VMHostScsiLunIsLocal -and $IsSsd -eq $script:constants.VMHostScsiLunIsSsd -and !$Confirm } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileModifyingTheScsiLunConfiguration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n    $vmHostScsiLunProperties.BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    $vmHostScsiLunProperties.CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    $vmHostScsiLunProperties.DeletePartitions = $script:constants.VMHostScsiLunDeletePartitions\n    $vmHostScsiLunProperties.IsLocal = $script:constants.VMHostScsiLunIsLocal\n    $vmHostScsiLunProperties.IsSsd = $script:constants.VMHostScsiLunIsSsd\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Set-ScsiLun -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksWhenTheScsiLunIsNotFound {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    Mock -CommandName Get-ScsiLun -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathIsNotFound {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { throw }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksWhenTheScsiLunConfigurationDoesNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n    $vmHostScsiLunProperties.BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    $vmHostScsiLunProperties.CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    $vmHostScsiLunProperties.DeletePartitions = $script:constants.VMHostScsiLunDeletePartitions\n    $vmHostScsiLunProperties.IsLocal = $script:constants.VMHostScsiLunIsLocal\n    $vmHostScsiLunProperties.IsSsd = $script:constants.VMHostScsiLunIsSsd\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n    $vmHostDiskMock = $script:vmHostDisk\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Get-VMHostDisk -MockWith { return $vmHostDiskMock }.GetNewClosure() -ParameterFilter { $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathIsNotPreferred {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n    $vmHostScsiLunProperties.BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    $vmHostScsiLunProperties.CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    $vmHostScsiLunProperties.DeletePartitions = $script:constants.VMHostScsiLunDeletePartitions\n    $vmHostScsiLunProperties.IsLocal = $script:constants.VMHostScsiLunIsLocal\n    $vmHostScsiLunProperties.IsSsd = $script:constants.VMHostScsiLunIsSsd\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:notPreferredVMHostScsiLunPath\n    $vmHostDiskMock = $script:vmHostDisk\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Get-VMHostDisk -MockWith { return $vmHostDiskMock }.GetNewClosure() -ParameterFilter { $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksWhenDiskPartitionsExistAndDeletePartitionsIsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n    $vmHostScsiLunProperties.BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    $vmHostScsiLunProperties.CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    $vmHostScsiLunProperties.DeletePartitions = $script:constants.VMHostScsiLunDeletePartitions\n    $vmHostScsiLunProperties.IsLocal = $script:constants.VMHostScsiLunIsLocal\n    $vmHostScsiLunProperties.IsSsd = $script:constants.VMHostScsiLunIsSsd\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n    $vmHostDiskMock = $script:vmHostDiskWithPartitions\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Get-VMHostDisk -MockWith { return $vmHostDiskMock }.GetNewClosure() -ParameterFilter { $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunProperties = New-VMHostScsiLunProperties\n\n    $vmHostScsiLunProperties.MultipathPolicy = $script:constants.VMHostScsiLunMultipathPolicy\n    $vmHostScsiLunProperties.PreferredScsiLunPathName = $script:constants.VMHostScsiLunPathName\n    $vmHostScsiLunProperties.BlocksToSwitchPath = $script:constants.VMHostScsiLunBlocksToSwitchPath\n    $vmHostScsiLunProperties.CommandsToSwitchPath = $script:constants.VMHostScsiLunCommandsToSwitchPath\n    $vmHostScsiLunProperties.DeletePartitions = $script:constants.VMHostScsiLunDeletePartitions\n    $vmHostScsiLunProperties.IsLocal = $script:constants.VMHostScsiLunIsLocal\n    $vmHostScsiLunProperties.IsSsd = $script:constants.VMHostScsiLunIsSsd\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostScsiLunPathMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostScsiLunPathProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.VMHostScsiLunPathName\n        ScsiLunCanonicalName = $script:constants.VMHostScsiLunCanonicalName\n    }\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksForVMHostScsiLunPath {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenErrorOccursWhileConfiguringTheScsiLunPath {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunPathProperties.Active = $script:constants.VMHostActiveScsiLunPath\n    $vmHostScsiLunPathProperties.Preferred = $script:constants.VMHostPreferredScsiLunPath\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Set-ScsiLunPath -MockWith { throw }.GetNewClosure() -ParameterFilter { $ScsiLunPath -eq $script:vmHostScsiLunPath -and $Active -eq $script:constants.VMHostActiveScsiLunPath -and $Preferred -eq $script:constants.VMHostPreferredScsiLunPath -and !$Confirm } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileConfiguringTheScsiLunPath {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunPathProperties.Active = $script:constants.VMHostActiveScsiLunPath\n    $vmHostScsiLunPathProperties.Preferred = $script:constants.VMHostPreferredScsiLunPath\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n    Mock -CommandName Set-ScsiLunPath -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenTheScsiLunIsNotFound {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    Mock -CommandName Get-ScsiLun -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathIsNotFound {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { throw }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathStateIsActiveAndTheActivePropertyIsTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunPathProperties.Active = $script:constants.VMHostActiveScsiLunPath\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathStateIsActiveAndTheActivePropertyIsFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunPathProperties.Active = !$script:constants.VMHostActiveScsiLunPath\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathIsPreferredAndThePreferredPropertyIsTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunPathProperties.Preferred = $script:constants.VMHostPreferredScsiLunPath\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksWhenTheScsiLunPathIsPreferredAndThePreferredPropertyIsFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunPathProperties.Preferred = !$script:constants.VMHostPreferredScsiLunPath\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostScsiLunPathProperties = New-VMHostScsiLunPathProperties\n\n    $vmHostScsiLunMock = $script:vmHostScsiLun\n    $vmHostScsiLunPathMock = $script:vmHostScsiLunPath\n\n    Mock -CommandName Get-ScsiLun -MockWith { return $vmHostScsiLunMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VmHost -eq $script:vmHost -and $CanonicalName -eq $script:constants.VMHostScsiLunCanonicalName } -Verifiable\n    Mock -CommandName Get-ScsiLunPath -MockWith { return $vmHostScsiLunPathMock }.GetNewClosure() -ParameterFilter { $Name -eq $script:constants.VMHostScsiLunPathName -and $ScsiLun -eq $script:vmHostScsiLun } -Verifiable\n\n    $vmHostScsiLunPathProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostSharedSwapSpaceMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostSharedSwapSpaceProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSharedSwapSpaceProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostSharedSwapSpaceProperties\n}\n\nfunction New-MocksInSetForVMHostSharedSwapSpace {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSharedSwapSpaceProperties = New-VMHostSharedSwapSpaceProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostSharedSwapSpaceProperties\n}\n\nfunction New-MocksForVMHostSharedSwapSpace {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSharedSwapSpaceProperties = New-VMHostSharedSwapSpaceProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliListMethodMock = $script:vmHostSharedSwapSpaceConfiguration\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliListMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostSharedSwapSpaceProperties\n}\n\nfunction New-MocksWhenTheVMHostSharedSwapSpaceConfigurationShouldBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSharedSwapSpaceProperties = New-VMHostSharedSwapSpaceProperties\n\n    $vmHostSharedSwapSpaceProperties.DatastoreEnabled = !$script:constants.DatastoreEnabled\n    $vmHostSharedSwapSpaceProperties.DatastoreName = $script:constants.DatastoreName + $script:constants.DatastoreName\n    $vmHostSharedSwapSpaceProperties.DatastoreOrder = $script:constants.DatastoreOrder\n    $vmHostSharedSwapSpaceProperties.HostCacheEnabled = $script:constants.HostCacheEnabled\n    $vmHostSharedSwapSpaceProperties.HostCacheOrder = $script:constants.HostCacheOrder\n    $vmHostSharedSwapSpaceProperties.HostLocalSwapEnabled = $script:constants.HostLocalSwapEnabled\n    $vmHostSharedSwapSpaceProperties.HostLocalSwapOrder = $script:constants.HostLocalSwapOrder + $script:constants.HostLocalSwapOrder\n\n    $vmHostSharedSwapSpaceProperties\n}\n\nfunction New-MocksWhenTheVMHostSharedSwapSpaceConfigurationShouldNotBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSharedSwapSpaceProperties = New-VMHostSharedSwapSpaceProperties\n\n    $vmHostSharedSwapSpaceProperties.DatastoreEnabled = $script:constants.DatastoreEnabled\n    $vmHostSharedSwapSpaceProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostSharedSwapSpaceProperties.DatastoreOrder = $script:constants.DatastoreOrder\n    $vmHostSharedSwapSpaceProperties.HostCacheEnabled = $script:constants.HostCacheEnabled\n    $vmHostSharedSwapSpaceProperties.HostCacheOrder = $script:constants.HostCacheOrder\n    $vmHostSharedSwapSpaceProperties.HostLocalSwapEnabled = $script:constants.HostLocalSwapEnabled\n    $vmHostSharedSwapSpaceProperties.HostLocalSwapOrder = $script:constants.HostLocalSwapOrder\n\n    $vmHostSharedSwapSpaceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostSoftwareDeviceMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostSoftwareDeviceProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostSoftwareDeviceProperties\n}\n\nfunction New-MocksInSetForVMHostSoftwareDevice {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = New-VMHostSoftwareDeviceProperties\n\n    $vmHostSoftwareDeviceProperties.DeviceIdentifier = $script:constants.SoftwareDeviceId\n    $vmHostSoftwareDeviceProperties.InstanceAddress = $script:constants.SoftwareDeviceInstanceAddress\n    $vmHostSoftwareDeviceProperties.Ensure = 'Present'\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostSoftwareDeviceProperties\n}\n\nfunction New-MocksForVMHostSoftwareDevice {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = New-VMHostSoftwareDeviceProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliListMethodMock = $script:vmHostSoftwareDevices\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliListMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostSoftwareDeviceProperties\n}\n\nfunction New-MocksWhenTheVMHostSoftwareDeviceDoesNotExistAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = New-VMHostSoftwareDeviceProperties\n\n    $vmHostSoftwareDeviceProperties.DeviceIdentifier = $script:constants.SoftwareDeviceId\n    $vmHostSoftwareDeviceProperties.InstanceAddress = $script:constants.SoftwareDeviceDefaultInstanceAddress\n    $vmHostSoftwareDeviceProperties.Ensure = 'Present'\n\n    $vmHostSoftwareDeviceProperties\n}\n\nfunction New-MocksWhenTheVMHostSoftwareDeviceExistsAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = New-VMHostSoftwareDeviceProperties\n\n    $vmHostSoftwareDeviceProperties.DeviceIdentifier = $script:constants.SoftwareDeviceId\n    $vmHostSoftwareDeviceProperties.InstanceAddress = $script:constants.SoftwareDeviceInstanceAddress\n    $vmHostSoftwareDeviceProperties.Ensure = 'Present'\n\n    $vmHostSoftwareDeviceProperties\n}\n\nfunction New-MocksWhenTheVMHostSoftwareDeviceDoesNotExistAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = New-VMHostSoftwareDeviceProperties\n\n    $vmHostSoftwareDeviceProperties.DeviceIdentifier = $script:constants.SoftwareDeviceId\n    $vmHostSoftwareDeviceProperties.InstanceAddress = $script:constants.SoftwareDeviceDefaultInstanceAddress\n    $vmHostSoftwareDeviceProperties.Ensure = 'Absent'\n\n    $vmHostSoftwareDeviceProperties\n}\n\nfunction New-MocksWhenTheVMHostSoftwareDeviceExistsAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostSoftwareDeviceProperties = New-VMHostSoftwareDeviceProperties\n\n    $vmHostSoftwareDeviceProperties.DeviceIdentifier = $script:constants.SoftwareDeviceId\n    $vmHostSoftwareDeviceProperties.InstanceAddress = $script:constants.SoftwareDeviceInstanceAddress\n    $vmHostSoftwareDeviceProperties.Ensure = 'Absent'\n\n    $vmHostSoftwareDeviceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVDSwitchMigrationMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVDSwitchMigrationProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostAddedToDistributedSwitchOneName\n        VdsName = $script:constants.DistributedSwitchName\n        MigratePhysicalNicsOnly = $true\n    }\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksForVMHostVDSwitchMigration {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHostAddedToDistributedSwitchOne\n    $distributedSwitchMock = $script:distributedSwitch\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure()\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName }\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenOneDisconnectedPhysicalNetworkAdapterIsPassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOneDisconnectedPhysicalNetworkAdapterIsPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersArePassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterTwoName)\n\n    $physicalNetworkAdapterOneMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterTwoName)\n\n    $physicalNetworkAdapterOneMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersArePassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @(\n        $script:constants.ConnectedPhysicalNetworkAdapterOneName,\n        $script:constants.ConnectedPhysicalNetworkAdapterTwoName,\n        $script:constants.DisconnectedPhysicalNetworkAdapterOneName\n    )\n\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:connectedPhysicalNetworkAdapterTwo\n    $physicalNetworkAdapterThreeMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $DistributedSwitch -eq $script:distributedSwitch -and [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] @($script:connectedPhysicalNetworkAdapterOne, $script:connectedPhysicalNetworkAdapterTwo, $script:disconnectedPhysicalNetworkAdapterOne)) -and !$Confirm } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @(\n        $script:constants.ConnectedPhysicalNetworkAdapterOneName,\n        $script:constants.ConnectedPhysicalNetworkAdapterTwoName,\n        $script:constants.DisconnectedPhysicalNetworkAdapterOneName\n    )\n\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:connectedPhysicalNetworkAdapterTwo\n    $physicalNetworkAdapterThreeMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupArePassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName, $script:constants.PortGroupTwoName)\n\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupTwoName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupTwoName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupArePassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $physicalNetworkAdapterOneMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterTwo\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $physicalNetworkAdapterOneMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterTwo\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName, $script:constants.PortGroupTwoName)\n\n    $physicalNetworkAdapterOneMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterTwo\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupTwoName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupTwoName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @(\n        $script:constants.ConnectedPhysicalNetworkAdapterOneName,\n        $script:constants.ConnectedPhysicalNetworkAdapterTwoName,\n        $script:constants.DisconnectedPhysicalNetworkAdapterOneName\n    )\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:connectedPhysicalNetworkAdapterTwo\n    $physicalNetworkAdapterThreeMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @(\n        $script:constants.ConnectedPhysicalNetworkAdapterOneName,\n        $script:constants.ConnectedPhysicalNetworkAdapterTwoName,\n        $script:constants.DisconnectedPhysicalNetworkAdapterOneName\n    )\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName, $script:constants.PortGroupTwoName)\n\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:connectedPhysicalNetworkAdapterTwo\n    $physicalNetworkAdapterThreeMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterOneMock = $script:vmKernelNetworkAdapterOne\n    $vmKernelNetworkAdapterTwoMock = $script:vmKernelNetworkAdapterTwo\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterThreeMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupTwoName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupTwoName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenPortGroupWithAssociatedVLanIsPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNicAttachedToPortGroupWithVLanName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupWithVLanName)\n\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNicAttachedToPortGroupWithVLan\n    $standardPortGroupMock = $script:portGroupWithVLan\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNicAttachedToPortGroupWithVLanName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupWithVLanName -and $VDSwitch -eq $script:distributedSwitch } -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $standardPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupWithVLanName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Standard } -Verifiable\n    Mock -CommandName New-VDPortgroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupWithVLanName -and $VDSwitch -eq $script:distributedSwitch -and $VlanId -eq $script:constants.PortGroupWithVLanVLanId } -Verifiable\n    Mock -CommandName Add-VDSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenVMHostIsNotAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.VMHostName = $script:constants.VMHostName\n\n    $vmHostMock = $script:vmHost\n\n    # We need to mock Get-VMHost again here to change the ESXi we use in all the other tests.\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndNoPhysicalNetworkAdaptersAreAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.VdsName = $script:constants.DistributedSwitchWithoutAddedPhysicalNetworkAdaptersName\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithoutAddedPhysicalNetworkAdapters\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchWithoutAddedPhysicalNetworkAdaptersName } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoPhysicalNetworkAdaptersArePassedAndTheSecondIsNotAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.ConnectedPhysicalNetworkAdapterTwoName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:connectedPhysicalNetworkAdapterTwo\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndItIsAddedToTheDistributedSwitchAndNoVMKernelNetworkAdaptersAndPortGroupsArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenOneVMKernelNetworkAdapterAndZeroPortGroupsArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @()\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenZeroVMKernelNetworkAdaptersAndOnePortGroupArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @()\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoVMKernelNetworkAdaptersAndOnePortGroupArePassedAndTheSecondVMKernelNetworkAdapterIsNotAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VirtualSwitch -eq $script:distributedSwitchWithAddedPhysicalNetworkAdapters -and $PortGroup -eq $script:constants.PortGroupOneName -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VirtualSwitch -eq $script:distributedSwitchWithAddedPhysicalNetworkAdapters -and $PortGroup -eq $script:constants.PortGroupOneName -and $VMKernel } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksWhenTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassedAndTheSecondVMKernelNetworkAdapterIsNotAddedToTheDistributedSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVDSwitchMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName, $script:constants.PortGroupTwoName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VirtualSwitch -eq $script:distributedSwitchWithAddedPhysicalNetworkAdapters -and $PortGroup -eq $script:constants.PortGroupOneName -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterTwoName -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VirtualSwitch -eq $script:distributedSwitchWithAddedPhysicalNetworkAdapters -and $PortGroup -eq $script:constants.PortGroupTwoName -and $VMKernel } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVDSwitchMigrationProperties = New-VMHostVDSwitchMigrationProperties\n\n    $vmHostVDSwitchMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n\n    $distributedSwitchMock = $script:distributedSwitchWithAddedPhysicalNetworkAdapters\n    $vmKernelNetworkAdaptersMock = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n    # We need to mock Get-VDSwitch again here to change the Distributed Switch we use in all the other tests.\n    Mock -CommandName Get-VDSwitch -MockWith { return $distributedSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdaptersMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHostAddedToDistributedSwitchOne -and $VirtualSwitch -eq $script:distributedSwitchWithAddedPhysicalNetworkAdapters -and $VMKernel } -Verifiable\n\n    $vmHostVDSwitchMigrationProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVMKernelActiveDumpFileMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVMKernelActiveDumpFileProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpFileProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostVMKernelActiveDumpFileProperties\n}\n\nfunction New-MocksInSetForVMHostVMKernelActiveDumpFile {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpFileProperties = New-VMHostVMKernelActiveDumpFileProperties\n\n    $vmHostVMKernelActiveDumpFileProperties.Enable = $script:constants.EnableVMKernelDumpFile\n    $vmHostVMKernelActiveDumpFileProperties.Smart = $script:constants.UseSmartAlgorithmForVMKernelDumpFile\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelActiveDumpFileProperties\n}\n\nfunction New-MocksForVMHostVMKernelActiveDumpFile {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpFileProperties = New-VMHostVMKernelActiveDumpFileProperties\n\n    $vmHostVMKernelActiveDumpFileProperties.Smart = $script:constants.UseSmartAlgorithmForVMKernelDumpFile\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliGetMethodMock = $script:vmKernelDumpFile\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelActiveDumpFileProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpFileIsActiveAndConfiguredAndEnableIsTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpFileProperties = New-VMHostVMKernelActiveDumpFileProperties\n\n    $vmHostVMKernelActiveDumpFileProperties.Enable = $script:constants.EnableVMKernelDumpFile\n\n    $vmHostVMKernelActiveDumpFileProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpFileIsActiveAndConfiguredAndEnableIsFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpFileProperties = New-VMHostVMKernelActiveDumpFileProperties\n\n    $vmHostVMKernelActiveDumpFileProperties.Enable = !$script:constants.EnableVMKernelDumpFile\n\n    $vmHostVMKernelActiveDumpFileProperties\n}\n\nfunction New-MocksWhenEnableIsNotPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpFileProperties = New-VMHostVMKernelActiveDumpFileProperties\n    $vmHostVMKernelActiveDumpFileProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVMKernelActiveDumpPartitionMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVMKernelActiveDumpPartitionProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpPartitionProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostVMKernelActiveDumpPartitionProperties\n}\n\nfunction New-MocksInSetForVMHostVMKernelActiveDumpPartition {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpPartitionProperties = New-VMHostVMKernelActiveDumpPartitionProperties\n\n    $vmHostVMKernelActiveDumpPartitionProperties.Enable = $script:constants.EnableVMKernelDumpPartition\n    $vmHostVMKernelActiveDumpPartitionProperties.Smart = $script:constants.UseSmartAlgorithmForVMKernelDumpPartition\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelActiveDumpPartitionProperties\n}\n\nfunction New-MocksForVMHostVMKernelActiveDumpPartition {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpPartitionProperties = New-VMHostVMKernelActiveDumpPartitionProperties\n\n    $vmHostVMKernelActiveDumpPartitionProperties.Smart = $script:constants.UseSmartAlgorithmForVMKernelDumpPartition\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliGetMethodMock = $script:vmKernelDumpPartition\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliGetMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelActiveDumpPartitionProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpPartitionIsActiveAndConfiguredAndEnableIsTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpPartitionProperties = New-VMHostVMKernelActiveDumpPartitionProperties\n\n    $vmHostVMKernelActiveDumpPartitionProperties.Enable = $script:constants.EnableVMKernelDumpPartition\n\n    $vmHostVMKernelActiveDumpPartitionProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpPartitionIsActiveAndConfiguredAndEnableIsFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpPartitionProperties = New-VMHostVMKernelActiveDumpPartitionProperties\n\n    $vmHostVMKernelActiveDumpPartitionProperties.Enable = !$script:constants.EnableVMKernelDumpPartition\n\n    $vmHostVMKernelActiveDumpPartitionProperties\n}\n\nfunction New-MocksWhenEnableIsNotPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelActiveDumpPartitionProperties = New-VMHostVMKernelActiveDumpPartitionProperties\n    $vmHostVMKernelActiveDumpPartitionProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVMKernelDumpFileMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVMKernelDumpFileProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostVMKernelDumpFileProperties\n}\n\nfunction New-MocksInSetForVMHostVMKernelDumpFile {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = New-VMHostVMKernelDumpFileProperties\n\n    $vmHostVMKernelDumpFileProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostVMKernelDumpFileProperties.FileName = $script:constants.DumpFileName\n    $vmHostVMKernelDumpFileProperties.Ensure = 'Present'\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelDumpFileProperties\n}\n\nfunction New-MocksForVMHostVMKernelDumpFile {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = New-VMHostVMKernelDumpFileProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliListMethodMock = $script:vmKernelDumpFile\n    $esxCliFileSystemsListMock = $script:fileSystem\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliListMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $esxCliFileSystemsListMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelDumpFileProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpFileDoesNotExistAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = New-VMHostVMKernelDumpFileProperties\n\n    $vmHostVMKernelDumpFileProperties.DatastoreName = $script:constants.DatastoreName + $script:constants.DatastoreName\n    $vmHostVMKernelDumpFileProperties.FileName = $script:constants.DumpFileName + $script:constants.DumpFileName\n    $vmHostVMKernelDumpFileProperties.Ensure = 'Present'\n    $vmHostVMKernelDumpFileProperties.Size = $script:constants.DumpFileSizeInMB + $script:constants.DumpFileSizeInMB\n\n    $vmHostVMKernelDumpFileProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpFileExistsAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = New-VMHostVMKernelDumpFileProperties\n\n    $vmHostVMKernelDumpFileProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostVMKernelDumpFileProperties.FileName = $script:constants.DumpFileName\n    $vmHostVMKernelDumpFileProperties.Ensure = 'Present'\n    $vmHostVMKernelDumpFileProperties.Size = $script:constants.DumpFileSizeInMB\n\n    $vmHostVMKernelDumpFileProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpFileDoesNotExistAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = New-VMHostVMKernelDumpFileProperties\n\n    $vmHostVMKernelDumpFileProperties.DatastoreName = $script:constants.DatastoreName + $script:constants.DatastoreName\n    $vmHostVMKernelDumpFileProperties.FileName = $script:constants.DumpFileName + $script:constants.DumpFileName\n    $vmHostVMKernelDumpFileProperties.Ensure = 'Absent'\n    $vmHostVMKernelDumpFileProperties.Size = $script:constants.DumpFileSizeInMB + $script:constants.DumpFileSizeInMB\n\n    $vmHostVMKernelDumpFileProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelDumpFileExistsAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelDumpFileProperties = New-VMHostVMKernelDumpFileProperties\n\n    $vmHostVMKernelDumpFileProperties.DatastoreName = $script:constants.DatastoreName\n    $vmHostVMKernelDumpFileProperties.FileName = $script:constants.DumpFileName\n    $vmHostVMKernelDumpFileProperties.Ensure = 'Absent'\n    $vmHostVMKernelDumpFileProperties.Size = $script:constants.DumpFileSizeInMB\n\n    $vmHostVMKernelDumpFileProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVMKernelModuleMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVMKernelModuleProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelModuleProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostVMKernelModuleProperties\n}\n\nfunction New-MocksInSetForVMHostVMKernelModule {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelModuleProperties = New-VMHostVMKernelModuleProperties\n\n    $vmHostVMKernelModuleProperties.Module = $script:constants.VMKernelModuleName\n    $vmHostVMKernelModuleProperties.Enabled = $script:constants.VMKernelModuleEnabled\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelModuleProperties\n}\n\nfunction New-MocksForVMHostVMKernelModule {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelModuleProperties = New-VMHostVMKernelModuleProperties\n\n    $vmHostVMKernelModuleProperties.Module = $script:constants.VMKernelModuleName\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliListMethodMock = $script:vmKernelModule\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliListMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVMKernelModuleProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelModuleIsEnabledAndEnabledIsFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelModuleProperties = New-VMHostVMKernelModuleProperties\n\n    $vmHostVMKernelModuleProperties.Module = $script:constants.VMKernelModuleName\n    $vmHostVMKernelModuleProperties.Enabled = !$script:constants.VMKernelModuleEnabled\n\n    $vmHostVMKernelModuleProperties\n}\n\nfunction New-MocksWhenTheVMHostVMKernelModuleIsEnabledAndEnabledIsTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVMKernelModuleProperties = New-VMHostVMKernelModuleProperties\n\n    $vmHostVMKernelModuleProperties.Module = $script:constants.VMKernelModuleName\n    $vmHostVMKernelModuleProperties.Enabled = $script:constants.VMKernelModuleEnabled\n\n    $vmHostVMKernelModuleProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVssMigrationMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVssMigrationProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        VssName = $script:constants.VirtualSwitchName\n    }\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksForVMHostVssMigration {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenServerErrorOccursDuringStandardSwitchRetrieval {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenTwoPhysicalNetworkAdaptersArePassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n\n    $standardSwitchMock = $script:virtualSwitch\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Add-VirtualSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenTwoPhysicalNetworkAdaptersArePassedAndBothAreNotAddedToThePassedStandardSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n\n    $standardSwitchMock = $script:virtualSwitch\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Add-VirtualSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenTwoPhysicalNetworkAdaptersOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndServerErrorOccursDuringMigration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n    $standardPortGroupMock = $script:portGroupWithAttachedVMKernelNetworkAdapter\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $standardPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and $Standard } -Verifiable\n    Mock -CommandName Add-VirtualSwitchPhysicalNetworkAdapter -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenTwoPhysicalNetworkAdaptersOneVMKernelNetworkAdapterAndOnePortGroupArePassedThePortGroupDoesNotExistAndServerErrorOccursDuringPortGroupCreation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and $Standard } -Verifiable\n    Mock -CommandName New-VirtualPortGroup -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenTwoPhysicalNetworkAdaptersOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndThePortGroupDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterOneMock = $script:connectedPhysicalNetworkAdapterOne\n    $physicalNetworkAdapterTwoMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterOneMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterTwoMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DisconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $VMKernel } -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and $Standard } -Verifiable\n    Mock -CommandName New-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.PortGroupOneName -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter } -Verifiable\n    Mock -CommandName Add-VirtualSwitchPhysicalNetworkAdapter -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndIsNotPresentOnTheServer {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterTwoName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n\n    # Mock Write-WarningLog to avoid the warning output when executing the Unit Tests.\n    Mock -CommandName Write-WarningLog -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterTwoName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndTheStandardSwitchDoesNotHavePhysicalNetworkAdaptersAddedToIt {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n\n    $standardSwitchMock = $script:virtualSwitch\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndItIsNotAddedToTheStandardSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterMock = $script:connectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.ConnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndItIsAddedToTheStandardSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.disconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.disconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenZeroVMKernelNetworkAdaptersAndOnePortGroupArePassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @()\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.disconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndTheVMKernelNetworkAdapterIsNotAddedToTheStandardSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.disconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and $PortGroup -eq $script:constants.PortGroupOneName -and $VMKernel } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksWhenOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndTheVMKernelNetworkAdapterIsAddedToTheStandardSwitch {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $physicalNetworkAdapterMock = $script:disconnectedPhysicalNetworkAdapterOne\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $physicalNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.disconnectedPhysicalNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $Physical } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMKernelNetworkAdapterOneName -and $VMHost -eq $script:vmHost -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and $PortGroup -eq $script:constants.PortGroupOneName -and $VMKernel } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssMigrationProperties = New-VMHostVssMigrationProperties\n\n    $vmHostVssMigrationProperties.VssName = $script:constants.VirtualSwitchName\n    $vmHostVssMigrationProperties.PhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.VMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n    $vmHostVssMigrationProperties.PortGroupNames = @($script:constants.PortGroupOneName)\n\n    $standardSwitchMock = $script:standardSwitchWithOnePhysicalNetworkAdapter\n    $vmKernelNetworkAdapterMock = $script:vmKernelNetworkAdapterOne\n\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $standardSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmKernelNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and $VMKernel } -Verifiable\n\n    $vmHostVssMigrationProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVssNicMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVssNicProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        VssName = $script:constants.VirtualSwitchName\n        PortGroupName = $script:constants.VirtualPortGroupName\n        Ensure = 'Present'\n        IP = $script:constants.VMKernelNetworkAdapterIP\n        SubnetMask = $script:constants.VMKernelNetworkAdapterSubnetMask\n        Mac = $script:constants.VMKernelNetworkAdapterMac\n        AutomaticIPv6 = $script:constants.VMKernelNetworkAdapterAutomaticIPv6\n        IPv6 = @()\n        IPv6ThroughDhcp = $script:constants.VMKernelNetworkAdapterIPv6ThroughDhcp\n        Mtu = $script:constants.VMKernelNetworkAdapterMtu\n        ManagementTrafficEnabled = $script:constants.VMKernelNetworkAdapterManagementTrafficEnabled\n        FaultToleranceLoggingEnabled = $script:constants.VMKernelNetworkAdapterFaultToleranceLoggingEnabled\n        VMotionEnabled = $script:constants.VMKernelNetworkAdapterVMotionEnabled\n        VsanTrafficEnabled = $script:constants.VMKernelNetworkAdapterVsanTrafficEnabled\n    }\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksForVMHostVssNic {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $virtualSwitchMock = $script:virtualSwitch\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure()\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure()\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $virtualSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard }\n}\n\nfunction New-MocksWhenEnsurePresentAndVMKernelNetworkAdapterDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n    Mock -CommandName New-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure()\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndVMKernelNetworkAdapterExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    $vmHostVssNicProperties.IPv6Enabled = !$script:constants.VMKernelNetworkAdapterIPv6Enabled\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:vmHostNetworkAdapter.Name -and $VMHost -eq $script:vmHost -and $VMKernel }\n    Mock -CommandName Set-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure()\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndVMKernelNetworkAdapterDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostVssNicProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n    Mock -CommandName Remove-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure()\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndVMKernelNetworkAdapterExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostVssNicProperties.Ensure = 'Absent'\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:vmHostNetworkAdapter.Name -and $VMHost -eq $script:vmHost -and $VMKernel }\n    Mock -CommandName Remove-VMHostNetworkAdapter -MockWith { return $null }.GetNewClosure()\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksWhenEnsurePresentVMKernelNetworkAdapterExistsAndMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksWhenEnsurePresentVMKernelNetworkAdapterExistsAndNonMatchingSettings {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostVssNicProperties.SubnetMask = $vmHostVssNicProperties.SubnetMask + $vmHostVssNicProperties.SubnetMask\n    $vmHostVssNicProperties.VsanTrafficEnabled = $false\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n\n    $vmHostVssNicProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssNicProperties = New-VMHostVssNicProperties\n\n    $vmHostNetworkAdapterMock = $script:vmHostNetworkAdapter\n\n    Mock -CommandName Get-VMHostNetworkAdapter -MockWith { return $vmHostNetworkAdapterMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $PortGroup -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost -and $VMKernel }\n\n    $vmHostVssNicProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVssPortGroupMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVssPortGroupProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        VssName = $script:constants.VirtualSwitchName\n    }\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksForVMHostVssPortGroup {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $virtualSwitchMock = $script:virtualSwitch\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VirtualSwitch -MockWith { return $virtualSwitchMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualSwitchName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n}\n\nfunction New-MocksInSetWhenEnsurePresentAndNonExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName New-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingPortGroupAndNegativeVLanId {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n    $vmHostVssPortGroupProperties.VLanId = -1\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingPortGroupAndVLanIdBiggerThanTheMaxValidValue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n    $vmHostVssPortGroupProperties.VLanId = $script:constants.VLanId + 1\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingPortGroupAndValidVLanId {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n    $vmHostVssPortGroupProperties.VLanId = $script:constants.VLanId\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Set-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndNonExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-VirtualPortGroup -MockWith { return $null }.GetNewClosure()\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksInSetWhenEnsureAbsentAndExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Absent'\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n    Mock -CommandName Remove-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndNonExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingPortGroupAndNoVLanIdSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingPortGroupAndVLanIdNotEqualToPortGroupVLanId {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n    $vmHostVssPortGroupProperties.VLanId = $script:constants.VLanId - 1\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentExistingPortGroupAndVLanIdEqualToPortGroupVLanId {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n    $vmHostVssPortGroupProperties.VLanId = $script:constants.VLanId\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndNonExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsureAbsentAndExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Absent'\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n\nfunction New-MocksWhenEnsurePresentAndExistingPortGroup {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupProperties = New-VMHostVssPortGroupProperties\n    $vmHostVssPortGroupProperties.Name = $script:constants.VirtualPortGroupName\n    $vmHostVssPortGroupProperties.Ensure = 'Present'\n\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmHostVssPortGroupProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVssPortGroupSecurityMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVssPortGroupSecurityProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.VirtualPortGroupName\n        Ensure = 'Present'\n    }\n\n    $vmHostVssPortGroupSecurityProperties\n}\n\nfunction New-MocksForVMHostVssPortGroupSecurity {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n}\n\nfunction New-MocksWhenSecurityPolicySettingsArePassedAndSecurityPolicySettingsInheritedAreNotPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = New-VMHostVssPortGroupSecurityProperties\n\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuous = $script:constants.AllowPromiscuous\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmits = $script:constants.ForgedTransmits\n    $vmHostVssPortGroupSecurityProperties.MacChanges = $script:constants.MacChanges\n\n    $virtualPortGroupSecurityPolicyMock = $script:virtualPortGroupSecurityPolicy\n\n    Mock -CommandName Get-SecurityPolicy -MockWith { return $virtualPortGroupSecurityPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n    Mock -CommandName Set-SecurityPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupSecurityProperties\n}\n\nfunction New-MocksWhenSecurityPolicySettingsArePassedAndSecurityPolicySettingsInheritedAreSetToFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = New-VMHostVssPortGroupSecurityProperties\n\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuous = $script:constants.AllowPromiscuous\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuousInherited = $script:constants.AllowPromiscuousInherited\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmits = $script:constants.ForgedTransmits\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmitsInherited = $script:constants.ForgedTransmitsInherited\n    $vmHostVssPortGroupSecurityProperties.MacChanges = $script:constants.MacChanges\n    $vmHostVssPortGroupSecurityProperties.MacChangesInherited = $script:constants.MacChangesInherited\n\n    $virtualPortGroupSecurityPolicyMock = $script:virtualPortGroupSecurityPolicy\n\n    Mock -CommandName Get-SecurityPolicy -MockWith { return $virtualPortGroupSecurityPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n    Mock -CommandName Set-SecurityPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupSecurityProperties\n}\n\nfunction New-MocksWhenSecurityPolicySettingsArePassedAndSecurityPolicySettingsInheritedAreSetToTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = New-VMHostVssPortGroupSecurityProperties\n\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuous = $script:constants.AllowPromiscuous\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuousInherited = !$script:constants.AllowPromiscuousInherited\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmits = $script:constants.ForgedTransmits\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmitsInherited = !$script:constants.ForgedTransmitsInherited\n    $vmHostVssPortGroupSecurityProperties.MacChanges = $script:constants.MacChanges\n    $vmHostVssPortGroupSecurityProperties.MacChangesInherited = !$script:constants.MacChangesInherited\n\n    $virtualPortGroupSecurityPolicyMock = $script:virtualPortGroupSecurityPolicy\n\n    Mock -CommandName Get-SecurityPolicy -MockWith { return $virtualPortGroupSecurityPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n    Mock -CommandName Set-SecurityPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupSecurityProperties\n}\n\nfunction New-MocksWhenTheSecurityPolicySettingsAreNonMatching {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = New-VMHostVssPortGroupSecurityProperties\n\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuous = !$script:constants.AllowPromiscuous\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmitsInherited = !$script:constants.ForgedTransmitsInherited\n\n    $virtualPortGroupSecurityPolicyMock = $script:virtualPortGroupSecurityPolicy\n\n    Mock -CommandName Get-SecurityPolicy -MockWith { return $virtualPortGroupSecurityPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n\n    $vmHostVssPortGroupSecurityProperties\n}\n\nfunction New-MocksWhenTheSecurityPolicySettingsAreMatching {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = New-VMHostVssPortGroupSecurityProperties\n\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuous = $script:constants.AllowPromiscuous\n    $vmHostVssPortGroupSecurityProperties.AllowPromiscuousInherited = $script:constants.AllowPromiscuousInherited\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmits = $script:constants.ForgedTransmits\n    $vmHostVssPortGroupSecurityProperties.ForgedTransmitsInherited = $script:constants.ForgedTransmitsInherited\n    $vmHostVssPortGroupSecurityProperties.MacChanges = $script:constants.MacChanges\n    $vmHostVssPortGroupSecurityProperties.MacChangesInherited = $script:constants.MacChangesInherited\n\n    $virtualPortGroupSecurityPolicyMock = $script:virtualPortGroupSecurityPolicy\n\n    Mock -CommandName Get-SecurityPolicy -MockWith { return $virtualPortGroupSecurityPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n\n    $vmHostVssPortGroupSecurityProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupSecurityProperties = New-VMHostVssPortGroupSecurityProperties\n\n    $virtualPortGroupSecurityPolicyMock = $script:virtualPortGroupSecurityPolicy\n\n    Mock -CommandName Get-SecurityPolicy -MockWith { return $virtualPortGroupSecurityPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n\n    $vmHostVssPortGroupSecurityProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVssPortGroupShapingMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVssPortGroupShapingProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupShapingProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.VirtualPortGroupName\n        Ensure = 'Present'\n    }\n\n    $vmHostVssPortGroupShapingProperties\n}\n\nfunction New-MocksForVMHostVssPortGroupShaping {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksInSet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupShapingProperties = New-VMHostVssPortGroupShapingProperties\n\n    $vmHostVssPortGroupShapingProperties.Enabled = $script:constants.ShapingEnabled\n    $vmHostVssPortGroupShapingProperties.AverageBandwidth = $script:constants.AverageBandwidth\n    $vmHostVssPortGroupShapingProperties.PeakBandwidth = $script:constants.PeakBandwidth\n    $vmHostVssPortGroupShapingProperties.BurstSize = $script:constants.BurstSize\n\n    $networkSystemMock = $script:vmHostNetworkSystem\n\n    Mock -CommandName Get-View -MockWith { return $networkSystemMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Update-VirtualPortGroup -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupShapingProperties\n}\n\nfunction New-MocksWhenTheShapingPolicySettingsAreNonMatching {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupShapingProperties = New-VMHostVssPortGroupShapingProperties\n\n    $vmHostVssPortGroupShapingProperties.Enabled = !$script:constants.ShapingEnabled\n    $vmHostVssPortGroupShapingProperties.BurstSize = $script:constants.BurstSize + $script:constants.BurstSize\n\n    $vmHostVssPortGroupShapingProperties\n}\n\nfunction New-MocksWhenTheShapingPolicySettingsAreMatching {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupShapingProperties = New-VMHostVssPortGroupShapingProperties\n\n    $vmHostVssPortGroupShapingProperties.Enabled = $script:constants.ShapingEnabled\n    $vmHostVssPortGroupShapingProperties.AverageBandwidth = $script:constants.AverageBandwidth\n    $vmHostVssPortGroupShapingProperties.PeakBandwidth = $script:constants.PeakBandwidth\n    $vmHostVssPortGroupShapingProperties.BurstSize = $script:constants.BurstSize\n\n    $vmHostVssPortGroupShapingProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostVssPortGroupTeamingMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVssPortGroupTeamingProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.VirtualPortGroupName\n        Ensure = 'Present'\n    }\n\n    $vmHostVssPortGroupTeamingProperties\n}\n\nfunction New-MocksForVMHostVssPortGroupTeaming {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $virtualPortGroupMock = $script:virtualPortGroup\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VirtualPortGroup -MockWith { return $virtualPortGroupMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VMHost -eq $script:vmHost -and $Standard } -Verifiable\n}\n\nfunction New-MocksWhenTeamingPolicySettingsArePassedAndTeamingPolicySettingsInheritedAreNotPassed {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = New-VMHostVssPortGroupTeamingProperties\n\n    $vmHostVssPortGroupTeamingProperties.FailbackEnabled = $script:constants.FailbackEnabled\n    $vmHostVssPortGroupTeamingProperties.LoadBalancingPolicy = $script:constants.LoadBalancingPolicyIP\n    $vmHostVssPortGroupTeamingProperties.NetworkFailoverDetectionPolicy = $script:constants.NetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.NotifySwitches = $script:constants.NotifySwitches\n    $vmHostVssPortGroupTeamingProperties.ActiveNic = $script:constants.ActiveNic\n    $vmHostVssPortGroupTeamingProperties.StandbyNic = $script:constants.StandbyNic\n    $vmHostVssPortGroupTeamingProperties.UnusedNic = $script:constants.UnusedNic\n\n    $virtualPortGroupTeamingPolicyMock = $script:virtualPortGroupTeamingPolicy\n\n    Mock -CommandName Get-NicTeamingPolicy -MockWith { return $virtualPortGroupTeamingPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n    Mock -CommandName Set-NicTeamingPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupTeamingProperties\n}\n\nfunction New-MocksWhenTeamingPolicySettingsArePassedAndTeamingPolicySettingsInheritedAreSetToFalse {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = New-VMHostVssPortGroupTeamingProperties\n\n    $vmHostVssPortGroupTeamingProperties.FailbackEnabled = $script:constants.FailbackEnabled\n    $vmHostVssPortGroupTeamingProperties.LoadBalancingPolicy = $script:constants.LoadBalancingPolicyIP\n    $vmHostVssPortGroupTeamingProperties.NetworkFailoverDetectionPolicy = $script:constants.NetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.NotifySwitches = $script:constants.NotifySwitches\n    $vmHostVssPortGroupTeamingProperties.ActiveNic = $script:constants.ActiveNic\n    $vmHostVssPortGroupTeamingProperties.StandbyNic = $script:constants.StandbyNic\n    $vmHostVssPortGroupTeamingProperties.UnusedNic = $script:constants.UnusedNic\n    $vmHostVssPortGroupTeamingProperties.InheritFailback = $script:constants.InheritFailback\n    $vmHostVssPortGroupTeamingProperties.InheritFailoverOrder = $script:constants.InheritFailoverOrder\n    $vmHostVssPortGroupTeamingProperties.InheritLoadBalancingPolicy = $script:constants.InheritLoadBalancingPolicy\n    $vmHostVssPortGroupTeamingProperties.InheritNetworkFailoverDetectionPolicy = $script:constants.InheritNetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.InheritNotifySwitches = $script:constants.InheritNotifySwitches\n\n    $virtualPortGroupTeamingPolicyMock = $script:virtualPortGroupTeamingPolicy\n\n    Mock -CommandName Get-NicTeamingPolicy -MockWith { return $virtualPortGroupTeamingPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n    Mock -CommandName Set-NicTeamingPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupTeamingProperties\n}\n\nfunction New-MocksWhenTeamingPolicySettingsArePassedAndTeamingPolicySettingsInheritedAreSetToTrue {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = New-VMHostVssPortGroupTeamingProperties\n\n    $vmHostVssPortGroupTeamingProperties.FailbackEnabled = $script:constants.FailbackEnabled\n    $vmHostVssPortGroupTeamingProperties.LoadBalancingPolicy = $script:constants.LoadBalancingPolicyIP\n    $vmHostVssPortGroupTeamingProperties.NetworkFailoverDetectionPolicy = $script:constants.NetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.NotifySwitches = $script:constants.NotifySwitches\n    $vmHostVssPortGroupTeamingProperties.ActiveNic = $script:constants.ActiveNic\n    $vmHostVssPortGroupTeamingProperties.StandbyNic = $script:constants.StandbyNic\n    $vmHostVssPortGroupTeamingProperties.UnusedNic = $script:constants.UnusedNic\n    $vmHostVssPortGroupTeamingProperties.InheritFailback = !$script:constants.InheritFailback\n    $vmHostVssPortGroupTeamingProperties.InheritFailoverOrder = !$script:constants.InheritFailoverOrder\n    $vmHostVssPortGroupTeamingProperties.InheritLoadBalancingPolicy = !$script:constants.InheritLoadBalancingPolicy\n    $vmHostVssPortGroupTeamingProperties.InheritNetworkFailoverDetectionPolicy = !$script:constants.InheritNetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.InheritNotifySwitches = !$script:constants.InheritNotifySwitches\n\n    $virtualPortGroupTeamingPolicyMock = $script:virtualPortGroupTeamingPolicy\n\n    Mock -CommandName Get-NicTeamingPolicy -MockWith { return $virtualPortGroupTeamingPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n    Mock -CommandName Set-NicTeamingPolicy -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostVssPortGroupTeamingProperties\n}\n\nfunction New-MocksWhenTheTeamingPolicySettingsAreNonMatching {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = New-VMHostVssPortGroupTeamingProperties\n\n    $vmHostVssPortGroupTeamingProperties.FailbackEnabled = !$script:constants.FailbackEnabled\n    $vmHostVssPortGroupTeamingProperties.LoadBalancingPolicy = $script:constants.LoadBalancingPolicySrcMac\n    $vmHostVssPortGroupTeamingProperties.ActiveNic = $script:constants.ActiveNicSubset\n    $vmHostVssPortGroupTeamingProperties.UnusedNic = $script:constants.UnusedNicEmpty\n    $vmHostVssPortGroupTeamingProperties.InheritNotifySwitches = !$script:constants.InheritNotifySwitches\n\n    $virtualPortGroupTeamingPolicyMock = $script:virtualPortGroupTeamingPolicy\n\n    Mock -CommandName Get-NicTeamingPolicy -MockWith { return $virtualPortGroupTeamingPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n\n    $vmHostVssPortGroupTeamingProperties\n}\n\nfunction New-MocksWhenTheTeamingPolicySettingsAreMatching {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = New-VMHostVssPortGroupTeamingProperties\n\n    $vmHostVssPortGroupTeamingProperties.FailbackEnabled = $script:constants.FailbackEnabled\n    $vmHostVssPortGroupTeamingProperties.LoadBalancingPolicy = $script:constants.LoadBalancingPolicyIP\n    $vmHostVssPortGroupTeamingProperties.NetworkFailoverDetectionPolicy = $script:constants.NetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.NotifySwitches = $script:constants.NotifySwitches\n    $vmHostVssPortGroupTeamingProperties.ActiveNic = $script:constants.ActiveNic\n    $vmHostVssPortGroupTeamingProperties.StandbyNic = $script:constants.StandbyNic\n    $vmHostVssPortGroupTeamingProperties.UnusedNic = $script:constants.UnusedNic\n    $vmHostVssPortGroupTeamingProperties.InheritFailback = $script:constants.InheritFailback\n    $vmHostVssPortGroupTeamingProperties.InheritFailoverOrder = $script:constants.InheritFailoverOrder\n    $vmHostVssPortGroupTeamingProperties.InheritLoadBalancingPolicy = $script:constants.InheritLoadBalancingPolicy\n    $vmHostVssPortGroupTeamingProperties.InheritNetworkFailoverDetectionPolicy = $script:constants.InheritNetworkFailoverDetectionPolicy\n    $vmHostVssPortGroupTeamingProperties.InheritNotifySwitches = $script:constants.InheritNotifySwitches\n\n    $virtualPortGroupTeamingPolicyMock = $script:virtualPortGroupTeamingPolicy\n\n    Mock -CommandName Get-NicTeamingPolicy -MockWith { return $virtualPortGroupTeamingPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n\n    $vmHostVssPortGroupTeamingProperties\n}\n\nfunction New-MocksInGet {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostVssPortGroupTeamingProperties = New-VMHostVssPortGroupTeamingProperties\n\n    $virtualPortGroupTeamingPolicyMock = $script:virtualPortGroupTeamingPolicy\n\n    Mock -CommandName Get-NicTeamingPolicy -MockWith { return $virtualPortGroupTeamingPolicyMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $VirtualPortGroup -eq $script:virtualPortGroup } -Verifiable\n\n    $vmHostVssPortGroupTeamingProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VMHostvSANNetworkConfigurationMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostvSANNetworkConfigurationProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n    }\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n\nfunction New-MocksInSetForVMHostvSANNetworkConfiguration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = New-VMHostvSANNetworkConfigurationProperties\n\n    $vmHostvSANNetworkConfigurationProperties.InterfaceName = $script:constants.VMHostvSanNetworkConfigurationInterfaceOneName\n    $vmHostvSANNetworkConfigurationProperties.Ensure = 'Present'\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliSetMethodArgsMock = $script:constants.EsxCliSetMethodArgs\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliSetMethodArgsMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-EsxCliCommandMethod -MockWith { return $null }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n\nfunction New-MocksForVMHostvSANNetworkConfiguration {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = New-VMHostvSANNetworkConfigurationProperties\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n    $esxCliMock = $script:esxCli\n    $esxCliListMethodMock = $script:vmHostvSanNetworkConfigurationIPInterface\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-EsxCli -MockWith { return $esxCliMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Invoke-Expression -MockWith { return $esxCliListMethodMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceDoesNotExistAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = New-VMHostvSANNetworkConfigurationProperties\n\n    $vmHostvSANNetworkConfigurationProperties.InterfaceName = $script:constants.VMHostvSanNetworkConfigurationInterfaceTwoName\n    $vmHostvSANNetworkConfigurationProperties.AgentV6McAddr = $script:constants.VMHostvSanNetworkConfigurationAgentGroupIPv6MulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.AgentMcAddr = $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.AgentMcPort = $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastPort\n    $vmHostvSANNetworkConfigurationProperties.HostUcPort = $script:constants.VMHostvSanNetworkConfigurationHostUnicastChannelBoundPort\n    $vmHostvSANNetworkConfigurationProperties.MasterV6McAddr = $script:constants.VMHostvSanNetworkConfigurationMasterGroupIPv6MulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.MasterMcAddr = $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.MasterMcPort = $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastPort\n    $vmHostvSANNetworkConfigurationProperties.MulticastTtl = $script:constants.VMHostvSanNetworkConfigurationMulticastTTL\n    $vmHostvSANNetworkConfigurationProperties.TrafficType = $script:constants.VMHostvSanNetworkConfigurationTrafficType\n    $vmHostvSANNetworkConfigurationProperties.Ensure = 'Present'\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceExistsAndEnsureIsPresent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = New-VMHostvSANNetworkConfigurationProperties\n\n    $vmHostvSANNetworkConfigurationProperties.InterfaceName = $script:constants.VMHostvSanNetworkConfigurationInterfaceOneName\n    $vmHostvSANNetworkConfigurationProperties.Ensure = 'Present'\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceDoesNotExistAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = New-VMHostvSANNetworkConfigurationProperties\n\n    $vmHostvSANNetworkConfigurationProperties.InterfaceName = $script:constants.VMHostvSanNetworkConfigurationInterfaceTwoName\n    $vmHostvSANNetworkConfigurationProperties.AgentV6McAddr = $script:constants.VMHostvSanNetworkConfigurationAgentGroupIPv6MulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.AgentMcAddr = $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.AgentMcPort = $script:constants.VMHostvSanNetworkConfigurationAgentGroupMulticastPort\n    $vmHostvSANNetworkConfigurationProperties.HostUcPort = $script:constants.VMHostvSanNetworkConfigurationHostUnicastChannelBoundPort\n    $vmHostvSANNetworkConfigurationProperties.MasterV6McAddr = $script:constants.VMHostvSanNetworkConfigurationMasterGroupIPv6MulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.MasterMcAddr = $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastAddress\n    $vmHostvSANNetworkConfigurationProperties.MasterMcPort = $script:constants.VMHostvSanNetworkConfigurationMasterGroupMulticastPort\n    $vmHostvSANNetworkConfigurationProperties.MulticastTtl = $script:constants.VMHostvSanNetworkConfigurationMulticastTTL\n    $vmHostvSANNetworkConfigurationProperties.TrafficType = $script:constants.VMHostvSanNetworkConfigurationTrafficType\n    $vmHostvSANNetworkConfigurationProperties.Ensure = 'Absent'\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n\nfunction New-MocksWhenTheVMHostvSANNetworkConfigurationIPInterfaceExistsAndEnsureIsAbsent {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostvSANNetworkConfigurationProperties = New-VMHostvSANNetworkConfigurationProperties\n\n    $vmHostvSANNetworkConfigurationProperties.InterfaceName = $script:constants.VMHostvSanNetworkConfigurationInterfaceOneName\n    $vmHostvSANNetworkConfigurationProperties.Ensure = 'Absent'\n\n    $vmHostvSANNetworkConfigurationProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/VmfsDatastoreMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VmfsDatastoreDSCProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        VMHostName = $script:constants.VMHostName\n        Name = $script:constants.DatastoreName\n        Path = $script:constants.ScsiLunCanonicalName\n    }\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksForVmfsDatastore {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $vmHostMock = $script:vmHost\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsNotCreatedAndBlockSizeMBIsNotSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Present'\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure()\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsNotCreatedAndBlockSizeMBIsSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $vmfsDatastoreBaseDSCProperties.BlockSizeMB = $script:constants.BlockSizeMB\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure()\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsNotCreatedAndStorageIOControlEnabledAndCongestionThresholdMillisecondAreSpecified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $vmfsDatastoreBaseDSCProperties.BlockSizeMB = $script:constants.BlockSizeMB\n    $vmfsDatastoreBaseDSCProperties.StorageIOControlEnabled = !$script:constants.StorageIOControlEnabled\n    $vmfsDatastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.CongestionThresholdMillisecond\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName New-Datastore -MockWith { return $datastoreMock }.GetNewClosure()\n    Mock -CommandName Set-Datastore -MockWith { return $null }.GetNewClosure()\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheVmfsDatastoreIsAlreadyRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName Remove-Datastore -MockWith { return $null }.GetNewClosure()\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheVmfsDatastoreIsNotRemoved {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Absent'\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n    Mock -CommandName Remove-Datastore -MockWith { return $null }.GetNewClosure()\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheVmfsDatastoreIsNotCreated {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesDoNotNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $vmfsDatastoreBaseDSCProperties.StorageIOControlEnabled = $script:constants.StorageIOControlEnabled\n    $vmfsDatastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.MaxCongestionThresholdMillisecond\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVmfsDatastoreIsAlreadyCreatedAndDatastoreCongestionThresholdMillisecondAndStorageIOControlEnabledValuesNeedToBeModified {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.Ensure = 'Present'\n    $vmfsDatastoreBaseDSCProperties.StorageIOControlEnabled = !$script:constants.StorageIOControlEnabled\n    $vmfsDatastoreBaseDSCProperties.CongestionThresholdMillisecond = $script:constants.CongestionThresholdMillisecond\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost }\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenTheVmfsDatastoreDoesNotExist {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $vmfsDatastoreBaseDSCProperties.BlockSizeMB = $script:constants.BlockSizeMB\n\n    Mock -CommandName Get-Datastore -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmfsDatastoreBaseDSCProperties\n}\n\nfunction New-MocksWhenTheVmfsDatastoreExists {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmfsDatastoreBaseDSCProperties = New-VmfsDatastoreDSCProperties\n\n    $datastoreMock = $script:datastore\n\n    Mock -CommandName Get-Datastore -MockWith { return $datastoreMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.DatastoreName -and $VMHost -eq $script:vmHost } -Verifiable\n\n    $vmfsDatastoreBaseDSCProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/Mocks/vCenterVMHostMocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-vCenterVMHostProperties {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = @{\n        Server = $script:constants.VIServerName\n        Credential = $script:credential\n        Name = $script:constants.VMHostName\n        Location = [string]::Empty\n        DatacenterName = $script:constants.DatacenterName\n        DatacenterLocation = $script:constants.DatacenterLocationItemOne\n        VMHostCredential = $script:credential\n    }\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksForvCenterVMHostInSet {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksForvCenterVMHost {\n    [CmdletBinding()]\n\n    $viServerMock = $script:viServer\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMHostIsNotAddedToThevCenterAndErrorOccursWhileAddingTheVMHostToThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VMHost -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Add-VMHost -MockWith { throw }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName -and $Location -eq $script:datacenterHostFolder -and $Credential -eq $script:credential -and !$Confirm } -Verifiable\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMHostIsNotAddedToThevCenterAndNoErrorOccursWhileAddingTheVMHostToThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n    $vCenterVMHostProperties.Port = $script:constants.VMHostPort\n    $vCenterVMHostProperties.Force = $true\n\n    Mock -CommandName Get-VMHost -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Add-VMHost -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterAndItIsOnTheDesiredLocation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    $vmHostMock = $script:vmHostWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Move-VMHost -MockWith { return $null }.GetNewClosure()\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterAndErrorOccursWhileMovingTheVMHostToTheDesiredLocation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    $vmHostMock = $script:vmHostWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Move-VMHost -MockWith { throw }.GetNewClosure()\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterAndNoErrorOccursWhileMovingTheVMHostToTheDesiredLocation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    $vmHostMock = $script:vmHostWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Move-VMHost -MockWith { return $null }.GetNewClosure()\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheVMHostIsAlreadyRemovedFromThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Absent'\n\n    Mock -CommandName Get-VMHost -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Remove-VMHost -MockWith { return $null }.GetNewClosure()\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheVMHostIsNotRemovedFromThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Absent'\n\n    $vmHostMock = $script:vmHostWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheVMHostIsNotRemovedFromThevCenterAndErrorOccursWhileRemovingTheVMHostFromThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Absent'\n\n    $vmHostMock = $script:vmHostWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Remove-VMHost -MockWith { throw }.GetNewClosure()\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentTheVMHostIsNotRemovedFromThevCenterAndNoErrorOccursWhileRemovingTheVMHostFromThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Absent'\n\n    $vmHostMock = $script:vmHostWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n    Mock -CommandName Remove-VMHost -MockWith { return $null }.GetNewClosure()\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheVMHostIsNotAddedToThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    Mock -CommandName Get-VMHost -MockWith { return $null }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheVMHostIsAlreadyAddedToThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    $vmHostMock = $script:vmHostWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterButNotOnTheDesiredLocation {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $vmHostMock = $script:vmHostWithInventoryItemLocationItemOneAsParent\n\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n\n    $vCenterVMHostProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTheVMHostIsAlreadyAddedToTheDesiredLocationOnThevCenter {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n\n    $vCenterVMHostProperties = New-vCenterVMHostProperties\n\n    $vCenterVMHostProperties.Ensure = 'Present'\n\n    $rootFolderViewBaseObjectMock = $script:rootFolderViewBaseObject\n    $inventoryRootFolderMock = $script:inventoryRootFolder\n    $locationDatacenterLocationItemOneMock = $script:locationDatacenterLocationItemOne\n    $datacenterWithDatacenterLocationItemOneAsParentMock = $script:datacenterWithDatacenterLocationItemOneAsParent\n    $datacenterHostFolderViewBaseObjectMock = $script:datacenterHostFolderViewBaseObject\n    $datacenterHostFolderMock = $script:datacenterHostFolder\n    $vmHostMock = $script:vmHostWithDatacenterHostFolderAsParent\n\n    Mock -CommandName Get-View -MockWith { return $rootFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:viServer.ExtensionData.Content.RootFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $inventoryRootFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:rootFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-Folder -MockWith { return $locationDatacenterLocationItemOneMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-Datacenter -MockWith { return $datacenterWithDatacenterLocationItemOneAsParentMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-View -MockWith { return $datacenterHostFolderViewBaseObjectMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterWithDatacenterLocationItemOneAsParent.ExtensionData.HostFolder } -Verifiable\n    Mock -CommandName Get-Inventory -MockWith { return $datacenterHostFolderMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Id -eq $script:datacenterHostFolderViewBaseObject.MoRef } -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -ParameterFilter { $Server -eq $script:viServer -and $Name -eq $script:constants.VMHostName } -Verifiable\n\n    $vCenterVMHostProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/TestUtils.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction Import-VMwareVSphereDSCModule {\n    <#\n    .SYNOPSIS\n\n    Imports the VMware.vSphereDSC module into the current session.\n\n    .DESCRIPTION\n\n    Imports the VMware.vSphereDSC module into the current session. Due to the fact that the module\n    contains PowerShell classes and that the 'Using module' statement works only with strings and\n    'ModuleSpecification' hashtables and can't include variables, the statement is wrapped in a Script\n    Block to allow the path to the psm1 file to be passed as a variable.\n    #>\n\n    $modulePath = (Get-Module -Name 'VMware.vSphereDSC' -ListAvailable).ModuleBase\n    $moduleFilePath = Join-Path -Path $modulePath -ChildPath 'VMware.vSphereDSC.psm1'\n\n    $scriptBody = \"Using module '$moduleFilePath'\"\n    $script = [ScriptBlock]::Create($scriptBody)\n    . $script\n}\n\nfunction Invoke-TestSetup {\n    [CmdletBinding()]\n\n    $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $mockModuleLocation = \"$unitTestsFolder\\TestHelpers\"\n\n    $env:PSModulePath = $mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [string] $ModulePath\n    )\n\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $ModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/VMware.VimAutomation.Core/PowerCLITypes.cs",
    "content": "/*\nCopyright(c) 2018-2020 VMware, Inc.All rights reserved\n\nThe BSD-2 license(the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n//------------------------------------------------------------------------------\n// <auto-generated>\n// This code was generated by a tool.\n//\n// Changes to this file may cause incorrect behavior and will be lost if\n// the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace VMware.Vim\n{\n    using System;\n    using System.Collections;\n    using System.Collections.Generic;\n    using System.Collections.Specialized;\n    using System.Linq;\n    using System.Net.Security;\n    using System.Runtime.Serialization;\n    using System.Security;\n    using System.Security.Cryptography;\n    using System.Security.Cryptography.X509Certificates;\n\n    public interface VimClient\n    {\n        VimVersion Version { get; set; }\n\n        object VimService { get; set; }\n\n        ServiceContent ServiceContent { get; set; }\n\n        string ServiceUrl { get; set; }\n\n        int ServiceTimeout { get; set; }\n\n        bool UseSystemProxy { get; set; }\n\n        string UserAgent { get; set; }\n\n        string SessionSecret { get; set; }\n\n        Action<X509Certificate2> CertificateValidationHandler { get; set; }\n\n        bool IgnoreServerCertificateErrors { get; set; }\n\n        ServiceContent Connect();\n        ServiceContent Connect(string serviceUrl);\n        ServiceContent Connect(string server, CommunicationProtocol? protocol, ushort? port);\n        UserSession Login(string username, string password);\n        UserSession Login(string serviceUrl, string username, string password);\n        void Logout();\n        UserSession ConnectToSession(string serviceUrl, string soapSessionId);\n        EntityViewBase FindEntityView(Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, string[] properties);\n        List<EntityViewBase> FindEntityViews(Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, string[] properties);\n        List<ViewBase> GetViews(IEnumerable<ManagedObjectReference> moRefs, string[] properties);\n        List<ViewBase> GetViews(ObjectContent[] objectContent, string[] properties);\n        List<ViewBase> GetViewsByMorefs(IEnumerable<ManagedObjectReference> moRefs, string[] properties);\n        ViewBase GetView(ManagedObjectReference moRef, string[] properties);\n        void Disconnect();\n        void SaveSession(string fileName);\n        void LoadSession(string fileName);\n        bool IsVimVersionOrHigher(VimVersion version);\n        object WaitForTask(ManagedObjectReference taskReference);\n    }\n\n    public enum ActionParameter\n    {\n        TargetName,\n        AlarmName,\n        OldStatus,\n        NewStatus,\n        TriggeringSummary,\n        DeclaringSummary,\n        EventDescription,\n        Target,\n        Alarm\n    }\n\n    public enum ActionType\n    {\n        MigrationV1,\n        VmPowerV1,\n        HostPowerV1,\n        HostMaintenanceV1,\n        StorageMigrationV1,\n        StoragePlacementV1,\n        PlacementV1,\n        HostInfraUpdateHaV1\n    }\n\n    public enum AffinityType\n    {\n        Memory,\n        Cpu\n    }\n\n    public enum AgentInstallFailedReason\n    {\n        NotEnoughSpaceOnDevice,\n        PrepareToUpgradeFailed,\n        AgentNotRunning,\n        AgentNotReachable,\n        InstallTimedout,\n        SignatureVerificationFailed,\n        AgentUploadFailed,\n        AgentUploadTimedout,\n        UnknownInstallerError\n    }\n\n    public enum AlarmFilterSpecAlarmTypeByEntity\n    {\n        EntityTypeAll,\n        EntityTypeHost,\n        EntityTypeVm\n    }\n\n    public enum AlarmFilterSpecAlarmTypeByTrigger\n    {\n        TriggerTypeAll,\n        TriggerTypeEvent,\n        TriggerTypeMetric\n    }\n\n    public enum AnswerFileValidationInfoStatus\n    {\n        Success,\n        Failed,\n        Failed_defaults\n    }\n\n    public enum ApplyHostProfileConfigurationResultStatus\n    {\n        Success,\n        Failed,\n        Reboot_failed,\n        Stateless_reboot_failed,\n        Check_compliance_failed,\n        State_not_satisfied,\n        Exit_maintenancemode_failed,\n        Canceled\n    }\n\n    public enum ArrayUpdateOperation\n    {\n        Add,\n        Remove,\n        Edit\n    }\n\n    public enum AutoStartAction\n    {\n        None,\n        SystemDefault,\n        PowerOn,\n        PowerOff,\n        GuestShutdown,\n        Suspend\n    }\n\n    public enum AutoStartWaitHeartbeatSetting\n    {\n        Yes,\n        No,\n        SystemDefault\n    }\n\n    public enum BaseConfigInfoDiskFileBackingInfoProvisioningType\n    {\n        Thin,\n        EagerZeroedThick,\n        LazyZeroedThick\n    }\n\n    public enum BatchResultResult\n    {\n        Success,\n        Fail\n    }\n\n    public enum CannotEnableVmcpForClusterReason\n    {\n        APDTimeoutDisabled,\n        IncompatibleHostVersion\n    }\n\n    public enum CannotMoveFaultToleranceVmMoveType\n    {\n        ResourcePool,\n        Cluster\n    }\n\n    public enum CannotPowerOffVmInClusterOperation\n    {\n        Suspend,\n        PowerOff,\n        GuestShutdown,\n        GuestSuspend\n    }\n\n    public enum CannotUseNetworkReason\n    {\n        NetworkReservationNotSupported,\n        MismatchedNetworkPolicies,\n        MismatchedDvsVersionOrVendor,\n        VMotionToUnsupportedNetworkType\n    }\n\n    public enum CheckTestType\n    {\n        SourceTests,\n        HostTests,\n        ResourcePoolTests,\n        DatastoreTests,\n        NetworkTests\n    }\n\n    public enum ClusterComputeResourceHCIWorkflowState\n    {\n        In_progress,\n        Done,\n        Invalid\n    }\n\n    public enum ClusterDasAamNodeStateDasState\n    {\n        Uninitialized,\n        Initialized,\n        Configuring,\n        Unconfiguring,\n        Running,\n        Error,\n        AgentShutdown,\n        NodeFailed\n    }\n\n    public enum ClusterDasConfigInfoHBDatastoreCandidate\n    {\n        UserSelectedDs,\n        AllFeasibleDs,\n        AllFeasibleDsWithUserPreference\n    }\n\n    public enum ClusterDasConfigInfoServiceState\n    {\n        Disabled,\n        Enabled\n    }\n\n    public enum ClusterDasConfigInfoVmMonitoringState\n    {\n        VmMonitoringDisabled,\n        VmMonitoringOnly,\n        VmAndAppMonitoring\n    }\n\n    public enum ClusterDasFdmAvailabilityState\n    {\n        Uninitialized,\n        Election,\n        Master,\n        ConnectedToMaster,\n        NetworkPartitionedFromMaster,\n        NetworkIsolated,\n        HostDown,\n        InitializationError,\n        UninitializationError,\n        FdmUnreachable\n    }\n\n    public enum ClusterDasVmSettingsIsolationResponse\n    {\n        None,\n        PowerOff,\n        Shutdown,\n        ClusterIsolationResponse\n    }\n\n    public enum ClusterDasVmSettingsRestartPriority\n    {\n        Disabled,\n        Lowest,\n        Low,\n        Medium,\n        High,\n        Highest,\n        ClusterRestartPriority\n    }\n\n    public enum ClusterHostInfraUpdateHaModeActionOperationType\n    {\n        EnterQuarantine,\n        ExitQuarantine,\n        EnterMaintenance\n    }\n\n    public enum ClusterInfraUpdateHaConfigInfoBehaviorType\n    {\n        Manual,\n        Automated\n    }\n\n    public enum ClusterInfraUpdateHaConfigInfoRemediationType\n    {\n        QuarantineMode,\n        MaintenanceMode\n    }\n\n    public enum ClusterPowerOnVmOption\n    {\n        OverrideAutomationLevel,\n        ReserveResources\n    }\n\n    public enum ClusterProfileServiceType\n    {\n        DRS,\n        HA,\n        DPM,\n        FT\n    }\n\n    public enum ClusterVmComponentProtectionSettingsStorageVmReaction\n    {\n        Disabled,\n        Warning,\n        RestartConservative,\n        RestartAggressive,\n        ClusterDefault\n    }\n\n    public enum ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared\n    {\n        None,\n        Reset,\n        UseClusterDefault\n    }\n\n    public enum ClusterVmReadinessReadyCondition\n    {\n        None,\n        PoweredOn,\n        GuestHbStatusGreen,\n        AppHbStatusGreen,\n        UseClusterDefault\n    }\n\n    public enum CommunicationProtocol\n    {\n        Http,\n        Https\n    }\n\n    public enum ComplianceResultStatus\n    {\n        Compliant,\n        NonCompliant,\n        Unknown,\n        Running\n    }\n\n    public enum ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState\n    {\n        Licensed,\n        Unlicensed,\n        Unknown\n    }\n\n    public enum ConfigSpecOperation\n    {\n        Add,\n        Edit,\n        Remove\n    }\n\n    public enum CustomizationLicenseDataMode\n    {\n        PerServer,\n        PerSeat\n    }\n\n    public enum CustomizationNetBIOSMode\n    {\n        EnableNetBIOSViaDhcp,\n        EnableNetBIOS,\n        DisableNetBIOS\n    }\n\n    public enum CustomizationSysprepRebootOption\n    {\n        Reboot,\n        Noreboot,\n        Shutdown\n    }\n\n    public enum DasConfigFaultDasConfigFaultReason\n    {\n        HostNetworkMisconfiguration,\n        HostMisconfiguration,\n        InsufficientPrivileges,\n        NoPrimaryAgentAvailable,\n        Other,\n        NoDatastoresConfigured,\n        CreateConfigVvolFailed,\n        VSanNotSupportedOnHost,\n        DasNetworkMisconfiguration\n    }\n\n    public enum DasVmPriority\n    {\n        Disabled,\n        Low,\n        Medium,\n        High\n    }\n\n    public enum DatastoreAccessible\n    {\n        True,\n        False\n    }\n\n    public enum DatastoreSummaryMaintenanceModeState\n    {\n        Normal,\n        EnteringMaintenance,\n        InMaintenance\n    }\n\n    public enum DayOfWeek\n    {\n        Sunday,\n        Monday,\n        Tuesday,\n        Wednesday,\n        Thursday,\n        Friday,\n        Saturday\n    }\n\n    public enum DeviceNotSupportedReason\n    {\n        Host,\n        Guest\n    }\n\n    public enum DiagnosticManagerLogCreator\n    {\n        Vpxd,\n        Vpxa,\n        Hostd,\n        Serverd,\n        Install,\n        VpxClient,\n        RecordLog\n    }\n\n    public enum DiagnosticManagerLogFormat\n    {\n        Plain\n    }\n\n    public enum DiagnosticPartitionStorageType\n    {\n        DirectAttached,\n        NetworkAttached\n    }\n\n    public enum DiagnosticPartitionType\n    {\n        SingleHost,\n        MultiHost\n    }\n\n    public enum DisallowedChangeByServiceDisallowedChange\n    {\n        HotExtendDisk\n    }\n\n    public enum DistributedVirtualPortgroupMetaTagName\n    {\n        DvsName,\n        PortgroupName,\n        PortIndex\n    }\n\n    public enum DistributedVirtualPortgroupPortgroupType\n    {\n        EarlyBinding,\n        LateBinding,\n        Ephemeral\n    }\n\n    public enum DistributedVirtualSwitchHostInfrastructureTrafficClass\n    {\n        Management,\n        FaultTolerance,\n        Vmotion,\n        VirtualMachine,\n        ISCSI,\n        Nfs,\n        Hbr,\n        Vsan,\n        Vdp\n    }\n\n    public enum DistributedVirtualSwitchHostMemberHostComponentState\n    {\n        Up,\n        Pending,\n        OutOfSync,\n        Warning,\n        Disconnected,\n        Down\n    }\n\n    public enum DistributedVirtualSwitchNetworkResourceControlVersion\n    {\n        Version2,\n        Version3\n    }\n\n    public enum DistributedVirtualSwitchNicTeamingPolicyMode\n    {\n        Loadbalance_ip,\n        Loadbalance_srcmac,\n        Loadbalance_srcid,\n        Failover_explicit,\n        Loadbalance_loadbased\n    }\n\n    public enum DistributedVirtualSwitchPortConnecteeConnecteeType\n    {\n        Pnic,\n        VmVnic,\n        HostConsoleVnic,\n        HostVmkVnic\n    }\n\n    public enum DistributedVirtualSwitchProductSpecOperationType\n    {\n        PreInstall,\n        Upgrade,\n        NotifyAvailableUpgrade,\n        ProceedWithUpgrade,\n        UpdateBundleInfo\n    }\n\n    public enum DpmBehavior\n    {\n        Manual,\n        Automated\n    }\n\n    public enum DrsBehavior\n    {\n        Manual,\n        PartiallyAutomated,\n        FullyAutomated\n    }\n\n    public enum DrsInjectorWorkloadCorrelationState\n    {\n        Correlated,\n        Uncorrelated\n    }\n\n    public enum DrsRecommendationReasonCode\n    {\n        FairnessCpuAvg,\n        FairnessMemAvg,\n        JointAffin,\n        AntiAffin,\n        HostMaint\n    }\n\n    public enum DVPortStatusVmDirectPathGen2InactiveReasonNetwork\n    {\n        PortNptIncompatibleDvs,\n        PortNptNoCompatibleNics,\n        PortNptNoVirtualFunctionsAvailable,\n        PortNptDisabledForPort\n    }\n\n    public enum DVPortStatusVmDirectPathGen2InactiveReasonOther\n    {\n        PortNptIncompatibleHost,\n        PortNptIncompatibleConnectee\n    }\n\n    public enum DvsEventPortBlockState\n    {\n        Unset,\n        Blocked,\n        Unblocked,\n        Unknown\n    }\n\n    public enum DvsFilterOnFailure\n    {\n        FailOpen,\n        FailClosed\n    }\n\n    public enum DVSMacLimitPolicyType\n    {\n        Allow,\n        Drop\n    }\n\n    public enum DvsNetworkRuleDirectionType\n    {\n        IncomingPackets,\n        OutgoingPackets,\n        Both\n    }\n\n    public enum EntityImportType\n    {\n        CreateEntityWithNewIdentifier,\n        CreateEntityWithOriginalIdentifier,\n        ApplyToEntitySpecified\n    }\n\n    public enum EntityType\n    {\n        DistributedVirtualSwitch,\n        DistributedVirtualPortgroup\n    }\n\n    public enum EventAlarmExpressionComparisonOperator\n    {\n        Equals,\n        NotEqualTo,\n        StartsWith,\n        DoesNotStartWith,\n        EndsWith,\n        DoesNotEndWith\n    }\n\n    public enum EventCategory\n    {\n        Info,\n        Warning,\n        Error,\n        User\n    }\n\n    public enum EventEventSeverity\n    {\n        Error,\n        Warning,\n        Info,\n        User\n    }\n\n    public enum EventFilterSpecRecursionOption\n    {\n        Self,\n        Children,\n        All\n    }\n\n    public enum FibreChannelPortType\n    {\n        Fabric,\n        Loop,\n        PointToPoint,\n        Unknown\n    }\n\n    public enum FileSystemMountInfoVStorageSupportStatus\n    {\n        VStorageSupported,\n        VStorageUnsupported,\n        VStorageUnknown\n    }\n\n    public enum FolderDesiredHostState\n    {\n        Maintenance,\n        Non_maintenance\n    }\n\n    public enum FtIssuesOnHostHostSelectionType\n    {\n        User,\n        Vc,\n        Drs\n    }\n\n    public enum GuestFileType\n    {\n        File,\n        Directory,\n        Symlink\n    }\n\n    public enum GuestInfoAppStateType\n    {\n        None,\n        AppStateOk,\n        AppStateNeedReset\n    }\n\n    public enum GuestOsDescriptorFirmwareType\n    {\n        Bios,\n        Efi\n    }\n\n    public enum GuestOsDescriptorSupportLevel\n    {\n        Experimental,\n        Legacy,\n        Terminated,\n        Supported,\n        Unsupported,\n        Deprecated,\n        TechPreview\n    }\n\n    public enum GuestRegKeyWowSpec\n    {\n        WOWNative,\n        WOW32,\n        WOW64\n    }\n\n    public enum HealthUpdateInfoComponentType\n    {\n        Memory,\n        Power,\n        Fan,\n        Network,\n        Storage\n    }\n\n    public enum HostAccessMode\n    {\n        AccessNone,\n        AccessAdmin,\n        AccessNoAccess,\n        AccessReadOnly,\n        AccessOther\n    }\n\n    public enum HostActiveDirectoryAuthenticationCertificateDigest\n    {\n        SHA1\n    }\n\n    public enum HostActiveDirectoryInfoDomainMembershipStatus\n    {\n        Unknown,\n        Ok,\n        NoServers,\n        ClientTrustBroken,\n        ServerTrustBroken,\n        InconsistentTrust,\n        OtherProblem\n    }\n\n    public enum HostCapabilityFtUnsupportedReason\n    {\n        VMotionNotLicensed,\n        MissingVMotionNic,\n        MissingFTLoggingNic,\n        FtNotLicensed,\n        HaAgentIssue,\n        UnsupportedProduct,\n        CpuHvUnsupported,\n        CpuHwmmuUnsupported,\n        CpuHvDisabled\n    }\n\n    public enum HostCapabilityUnmapMethodSupported\n    {\n        Priority,\n        Fixed,\n        Dynamic\n    }\n\n    public enum HostCapabilityVmDirectPathGen2UnsupportedReason\n    {\n        HostNptIncompatibleProduct,\n        HostNptIncompatibleHardware,\n        HostNptDisabled\n    }\n\n    public enum HostCertificateManagerCertificateInfoCertificateStatus\n    {\n        Unknown,\n        Expired,\n        Expiring,\n        ExpiringShortly,\n        ExpirationImminent,\n        Good\n    }\n\n    public enum HostConfigChangeMode\n    {\n        Modify,\n        Replace\n    }\n\n    public enum HostConfigChangeOperation\n    {\n        Add,\n        Remove,\n        Edit,\n        Ignore\n    }\n\n    public enum HostCpuPackageVendor\n    {\n        Unknown,\n        Intel,\n        Amd,\n        Hygon\n    }\n\n    public enum HostCpuPowerManagementInfoPolicyType\n    {\n        Off,\n        StaticPolicy,\n        DynamicPolicy\n    }\n\n    public enum HostCryptoState\n    {\n        Incapable,\n        Prepared,\n        Safe\n    }\n\n    public enum HostDasErrorEventHostDasErrorReason\n    {\n        ConfigFailed,\n        Timeout,\n        CommunicationInitFailed,\n        HealthCheckScriptFailed,\n        AgentFailed,\n        AgentShutdown,\n        IsolationAddressUnpingable,\n        Other\n    }\n\n    public enum HostDigestInfoDigestMethodType\n    {\n        SHA1,\n        MD5,\n        SHA256,\n        SHA384,\n        SHA512,\n        SM3_256\n    }\n\n    public enum HostDisconnectedEventReasonCode\n    {\n        SslThumbprintVerifyFailed,\n        LicenseExpired,\n        AgentUpgrade,\n        UserRequest,\n        InsufficientLicenses,\n        AgentOutOfDate,\n        PasswordDecryptFailure,\n        Unknown,\n        VcVRAMCapacityExceeded\n    }\n\n    public enum HostDiskPartitionInfoPartitionFormat\n    {\n        Gpt,\n        Mbr,\n        Unknown\n    }\n\n    public enum HostDiskPartitionInfoType\n    {\n        None,\n        Vmfs,\n        LinuxNative,\n        LinuxSwap,\n        Extended,\n        Ntfs,\n        VmkDiagnostic,\n        Vffs\n    }\n\n    public enum HostFeatureVersionKey\n    {\n        FaultTolerance\n    }\n\n    public enum HostFileSystemVolumeFileSystemType\n    {\n        VMFS,\n        NFS,\n        NFS41,\n        CIFS,\n        Vsan,\n        VFFS,\n        VVOL,\n        PMEM,\n        OTHER\n    }\n\n    public enum HostFirewallRuleDirection\n    {\n        Inbound,\n        Outbound\n    }\n\n    public enum HostFirewallRulePortType\n    {\n        Src,\n        Dst\n    }\n\n    public enum HostFirewallRuleProtocol\n    {\n        Tcp,\n        Udp\n    }\n\n    public enum HostGraphicsConfigGraphicsType\n    {\n        Shared,\n        SharedDirect\n    }\n\n    public enum HostGraphicsConfigSharedPassthruAssignmentPolicy\n    {\n        Performance,\n        Consolidation\n    }\n\n    public enum HostGraphicsInfoGraphicsType\n    {\n        Basic,\n        Shared,\n        Direct,\n        SharedDirect\n    }\n\n    public enum HostHardwareElementStatus\n    {\n        Unknown,\n        Green,\n        Yellow,\n        Red\n    }\n\n    public enum HostHasComponentFailureHostComponentType\n    {\n        Datastore\n    }\n\n    public enum HostImageAcceptanceLevel\n    {\n        Vmware_certified,\n        Vmware_accepted,\n        Partner,\n        Community\n    }\n\n    public enum HostIncompatibleForFaultToleranceReason\n    {\n        Product,\n        Processor\n    }\n\n    public enum HostIncompatibleForRecordReplayReason\n    {\n        Product,\n        Processor\n    }\n\n    public enum HostInternetScsiHbaChapAuthenticationType\n    {\n        ChapProhibited,\n        ChapDiscouraged,\n        ChapPreferred,\n        ChapRequired\n    }\n\n    public enum HostInternetScsiHbaDigestType\n    {\n        DigestProhibited,\n        DigestDiscouraged,\n        DigestPreferred,\n        DigestRequired\n    }\n\n    public enum HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType\n    {\n        DHCP,\n        AutoConfigured,\n        Static,\n        Other\n    }\n\n    public enum HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperation\n    {\n        Add,\n        Remove\n    }\n\n    public enum HostInternetScsiHbaNetworkBindingSupportType\n    {\n        Notsupported,\n        Optional,\n        Required\n    }\n\n    public enum HostInternetScsiHbaStaticTargetTargetDiscoveryMethod\n    {\n        StaticMethod,\n        SendTargetMethod,\n        SlpMethod,\n        IsnsMethod,\n        UnknownMethod\n    }\n\n    public enum HostIpConfigIpV6AddressConfigType\n    {\n        Other,\n        Manual,\n        Dhcp,\n        Linklayer,\n        Random\n    }\n\n    public enum HostIpConfigIpV6AddressStatus\n    {\n        Preferred,\n        Deprecated,\n        Invalid,\n        Inaccessible,\n        Unknown,\n        Tentative,\n        Duplicate\n    }\n\n    public enum HostLicensableResourceKey\n    {\n        NumCpuPackages,\n        NumCpuCores,\n        MemorySize,\n        MemoryForVms,\n        NumVmsStarted,\n        NumVmsStarting\n    }\n\n    public enum HostLockdownMode\n    {\n        LockdownDisabled,\n        LockdownNormal,\n        LockdownStrict\n    }\n\n    public enum HostLowLevelProvisioningManagerFileType\n    {\n        File,\n        VirtualDisk,\n        Directory\n    }\n\n    public enum HostLowLevelProvisioningManagerReloadTarget\n    {\n        CurrentConfig,\n        SnapshotConfig\n    }\n\n    public enum HostMountInfoInaccessibleReason\n    {\n        AllPathsDown_Start,\n        AllPathsDown_Timeout,\n        PermanentDeviceLoss\n    }\n\n    public enum HostMountMode\n    {\n        ReadWrite,\n        ReadOnly\n    }\n\n    public enum HostNasVolumeSecurityType\n    {\n        AUTH_SYS,\n        SEC_KRB5,\n        SEC_KRB5I\n    }\n\n    public enum HostNetStackInstanceCongestionControlAlgorithmType\n    {\n        Newreno,\n        Cubic\n    }\n\n    public enum HostNetStackInstanceSystemStackKey\n    {\n        DefaultTcpipStack,\n        Vmotion,\n        VSphereProvisioning\n    }\n\n    public enum HostNumericSensorHealthState\n    {\n        Unknown,\n        Green,\n        Yellow,\n        Red\n    }\n\n    public enum HostNumericSensorType\n    {\n        Fan,\n        Power,\n        Temperature,\n        Voltage,\n        Other,\n        Processor,\n        Memory,\n        Storage,\n        SystemBoard,\n        Battery,\n        Bios,\n        Cable,\n        Watchdog\n    }\n\n    public enum HostOpaqueSwitchOpaqueSwitchState\n    {\n        Up,\n        Warning,\n        Down\n    }\n\n    public enum HostPatchManagerInstallState\n    {\n        HostRestarted,\n        ImageActive\n    }\n\n    public enum HostPatchManagerIntegrityStatus\n    {\n        Validated,\n        KeyNotFound,\n        KeyRevoked,\n        KeyExpired,\n        DigestMismatch,\n        NotEnoughSignatures,\n        ValidationError\n    }\n\n    public enum HostPatchManagerReason\n    {\n        Obsoleted,\n        MissingPatch,\n        MissingLib,\n        HasDependentPatch,\n        ConflictPatch,\n        ConflictLib\n    }\n\n    public enum HostPowerOperationType\n    {\n        PowerOn,\n        PowerOff\n    }\n\n    public enum HostProfileManagerAnswerFileStatus\n    {\n        Valid,\n        Invalid,\n        Unknown\n    }\n\n    public enum HostProfileManagerCompositionResultResultElementStatus\n    {\n        Success,\n        Error\n    }\n\n    public enum HostProfileManagerCompositionValidationResultResultElementStatus\n    {\n        Success,\n        Error\n    }\n\n    public enum HostProfileManagerTaskListRequirement\n    {\n        MaintenanceModeRequired,\n        RebootRequired\n    }\n\n    public enum HostProfileValidationFailureInfoUpdateType\n    {\n        HostBased,\n        Import,\n        Edit,\n        Compose\n    }\n\n    public enum HostProfileValidationState\n    {\n        Ready,\n        Running,\n        Failed\n    }\n\n    public enum HostProtocolEndpointPEType\n    {\n        Block,\n        Nas\n    }\n\n    public enum HostProtocolEndpointProtocolEndpointType\n    {\n        Scsi,\n        Nfs,\n        Nfs4x\n    }\n\n    public enum HostReplayUnsupportedReason\n    {\n        IncompatibleProduct,\n        IncompatibleCpu,\n        HvDisabled,\n        CpuidLimitSet,\n        OldBIOS,\n        Unknown\n    }\n\n    public enum HostRuntimeInfoNetStackInstanceRuntimeInfoState\n    {\n        Inactive,\n        Active,\n        Deactivating,\n        Activating\n    }\n\n    public enum HostServicePolicy\n    {\n        On,\n        Automatic,\n        Off\n    }\n\n    public enum HostSnmpAgentCapability\n    {\n        COMPLETE,\n        DIAGNOSTICS,\n        CONFIGURATION\n    }\n\n    public enum HostStandbyMode\n    {\n        Entering,\n        Exiting,\n        In,\n        None\n    }\n\n    public enum HostSystemConnectionState\n    {\n        Connected,\n        NotResponding,\n        Disconnected\n    }\n\n    public enum HostSystemIdentificationInfoIdentifier\n    {\n        AssetTag,\n        ServiceTag,\n        OemSpecificString,\n        EnclosureSerialNumberTag,\n        SerialNumberTag\n    }\n\n    public enum HostSystemPowerState\n    {\n        PoweredOn,\n        PoweredOff,\n        StandBy,\n        Unknown\n    }\n\n    public enum HostSystemRemediationStateState\n    {\n        RemediationReady,\n        PrecheckRemediationRunning,\n        PrecheckRemediationComplete,\n        PrecheckRemediationFailed,\n        RemediationRunning,\n        RemediationFailed\n    }\n\n    public enum HostTpmAttestationInfoAcceptanceStatus\n    {\n        NotAccepted,\n        Accepted\n    }\n\n    public enum HostUnresolvedVmfsExtentUnresolvedReason\n    {\n        DiskIdMismatch,\n        UuidConflict\n    }\n\n    public enum HostUnresolvedVmfsResolutionSpecVmfsUuidResolution\n    {\n        Resignature,\n        ForceMount\n    }\n\n    public enum HostVirtualNicManagerNicType\n    {\n        Vmotion,\n        FaultToleranceLogging,\n        VSphereReplication,\n        VSphereReplicationNFC,\n        Management,\n        Vsan,\n        VSphereProvisioning,\n        VsanWitness\n    }\n\n    public enum HostVmciAccessManagerMode\n    {\n        Grant,\n        Replace,\n        Revoke\n    }\n\n    public enum HostVmfsVolumeUnmapBandwidthPolicy\n    {\n        Fixed,\n        Dynamic\n    }\n\n    public enum HostVmfsVolumeUnmapPriority\n    {\n        None,\n        Low\n    }\n\n    public enum HttpNfcLeaseManifestEntryChecksumType\n    {\n        Sha1,\n        Sha256\n    }\n\n    public enum HttpNfcLeaseMode\n    {\n        PushOrGet,\n        Pull\n    }\n\n    public enum HttpNfcLeaseState\n    {\n        Initializing,\n        Ready,\n        Done,\n        Error\n    }\n\n    public enum IncompatibleHostForVmReplicationIncompatibleReason\n    {\n        Rpo,\n        NetCompression\n    }\n\n    public enum InternetScsiSnsDiscoveryMethod\n    {\n        IsnsStatic,\n        IsnsDhcp,\n        IsnsSlp\n    }\n\n    public enum InvalidDasConfigArgumentEntryForInvalidArgument\n    {\n        AdmissionControl,\n        UserHeartbeatDs,\n        VmConfig\n    }\n\n    public enum InvalidProfileReferenceHostReason\n    {\n        IncompatibleVersion,\n        MissingReferenceHost\n    }\n\n    public enum IoFilterOperation\n    {\n        Install,\n        Uninstall,\n        Upgrade\n    }\n\n    public enum IoFilterType\n    {\n        Cache,\n        Replication,\n        Encryption,\n        Compression,\n        Inspection,\n        DatastoreIoControl,\n        DataProvider\n    }\n\n    public enum IscsiPortInfoPathStatus\n    {\n        NotUsed,\n        Active,\n        StandBy,\n        LastActive\n    }\n\n    public enum LatencySensitivitySensitivityLevel\n    {\n        Low,\n        Normal,\n        Medium,\n        High,\n        Custom\n    }\n\n    public enum LicenseAssignmentFailedReason\n    {\n        KeyEntityMismatch,\n        DowngradeDisallowed,\n        InventoryNotManageableByVirtualCenter,\n        HostsUnmanageableByVirtualCenterWithoutLicenseServer\n    }\n\n    public enum LicenseFeatureInfoSourceRestriction\n    {\n        Unrestricted,\n        Served,\n        File\n    }\n\n    public enum LicenseFeatureInfoState\n    {\n        Enabled,\n        Disabled,\n        Optional\n    }\n\n    public enum LicenseFeatureInfoUnit\n    {\n        Host,\n        CpuCore,\n        CpuPackage,\n        Server,\n        Vm\n    }\n\n    public enum LicenseManagerLicenseKey\n    {\n        EsxFull,\n        EsxVmtn,\n        EsxExpress,\n        San,\n        Iscsi,\n        Nas,\n        Vsmp,\n        Backup,\n        Vc,\n        VcExpress,\n        EsxHost,\n        GsxHost,\n        ServerHost,\n        DrsPower,\n        Vmotion,\n        Drs,\n        Das\n    }\n\n    public enum LicenseManagerState\n    {\n        Initializing,\n        Normal,\n        Marginal,\n        Fault\n    }\n\n    public enum LicenseReservationInfoState\n    {\n        NotUsed,\n        NoLicense,\n        UnlicensedUse,\n        Licensed\n    }\n\n    public enum LinkDiscoveryProtocolConfigOperationType\n    {\n        None,\n        Listen,\n        Advertise,\n        Both\n    }\n\n    public enum LinkDiscoveryProtocolConfigProtocolType\n    {\n        Cdp,\n        Lldp\n    }\n\n    public enum ManagedEntityStatus\n    {\n        Gray,\n        Green,\n        Yellow,\n        Red\n    }\n\n    public enum MetricAlarmOperator\n    {\n        IsAbove,\n        IsBelow\n    }\n\n    public enum MultipathState\n    {\n        Standby,\n        Active,\n        Disabled,\n        Dead,\n        Unknown\n    }\n\n    public enum NetBIOSConfigInfoMode\n    {\n        Unknown,\n        Enabled,\n        Disabled,\n        EnabledViaDHCP\n    }\n\n    public enum NetIpConfigInfoIpAddressOrigin\n    {\n        Other,\n        Manual,\n        Dhcp,\n        Linklayer,\n        Random\n    }\n\n    public enum NetIpConfigInfoIpAddressStatus\n    {\n        Preferred,\n        Deprecated,\n        Invalid,\n        Inaccessible,\n        Unknown,\n        Tentative,\n        Duplicate\n    }\n\n    public enum NetIpStackInfoEntryType\n    {\n        Other,\n        Invalid,\n        Dynamic,\n        Manual\n    }\n\n    public enum NetIpStackInfoPreference\n    {\n        Reserved,\n        Low,\n        Medium,\n        High\n    }\n\n    public enum NotSupportedDeviceForFTDeviceType\n    {\n        VirtualVmxnet3,\n        ParaVirtualSCSIController\n    }\n\n    public enum NumVirtualCpusIncompatibleReason\n    {\n        RecordReplay,\n        FaultTolerance\n    }\n\n    public enum NvdimmInterleaveSetState\n    {\n        Invalid,\n        Active\n    }\n\n    public enum NvdimmNamespaceDetailsHealthStatus\n    {\n        Normal,\n        Missing,\n        LabelMissing,\n        InterleaveBroken,\n        LabelInconsistent\n    }\n\n    public enum NvdimmNamespaceDetailsState\n    {\n        Invalid,\n        NotInUse,\n        InUse\n    }\n\n    public enum NvdimmNamespaceHealthStatus\n    {\n        Normal,\n        Missing,\n        LabelMissing,\n        InterleaveBroken,\n        LabelInconsistent,\n        BttCorrupt,\n        BadBlockSize\n    }\n\n    public enum NvdimmNamespaceState\n    {\n        Invalid,\n        NotInUse,\n        InUse\n    }\n\n    public enum NvdimmNamespaceType\n    {\n        BlockNamespace,\n        PersistentNamespace\n    }\n\n    public enum NvdimmNvdimmHealthInfoState\n    {\n        Normal,\n        Error\n    }\n\n    public enum NvdimmRangeType\n    {\n        VolatileRange,\n        PersistentRange,\n        ControlRange,\n        BlockRange,\n        VolatileVirtualDiskRange,\n        VolatileVirtualCDRange,\n        PersistentVirtualDiskRange,\n        PersistentVirtualCDRange\n    }\n\n    public enum ObjectUpdateKind\n    {\n        Modify,\n        Enter,\n        Leave\n    }\n\n    public enum OvfConsumerOstNodeType\n    {\n        Envelope,\n        VirtualSystem,\n        VirtualSystemCollection\n    }\n\n    public enum OvfCreateImportSpecParamsDiskProvisioningType\n    {\n        MonolithicSparse,\n        MonolithicFlat,\n        TwoGbMaxExtentSparse,\n        TwoGbMaxExtentFlat,\n        Thin,\n        Thick,\n        SeSparse,\n        EagerZeroedThick,\n        Sparse,\n        Flat\n    }\n\n    public enum PerfFormat\n    {\n        Normal,\n        Csv\n    }\n\n    public enum PerformanceManagerUnit\n    {\n        Percent,\n        KiloBytes,\n        MegaBytes,\n        MegaHertz,\n        Number,\n        Microsecond,\n        Millisecond,\n        Second,\n        KiloBytesPerSecond,\n        MegaBytesPerSecond,\n        Watt,\n        Joule,\n        TeraBytes\n    }\n\n    public enum PerfStatsType\n    {\n        Absolute,\n        Delta,\n        Rate\n    }\n\n    public enum PerfSummaryType\n    {\n        Average,\n        Maximum,\n        Minimum,\n        Latest,\n        Summation,\n        None\n    }\n\n    public enum PhysicalNicResourcePoolSchedulerDisallowedReason\n    {\n        UserOptOut,\n        HardwareUnsupported\n    }\n\n    public enum PhysicalNicVmDirectPathGen2SupportedMode\n    {\n        Upt\n    }\n\n    public enum PlacementAffinityRuleRuleScope\n    {\n        Cluster,\n        Host,\n        StoragePod,\n        Datastore\n    }\n\n    public enum PlacementAffinityRuleRuleType\n    {\n        Affinity,\n        AntiAffinity,\n        SoftAffinity,\n        SoftAntiAffinity\n    }\n\n    public enum PlacementSpecPlacementType\n    {\n        Create,\n        Reconfigure,\n        Relocate,\n        Clone\n    }\n\n    public enum PortGroupConnecteeType\n    {\n        VirtualMachine,\n        SystemManagement,\n        Host,\n        Unknown\n    }\n\n    public enum ProfileExecuteResultStatus\n    {\n        Success,\n        NeedInput,\n        Error\n    }\n\n    public enum ProfileNumericComparator\n    {\n        LessThan,\n        LessThanEqual,\n        Equal,\n        NotEqual,\n        GreaterThanEqual,\n        GreaterThan\n    }\n\n    public enum ProfileParameterMetadataRelationType\n    {\n        Dynamic_relation,\n        Extensible_relation,\n        Localizable_relation,\n        Static_relation,\n        Validation_relation\n    }\n\n    public enum PropertyChangeOp\n    {\n        Add,\n        Remove,\n        Assign,\n        IndirectRemove\n    }\n\n    public enum QuarantineModeFaultFaultType\n    {\n        NoCompatibleNonQuarantinedHost,\n        CorrectionDisallowed,\n        CorrectionImpact\n    }\n\n    public enum QuiesceMode\n    {\n        Application,\n        Filesystem,\n        None\n    }\n\n    public enum RecommendationReasonCode\n    {\n        FairnessCpuAvg,\n        FairnessMemAvg,\n        JointAffin,\n        AntiAffin,\n        HostMaint,\n        EnterStandby,\n        ReservationCpu,\n        ReservationMem,\n        PowerOnVm,\n        PowerSaving,\n        IncreaseCapacity,\n        CheckResource,\n        UnreservedCapacity,\n        VmHostHardAffinity,\n        VmHostSoftAffinity,\n        BalanceDatastoreSpaceUsage,\n        BalanceDatastoreIOLoad,\n        BalanceDatastoreIOPSReservation,\n        DatastoreMaint,\n        VirtualDiskJointAffin,\n        VirtualDiskAntiAffin,\n        DatastoreSpaceOutage,\n        StoragePlacement,\n        IolbDisabledInternal,\n        XvmotionPlacement,\n        NetworkBandwidthReservation,\n        HostInDegradation,\n        HostExitDegradation,\n        MaxVmsConstraint,\n        FtConstraints\n    }\n\n    public enum RecommendationType\n    {\n        V1\n    }\n\n    public enum ReplicationDiskConfigFaultReasonForFault\n    {\n        DiskNotFound,\n        DiskTypeNotSupported,\n        InvalidDiskKey,\n        InvalidDiskReplicationId,\n        DuplicateDiskReplicationId,\n        InvalidPersistentFilePath,\n        ReconfigureDiskReplicationIdNotAllowed\n    }\n\n    public enum ReplicationVmConfigFaultReasonForFault\n    {\n        IncompatibleHwVersion,\n        InvalidVmReplicationId,\n        InvalidGenerationNumber,\n        OutOfBoundsRpoValue,\n        InvalidDestinationIpAddress,\n        InvalidDestinationPort,\n        InvalidExtraVmOptions,\n        StaleGenerationNumber,\n        ReconfigureVmReplicationIdNotAllowed,\n        CannotRetrieveVmReplicationConfiguration,\n        ReplicationAlreadyEnabled,\n        InvalidPriorConfiguration,\n        ReplicationNotEnabled,\n        ReplicationConfigurationFailed,\n        EncryptedVm,\n        InvalidThumbprint,\n        IncompatibleDevice\n    }\n\n    public enum ReplicationVmFaultReasonForFault\n    {\n        NotConfigured,\n        PoweredOff,\n        Suspended,\n        PoweredOn,\n        OfflineReplicating,\n        InvalidState,\n        InvalidInstanceId,\n        CloseDiskError,\n        GroupExist\n    }\n\n    public enum ReplicationVmInProgressFaultActivity\n    {\n        FullSync,\n        Delta\n    }\n\n    public enum ReplicationVmState\n    {\n        None,\n        Paused,\n        Syncing,\n        Idle,\n        Active,\n        Error\n    }\n\n    public enum ScheduledHardwareUpgradeInfoHardwareUpgradePolicy\n    {\n        Never,\n        OnSoftPowerOff,\n        Always\n    }\n\n    public enum ScheduledHardwareUpgradeInfoHardwareUpgradeStatus\n    {\n        None,\n        Pending,\n        Success,\n        Failed\n    }\n\n    public enum ScsiDiskType\n    {\n        Native512,\n        Emulated512,\n        Native4k,\n        SoftwareEmulated4k,\n        Unknown\n    }\n\n    public enum ScsiLunDescriptorQuality\n    {\n        HighQuality,\n        MediumQuality,\n        LowQuality,\n        UnknownQuality\n    }\n\n    public enum ScsiLunState\n    {\n        UnknownState,\n        Ok,\n        Error,\n        Off,\n        Quiesced,\n        Degraded,\n        LostCommunication,\n        Timeout\n    }\n\n    public enum ScsiLunType\n    {\n        Disk,\n        Tape,\n        Printer,\n        Processor,\n        Worm,\n        Cdrom,\n        Scanner,\n        OpticalDevice,\n        MediaChanger,\n        Communications,\n        StorageArrayController,\n        Enclosure,\n        Unknown\n    }\n\n    public enum ScsiLunVStorageSupportStatus\n    {\n        VStorageSupported,\n        VStorageUnsupported,\n        VStorageUnknown\n    }\n\n    public enum SessionManagerHttpServiceRequestSpecMethod\n    {\n        HttpOptions,\n        HttpGet,\n        HttpHead,\n        HttpPost,\n        HttpPut,\n        HttpDelete,\n        HttpTrace,\n        HttpConnect\n    }\n\n    public enum SharesLevel\n    {\n        Low,\n        Normal,\n        High,\n        Custom\n    }\n\n    public enum SimpleCommandEncoding\n    {\n        CSV,\n        HEX,\n        STRING\n    }\n\n    public enum SlpDiscoveryMethod\n    {\n        SlpDhcp,\n        SlpAutoUnicast,\n        SlpAutoMulticast,\n        SlpManual\n    }\n\n    public enum SoftwarePackageConstraint\n    {\n        Equals,\n        LessThan,\n        LessThanEqual,\n        GreaterThanEqual,\n        GreaterThan\n    }\n\n    public enum SoftwarePackageVibType\n    {\n        Bootbank,\n        Tools,\n        Meta\n    }\n\n    public enum StateAlarmOperator\n    {\n        IsEqual,\n        IsUnequal\n    }\n\n    public enum StorageDrsPodConfigInfoBehavior\n    {\n        Manual,\n        Automated\n    }\n\n    public enum StorageDrsSpaceLoadBalanceConfigSpaceThresholdMode\n    {\n        Utilization,\n        FreeSpace\n    }\n\n    public enum StorageIORMThresholdMode\n    {\n        Automatic,\n        Manual\n    }\n\n    public enum StoragePlacementSpecPlacementType\n    {\n        Create,\n        Reconfigure,\n        Relocate,\n        Clone\n    }\n\n    public enum TaskFilterSpecRecursionOption\n    {\n        Self,\n        Children,\n        All\n    }\n\n    public enum TaskFilterSpecTimeOption\n    {\n        QueuedTime,\n        StartedTime,\n        CompletedTime\n    }\n\n    public enum TaskInfoState\n    {\n        Queued,\n        Running,\n        Success,\n        Error\n    }\n\n    public enum ThirdPartyLicenseAssignmentFailedReason\n    {\n        LicenseAssignmentFailed,\n        ModuleNotInstalled\n    }\n\n    public enum UpgradePolicy\n    {\n        Manual,\n        UpgradeAtPowerCycle\n    }\n\n    public enum ValidateMigrationTestType\n    {\n        SourceTests,\n        CompatibilityTests,\n        DiskAccessibilityTests,\n        ResourceTests\n    }\n\n    public enum VAppAutoStartAction\n    {\n        None,\n        PowerOn,\n        PowerOff,\n        GuestShutdown,\n        Suspend\n    }\n\n    public enum VAppCloneSpecProvisioningType\n    {\n        SameAsSource,\n        Thin,\n        Thick\n    }\n\n    public enum VAppIPAssignmentInfoAllocationSchemes\n    {\n        Dhcp,\n        Ovfenv\n    }\n\n    public enum VAppIPAssignmentInfoIpAllocationPolicy\n    {\n        DhcpPolicy,\n        TransientPolicy,\n        FixedPolicy,\n        FixedAllocatedPolicy\n    }\n\n    public enum VAppIPAssignmentInfoProtocols\n    {\n        IPv4,\n        IPv6\n    }\n\n    public enum VchaClusterMode\n    {\n        Enabled,\n        Disabled,\n        Maintenance\n    }\n\n    public enum VchaClusterState\n    {\n        Healthy,\n        Degraded,\n        Isolated\n    }\n\n    public enum VchaNodeRole\n    {\n        Active,\n        Passive,\n        Witness\n    }\n\n    public enum VchaNodeState\n    {\n        Up,\n        Down\n    }\n\n    public enum VchaState\n    {\n        Configured,\n        NotConfigured,\n        Invalid,\n        Prepared\n    }\n\n    public enum VFlashModuleNotSupportedReason\n    {\n        CacheModeNotSupported,\n        CacheConsistencyTypeNotSupported,\n        CacheBlockSizeNotSupported,\n        CacheReservationNotSupported,\n        DiskSizeNotSupported\n    }\n\n    public enum VimVersion\n    {\n        Vim67,\n        Vim60,\n        Vim65\n    }\n\n    public enum VirtualAppVAppState\n    {\n        Started,\n        Stopped,\n        Starting,\n        Stopping\n    }\n\n    public enum VirtualDeviceConfigSpecFileOperation\n    {\n        Create,\n        Destroy,\n        Replace\n    }\n\n    public enum VirtualDeviceConfigSpecOperation\n    {\n        Add,\n        Remove,\n        Edit\n    }\n\n    public enum VirtualDeviceConnectInfoMigrateConnectOp\n    {\n        Connect,\n        Disconnect,\n        Unset\n    }\n\n    public enum VirtualDeviceConnectInfoStatus\n    {\n        Ok,\n        RecoverableError,\n        UnrecoverableError,\n        Untried\n    }\n\n    public enum VirtualDeviceFileExtension\n    {\n        Iso,\n        Flp,\n        Vmdk,\n        Dsk,\n        Rdm\n    }\n\n    public enum VirtualDeviceURIBackingOptionDirection\n    {\n        Server,\n        Client\n    }\n\n    public enum VirtualDiskAdapterType\n    {\n        Ide,\n        BusLogic,\n        LsiLogic\n    }\n\n    public enum VirtualDiskCompatibilityMode\n    {\n        VirtualMode,\n        PhysicalMode\n    }\n\n    public enum VirtualDiskDeltaDiskFormat\n    {\n        RedoLogFormat,\n        NativeFormat,\n        SeSparseFormat\n    }\n\n    public enum VirtualDiskDeltaDiskFormatVariant\n    {\n        VmfsSparseVariant,\n        VsanSparseVariant\n    }\n\n    public enum VirtualDiskMode\n    {\n        Persistent,\n        Nonpersistent,\n        Undoable,\n        Independent_persistent,\n        Independent_nonpersistent,\n        Append\n    }\n\n    public enum VirtualDiskRuleSpecRuleType\n    {\n        Affinity,\n        AntiAffinity,\n        Disabled\n    }\n\n    public enum VirtualDiskSharing\n    {\n        SharingNone,\n        SharingMultiWriter\n    }\n\n    public enum VirtualDiskType\n    {\n        Preallocated,\n        Thin,\n        SeSparse,\n        Rdm,\n        Rdmp,\n        Raw,\n        Delta,\n        Sparse2Gb,\n        Thick2Gb,\n        EagerZeroedThick,\n        SparseMonolithic,\n        FlatMonolithic,\n        Thick\n    }\n\n    public enum VirtualDiskVFlashCacheConfigInfoCacheConsistencyType\n    {\n        Strong,\n        Weak\n    }\n\n    public enum VirtualDiskVFlashCacheConfigInfoCacheMode\n    {\n        Write_thru,\n        Write_back\n    }\n\n    public enum VirtualEthernetCardLegacyNetworkDeviceName\n    {\n        Bridged,\n        Nat,\n        Hostonly\n    }\n\n    public enum VirtualEthernetCardMacType\n    {\n        Manual,\n        Generated,\n        Assigned\n    }\n\n    public enum VirtualMachineAppHeartbeatStatusType\n    {\n        AppStatusGray,\n        AppStatusGreen,\n        AppStatusRed\n    }\n\n    public enum VirtualMachineBootOptionsNetworkBootProtocolType\n    {\n        Ipv4,\n        Ipv6\n    }\n\n    public enum VirtualMachineConfigInfoNpivWwnType\n    {\n        Vc,\n        Host,\n        External\n    }\n\n    public enum VirtualMachineConfigInfoSwapPlacementType\n    {\n        Inherit,\n        VmDirectory,\n        HostLocal\n    }\n\n    public enum VirtualMachineConfigSpecEncryptedVMotionModes\n    {\n        Disabled,\n        Opportunistic,\n        Required\n    }\n\n    public enum VirtualMachineConfigSpecNpivWwnOp\n    {\n        Generate,\n        Set,\n        Remove,\n        Extend\n    }\n\n    public enum VirtualMachineConnectionState\n    {\n        Connected,\n        Disconnected,\n        Orphaned,\n        Inaccessible,\n        Invalid\n    }\n\n    public enum VirtualMachineCryptoState\n    {\n        Unlocked,\n        Locked\n    }\n\n    public enum VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther\n    {\n        VmNptIncompatibleHost,\n        VmNptIncompatibleNetwork\n    }\n\n    public enum VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm\n    {\n        VmNptIncompatibleGuest,\n        VmNptIncompatibleGuestDriver,\n        VmNptIncompatibleAdapterType,\n        VmNptDisabledOrDisconnectedAdapter,\n        VmNptIncompatibleAdapterFeatures,\n        VmNptIncompatibleBackingType,\n        VmNptInsufficientMemoryReservation,\n        VmNptFaultToleranceOrRecordReplayConfigured,\n        VmNptConflictingIOChainConfigured,\n        VmNptMonitorBlocks,\n        VmNptConflictingOperationInProgress,\n        VmNptRuntimeError,\n        VmNptOutOfIntrVector,\n        VmNptVMCIActive\n    }\n\n    public enum VirtualMachineFaultToleranceState\n    {\n        NotConfigured,\n        Disabled,\n        Enabled,\n        NeedSecondary,\n        Starting,\n        Running\n    }\n\n    public enum VirtualMachineFaultToleranceType\n    {\n        Unset,\n        RecordReplay,\n        Checkpointing\n    }\n\n    public enum VirtualMachineFileLayoutExFileType\n    {\n        Config,\n        ExtendedConfig,\n        DiskDescriptor,\n        DiskExtent,\n        DigestDescriptor,\n        DigestExtent,\n        DiskReplicationState,\n        Log,\n        Stat,\n        NamespaceData,\n        Nvram,\n        SnapshotData,\n        SnapshotMemory,\n        SnapshotList,\n        SnapshotManifestList,\n        Suspend,\n        SuspendMemory,\n        Swap,\n        Uwswap,\n        Core,\n        Screenshot,\n        FtMetadata,\n        GuestCustomization\n    }\n\n    public enum VirtualMachineFlagInfoMonitorType\n    {\n        Release,\n        Debug,\n        Stats\n    }\n\n    public enum VirtualMachineFlagInfoVirtualExecUsage\n    {\n        HvAuto,\n        HvOn,\n        HvOff\n    }\n\n    public enum VirtualMachineFlagInfoVirtualMmuUsage\n    {\n        Automatic,\n        On,\n        Off\n    }\n\n    public enum VirtualMachineForkConfigInfoChildType\n    {\n        None,\n        Persistent,\n        Nonpersistent\n    }\n\n    public enum VirtualMachineGuestOsFamily\n    {\n        WindowsGuest,\n        LinuxGuest,\n        NetwareGuest,\n        SolarisGuest,\n        DarwinGuestFamily,\n        OtherGuestFamily\n    }\n\n    public enum VirtualMachineGuestOsIdentifier\n    {\n        DosGuest,\n        Win31Guest,\n        Win95Guest,\n        Win98Guest,\n        WinMeGuest,\n        WinNTGuest,\n        Win2000ProGuest,\n        Win2000ServGuest,\n        Win2000AdvServGuest,\n        WinXPHomeGuest,\n        WinXPProGuest,\n        WinXPPro64Guest,\n        WinNetWebGuest,\n        WinNetStandardGuest,\n        WinNetEnterpriseGuest,\n        WinNetDatacenterGuest,\n        WinNetBusinessGuest,\n        WinNetStandard64Guest,\n        WinNetEnterprise64Guest,\n        WinLonghornGuest,\n        WinLonghorn64Guest,\n        WinNetDatacenter64Guest,\n        WinVistaGuest,\n        WinVista64Guest,\n        Windows7Guest,\n        Windows7_64Guest,\n        Windows7Server64Guest,\n        Windows8Guest,\n        Windows8_64Guest,\n        Windows8Server64Guest,\n        Windows9Guest,\n        Windows9_64Guest,\n        Windows9Server64Guest,\n        WindowsHyperVGuest,\n        FreebsdGuest,\n        Freebsd64Guest,\n        Freebsd11Guest,\n        Freebsd11_64Guest,\n        Freebsd12Guest,\n        Freebsd12_64Guest,\n        RedhatGuest,\n        Rhel2Guest,\n        Rhel3Guest,\n        Rhel3_64Guest,\n        Rhel4Guest,\n        Rhel4_64Guest,\n        Rhel5Guest,\n        Rhel5_64Guest,\n        Rhel6Guest,\n        Rhel6_64Guest,\n        Rhel7Guest,\n        Rhel7_64Guest,\n        Rhel8_64Guest,\n        CentosGuest,\n        Centos64Guest,\n        Centos6Guest,\n        Centos6_64Guest,\n        Centos7Guest,\n        Centos7_64Guest,\n        Centos8_64Guest,\n        OracleLinuxGuest,\n        OracleLinux64Guest,\n        OracleLinux6Guest,\n        OracleLinux6_64Guest,\n        OracleLinux7Guest,\n        OracleLinux7_64Guest,\n        OracleLinux8_64Guest,\n        SuseGuest,\n        Suse64Guest,\n        SlesGuest,\n        Sles64Guest,\n        Sles10Guest,\n        Sles10_64Guest,\n        Sles11Guest,\n        Sles11_64Guest,\n        Sles12Guest,\n        Sles12_64Guest,\n        Sles15_64Guest,\n        Nld9Guest,\n        OesGuest,\n        SjdsGuest,\n        MandrakeGuest,\n        MandrivaGuest,\n        Mandriva64Guest,\n        TurboLinuxGuest,\n        TurboLinux64Guest,\n        UbuntuGuest,\n        Ubuntu64Guest,\n        Debian4Guest,\n        Debian4_64Guest,\n        Debian5Guest,\n        Debian5_64Guest,\n        Debian6Guest,\n        Debian6_64Guest,\n        Debian7Guest,\n        Debian7_64Guest,\n        Debian8Guest,\n        Debian8_64Guest,\n        Debian9Guest,\n        Debian9_64Guest,\n        Debian10Guest,\n        Debian10_64Guest,\n        Asianux3Guest,\n        Asianux3_64Guest,\n        Asianux4Guest,\n        Asianux4_64Guest,\n        Asianux5_64Guest,\n        Asianux7_64Guest,\n        Asianux8_64Guest,\n        OpensuseGuest,\n        Opensuse64Guest,\n        FedoraGuest,\n        Fedora64Guest,\n        Coreos64Guest,\n        VmwarePhoton64Guest,\n        Other24xLinuxGuest,\n        Other26xLinuxGuest,\n        OtherLinuxGuest,\n        Other3xLinuxGuest,\n        Other4xLinuxGuest,\n        GenericLinuxGuest,\n        Other24xLinux64Guest,\n        Other26xLinux64Guest,\n        Other3xLinux64Guest,\n        Other4xLinux64Guest,\n        OtherLinux64Guest,\n        Solaris6Guest,\n        Solaris7Guest,\n        Solaris8Guest,\n        Solaris9Guest,\n        Solaris10Guest,\n        Solaris10_64Guest,\n        Solaris11_64Guest,\n        Os2Guest,\n        EComStationGuest,\n        EComStation2Guest,\n        Netware4Guest,\n        Netware5Guest,\n        Netware6Guest,\n        OpenServer5Guest,\n        OpenServer6Guest,\n        UnixWare7Guest,\n        DarwinGuest,\n        Darwin64Guest,\n        Darwin10Guest,\n        Darwin10_64Guest,\n        Darwin11Guest,\n        Darwin11_64Guest,\n        Darwin12_64Guest,\n        Darwin13_64Guest,\n        Darwin14_64Guest,\n        Darwin15_64Guest,\n        Darwin16_64Guest,\n        Darwin17_64Guest,\n        Darwin18_64Guest,\n        VmkernelGuest,\n        Vmkernel5Guest,\n        Vmkernel6Guest,\n        Vmkernel65Guest,\n        Amazonlinux2_64Guest,\n        OtherGuest,\n        OtherGuest64\n    }\n\n    public enum VirtualMachineGuestState\n    {\n        Running,\n        ShuttingDown,\n        Resetting,\n        Standby,\n        NotRunning,\n        Unknown\n    }\n\n    public enum VirtualMachineHtSharing\n    {\n        Any,\n        None,\n        Internal\n    }\n\n    public enum VirtualMachineMemoryAllocationPolicy\n    {\n        SwapNone,\n        SwapSome,\n        SwapMost\n    }\n\n    public enum VirtualMachineMetadataManagerVmMetadataOp\n    {\n        Update,\n        Remove\n    }\n\n    public enum VirtualMachineMetadataManagerVmMetadataOwnerOwner\n    {\n        ComVmwareVsphereHA\n    }\n\n    public enum VirtualMachineMovePriority\n    {\n        LowPriority,\n        HighPriority,\n        DefaultPriority\n    }\n\n    public enum VirtualMachineNeedSecondaryReason\n    {\n        Initializing,\n        Divergence,\n        LostConnection,\n        PartialHardwareFailure,\n        UserAction,\n        CheckpointError,\n        Other\n    }\n\n    public enum VirtualMachinePowerOffBehavior\n    {\n        PowerOff,\n        Revert,\n        Prompt,\n        Take\n    }\n\n    public enum VirtualMachinePowerOpType\n    {\n        Soft,\n        Hard,\n        Preset\n    }\n\n    public enum VirtualMachinePowerState\n    {\n        PoweredOff,\n        PoweredOn,\n        Suspended\n    }\n\n    public enum VirtualMachineRecordReplayState\n    {\n        Recording,\n        Replaying,\n        Inactive\n    }\n\n    public enum VirtualMachineRelocateDiskMoveOptions\n    {\n        MoveAllDiskBackingsAndAllowSharing,\n        MoveAllDiskBackingsAndDisallowSharing,\n        MoveChildMostDiskBacking,\n        CreateNewChildDiskBacking,\n        MoveAllDiskBackingsAndConsolidate\n    }\n\n    public enum VirtualMachineRelocateTransformation\n    {\n        Flat,\n        Sparse\n    }\n\n    public enum VirtualMachineScsiPassthroughType\n    {\n        Disk,\n        Tape,\n        Printer,\n        Processor,\n        Worm,\n        Cdrom,\n        Scanner,\n        Optical,\n        Media,\n        Com,\n        Raid,\n        Unknown\n    }\n\n    public enum VirtualMachineStandbyActionType\n    {\n        Checkpoint,\n        PowerOnSuspend\n    }\n\n    public enum VirtualMachineTargetInfoConfigurationTag\n    {\n        Compliant,\n        ClusterWide\n    }\n\n    public enum VirtualMachineTicketType\n    {\n        Mks,\n        Device,\n        GuestControl,\n        Webmks,\n        GuestIntegrity\n    }\n\n    public enum VirtualMachineToolsInstallType\n    {\n        GuestToolsTypeUnknown,\n        GuestToolsTypeMSI,\n        GuestToolsTypeTar,\n        GuestToolsTypeOSP,\n        GuestToolsTypeOpenVMTools\n    }\n\n    public enum VirtualMachineToolsRunningStatus\n    {\n        GuestToolsNotRunning,\n        GuestToolsRunning,\n        GuestToolsExecutingScripts\n    }\n\n    public enum VirtualMachineToolsStatus\n    {\n        ToolsNotInstalled,\n        ToolsNotRunning,\n        ToolsOld,\n        ToolsOk\n    }\n\n    public enum VirtualMachineToolsVersionStatus\n    {\n        GuestToolsNotInstalled,\n        GuestToolsNeedUpgrade,\n        GuestToolsCurrent,\n        GuestToolsUnmanaged,\n        GuestToolsTooOld,\n        GuestToolsSupportedOld,\n        GuestToolsSupportedNew,\n        GuestToolsTooNew,\n        GuestToolsBlacklisted\n    }\n\n    public enum VirtualMachineUsbInfoFamily\n    {\n        Audio,\n        Hid,\n        Hid_bootable,\n        Physical,\n        Communication,\n        Imaging,\n        Printer,\n        Storage,\n        Hub,\n        Smart_card,\n        Security,\n        Video,\n        Wireless,\n        Bluetooth,\n        Wusb,\n        Pda,\n        Vendor_specific,\n        Other,\n        UnknownFamily\n    }\n\n    public enum VirtualMachineUsbInfoSpeed\n    {\n        Low,\n        Full,\n        High,\n        SuperSpeed,\n        UnknownSpeed\n    }\n\n    public enum VirtualMachineVideoCardUse3dRenderer\n    {\n        Automatic,\n        Software,\n        Hardware\n    }\n\n    public enum VirtualMachineVMCIDeviceAction\n    {\n        Allow,\n        Deny\n    }\n\n    public enum VirtualMachineVMCIDeviceDirection\n    {\n        Guest,\n        Host,\n        AnyDirection\n    }\n\n    public enum VirtualMachineVMCIDeviceProtocol\n    {\n        Hypervisor,\n        Doorbell,\n        Queuepair,\n        Datagram,\n        Stream,\n        AnyProtocol\n    }\n\n    public enum VirtualMachineWindowsQuiesceSpecVssBackupContext\n    {\n        Ctx_auto,\n        Ctx_backup,\n        Ctx_file_share_backup\n    }\n\n    public enum VirtualPointingDeviceHostChoice\n    {\n        Autodetect,\n        IntellimouseExplorer,\n        IntellimousePs2,\n        LogitechMouseman,\n        Microsoft_serial,\n        MouseSystems,\n        MousemanSerial,\n        Ps2\n    }\n\n    public enum VirtualSCSISharing\n    {\n        NoSharing,\n        VirtualSharing,\n        PhysicalSharing\n    }\n\n    public enum VirtualSerialPortEndPoint\n    {\n        Client,\n        Server\n    }\n\n    public enum VirtualVmxnet3VrdmaOptionDeviceProtocols\n    {\n        Rocev1,\n        Rocev2\n    }\n\n    public enum VmDasBeingResetEventReasonCode\n    {\n        VmtoolsHeartbeatFailure,\n        AppHeartbeatFailure,\n        AppImmediateResetRequest,\n        VmcpResetApdCleared\n    }\n\n    public enum VmFailedStartingSecondaryEventFailureReason\n    {\n        IncompatibleHost,\n        LoginFailed,\n        RegisterVmFailed,\n        MigrateFailed\n    }\n\n    public enum VmFaultToleranceConfigIssueReasonForIssue\n    {\n        HaNotEnabled,\n        MoreThanOneSecondary,\n        RecordReplayNotSupported,\n        ReplayNotSupported,\n        TemplateVm,\n        MultipleVCPU,\n        HostInactive,\n        FtUnsupportedHardware,\n        FtUnsupportedProduct,\n        MissingVMotionNic,\n        MissingFTLoggingNic,\n        ThinDisk,\n        VerifySSLCertificateFlagNotSet,\n        HasSnapshots,\n        NoConfig,\n        FtSecondaryVm,\n        HasLocalDisk,\n        EsxAgentVm,\n        Video3dEnabled,\n        HasUnsupportedDisk,\n        InsufficientBandwidth,\n        HasNestedHVConfiguration,\n        HasVFlashConfiguration,\n        UnsupportedProduct,\n        CpuHvUnsupported,\n        CpuHwmmuUnsupported,\n        CpuHvDisabled,\n        HasEFIFirmware,\n        TooManyVCPUs,\n        TooMuchMemory\n    }\n\n    public enum VmFaultToleranceInvalidFileBackingDeviceType\n    {\n        VirtualFloppy,\n        VirtualCdrom,\n        VirtualSerialPort,\n        VirtualParallelPort,\n        VirtualDisk\n    }\n\n    public enum VMotionCompatibilityType\n    {\n        Cpu,\n        Software\n    }\n\n    public enum VmShutdownOnIsolationEventOperation\n    {\n        Shutdown,\n        PoweredOff\n    }\n\n    public enum VmwareDistributedVirtualSwitchPvlanPortType\n    {\n        Promiscuous,\n        Isolated,\n        Community\n    }\n\n    public enum VMwareDvsLacpApiVersion\n    {\n        SingleLag,\n        MultipleLag\n    }\n\n    public enum VMwareDvsLacpLoadBalanceAlgorithm\n    {\n        SrcMac,\n        DestMac,\n        SrcDestMac,\n        DestIpVlan,\n        SrcIpVlan,\n        SrcDestIpVlan,\n        DestTcpUdpPort,\n        SrcTcpUdpPort,\n        SrcDestTcpUdpPort,\n        DestIpTcpUdpPort,\n        SrcIpTcpUdpPort,\n        SrcDestIpTcpUdpPort,\n        DestIpTcpUdpPortVlan,\n        SrcIpTcpUdpPortVlan,\n        SrcDestIpTcpUdpPortVlan,\n        DestIp,\n        SrcIp,\n        SrcDestIp,\n        Vlan,\n        SrcPortId\n    }\n\n    public enum VMwareDvsMulticastFilteringMode\n    {\n        LegacyFiltering,\n        Snooping\n    }\n\n    public enum VMwareDVSTeamingMatchStatus\n    {\n        IphashMatch,\n        NonIphashMatch,\n        IphashMismatch,\n        NonIphashMismatch\n    }\n\n    public enum VMwareDVSVspanSessionEncapType\n    {\n        Gre,\n        Erspan2,\n        Erspan3\n    }\n\n    public enum VMwareDVSVspanSessionType\n    {\n        MixedDestMirror,\n        DvPortMirror,\n        RemoteMirrorSource,\n        RemoteMirrorDest,\n        EncapsulatedRemoteMirrorSource\n    }\n\n    public enum VMwareUplinkLacpMode\n    {\n        Active,\n        Passive\n    }\n\n    public enum VsanDiskIssueType\n    {\n        NonExist,\n        StampMismatch,\n        Unknown\n    }\n\n    public enum VsanHostDecommissionModeObjectAction\n    {\n        NoAction,\n        EnsureObjectAccessibility,\n        EvacuateAllData\n    }\n\n    public enum VsanHostDiskResultState\n    {\n        InUse,\n        Eligible,\n        Ineligible\n    }\n\n    public enum VsanHostHealthState\n    {\n        Unknown,\n        Healthy,\n        Unhealthy\n    }\n\n    public enum VsanHostNodeState\n    {\n        Error,\n        Disabled,\n        Agent,\n        Master,\n        Backup,\n        Starting,\n        Stopping,\n        EnteringMaintenanceMode,\n        ExitingMaintenanceMode,\n        Decommissioning\n    }\n\n    public enum VsanUpgradeSystemUpgradeHistoryDiskGroupOpType\n    {\n        Add,\n        Remove\n    }\n\n    public enum vslmVStorageObjectControlFlag\n    {\n        KeepAfterDeleteVm,\n        DisableRelocation,\n        EnableChangedBlockTracking\n    }\n\n    public enum VStorageObjectConsumptionType\n    {\n        Disk\n    }\n\n    public enum WeekOfMonth\n    {\n        First,\n        Second,\n        Third,\n        Fourth,\n        Last\n    }\n\n    public enum WillLoseHAProtectionResolution\n    {\n        Svmotion,\n        Relocate\n    }\n\n    public class AboutInfo : DynamicData, IEquatable<AboutInfo>\n    {\n        public string Name { get; set; }\n\n        public string FullName { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Version { get; set; }\n\n        public string Build { get; set; }\n\n        public string LocaleVersion { get; set; }\n\n        public string LocaleBuild { get; set; }\n\n        public string OsType { get; set; }\n\n        public string ProductLineId { get; set; }\n\n        public string ApiType { get; set; }\n\n        public string ApiVersion { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public string LicenseProductName { get; set; }\n\n        public string LicenseProductVersion { get; set; }\n\n        public bool Equals(AboutInfo aboutInfo)\n        {\n            return (aboutInfo != null && this.Name == aboutInfo.Name && this.FullName == aboutInfo.FullName && this.Vendor == aboutInfo.Vendor && this.Version == aboutInfo.Version && this.Build == aboutInfo.Build && this.LocaleVersion == aboutInfo.LocaleVersion && this.LocaleBuild == aboutInfo.LocaleBuild && this.OsType == aboutInfo.OsType && this.ProductLineId == aboutInfo.ProductLineId && this.ApiType == aboutInfo.ApiType && this.ApiVersion == aboutInfo.ApiVersion && this.InstanceUuid == aboutInfo.InstanceUuid && this.LicenseProductName == aboutInfo.LicenseProductName && this.LicenseProductVersion == aboutInfo.LicenseProductVersion);\n        }\n\n        public override bool Equals(object aboutInfo)\n        {\n            return Equals(aboutInfo as AboutInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + FullName + \"_\" + Vendor + \"_\" + Version + \"_\" + Build + \"_\" + LocaleVersion + \"_\" + LocaleBuild + \"_\" + OsType + \"_\" + ProductLineId + \"_\" + ApiType + \"_\" + ApiVersion + \"_\" + InstanceUuid + \"_\" + LicenseProductName + \"_\" + LicenseProductVersion).GetHashCode();\n        }\n    }\n\n    public class AccountCreatedEvent : HostEvent, IEquatable<AccountCreatedEvent>\n    {\n        public HostAccountSpec Spec { get; set; }\n\n        public bool Group { get; set; }\n\n        public bool Equals(AccountCreatedEvent accountCreatedEvent)\n        {\n            return (accountCreatedEvent != null && ((this.Spec == null && accountCreatedEvent.Spec == null) || (this.Spec != null && this.Spec.Equals(accountCreatedEvent.Spec))) && this.Group == accountCreatedEvent.Group);\n        }\n\n        public override bool Equals(object accountCreatedEvent)\n        {\n            return Equals(accountCreatedEvent as AccountCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Spec + \"_\" + Group).GetHashCode();\n        }\n    }\n\n    public class AccountRemovedEvent : HostEvent, IEquatable<AccountRemovedEvent>\n    {\n        public string Account { get; set; }\n\n        public bool Group { get; set; }\n\n        public bool Equals(AccountRemovedEvent accountRemovedEvent)\n        {\n            return (accountRemovedEvent != null && this.Account == accountRemovedEvent.Account && this.Group == accountRemovedEvent.Group);\n        }\n\n        public override bool Equals(object accountRemovedEvent)\n        {\n            return Equals(accountRemovedEvent as AccountRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Account + \"_\" + Group).GetHashCode();\n        }\n    }\n\n    public class AccountUpdatedEvent : HostEvent, IEquatable<AccountUpdatedEvent>\n    {\n        public HostAccountSpec Spec { get; set; }\n\n        public bool Group { get; set; }\n\n        public string PrevDescription { get; set; }\n\n        public bool Equals(AccountUpdatedEvent accountUpdatedEvent)\n        {\n            return (accountUpdatedEvent != null && ((this.Spec == null && accountUpdatedEvent.Spec == null) || (this.Spec != null && this.Spec.Equals(accountUpdatedEvent.Spec))) && this.Group == accountUpdatedEvent.Group && this.PrevDescription == accountUpdatedEvent.PrevDescription);\n        }\n\n        public override bool Equals(object accountUpdatedEvent)\n        {\n            return Equals(accountUpdatedEvent as AccountUpdatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Spec + \"_\" + Group + \"_\" + PrevDescription).GetHashCode();\n        }\n    }\n\n    public class Action : DynamicData, IEquatable<Action>\n    {\n        public bool Equals(Action action)\n        {\n            return (action != null && base.Equals(action));\n        }\n\n        public override bool Equals(object action)\n        {\n            return Equals(action as Action);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ActiveDirectoryFault : VimFault, IEquatable<ActiveDirectoryFault>\n    {\n        public int? ErrorCode { get; set; }\n\n        public bool Equals(ActiveDirectoryFault activeDirectoryFault)\n        {\n            return (activeDirectoryFault != null && ((this.ErrorCode == null && activeDirectoryFault.ErrorCode == null) || (this.ErrorCode != null && this.ErrorCode.Equals(activeDirectoryFault.ErrorCode))));\n        }\n\n        public override bool Equals(object activeDirectoryFault)\n        {\n            return Equals(activeDirectoryFault as ActiveDirectoryFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ErrorCode).GetHashCode();\n        }\n    }\n\n    public class ActiveDirectoryProfile : ApplyProfile, IEquatable<ActiveDirectoryProfile>\n    {\n        public bool Equals(ActiveDirectoryProfile activeDirectoryProfile)\n        {\n            return (activeDirectoryProfile != null && base.Equals(activeDirectoryProfile));\n        }\n\n        public override bool Equals(object activeDirectoryProfile)\n        {\n            return Equals(activeDirectoryProfile as ActiveDirectoryProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ActiveVMsBlockingEVC : EVCConfigFault, IEquatable<ActiveVMsBlockingEVC>\n    {\n        public string EvcMode { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public string[] HostName { get; set; }\n\n        public ActiveVMsBlockingEVC_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ActiveVMsBlockingEVC activeVMsBlockingEVC)\n        {\n            return (activeVMsBlockingEVC != null && this.EvcMode == activeVMsBlockingEVC.EvcMode && ((this.Host == null && activeVMsBlockingEVC.Host == null) || (this.Host != null && activeVMsBlockingEVC.Host != null && Enumerable.SequenceEqual(this.Host, activeVMsBlockingEVC.Host))) && ((this.HostName == null && activeVMsBlockingEVC.HostName == null) || (this.HostName != null && activeVMsBlockingEVC.HostName != null && Enumerable.SequenceEqual(this.HostName, activeVMsBlockingEVC.HostName))) && ((this.LinkedView == null && activeVMsBlockingEVC.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(activeVMsBlockingEVC.LinkedView))));\n        }\n\n        public override bool Equals(object activeVMsBlockingEVC)\n        {\n            return Equals(activeVMsBlockingEVC as ActiveVMsBlockingEVC);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EvcMode + \"_\" + Host + \"_\" + HostName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ActiveVMsBlockingEVC_LinkedView : IEquatable<ActiveVMsBlockingEVC_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(ActiveVMsBlockingEVC_LinkedView activeVMsBlockingEVC_LinkedView)\n        {\n            return (activeVMsBlockingEVC_LinkedView != null && ((this.Host == null && activeVMsBlockingEVC_LinkedView.Host == null) || (this.Host != null && activeVMsBlockingEVC_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, activeVMsBlockingEVC_LinkedView.Host))));\n        }\n\n        public override bool Equals(object activeVMsBlockingEVC_LinkedView)\n        {\n            return Equals(activeVMsBlockingEVC_LinkedView as ActiveVMsBlockingEVC_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class AdminDisabled : HostConfigFault, IEquatable<AdminDisabled>\n    {\n        public bool Equals(AdminDisabled adminDisabled)\n        {\n            return (adminDisabled != null && base.Equals(adminDisabled));\n        }\n\n        public override bool Equals(object adminDisabled)\n        {\n            return Equals(adminDisabled as AdminDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AdminNotDisabled : HostConfigFault, IEquatable<AdminNotDisabled>\n    {\n        public bool Equals(AdminNotDisabled adminNotDisabled)\n        {\n            return (adminNotDisabled != null && base.Equals(adminNotDisabled));\n        }\n\n        public override bool Equals(object adminNotDisabled)\n        {\n            return Equals(adminNotDisabled as AdminNotDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AdminPasswordNotChangedEvent : HostEvent, IEquatable<AdminPasswordNotChangedEvent>\n    {\n        public bool Equals(AdminPasswordNotChangedEvent adminPasswordNotChangedEvent)\n        {\n            return (adminPasswordNotChangedEvent != null && base.Equals(adminPasswordNotChangedEvent));\n        }\n\n        public override bool Equals(object adminPasswordNotChangedEvent)\n        {\n            return Equals(adminPasswordNotChangedEvent as AdminPasswordNotChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AffinityConfigured : MigrationFault, IEquatable<AffinityConfigured>\n    {\n        public string[] ConfiguredAffinity { get; set; }\n\n        public bool Equals(AffinityConfigured affinityConfigured)\n        {\n            return (affinityConfigured != null && ((this.ConfiguredAffinity == null && affinityConfigured.ConfiguredAffinity == null) || (this.ConfiguredAffinity != null && affinityConfigured.ConfiguredAffinity != null && Enumerable.SequenceEqual(this.ConfiguredAffinity, affinityConfigured.ConfiguredAffinity))));\n        }\n\n        public override bool Equals(object affinityConfigured)\n        {\n            return Equals(affinityConfigured as AffinityConfigured);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfiguredAffinity).GetHashCode();\n        }\n    }\n\n    public class AfterStartupTaskScheduler : TaskScheduler, IEquatable<AfterStartupTaskScheduler>\n    {\n        public int Minute { get; set; }\n\n        public bool Equals(AfterStartupTaskScheduler afterStartupTaskScheduler)\n        {\n            return (afterStartupTaskScheduler != null && this.Minute == afterStartupTaskScheduler.Minute);\n        }\n\n        public override bool Equals(object afterStartupTaskScheduler)\n        {\n            return Equals(afterStartupTaskScheduler as AfterStartupTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Minute).GetHashCode();\n        }\n    }\n\n    public class AgentInstallFailed : HostConnectFault, IEquatable<AgentInstallFailed>\n    {\n        public string Reason { get; set; }\n\n        public int? StatusCode { get; set; }\n\n        public string InstallerOutput { get; set; }\n\n        public bool Equals(AgentInstallFailed agentInstallFailed)\n        {\n            return (agentInstallFailed != null && this.Reason == agentInstallFailed.Reason && ((this.StatusCode == null && agentInstallFailed.StatusCode == null) || (this.StatusCode != null && this.StatusCode.Equals(agentInstallFailed.StatusCode))) && this.InstallerOutput == agentInstallFailed.InstallerOutput);\n        }\n\n        public override bool Equals(object agentInstallFailed)\n        {\n            return Equals(agentInstallFailed as AgentInstallFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + StatusCode + \"_\" + InstallerOutput).GetHashCode();\n        }\n    }\n\n    public class Alarm : ExtensibleManagedObject, IEquatable<Alarm>\n    {\n        public AlarmInfo Info { get; set; }\n\n        public void RemoveAlarm()\n        {\n        }\n\n        public void ReconfigureAlarm(AlarmSpec spec)\n        {\n        }\n\n        public bool Equals(Alarm alarm)\n        {\n            return (alarm != null && ((this.Info == null && alarm.Info == null) || (this.Info != null && this.Info.Equals(alarm.Info))));\n        }\n\n        public override bool Equals(object alarm)\n        {\n            return Equals(alarm as Alarm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class AlarmAcknowledgedEvent : AlarmEvent, IEquatable<AlarmAcknowledgedEvent>\n    {\n        public ManagedEntityEventArgument Source { get; set; }\n\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(AlarmAcknowledgedEvent alarmAcknowledgedEvent)\n        {\n            return (alarmAcknowledgedEvent != null && ((this.Source == null && alarmAcknowledgedEvent.Source == null) || (this.Source != null && this.Source.Equals(alarmAcknowledgedEvent.Source))) && ((this.Entity == null && alarmAcknowledgedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmAcknowledgedEvent.Entity))));\n        }\n\n        public override bool Equals(object alarmAcknowledgedEvent)\n        {\n            return Equals(alarmAcknowledgedEvent as AlarmAcknowledgedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class AlarmAction : DynamicData, IEquatable<AlarmAction>\n    {\n        public bool Equals(AlarmAction alarmAction)\n        {\n            return (alarmAction != null && base.Equals(alarmAction));\n        }\n\n        public override bool Equals(object alarmAction)\n        {\n            return Equals(alarmAction as AlarmAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AlarmActionTriggeredEvent : AlarmEvent, IEquatable<AlarmActionTriggeredEvent>\n    {\n        public ManagedEntityEventArgument Source { get; set; }\n\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(AlarmActionTriggeredEvent alarmActionTriggeredEvent)\n        {\n            return (alarmActionTriggeredEvent != null && ((this.Source == null && alarmActionTriggeredEvent.Source == null) || (this.Source != null && this.Source.Equals(alarmActionTriggeredEvent.Source))) && ((this.Entity == null && alarmActionTriggeredEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmActionTriggeredEvent.Entity))));\n        }\n\n        public override bool Equals(object alarmActionTriggeredEvent)\n        {\n            return Equals(alarmActionTriggeredEvent as AlarmActionTriggeredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class AlarmClearedEvent : AlarmEvent, IEquatable<AlarmClearedEvent>\n    {\n        public ManagedEntityEventArgument Source { get; set; }\n\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string From { get; set; }\n\n        public bool Equals(AlarmClearedEvent alarmClearedEvent)\n        {\n            return (alarmClearedEvent != null && ((this.Source == null && alarmClearedEvent.Source == null) || (this.Source != null && this.Source.Equals(alarmClearedEvent.Source))) && ((this.Entity == null && alarmClearedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmClearedEvent.Entity))) && this.From == alarmClearedEvent.From);\n        }\n\n        public override bool Equals(object alarmClearedEvent)\n        {\n            return Equals(alarmClearedEvent as AlarmClearedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Entity + \"_\" + From).GetHashCode();\n        }\n    }\n\n    public class AlarmCreatedEvent : AlarmEvent, IEquatable<AlarmCreatedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(AlarmCreatedEvent alarmCreatedEvent)\n        {\n            return (alarmCreatedEvent != null && ((this.Entity == null && alarmCreatedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmCreatedEvent.Entity))));\n        }\n\n        public override bool Equals(object alarmCreatedEvent)\n        {\n            return Equals(alarmCreatedEvent as AlarmCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class AlarmDescription : DynamicData, IEquatable<AlarmDescription>\n    {\n        public TypeDescription[] Expr { get; set; }\n\n        public ElementDescription[] StateOperator { get; set; }\n\n        public ElementDescription[] MetricOperator { get; set; }\n\n        public ElementDescription[] HostSystemConnectionState { get; set; }\n\n        public ElementDescription[] VirtualMachinePowerState { get; set; }\n\n        public ElementDescription[] DatastoreConnectionState { get; set; }\n\n        public ElementDescription[] HostSystemPowerState { get; set; }\n\n        public ElementDescription[] VirtualMachineGuestHeartbeatStatus { get; set; }\n\n        public ElementDescription[] EntityStatus { get; set; }\n\n        public TypeDescription[] Action { get; set; }\n\n        public bool Equals(AlarmDescription alarmDescription)\n        {\n            return (alarmDescription != null && ((this.Expr == null && alarmDescription.Expr == null) || (this.Expr != null && alarmDescription.Expr != null && Enumerable.SequenceEqual(this.Expr, alarmDescription.Expr))) && ((this.StateOperator == null && alarmDescription.StateOperator == null) || (this.StateOperator != null && alarmDescription.StateOperator != null && Enumerable.SequenceEqual(this.StateOperator, alarmDescription.StateOperator))) && ((this.MetricOperator == null && alarmDescription.MetricOperator == null) || (this.MetricOperator != null && alarmDescription.MetricOperator != null && Enumerable.SequenceEqual(this.MetricOperator, alarmDescription.MetricOperator))) && ((this.HostSystemConnectionState == null && alarmDescription.HostSystemConnectionState == null) || (this.HostSystemConnectionState != null && alarmDescription.HostSystemConnectionState != null && Enumerable.SequenceEqual(this.HostSystemConnectionState, alarmDescription.HostSystemConnectionState))) && ((this.VirtualMachinePowerState == null && alarmDescription.VirtualMachinePowerState == null) || (this.VirtualMachinePowerState != null && alarmDescription.VirtualMachinePowerState != null && Enumerable.SequenceEqual(this.VirtualMachinePowerState, alarmDescription.VirtualMachinePowerState))) && ((this.DatastoreConnectionState == null && alarmDescription.DatastoreConnectionState == null) || (this.DatastoreConnectionState != null && alarmDescription.DatastoreConnectionState != null && Enumerable.SequenceEqual(this.DatastoreConnectionState, alarmDescription.DatastoreConnectionState))) && ((this.HostSystemPowerState == null && alarmDescription.HostSystemPowerState == null) || (this.HostSystemPowerState != null && alarmDescription.HostSystemPowerState != null && Enumerable.SequenceEqual(this.HostSystemPowerState, alarmDescription.HostSystemPowerState))) && ((this.VirtualMachineGuestHeartbeatStatus == null && alarmDescription.VirtualMachineGuestHeartbeatStatus == null) || (this.VirtualMachineGuestHeartbeatStatus != null && alarmDescription.VirtualMachineGuestHeartbeatStatus != null && Enumerable.SequenceEqual(this.VirtualMachineGuestHeartbeatStatus, alarmDescription.VirtualMachineGuestHeartbeatStatus))) && ((this.EntityStatus == null && alarmDescription.EntityStatus == null) || (this.EntityStatus != null && alarmDescription.EntityStatus != null && Enumerable.SequenceEqual(this.EntityStatus, alarmDescription.EntityStatus))) && ((this.Action == null && alarmDescription.Action == null) || (this.Action != null && alarmDescription.Action != null && Enumerable.SequenceEqual(this.Action, alarmDescription.Action))));\n        }\n\n        public override bool Equals(object alarmDescription)\n        {\n            return Equals(alarmDescription as AlarmDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Expr + \"_\" + StateOperator + \"_\" + MetricOperator + \"_\" + HostSystemConnectionState + \"_\" + VirtualMachinePowerState + \"_\" + DatastoreConnectionState + \"_\" + HostSystemPowerState + \"_\" + VirtualMachineGuestHeartbeatStatus + \"_\" + EntityStatus + \"_\" + Action).GetHashCode();\n        }\n    }\n\n    public class AlarmEmailCompletedEvent : AlarmEvent, IEquatable<AlarmEmailCompletedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string To { get; set; }\n\n        public bool Equals(AlarmEmailCompletedEvent alarmEmailCompletedEvent)\n        {\n            return (alarmEmailCompletedEvent != null && ((this.Entity == null && alarmEmailCompletedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmEmailCompletedEvent.Entity))) && this.To == alarmEmailCompletedEvent.To);\n        }\n\n        public override bool Equals(object alarmEmailCompletedEvent)\n        {\n            return Equals(alarmEmailCompletedEvent as AlarmEmailCompletedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + To).GetHashCode();\n        }\n    }\n\n    public class AlarmEmailFailedEvent : AlarmEvent, IEquatable<AlarmEmailFailedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string To { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(AlarmEmailFailedEvent alarmEmailFailedEvent)\n        {\n            return (alarmEmailFailedEvent != null && ((this.Entity == null && alarmEmailFailedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmEmailFailedEvent.Entity))) && this.To == alarmEmailFailedEvent.To && ((this.Reason == null && alarmEmailFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(alarmEmailFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object alarmEmailFailedEvent)\n        {\n            return Equals(alarmEmailFailedEvent as AlarmEmailFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + To + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class AlarmEvent : Event, IEquatable<AlarmEvent>\n    {\n        public AlarmEventArgument Alarm { get; set; }\n\n        public bool Equals(AlarmEvent alarmEvent)\n        {\n            return (alarmEvent != null && ((this.Alarm == null && alarmEvent.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmEvent.Alarm))));\n        }\n\n        public override bool Equals(object alarmEvent)\n        {\n            return Equals(alarmEvent as AlarmEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm).GetHashCode();\n        }\n    }\n\n    public class AlarmEventArgument : EntityEventArgument, IEquatable<AlarmEventArgument>\n    {\n        public ManagedObjectReference Alarm { get; set; }\n\n        public AlarmEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(AlarmEventArgument alarmEventArgument)\n        {\n            return (alarmEventArgument != null && ((this.Alarm == null && alarmEventArgument.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmEventArgument.Alarm))) && ((this.LinkedView == null && alarmEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(alarmEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object alarmEventArgument)\n        {\n            return Equals(alarmEventArgument as AlarmEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class AlarmEventArgument_LinkedView : IEquatable<AlarmEventArgument_LinkedView>\n    {\n        public Alarm Alarm { get; set; }\n\n        public bool Equals(AlarmEventArgument_LinkedView alarmEventArgument_LinkedView)\n        {\n            return (alarmEventArgument_LinkedView != null && ((this.Alarm == null && alarmEventArgument_LinkedView.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmEventArgument_LinkedView.Alarm))));\n        }\n\n        public override bool Equals(object alarmEventArgument_LinkedView)\n        {\n            return Equals(alarmEventArgument_LinkedView as AlarmEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm).GetHashCode();\n        }\n    }\n\n    public class AlarmExpression : DynamicData, IEquatable<AlarmExpression>\n    {\n        public bool Equals(AlarmExpression alarmExpression)\n        {\n            return (alarmExpression != null && base.Equals(alarmExpression));\n        }\n\n        public override bool Equals(object alarmExpression)\n        {\n            return Equals(alarmExpression as AlarmExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AlarmFilterSpec : DynamicData, IEquatable<AlarmFilterSpec>\n    {\n        public ManagedEntityStatus[] Status { get; set; }\n\n        public string TypeEntity { get; set; }\n\n        public string TypeTrigger { get; set; }\n\n        public bool Equals(AlarmFilterSpec alarmFilterSpec)\n        {\n            return (alarmFilterSpec != null && ((this.Status == null && alarmFilterSpec.Status == null) || (this.Status != null && alarmFilterSpec.Status != null && Enumerable.SequenceEqual(this.Status, alarmFilterSpec.Status))) && this.TypeEntity == alarmFilterSpec.TypeEntity && this.TypeTrigger == alarmFilterSpec.TypeTrigger);\n        }\n\n        public override bool Equals(object alarmFilterSpec)\n        {\n            return Equals(alarmFilterSpec as AlarmFilterSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Status + \"_\" + TypeEntity + \"_\" + TypeTrigger).GetHashCode();\n        }\n    }\n\n    public class AlarmInfo : AlarmSpec, IEquatable<AlarmInfo>\n    {\n        public string Key { get; set; }\n\n        public ManagedObjectReference Alarm { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public DateTime LastModifiedTime { get; set; }\n\n        public string LastModifiedUser { get; set; }\n\n        public int CreationEventId { get; set; }\n\n        public AlarmInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(AlarmInfo alarmInfo)\n        {\n            return (alarmInfo != null && this.Key == alarmInfo.Key && ((this.Alarm == null && alarmInfo.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmInfo.Alarm))) && ((this.Entity == null && alarmInfo.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmInfo.Entity))) && this.LastModifiedTime == alarmInfo.LastModifiedTime && this.LastModifiedUser == alarmInfo.LastModifiedUser && this.CreationEventId == alarmInfo.CreationEventId && ((this.LinkedView == null && alarmInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(alarmInfo.LinkedView))));\n        }\n\n        public override bool Equals(object alarmInfo)\n        {\n            return Equals(alarmInfo as AlarmInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Alarm + \"_\" + Entity + \"_\" + LastModifiedTime + \"_\" + LastModifiedUser + \"_\" + CreationEventId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class AlarmInfo_LinkedView : IEquatable<AlarmInfo_LinkedView>\n    {\n        public Alarm Alarm { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(AlarmInfo_LinkedView alarmInfo_LinkedView)\n        {\n            return (alarmInfo_LinkedView != null && ((this.Alarm == null && alarmInfo_LinkedView.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmInfo_LinkedView.Alarm))) && ((this.Entity == null && alarmInfo_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmInfo_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object alarmInfo_LinkedView)\n        {\n            return Equals(alarmInfo_LinkedView as AlarmInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class AlarmManager : ViewBase, IEquatable<AlarmManager>\n    {\n        public AlarmExpression[] DefaultExpression { get; set; }\n\n        public AlarmDescription Description { get; set; }\n\n        public ManagedObjectReference CreateAlarm(ManagedObjectReference entity, AlarmSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference[] GetAlarm(ManagedObjectReference entity)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool AreAlarmActionsEnabled(ManagedObjectReference entity)\n        {\n            return default(bool);\n        }\n\n        public void EnableAlarmActions(ManagedObjectReference entity, bool enabled)\n        {\n        }\n\n        public AlarmState[] GetAlarmState(ManagedObjectReference entity)\n        {\n            return default(AlarmState[]);\n        }\n\n        public void AcknowledgeAlarm(ManagedObjectReference alarm, ManagedObjectReference entity)\n        {\n        }\n\n        public void ClearTriggeredAlarms(AlarmFilterSpec filter)\n        {\n        }\n\n        public bool Equals(AlarmManager alarmManager)\n        {\n            return (alarmManager != null && ((this.DefaultExpression == null && alarmManager.DefaultExpression == null) || (this.DefaultExpression != null && alarmManager.DefaultExpression != null && Enumerable.SequenceEqual(this.DefaultExpression, alarmManager.DefaultExpression))) && ((this.Description == null && alarmManager.Description == null) || (this.Description != null && this.Description.Equals(alarmManager.Description))));\n        }\n\n        public override bool Equals(object alarmManager)\n        {\n            return Equals(alarmManager as AlarmManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultExpression + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class AlarmReconfiguredEvent : AlarmEvent, IEquatable<AlarmReconfiguredEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(AlarmReconfiguredEvent alarmReconfiguredEvent)\n        {\n            return (alarmReconfiguredEvent != null && ((this.Entity == null && alarmReconfiguredEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmReconfiguredEvent.Entity))) && ((this.ConfigChanges == null && alarmReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(alarmReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object alarmReconfiguredEvent)\n        {\n            return Equals(alarmReconfiguredEvent as AlarmReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class AlarmRemovedEvent : AlarmEvent, IEquatable<AlarmRemovedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(AlarmRemovedEvent alarmRemovedEvent)\n        {\n            return (alarmRemovedEvent != null && ((this.Entity == null && alarmRemovedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmRemovedEvent.Entity))));\n        }\n\n        public override bool Equals(object alarmRemovedEvent)\n        {\n            return Equals(alarmRemovedEvent as AlarmRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class AlarmScriptCompleteEvent : AlarmEvent, IEquatable<AlarmScriptCompleteEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string Script { get; set; }\n\n        public bool Equals(AlarmScriptCompleteEvent alarmScriptCompleteEvent)\n        {\n            return (alarmScriptCompleteEvent != null && ((this.Entity == null && alarmScriptCompleteEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmScriptCompleteEvent.Entity))) && this.Script == alarmScriptCompleteEvent.Script);\n        }\n\n        public override bool Equals(object alarmScriptCompleteEvent)\n        {\n            return Equals(alarmScriptCompleteEvent as AlarmScriptCompleteEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Script).GetHashCode();\n        }\n    }\n\n    public class AlarmScriptFailedEvent : AlarmEvent, IEquatable<AlarmScriptFailedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string Script { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(AlarmScriptFailedEvent alarmScriptFailedEvent)\n        {\n            return (alarmScriptFailedEvent != null && ((this.Entity == null && alarmScriptFailedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmScriptFailedEvent.Entity))) && this.Script == alarmScriptFailedEvent.Script && ((this.Reason == null && alarmScriptFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(alarmScriptFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object alarmScriptFailedEvent)\n        {\n            return Equals(alarmScriptFailedEvent as AlarmScriptFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Script + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class AlarmSetting : DynamicData, IEquatable<AlarmSetting>\n    {\n        public int ToleranceRange { get; set; }\n\n        public int ReportingFrequency { get; set; }\n\n        public bool Equals(AlarmSetting alarmSetting)\n        {\n            return (alarmSetting != null && this.ToleranceRange == alarmSetting.ToleranceRange && this.ReportingFrequency == alarmSetting.ReportingFrequency);\n        }\n\n        public override bool Equals(object alarmSetting)\n        {\n            return Equals(alarmSetting as AlarmSetting);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ToleranceRange + \"_\" + ReportingFrequency).GetHashCode();\n        }\n    }\n\n    public class AlarmSnmpCompletedEvent : AlarmEvent, IEquatable<AlarmSnmpCompletedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(AlarmSnmpCompletedEvent alarmSnmpCompletedEvent)\n        {\n            return (alarmSnmpCompletedEvent != null && ((this.Entity == null && alarmSnmpCompletedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmSnmpCompletedEvent.Entity))));\n        }\n\n        public override bool Equals(object alarmSnmpCompletedEvent)\n        {\n            return Equals(alarmSnmpCompletedEvent as AlarmSnmpCompletedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class AlarmSnmpFailedEvent : AlarmEvent, IEquatable<AlarmSnmpFailedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(AlarmSnmpFailedEvent alarmSnmpFailedEvent)\n        {\n            return (alarmSnmpFailedEvent != null && ((this.Entity == null && alarmSnmpFailedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmSnmpFailedEvent.Entity))) && ((this.Reason == null && alarmSnmpFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(alarmSnmpFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object alarmSnmpFailedEvent)\n        {\n            return Equals(alarmSnmpFailedEvent as AlarmSnmpFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class AlarmSpec : DynamicData, IEquatable<AlarmSpec>\n    {\n        public string Name { get; set; }\n\n        public string SystemName { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public AlarmExpression Expression { get; set; }\n\n        public AlarmAction Action { get; set; }\n\n        public int? ActionFrequency { get; set; }\n\n        public AlarmSetting Setting { get; set; }\n\n        public bool Equals(AlarmSpec alarmSpec)\n        {\n            return (alarmSpec != null && this.Name == alarmSpec.Name && this.SystemName == alarmSpec.SystemName && this.Description == alarmSpec.Description && this.Enabled == alarmSpec.Enabled && ((this.Expression == null && alarmSpec.Expression == null) || (this.Expression != null && this.Expression.Equals(alarmSpec.Expression))) && ((this.Action == null && alarmSpec.Action == null) || (this.Action != null && this.Action.Equals(alarmSpec.Action))) && ((this.ActionFrequency == null && alarmSpec.ActionFrequency == null) || (this.ActionFrequency != null && this.ActionFrequency.Equals(alarmSpec.ActionFrequency))) && ((this.Setting == null && alarmSpec.Setting == null) || (this.Setting != null && this.Setting.Equals(alarmSpec.Setting))));\n        }\n\n        public override bool Equals(object alarmSpec)\n        {\n            return Equals(alarmSpec as AlarmSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + SystemName + \"_\" + Description + \"_\" + Enabled + \"_\" + Expression + \"_\" + Action + \"_\" + ActionFrequency + \"_\" + Setting).GetHashCode();\n        }\n    }\n\n    public class AlarmState : DynamicData, IEquatable<AlarmState>\n    {\n        public string Key { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public ManagedObjectReference Alarm { get; set; }\n\n        public ManagedEntityStatus OverallStatus { get; set; }\n\n        public DateTime Time { get; set; }\n\n        public bool? Acknowledged { get; set; }\n\n        public string AcknowledgedByUser { get; set; }\n\n        public DateTime? AcknowledgedTime { get; set; }\n\n        public int? EventKey { get; set; }\n\n        public AlarmState_LinkedView LinkedView { get; set; }\n\n        public bool Equals(AlarmState alarmState)\n        {\n            return (alarmState != null && this.Key == alarmState.Key && ((this.Entity == null && alarmState.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmState.Entity))) && ((this.Alarm == null && alarmState.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmState.Alarm))) && this.OverallStatus == alarmState.OverallStatus && this.Time == alarmState.Time && ((this.Acknowledged == null && alarmState.Acknowledged == null) || (this.Acknowledged != null && this.Acknowledged.Equals(alarmState.Acknowledged))) && this.AcknowledgedByUser == alarmState.AcknowledgedByUser && ((this.AcknowledgedTime == null && alarmState.AcknowledgedTime == null) || (this.AcknowledgedTime != null && this.AcknowledgedTime.Equals(alarmState.AcknowledgedTime))) && ((this.EventKey == null && alarmState.EventKey == null) || (this.EventKey != null && this.EventKey.Equals(alarmState.EventKey))) && ((this.LinkedView == null && alarmState.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(alarmState.LinkedView))));\n        }\n\n        public override bool Equals(object alarmState)\n        {\n            return Equals(alarmState as AlarmState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Entity + \"_\" + Alarm + \"_\" + OverallStatus + \"_\" + Time + \"_\" + Acknowledged + \"_\" + AcknowledgedByUser + \"_\" + AcknowledgedTime + \"_\" + EventKey + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class AlarmState_LinkedView : IEquatable<AlarmState_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public Alarm Alarm { get; set; }\n\n        public bool Equals(AlarmState_LinkedView alarmState_LinkedView)\n        {\n            return (alarmState_LinkedView != null && ((this.Entity == null && alarmState_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmState_LinkedView.Entity))) && ((this.Alarm == null && alarmState_LinkedView.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(alarmState_LinkedView.Alarm))));\n        }\n\n        public override bool Equals(object alarmState_LinkedView)\n        {\n            return Equals(alarmState_LinkedView as AlarmState_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Alarm).GetHashCode();\n        }\n    }\n\n    public class AlarmStatusChangedEvent : AlarmEvent, IEquatable<AlarmStatusChangedEvent>\n    {\n        public ManagedEntityEventArgument Source { get; set; }\n\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string From { get; set; }\n\n        public string To { get; set; }\n\n        public bool Equals(AlarmStatusChangedEvent alarmStatusChangedEvent)\n        {\n            return (alarmStatusChangedEvent != null && ((this.Source == null && alarmStatusChangedEvent.Source == null) || (this.Source != null && this.Source.Equals(alarmStatusChangedEvent.Source))) && ((this.Entity == null && alarmStatusChangedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmStatusChangedEvent.Entity))) && this.From == alarmStatusChangedEvent.From && this.To == alarmStatusChangedEvent.To);\n        }\n\n        public override bool Equals(object alarmStatusChangedEvent)\n        {\n            return Equals(alarmStatusChangedEvent as AlarmStatusChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Entity + \"_\" + From + \"_\" + To).GetHashCode();\n        }\n    }\n\n    public class AlarmTriggeringAction : AlarmAction, IEquatable<AlarmTriggeringAction>\n    {\n        public Action Action { get; set; }\n\n        public AlarmTriggeringActionTransitionSpec[] TransitionSpecs { get; set; }\n\n        public bool Green2yellow { get; set; }\n\n        public bool Yellow2red { get; set; }\n\n        public bool Red2yellow { get; set; }\n\n        public bool Yellow2green { get; set; }\n\n        public bool Equals(AlarmTriggeringAction alarmTriggeringAction)\n        {\n            return (alarmTriggeringAction != null && ((this.Action == null && alarmTriggeringAction.Action == null) || (this.Action != null && this.Action.Equals(alarmTriggeringAction.Action))) && ((this.TransitionSpecs == null && alarmTriggeringAction.TransitionSpecs == null) || (this.TransitionSpecs != null && alarmTriggeringAction.TransitionSpecs != null && Enumerable.SequenceEqual(this.TransitionSpecs, alarmTriggeringAction.TransitionSpecs))) && this.Green2yellow == alarmTriggeringAction.Green2yellow && this.Yellow2red == alarmTriggeringAction.Yellow2red && this.Red2yellow == alarmTriggeringAction.Red2yellow && this.Yellow2green == alarmTriggeringAction.Yellow2green);\n        }\n\n        public override bool Equals(object alarmTriggeringAction)\n        {\n            return Equals(alarmTriggeringAction as AlarmTriggeringAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Action + \"_\" + TransitionSpecs + \"_\" + Green2yellow + \"_\" + Yellow2red + \"_\" + Red2yellow + \"_\" + Yellow2green).GetHashCode();\n        }\n    }\n\n    public class AlarmTriggeringActionTransitionSpec : DynamicData, IEquatable<AlarmTriggeringActionTransitionSpec>\n    {\n        public ManagedEntityStatus StartState { get; set; }\n\n        public ManagedEntityStatus FinalState { get; set; }\n\n        public bool Repeats { get; set; }\n\n        public bool Equals(AlarmTriggeringActionTransitionSpec alarmTriggeringActionTransitionSpec)\n        {\n            return (alarmTriggeringActionTransitionSpec != null && this.StartState == alarmTriggeringActionTransitionSpec.StartState && this.FinalState == alarmTriggeringActionTransitionSpec.FinalState && this.Repeats == alarmTriggeringActionTransitionSpec.Repeats);\n        }\n\n        public override bool Equals(object alarmTriggeringActionTransitionSpec)\n        {\n            return Equals(alarmTriggeringActionTransitionSpec as AlarmTriggeringActionTransitionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StartState + \"_\" + FinalState + \"_\" + Repeats).GetHashCode();\n        }\n    }\n\n    public class AllVirtualMachinesLicensedEvent : LicenseEvent, IEquatable<AllVirtualMachinesLicensedEvent>\n    {\n        public bool Equals(AllVirtualMachinesLicensedEvent allVirtualMachinesLicensedEvent)\n        {\n            return (allVirtualMachinesLicensedEvent != null && base.Equals(allVirtualMachinesLicensedEvent));\n        }\n\n        public override bool Equals(object allVirtualMachinesLicensedEvent)\n        {\n            return Equals(allVirtualMachinesLicensedEvent as AllVirtualMachinesLicensedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AlreadyAuthenticatedSessionEvent : SessionEvent, IEquatable<AlreadyAuthenticatedSessionEvent>\n    {\n        public bool Equals(AlreadyAuthenticatedSessionEvent alreadyAuthenticatedSessionEvent)\n        {\n            return (alreadyAuthenticatedSessionEvent != null && base.Equals(alreadyAuthenticatedSessionEvent));\n        }\n\n        public override bool Equals(object alreadyAuthenticatedSessionEvent)\n        {\n            return Equals(alreadyAuthenticatedSessionEvent as AlreadyAuthenticatedSessionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AlreadyBeingManaged : HostConnectFault, IEquatable<AlreadyBeingManaged>\n    {\n        public string IpAddress { get; set; }\n\n        public bool Equals(AlreadyBeingManaged alreadyBeingManaged)\n        {\n            return (alreadyBeingManaged != null && this.IpAddress == alreadyBeingManaged.IpAddress);\n        }\n\n        public override bool Equals(object alreadyBeingManaged)\n        {\n            return Equals(alreadyBeingManaged as AlreadyBeingManaged);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress).GetHashCode();\n        }\n    }\n\n    public class AlreadyConnected : HostConnectFault, IEquatable<AlreadyConnected>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(AlreadyConnected alreadyConnected)\n        {\n            return (alreadyConnected != null && this.Name == alreadyConnected.Name);\n        }\n\n        public override bool Equals(object alreadyConnected)\n        {\n            return Equals(alreadyConnected as AlreadyConnected);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class AlreadyExists : VimFault, IEquatable<AlreadyExists>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(AlreadyExists alreadyExists)\n        {\n            return (alreadyExists != null && this.Name == alreadyExists.Name);\n        }\n\n        public override bool Equals(object alreadyExists)\n        {\n            return Equals(alreadyExists as AlreadyExists);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class AlreadyUpgraded : VimFault, IEquatable<AlreadyUpgraded>\n    {\n        public bool Equals(AlreadyUpgraded alreadyUpgraded)\n        {\n            return (alreadyUpgraded != null && base.Equals(alreadyUpgraded));\n        }\n\n        public override bool Equals(object alreadyUpgraded)\n        {\n            return Equals(alreadyUpgraded as AlreadyUpgraded);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AndAlarmExpression : AlarmExpression, IEquatable<AndAlarmExpression>\n    {\n        public AlarmExpression[] Expression { get; set; }\n\n        public bool Equals(AndAlarmExpression andAlarmExpression)\n        {\n            return (andAlarmExpression != null && ((this.Expression == null && andAlarmExpression.Expression == null) || (this.Expression != null && andAlarmExpression.Expression != null && Enumerable.SequenceEqual(this.Expression, andAlarmExpression.Expression))));\n        }\n\n        public override bool Equals(object andAlarmExpression)\n        {\n            return Equals(andAlarmExpression as AndAlarmExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Expression).GetHashCode();\n        }\n    }\n\n    public class AnswerFile : DynamicData, IEquatable<AnswerFile>\n    {\n        public ProfileDeferredPolicyOptionParameter[] UserInput { get; set; }\n\n        public DateTime CreatedTime { get; set; }\n\n        public DateTime ModifiedTime { get; set; }\n\n        public bool Equals(AnswerFile answerFile)\n        {\n            return (answerFile != null && ((this.UserInput == null && answerFile.UserInput == null) || (this.UserInput != null && answerFile.UserInput != null && Enumerable.SequenceEqual(this.UserInput, answerFile.UserInput))) && this.CreatedTime == answerFile.CreatedTime && this.ModifiedTime == answerFile.ModifiedTime);\n        }\n\n        public override bool Equals(object answerFile)\n        {\n            return Equals(answerFile as AnswerFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserInput + \"_\" + CreatedTime + \"_\" + ModifiedTime).GetHashCode();\n        }\n    }\n\n    public class AnswerFileCreateSpec : DynamicData, IEquatable<AnswerFileCreateSpec>\n    {\n        public bool? Validating { get; set; }\n\n        public bool Equals(AnswerFileCreateSpec answerFileCreateSpec)\n        {\n            return (answerFileCreateSpec != null && ((this.Validating == null && answerFileCreateSpec.Validating == null) || (this.Validating != null && this.Validating.Equals(answerFileCreateSpec.Validating))));\n        }\n\n        public override bool Equals(object answerFileCreateSpec)\n        {\n            return Equals(answerFileCreateSpec as AnswerFileCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Validating).GetHashCode();\n        }\n    }\n\n    public class AnswerFileOptionsCreateSpec : AnswerFileCreateSpec, IEquatable<AnswerFileOptionsCreateSpec>\n    {\n        public ProfileDeferredPolicyOptionParameter[] UserInput { get; set; }\n\n        public bool Equals(AnswerFileOptionsCreateSpec answerFileOptionsCreateSpec)\n        {\n            return (answerFileOptionsCreateSpec != null && ((this.UserInput == null && answerFileOptionsCreateSpec.UserInput == null) || (this.UserInput != null && answerFileOptionsCreateSpec.UserInput != null && Enumerable.SequenceEqual(this.UserInput, answerFileOptionsCreateSpec.UserInput))));\n        }\n\n        public override bool Equals(object answerFileOptionsCreateSpec)\n        {\n            return Equals(answerFileOptionsCreateSpec as AnswerFileOptionsCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserInput).GetHashCode();\n        }\n    }\n\n    public class AnswerFileSerializedCreateSpec : AnswerFileCreateSpec, IEquatable<AnswerFileSerializedCreateSpec>\n    {\n        public string AnswerFileConfigString { get; set; }\n\n        public bool Equals(AnswerFileSerializedCreateSpec answerFileSerializedCreateSpec)\n        {\n            return (answerFileSerializedCreateSpec != null && this.AnswerFileConfigString == answerFileSerializedCreateSpec.AnswerFileConfigString);\n        }\n\n        public override bool Equals(object answerFileSerializedCreateSpec)\n        {\n            return Equals(answerFileSerializedCreateSpec as AnswerFileSerializedCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AnswerFileConfigString).GetHashCode();\n        }\n    }\n\n    public class AnswerFileStatusError : DynamicData, IEquatable<AnswerFileStatusError>\n    {\n        public ProfilePropertyPath UserInputPath { get; set; }\n\n        public LocalizableMessage ErrMsg { get; set; }\n\n        public bool Equals(AnswerFileStatusError answerFileStatusError)\n        {\n            return (answerFileStatusError != null && ((this.UserInputPath == null && answerFileStatusError.UserInputPath == null) || (this.UserInputPath != null && this.UserInputPath.Equals(answerFileStatusError.UserInputPath))) && ((this.ErrMsg == null && answerFileStatusError.ErrMsg == null) || (this.ErrMsg != null && this.ErrMsg.Equals(answerFileStatusError.ErrMsg))));\n        }\n\n        public override bool Equals(object answerFileStatusError)\n        {\n            return Equals(answerFileStatusError as AnswerFileStatusError);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserInputPath + \"_\" + ErrMsg).GetHashCode();\n        }\n    }\n\n    public class AnswerFileStatusResult : DynamicData, IEquatable<AnswerFileStatusResult>\n    {\n        public DateTime CheckedTime { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public string Status { get; set; }\n\n        public AnswerFileStatusError[] Error { get; set; }\n\n        public AnswerFileStatusResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(AnswerFileStatusResult answerFileStatusResult)\n        {\n            return (answerFileStatusResult != null && this.CheckedTime == answerFileStatusResult.CheckedTime && ((this.Host == null && answerFileStatusResult.Host == null) || (this.Host != null && this.Host.Equals(answerFileStatusResult.Host))) && this.Status == answerFileStatusResult.Status && ((this.Error == null && answerFileStatusResult.Error == null) || (this.Error != null && answerFileStatusResult.Error != null && Enumerable.SequenceEqual(this.Error, answerFileStatusResult.Error))) && ((this.LinkedView == null && answerFileStatusResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(answerFileStatusResult.LinkedView))));\n        }\n\n        public override bool Equals(object answerFileStatusResult)\n        {\n            return Equals(answerFileStatusResult as AnswerFileStatusResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CheckedTime + \"_\" + Host + \"_\" + Status + \"_\" + Error + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class AnswerFileStatusResult_LinkedView : IEquatable<AnswerFileStatusResult_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(AnswerFileStatusResult_LinkedView answerFileStatusResult_LinkedView)\n        {\n            return (answerFileStatusResult_LinkedView != null && ((this.Host == null && answerFileStatusResult_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(answerFileStatusResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object answerFileStatusResult_LinkedView)\n        {\n            return Equals(answerFileStatusResult_LinkedView as AnswerFileStatusResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class AnswerFileUpdateFailed : VimFault, IEquatable<AnswerFileUpdateFailed>\n    {\n        public AnswerFileUpdateFailure[] Failure { get; set; }\n\n        public bool Equals(AnswerFileUpdateFailed answerFileUpdateFailed)\n        {\n            return (answerFileUpdateFailed != null && ((this.Failure == null && answerFileUpdateFailed.Failure == null) || (this.Failure != null && answerFileUpdateFailed.Failure != null && Enumerable.SequenceEqual(this.Failure, answerFileUpdateFailed.Failure))));\n        }\n\n        public override bool Equals(object answerFileUpdateFailed)\n        {\n            return Equals(answerFileUpdateFailed as AnswerFileUpdateFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Failure).GetHashCode();\n        }\n    }\n\n    public class AnswerFileUpdateFailure : DynamicData, IEquatable<AnswerFileUpdateFailure>\n    {\n        public ProfilePropertyPath UserInputPath { get; set; }\n\n        public LocalizableMessage ErrMsg { get; set; }\n\n        public bool Equals(AnswerFileUpdateFailure answerFileUpdateFailure)\n        {\n            return (answerFileUpdateFailure != null && ((this.UserInputPath == null && answerFileUpdateFailure.UserInputPath == null) || (this.UserInputPath != null && this.UserInputPath.Equals(answerFileUpdateFailure.UserInputPath))) && ((this.ErrMsg == null && answerFileUpdateFailure.ErrMsg == null) || (this.ErrMsg != null && this.ErrMsg.Equals(answerFileUpdateFailure.ErrMsg))));\n        }\n\n        public override bool Equals(object answerFileUpdateFailure)\n        {\n            return Equals(answerFileUpdateFailure as AnswerFileUpdateFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserInputPath + \"_\" + ErrMsg).GetHashCode();\n        }\n    }\n\n    public class ApplicationQuiesceFault : SnapshotFault, IEquatable<ApplicationQuiesceFault>\n    {\n        public bool Equals(ApplicationQuiesceFault applicationQuiesceFault)\n        {\n            return (applicationQuiesceFault != null && base.Equals(applicationQuiesceFault));\n        }\n\n        public override bool Equals(object applicationQuiesceFault)\n        {\n            return Equals(applicationQuiesceFault as ApplicationQuiesceFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ApplyHostProfileConfigurationResult : DynamicData, IEquatable<ApplyHostProfileConfigurationResult>\n    {\n        public DateTime StartTime { get; set; }\n\n        public DateTime CompleteTime { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public string Status { get; set; }\n\n        public LocalizedMethodFault[] Errors { get; set; }\n\n        public ApplyHostProfileConfigurationResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ApplyHostProfileConfigurationResult applyHostProfileConfigurationResult)\n        {\n            return (applyHostProfileConfigurationResult != null && this.StartTime == applyHostProfileConfigurationResult.StartTime && this.CompleteTime == applyHostProfileConfigurationResult.CompleteTime && ((this.Host == null && applyHostProfileConfigurationResult.Host == null) || (this.Host != null && this.Host.Equals(applyHostProfileConfigurationResult.Host))) && this.Status == applyHostProfileConfigurationResult.Status && ((this.Errors == null && applyHostProfileConfigurationResult.Errors == null) || (this.Errors != null && applyHostProfileConfigurationResult.Errors != null && Enumerable.SequenceEqual(this.Errors, applyHostProfileConfigurationResult.Errors))) && ((this.LinkedView == null && applyHostProfileConfigurationResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(applyHostProfileConfigurationResult.LinkedView))));\n        }\n\n        public override bool Equals(object applyHostProfileConfigurationResult)\n        {\n            return Equals(applyHostProfileConfigurationResult as ApplyHostProfileConfigurationResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StartTime + \"_\" + CompleteTime + \"_\" + Host + \"_\" + Status + \"_\" + Errors + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ApplyHostProfileConfigurationResult_LinkedView : IEquatable<ApplyHostProfileConfigurationResult_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ApplyHostProfileConfigurationResult_LinkedView applyHostProfileConfigurationResult_LinkedView)\n        {\n            return (applyHostProfileConfigurationResult_LinkedView != null && ((this.Host == null && applyHostProfileConfigurationResult_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(applyHostProfileConfigurationResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object applyHostProfileConfigurationResult_LinkedView)\n        {\n            return Equals(applyHostProfileConfigurationResult_LinkedView as ApplyHostProfileConfigurationResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ApplyHostProfileConfigurationSpec : ProfileExecuteResult, IEquatable<ApplyHostProfileConfigurationSpec>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string[] TaskListRequirement { get; set; }\n\n        public LocalizableMessage[] TaskDescription { get; set; }\n\n        public bool? RebootStateless { get; set; }\n\n        public bool? RebootHost { get; set; }\n\n        public LocalizedMethodFault FaultData { get; set; }\n\n        public ApplyHostProfileConfigurationSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ApplyHostProfileConfigurationSpec applyHostProfileConfigurationSpec)\n        {\n            return (applyHostProfileConfigurationSpec != null && ((this.Host == null && applyHostProfileConfigurationSpec.Host == null) || (this.Host != null && this.Host.Equals(applyHostProfileConfigurationSpec.Host))) && ((this.TaskListRequirement == null && applyHostProfileConfigurationSpec.TaskListRequirement == null) || (this.TaskListRequirement != null && applyHostProfileConfigurationSpec.TaskListRequirement != null && Enumerable.SequenceEqual(this.TaskListRequirement, applyHostProfileConfigurationSpec.TaskListRequirement))) && ((this.TaskDescription == null && applyHostProfileConfigurationSpec.TaskDescription == null) || (this.TaskDescription != null && applyHostProfileConfigurationSpec.TaskDescription != null && Enumerable.SequenceEqual(this.TaskDescription, applyHostProfileConfigurationSpec.TaskDescription))) && ((this.RebootStateless == null && applyHostProfileConfigurationSpec.RebootStateless == null) || (this.RebootStateless != null && this.RebootStateless.Equals(applyHostProfileConfigurationSpec.RebootStateless))) && ((this.RebootHost == null && applyHostProfileConfigurationSpec.RebootHost == null) || (this.RebootHost != null && this.RebootHost.Equals(applyHostProfileConfigurationSpec.RebootHost))) && ((this.FaultData == null && applyHostProfileConfigurationSpec.FaultData == null) || (this.FaultData != null && this.FaultData.Equals(applyHostProfileConfigurationSpec.FaultData))) && ((this.LinkedView == null && applyHostProfileConfigurationSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(applyHostProfileConfigurationSpec.LinkedView))));\n        }\n\n        public override bool Equals(object applyHostProfileConfigurationSpec)\n        {\n            return Equals(applyHostProfileConfigurationSpec as ApplyHostProfileConfigurationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + TaskListRequirement + \"_\" + TaskDescription + \"_\" + RebootStateless + \"_\" + RebootHost + \"_\" + FaultData + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ApplyHostProfileConfigurationSpec_LinkedView : IEquatable<ApplyHostProfileConfigurationSpec_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ApplyHostProfileConfigurationSpec_LinkedView applyHostProfileConfigurationSpec_LinkedView)\n        {\n            return (applyHostProfileConfigurationSpec_LinkedView != null && ((this.Host == null && applyHostProfileConfigurationSpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(applyHostProfileConfigurationSpec_LinkedView.Host))));\n        }\n\n        public override bool Equals(object applyHostProfileConfigurationSpec_LinkedView)\n        {\n            return Equals(applyHostProfileConfigurationSpec_LinkedView as ApplyHostProfileConfigurationSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ApplyProfile : DynamicData, IEquatable<ApplyProfile>\n    {\n        public bool Enabled { get; set; }\n\n        public ProfilePolicy[] Policy { get; set; }\n\n        public string ProfileTypeName { get; set; }\n\n        public string ProfileVersion { get; set; }\n\n        public ProfileApplyProfileProperty[] Property { get; set; }\n\n        public bool? Favorite { get; set; }\n\n        public bool? ToBeMerged { get; set; }\n\n        public bool? ToReplaceWith { get; set; }\n\n        public bool? ToBeDeleted { get; set; }\n\n        public bool? CopyEnableStatus { get; set; }\n\n        public bool? Hidden { get; set; }\n\n        public bool Equals(ApplyProfile applyProfile)\n        {\n            return (applyProfile != null && this.Enabled == applyProfile.Enabled && ((this.Policy == null && applyProfile.Policy == null) || (this.Policy != null && applyProfile.Policy != null && Enumerable.SequenceEqual(this.Policy, applyProfile.Policy))) && this.ProfileTypeName == applyProfile.ProfileTypeName && this.ProfileVersion == applyProfile.ProfileVersion && ((this.Property == null && applyProfile.Property == null) || (this.Property != null && applyProfile.Property != null && Enumerable.SequenceEqual(this.Property, applyProfile.Property))) && ((this.Favorite == null && applyProfile.Favorite == null) || (this.Favorite != null && this.Favorite.Equals(applyProfile.Favorite))) && ((this.ToBeMerged == null && applyProfile.ToBeMerged == null) || (this.ToBeMerged != null && this.ToBeMerged.Equals(applyProfile.ToBeMerged))) && ((this.ToReplaceWith == null && applyProfile.ToReplaceWith == null) || (this.ToReplaceWith != null && this.ToReplaceWith.Equals(applyProfile.ToReplaceWith))) && ((this.ToBeDeleted == null && applyProfile.ToBeDeleted == null) || (this.ToBeDeleted != null && this.ToBeDeleted.Equals(applyProfile.ToBeDeleted))) && ((this.CopyEnableStatus == null && applyProfile.CopyEnableStatus == null) || (this.CopyEnableStatus != null && this.CopyEnableStatus.Equals(applyProfile.CopyEnableStatus))) && ((this.Hidden == null && applyProfile.Hidden == null) || (this.Hidden != null && this.Hidden.Equals(applyProfile.Hidden))));\n        }\n\n        public override bool Equals(object applyProfile)\n        {\n            return Equals(applyProfile as ApplyProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + Policy + \"_\" + ProfileTypeName + \"_\" + ProfileVersion + \"_\" + Property + \"_\" + Favorite + \"_\" + ToBeMerged + \"_\" + ToReplaceWith + \"_\" + ToBeDeleted + \"_\" + CopyEnableStatus + \"_\" + Hidden).GetHashCode();\n        }\n    }\n\n    public class ApplyStorageRecommendationResult : DynamicData, IEquatable<ApplyStorageRecommendationResult>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public ApplyStorageRecommendationResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ApplyStorageRecommendationResult applyStorageRecommendationResult)\n        {\n            return (applyStorageRecommendationResult != null && ((this.Vm == null && applyStorageRecommendationResult.Vm == null) || (this.Vm != null && this.Vm.Equals(applyStorageRecommendationResult.Vm))) && ((this.LinkedView == null && applyStorageRecommendationResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(applyStorageRecommendationResult.LinkedView))));\n        }\n\n        public override bool Equals(object applyStorageRecommendationResult)\n        {\n            return Equals(applyStorageRecommendationResult as ApplyStorageRecommendationResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ApplyStorageRecommendationResult_LinkedView : IEquatable<ApplyStorageRecommendationResult_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(ApplyStorageRecommendationResult_LinkedView applyStorageRecommendationResult_LinkedView)\n        {\n            return (applyStorageRecommendationResult_LinkedView != null && ((this.Vm == null && applyStorageRecommendationResult_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(applyStorageRecommendationResult_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object applyStorageRecommendationResult_LinkedView)\n        {\n            return Equals(applyStorageRecommendationResult_LinkedView as ApplyStorageRecommendationResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ArrayUpdateSpec : DynamicData, IEquatable<ArrayUpdateSpec>\n    {\n        public ArrayUpdateOperation Operation { get; set; }\n\n        public object RemoveKey { get; set; }\n\n        public bool Equals(ArrayUpdateSpec arrayUpdateSpec)\n        {\n            return (arrayUpdateSpec != null && this.Operation == arrayUpdateSpec.Operation && ((this.RemoveKey == null && arrayUpdateSpec.RemoveKey == null) || (this.RemoveKey != null && this.RemoveKey.Equals(arrayUpdateSpec.RemoveKey))));\n        }\n\n        public override bool Equals(object arrayUpdateSpec)\n        {\n            return Equals(arrayUpdateSpec as ArrayUpdateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + RemoveKey).GetHashCode();\n        }\n    }\n\n    public class AuthenticationProfile : ApplyProfile, IEquatable<AuthenticationProfile>\n    {\n        public ActiveDirectoryProfile ActiveDirectory { get; set; }\n\n        public bool Equals(AuthenticationProfile authenticationProfile)\n        {\n            return (authenticationProfile != null && ((this.ActiveDirectory == null && authenticationProfile.ActiveDirectory == null) || (this.ActiveDirectory != null && this.ActiveDirectory.Equals(authenticationProfile.ActiveDirectory))));\n        }\n\n        public override bool Equals(object authenticationProfile)\n        {\n            return Equals(authenticationProfile as AuthenticationProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActiveDirectory).GetHashCode();\n        }\n    }\n\n    public class AuthMinimumAdminPermission : VimFault, IEquatable<AuthMinimumAdminPermission>\n    {\n        public bool Equals(AuthMinimumAdminPermission authMinimumAdminPermission)\n        {\n            return (authMinimumAdminPermission != null && base.Equals(authMinimumAdminPermission));\n        }\n\n        public override bool Equals(object authMinimumAdminPermission)\n        {\n            return Equals(authMinimumAdminPermission as AuthMinimumAdminPermission);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AuthorizationDescription : DynamicData, IEquatable<AuthorizationDescription>\n    {\n        public ElementDescription[] Privilege { get; set; }\n\n        public ElementDescription[] PrivilegeGroup { get; set; }\n\n        public bool Equals(AuthorizationDescription authorizationDescription)\n        {\n            return (authorizationDescription != null && ((this.Privilege == null && authorizationDescription.Privilege == null) || (this.Privilege != null && authorizationDescription.Privilege != null && Enumerable.SequenceEqual(this.Privilege, authorizationDescription.Privilege))) && ((this.PrivilegeGroup == null && authorizationDescription.PrivilegeGroup == null) || (this.PrivilegeGroup != null && authorizationDescription.PrivilegeGroup != null && Enumerable.SequenceEqual(this.PrivilegeGroup, authorizationDescription.PrivilegeGroup))));\n        }\n\n        public override bool Equals(object authorizationDescription)\n        {\n            return Equals(authorizationDescription as AuthorizationDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Privilege + \"_\" + PrivilegeGroup).GetHashCode();\n        }\n    }\n\n    public class AuthorizationEvent : Event, IEquatable<AuthorizationEvent>\n    {\n        public bool Equals(AuthorizationEvent authorizationEvent)\n        {\n            return (authorizationEvent != null && base.Equals(authorizationEvent));\n        }\n\n        public override bool Equals(object authorizationEvent)\n        {\n            return Equals(authorizationEvent as AuthorizationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class AuthorizationManager : ViewBase, IEquatable<AuthorizationManager>\n    {\n        public AuthorizationPrivilege[] PrivilegeList { get; set; }\n\n        public AuthorizationRole[] RoleList { get; set; }\n\n        public AuthorizationDescription Description { get; set; }\n\n        public int AddAuthorizationRole(string name, string[] privIds)\n        {\n            return default(int);\n        }\n\n        public void RemoveAuthorizationRole(int roleId, bool failIfUsed)\n        {\n        }\n\n        public void UpdateAuthorizationRole(int roleId, string newName, string[] privIds)\n        {\n        }\n\n        public void MergePermissions(int srcRoleId, int dstRoleId)\n        {\n        }\n\n        public Permission[] RetrieveRolePermissions(int roleId)\n        {\n            return default(Permission[]);\n        }\n\n        public Permission[] RetrieveEntityPermissions(ManagedObjectReference entity, bool inherited)\n        {\n            return default(Permission[]);\n        }\n\n        public Permission[] RetrieveAllPermissions()\n        {\n            return default(Permission[]);\n        }\n\n        public void SetEntityPermissions(ManagedObjectReference entity, Permission[] permission)\n        {\n        }\n\n        public void ResetEntityPermissions(ManagedObjectReference entity, Permission[] permission)\n        {\n        }\n\n        public void RemoveEntityPermission(ManagedObjectReference entity, string user, bool isGroup)\n        {\n        }\n\n        public bool[] HasPrivilegeOnEntity(ManagedObjectReference entity, string sessionId, string[] privId)\n        {\n            return default(bool[]);\n        }\n\n        public EntityPrivilege[] HasPrivilegeOnEntities(ManagedObjectReference[] entity, string sessionId, string[] privId)\n        {\n            return default(EntityPrivilege[]);\n        }\n\n        public EntityPrivilege[] HasUserPrivilegeOnEntities(ManagedObjectReference[] entities, string userName, string[] privId)\n        {\n            return default(EntityPrivilege[]);\n        }\n\n        public UserPrivilegeResult[] FetchUserPrivilegeOnEntities(ManagedObjectReference[] entities, string userName)\n        {\n            return default(UserPrivilegeResult[]);\n        }\n\n        public bool Equals(AuthorizationManager authorizationManager)\n        {\n            return (authorizationManager != null && ((this.PrivilegeList == null && authorizationManager.PrivilegeList == null) || (this.PrivilegeList != null && authorizationManager.PrivilegeList != null && Enumerable.SequenceEqual(this.PrivilegeList, authorizationManager.PrivilegeList))) && ((this.RoleList == null && authorizationManager.RoleList == null) || (this.RoleList != null && authorizationManager.RoleList != null && Enumerable.SequenceEqual(this.RoleList, authorizationManager.RoleList))) && ((this.Description == null && authorizationManager.Description == null) || (this.Description != null && this.Description.Equals(authorizationManager.Description))));\n        }\n\n        public override bool Equals(object authorizationManager)\n        {\n            return Equals(authorizationManager as AuthorizationManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrivilegeList + \"_\" + RoleList + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class AuthorizationPrivilege : DynamicData, IEquatable<AuthorizationPrivilege>\n    {\n        public string PrivId { get; set; }\n\n        public bool OnParent { get; set; }\n\n        public string Name { get; set; }\n\n        public string PrivGroupName { get; set; }\n\n        public bool Equals(AuthorizationPrivilege authorizationPrivilege)\n        {\n            return (authorizationPrivilege != null && this.PrivId == authorizationPrivilege.PrivId && this.OnParent == authorizationPrivilege.OnParent && this.Name == authorizationPrivilege.Name && this.PrivGroupName == authorizationPrivilege.PrivGroupName);\n        }\n\n        public override bool Equals(object authorizationPrivilege)\n        {\n            return Equals(authorizationPrivilege as AuthorizationPrivilege);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrivId + \"_\" + OnParent + \"_\" + Name + \"_\" + PrivGroupName).GetHashCode();\n        }\n    }\n\n    public class AuthorizationRole : DynamicData, IEquatable<AuthorizationRole>\n    {\n        public int RoleId { get; set; }\n\n        public bool System { get; set; }\n\n        public string Name { get; set; }\n\n        public Description Info { get; set; }\n\n        public string[] Privilege { get; set; }\n\n        public bool Equals(AuthorizationRole authorizationRole)\n        {\n            return (authorizationRole != null && this.RoleId == authorizationRole.RoleId && this.System == authorizationRole.System && this.Name == authorizationRole.Name && ((this.Info == null && authorizationRole.Info == null) || (this.Info != null && this.Info.Equals(authorizationRole.Info))) && ((this.Privilege == null && authorizationRole.Privilege == null) || (this.Privilege != null && authorizationRole.Privilege != null && Enumerable.SequenceEqual(this.Privilege, authorizationRole.Privilege))));\n        }\n\n        public override bool Equals(object authorizationRole)\n        {\n            return Equals(authorizationRole as AuthorizationRole);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RoleId + \"_\" + System + \"_\" + Name + \"_\" + Info + \"_\" + Privilege).GetHashCode();\n        }\n    }\n\n    public class AutoStartDefaults : DynamicData, IEquatable<AutoStartDefaults>\n    {\n        public bool? Enabled { get; set; }\n\n        public int? StartDelay { get; set; }\n\n        public int? StopDelay { get; set; }\n\n        public bool? WaitForHeartbeat { get; set; }\n\n        public string StopAction { get; set; }\n\n        public bool Equals(AutoStartDefaults autoStartDefaults)\n        {\n            return (autoStartDefaults != null && ((this.Enabled == null && autoStartDefaults.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(autoStartDefaults.Enabled))) && ((this.StartDelay == null && autoStartDefaults.StartDelay == null) || (this.StartDelay != null && this.StartDelay.Equals(autoStartDefaults.StartDelay))) && ((this.StopDelay == null && autoStartDefaults.StopDelay == null) || (this.StopDelay != null && this.StopDelay.Equals(autoStartDefaults.StopDelay))) && ((this.WaitForHeartbeat == null && autoStartDefaults.WaitForHeartbeat == null) || (this.WaitForHeartbeat != null && this.WaitForHeartbeat.Equals(autoStartDefaults.WaitForHeartbeat))) && this.StopAction == autoStartDefaults.StopAction);\n        }\n\n        public override bool Equals(object autoStartDefaults)\n        {\n            return Equals(autoStartDefaults as AutoStartDefaults);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + StartDelay + \"_\" + StopDelay + \"_\" + WaitForHeartbeat + \"_\" + StopAction).GetHashCode();\n        }\n    }\n\n    public class AutoStartPowerInfo : DynamicData, IEquatable<AutoStartPowerInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public int StartOrder { get; set; }\n\n        public int StartDelay { get; set; }\n\n        public AutoStartWaitHeartbeatSetting WaitForHeartbeat { get; set; }\n\n        public string StartAction { get; set; }\n\n        public int StopDelay { get; set; }\n\n        public string StopAction { get; set; }\n\n        public AutoStartPowerInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(AutoStartPowerInfo autoStartPowerInfo)\n        {\n            return (autoStartPowerInfo != null && ((this.Key == null && autoStartPowerInfo.Key == null) || (this.Key != null && this.Key.Equals(autoStartPowerInfo.Key))) && this.StartOrder == autoStartPowerInfo.StartOrder && this.StartDelay == autoStartPowerInfo.StartDelay && this.WaitForHeartbeat == autoStartPowerInfo.WaitForHeartbeat && this.StartAction == autoStartPowerInfo.StartAction && this.StopDelay == autoStartPowerInfo.StopDelay && this.StopAction == autoStartPowerInfo.StopAction && ((this.LinkedView == null && autoStartPowerInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(autoStartPowerInfo.LinkedView))));\n        }\n\n        public override bool Equals(object autoStartPowerInfo)\n        {\n            return Equals(autoStartPowerInfo as AutoStartPowerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + StartOrder + \"_\" + StartDelay + \"_\" + WaitForHeartbeat + \"_\" + StartAction + \"_\" + StopDelay + \"_\" + StopAction + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class AutoStartPowerInfo_LinkedView : IEquatable<AutoStartPowerInfo_LinkedView>\n    {\n        public VirtualMachine Key { get; set; }\n\n        public bool Equals(AutoStartPowerInfo_LinkedView autoStartPowerInfo_LinkedView)\n        {\n            return (autoStartPowerInfo_LinkedView != null && ((this.Key == null && autoStartPowerInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(autoStartPowerInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object autoStartPowerInfo_LinkedView)\n        {\n            return Equals(autoStartPowerInfo_LinkedView as AutoStartPowerInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class BackupBlobReadFailure : DvsFault, IEquatable<BackupBlobReadFailure>\n    {\n        public string EntityName { get; set; }\n\n        public string EntityType { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(BackupBlobReadFailure backupBlobReadFailure)\n        {\n            return (backupBlobReadFailure != null && this.EntityName == backupBlobReadFailure.EntityName && this.EntityType == backupBlobReadFailure.EntityType && ((this.Fault == null && backupBlobReadFailure.Fault == null) || (this.Fault != null && this.Fault.Equals(backupBlobReadFailure.Fault))));\n        }\n\n        public override bool Equals(object backupBlobReadFailure)\n        {\n            return Equals(backupBlobReadFailure as BackupBlobReadFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityName + \"_\" + EntityType + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class BackupBlobWriteFailure : DvsFault, IEquatable<BackupBlobWriteFailure>\n    {\n        public string EntityName { get; set; }\n\n        public string EntityType { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(BackupBlobWriteFailure backupBlobWriteFailure)\n        {\n            return (backupBlobWriteFailure != null && this.EntityName == backupBlobWriteFailure.EntityName && this.EntityType == backupBlobWriteFailure.EntityType && ((this.Fault == null && backupBlobWriteFailure.Fault == null) || (this.Fault != null && this.Fault.Equals(backupBlobWriteFailure.Fault))));\n        }\n\n        public override bool Equals(object backupBlobWriteFailure)\n        {\n            return Equals(backupBlobWriteFailure as BackupBlobWriteFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityName + \"_\" + EntityType + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class BadUsernameSessionEvent : SessionEvent, IEquatable<BadUsernameSessionEvent>\n    {\n        public string IpAddress { get; set; }\n\n        public bool Equals(BadUsernameSessionEvent badUsernameSessionEvent)\n        {\n            return (badUsernameSessionEvent != null && this.IpAddress == badUsernameSessionEvent.IpAddress);\n        }\n\n        public override bool Equals(object badUsernameSessionEvent)\n        {\n            return Equals(badUsernameSessionEvent as BadUsernameSessionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfo : DynamicData, IEquatable<BaseConfigInfo>\n    {\n        public ID Id { get; set; }\n\n        public string Name { get; set; }\n\n        public DateTime CreateTime { get; set; }\n\n        public bool? KeepAfterDeleteVm { get; set; }\n\n        public bool? RelocationDisabled { get; set; }\n\n        public bool? NativeSnapshotSupported { get; set; }\n\n        public bool? ChangedBlockTrackingEnabled { get; set; }\n\n        public BaseConfigInfoBackingInfo Backing { get; set; }\n\n        public string[] Iofilter { get; set; }\n\n        public bool Equals(BaseConfigInfo baseConfigInfo)\n        {\n            return (baseConfigInfo != null && ((this.Id == null && baseConfigInfo.Id == null) || (this.Id != null && this.Id.Equals(baseConfigInfo.Id))) && this.Name == baseConfigInfo.Name && this.CreateTime == baseConfigInfo.CreateTime && ((this.KeepAfterDeleteVm == null && baseConfigInfo.KeepAfterDeleteVm == null) || (this.KeepAfterDeleteVm != null && this.KeepAfterDeleteVm.Equals(baseConfigInfo.KeepAfterDeleteVm))) && ((this.RelocationDisabled == null && baseConfigInfo.RelocationDisabled == null) || (this.RelocationDisabled != null && this.RelocationDisabled.Equals(baseConfigInfo.RelocationDisabled))) && ((this.NativeSnapshotSupported == null && baseConfigInfo.NativeSnapshotSupported == null) || (this.NativeSnapshotSupported != null && this.NativeSnapshotSupported.Equals(baseConfigInfo.NativeSnapshotSupported))) && ((this.ChangedBlockTrackingEnabled == null && baseConfigInfo.ChangedBlockTrackingEnabled == null) || (this.ChangedBlockTrackingEnabled != null && this.ChangedBlockTrackingEnabled.Equals(baseConfigInfo.ChangedBlockTrackingEnabled))) && ((this.Backing == null && baseConfigInfo.Backing == null) || (this.Backing != null && this.Backing.Equals(baseConfigInfo.Backing))) && ((this.Iofilter == null && baseConfigInfo.Iofilter == null) || (this.Iofilter != null && baseConfigInfo.Iofilter != null && Enumerable.SequenceEqual(this.Iofilter, baseConfigInfo.Iofilter))));\n        }\n\n        public override bool Equals(object baseConfigInfo)\n        {\n            return Equals(baseConfigInfo as BaseConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + CreateTime + \"_\" + KeepAfterDeleteVm + \"_\" + RelocationDisabled + \"_\" + NativeSnapshotSupported + \"_\" + ChangedBlockTrackingEnabled + \"_\" + Backing + \"_\" + Iofilter).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoBackingInfo : DynamicData, IEquatable<BaseConfigInfoBackingInfo>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public BaseConfigInfoBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(BaseConfigInfoBackingInfo baseConfigInfoBackingInfo)\n        {\n            return (baseConfigInfoBackingInfo != null && ((this.Datastore == null && baseConfigInfoBackingInfo.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(baseConfigInfoBackingInfo.Datastore))) && ((this.LinkedView == null && baseConfigInfoBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(baseConfigInfoBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object baseConfigInfoBackingInfo)\n        {\n            return Equals(baseConfigInfoBackingInfo as BaseConfigInfoBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoBackingInfo_LinkedView : IEquatable<BaseConfigInfoBackingInfo_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(BaseConfigInfoBackingInfo_LinkedView baseConfigInfoBackingInfo_LinkedView)\n        {\n            return (baseConfigInfoBackingInfo_LinkedView != null && ((this.Datastore == null && baseConfigInfoBackingInfo_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(baseConfigInfoBackingInfo_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object baseConfigInfoBackingInfo_LinkedView)\n        {\n            return Equals(baseConfigInfoBackingInfo_LinkedView as BaseConfigInfoBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoDiskFileBackingInfo : BaseConfigInfoFileBackingInfo, IEquatable<BaseConfigInfoDiskFileBackingInfo>\n    {\n        public string ProvisioningType { get; set; }\n\n        public new BaseConfigInfoDiskFileBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(BaseConfigInfoDiskFileBackingInfo baseConfigInfoDiskFileBackingInfo)\n        {\n            return (baseConfigInfoDiskFileBackingInfo != null && this.ProvisioningType == baseConfigInfoDiskFileBackingInfo.ProvisioningType && ((this.LinkedView == null && baseConfigInfoDiskFileBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(baseConfigInfoDiskFileBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object baseConfigInfoDiskFileBackingInfo)\n        {\n            return Equals(baseConfigInfoDiskFileBackingInfo as BaseConfigInfoDiskFileBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProvisioningType + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoDiskFileBackingInfo_LinkedView : BaseConfigInfoFileBackingInfo_LinkedView, IEquatable<BaseConfigInfoDiskFileBackingInfo_LinkedView>\n    {\n        public bool Equals(BaseConfigInfoDiskFileBackingInfo_LinkedView baseConfigInfoDiskFileBackingInfo_LinkedView)\n        {\n            return (baseConfigInfoDiskFileBackingInfo_LinkedView != null && base.Equals(baseConfigInfoDiskFileBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object baseConfigInfoDiskFileBackingInfo_LinkedView)\n        {\n            return Equals(baseConfigInfoDiskFileBackingInfo_LinkedView as BaseConfigInfoDiskFileBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoFileBackingInfo : BaseConfigInfoBackingInfo, IEquatable<BaseConfigInfoFileBackingInfo>\n    {\n        public new BaseConfigInfoFileBackingInfo_LinkedView LinkedView { get; set; }\n\n        public string FilePath { get; set; }\n\n        public string BackingObjectId { get; set; }\n\n        public BaseConfigInfoFileBackingInfo Parent { get; set; }\n\n        public long? DeltaSizeInMB { get; set; }\n\n        public bool Equals(BaseConfigInfoFileBackingInfo baseConfigInfoFileBackingInfo)\n        {\n            return (baseConfigInfoFileBackingInfo != null && ((this.LinkedView == null && baseConfigInfoFileBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(baseConfigInfoFileBackingInfo.LinkedView))) && this.FilePath == baseConfigInfoFileBackingInfo.FilePath && this.BackingObjectId == baseConfigInfoFileBackingInfo.BackingObjectId && ((this.Parent == null && baseConfigInfoFileBackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(baseConfigInfoFileBackingInfo.Parent))) && ((this.DeltaSizeInMB == null && baseConfigInfoFileBackingInfo.DeltaSizeInMB == null) || (this.DeltaSizeInMB != null && this.DeltaSizeInMB.Equals(baseConfigInfoFileBackingInfo.DeltaSizeInMB))));\n        }\n\n        public override bool Equals(object baseConfigInfoFileBackingInfo)\n        {\n            return Equals(baseConfigInfoFileBackingInfo as BaseConfigInfoFileBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView + \"_\" + FilePath + \"_\" + BackingObjectId + \"_\" + Parent + \"_\" + DeltaSizeInMB).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoFileBackingInfo_LinkedView : BaseConfigInfoBackingInfo_LinkedView, IEquatable<BaseConfigInfoFileBackingInfo_LinkedView>\n    {\n        public bool Equals(BaseConfigInfoFileBackingInfo_LinkedView baseConfigInfoFileBackingInfo_LinkedView)\n        {\n            return (baseConfigInfoFileBackingInfo_LinkedView != null && base.Equals(baseConfigInfoFileBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object baseConfigInfoFileBackingInfo_LinkedView)\n        {\n            return Equals(baseConfigInfoFileBackingInfo_LinkedView as BaseConfigInfoFileBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoRawDiskMappingBackingInfo : BaseConfigInfoFileBackingInfo, IEquatable<BaseConfigInfoRawDiskMappingBackingInfo>\n    {\n        public string LunUuid { get; set; }\n\n        public string CompatibilityMode { get; set; }\n\n        public new BaseConfigInfoRawDiskMappingBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(BaseConfigInfoRawDiskMappingBackingInfo baseConfigInfoRawDiskMappingBackingInfo)\n        {\n            return (baseConfigInfoRawDiskMappingBackingInfo != null && this.LunUuid == baseConfigInfoRawDiskMappingBackingInfo.LunUuid && this.CompatibilityMode == baseConfigInfoRawDiskMappingBackingInfo.CompatibilityMode && ((this.LinkedView == null && baseConfigInfoRawDiskMappingBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(baseConfigInfoRawDiskMappingBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object baseConfigInfoRawDiskMappingBackingInfo)\n        {\n            return Equals(baseConfigInfoRawDiskMappingBackingInfo as BaseConfigInfoRawDiskMappingBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LunUuid + \"_\" + CompatibilityMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class BaseConfigInfoRawDiskMappingBackingInfo_LinkedView : BaseConfigInfoFileBackingInfo_LinkedView, IEquatable<BaseConfigInfoRawDiskMappingBackingInfo_LinkedView>\n    {\n        public bool Equals(BaseConfigInfoRawDiskMappingBackingInfo_LinkedView baseConfigInfoRawDiskMappingBackingInfo_LinkedView)\n        {\n            return (baseConfigInfoRawDiskMappingBackingInfo_LinkedView != null && base.Equals(baseConfigInfoRawDiskMappingBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object baseConfigInfoRawDiskMappingBackingInfo_LinkedView)\n        {\n            return Equals(baseConfigInfoRawDiskMappingBackingInfo_LinkedView as BaseConfigInfoRawDiskMappingBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class BatchResult : DynamicData, IEquatable<BatchResult>\n    {\n        public string Result { get; set; }\n\n        public string HostKey { get; set; }\n\n        public ManagedObjectReference Ds { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public BatchResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(BatchResult batchResult)\n        {\n            return (batchResult != null && this.Result == batchResult.Result && this.HostKey == batchResult.HostKey && ((this.Ds == null && batchResult.Ds == null) || (this.Ds != null && this.Ds.Equals(batchResult.Ds))) && ((this.Fault == null && batchResult.Fault == null) || (this.Fault != null && this.Fault.Equals(batchResult.Fault))) && ((this.LinkedView == null && batchResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(batchResult.LinkedView))));\n        }\n\n        public override bool Equals(object batchResult)\n        {\n            return Equals(batchResult as BatchResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Result + \"_\" + HostKey + \"_\" + Ds + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class BatchResult_LinkedView : IEquatable<BatchResult_LinkedView>\n    {\n        public Datastore Ds { get; set; }\n\n        public bool Equals(BatchResult_LinkedView batchResult_LinkedView)\n        {\n            return (batchResult_LinkedView != null && ((this.Ds == null && batchResult_LinkedView.Ds == null) || (this.Ds != null && this.Ds.Equals(batchResult_LinkedView.Ds))));\n        }\n\n        public override bool Equals(object batchResult_LinkedView)\n        {\n            return Equals(batchResult_LinkedView as BatchResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ds).GetHashCode();\n        }\n    }\n\n    public class BlockedByFirewall : HostConfigFault, IEquatable<BlockedByFirewall>\n    {\n        public bool Equals(BlockedByFirewall blockedByFirewall)\n        {\n            return (blockedByFirewall != null && base.Equals(blockedByFirewall));\n        }\n\n        public override bool Equals(object blockedByFirewall)\n        {\n            return Equals(blockedByFirewall as BlockedByFirewall);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class BoolOption : OptionType, IEquatable<BoolOption>\n    {\n        public bool Supported { get; set; }\n\n        public bool DefaultValue { get; set; }\n\n        public bool Equals(BoolOption boolOption)\n        {\n            return (boolOption != null && this.Supported == boolOption.Supported && this.DefaultValue == boolOption.DefaultValue);\n        }\n\n        public override bool Equals(object boolOption)\n        {\n            return Equals(boolOption as BoolOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Supported + \"_\" + DefaultValue).GetHashCode();\n        }\n    }\n\n    public class BoolPolicy : InheritablePolicy, IEquatable<BoolPolicy>\n    {\n        public bool? Value { get; set; }\n\n        public bool Equals(BoolPolicy boolPolicy)\n        {\n            return (boolPolicy != null && ((this.Value == null && boolPolicy.Value == null) || (this.Value != null && this.Value.Equals(boolPolicy.Value))));\n        }\n\n        public override bool Equals(object boolPolicy)\n        {\n            return Equals(boolPolicy as BoolPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class CAMServerRefusedConnection : InvalidCAMServer, IEquatable<CAMServerRefusedConnection>\n    {\n        public bool Equals(CAMServerRefusedConnection cAMServerRefusedConnection)\n        {\n            return (cAMServerRefusedConnection != null && base.Equals(cAMServerRefusedConnection));\n        }\n\n        public override bool Equals(object cAMServerRefusedConnection)\n        {\n            return Equals(cAMServerRefusedConnection as CAMServerRefusedConnection);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CanceledHostOperationEvent : HostEvent, IEquatable<CanceledHostOperationEvent>\n    {\n        public bool Equals(CanceledHostOperationEvent canceledHostOperationEvent)\n        {\n            return (canceledHostOperationEvent != null && base.Equals(canceledHostOperationEvent));\n        }\n\n        public override bool Equals(object canceledHostOperationEvent)\n        {\n            return Equals(canceledHostOperationEvent as CanceledHostOperationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotAccessFile : FileFault, IEquatable<CannotAccessFile>\n    {\n        public bool Equals(CannotAccessFile cannotAccessFile)\n        {\n            return (cannotAccessFile != null && base.Equals(cannotAccessFile));\n        }\n\n        public override bool Equals(object cannotAccessFile)\n        {\n            return Equals(cannotAccessFile as CannotAccessFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotAccessLocalSource : VimFault, IEquatable<CannotAccessLocalSource>\n    {\n        public bool Equals(CannotAccessLocalSource cannotAccessLocalSource)\n        {\n            return (cannotAccessLocalSource != null && base.Equals(cannotAccessLocalSource));\n        }\n\n        public override bool Equals(object cannotAccessLocalSource)\n        {\n            return Equals(cannotAccessLocalSource as CannotAccessLocalSource);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotAccessNetwork : CannotAccessVmDevice, IEquatable<CannotAccessNetwork>\n    {\n        public ManagedObjectReference Network { get; set; }\n\n        public CannotAccessNetwork_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotAccessNetwork cannotAccessNetwork)\n        {\n            return (cannotAccessNetwork != null && ((this.Network == null && cannotAccessNetwork.Network == null) || (this.Network != null && this.Network.Equals(cannotAccessNetwork.Network))) && ((this.LinkedView == null && cannotAccessNetwork.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotAccessNetwork.LinkedView))));\n        }\n\n        public override bool Equals(object cannotAccessNetwork)\n        {\n            return Equals(cannotAccessNetwork as CannotAccessNetwork);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotAccessNetwork_LinkedView : IEquatable<CannotAccessNetwork_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(CannotAccessNetwork_LinkedView cannotAccessNetwork_LinkedView)\n        {\n            return (cannotAccessNetwork_LinkedView != null && ((this.Network == null && cannotAccessNetwork_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(cannotAccessNetwork_LinkedView.Network))));\n        }\n\n        public override bool Equals(object cannotAccessNetwork_LinkedView)\n        {\n            return Equals(cannotAccessNetwork_LinkedView as CannotAccessNetwork_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class CannotAccessVmComponent : VmConfigFault, IEquatable<CannotAccessVmComponent>\n    {\n        public bool Equals(CannotAccessVmComponent cannotAccessVmComponent)\n        {\n            return (cannotAccessVmComponent != null && base.Equals(cannotAccessVmComponent));\n        }\n\n        public override bool Equals(object cannotAccessVmComponent)\n        {\n            return Equals(cannotAccessVmComponent as CannotAccessVmComponent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotAccessVmConfig : CannotAccessVmComponent, IEquatable<CannotAccessVmConfig>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(CannotAccessVmConfig cannotAccessVmConfig)\n        {\n            return (cannotAccessVmConfig != null && ((this.Reason == null && cannotAccessVmConfig.Reason == null) || (this.Reason != null && this.Reason.Equals(cannotAccessVmConfig.Reason))));\n        }\n\n        public override bool Equals(object cannotAccessVmConfig)\n        {\n            return Equals(cannotAccessVmConfig as CannotAccessVmConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class CannotAccessVmDevice : CannotAccessVmComponent, IEquatable<CannotAccessVmDevice>\n    {\n        public string Device { get; set; }\n\n        public string Backing { get; set; }\n\n        public bool Connected { get; set; }\n\n        public bool Equals(CannotAccessVmDevice cannotAccessVmDevice)\n        {\n            return (cannotAccessVmDevice != null && this.Device == cannotAccessVmDevice.Device && this.Backing == cannotAccessVmDevice.Backing && this.Connected == cannotAccessVmDevice.Connected);\n        }\n\n        public override bool Equals(object cannotAccessVmDevice)\n        {\n            return Equals(cannotAccessVmDevice as CannotAccessVmDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Backing + \"_\" + Connected).GetHashCode();\n        }\n    }\n\n    public class CannotAccessVmDisk : CannotAccessVmDevice, IEquatable<CannotAccessVmDisk>\n    {\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(CannotAccessVmDisk cannotAccessVmDisk)\n        {\n            return (cannotAccessVmDisk != null && ((this.Fault == null && cannotAccessVmDisk.Fault == null) || (this.Fault != null && this.Fault.Equals(cannotAccessVmDisk.Fault))));\n        }\n\n        public override bool Equals(object cannotAccessVmDisk)\n        {\n            return Equals(cannotAccessVmDisk as CannotAccessVmDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault).GetHashCode();\n        }\n    }\n\n    public class CannotAddHostWithFTVmAsStandalone : HostConnectFault, IEquatable<CannotAddHostWithFTVmAsStandalone>\n    {\n        public bool Equals(CannotAddHostWithFTVmAsStandalone cannotAddHostWithFTVmAsStandalone)\n        {\n            return (cannotAddHostWithFTVmAsStandalone != null && base.Equals(cannotAddHostWithFTVmAsStandalone));\n        }\n\n        public override bool Equals(object cannotAddHostWithFTVmAsStandalone)\n        {\n            return Equals(cannotAddHostWithFTVmAsStandalone as CannotAddHostWithFTVmAsStandalone);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotAddHostWithFTVmToDifferentCluster : HostConnectFault, IEquatable<CannotAddHostWithFTVmToDifferentCluster>\n    {\n        public bool Equals(CannotAddHostWithFTVmToDifferentCluster cannotAddHostWithFTVmToDifferentCluster)\n        {\n            return (cannotAddHostWithFTVmToDifferentCluster != null && base.Equals(cannotAddHostWithFTVmToDifferentCluster));\n        }\n\n        public override bool Equals(object cannotAddHostWithFTVmToDifferentCluster)\n        {\n            return Equals(cannotAddHostWithFTVmToDifferentCluster as CannotAddHostWithFTVmToDifferentCluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotAddHostWithFTVmToNonHACluster : HostConnectFault, IEquatable<CannotAddHostWithFTVmToNonHACluster>\n    {\n        public bool Equals(CannotAddHostWithFTVmToNonHACluster cannotAddHostWithFTVmToNonHACluster)\n        {\n            return (cannotAddHostWithFTVmToNonHACluster != null && base.Equals(cannotAddHostWithFTVmToNonHACluster));\n        }\n\n        public override bool Equals(object cannotAddHostWithFTVmToNonHACluster)\n        {\n            return Equals(cannotAddHostWithFTVmToNonHACluster as CannotAddHostWithFTVmToNonHACluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotChangeDrsBehaviorForFtSecondary : VmFaultToleranceIssue, IEquatable<CannotChangeDrsBehaviorForFtSecondary>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public CannotChangeDrsBehaviorForFtSecondary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotChangeDrsBehaviorForFtSecondary cannotChangeDrsBehaviorForFtSecondary)\n        {\n            return (cannotChangeDrsBehaviorForFtSecondary != null && ((this.Vm == null && cannotChangeDrsBehaviorForFtSecondary.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotChangeDrsBehaviorForFtSecondary.Vm))) && this.VmName == cannotChangeDrsBehaviorForFtSecondary.VmName && ((this.LinkedView == null && cannotChangeDrsBehaviorForFtSecondary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotChangeDrsBehaviorForFtSecondary.LinkedView))));\n        }\n\n        public override bool Equals(object cannotChangeDrsBehaviorForFtSecondary)\n        {\n            return Equals(cannotChangeDrsBehaviorForFtSecondary as CannotChangeDrsBehaviorForFtSecondary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotChangeDrsBehaviorForFtSecondary_LinkedView : IEquatable<CannotChangeDrsBehaviorForFtSecondary_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(CannotChangeDrsBehaviorForFtSecondary_LinkedView cannotChangeDrsBehaviorForFtSecondary_LinkedView)\n        {\n            return (cannotChangeDrsBehaviorForFtSecondary_LinkedView != null && ((this.Vm == null && cannotChangeDrsBehaviorForFtSecondary_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotChangeDrsBehaviorForFtSecondary_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object cannotChangeDrsBehaviorForFtSecondary_LinkedView)\n        {\n            return Equals(cannotChangeDrsBehaviorForFtSecondary_LinkedView as CannotChangeDrsBehaviorForFtSecondary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class CannotChangeHaSettingsForFtSecondary : VmFaultToleranceIssue, IEquatable<CannotChangeHaSettingsForFtSecondary>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public CannotChangeHaSettingsForFtSecondary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotChangeHaSettingsForFtSecondary cannotChangeHaSettingsForFtSecondary)\n        {\n            return (cannotChangeHaSettingsForFtSecondary != null && ((this.Vm == null && cannotChangeHaSettingsForFtSecondary.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotChangeHaSettingsForFtSecondary.Vm))) && this.VmName == cannotChangeHaSettingsForFtSecondary.VmName && ((this.LinkedView == null && cannotChangeHaSettingsForFtSecondary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotChangeHaSettingsForFtSecondary.LinkedView))));\n        }\n\n        public override bool Equals(object cannotChangeHaSettingsForFtSecondary)\n        {\n            return Equals(cannotChangeHaSettingsForFtSecondary as CannotChangeHaSettingsForFtSecondary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotChangeHaSettingsForFtSecondary_LinkedView : IEquatable<CannotChangeHaSettingsForFtSecondary_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(CannotChangeHaSettingsForFtSecondary_LinkedView cannotChangeHaSettingsForFtSecondary_LinkedView)\n        {\n            return (cannotChangeHaSettingsForFtSecondary_LinkedView != null && ((this.Vm == null && cannotChangeHaSettingsForFtSecondary_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotChangeHaSettingsForFtSecondary_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object cannotChangeHaSettingsForFtSecondary_LinkedView)\n        {\n            return Equals(cannotChangeHaSettingsForFtSecondary_LinkedView as CannotChangeHaSettingsForFtSecondary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class CannotChangeVsanClusterUuid : VsanFault, IEquatable<CannotChangeVsanClusterUuid>\n    {\n        public bool Equals(CannotChangeVsanClusterUuid cannotChangeVsanClusterUuid)\n        {\n            return (cannotChangeVsanClusterUuid != null && base.Equals(cannotChangeVsanClusterUuid));\n        }\n\n        public override bool Equals(object cannotChangeVsanClusterUuid)\n        {\n            return Equals(cannotChangeVsanClusterUuid as CannotChangeVsanClusterUuid);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotChangeVsanNodeUuid : VsanFault, IEquatable<CannotChangeVsanNodeUuid>\n    {\n        public bool Equals(CannotChangeVsanNodeUuid cannotChangeVsanNodeUuid)\n        {\n            return (cannotChangeVsanNodeUuid != null && base.Equals(cannotChangeVsanNodeUuid));\n        }\n\n        public override bool Equals(object cannotChangeVsanNodeUuid)\n        {\n            return Equals(cannotChangeVsanNodeUuid as CannotChangeVsanNodeUuid);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotComputeFTCompatibleHosts : VmFaultToleranceIssue, IEquatable<CannotComputeFTCompatibleHosts>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public CannotComputeFTCompatibleHosts_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotComputeFTCompatibleHosts cannotComputeFTCompatibleHosts)\n        {\n            return (cannotComputeFTCompatibleHosts != null && ((this.Vm == null && cannotComputeFTCompatibleHosts.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotComputeFTCompatibleHosts.Vm))) && this.VmName == cannotComputeFTCompatibleHosts.VmName && ((this.LinkedView == null && cannotComputeFTCompatibleHosts.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotComputeFTCompatibleHosts.LinkedView))));\n        }\n\n        public override bool Equals(object cannotComputeFTCompatibleHosts)\n        {\n            return Equals(cannotComputeFTCompatibleHosts as CannotComputeFTCompatibleHosts);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotComputeFTCompatibleHosts_LinkedView : IEquatable<CannotComputeFTCompatibleHosts_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(CannotComputeFTCompatibleHosts_LinkedView cannotComputeFTCompatibleHosts_LinkedView)\n        {\n            return (cannotComputeFTCompatibleHosts_LinkedView != null && ((this.Vm == null && cannotComputeFTCompatibleHosts_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotComputeFTCompatibleHosts_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object cannotComputeFTCompatibleHosts_LinkedView)\n        {\n            return Equals(cannotComputeFTCompatibleHosts_LinkedView as CannotComputeFTCompatibleHosts_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class CannotCreateFile : FileFault, IEquatable<CannotCreateFile>\n    {\n        public bool Equals(CannotCreateFile cannotCreateFile)\n        {\n            return (cannotCreateFile != null && base.Equals(cannotCreateFile));\n        }\n\n        public override bool Equals(object cannotCreateFile)\n        {\n            return Equals(cannotCreateFile as CannotCreateFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotDecryptPasswords : CustomizationFault, IEquatable<CannotDecryptPasswords>\n    {\n        public bool Equals(CannotDecryptPasswords cannotDecryptPasswords)\n        {\n            return (cannotDecryptPasswords != null && base.Equals(cannotDecryptPasswords));\n        }\n\n        public override bool Equals(object cannotDecryptPasswords)\n        {\n            return Equals(cannotDecryptPasswords as CannotDecryptPasswords);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotDeleteFile : FileFault, IEquatable<CannotDeleteFile>\n    {\n        public bool Equals(CannotDeleteFile cannotDeleteFile)\n        {\n            return (cannotDeleteFile != null && base.Equals(cannotDeleteFile));\n        }\n\n        public override bool Equals(object cannotDeleteFile)\n        {\n            return Equals(cannotDeleteFile as CannotDeleteFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotDisableDrsOnClustersWithVApps : RuntimeFault, IEquatable<CannotDisableDrsOnClustersWithVApps>\n    {\n        public bool Equals(CannotDisableDrsOnClustersWithVApps cannotDisableDrsOnClustersWithVApps)\n        {\n            return (cannotDisableDrsOnClustersWithVApps != null && base.Equals(cannotDisableDrsOnClustersWithVApps));\n        }\n\n        public override bool Equals(object cannotDisableDrsOnClustersWithVApps)\n        {\n            return Equals(cannotDisableDrsOnClustersWithVApps as CannotDisableDrsOnClustersWithVApps);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotDisableSnapshot : VmConfigFault, IEquatable<CannotDisableSnapshot>\n    {\n        public bool Equals(CannotDisableSnapshot cannotDisableSnapshot)\n        {\n            return (cannotDisableSnapshot != null && base.Equals(cannotDisableSnapshot));\n        }\n\n        public override bool Equals(object cannotDisableSnapshot)\n        {\n            return Equals(cannotDisableSnapshot as CannotDisableSnapshot);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotDisconnectHostWithFaultToleranceVm : VimFault, IEquatable<CannotDisconnectHostWithFaultToleranceVm>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(CannotDisconnectHostWithFaultToleranceVm cannotDisconnectHostWithFaultToleranceVm)\n        {\n            return (cannotDisconnectHostWithFaultToleranceVm != null && this.HostName == cannotDisconnectHostWithFaultToleranceVm.HostName);\n        }\n\n        public override bool Equals(object cannotDisconnectHostWithFaultToleranceVm)\n        {\n            return Equals(cannotDisconnectHostWithFaultToleranceVm as CannotDisconnectHostWithFaultToleranceVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class CannotEnableVmcpForCluster : VimFault, IEquatable<CannotEnableVmcpForCluster>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string HostName { get; set; }\n\n        public string Reason { get; set; }\n\n        public CannotEnableVmcpForCluster_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotEnableVmcpForCluster cannotEnableVmcpForCluster)\n        {\n            return (cannotEnableVmcpForCluster != null && ((this.Host == null && cannotEnableVmcpForCluster.Host == null) || (this.Host != null && this.Host.Equals(cannotEnableVmcpForCluster.Host))) && this.HostName == cannotEnableVmcpForCluster.HostName && this.Reason == cannotEnableVmcpForCluster.Reason && ((this.LinkedView == null && cannotEnableVmcpForCluster.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotEnableVmcpForCluster.LinkedView))));\n        }\n\n        public override bool Equals(object cannotEnableVmcpForCluster)\n        {\n            return Equals(cannotEnableVmcpForCluster as CannotEnableVmcpForCluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostName + \"_\" + Reason + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotEnableVmcpForCluster_LinkedView : IEquatable<CannotEnableVmcpForCluster_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(CannotEnableVmcpForCluster_LinkedView cannotEnableVmcpForCluster_LinkedView)\n        {\n            return (cannotEnableVmcpForCluster_LinkedView != null && ((this.Host == null && cannotEnableVmcpForCluster_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(cannotEnableVmcpForCluster_LinkedView.Host))));\n        }\n\n        public override bool Equals(object cannotEnableVmcpForCluster_LinkedView)\n        {\n            return Equals(cannotEnableVmcpForCluster_LinkedView as CannotEnableVmcpForCluster_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class CannotModifyConfigCpuRequirements : MigrationFault, IEquatable<CannotModifyConfigCpuRequirements>\n    {\n        public bool Equals(CannotModifyConfigCpuRequirements cannotModifyConfigCpuRequirements)\n        {\n            return (cannotModifyConfigCpuRequirements != null && base.Equals(cannotModifyConfigCpuRequirements));\n        }\n\n        public override bool Equals(object cannotModifyConfigCpuRequirements)\n        {\n            return Equals(cannotModifyConfigCpuRequirements as CannotModifyConfigCpuRequirements);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotMoveFaultToleranceVm : VimFault, IEquatable<CannotMoveFaultToleranceVm>\n    {\n        public string MoveType { get; set; }\n\n        public string VmName { get; set; }\n\n        public bool Equals(CannotMoveFaultToleranceVm cannotMoveFaultToleranceVm)\n        {\n            return (cannotMoveFaultToleranceVm != null && this.MoveType == cannotMoveFaultToleranceVm.MoveType && this.VmName == cannotMoveFaultToleranceVm.VmName);\n        }\n\n        public override bool Equals(object cannotMoveFaultToleranceVm)\n        {\n            return Equals(cannotMoveFaultToleranceVm as CannotMoveFaultToleranceVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MoveType + \"_\" + VmName).GetHashCode();\n        }\n    }\n\n    public class CannotMoveHostWithFaultToleranceVm : VimFault, IEquatable<CannotMoveHostWithFaultToleranceVm>\n    {\n        public bool Equals(CannotMoveHostWithFaultToleranceVm cannotMoveHostWithFaultToleranceVm)\n        {\n            return (cannotMoveHostWithFaultToleranceVm != null && base.Equals(cannotMoveHostWithFaultToleranceVm));\n        }\n\n        public override bool Equals(object cannotMoveHostWithFaultToleranceVm)\n        {\n            return Equals(cannotMoveHostWithFaultToleranceVm as CannotMoveHostWithFaultToleranceVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotMoveVmWithDeltaDisk : MigrationFault, IEquatable<CannotMoveVmWithDeltaDisk>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(CannotMoveVmWithDeltaDisk cannotMoveVmWithDeltaDisk)\n        {\n            return (cannotMoveVmWithDeltaDisk != null && this.Device == cannotMoveVmWithDeltaDisk.Device);\n        }\n\n        public override bool Equals(object cannotMoveVmWithDeltaDisk)\n        {\n            return Equals(cannotMoveVmWithDeltaDisk as CannotMoveVmWithDeltaDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class CannotMoveVmWithNativeDeltaDisk : MigrationFault, IEquatable<CannotMoveVmWithNativeDeltaDisk>\n    {\n        public bool Equals(CannotMoveVmWithNativeDeltaDisk cannotMoveVmWithNativeDeltaDisk)\n        {\n            return (cannotMoveVmWithNativeDeltaDisk != null && base.Equals(cannotMoveVmWithNativeDeltaDisk));\n        }\n\n        public override bool Equals(object cannotMoveVmWithNativeDeltaDisk)\n        {\n            return Equals(cannotMoveVmWithNativeDeltaDisk as CannotMoveVmWithNativeDeltaDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotMoveVsanEnabledHost : VsanFault, IEquatable<CannotMoveVsanEnabledHost>\n    {\n        public bool Equals(CannotMoveVsanEnabledHost cannotMoveVsanEnabledHost)\n        {\n            return (cannotMoveVsanEnabledHost != null && base.Equals(cannotMoveVsanEnabledHost));\n        }\n\n        public override bool Equals(object cannotMoveVsanEnabledHost)\n        {\n            return Equals(cannotMoveVsanEnabledHost as CannotMoveVsanEnabledHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotPlaceWithoutPrerequisiteMoves : VimFault, IEquatable<CannotPlaceWithoutPrerequisiteMoves>\n    {\n        public bool Equals(CannotPlaceWithoutPrerequisiteMoves cannotPlaceWithoutPrerequisiteMoves)\n        {\n            return (cannotPlaceWithoutPrerequisiteMoves != null && base.Equals(cannotPlaceWithoutPrerequisiteMoves));\n        }\n\n        public override bool Equals(object cannotPlaceWithoutPrerequisiteMoves)\n        {\n            return Equals(cannotPlaceWithoutPrerequisiteMoves as CannotPlaceWithoutPrerequisiteMoves);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotPowerOffVmInCluster : InvalidState, IEquatable<CannotPowerOffVmInCluster>\n    {\n        public string Operation { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public CannotPowerOffVmInCluster_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotPowerOffVmInCluster cannotPowerOffVmInCluster)\n        {\n            return (cannotPowerOffVmInCluster != null && this.Operation == cannotPowerOffVmInCluster.Operation && ((this.Vm == null && cannotPowerOffVmInCluster.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotPowerOffVmInCluster.Vm))) && this.VmName == cannotPowerOffVmInCluster.VmName && ((this.LinkedView == null && cannotPowerOffVmInCluster.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotPowerOffVmInCluster.LinkedView))));\n        }\n\n        public override bool Equals(object cannotPowerOffVmInCluster)\n        {\n            return Equals(cannotPowerOffVmInCluster as CannotPowerOffVmInCluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotPowerOffVmInCluster_LinkedView : IEquatable<CannotPowerOffVmInCluster_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(CannotPowerOffVmInCluster_LinkedView cannotPowerOffVmInCluster_LinkedView)\n        {\n            return (cannotPowerOffVmInCluster_LinkedView != null && ((this.Vm == null && cannotPowerOffVmInCluster_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(cannotPowerOffVmInCluster_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object cannotPowerOffVmInCluster_LinkedView)\n        {\n            return Equals(cannotPowerOffVmInCluster_LinkedView as CannotPowerOffVmInCluster_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class CannotReconfigureVsanWhenHaEnabled : VsanFault, IEquatable<CannotReconfigureVsanWhenHaEnabled>\n    {\n        public bool Equals(CannotReconfigureVsanWhenHaEnabled cannotReconfigureVsanWhenHaEnabled)\n        {\n            return (cannotReconfigureVsanWhenHaEnabled != null && base.Equals(cannotReconfigureVsanWhenHaEnabled));\n        }\n\n        public override bool Equals(object cannotReconfigureVsanWhenHaEnabled)\n        {\n            return Equals(cannotReconfigureVsanWhenHaEnabled as CannotReconfigureVsanWhenHaEnabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CannotUseNetwork : VmConfigFault, IEquatable<CannotUseNetwork>\n    {\n        public string Device { get; set; }\n\n        public string Backing { get; set; }\n\n        public bool Connected { get; set; }\n\n        public string Reason { get; set; }\n\n        public ManagedObjectReference Network { get; set; }\n\n        public CannotUseNetwork_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CannotUseNetwork cannotUseNetwork)\n        {\n            return (cannotUseNetwork != null && this.Device == cannotUseNetwork.Device && this.Backing == cannotUseNetwork.Backing && this.Connected == cannotUseNetwork.Connected && this.Reason == cannotUseNetwork.Reason && ((this.Network == null && cannotUseNetwork.Network == null) || (this.Network != null && this.Network.Equals(cannotUseNetwork.Network))) && ((this.LinkedView == null && cannotUseNetwork.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cannotUseNetwork.LinkedView))));\n        }\n\n        public override bool Equals(object cannotUseNetwork)\n        {\n            return Equals(cannotUseNetwork as CannotUseNetwork);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Backing + \"_\" + Connected + \"_\" + Reason + \"_\" + Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CannotUseNetwork_LinkedView : IEquatable<CannotUseNetwork_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(CannotUseNetwork_LinkedView cannotUseNetwork_LinkedView)\n        {\n            return (cannotUseNetwork_LinkedView != null && ((this.Network == null && cannotUseNetwork_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(cannotUseNetwork_LinkedView.Network))));\n        }\n\n        public override bool Equals(object cannotUseNetwork_LinkedView)\n        {\n            return Equals(cannotUseNetwork_LinkedView as CannotUseNetwork_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class Capability : DynamicData, IEquatable<Capability>\n    {\n        public bool ProvisioningSupported { get; set; }\n\n        public bool MultiHostSupported { get; set; }\n\n        public bool UserShellAccessSupported { get; set; }\n\n        public EVCMode[] SupportedEVCMode { get; set; }\n\n        public bool? NetworkBackupAndRestoreSupported { get; set; }\n\n        public bool? FtDrsWithoutEvcSupported { get; set; }\n\n        public bool? HciWorkflowSupported { get; set; }\n\n        public bool Equals(Capability capability)\n        {\n            return (capability != null && this.ProvisioningSupported == capability.ProvisioningSupported && this.MultiHostSupported == capability.MultiHostSupported && this.UserShellAccessSupported == capability.UserShellAccessSupported && ((this.SupportedEVCMode == null && capability.SupportedEVCMode == null) || (this.SupportedEVCMode != null && capability.SupportedEVCMode != null && Enumerable.SequenceEqual(this.SupportedEVCMode, capability.SupportedEVCMode))) && ((this.NetworkBackupAndRestoreSupported == null && capability.NetworkBackupAndRestoreSupported == null) || (this.NetworkBackupAndRestoreSupported != null && this.NetworkBackupAndRestoreSupported.Equals(capability.NetworkBackupAndRestoreSupported))) && ((this.FtDrsWithoutEvcSupported == null && capability.FtDrsWithoutEvcSupported == null) || (this.FtDrsWithoutEvcSupported != null && this.FtDrsWithoutEvcSupported.Equals(capability.FtDrsWithoutEvcSupported))) && ((this.HciWorkflowSupported == null && capability.HciWorkflowSupported == null) || (this.HciWorkflowSupported != null && this.HciWorkflowSupported.Equals(capability.HciWorkflowSupported))));\n        }\n\n        public override bool Equals(object capability)\n        {\n            return Equals(capability as Capability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProvisioningSupported + \"_\" + MultiHostSupported + \"_\" + UserShellAccessSupported + \"_\" + SupportedEVCMode + \"_\" + NetworkBackupAndRestoreSupported + \"_\" + FtDrsWithoutEvcSupported + \"_\" + HciWorkflowSupported).GetHashCode();\n        }\n    }\n\n    public class CertificateErrorEventArg : EventArgs, IEquatable<CertificateErrorEventArg>\n    {\n        public object Sender { get; set; }\n\n        public X509Certificate Certificate { get; set; }\n\n        public X509Chain Chain { get; set; }\n\n        public SslPolicyErrors SslPolicyErrors { get; set; }\n\n        public bool IgnoreError { get; set; }\n\n        public bool Equals(CertificateErrorEventArg certificateErrorEventArg)\n        {\n            return (certificateErrorEventArg != null && ((this.Sender == null && certificateErrorEventArg.Sender == null) || (this.Sender != null && this.Sender.Equals(certificateErrorEventArg.Sender))) && ((this.Certificate == null && certificateErrorEventArg.Certificate == null) || (this.Certificate != null && this.Certificate.Equals(certificateErrorEventArg.Certificate))) && ((this.Chain == null && certificateErrorEventArg.Chain == null) || (this.Chain != null && this.Chain.Equals(certificateErrorEventArg.Chain))) && this.SslPolicyErrors == certificateErrorEventArg.SslPolicyErrors && this.IgnoreError == certificateErrorEventArg.IgnoreError);\n        }\n\n        public override bool Equals(object certificateErrorEventArg)\n        {\n            return Equals(certificateErrorEventArg as CertificateErrorEventArg);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Sender + \"_\" + Certificate + \"_\" + Chain + \"_\" + SslPolicyErrors + \"_\" + IgnoreError).GetHashCode();\n        }\n    }\n\n    public class CertificateManager : ViewBase, IEquatable<CertificateManager>\n    {\n        public ManagedObjectReference CertMgrRefreshCACertificatesAndCRLs_Task(ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void CertMgrRefreshCACertificatesAndCRLs(ManagedObjectReference[] host)\n        {\n        }\n\n        public ManagedObjectReference CertMgrRefreshCertificates_Task(ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void CertMgrRefreshCertificates(ManagedObjectReference[] host)\n        {\n        }\n\n        public ManagedObjectReference CertMgrRevokeCertificates_Task(ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void CertMgrRevokeCertificates(ManagedObjectReference[] host)\n        {\n        }\n\n        public bool Equals(CertificateManager certificateManager)\n        {\n            return (certificateManager != null && base.Equals(certificateManager));\n        }\n\n        public override bool Equals(object certificateManager)\n        {\n            return Equals(certificateManager as CertificateManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ChangesInfoEventArgument : DynamicData, IEquatable<ChangesInfoEventArgument>\n    {\n        public string Modified { get; set; }\n\n        public string Added { get; set; }\n\n        public string Deleted { get; set; }\n\n        public bool Equals(ChangesInfoEventArgument changesInfoEventArgument)\n        {\n            return (changesInfoEventArgument != null && this.Modified == changesInfoEventArgument.Modified && this.Added == changesInfoEventArgument.Added && this.Deleted == changesInfoEventArgument.Deleted);\n        }\n\n        public override bool Equals(object changesInfoEventArgument)\n        {\n            return Equals(changesInfoEventArgument as ChangesInfoEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Modified + \"_\" + Added + \"_\" + Deleted).GetHashCode();\n        }\n    }\n\n    public class CheckResult : DynamicData, IEquatable<CheckResult>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault[] Warning { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public CheckResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CheckResult checkResult)\n        {\n            return (checkResult != null && ((this.Vm == null && checkResult.Vm == null) || (this.Vm != null && this.Vm.Equals(checkResult.Vm))) && ((this.Host == null && checkResult.Host == null) || (this.Host != null && this.Host.Equals(checkResult.Host))) && ((this.Warning == null && checkResult.Warning == null) || (this.Warning != null && checkResult.Warning != null && Enumerable.SequenceEqual(this.Warning, checkResult.Warning))) && ((this.Error == null && checkResult.Error == null) || (this.Error != null && checkResult.Error != null && Enumerable.SequenceEqual(this.Error, checkResult.Error))) && ((this.LinkedView == null && checkResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(checkResult.LinkedView))));\n        }\n\n        public override bool Equals(object checkResult)\n        {\n            return Equals(checkResult as CheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Host + \"_\" + Warning + \"_\" + Error + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CheckResult_LinkedView : IEquatable<CheckResult_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public HostSystem Host { get; set; }\n\n        public bool Equals(CheckResult_LinkedView checkResult_LinkedView)\n        {\n            return (checkResult_LinkedView != null && ((this.Vm == null && checkResult_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(checkResult_LinkedView.Vm))) && ((this.Host == null && checkResult_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(checkResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object checkResult_LinkedView)\n        {\n            return Equals(checkResult_LinkedView as CheckResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class ChoiceOption : OptionType, IEquatable<ChoiceOption>\n    {\n        public ElementDescription[] ChoiceInfo { get; set; }\n\n        public int? DefaultIndex { get; set; }\n\n        public bool Equals(ChoiceOption choiceOption)\n        {\n            return (choiceOption != null && ((this.ChoiceInfo == null && choiceOption.ChoiceInfo == null) || (this.ChoiceInfo != null && choiceOption.ChoiceInfo != null && Enumerable.SequenceEqual(this.ChoiceInfo, choiceOption.ChoiceInfo))) && ((this.DefaultIndex == null && choiceOption.DefaultIndex == null) || (this.DefaultIndex != null && this.DefaultIndex.Equals(choiceOption.DefaultIndex))));\n        }\n\n        public override bool Equals(object choiceOption)\n        {\n            return Equals(choiceOption as ChoiceOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChoiceInfo + \"_\" + DefaultIndex).GetHashCode();\n        }\n    }\n\n    public class ClockSkew : HostConfigFault, IEquatable<ClockSkew>\n    {\n        public bool Equals(ClockSkew clockSkew)\n        {\n            return (clockSkew != null && base.Equals(clockSkew));\n        }\n\n        public override bool Equals(object clockSkew)\n        {\n            return Equals(clockSkew as ClockSkew);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CloneFromSnapshotNotSupported : MigrationFault, IEquatable<CloneFromSnapshotNotSupported>\n    {\n        public bool Equals(CloneFromSnapshotNotSupported cloneFromSnapshotNotSupported)\n        {\n            return (cloneFromSnapshotNotSupported != null && base.Equals(cloneFromSnapshotNotSupported));\n        }\n\n        public override bool Equals(object cloneFromSnapshotNotSupported)\n        {\n            return Equals(cloneFromSnapshotNotSupported as CloneFromSnapshotNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterAction : DynamicData, IEquatable<ClusterAction>\n    {\n        public string Type { get; set; }\n\n        public ManagedObjectReference Target { get; set; }\n\n        public bool Equals(ClusterAction clusterAction)\n        {\n            return (clusterAction != null && this.Type == clusterAction.Type && ((this.Target == null && clusterAction.Target == null) || (this.Target != null && this.Target.Equals(clusterAction.Target))));\n        }\n\n        public override bool Equals(object clusterAction)\n        {\n            return Equals(clusterAction as ClusterAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Target).GetHashCode();\n        }\n    }\n\n    public class ClusterActionHistory : DynamicData, IEquatable<ClusterActionHistory>\n    {\n        public ClusterAction Action { get; set; }\n\n        public DateTime Time { get; set; }\n\n        public bool Equals(ClusterActionHistory clusterActionHistory)\n        {\n            return (clusterActionHistory != null && ((this.Action == null && clusterActionHistory.Action == null) || (this.Action != null && this.Action.Equals(clusterActionHistory.Action))) && this.Time == clusterActionHistory.Time);\n        }\n\n        public override bool Equals(object clusterActionHistory)\n        {\n            return Equals(clusterActionHistory as ClusterActionHistory);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Action + \"_\" + Time).GetHashCode();\n        }\n    }\n\n    public class ClusterAffinityRuleSpec : ClusterRuleInfo, IEquatable<ClusterAffinityRuleSpec>\n    {\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ClusterAffinityRuleSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterAffinityRuleSpec clusterAffinityRuleSpec)\n        {\n            return (clusterAffinityRuleSpec != null && ((this.Vm == null && clusterAffinityRuleSpec.Vm == null) || (this.Vm != null && clusterAffinityRuleSpec.Vm != null && Enumerable.SequenceEqual(this.Vm, clusterAffinityRuleSpec.Vm))) && ((this.LinkedView == null && clusterAffinityRuleSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterAffinityRuleSpec.LinkedView))));\n        }\n\n        public override bool Equals(object clusterAffinityRuleSpec)\n        {\n            return Equals(clusterAffinityRuleSpec as ClusterAffinityRuleSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterAffinityRuleSpec_LinkedView : IEquatable<ClusterAffinityRuleSpec_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(ClusterAffinityRuleSpec_LinkedView clusterAffinityRuleSpec_LinkedView)\n        {\n            return (clusterAffinityRuleSpec_LinkedView != null && ((this.Vm == null && clusterAffinityRuleSpec_LinkedView.Vm == null) || (this.Vm != null && clusterAffinityRuleSpec_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, clusterAffinityRuleSpec_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterAffinityRuleSpec_LinkedView)\n        {\n            return Equals(clusterAffinityRuleSpec_LinkedView as ClusterAffinityRuleSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterAntiAffinityRuleSpec : ClusterRuleInfo, IEquatable<ClusterAntiAffinityRuleSpec>\n    {\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ClusterAntiAffinityRuleSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterAntiAffinityRuleSpec clusterAntiAffinityRuleSpec)\n        {\n            return (clusterAntiAffinityRuleSpec != null && ((this.Vm == null && clusterAntiAffinityRuleSpec.Vm == null) || (this.Vm != null && clusterAntiAffinityRuleSpec.Vm != null && Enumerable.SequenceEqual(this.Vm, clusterAntiAffinityRuleSpec.Vm))) && ((this.LinkedView == null && clusterAntiAffinityRuleSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterAntiAffinityRuleSpec.LinkedView))));\n        }\n\n        public override bool Equals(object clusterAntiAffinityRuleSpec)\n        {\n            return Equals(clusterAntiAffinityRuleSpec as ClusterAntiAffinityRuleSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterAntiAffinityRuleSpec_LinkedView : IEquatable<ClusterAntiAffinityRuleSpec_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(ClusterAntiAffinityRuleSpec_LinkedView clusterAntiAffinityRuleSpec_LinkedView)\n        {\n            return (clusterAntiAffinityRuleSpec_LinkedView != null && ((this.Vm == null && clusterAntiAffinityRuleSpec_LinkedView.Vm == null) || (this.Vm != null && clusterAntiAffinityRuleSpec_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, clusterAntiAffinityRuleSpec_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterAntiAffinityRuleSpec_LinkedView)\n        {\n            return Equals(clusterAntiAffinityRuleSpec_LinkedView as ClusterAntiAffinityRuleSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterAttemptedVmInfo : DynamicData, IEquatable<ClusterAttemptedVmInfo>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public ManagedObjectReference Task { get; set; }\n\n        public ClusterAttemptedVmInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterAttemptedVmInfo clusterAttemptedVmInfo)\n        {\n            return (clusterAttemptedVmInfo != null && ((this.Vm == null && clusterAttemptedVmInfo.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterAttemptedVmInfo.Vm))) && ((this.Task == null && clusterAttemptedVmInfo.Task == null) || (this.Task != null && this.Task.Equals(clusterAttemptedVmInfo.Task))) && ((this.LinkedView == null && clusterAttemptedVmInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterAttemptedVmInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterAttemptedVmInfo)\n        {\n            return Equals(clusterAttemptedVmInfo as ClusterAttemptedVmInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Task + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterAttemptedVmInfo_LinkedView : IEquatable<ClusterAttemptedVmInfo_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public Task Task { get; set; }\n\n        public bool Equals(ClusterAttemptedVmInfo_LinkedView clusterAttemptedVmInfo_LinkedView)\n        {\n            return (clusterAttemptedVmInfo_LinkedView != null && ((this.Vm == null && clusterAttemptedVmInfo_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterAttemptedVmInfo_LinkedView.Vm))) && ((this.Task == null && clusterAttemptedVmInfo_LinkedView.Task == null) || (this.Task != null && this.Task.Equals(clusterAttemptedVmInfo_LinkedView.Task))));\n        }\n\n        public override bool Equals(object clusterAttemptedVmInfo_LinkedView)\n        {\n            return Equals(clusterAttemptedVmInfo_LinkedView as ClusterAttemptedVmInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Task).GetHashCode();\n        }\n    }\n\n    public class ClusterComplianceCheckedEvent : ClusterEvent, IEquatable<ClusterComplianceCheckedEvent>\n    {\n        public ProfileEventArgument Profile { get; set; }\n\n        public bool Equals(ClusterComplianceCheckedEvent clusterComplianceCheckedEvent)\n        {\n            return (clusterComplianceCheckedEvent != null && ((this.Profile == null && clusterComplianceCheckedEvent.Profile == null) || (this.Profile != null && this.Profile.Equals(clusterComplianceCheckedEvent.Profile))));\n        }\n\n        public override bool Equals(object clusterComplianceCheckedEvent)\n        {\n            return Equals(clusterComplianceCheckedEvent as ClusterComplianceCheckedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResource : ComputeResource, IEquatable<ClusterComputeResource>\n    {\n        public ClusterConfigInfo Configuration { get; set; }\n\n        public ClusterRecommendation[] Recommendation { get; set; }\n\n        public ClusterDrsRecommendation[] DrsRecommendation { get; set; }\n\n        public ClusterComputeResourceHCIConfigInfo HciConfig { get; set; }\n\n        public ClusterDrsMigration[] MigrationHistory { get; set; }\n\n        public ClusterActionHistory[] ActionHistory { get; set; }\n\n        public ClusterDrsFaults[] DrsFault { get; set; }\n\n        public new ClusterComputeResource_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference ConfigureHCI_Task(ClusterComputeResourceHCIConfigSpec clusterSpec, ClusterComputeResourceHostConfigurationInput[] hostInputs)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterComputeResourceClusterConfigResult ConfigureHCI(ClusterComputeResourceHCIConfigSpec clusterSpec, ClusterComputeResourceHostConfigurationInput[] hostInputs)\n        {\n            return default(ClusterComputeResourceClusterConfigResult);\n        }\n\n        public ManagedObjectReference ExtendHCI_Task(ClusterComputeResourceHostConfigurationInput[] hostInputs, SDDCBase vSanConfigSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterComputeResourceClusterConfigResult ExtendHCI(ClusterComputeResourceHostConfigurationInput[] hostInputs, SDDCBase vSanConfigSpec)\n        {\n            return default(ClusterComputeResourceClusterConfigResult);\n        }\n\n        public void AbandonHciWorkflow()\n        {\n        }\n\n        public ClusterComputeResourceValidationResultBase[] ValidateHCIConfiguration(ClusterComputeResourceHCIConfigSpec hciConfigSpec, ManagedObjectReference[] hosts)\n        {\n            return default(ClusterComputeResourceValidationResultBase[]);\n        }\n\n        public ManagedObjectReference ReconfigureCluster_Task(ClusterConfigSpec spec, bool modify)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureCluster(ClusterConfigSpec spec, bool modify)\n        {\n        }\n\n        public void ApplyRecommendation(string key)\n        {\n        }\n\n        public void CancelRecommendation(string key)\n        {\n        }\n\n        public ClusterHostRecommendation[] RecommendHostsForVm(ManagedObjectReference vm, ManagedObjectReference pool)\n        {\n            return default(ClusterHostRecommendation[]);\n        }\n\n        public ManagedObjectReference AddHost_Task(HostConnectSpec spec, bool asConnected, ManagedObjectReference resourcePool, string license)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference AddHost(HostConnectSpec spec, bool asConnected, ManagedObjectReference resourcePool, string license)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference MoveInto_Task(ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MoveInto(ManagedObjectReference[] host)\n        {\n        }\n\n        public ManagedObjectReference MoveHostInto_Task(ManagedObjectReference host, ManagedObjectReference resourcePool)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MoveHostInto(ManagedObjectReference host, ManagedObjectReference resourcePool)\n        {\n        }\n\n        public void RefreshRecommendation()\n        {\n        }\n\n        public ManagedObjectReference EvcManager()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterDasAdvancedRuntimeInfo RetrieveDasAdvancedRuntimeInfo()\n        {\n            return default(ClusterDasAdvancedRuntimeInfo);\n        }\n\n        public ClusterEnterMaintenanceResult ClusterEnterMaintenanceMode(ManagedObjectReference[] host, OptionValue[] option)\n        {\n            return default(ClusterEnterMaintenanceResult);\n        }\n\n        public PlacementResult PlaceVm(PlacementSpec placementSpec)\n        {\n            return default(PlacementResult);\n        }\n\n        public ClusterRuleInfo[] FindRulesForVm(ManagedObjectReference vm)\n        {\n            return default(ClusterRuleInfo[]);\n        }\n\n        public ManagedObjectReference StampAllRulesWithUuid_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void StampAllRulesWithUuid()\n        {\n        }\n\n        public ClusterResourceUsageSummary GetResourceUsage()\n        {\n            return default(ClusterResourceUsageSummary);\n        }\n\n        public bool Equals(ClusterComputeResource clusterComputeResource)\n        {\n            return (clusterComputeResource != null && ((this.Configuration == null && clusterComputeResource.Configuration == null) || (this.Configuration != null && this.Configuration.Equals(clusterComputeResource.Configuration))) && ((this.Recommendation == null && clusterComputeResource.Recommendation == null) || (this.Recommendation != null && clusterComputeResource.Recommendation != null && Enumerable.SequenceEqual(this.Recommendation, clusterComputeResource.Recommendation))) && ((this.DrsRecommendation == null && clusterComputeResource.DrsRecommendation == null) || (this.DrsRecommendation != null && clusterComputeResource.DrsRecommendation != null && Enumerable.SequenceEqual(this.DrsRecommendation, clusterComputeResource.DrsRecommendation))) && ((this.HciConfig == null && clusterComputeResource.HciConfig == null) || (this.HciConfig != null && this.HciConfig.Equals(clusterComputeResource.HciConfig))) && ((this.MigrationHistory == null && clusterComputeResource.MigrationHistory == null) || (this.MigrationHistory != null && clusterComputeResource.MigrationHistory != null && Enumerable.SequenceEqual(this.MigrationHistory, clusterComputeResource.MigrationHistory))) && ((this.ActionHistory == null && clusterComputeResource.ActionHistory == null) || (this.ActionHistory != null && clusterComputeResource.ActionHistory != null && Enumerable.SequenceEqual(this.ActionHistory, clusterComputeResource.ActionHistory))) && ((this.DrsFault == null && clusterComputeResource.DrsFault == null) || (this.DrsFault != null && clusterComputeResource.DrsFault != null && Enumerable.SequenceEqual(this.DrsFault, clusterComputeResource.DrsFault))) && ((this.LinkedView == null && clusterComputeResource.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResource.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResource)\n        {\n            return Equals(clusterComputeResource as ClusterComputeResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Configuration + \"_\" + Recommendation + \"_\" + DrsRecommendation + \"_\" + HciConfig + \"_\" + MigrationHistory + \"_\" + ActionHistory + \"_\" + DrsFault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResource_LinkedView : ComputeResource_LinkedView, IEquatable<ClusterComputeResource_LinkedView>\n    {\n        public bool Equals(ClusterComputeResource_LinkedView clusterComputeResource_LinkedView)\n        {\n            return (clusterComputeResource_LinkedView != null && base.Equals(clusterComputeResource_LinkedView));\n        }\n\n        public override bool Equals(object clusterComputeResource_LinkedView)\n        {\n            return Equals(clusterComputeResource_LinkedView as ClusterComputeResource_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceClusterConfigResult : DynamicData, IEquatable<ClusterComputeResourceClusterConfigResult>\n    {\n        public FolderFailedHostResult[] FailedHosts { get; set; }\n\n        public ManagedObjectReference[] ConfiguredHosts { get; set; }\n\n        public ClusterComputeResourceClusterConfigResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceClusterConfigResult clusterComputeResourceClusterConfigResult)\n        {\n            return (clusterComputeResourceClusterConfigResult != null && ((this.FailedHosts == null && clusterComputeResourceClusterConfigResult.FailedHosts == null) || (this.FailedHosts != null && clusterComputeResourceClusterConfigResult.FailedHosts != null && Enumerable.SequenceEqual(this.FailedHosts, clusterComputeResourceClusterConfigResult.FailedHosts))) && ((this.ConfiguredHosts == null && clusterComputeResourceClusterConfigResult.ConfiguredHosts == null) || (this.ConfiguredHosts != null && clusterComputeResourceClusterConfigResult.ConfiguredHosts != null && Enumerable.SequenceEqual(this.ConfiguredHosts, clusterComputeResourceClusterConfigResult.ConfiguredHosts))) && ((this.LinkedView == null && clusterComputeResourceClusterConfigResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceClusterConfigResult.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceClusterConfigResult)\n        {\n            return Equals(clusterComputeResourceClusterConfigResult as ClusterComputeResourceClusterConfigResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailedHosts + \"_\" + ConfiguredHosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceClusterConfigResult_LinkedView : IEquatable<ClusterComputeResourceClusterConfigResult_LinkedView>\n    {\n        public HostSystem[] ConfiguredHosts { get; set; }\n\n        public bool Equals(ClusterComputeResourceClusterConfigResult_LinkedView clusterComputeResourceClusterConfigResult_LinkedView)\n        {\n            return (clusterComputeResourceClusterConfigResult_LinkedView != null && ((this.ConfiguredHosts == null && clusterComputeResourceClusterConfigResult_LinkedView.ConfiguredHosts == null) || (this.ConfiguredHosts != null && clusterComputeResourceClusterConfigResult_LinkedView.ConfiguredHosts != null && Enumerable.SequenceEqual(this.ConfiguredHosts, clusterComputeResourceClusterConfigResult_LinkedView.ConfiguredHosts))));\n        }\n\n        public override bool Equals(object clusterComputeResourceClusterConfigResult_LinkedView)\n        {\n            return Equals(clusterComputeResourceClusterConfigResult_LinkedView as ClusterComputeResourceClusterConfigResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfiguredHosts).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDVSConfigurationValidation : ClusterComputeResourceValidationResultBase, IEquatable<ClusterComputeResourceDVSConfigurationValidation>\n    {\n        public bool IsDvsValid { get; set; }\n\n        public bool IsDvpgValid { get; set; }\n\n        public bool Equals(ClusterComputeResourceDVSConfigurationValidation clusterComputeResourceDVSConfigurationValidation)\n        {\n            return (clusterComputeResourceDVSConfigurationValidation != null && this.IsDvsValid == clusterComputeResourceDVSConfigurationValidation.IsDvsValid && this.IsDvpgValid == clusterComputeResourceDVSConfigurationValidation.IsDvpgValid);\n        }\n\n        public override bool Equals(object clusterComputeResourceDVSConfigurationValidation)\n        {\n            return Equals(clusterComputeResourceDVSConfigurationValidation as ClusterComputeResourceDVSConfigurationValidation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsDvsValid + \"_\" + IsDvpgValid).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDvsProfile : DynamicData, IEquatable<ClusterComputeResourceDvsProfile>\n    {\n        public string DvsName { get; set; }\n\n        public ManagedObjectReference DvSwitch { get; set; }\n\n        public string[] PnicDevices { get; set; }\n\n        public ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping[] DvPortgroupMapping { get; set; }\n\n        public ClusterComputeResourceDvsProfile_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceDvsProfile clusterComputeResourceDvsProfile)\n        {\n            return (clusterComputeResourceDvsProfile != null && this.DvsName == clusterComputeResourceDvsProfile.DvsName && ((this.DvSwitch == null && clusterComputeResourceDvsProfile.DvSwitch == null) || (this.DvSwitch != null && this.DvSwitch.Equals(clusterComputeResourceDvsProfile.DvSwitch))) && ((this.PnicDevices == null && clusterComputeResourceDvsProfile.PnicDevices == null) || (this.PnicDevices != null && clusterComputeResourceDvsProfile.PnicDevices != null && Enumerable.SequenceEqual(this.PnicDevices, clusterComputeResourceDvsProfile.PnicDevices))) && ((this.DvPortgroupMapping == null && clusterComputeResourceDvsProfile.DvPortgroupMapping == null) || (this.DvPortgroupMapping != null && clusterComputeResourceDvsProfile.DvPortgroupMapping != null && Enumerable.SequenceEqual(this.DvPortgroupMapping, clusterComputeResourceDvsProfile.DvPortgroupMapping))) && ((this.LinkedView == null && clusterComputeResourceDvsProfile.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceDvsProfile.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDvsProfile)\n        {\n            return Equals(clusterComputeResourceDvsProfile as ClusterComputeResourceDvsProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsName + \"_\" + DvSwitch + \"_\" + PnicDevices + \"_\" + DvPortgroupMapping + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDvsProfile_LinkedView : IEquatable<ClusterComputeResourceDvsProfile_LinkedView>\n    {\n        public DistributedVirtualSwitch DvSwitch { get; set; }\n\n        public bool Equals(ClusterComputeResourceDvsProfile_LinkedView clusterComputeResourceDvsProfile_LinkedView)\n        {\n            return (clusterComputeResourceDvsProfile_LinkedView != null && ((this.DvSwitch == null && clusterComputeResourceDvsProfile_LinkedView.DvSwitch == null) || (this.DvSwitch != null && this.DvSwitch.Equals(clusterComputeResourceDvsProfile_LinkedView.DvSwitch))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDvsProfile_LinkedView)\n        {\n            return Equals(clusterComputeResourceDvsProfile_LinkedView as ClusterComputeResourceDvsProfile_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvSwitch).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping : DynamicData, IEquatable<ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping>\n    {\n        public DVPortgroupConfigSpec DvPortgroupSpec { get; set; }\n\n        public ManagedObjectReference DvPortgroup { get; set; }\n\n        public string Service { get; set; }\n\n        public ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping)\n        {\n            return (clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping != null && ((this.DvPortgroupSpec == null && clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.DvPortgroupSpec == null) || (this.DvPortgroupSpec != null && this.DvPortgroupSpec.Equals(clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.DvPortgroupSpec))) && ((this.DvPortgroup == null && clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.DvPortgroup == null) || (this.DvPortgroup != null && this.DvPortgroup.Equals(clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.DvPortgroup))) && this.Service == clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.Service && ((this.LinkedView == null && clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping)\n        {\n            return Equals(clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping as ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvPortgroupSpec + \"_\" + DvPortgroup + \"_\" + Service + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView : IEquatable<ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView>\n    {\n        public DistributedVirtualPortgroup DvPortgroup { get; set; }\n\n        public bool Equals(ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView)\n        {\n            return (clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView != null && ((this.DvPortgroup == null && clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView.DvPortgroup == null) || (this.DvPortgroup != null && this.DvPortgroup.Equals(clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView.DvPortgroup))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView)\n        {\n            return Equals(clusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView as ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvPortgroup).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDVSSetting : DynamicData, IEquatable<ClusterComputeResourceDVSSetting>\n    {\n        public ManagedObjectReference DvSwitch { get; set; }\n\n        public string[] PnicDevices { get; set; }\n\n        public ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping[] DvPortgroupSetting { get; set; }\n\n        public ClusterComputeResourceDVSSetting_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceDVSSetting clusterComputeResourceDVSSetting)\n        {\n            return (clusterComputeResourceDVSSetting != null && ((this.DvSwitch == null && clusterComputeResourceDVSSetting.DvSwitch == null) || (this.DvSwitch != null && this.DvSwitch.Equals(clusterComputeResourceDVSSetting.DvSwitch))) && ((this.PnicDevices == null && clusterComputeResourceDVSSetting.PnicDevices == null) || (this.PnicDevices != null && clusterComputeResourceDVSSetting.PnicDevices != null && Enumerable.SequenceEqual(this.PnicDevices, clusterComputeResourceDVSSetting.PnicDevices))) && ((this.DvPortgroupSetting == null && clusterComputeResourceDVSSetting.DvPortgroupSetting == null) || (this.DvPortgroupSetting != null && clusterComputeResourceDVSSetting.DvPortgroupSetting != null && Enumerable.SequenceEqual(this.DvPortgroupSetting, clusterComputeResourceDVSSetting.DvPortgroupSetting))) && ((this.LinkedView == null && clusterComputeResourceDVSSetting.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceDVSSetting.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDVSSetting)\n        {\n            return Equals(clusterComputeResourceDVSSetting as ClusterComputeResourceDVSSetting);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvSwitch + \"_\" + PnicDevices + \"_\" + DvPortgroupSetting + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDVSSetting_LinkedView : IEquatable<ClusterComputeResourceDVSSetting_LinkedView>\n    {\n        public DistributedVirtualSwitch DvSwitch { get; set; }\n\n        public bool Equals(ClusterComputeResourceDVSSetting_LinkedView clusterComputeResourceDVSSetting_LinkedView)\n        {\n            return (clusterComputeResourceDVSSetting_LinkedView != null && ((this.DvSwitch == null && clusterComputeResourceDVSSetting_LinkedView.DvSwitch == null) || (this.DvSwitch != null && this.DvSwitch.Equals(clusterComputeResourceDVSSetting_LinkedView.DvSwitch))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDVSSetting_LinkedView)\n        {\n            return Equals(clusterComputeResourceDVSSetting_LinkedView as ClusterComputeResourceDVSSetting_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvSwitch).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping : DynamicData, IEquatable<ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping>\n    {\n        public ManagedObjectReference DvPortgroup { get; set; }\n\n        public string Service { get; set; }\n\n        public ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping clusterComputeResourceDVSSettingDVPortgroupToServiceMapping)\n        {\n            return (clusterComputeResourceDVSSettingDVPortgroupToServiceMapping != null && ((this.DvPortgroup == null && clusterComputeResourceDVSSettingDVPortgroupToServiceMapping.DvPortgroup == null) || (this.DvPortgroup != null && this.DvPortgroup.Equals(clusterComputeResourceDVSSettingDVPortgroupToServiceMapping.DvPortgroup))) && this.Service == clusterComputeResourceDVSSettingDVPortgroupToServiceMapping.Service && ((this.LinkedView == null && clusterComputeResourceDVSSettingDVPortgroupToServiceMapping.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceDVSSettingDVPortgroupToServiceMapping.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDVSSettingDVPortgroupToServiceMapping)\n        {\n            return Equals(clusterComputeResourceDVSSettingDVPortgroupToServiceMapping as ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvPortgroup + \"_\" + Service + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView : IEquatable<ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView>\n    {\n        public DistributedVirtualPortgroup DvPortgroup { get; set; }\n\n        public bool Equals(ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView clusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView)\n        {\n            return (clusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView != null && ((this.DvPortgroup == null && clusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView.DvPortgroup == null) || (this.DvPortgroup != null && this.DvPortgroup.Equals(clusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView.DvPortgroup))));\n        }\n\n        public override bool Equals(object clusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView)\n        {\n            return Equals(clusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView as ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvPortgroup).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHCIConfigInfo : DynamicData, IEquatable<ClusterComputeResourceHCIConfigInfo>\n    {\n        public string WorkflowState { get; set; }\n\n        public ClusterComputeResourceDVSSetting[] DvsSetting { get; set; }\n\n        public ManagedObjectReference[] ConfiguredHosts { get; set; }\n\n        public ClusterComputeResourceHostConfigurationProfile HostConfigProfile { get; set; }\n\n        public ClusterComputeResourceHCIConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceHCIConfigInfo clusterComputeResourceHCIConfigInfo)\n        {\n            return (clusterComputeResourceHCIConfigInfo != null && this.WorkflowState == clusterComputeResourceHCIConfigInfo.WorkflowState && ((this.DvsSetting == null && clusterComputeResourceHCIConfigInfo.DvsSetting == null) || (this.DvsSetting != null && clusterComputeResourceHCIConfigInfo.DvsSetting != null && Enumerable.SequenceEqual(this.DvsSetting, clusterComputeResourceHCIConfigInfo.DvsSetting))) && ((this.ConfiguredHosts == null && clusterComputeResourceHCIConfigInfo.ConfiguredHosts == null) || (this.ConfiguredHosts != null && clusterComputeResourceHCIConfigInfo.ConfiguredHosts != null && Enumerable.SequenceEqual(this.ConfiguredHosts, clusterComputeResourceHCIConfigInfo.ConfiguredHosts))) && ((this.HostConfigProfile == null && clusterComputeResourceHCIConfigInfo.HostConfigProfile == null) || (this.HostConfigProfile != null && this.HostConfigProfile.Equals(clusterComputeResourceHCIConfigInfo.HostConfigProfile))) && ((this.LinkedView == null && clusterComputeResourceHCIConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceHCIConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHCIConfigInfo)\n        {\n            return Equals(clusterComputeResourceHCIConfigInfo as ClusterComputeResourceHCIConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (WorkflowState + \"_\" + DvsSetting + \"_\" + ConfiguredHosts + \"_\" + HostConfigProfile + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHCIConfigInfo_LinkedView : IEquatable<ClusterComputeResourceHCIConfigInfo_LinkedView>\n    {\n        public HostSystem[] ConfiguredHosts { get; set; }\n\n        public bool Equals(ClusterComputeResourceHCIConfigInfo_LinkedView clusterComputeResourceHCIConfigInfo_LinkedView)\n        {\n            return (clusterComputeResourceHCIConfigInfo_LinkedView != null && ((this.ConfiguredHosts == null && clusterComputeResourceHCIConfigInfo_LinkedView.ConfiguredHosts == null) || (this.ConfiguredHosts != null && clusterComputeResourceHCIConfigInfo_LinkedView.ConfiguredHosts != null && Enumerable.SequenceEqual(this.ConfiguredHosts, clusterComputeResourceHCIConfigInfo_LinkedView.ConfiguredHosts))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHCIConfigInfo_LinkedView)\n        {\n            return Equals(clusterComputeResourceHCIConfigInfo_LinkedView as ClusterComputeResourceHCIConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfiguredHosts).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHCIConfigSpec : DynamicData, IEquatable<ClusterComputeResourceHCIConfigSpec>\n    {\n        public ClusterComputeResourceDvsProfile[] DvsProf { get; set; }\n\n        public ClusterComputeResourceHostConfigurationProfile HostConfigProfile { get; set; }\n\n        public SDDCBase VSanConfigSpec { get; set; }\n\n        public ClusterComputeResourceVCProfile VcProf { get; set; }\n\n        public bool Equals(ClusterComputeResourceHCIConfigSpec clusterComputeResourceHCIConfigSpec)\n        {\n            return (clusterComputeResourceHCIConfigSpec != null && ((this.DvsProf == null && clusterComputeResourceHCIConfigSpec.DvsProf == null) || (this.DvsProf != null && clusterComputeResourceHCIConfigSpec.DvsProf != null && Enumerable.SequenceEqual(this.DvsProf, clusterComputeResourceHCIConfigSpec.DvsProf))) && ((this.HostConfigProfile == null && clusterComputeResourceHCIConfigSpec.HostConfigProfile == null) || (this.HostConfigProfile != null && this.HostConfigProfile.Equals(clusterComputeResourceHCIConfigSpec.HostConfigProfile))) && ((this.VSanConfigSpec == null && clusterComputeResourceHCIConfigSpec.VSanConfigSpec == null) || (this.VSanConfigSpec != null && this.VSanConfigSpec.Equals(clusterComputeResourceHCIConfigSpec.VSanConfigSpec))) && ((this.VcProf == null && clusterComputeResourceHCIConfigSpec.VcProf == null) || (this.VcProf != null && this.VcProf.Equals(clusterComputeResourceHCIConfigSpec.VcProf))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHCIConfigSpec)\n        {\n            return Equals(clusterComputeResourceHCIConfigSpec as ClusterComputeResourceHCIConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsProf + \"_\" + HostConfigProfile + \"_\" + VSanConfigSpec + \"_\" + VcProf).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHostConfigurationInput : DynamicData, IEquatable<ClusterComputeResourceHostConfigurationInput>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public ClusterComputeResourceHostVmkNicInfo[] HostVmkNics { get; set; }\n\n        public bool? AllowedInNonMaintenanceMode { get; set; }\n\n        public ClusterComputeResourceHostConfigurationInput_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceHostConfigurationInput clusterComputeResourceHostConfigurationInput)\n        {\n            return (clusterComputeResourceHostConfigurationInput != null && ((this.Host == null && clusterComputeResourceHostConfigurationInput.Host == null) || (this.Host != null && this.Host.Equals(clusterComputeResourceHostConfigurationInput.Host))) && ((this.HostVmkNics == null && clusterComputeResourceHostConfigurationInput.HostVmkNics == null) || (this.HostVmkNics != null && clusterComputeResourceHostConfigurationInput.HostVmkNics != null && Enumerable.SequenceEqual(this.HostVmkNics, clusterComputeResourceHostConfigurationInput.HostVmkNics))) && ((this.AllowedInNonMaintenanceMode == null && clusterComputeResourceHostConfigurationInput.AllowedInNonMaintenanceMode == null) || (this.AllowedInNonMaintenanceMode != null && this.AllowedInNonMaintenanceMode.Equals(clusterComputeResourceHostConfigurationInput.AllowedInNonMaintenanceMode))) && ((this.LinkedView == null && clusterComputeResourceHostConfigurationInput.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceHostConfigurationInput.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHostConfigurationInput)\n        {\n            return Equals(clusterComputeResourceHostConfigurationInput as ClusterComputeResourceHostConfigurationInput);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostVmkNics + \"_\" + AllowedInNonMaintenanceMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHostConfigurationInput_LinkedView : IEquatable<ClusterComputeResourceHostConfigurationInput_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterComputeResourceHostConfigurationInput_LinkedView clusterComputeResourceHostConfigurationInput_LinkedView)\n        {\n            return (clusterComputeResourceHostConfigurationInput_LinkedView != null && ((this.Host == null && clusterComputeResourceHostConfigurationInput_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterComputeResourceHostConfigurationInput_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHostConfigurationInput_LinkedView)\n        {\n            return Equals(clusterComputeResourceHostConfigurationInput_LinkedView as ClusterComputeResourceHostConfigurationInput_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHostConfigurationProfile : DynamicData, IEquatable<ClusterComputeResourceHostConfigurationProfile>\n    {\n        public HostDateTimeConfig DateTimeConfig { get; set; }\n\n        public HostLockdownMode? LockdownMode { get; set; }\n\n        public bool Equals(ClusterComputeResourceHostConfigurationProfile clusterComputeResourceHostConfigurationProfile)\n        {\n            return (clusterComputeResourceHostConfigurationProfile != null && ((this.DateTimeConfig == null && clusterComputeResourceHostConfigurationProfile.DateTimeConfig == null) || (this.DateTimeConfig != null && this.DateTimeConfig.Equals(clusterComputeResourceHostConfigurationProfile.DateTimeConfig))) && ((this.LockdownMode == null && clusterComputeResourceHostConfigurationProfile.LockdownMode == null) || (this.LockdownMode != null && this.LockdownMode.Equals(clusterComputeResourceHostConfigurationProfile.LockdownMode))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHostConfigurationProfile)\n        {\n            return Equals(clusterComputeResourceHostConfigurationProfile as ClusterComputeResourceHostConfigurationProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DateTimeConfig + \"_\" + LockdownMode).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHostConfigurationValidation : ClusterComputeResourceValidationResultBase, IEquatable<ClusterComputeResourceHostConfigurationValidation>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public bool? IsDvsSettingValid { get; set; }\n\n        public bool? IsVmknicSettingValid { get; set; }\n\n        public bool? IsNtpSettingValid { get; set; }\n\n        public bool? IsLockdownModeValid { get; set; }\n\n        public ClusterComputeResourceHostConfigurationValidation_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterComputeResourceHostConfigurationValidation clusterComputeResourceHostConfigurationValidation)\n        {\n            return (clusterComputeResourceHostConfigurationValidation != null && ((this.Host == null && clusterComputeResourceHostConfigurationValidation.Host == null) || (this.Host != null && this.Host.Equals(clusterComputeResourceHostConfigurationValidation.Host))) && ((this.IsDvsSettingValid == null && clusterComputeResourceHostConfigurationValidation.IsDvsSettingValid == null) || (this.IsDvsSettingValid != null && this.IsDvsSettingValid.Equals(clusterComputeResourceHostConfigurationValidation.IsDvsSettingValid))) && ((this.IsVmknicSettingValid == null && clusterComputeResourceHostConfigurationValidation.IsVmknicSettingValid == null) || (this.IsVmknicSettingValid != null && this.IsVmknicSettingValid.Equals(clusterComputeResourceHostConfigurationValidation.IsVmknicSettingValid))) && ((this.IsNtpSettingValid == null && clusterComputeResourceHostConfigurationValidation.IsNtpSettingValid == null) || (this.IsNtpSettingValid != null && this.IsNtpSettingValid.Equals(clusterComputeResourceHostConfigurationValidation.IsNtpSettingValid))) && ((this.IsLockdownModeValid == null && clusterComputeResourceHostConfigurationValidation.IsLockdownModeValid == null) || (this.IsLockdownModeValid != null && this.IsLockdownModeValid.Equals(clusterComputeResourceHostConfigurationValidation.IsLockdownModeValid))) && ((this.LinkedView == null && clusterComputeResourceHostConfigurationValidation.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterComputeResourceHostConfigurationValidation.LinkedView))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHostConfigurationValidation)\n        {\n            return Equals(clusterComputeResourceHostConfigurationValidation as ClusterComputeResourceHostConfigurationValidation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + IsDvsSettingValid + \"_\" + IsVmknicSettingValid + \"_\" + IsNtpSettingValid + \"_\" + IsLockdownModeValid + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHostConfigurationValidation_LinkedView : IEquatable<ClusterComputeResourceHostConfigurationValidation_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterComputeResourceHostConfigurationValidation_LinkedView clusterComputeResourceHostConfigurationValidation_LinkedView)\n        {\n            return (clusterComputeResourceHostConfigurationValidation_LinkedView != null && ((this.Host == null && clusterComputeResourceHostConfigurationValidation_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterComputeResourceHostConfigurationValidation_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterComputeResourceHostConfigurationValidation_LinkedView)\n        {\n            return Equals(clusterComputeResourceHostConfigurationValidation_LinkedView as ClusterComputeResourceHostConfigurationValidation_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceHostVmkNicInfo : DynamicData, IEquatable<ClusterComputeResourceHostVmkNicInfo>\n    {\n        public HostVirtualNicSpec NicSpec { get; set; }\n\n        public string Service { get; set; }\n\n        public bool Equals(ClusterComputeResourceHostVmkNicInfo clusterComputeResourceHostVmkNicInfo)\n        {\n            return (clusterComputeResourceHostVmkNicInfo != null && ((this.NicSpec == null && clusterComputeResourceHostVmkNicInfo.NicSpec == null) || (this.NicSpec != null && this.NicSpec.Equals(clusterComputeResourceHostVmkNicInfo.NicSpec))) && this.Service == clusterComputeResourceHostVmkNicInfo.Service);\n        }\n\n        public override bool Equals(object clusterComputeResourceHostVmkNicInfo)\n        {\n            return Equals(clusterComputeResourceHostVmkNicInfo as ClusterComputeResourceHostVmkNicInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NicSpec + \"_\" + Service).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceSummary : ComputeResourceSummary, IEquatable<ClusterComputeResourceSummary>\n    {\n        public int CurrentFailoverLevel { get; set; }\n\n        public ClusterDasAdmissionControlInfo AdmissionControlInfo { get; set; }\n\n        public int NumVmotions { get; set; }\n\n        public int? TargetBalance { get; set; }\n\n        public int? CurrentBalance { get; set; }\n\n        public ClusterUsageSummary UsageSummary { get; set; }\n\n        public string CurrentEVCModeKey { get; set; }\n\n        public ClusterDasData DasData { get; set; }\n\n        public bool Equals(ClusterComputeResourceSummary clusterComputeResourceSummary)\n        {\n            return (clusterComputeResourceSummary != null && this.CurrentFailoverLevel == clusterComputeResourceSummary.CurrentFailoverLevel && ((this.AdmissionControlInfo == null && clusterComputeResourceSummary.AdmissionControlInfo == null) || (this.AdmissionControlInfo != null && this.AdmissionControlInfo.Equals(clusterComputeResourceSummary.AdmissionControlInfo))) && this.NumVmotions == clusterComputeResourceSummary.NumVmotions && ((this.TargetBalance == null && clusterComputeResourceSummary.TargetBalance == null) || (this.TargetBalance != null && this.TargetBalance.Equals(clusterComputeResourceSummary.TargetBalance))) && ((this.CurrentBalance == null && clusterComputeResourceSummary.CurrentBalance == null) || (this.CurrentBalance != null && this.CurrentBalance.Equals(clusterComputeResourceSummary.CurrentBalance))) && ((this.UsageSummary == null && clusterComputeResourceSummary.UsageSummary == null) || (this.UsageSummary != null && this.UsageSummary.Equals(clusterComputeResourceSummary.UsageSummary))) && this.CurrentEVCModeKey == clusterComputeResourceSummary.CurrentEVCModeKey && ((this.DasData == null && clusterComputeResourceSummary.DasData == null) || (this.DasData != null && this.DasData.Equals(clusterComputeResourceSummary.DasData))));\n        }\n\n        public override bool Equals(object clusterComputeResourceSummary)\n        {\n            return Equals(clusterComputeResourceSummary as ClusterComputeResourceSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentFailoverLevel + \"_\" + AdmissionControlInfo + \"_\" + NumVmotions + \"_\" + TargetBalance + \"_\" + CurrentBalance + \"_\" + UsageSummary + \"_\" + CurrentEVCModeKey + \"_\" + DasData).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceValidationResultBase : DynamicData, IEquatable<ClusterComputeResourceValidationResultBase>\n    {\n        public LocalizableMessage[] Info { get; set; }\n\n        public bool Equals(ClusterComputeResourceValidationResultBase clusterComputeResourceValidationResultBase)\n        {\n            return (clusterComputeResourceValidationResultBase != null && ((this.Info == null && clusterComputeResourceValidationResultBase.Info == null) || (this.Info != null && clusterComputeResourceValidationResultBase.Info != null && Enumerable.SequenceEqual(this.Info, clusterComputeResourceValidationResultBase.Info))));\n        }\n\n        public override bool Equals(object clusterComputeResourceValidationResultBase)\n        {\n            return Equals(clusterComputeResourceValidationResultBase as ClusterComputeResourceValidationResultBase);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterComputeResourceVCProfile : DynamicData, IEquatable<ClusterComputeResourceVCProfile>\n    {\n        public ClusterConfigSpecEx ClusterSpec { get; set; }\n\n        public string EvcModeKey { get; set; }\n\n        public bool Equals(ClusterComputeResourceVCProfile clusterComputeResourceVCProfile)\n        {\n            return (clusterComputeResourceVCProfile != null && ((this.ClusterSpec == null && clusterComputeResourceVCProfile.ClusterSpec == null) || (this.ClusterSpec != null && this.ClusterSpec.Equals(clusterComputeResourceVCProfile.ClusterSpec))) && this.EvcModeKey == clusterComputeResourceVCProfile.EvcModeKey);\n        }\n\n        public override bool Equals(object clusterComputeResourceVCProfile)\n        {\n            return Equals(clusterComputeResourceVCProfile as ClusterComputeResourceVCProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterSpec + \"_\" + EvcModeKey).GetHashCode();\n        }\n    }\n\n    public class ClusterConfigInfo : DynamicData, IEquatable<ClusterConfigInfo>\n    {\n        public ClusterDasConfigInfo DasConfig { get; set; }\n\n        public ClusterDasVmConfigInfo[] DasVmConfig { get; set; }\n\n        public ClusterDrsConfigInfo DrsConfig { get; set; }\n\n        public ClusterDrsVmConfigInfo[] DrsVmConfig { get; set; }\n\n        public ClusterRuleInfo[] Rule { get; set; }\n\n        public bool Equals(ClusterConfigInfo clusterConfigInfo)\n        {\n            return (clusterConfigInfo != null && ((this.DasConfig == null && clusterConfigInfo.DasConfig == null) || (this.DasConfig != null && this.DasConfig.Equals(clusterConfigInfo.DasConfig))) && ((this.DasVmConfig == null && clusterConfigInfo.DasVmConfig == null) || (this.DasVmConfig != null && clusterConfigInfo.DasVmConfig != null && Enumerable.SequenceEqual(this.DasVmConfig, clusterConfigInfo.DasVmConfig))) && ((this.DrsConfig == null && clusterConfigInfo.DrsConfig == null) || (this.DrsConfig != null && this.DrsConfig.Equals(clusterConfigInfo.DrsConfig))) && ((this.DrsVmConfig == null && clusterConfigInfo.DrsVmConfig == null) || (this.DrsVmConfig != null && clusterConfigInfo.DrsVmConfig != null && Enumerable.SequenceEqual(this.DrsVmConfig, clusterConfigInfo.DrsVmConfig))) && ((this.Rule == null && clusterConfigInfo.Rule == null) || (this.Rule != null && clusterConfigInfo.Rule != null && Enumerable.SequenceEqual(this.Rule, clusterConfigInfo.Rule))));\n        }\n\n        public override bool Equals(object clusterConfigInfo)\n        {\n            return Equals(clusterConfigInfo as ClusterConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DasConfig + \"_\" + DasVmConfig + \"_\" + DrsConfig + \"_\" + DrsVmConfig + \"_\" + Rule).GetHashCode();\n        }\n    }\n\n    public class ClusterConfigInfoEx : ComputeResourceConfigInfo, IEquatable<ClusterConfigInfoEx>\n    {\n        public ClusterDasConfigInfo DasConfig { get; set; }\n\n        public ClusterDasVmConfigInfo[] DasVmConfig { get; set; }\n\n        public ClusterDrsConfigInfo DrsConfig { get; set; }\n\n        public ClusterDrsVmConfigInfo[] DrsVmConfig { get; set; }\n\n        public ClusterRuleInfo[] Rule { get; set; }\n\n        public ClusterOrchestrationInfo Orchestration { get; set; }\n\n        public ClusterVmOrchestrationInfo[] VmOrchestration { get; set; }\n\n        public ClusterDpmConfigInfo DpmConfigInfo { get; set; }\n\n        public ClusterDpmHostConfigInfo[] DpmHostConfig { get; set; }\n\n        public VsanClusterConfigInfo VsanConfigInfo { get; set; }\n\n        public VsanHostConfigInfo[] VsanHostConfig { get; set; }\n\n        public ClusterGroupInfo[] Group { get; set; }\n\n        public ClusterInfraUpdateHaConfigInfo InfraUpdateHaConfig { get; set; }\n\n        public ClusterProactiveDrsConfigInfo ProactiveDrsConfig { get; set; }\n\n        public bool Equals(ClusterConfigInfoEx clusterConfigInfoEx)\n        {\n            return (clusterConfigInfoEx != null && ((this.DasConfig == null && clusterConfigInfoEx.DasConfig == null) || (this.DasConfig != null && this.DasConfig.Equals(clusterConfigInfoEx.DasConfig))) && ((this.DasVmConfig == null && clusterConfigInfoEx.DasVmConfig == null) || (this.DasVmConfig != null && clusterConfigInfoEx.DasVmConfig != null && Enumerable.SequenceEqual(this.DasVmConfig, clusterConfigInfoEx.DasVmConfig))) && ((this.DrsConfig == null && clusterConfigInfoEx.DrsConfig == null) || (this.DrsConfig != null && this.DrsConfig.Equals(clusterConfigInfoEx.DrsConfig))) && ((this.DrsVmConfig == null && clusterConfigInfoEx.DrsVmConfig == null) || (this.DrsVmConfig != null && clusterConfigInfoEx.DrsVmConfig != null && Enumerable.SequenceEqual(this.DrsVmConfig, clusterConfigInfoEx.DrsVmConfig))) && ((this.Rule == null && clusterConfigInfoEx.Rule == null) || (this.Rule != null && clusterConfigInfoEx.Rule != null && Enumerable.SequenceEqual(this.Rule, clusterConfigInfoEx.Rule))) && ((this.Orchestration == null && clusterConfigInfoEx.Orchestration == null) || (this.Orchestration != null && this.Orchestration.Equals(clusterConfigInfoEx.Orchestration))) && ((this.VmOrchestration == null && clusterConfigInfoEx.VmOrchestration == null) || (this.VmOrchestration != null && clusterConfigInfoEx.VmOrchestration != null && Enumerable.SequenceEqual(this.VmOrchestration, clusterConfigInfoEx.VmOrchestration))) && ((this.DpmConfigInfo == null && clusterConfigInfoEx.DpmConfigInfo == null) || (this.DpmConfigInfo != null && this.DpmConfigInfo.Equals(clusterConfigInfoEx.DpmConfigInfo))) && ((this.DpmHostConfig == null && clusterConfigInfoEx.DpmHostConfig == null) || (this.DpmHostConfig != null && clusterConfigInfoEx.DpmHostConfig != null && Enumerable.SequenceEqual(this.DpmHostConfig, clusterConfigInfoEx.DpmHostConfig))) && ((this.VsanConfigInfo == null && clusterConfigInfoEx.VsanConfigInfo == null) || (this.VsanConfigInfo != null && this.VsanConfigInfo.Equals(clusterConfigInfoEx.VsanConfigInfo))) && ((this.VsanHostConfig == null && clusterConfigInfoEx.VsanHostConfig == null) || (this.VsanHostConfig != null && clusterConfigInfoEx.VsanHostConfig != null && Enumerable.SequenceEqual(this.VsanHostConfig, clusterConfigInfoEx.VsanHostConfig))) && ((this.Group == null && clusterConfigInfoEx.Group == null) || (this.Group != null && clusterConfigInfoEx.Group != null && Enumerable.SequenceEqual(this.Group, clusterConfigInfoEx.Group))) && ((this.InfraUpdateHaConfig == null && clusterConfigInfoEx.InfraUpdateHaConfig == null) || (this.InfraUpdateHaConfig != null && this.InfraUpdateHaConfig.Equals(clusterConfigInfoEx.InfraUpdateHaConfig))) && ((this.ProactiveDrsConfig == null && clusterConfigInfoEx.ProactiveDrsConfig == null) || (this.ProactiveDrsConfig != null && this.ProactiveDrsConfig.Equals(clusterConfigInfoEx.ProactiveDrsConfig))));\n        }\n\n        public override bool Equals(object clusterConfigInfoEx)\n        {\n            return Equals(clusterConfigInfoEx as ClusterConfigInfoEx);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DasConfig + \"_\" + DasVmConfig + \"_\" + DrsConfig + \"_\" + DrsVmConfig + \"_\" + Rule + \"_\" + Orchestration + \"_\" + VmOrchestration + \"_\" + DpmConfigInfo + \"_\" + DpmHostConfig + \"_\" + VsanConfigInfo + \"_\" + VsanHostConfig + \"_\" + Group + \"_\" + InfraUpdateHaConfig + \"_\" + ProactiveDrsConfig).GetHashCode();\n        }\n    }\n\n    public class ClusterConfigSpec : DynamicData, IEquatable<ClusterConfigSpec>\n    {\n        public ClusterDasConfigInfo DasConfig { get; set; }\n\n        public ClusterDasVmConfigSpec[] DasVmConfigSpec { get; set; }\n\n        public ClusterDrsConfigInfo DrsConfig { get; set; }\n\n        public ClusterDrsVmConfigSpec[] DrsVmConfigSpec { get; set; }\n\n        public ClusterRuleSpec[] RulesSpec { get; set; }\n\n        public bool Equals(ClusterConfigSpec clusterConfigSpec)\n        {\n            return (clusterConfigSpec != null && ((this.DasConfig == null && clusterConfigSpec.DasConfig == null) || (this.DasConfig != null && this.DasConfig.Equals(clusterConfigSpec.DasConfig))) && ((this.DasVmConfigSpec == null && clusterConfigSpec.DasVmConfigSpec == null) || (this.DasVmConfigSpec != null && clusterConfigSpec.DasVmConfigSpec != null && Enumerable.SequenceEqual(this.DasVmConfigSpec, clusterConfigSpec.DasVmConfigSpec))) && ((this.DrsConfig == null && clusterConfigSpec.DrsConfig == null) || (this.DrsConfig != null && this.DrsConfig.Equals(clusterConfigSpec.DrsConfig))) && ((this.DrsVmConfigSpec == null && clusterConfigSpec.DrsVmConfigSpec == null) || (this.DrsVmConfigSpec != null && clusterConfigSpec.DrsVmConfigSpec != null && Enumerable.SequenceEqual(this.DrsVmConfigSpec, clusterConfigSpec.DrsVmConfigSpec))) && ((this.RulesSpec == null && clusterConfigSpec.RulesSpec == null) || (this.RulesSpec != null && clusterConfigSpec.RulesSpec != null && Enumerable.SequenceEqual(this.RulesSpec, clusterConfigSpec.RulesSpec))));\n        }\n\n        public override bool Equals(object clusterConfigSpec)\n        {\n            return Equals(clusterConfigSpec as ClusterConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DasConfig + \"_\" + DasVmConfigSpec + \"_\" + DrsConfig + \"_\" + DrsVmConfigSpec + \"_\" + RulesSpec).GetHashCode();\n        }\n    }\n\n    public class ClusterConfigSpecEx : ComputeResourceConfigSpec, IEquatable<ClusterConfigSpecEx>\n    {\n        public ClusterDasConfigInfo DasConfig { get; set; }\n\n        public ClusterDasVmConfigSpec[] DasVmConfigSpec { get; set; }\n\n        public ClusterDrsConfigInfo DrsConfig { get; set; }\n\n        public ClusterDrsVmConfigSpec[] DrsVmConfigSpec { get; set; }\n\n        public ClusterRuleSpec[] RulesSpec { get; set; }\n\n        public ClusterOrchestrationInfo Orchestration { get; set; }\n\n        public ClusterVmOrchestrationSpec[] VmOrchestrationSpec { get; set; }\n\n        public ClusterDpmConfigInfo DpmConfig { get; set; }\n\n        public ClusterDpmHostConfigSpec[] DpmHostConfigSpec { get; set; }\n\n        public VsanClusterConfigInfo VsanConfig { get; set; }\n\n        public VsanHostConfigInfo[] VsanHostConfigSpec { get; set; }\n\n        public ClusterGroupSpec[] GroupSpec { get; set; }\n\n        public ClusterInfraUpdateHaConfigInfo InfraUpdateHaConfig { get; set; }\n\n        public ClusterProactiveDrsConfigInfo ProactiveDrsConfig { get; set; }\n\n        public bool? InHciWorkflow { get; set; }\n\n        public bool Equals(ClusterConfigSpecEx clusterConfigSpecEx)\n        {\n            return (clusterConfigSpecEx != null && ((this.DasConfig == null && clusterConfigSpecEx.DasConfig == null) || (this.DasConfig != null && this.DasConfig.Equals(clusterConfigSpecEx.DasConfig))) && ((this.DasVmConfigSpec == null && clusterConfigSpecEx.DasVmConfigSpec == null) || (this.DasVmConfigSpec != null && clusterConfigSpecEx.DasVmConfigSpec != null && Enumerable.SequenceEqual(this.DasVmConfigSpec, clusterConfigSpecEx.DasVmConfigSpec))) && ((this.DrsConfig == null && clusterConfigSpecEx.DrsConfig == null) || (this.DrsConfig != null && this.DrsConfig.Equals(clusterConfigSpecEx.DrsConfig))) && ((this.DrsVmConfigSpec == null && clusterConfigSpecEx.DrsVmConfigSpec == null) || (this.DrsVmConfigSpec != null && clusterConfigSpecEx.DrsVmConfigSpec != null && Enumerable.SequenceEqual(this.DrsVmConfigSpec, clusterConfigSpecEx.DrsVmConfigSpec))) && ((this.RulesSpec == null && clusterConfigSpecEx.RulesSpec == null) || (this.RulesSpec != null && clusterConfigSpecEx.RulesSpec != null && Enumerable.SequenceEqual(this.RulesSpec, clusterConfigSpecEx.RulesSpec))) && ((this.Orchestration == null && clusterConfigSpecEx.Orchestration == null) || (this.Orchestration != null && this.Orchestration.Equals(clusterConfigSpecEx.Orchestration))) && ((this.VmOrchestrationSpec == null && clusterConfigSpecEx.VmOrchestrationSpec == null) || (this.VmOrchestrationSpec != null && clusterConfigSpecEx.VmOrchestrationSpec != null && Enumerable.SequenceEqual(this.VmOrchestrationSpec, clusterConfigSpecEx.VmOrchestrationSpec))) && ((this.DpmConfig == null && clusterConfigSpecEx.DpmConfig == null) || (this.DpmConfig != null && this.DpmConfig.Equals(clusterConfigSpecEx.DpmConfig))) && ((this.DpmHostConfigSpec == null && clusterConfigSpecEx.DpmHostConfigSpec == null) || (this.DpmHostConfigSpec != null && clusterConfigSpecEx.DpmHostConfigSpec != null && Enumerable.SequenceEqual(this.DpmHostConfigSpec, clusterConfigSpecEx.DpmHostConfigSpec))) && ((this.VsanConfig == null && clusterConfigSpecEx.VsanConfig == null) || (this.VsanConfig != null && this.VsanConfig.Equals(clusterConfigSpecEx.VsanConfig))) && ((this.VsanHostConfigSpec == null && clusterConfigSpecEx.VsanHostConfigSpec == null) || (this.VsanHostConfigSpec != null && clusterConfigSpecEx.VsanHostConfigSpec != null && Enumerable.SequenceEqual(this.VsanHostConfigSpec, clusterConfigSpecEx.VsanHostConfigSpec))) && ((this.GroupSpec == null && clusterConfigSpecEx.GroupSpec == null) || (this.GroupSpec != null && clusterConfigSpecEx.GroupSpec != null && Enumerable.SequenceEqual(this.GroupSpec, clusterConfigSpecEx.GroupSpec))) && ((this.InfraUpdateHaConfig == null && clusterConfigSpecEx.InfraUpdateHaConfig == null) || (this.InfraUpdateHaConfig != null && this.InfraUpdateHaConfig.Equals(clusterConfigSpecEx.InfraUpdateHaConfig))) && ((this.ProactiveDrsConfig == null && clusterConfigSpecEx.ProactiveDrsConfig == null) || (this.ProactiveDrsConfig != null && this.ProactiveDrsConfig.Equals(clusterConfigSpecEx.ProactiveDrsConfig))) && ((this.InHciWorkflow == null && clusterConfigSpecEx.InHciWorkflow == null) || (this.InHciWorkflow != null && this.InHciWorkflow.Equals(clusterConfigSpecEx.InHciWorkflow))));\n        }\n\n        public override bool Equals(object clusterConfigSpecEx)\n        {\n            return Equals(clusterConfigSpecEx as ClusterConfigSpecEx);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DasConfig + \"_\" + DasVmConfigSpec + \"_\" + DrsConfig + \"_\" + DrsVmConfigSpec + \"_\" + RulesSpec + \"_\" + Orchestration + \"_\" + VmOrchestrationSpec + \"_\" + DpmConfig + \"_\" + DpmHostConfigSpec + \"_\" + VsanConfig + \"_\" + VsanHostConfigSpec + \"_\" + GroupSpec + \"_\" + InfraUpdateHaConfig + \"_\" + ProactiveDrsConfig + \"_\" + InHciWorkflow).GetHashCode();\n        }\n    }\n\n    public class ClusterCreatedEvent : ClusterEvent, IEquatable<ClusterCreatedEvent>\n    {\n        public FolderEventArgument Parent { get; set; }\n\n        public bool Equals(ClusterCreatedEvent clusterCreatedEvent)\n        {\n            return (clusterCreatedEvent != null && ((this.Parent == null && clusterCreatedEvent.Parent == null) || (this.Parent != null && this.Parent.Equals(clusterCreatedEvent.Parent))));\n        }\n\n        public override bool Equals(object clusterCreatedEvent)\n        {\n            return Equals(clusterCreatedEvent as ClusterCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent).GetHashCode();\n        }\n    }\n\n    public class ClusterDasAamHostInfo : ClusterDasHostInfo, IEquatable<ClusterDasAamHostInfo>\n    {\n        public ClusterDasAamNodeState[] HostDasState { get; set; }\n\n        public string[] PrimaryHosts { get; set; }\n\n        public bool Equals(ClusterDasAamHostInfo clusterDasAamHostInfo)\n        {\n            return (clusterDasAamHostInfo != null && ((this.HostDasState == null && clusterDasAamHostInfo.HostDasState == null) || (this.HostDasState != null && clusterDasAamHostInfo.HostDasState != null && Enumerable.SequenceEqual(this.HostDasState, clusterDasAamHostInfo.HostDasState))) && ((this.PrimaryHosts == null && clusterDasAamHostInfo.PrimaryHosts == null) || (this.PrimaryHosts != null && clusterDasAamHostInfo.PrimaryHosts != null && Enumerable.SequenceEqual(this.PrimaryHosts, clusterDasAamHostInfo.PrimaryHosts))));\n        }\n\n        public override bool Equals(object clusterDasAamHostInfo)\n        {\n            return Equals(clusterDasAamHostInfo as ClusterDasAamHostInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostDasState + \"_\" + PrimaryHosts).GetHashCode();\n        }\n    }\n\n    public class ClusterDasAamNodeState : DynamicData, IEquatable<ClusterDasAamNodeState>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string Name { get; set; }\n\n        public string ConfigState { get; set; }\n\n        public string RuntimeState { get; set; }\n\n        public ClusterDasAamNodeState_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasAamNodeState clusterDasAamNodeState)\n        {\n            return (clusterDasAamNodeState != null && ((this.Host == null && clusterDasAamNodeState.Host == null) || (this.Host != null && this.Host.Equals(clusterDasAamNodeState.Host))) && this.Name == clusterDasAamNodeState.Name && this.ConfigState == clusterDasAamNodeState.ConfigState && this.RuntimeState == clusterDasAamNodeState.RuntimeState && ((this.LinkedView == null && clusterDasAamNodeState.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasAamNodeState.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasAamNodeState)\n        {\n            return Equals(clusterDasAamNodeState as ClusterDasAamNodeState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Name + \"_\" + ConfigState + \"_\" + RuntimeState + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasAamNodeState_LinkedView : IEquatable<ClusterDasAamNodeState_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterDasAamNodeState_LinkedView clusterDasAamNodeState_LinkedView)\n        {\n            return (clusterDasAamNodeState_LinkedView != null && ((this.Host == null && clusterDasAamNodeState_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterDasAamNodeState_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterDasAamNodeState_LinkedView)\n        {\n            return Equals(clusterDasAamNodeState_LinkedView as ClusterDasAamNodeState_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterDasAdmissionControlInfo : DynamicData, IEquatable<ClusterDasAdmissionControlInfo>\n    {\n        public bool Equals(ClusterDasAdmissionControlInfo clusterDasAdmissionControlInfo)\n        {\n            return (clusterDasAdmissionControlInfo != null && base.Equals(clusterDasAdmissionControlInfo));\n        }\n\n        public override bool Equals(object clusterDasAdmissionControlInfo)\n        {\n            return Equals(clusterDasAdmissionControlInfo as ClusterDasAdmissionControlInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterDasAdmissionControlPolicy : DynamicData, IEquatable<ClusterDasAdmissionControlPolicy>\n    {\n        public int? ResourceReductionToToleratePercent { get; set; }\n\n        public bool Equals(ClusterDasAdmissionControlPolicy clusterDasAdmissionControlPolicy)\n        {\n            return (clusterDasAdmissionControlPolicy != null && ((this.ResourceReductionToToleratePercent == null && clusterDasAdmissionControlPolicy.ResourceReductionToToleratePercent == null) || (this.ResourceReductionToToleratePercent != null && this.ResourceReductionToToleratePercent.Equals(clusterDasAdmissionControlPolicy.ResourceReductionToToleratePercent))));\n        }\n\n        public override bool Equals(object clusterDasAdmissionControlPolicy)\n        {\n            return Equals(clusterDasAdmissionControlPolicy as ClusterDasAdmissionControlPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResourceReductionToToleratePercent).GetHashCode();\n        }\n    }\n\n    public class ClusterDasAdvancedRuntimeInfo : DynamicData, IEquatable<ClusterDasAdvancedRuntimeInfo>\n    {\n        public ClusterDasHostInfo DasHostInfo { get; set; }\n\n        public ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo VmcpSupported { get; set; }\n\n        public DasHeartbeatDatastoreInfo[] HeartbeatDatastoreInfo { get; set; }\n\n        public bool Equals(ClusterDasAdvancedRuntimeInfo clusterDasAdvancedRuntimeInfo)\n        {\n            return (clusterDasAdvancedRuntimeInfo != null && ((this.DasHostInfo == null && clusterDasAdvancedRuntimeInfo.DasHostInfo == null) || (this.DasHostInfo != null && this.DasHostInfo.Equals(clusterDasAdvancedRuntimeInfo.DasHostInfo))) && ((this.VmcpSupported == null && clusterDasAdvancedRuntimeInfo.VmcpSupported == null) || (this.VmcpSupported != null && this.VmcpSupported.Equals(clusterDasAdvancedRuntimeInfo.VmcpSupported))) && ((this.HeartbeatDatastoreInfo == null && clusterDasAdvancedRuntimeInfo.HeartbeatDatastoreInfo == null) || (this.HeartbeatDatastoreInfo != null && clusterDasAdvancedRuntimeInfo.HeartbeatDatastoreInfo != null && Enumerable.SequenceEqual(this.HeartbeatDatastoreInfo, clusterDasAdvancedRuntimeInfo.HeartbeatDatastoreInfo))));\n        }\n\n        public override bool Equals(object clusterDasAdvancedRuntimeInfo)\n        {\n            return Equals(clusterDasAdvancedRuntimeInfo as ClusterDasAdvancedRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DasHostInfo + \"_\" + VmcpSupported + \"_\" + HeartbeatDatastoreInfo).GetHashCode();\n        }\n    }\n\n    public class ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo : DynamicData, IEquatable<ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo>\n    {\n        public bool StorageAPDSupported { get; set; }\n\n        public bool StoragePDLSupported { get; set; }\n\n        public bool Equals(ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo clusterDasAdvancedRuntimeInfoVmcpCapabilityInfo)\n        {\n            return (clusterDasAdvancedRuntimeInfoVmcpCapabilityInfo != null && this.StorageAPDSupported == clusterDasAdvancedRuntimeInfoVmcpCapabilityInfo.StorageAPDSupported && this.StoragePDLSupported == clusterDasAdvancedRuntimeInfoVmcpCapabilityInfo.StoragePDLSupported);\n        }\n\n        public override bool Equals(object clusterDasAdvancedRuntimeInfoVmcpCapabilityInfo)\n        {\n            return Equals(clusterDasAdvancedRuntimeInfoVmcpCapabilityInfo as ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StorageAPDSupported + \"_\" + StoragePDLSupported).GetHashCode();\n        }\n    }\n\n    public class ClusterDasConfigInfo : DynamicData, IEquatable<ClusterDasConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public string VmMonitoring { get; set; }\n\n        public string HostMonitoring { get; set; }\n\n        public string VmComponentProtecting { get; set; }\n\n        public int? FailoverLevel { get; set; }\n\n        public ClusterDasAdmissionControlPolicy AdmissionControlPolicy { get; set; }\n\n        public bool? AdmissionControlEnabled { get; set; }\n\n        public ClusterDasVmSettings DefaultVmSettings { get; set; }\n\n        public OptionValue[] Option { get; set; }\n\n        public ManagedObjectReference[] HeartbeatDatastore { get; set; }\n\n        public string HBDatastoreCandidatePolicy { get; set; }\n\n        public ClusterDasConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasConfigInfo clusterDasConfigInfo)\n        {\n            return (clusterDasConfigInfo != null && ((this.Enabled == null && clusterDasConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterDasConfigInfo.Enabled))) && this.VmMonitoring == clusterDasConfigInfo.VmMonitoring && this.HostMonitoring == clusterDasConfigInfo.HostMonitoring && this.VmComponentProtecting == clusterDasConfigInfo.VmComponentProtecting && ((this.FailoverLevel == null && clusterDasConfigInfo.FailoverLevel == null) || (this.FailoverLevel != null && this.FailoverLevel.Equals(clusterDasConfigInfo.FailoverLevel))) && ((this.AdmissionControlPolicy == null && clusterDasConfigInfo.AdmissionControlPolicy == null) || (this.AdmissionControlPolicy != null && this.AdmissionControlPolicy.Equals(clusterDasConfigInfo.AdmissionControlPolicy))) && ((this.AdmissionControlEnabled == null && clusterDasConfigInfo.AdmissionControlEnabled == null) || (this.AdmissionControlEnabled != null && this.AdmissionControlEnabled.Equals(clusterDasConfigInfo.AdmissionControlEnabled))) && ((this.DefaultVmSettings == null && clusterDasConfigInfo.DefaultVmSettings == null) || (this.DefaultVmSettings != null && this.DefaultVmSettings.Equals(clusterDasConfigInfo.DefaultVmSettings))) && ((this.Option == null && clusterDasConfigInfo.Option == null) || (this.Option != null && clusterDasConfigInfo.Option != null && Enumerable.SequenceEqual(this.Option, clusterDasConfigInfo.Option))) && ((this.HeartbeatDatastore == null && clusterDasConfigInfo.HeartbeatDatastore == null) || (this.HeartbeatDatastore != null && clusterDasConfigInfo.HeartbeatDatastore != null && Enumerable.SequenceEqual(this.HeartbeatDatastore, clusterDasConfigInfo.HeartbeatDatastore))) && this.HBDatastoreCandidatePolicy == clusterDasConfigInfo.HBDatastoreCandidatePolicy && ((this.LinkedView == null && clusterDasConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasConfigInfo)\n        {\n            return Equals(clusterDasConfigInfo as ClusterDasConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + VmMonitoring + \"_\" + HostMonitoring + \"_\" + VmComponentProtecting + \"_\" + FailoverLevel + \"_\" + AdmissionControlPolicy + \"_\" + AdmissionControlEnabled + \"_\" + DefaultVmSettings + \"_\" + Option + \"_\" + HeartbeatDatastore + \"_\" + HBDatastoreCandidatePolicy + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasConfigInfo_LinkedView : IEquatable<ClusterDasConfigInfo_LinkedView>\n    {\n        public Datastore[] HeartbeatDatastore { get; set; }\n\n        public bool Equals(ClusterDasConfigInfo_LinkedView clusterDasConfigInfo_LinkedView)\n        {\n            return (clusterDasConfigInfo_LinkedView != null && ((this.HeartbeatDatastore == null && clusterDasConfigInfo_LinkedView.HeartbeatDatastore == null) || (this.HeartbeatDatastore != null && clusterDasConfigInfo_LinkedView.HeartbeatDatastore != null && Enumerable.SequenceEqual(this.HeartbeatDatastore, clusterDasConfigInfo_LinkedView.HeartbeatDatastore))));\n        }\n\n        public override bool Equals(object clusterDasConfigInfo_LinkedView)\n        {\n            return Equals(clusterDasConfigInfo_LinkedView as ClusterDasConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HeartbeatDatastore).GetHashCode();\n        }\n    }\n\n    public class ClusterDasData : DynamicData, IEquatable<ClusterDasData>\n    {\n        public bool Equals(ClusterDasData clusterDasData)\n        {\n            return (clusterDasData != null && base.Equals(clusterDasData));\n        }\n\n        public override bool Equals(object clusterDasData)\n        {\n            return Equals(clusterDasData as ClusterDasData);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterDasDataSummary : ClusterDasData, IEquatable<ClusterDasDataSummary>\n    {\n        public long HostListVersion { get; set; }\n\n        public long ClusterConfigVersion { get; set; }\n\n        public long CompatListVersion { get; set; }\n\n        public bool Equals(ClusterDasDataSummary clusterDasDataSummary)\n        {\n            return (clusterDasDataSummary != null && this.HostListVersion == clusterDasDataSummary.HostListVersion && this.ClusterConfigVersion == clusterDasDataSummary.ClusterConfigVersion && this.CompatListVersion == clusterDasDataSummary.CompatListVersion);\n        }\n\n        public override bool Equals(object clusterDasDataSummary)\n        {\n            return Equals(clusterDasDataSummary as ClusterDasDataSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostListVersion + \"_\" + ClusterConfigVersion + \"_\" + CompatListVersion).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFailoverLevelAdvancedRuntimeInfo : ClusterDasAdvancedRuntimeInfo, IEquatable<ClusterDasFailoverLevelAdvancedRuntimeInfo>\n    {\n        public ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo SlotInfo { get; set; }\n\n        public int TotalSlots { get; set; }\n\n        public int UsedSlots { get; set; }\n\n        public int UnreservedSlots { get; set; }\n\n        public int TotalVms { get; set; }\n\n        public int TotalHosts { get; set; }\n\n        public int TotalGoodHosts { get; set; }\n\n        public ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots[] HostSlots { get; set; }\n\n        public ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots[] VmsRequiringMultipleSlots { get; set; }\n\n        public bool Equals(ClusterDasFailoverLevelAdvancedRuntimeInfo clusterDasFailoverLevelAdvancedRuntimeInfo)\n        {\n            return (clusterDasFailoverLevelAdvancedRuntimeInfo != null && ((this.SlotInfo == null && clusterDasFailoverLevelAdvancedRuntimeInfo.SlotInfo == null) || (this.SlotInfo != null && this.SlotInfo.Equals(clusterDasFailoverLevelAdvancedRuntimeInfo.SlotInfo))) && this.TotalSlots == clusterDasFailoverLevelAdvancedRuntimeInfo.TotalSlots && this.UsedSlots == clusterDasFailoverLevelAdvancedRuntimeInfo.UsedSlots && this.UnreservedSlots == clusterDasFailoverLevelAdvancedRuntimeInfo.UnreservedSlots && this.TotalVms == clusterDasFailoverLevelAdvancedRuntimeInfo.TotalVms && this.TotalHosts == clusterDasFailoverLevelAdvancedRuntimeInfo.TotalHosts && this.TotalGoodHosts == clusterDasFailoverLevelAdvancedRuntimeInfo.TotalGoodHosts && ((this.HostSlots == null && clusterDasFailoverLevelAdvancedRuntimeInfo.HostSlots == null) || (this.HostSlots != null && clusterDasFailoverLevelAdvancedRuntimeInfo.HostSlots != null && Enumerable.SequenceEqual(this.HostSlots, clusterDasFailoverLevelAdvancedRuntimeInfo.HostSlots))) && ((this.VmsRequiringMultipleSlots == null && clusterDasFailoverLevelAdvancedRuntimeInfo.VmsRequiringMultipleSlots == null) || (this.VmsRequiringMultipleSlots != null && clusterDasFailoverLevelAdvancedRuntimeInfo.VmsRequiringMultipleSlots != null && Enumerable.SequenceEqual(this.VmsRequiringMultipleSlots, clusterDasFailoverLevelAdvancedRuntimeInfo.VmsRequiringMultipleSlots))));\n        }\n\n        public override bool Equals(object clusterDasFailoverLevelAdvancedRuntimeInfo)\n        {\n            return Equals(clusterDasFailoverLevelAdvancedRuntimeInfo as ClusterDasFailoverLevelAdvancedRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SlotInfo + \"_\" + TotalSlots + \"_\" + UsedSlots + \"_\" + UnreservedSlots + \"_\" + TotalVms + \"_\" + TotalHosts + \"_\" + TotalGoodHosts + \"_\" + HostSlots + \"_\" + VmsRequiringMultipleSlots).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots : DynamicData, IEquatable<ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public int Slots { get; set; }\n\n        public ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots)\n        {\n            return (clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots != null && ((this.Host == null && clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots.Host == null) || (this.Host != null && this.Host.Equals(clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots.Host))) && this.Slots == clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots.Slots && ((this.LinkedView == null && clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots)\n        {\n            return Equals(clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots as ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Slots + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView : IEquatable<ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView)\n        {\n            return (clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView != null && ((this.Host == null && clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView)\n        {\n            return Equals(clusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView as ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo : DynamicData, IEquatable<ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo>\n    {\n        public int NumVcpus { get; set; }\n\n        public int CpuMHz { get; set; }\n\n        public int MemoryMB { get; set; }\n\n        public bool Equals(ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo)\n        {\n            return (clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo != null && this.NumVcpus == clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo.NumVcpus && this.CpuMHz == clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo.CpuMHz && this.MemoryMB == clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo.MemoryMB);\n        }\n\n        public override bool Equals(object clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo)\n        {\n            return Equals(clusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo as ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumVcpus + \"_\" + CpuMHz + \"_\" + MemoryMB).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots : DynamicData, IEquatable<ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public int Slots { get; set; }\n\n        public ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots)\n        {\n            return (clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots != null && ((this.Vm == null && clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots.Vm))) && this.Slots == clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots.Slots && ((this.LinkedView == null && clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots)\n        {\n            return Equals(clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots as ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Slots + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView : IEquatable<ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView)\n        {\n            return (clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView != null && ((this.Vm == null && clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView)\n        {\n            return Equals(clusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView as ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFdmHostState : DynamicData, IEquatable<ClusterDasFdmHostState>\n    {\n        public string State { get; set; }\n\n        public ManagedObjectReference StateReporter { get; set; }\n\n        public ClusterDasFdmHostState_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasFdmHostState clusterDasFdmHostState)\n        {\n            return (clusterDasFdmHostState != null && this.State == clusterDasFdmHostState.State && ((this.StateReporter == null && clusterDasFdmHostState.StateReporter == null) || (this.StateReporter != null && this.StateReporter.Equals(clusterDasFdmHostState.StateReporter))) && ((this.LinkedView == null && clusterDasFdmHostState.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasFdmHostState.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasFdmHostState)\n        {\n            return Equals(clusterDasFdmHostState as ClusterDasFdmHostState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + StateReporter + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasFdmHostState_LinkedView : IEquatable<ClusterDasFdmHostState_LinkedView>\n    {\n        public HostSystem StateReporter { get; set; }\n\n        public bool Equals(ClusterDasFdmHostState_LinkedView clusterDasFdmHostState_LinkedView)\n        {\n            return (clusterDasFdmHostState_LinkedView != null && ((this.StateReporter == null && clusterDasFdmHostState_LinkedView.StateReporter == null) || (this.StateReporter != null && this.StateReporter.Equals(clusterDasFdmHostState_LinkedView.StateReporter))));\n        }\n\n        public override bool Equals(object clusterDasFdmHostState_LinkedView)\n        {\n            return Equals(clusterDasFdmHostState_LinkedView as ClusterDasFdmHostState_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StateReporter).GetHashCode();\n        }\n    }\n\n    public class ClusterDasHostInfo : DynamicData, IEquatable<ClusterDasHostInfo>\n    {\n        public bool Equals(ClusterDasHostInfo clusterDasHostInfo)\n        {\n            return (clusterDasHostInfo != null && base.Equals(clusterDasHostInfo));\n        }\n\n        public override bool Equals(object clusterDasHostInfo)\n        {\n            return Equals(clusterDasHostInfo as ClusterDasHostInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterDasHostRecommendation : DynamicData, IEquatable<ClusterDasHostRecommendation>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public int? DrsRating { get; set; }\n\n        public ClusterDasHostRecommendation_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasHostRecommendation clusterDasHostRecommendation)\n        {\n            return (clusterDasHostRecommendation != null && ((this.Host == null && clusterDasHostRecommendation.Host == null) || (this.Host != null && this.Host.Equals(clusterDasHostRecommendation.Host))) && ((this.DrsRating == null && clusterDasHostRecommendation.DrsRating == null) || (this.DrsRating != null && this.DrsRating.Equals(clusterDasHostRecommendation.DrsRating))) && ((this.LinkedView == null && clusterDasHostRecommendation.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasHostRecommendation.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasHostRecommendation)\n        {\n            return Equals(clusterDasHostRecommendation as ClusterDasHostRecommendation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + DrsRating + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasHostRecommendation_LinkedView : IEquatable<ClusterDasHostRecommendation_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterDasHostRecommendation_LinkedView clusterDasHostRecommendation_LinkedView)\n        {\n            return (clusterDasHostRecommendation_LinkedView != null && ((this.Host == null && clusterDasHostRecommendation_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterDasHostRecommendation_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterDasHostRecommendation_LinkedView)\n        {\n            return Equals(clusterDasHostRecommendation_LinkedView as ClusterDasHostRecommendation_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterDasVmConfigInfo : DynamicData, IEquatable<ClusterDasVmConfigInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public DasVmPriority? RestartPriority { get; set; }\n\n        public bool? PowerOffOnIsolation { get; set; }\n\n        public ClusterDasVmSettings DasSettings { get; set; }\n\n        public ClusterDasVmConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDasVmConfigInfo clusterDasVmConfigInfo)\n        {\n            return (clusterDasVmConfigInfo != null && ((this.Key == null && clusterDasVmConfigInfo.Key == null) || (this.Key != null && this.Key.Equals(clusterDasVmConfigInfo.Key))) && ((this.RestartPriority == null && clusterDasVmConfigInfo.RestartPriority == null) || (this.RestartPriority != null && this.RestartPriority.Equals(clusterDasVmConfigInfo.RestartPriority))) && ((this.PowerOffOnIsolation == null && clusterDasVmConfigInfo.PowerOffOnIsolation == null) || (this.PowerOffOnIsolation != null && this.PowerOffOnIsolation.Equals(clusterDasVmConfigInfo.PowerOffOnIsolation))) && ((this.DasSettings == null && clusterDasVmConfigInfo.DasSettings == null) || (this.DasSettings != null && this.DasSettings.Equals(clusterDasVmConfigInfo.DasSettings))) && ((this.LinkedView == null && clusterDasVmConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDasVmConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDasVmConfigInfo)\n        {\n            return Equals(clusterDasVmConfigInfo as ClusterDasVmConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + RestartPriority + \"_\" + PowerOffOnIsolation + \"_\" + DasSettings + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDasVmConfigInfo_LinkedView : IEquatable<ClusterDasVmConfigInfo_LinkedView>\n    {\n        public VirtualMachine Key { get; set; }\n\n        public bool Equals(ClusterDasVmConfigInfo_LinkedView clusterDasVmConfigInfo_LinkedView)\n        {\n            return (clusterDasVmConfigInfo_LinkedView != null && ((this.Key == null && clusterDasVmConfigInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(clusterDasVmConfigInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object clusterDasVmConfigInfo_LinkedView)\n        {\n            return Equals(clusterDasVmConfigInfo_LinkedView as ClusterDasVmConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class ClusterDasVmConfigSpec : ArrayUpdateSpec, IEquatable<ClusterDasVmConfigSpec>\n    {\n        public ClusterDasVmConfigInfo Info { get; set; }\n\n        public bool Equals(ClusterDasVmConfigSpec clusterDasVmConfigSpec)\n        {\n            return (clusterDasVmConfigSpec != null && ((this.Info == null && clusterDasVmConfigSpec.Info == null) || (this.Info != null && this.Info.Equals(clusterDasVmConfigSpec.Info))));\n        }\n\n        public override bool Equals(object clusterDasVmConfigSpec)\n        {\n            return Equals(clusterDasVmConfigSpec as ClusterDasVmConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterDasVmSettings : DynamicData, IEquatable<ClusterDasVmSettings>\n    {\n        public string RestartPriority { get; set; }\n\n        public int? RestartPriorityTimeout { get; set; }\n\n        public string IsolationResponse { get; set; }\n\n        public ClusterVmToolsMonitoringSettings VmToolsMonitoringSettings { get; set; }\n\n        public ClusterVmComponentProtectionSettings VmComponentProtectionSettings { get; set; }\n\n        public bool Equals(ClusterDasVmSettings clusterDasVmSettings)\n        {\n            return (clusterDasVmSettings != null && this.RestartPriority == clusterDasVmSettings.RestartPriority && ((this.RestartPriorityTimeout == null && clusterDasVmSettings.RestartPriorityTimeout == null) || (this.RestartPriorityTimeout != null && this.RestartPriorityTimeout.Equals(clusterDasVmSettings.RestartPriorityTimeout))) && this.IsolationResponse == clusterDasVmSettings.IsolationResponse && ((this.VmToolsMonitoringSettings == null && clusterDasVmSettings.VmToolsMonitoringSettings == null) || (this.VmToolsMonitoringSettings != null && this.VmToolsMonitoringSettings.Equals(clusterDasVmSettings.VmToolsMonitoringSettings))) && ((this.VmComponentProtectionSettings == null && clusterDasVmSettings.VmComponentProtectionSettings == null) || (this.VmComponentProtectionSettings != null && this.VmComponentProtectionSettings.Equals(clusterDasVmSettings.VmComponentProtectionSettings))));\n        }\n\n        public override bool Equals(object clusterDasVmSettings)\n        {\n            return Equals(clusterDasVmSettings as ClusterDasVmSettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RestartPriority + \"_\" + RestartPriorityTimeout + \"_\" + IsolationResponse + \"_\" + VmToolsMonitoringSettings + \"_\" + VmComponentProtectionSettings).GetHashCode();\n        }\n    }\n\n    public class ClusterDependencyRuleInfo : ClusterRuleInfo, IEquatable<ClusterDependencyRuleInfo>\n    {\n        public string VmGroup { get; set; }\n\n        public string DependsOnVmGroup { get; set; }\n\n        public bool Equals(ClusterDependencyRuleInfo clusterDependencyRuleInfo)\n        {\n            return (clusterDependencyRuleInfo != null && this.VmGroup == clusterDependencyRuleInfo.VmGroup && this.DependsOnVmGroup == clusterDependencyRuleInfo.DependsOnVmGroup);\n        }\n\n        public override bool Equals(object clusterDependencyRuleInfo)\n        {\n            return Equals(clusterDependencyRuleInfo as ClusterDependencyRuleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmGroup + \"_\" + DependsOnVmGroup).GetHashCode();\n        }\n    }\n\n    public class ClusterDestroyedEvent : ClusterEvent, IEquatable<ClusterDestroyedEvent>\n    {\n        public bool Equals(ClusterDestroyedEvent clusterDestroyedEvent)\n        {\n            return (clusterDestroyedEvent != null && base.Equals(clusterDestroyedEvent));\n        }\n\n        public override bool Equals(object clusterDestroyedEvent)\n        {\n            return Equals(clusterDestroyedEvent as ClusterDestroyedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterDpmConfigInfo : DynamicData, IEquatable<ClusterDpmConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public DpmBehavior? DefaultDpmBehavior { get; set; }\n\n        public int? HostPowerActionRate { get; set; }\n\n        public OptionValue[] Option { get; set; }\n\n        public bool Equals(ClusterDpmConfigInfo clusterDpmConfigInfo)\n        {\n            return (clusterDpmConfigInfo != null && ((this.Enabled == null && clusterDpmConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterDpmConfigInfo.Enabled))) && ((this.DefaultDpmBehavior == null && clusterDpmConfigInfo.DefaultDpmBehavior == null) || (this.DefaultDpmBehavior != null && this.DefaultDpmBehavior.Equals(clusterDpmConfigInfo.DefaultDpmBehavior))) && ((this.HostPowerActionRate == null && clusterDpmConfigInfo.HostPowerActionRate == null) || (this.HostPowerActionRate != null && this.HostPowerActionRate.Equals(clusterDpmConfigInfo.HostPowerActionRate))) && ((this.Option == null && clusterDpmConfigInfo.Option == null) || (this.Option != null && clusterDpmConfigInfo.Option != null && Enumerable.SequenceEqual(this.Option, clusterDpmConfigInfo.Option))));\n        }\n\n        public override bool Equals(object clusterDpmConfigInfo)\n        {\n            return Equals(clusterDpmConfigInfo as ClusterDpmConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + DefaultDpmBehavior + \"_\" + HostPowerActionRate + \"_\" + Option).GetHashCode();\n        }\n    }\n\n    public class ClusterDpmHostConfigInfo : DynamicData, IEquatable<ClusterDpmHostConfigInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public bool? Enabled { get; set; }\n\n        public DpmBehavior? Behavior { get; set; }\n\n        public ClusterDpmHostConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDpmHostConfigInfo clusterDpmHostConfigInfo)\n        {\n            return (clusterDpmHostConfigInfo != null && ((this.Key == null && clusterDpmHostConfigInfo.Key == null) || (this.Key != null && this.Key.Equals(clusterDpmHostConfigInfo.Key))) && ((this.Enabled == null && clusterDpmHostConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterDpmHostConfigInfo.Enabled))) && ((this.Behavior == null && clusterDpmHostConfigInfo.Behavior == null) || (this.Behavior != null && this.Behavior.Equals(clusterDpmHostConfigInfo.Behavior))) && ((this.LinkedView == null && clusterDpmHostConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDpmHostConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDpmHostConfigInfo)\n        {\n            return Equals(clusterDpmHostConfigInfo as ClusterDpmHostConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Enabled + \"_\" + Behavior + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDpmHostConfigInfo_LinkedView : IEquatable<ClusterDpmHostConfigInfo_LinkedView>\n    {\n        public HostSystem Key { get; set; }\n\n        public bool Equals(ClusterDpmHostConfigInfo_LinkedView clusterDpmHostConfigInfo_LinkedView)\n        {\n            return (clusterDpmHostConfigInfo_LinkedView != null && ((this.Key == null && clusterDpmHostConfigInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(clusterDpmHostConfigInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object clusterDpmHostConfigInfo_LinkedView)\n        {\n            return Equals(clusterDpmHostConfigInfo_LinkedView as ClusterDpmHostConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class ClusterDpmHostConfigSpec : ArrayUpdateSpec, IEquatable<ClusterDpmHostConfigSpec>\n    {\n        public ClusterDpmHostConfigInfo Info { get; set; }\n\n        public bool Equals(ClusterDpmHostConfigSpec clusterDpmHostConfigSpec)\n        {\n            return (clusterDpmHostConfigSpec != null && ((this.Info == null && clusterDpmHostConfigSpec.Info == null) || (this.Info != null && this.Info.Equals(clusterDpmHostConfigSpec.Info))));\n        }\n\n        public override bool Equals(object clusterDpmHostConfigSpec)\n        {\n            return Equals(clusterDpmHostConfigSpec as ClusterDpmHostConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsConfigInfo : DynamicData, IEquatable<ClusterDrsConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public bool? EnableVmBehaviorOverrides { get; set; }\n\n        public DrsBehavior? DefaultVmBehavior { get; set; }\n\n        public int? VmotionRate { get; set; }\n\n        public OptionValue[] Option { get; set; }\n\n        public bool Equals(ClusterDrsConfigInfo clusterDrsConfigInfo)\n        {\n            return (clusterDrsConfigInfo != null && ((this.Enabled == null && clusterDrsConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterDrsConfigInfo.Enabled))) && ((this.EnableVmBehaviorOverrides == null && clusterDrsConfigInfo.EnableVmBehaviorOverrides == null) || (this.EnableVmBehaviorOverrides != null && this.EnableVmBehaviorOverrides.Equals(clusterDrsConfigInfo.EnableVmBehaviorOverrides))) && ((this.DefaultVmBehavior == null && clusterDrsConfigInfo.DefaultVmBehavior == null) || (this.DefaultVmBehavior != null && this.DefaultVmBehavior.Equals(clusterDrsConfigInfo.DefaultVmBehavior))) && ((this.VmotionRate == null && clusterDrsConfigInfo.VmotionRate == null) || (this.VmotionRate != null && this.VmotionRate.Equals(clusterDrsConfigInfo.VmotionRate))) && ((this.Option == null && clusterDrsConfigInfo.Option == null) || (this.Option != null && clusterDrsConfigInfo.Option != null && Enumerable.SequenceEqual(this.Option, clusterDrsConfigInfo.Option))));\n        }\n\n        public override bool Equals(object clusterDrsConfigInfo)\n        {\n            return Equals(clusterDrsConfigInfo as ClusterDrsConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + EnableVmBehaviorOverrides + \"_\" + DefaultVmBehavior + \"_\" + VmotionRate + \"_\" + Option).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsFaults : DynamicData, IEquatable<ClusterDrsFaults>\n    {\n        public string Reason { get; set; }\n\n        public ClusterDrsFaultsFaultsByVm[] FaultsByVm { get; set; }\n\n        public bool Equals(ClusterDrsFaults clusterDrsFaults)\n        {\n            return (clusterDrsFaults != null && this.Reason == clusterDrsFaults.Reason && ((this.FaultsByVm == null && clusterDrsFaults.FaultsByVm == null) || (this.FaultsByVm != null && clusterDrsFaults.FaultsByVm != null && Enumerable.SequenceEqual(this.FaultsByVm, clusterDrsFaults.FaultsByVm))));\n        }\n\n        public override bool Equals(object clusterDrsFaults)\n        {\n            return Equals(clusterDrsFaults as ClusterDrsFaults);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + FaultsByVm).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsFaultsFaultsByVirtualDisk : ClusterDrsFaultsFaultsByVm, IEquatable<ClusterDrsFaultsFaultsByVirtualDisk>\n    {\n        public VirtualDiskId Disk { get; set; }\n\n        public new ClusterDrsFaultsFaultsByVirtualDisk_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDrsFaultsFaultsByVirtualDisk clusterDrsFaultsFaultsByVirtualDisk)\n        {\n            return (clusterDrsFaultsFaultsByVirtualDisk != null && ((this.Disk == null && clusterDrsFaultsFaultsByVirtualDisk.Disk == null) || (this.Disk != null && this.Disk.Equals(clusterDrsFaultsFaultsByVirtualDisk.Disk))) && ((this.LinkedView == null && clusterDrsFaultsFaultsByVirtualDisk.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDrsFaultsFaultsByVirtualDisk.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDrsFaultsFaultsByVirtualDisk)\n        {\n            return Equals(clusterDrsFaultsFaultsByVirtualDisk as ClusterDrsFaultsFaultsByVirtualDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsFaultsFaultsByVirtualDisk_LinkedView : ClusterDrsFaultsFaultsByVm_LinkedView, IEquatable<ClusterDrsFaultsFaultsByVirtualDisk_LinkedView>\n    {\n        public bool Equals(ClusterDrsFaultsFaultsByVirtualDisk_LinkedView clusterDrsFaultsFaultsByVirtualDisk_LinkedView)\n        {\n            return (clusterDrsFaultsFaultsByVirtualDisk_LinkedView != null && base.Equals(clusterDrsFaultsFaultsByVirtualDisk_LinkedView));\n        }\n\n        public override bool Equals(object clusterDrsFaultsFaultsByVirtualDisk_LinkedView)\n        {\n            return Equals(clusterDrsFaultsFaultsByVirtualDisk_LinkedView as ClusterDrsFaultsFaultsByVirtualDisk_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterDrsFaultsFaultsByVm : DynamicData, IEquatable<ClusterDrsFaultsFaultsByVm>\n    {\n        public ClusterDrsFaultsFaultsByVm_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public LocalizedMethodFault[] Fault { get; set; }\n\n        public bool Equals(ClusterDrsFaultsFaultsByVm clusterDrsFaultsFaultsByVm)\n        {\n            return (clusterDrsFaultsFaultsByVm != null && ((this.LinkedView == null && clusterDrsFaultsFaultsByVm.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDrsFaultsFaultsByVm.LinkedView))) && ((this.Vm == null && clusterDrsFaultsFaultsByVm.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterDrsFaultsFaultsByVm.Vm))) && ((this.Fault == null && clusterDrsFaultsFaultsByVm.Fault == null) || (this.Fault != null && clusterDrsFaultsFaultsByVm.Fault != null && Enumerable.SequenceEqual(this.Fault, clusterDrsFaultsFaultsByVm.Fault))));\n        }\n\n        public override bool Equals(object clusterDrsFaultsFaultsByVm)\n        {\n            return Equals(clusterDrsFaultsFaultsByVm as ClusterDrsFaultsFaultsByVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView + \"_\" + Vm + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsFaultsFaultsByVm_LinkedView : IEquatable<ClusterDrsFaultsFaultsByVm_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(ClusterDrsFaultsFaultsByVm_LinkedView clusterDrsFaultsFaultsByVm_LinkedView)\n        {\n            return (clusterDrsFaultsFaultsByVm_LinkedView != null && ((this.Vm == null && clusterDrsFaultsFaultsByVm_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterDrsFaultsFaultsByVm_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterDrsFaultsFaultsByVm_LinkedView)\n        {\n            return Equals(clusterDrsFaultsFaultsByVm_LinkedView as ClusterDrsFaultsFaultsByVm_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsMigration : DynamicData, IEquatable<ClusterDrsMigration>\n    {\n        public string Key { get; set; }\n\n        public DateTime Time { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public int? CpuLoad { get; set; }\n\n        public long? MemoryLoad { get; set; }\n\n        public ManagedObjectReference Source { get; set; }\n\n        public int? SourceCpuLoad { get; set; }\n\n        public long? SourceMemoryLoad { get; set; }\n\n        public ManagedObjectReference Destination { get; set; }\n\n        public int? DestinationCpuLoad { get; set; }\n\n        public long? DestinationMemoryLoad { get; set; }\n\n        public ClusterDrsMigration_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDrsMigration clusterDrsMigration)\n        {\n            return (clusterDrsMigration != null && this.Key == clusterDrsMigration.Key && this.Time == clusterDrsMigration.Time && ((this.Vm == null && clusterDrsMigration.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterDrsMigration.Vm))) && ((this.CpuLoad == null && clusterDrsMigration.CpuLoad == null) || (this.CpuLoad != null && this.CpuLoad.Equals(clusterDrsMigration.CpuLoad))) && ((this.MemoryLoad == null && clusterDrsMigration.MemoryLoad == null) || (this.MemoryLoad != null && this.MemoryLoad.Equals(clusterDrsMigration.MemoryLoad))) && ((this.Source == null && clusterDrsMigration.Source == null) || (this.Source != null && this.Source.Equals(clusterDrsMigration.Source))) && ((this.SourceCpuLoad == null && clusterDrsMigration.SourceCpuLoad == null) || (this.SourceCpuLoad != null && this.SourceCpuLoad.Equals(clusterDrsMigration.SourceCpuLoad))) && ((this.SourceMemoryLoad == null && clusterDrsMigration.SourceMemoryLoad == null) || (this.SourceMemoryLoad != null && this.SourceMemoryLoad.Equals(clusterDrsMigration.SourceMemoryLoad))) && ((this.Destination == null && clusterDrsMigration.Destination == null) || (this.Destination != null && this.Destination.Equals(clusterDrsMigration.Destination))) && ((this.DestinationCpuLoad == null && clusterDrsMigration.DestinationCpuLoad == null) || (this.DestinationCpuLoad != null && this.DestinationCpuLoad.Equals(clusterDrsMigration.DestinationCpuLoad))) && ((this.DestinationMemoryLoad == null && clusterDrsMigration.DestinationMemoryLoad == null) || (this.DestinationMemoryLoad != null && this.DestinationMemoryLoad.Equals(clusterDrsMigration.DestinationMemoryLoad))) && ((this.LinkedView == null && clusterDrsMigration.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDrsMigration.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDrsMigration)\n        {\n            return Equals(clusterDrsMigration as ClusterDrsMigration);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Time + \"_\" + Vm + \"_\" + CpuLoad + \"_\" + MemoryLoad + \"_\" + Source + \"_\" + SourceCpuLoad + \"_\" + SourceMemoryLoad + \"_\" + Destination + \"_\" + DestinationCpuLoad + \"_\" + DestinationMemoryLoad + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsMigration_LinkedView : IEquatable<ClusterDrsMigration_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public HostSystem Source { get; set; }\n\n        public HostSystem Destination { get; set; }\n\n        public bool Equals(ClusterDrsMigration_LinkedView clusterDrsMigration_LinkedView)\n        {\n            return (clusterDrsMigration_LinkedView != null && ((this.Vm == null && clusterDrsMigration_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterDrsMigration_LinkedView.Vm))) && ((this.Source == null && clusterDrsMigration_LinkedView.Source == null) || (this.Source != null && this.Source.Equals(clusterDrsMigration_LinkedView.Source))) && ((this.Destination == null && clusterDrsMigration_LinkedView.Destination == null) || (this.Destination != null && this.Destination.Equals(clusterDrsMigration_LinkedView.Destination))));\n        }\n\n        public override bool Equals(object clusterDrsMigration_LinkedView)\n        {\n            return Equals(clusterDrsMigration_LinkedView as ClusterDrsMigration_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Source + \"_\" + Destination).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsRecommendation : DynamicData, IEquatable<ClusterDrsRecommendation>\n    {\n        public string Key { get; set; }\n\n        public int Rating { get; set; }\n\n        public string Reason { get; set; }\n\n        public string ReasonText { get; set; }\n\n        public ClusterDrsMigration[] MigrationList { get; set; }\n\n        public bool Equals(ClusterDrsRecommendation clusterDrsRecommendation)\n        {\n            return (clusterDrsRecommendation != null && this.Key == clusterDrsRecommendation.Key && this.Rating == clusterDrsRecommendation.Rating && this.Reason == clusterDrsRecommendation.Reason && this.ReasonText == clusterDrsRecommendation.ReasonText && ((this.MigrationList == null && clusterDrsRecommendation.MigrationList == null) || (this.MigrationList != null && clusterDrsRecommendation.MigrationList != null && Enumerable.SequenceEqual(this.MigrationList, clusterDrsRecommendation.MigrationList))));\n        }\n\n        public override bool Equals(object clusterDrsRecommendation)\n        {\n            return Equals(clusterDrsRecommendation as ClusterDrsRecommendation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Rating + \"_\" + Reason + \"_\" + ReasonText + \"_\" + MigrationList).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsVmConfigInfo : DynamicData, IEquatable<ClusterDrsVmConfigInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public bool? Enabled { get; set; }\n\n        public DrsBehavior? Behavior { get; set; }\n\n        public ClusterDrsVmConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterDrsVmConfigInfo clusterDrsVmConfigInfo)\n        {\n            return (clusterDrsVmConfigInfo != null && ((this.Key == null && clusterDrsVmConfigInfo.Key == null) || (this.Key != null && this.Key.Equals(clusterDrsVmConfigInfo.Key))) && ((this.Enabled == null && clusterDrsVmConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterDrsVmConfigInfo.Enabled))) && ((this.Behavior == null && clusterDrsVmConfigInfo.Behavior == null) || (this.Behavior != null && this.Behavior.Equals(clusterDrsVmConfigInfo.Behavior))) && ((this.LinkedView == null && clusterDrsVmConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterDrsVmConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterDrsVmConfigInfo)\n        {\n            return Equals(clusterDrsVmConfigInfo as ClusterDrsVmConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Enabled + \"_\" + Behavior + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsVmConfigInfo_LinkedView : IEquatable<ClusterDrsVmConfigInfo_LinkedView>\n    {\n        public VirtualMachine Key { get; set; }\n\n        public bool Equals(ClusterDrsVmConfigInfo_LinkedView clusterDrsVmConfigInfo_LinkedView)\n        {\n            return (clusterDrsVmConfigInfo_LinkedView != null && ((this.Key == null && clusterDrsVmConfigInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(clusterDrsVmConfigInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object clusterDrsVmConfigInfo_LinkedView)\n        {\n            return Equals(clusterDrsVmConfigInfo_LinkedView as ClusterDrsVmConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class ClusterDrsVmConfigSpec : ArrayUpdateSpec, IEquatable<ClusterDrsVmConfigSpec>\n    {\n        public ClusterDrsVmConfigInfo Info { get; set; }\n\n        public bool Equals(ClusterDrsVmConfigSpec clusterDrsVmConfigSpec)\n        {\n            return (clusterDrsVmConfigSpec != null && ((this.Info == null && clusterDrsVmConfigSpec.Info == null) || (this.Info != null && this.Info.Equals(clusterDrsVmConfigSpec.Info))));\n        }\n\n        public override bool Equals(object clusterDrsVmConfigSpec)\n        {\n            return Equals(clusterDrsVmConfigSpec as ClusterDrsVmConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterEnterMaintenanceResult : DynamicData, IEquatable<ClusterEnterMaintenanceResult>\n    {\n        public ClusterRecommendation[] Recommendations { get; set; }\n\n        public ClusterDrsFaults Fault { get; set; }\n\n        public bool Equals(ClusterEnterMaintenanceResult clusterEnterMaintenanceResult)\n        {\n            return (clusterEnterMaintenanceResult != null && ((this.Recommendations == null && clusterEnterMaintenanceResult.Recommendations == null) || (this.Recommendations != null && clusterEnterMaintenanceResult.Recommendations != null && Enumerable.SequenceEqual(this.Recommendations, clusterEnterMaintenanceResult.Recommendations))) && ((this.Fault == null && clusterEnterMaintenanceResult.Fault == null) || (this.Fault != null && this.Fault.Equals(clusterEnterMaintenanceResult.Fault))));\n        }\n\n        public override bool Equals(object clusterEnterMaintenanceResult)\n        {\n            return Equals(clusterEnterMaintenanceResult as ClusterEnterMaintenanceResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Recommendations + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class ClusterEVCManager : ExtensibleManagedObject, IEquatable<ClusterEVCManager>\n    {\n        public ManagedObjectReference ManagedCluster { get; set; }\n\n        public ClusterEVCManagerEVCState EvcState { get; set; }\n\n        public ClusterEVCManager_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference ConfigureEvcMode_Task(string evcModeKey)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ConfigureEvcMode(string evcModeKey)\n        {\n        }\n\n        public ManagedObjectReference DisableEvcMode_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DisableEvcMode()\n        {\n        }\n\n        public ManagedObjectReference CheckConfigureEvcMode_Task(string evcModeKey)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterEVCManagerCheckResult[] CheckConfigureEvcMode(string evcModeKey)\n        {\n            return default(ClusterEVCManagerCheckResult[]);\n        }\n\n        public ManagedObjectReference CheckAddHostEvc_Task(HostConnectSpec cnxSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterEVCManagerCheckResult[] CheckAddHostEvc(HostConnectSpec cnxSpec)\n        {\n            return default(ClusterEVCManagerCheckResult[]);\n        }\n\n        public bool Equals(ClusterEVCManager clusterEVCManager)\n        {\n            return (clusterEVCManager != null && ((this.ManagedCluster == null && clusterEVCManager.ManagedCluster == null) || (this.ManagedCluster != null && this.ManagedCluster.Equals(clusterEVCManager.ManagedCluster))) && ((this.EvcState == null && clusterEVCManager.EvcState == null) || (this.EvcState != null && this.EvcState.Equals(clusterEVCManager.EvcState))) && ((this.LinkedView == null && clusterEVCManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterEVCManager.LinkedView))));\n        }\n\n        public override bool Equals(object clusterEVCManager)\n        {\n            return Equals(clusterEVCManager as ClusterEVCManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ManagedCluster + \"_\" + EvcState + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterEVCManager_LinkedView : IEquatable<ClusterEVCManager_LinkedView>\n    {\n        public ClusterComputeResource ManagedCluster { get; set; }\n\n        public bool Equals(ClusterEVCManager_LinkedView clusterEVCManager_LinkedView)\n        {\n            return (clusterEVCManager_LinkedView != null && ((this.ManagedCluster == null && clusterEVCManager_LinkedView.ManagedCluster == null) || (this.ManagedCluster != null && this.ManagedCluster.Equals(clusterEVCManager_LinkedView.ManagedCluster))));\n        }\n\n        public override bool Equals(object clusterEVCManager_LinkedView)\n        {\n            return Equals(clusterEVCManager_LinkedView as ClusterEVCManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ManagedCluster).GetHashCode();\n        }\n    }\n\n    public class ClusterEVCManagerCheckResult : DynamicData, IEquatable<ClusterEVCManagerCheckResult>\n    {\n        public string EvcModeKey { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public ClusterEVCManagerCheckResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterEVCManagerCheckResult clusterEVCManagerCheckResult)\n        {\n            return (clusterEVCManagerCheckResult != null && this.EvcModeKey == clusterEVCManagerCheckResult.EvcModeKey && ((this.Error == null && clusterEVCManagerCheckResult.Error == null) || (this.Error != null && this.Error.Equals(clusterEVCManagerCheckResult.Error))) && ((this.Host == null && clusterEVCManagerCheckResult.Host == null) || (this.Host != null && clusterEVCManagerCheckResult.Host != null && Enumerable.SequenceEqual(this.Host, clusterEVCManagerCheckResult.Host))) && ((this.LinkedView == null && clusterEVCManagerCheckResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterEVCManagerCheckResult.LinkedView))));\n        }\n\n        public override bool Equals(object clusterEVCManagerCheckResult)\n        {\n            return Equals(clusterEVCManagerCheckResult as ClusterEVCManagerCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EvcModeKey + \"_\" + Error + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterEVCManagerCheckResult_LinkedView : IEquatable<ClusterEVCManagerCheckResult_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(ClusterEVCManagerCheckResult_LinkedView clusterEVCManagerCheckResult_LinkedView)\n        {\n            return (clusterEVCManagerCheckResult_LinkedView != null && ((this.Host == null && clusterEVCManagerCheckResult_LinkedView.Host == null) || (this.Host != null && clusterEVCManagerCheckResult_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, clusterEVCManagerCheckResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterEVCManagerCheckResult_LinkedView)\n        {\n            return Equals(clusterEVCManagerCheckResult_LinkedView as ClusterEVCManagerCheckResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterEVCManagerEVCState : DynamicData, IEquatable<ClusterEVCManagerEVCState>\n    {\n        public EVCMode[] SupportedEVCMode { get; set; }\n\n        public string CurrentEVCModeKey { get; set; }\n\n        public HostCpuIdInfo[] GuaranteedCPUFeatures { get; set; }\n\n        public HostFeatureCapability[] FeatureCapability { get; set; }\n\n        public HostFeatureMask[] FeatureMask { get; set; }\n\n        public VirtualMachineFeatureRequirement[] FeatureRequirement { get; set; }\n\n        public bool Equals(ClusterEVCManagerEVCState clusterEVCManagerEVCState)\n        {\n            return (clusterEVCManagerEVCState != null && ((this.SupportedEVCMode == null && clusterEVCManagerEVCState.SupportedEVCMode == null) || (this.SupportedEVCMode != null && clusterEVCManagerEVCState.SupportedEVCMode != null && Enumerable.SequenceEqual(this.SupportedEVCMode, clusterEVCManagerEVCState.SupportedEVCMode))) && this.CurrentEVCModeKey == clusterEVCManagerEVCState.CurrentEVCModeKey && ((this.GuaranteedCPUFeatures == null && clusterEVCManagerEVCState.GuaranteedCPUFeatures == null) || (this.GuaranteedCPUFeatures != null && clusterEVCManagerEVCState.GuaranteedCPUFeatures != null && Enumerable.SequenceEqual(this.GuaranteedCPUFeatures, clusterEVCManagerEVCState.GuaranteedCPUFeatures))) && ((this.FeatureCapability == null && clusterEVCManagerEVCState.FeatureCapability == null) || (this.FeatureCapability != null && clusterEVCManagerEVCState.FeatureCapability != null && Enumerable.SequenceEqual(this.FeatureCapability, clusterEVCManagerEVCState.FeatureCapability))) && ((this.FeatureMask == null && clusterEVCManagerEVCState.FeatureMask == null) || (this.FeatureMask != null && clusterEVCManagerEVCState.FeatureMask != null && Enumerable.SequenceEqual(this.FeatureMask, clusterEVCManagerEVCState.FeatureMask))) && ((this.FeatureRequirement == null && clusterEVCManagerEVCState.FeatureRequirement == null) || (this.FeatureRequirement != null && clusterEVCManagerEVCState.FeatureRequirement != null && Enumerable.SequenceEqual(this.FeatureRequirement, clusterEVCManagerEVCState.FeatureRequirement))));\n        }\n\n        public override bool Equals(object clusterEVCManagerEVCState)\n        {\n            return Equals(clusterEVCManagerEVCState as ClusterEVCManagerEVCState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportedEVCMode + \"_\" + CurrentEVCModeKey + \"_\" + GuaranteedCPUFeatures + \"_\" + FeatureCapability + \"_\" + FeatureMask + \"_\" + FeatureRequirement).GetHashCode();\n        }\n    }\n\n    public class ClusterEvent : Event, IEquatable<ClusterEvent>\n    {\n        public bool Equals(ClusterEvent clusterEvent)\n        {\n            return (clusterEvent != null && base.Equals(clusterEvent));\n        }\n\n        public override bool Equals(object clusterEvent)\n        {\n            return Equals(clusterEvent as ClusterEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverHostAdmissionControlInfo : ClusterDasAdmissionControlInfo, IEquatable<ClusterFailoverHostAdmissionControlInfo>\n    {\n        public ClusterFailoverHostAdmissionControlInfoHostStatus[] HostStatus { get; set; }\n\n        public bool Equals(ClusterFailoverHostAdmissionControlInfo clusterFailoverHostAdmissionControlInfo)\n        {\n            return (clusterFailoverHostAdmissionControlInfo != null && ((this.HostStatus == null && clusterFailoverHostAdmissionControlInfo.HostStatus == null) || (this.HostStatus != null && clusterFailoverHostAdmissionControlInfo.HostStatus != null && Enumerable.SequenceEqual(this.HostStatus, clusterFailoverHostAdmissionControlInfo.HostStatus))));\n        }\n\n        public override bool Equals(object clusterFailoverHostAdmissionControlInfo)\n        {\n            return Equals(clusterFailoverHostAdmissionControlInfo as ClusterFailoverHostAdmissionControlInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostStatus).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverHostAdmissionControlInfoHostStatus : DynamicData, IEquatable<ClusterFailoverHostAdmissionControlInfoHostStatus>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public ManagedEntityStatus Status { get; set; }\n\n        public ClusterFailoverHostAdmissionControlInfoHostStatus_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterFailoverHostAdmissionControlInfoHostStatus clusterFailoverHostAdmissionControlInfoHostStatus)\n        {\n            return (clusterFailoverHostAdmissionControlInfoHostStatus != null && ((this.Host == null && clusterFailoverHostAdmissionControlInfoHostStatus.Host == null) || (this.Host != null && this.Host.Equals(clusterFailoverHostAdmissionControlInfoHostStatus.Host))) && this.Status == clusterFailoverHostAdmissionControlInfoHostStatus.Status && ((this.LinkedView == null && clusterFailoverHostAdmissionControlInfoHostStatus.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterFailoverHostAdmissionControlInfoHostStatus.LinkedView))));\n        }\n\n        public override bool Equals(object clusterFailoverHostAdmissionControlInfoHostStatus)\n        {\n            return Equals(clusterFailoverHostAdmissionControlInfoHostStatus as ClusterFailoverHostAdmissionControlInfoHostStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Status + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverHostAdmissionControlInfoHostStatus_LinkedView : IEquatable<ClusterFailoverHostAdmissionControlInfoHostStatus_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterFailoverHostAdmissionControlInfoHostStatus_LinkedView clusterFailoverHostAdmissionControlInfoHostStatus_LinkedView)\n        {\n            return (clusterFailoverHostAdmissionControlInfoHostStatus_LinkedView != null && ((this.Host == null && clusterFailoverHostAdmissionControlInfoHostStatus_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterFailoverHostAdmissionControlInfoHostStatus_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterFailoverHostAdmissionControlInfoHostStatus_LinkedView)\n        {\n            return Equals(clusterFailoverHostAdmissionControlInfoHostStatus_LinkedView as ClusterFailoverHostAdmissionControlInfoHostStatus_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverHostAdmissionControlPolicy : ClusterDasAdmissionControlPolicy, IEquatable<ClusterFailoverHostAdmissionControlPolicy>\n    {\n        public ManagedObjectReference[] FailoverHosts { get; set; }\n\n        public int? FailoverLevel { get; set; }\n\n        public ClusterFailoverHostAdmissionControlPolicy_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterFailoverHostAdmissionControlPolicy clusterFailoverHostAdmissionControlPolicy)\n        {\n            return (clusterFailoverHostAdmissionControlPolicy != null && ((this.FailoverHosts == null && clusterFailoverHostAdmissionControlPolicy.FailoverHosts == null) || (this.FailoverHosts != null && clusterFailoverHostAdmissionControlPolicy.FailoverHosts != null && Enumerable.SequenceEqual(this.FailoverHosts, clusterFailoverHostAdmissionControlPolicy.FailoverHosts))) && ((this.FailoverLevel == null && clusterFailoverHostAdmissionControlPolicy.FailoverLevel == null) || (this.FailoverLevel != null && this.FailoverLevel.Equals(clusterFailoverHostAdmissionControlPolicy.FailoverLevel))) && ((this.LinkedView == null && clusterFailoverHostAdmissionControlPolicy.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterFailoverHostAdmissionControlPolicy.LinkedView))));\n        }\n\n        public override bool Equals(object clusterFailoverHostAdmissionControlPolicy)\n        {\n            return Equals(clusterFailoverHostAdmissionControlPolicy as ClusterFailoverHostAdmissionControlPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailoverHosts + \"_\" + FailoverLevel + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverHostAdmissionControlPolicy_LinkedView : IEquatable<ClusterFailoverHostAdmissionControlPolicy_LinkedView>\n    {\n        public HostSystem[] FailoverHosts { get; set; }\n\n        public bool Equals(ClusterFailoverHostAdmissionControlPolicy_LinkedView clusterFailoverHostAdmissionControlPolicy_LinkedView)\n        {\n            return (clusterFailoverHostAdmissionControlPolicy_LinkedView != null && ((this.FailoverHosts == null && clusterFailoverHostAdmissionControlPolicy_LinkedView.FailoverHosts == null) || (this.FailoverHosts != null && clusterFailoverHostAdmissionControlPolicy_LinkedView.FailoverHosts != null && Enumerable.SequenceEqual(this.FailoverHosts, clusterFailoverHostAdmissionControlPolicy_LinkedView.FailoverHosts))));\n        }\n\n        public override bool Equals(object clusterFailoverHostAdmissionControlPolicy_LinkedView)\n        {\n            return Equals(clusterFailoverHostAdmissionControlPolicy_LinkedView as ClusterFailoverHostAdmissionControlPolicy_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailoverHosts).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverLevelAdmissionControlInfo : ClusterDasAdmissionControlInfo, IEquatable<ClusterFailoverLevelAdmissionControlInfo>\n    {\n        public int CurrentFailoverLevel { get; set; }\n\n        public bool Equals(ClusterFailoverLevelAdmissionControlInfo clusterFailoverLevelAdmissionControlInfo)\n        {\n            return (clusterFailoverLevelAdmissionControlInfo != null && this.CurrentFailoverLevel == clusterFailoverLevelAdmissionControlInfo.CurrentFailoverLevel);\n        }\n\n        public override bool Equals(object clusterFailoverLevelAdmissionControlInfo)\n        {\n            return Equals(clusterFailoverLevelAdmissionControlInfo as ClusterFailoverLevelAdmissionControlInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentFailoverLevel).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverLevelAdmissionControlPolicy : ClusterDasAdmissionControlPolicy, IEquatable<ClusterFailoverLevelAdmissionControlPolicy>\n    {\n        public int FailoverLevel { get; set; }\n\n        public ClusterSlotPolicy SlotPolicy { get; set; }\n\n        public bool Equals(ClusterFailoverLevelAdmissionControlPolicy clusterFailoverLevelAdmissionControlPolicy)\n        {\n            return (clusterFailoverLevelAdmissionControlPolicy != null && this.FailoverLevel == clusterFailoverLevelAdmissionControlPolicy.FailoverLevel && ((this.SlotPolicy == null && clusterFailoverLevelAdmissionControlPolicy.SlotPolicy == null) || (this.SlotPolicy != null && this.SlotPolicy.Equals(clusterFailoverLevelAdmissionControlPolicy.SlotPolicy))));\n        }\n\n        public override bool Equals(object clusterFailoverLevelAdmissionControlPolicy)\n        {\n            return Equals(clusterFailoverLevelAdmissionControlPolicy as ClusterFailoverLevelAdmissionControlPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailoverLevel + \"_\" + SlotPolicy).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverResourcesAdmissionControlInfo : ClusterDasAdmissionControlInfo, IEquatable<ClusterFailoverResourcesAdmissionControlInfo>\n    {\n        public int CurrentCpuFailoverResourcesPercent { get; set; }\n\n        public int CurrentMemoryFailoverResourcesPercent { get; set; }\n\n        public bool Equals(ClusterFailoverResourcesAdmissionControlInfo clusterFailoverResourcesAdmissionControlInfo)\n        {\n            return (clusterFailoverResourcesAdmissionControlInfo != null && this.CurrentCpuFailoverResourcesPercent == clusterFailoverResourcesAdmissionControlInfo.CurrentCpuFailoverResourcesPercent && this.CurrentMemoryFailoverResourcesPercent == clusterFailoverResourcesAdmissionControlInfo.CurrentMemoryFailoverResourcesPercent);\n        }\n\n        public override bool Equals(object clusterFailoverResourcesAdmissionControlInfo)\n        {\n            return Equals(clusterFailoverResourcesAdmissionControlInfo as ClusterFailoverResourcesAdmissionControlInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentCpuFailoverResourcesPercent + \"_\" + CurrentMemoryFailoverResourcesPercent).GetHashCode();\n        }\n    }\n\n    public class ClusterFailoverResourcesAdmissionControlPolicy : ClusterDasAdmissionControlPolicy, IEquatable<ClusterFailoverResourcesAdmissionControlPolicy>\n    {\n        public int CpuFailoverResourcesPercent { get; set; }\n\n        public int MemoryFailoverResourcesPercent { get; set; }\n\n        public int? FailoverLevel { get; set; }\n\n        public bool? AutoComputePercentages { get; set; }\n\n        public bool Equals(ClusterFailoverResourcesAdmissionControlPolicy clusterFailoverResourcesAdmissionControlPolicy)\n        {\n            return (clusterFailoverResourcesAdmissionControlPolicy != null && this.CpuFailoverResourcesPercent == clusterFailoverResourcesAdmissionControlPolicy.CpuFailoverResourcesPercent && this.MemoryFailoverResourcesPercent == clusterFailoverResourcesAdmissionControlPolicy.MemoryFailoverResourcesPercent && ((this.FailoverLevel == null && clusterFailoverResourcesAdmissionControlPolicy.FailoverLevel == null) || (this.FailoverLevel != null && this.FailoverLevel.Equals(clusterFailoverResourcesAdmissionControlPolicy.FailoverLevel))) && ((this.AutoComputePercentages == null && clusterFailoverResourcesAdmissionControlPolicy.AutoComputePercentages == null) || (this.AutoComputePercentages != null && this.AutoComputePercentages.Equals(clusterFailoverResourcesAdmissionControlPolicy.AutoComputePercentages))));\n        }\n\n        public override bool Equals(object clusterFailoverResourcesAdmissionControlPolicy)\n        {\n            return Equals(clusterFailoverResourcesAdmissionControlPolicy as ClusterFailoverResourcesAdmissionControlPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CpuFailoverResourcesPercent + \"_\" + MemoryFailoverResourcesPercent + \"_\" + FailoverLevel + \"_\" + AutoComputePercentages).GetHashCode();\n        }\n    }\n\n    public class ClusterFixedSizeSlotPolicy : ClusterSlotPolicy, IEquatable<ClusterFixedSizeSlotPolicy>\n    {\n        public int Cpu { get; set; }\n\n        public int Memory { get; set; }\n\n        public bool Equals(ClusterFixedSizeSlotPolicy clusterFixedSizeSlotPolicy)\n        {\n            return (clusterFixedSizeSlotPolicy != null && this.Cpu == clusterFixedSizeSlotPolicy.Cpu && this.Memory == clusterFixedSizeSlotPolicy.Memory);\n        }\n\n        public override bool Equals(object clusterFixedSizeSlotPolicy)\n        {\n            return Equals(clusterFixedSizeSlotPolicy as ClusterFixedSizeSlotPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Cpu + \"_\" + Memory).GetHashCode();\n        }\n    }\n\n    public class ClusterGroupInfo : DynamicData, IEquatable<ClusterGroupInfo>\n    {\n        public string Name { get; set; }\n\n        public bool? UserCreated { get; set; }\n\n        public string UniqueID { get; set; }\n\n        public bool Equals(ClusterGroupInfo clusterGroupInfo)\n        {\n            return (clusterGroupInfo != null && this.Name == clusterGroupInfo.Name && ((this.UserCreated == null && clusterGroupInfo.UserCreated == null) || (this.UserCreated != null && this.UserCreated.Equals(clusterGroupInfo.UserCreated))) && this.UniqueID == clusterGroupInfo.UniqueID);\n        }\n\n        public override bool Equals(object clusterGroupInfo)\n        {\n            return Equals(clusterGroupInfo as ClusterGroupInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + UserCreated + \"_\" + UniqueID).GetHashCode();\n        }\n    }\n\n    public class ClusterGroupSpec : ArrayUpdateSpec, IEquatable<ClusterGroupSpec>\n    {\n        public ClusterGroupInfo Info { get; set; }\n\n        public bool Equals(ClusterGroupSpec clusterGroupSpec)\n        {\n            return (clusterGroupSpec != null && ((this.Info == null && clusterGroupSpec.Info == null) || (this.Info != null && this.Info.Equals(clusterGroupSpec.Info))));\n        }\n\n        public override bool Equals(object clusterGroupSpec)\n        {\n            return Equals(clusterGroupSpec as ClusterGroupSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterHostGroup : ClusterGroupInfo, IEquatable<ClusterHostGroup>\n    {\n        public ManagedObjectReference[] Host { get; set; }\n\n        public ClusterHostGroup_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterHostGroup clusterHostGroup)\n        {\n            return (clusterHostGroup != null && ((this.Host == null && clusterHostGroup.Host == null) || (this.Host != null && clusterHostGroup.Host != null && Enumerable.SequenceEqual(this.Host, clusterHostGroup.Host))) && ((this.LinkedView == null && clusterHostGroup.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterHostGroup.LinkedView))));\n        }\n\n        public override bool Equals(object clusterHostGroup)\n        {\n            return Equals(clusterHostGroup as ClusterHostGroup);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterHostGroup_LinkedView : IEquatable<ClusterHostGroup_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(ClusterHostGroup_LinkedView clusterHostGroup_LinkedView)\n        {\n            return (clusterHostGroup_LinkedView != null && ((this.Host == null && clusterHostGroup_LinkedView.Host == null) || (this.Host != null && clusterHostGroup_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, clusterHostGroup_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterHostGroup_LinkedView)\n        {\n            return Equals(clusterHostGroup_LinkedView as ClusterHostGroup_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterHostInfraUpdateHaModeAction : ClusterAction, IEquatable<ClusterHostInfraUpdateHaModeAction>\n    {\n        public string OperationType { get; set; }\n\n        public bool Equals(ClusterHostInfraUpdateHaModeAction clusterHostInfraUpdateHaModeAction)\n        {\n            return (clusterHostInfraUpdateHaModeAction != null && this.OperationType == clusterHostInfraUpdateHaModeAction.OperationType);\n        }\n\n        public override bool Equals(object clusterHostInfraUpdateHaModeAction)\n        {\n            return Equals(clusterHostInfraUpdateHaModeAction as ClusterHostInfraUpdateHaModeAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OperationType).GetHashCode();\n        }\n    }\n\n    public class ClusterHostPowerAction : ClusterAction, IEquatable<ClusterHostPowerAction>\n    {\n        public HostPowerOperationType OperationType { get; set; }\n\n        public int? PowerConsumptionWatt { get; set; }\n\n        public int? CpuCapacityMHz { get; set; }\n\n        public int? MemCapacityMB { get; set; }\n\n        public bool Equals(ClusterHostPowerAction clusterHostPowerAction)\n        {\n            return (clusterHostPowerAction != null && this.OperationType == clusterHostPowerAction.OperationType && ((this.PowerConsumptionWatt == null && clusterHostPowerAction.PowerConsumptionWatt == null) || (this.PowerConsumptionWatt != null && this.PowerConsumptionWatt.Equals(clusterHostPowerAction.PowerConsumptionWatt))) && ((this.CpuCapacityMHz == null && clusterHostPowerAction.CpuCapacityMHz == null) || (this.CpuCapacityMHz != null && this.CpuCapacityMHz.Equals(clusterHostPowerAction.CpuCapacityMHz))) && ((this.MemCapacityMB == null && clusterHostPowerAction.MemCapacityMB == null) || (this.MemCapacityMB != null && this.MemCapacityMB.Equals(clusterHostPowerAction.MemCapacityMB))));\n        }\n\n        public override bool Equals(object clusterHostPowerAction)\n        {\n            return Equals(clusterHostPowerAction as ClusterHostPowerAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OperationType + \"_\" + PowerConsumptionWatt + \"_\" + CpuCapacityMHz + \"_\" + MemCapacityMB).GetHashCode();\n        }\n    }\n\n    public class ClusterHostRecommendation : DynamicData, IEquatable<ClusterHostRecommendation>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public int Rating { get; set; }\n\n        public ClusterHostRecommendation_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterHostRecommendation clusterHostRecommendation)\n        {\n            return (clusterHostRecommendation != null && ((this.Host == null && clusterHostRecommendation.Host == null) || (this.Host != null && this.Host.Equals(clusterHostRecommendation.Host))) && this.Rating == clusterHostRecommendation.Rating && ((this.LinkedView == null && clusterHostRecommendation.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterHostRecommendation.LinkedView))));\n        }\n\n        public override bool Equals(object clusterHostRecommendation)\n        {\n            return Equals(clusterHostRecommendation as ClusterHostRecommendation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Rating + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterHostRecommendation_LinkedView : IEquatable<ClusterHostRecommendation_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ClusterHostRecommendation_LinkedView clusterHostRecommendation_LinkedView)\n        {\n            return (clusterHostRecommendation_LinkedView != null && ((this.Host == null && clusterHostRecommendation_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(clusterHostRecommendation_LinkedView.Host))));\n        }\n\n        public override bool Equals(object clusterHostRecommendation_LinkedView)\n        {\n            return Equals(clusterHostRecommendation_LinkedView as ClusterHostRecommendation_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ClusterInfraUpdateHaConfigInfo : DynamicData, IEquatable<ClusterInfraUpdateHaConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public string Behavior { get; set; }\n\n        public string ModerateRemediation { get; set; }\n\n        public string SevereRemediation { get; set; }\n\n        public string[] Providers { get; set; }\n\n        public bool Equals(ClusterInfraUpdateHaConfigInfo clusterInfraUpdateHaConfigInfo)\n        {\n            return (clusterInfraUpdateHaConfigInfo != null && ((this.Enabled == null && clusterInfraUpdateHaConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterInfraUpdateHaConfigInfo.Enabled))) && this.Behavior == clusterInfraUpdateHaConfigInfo.Behavior && this.ModerateRemediation == clusterInfraUpdateHaConfigInfo.ModerateRemediation && this.SevereRemediation == clusterInfraUpdateHaConfigInfo.SevereRemediation && ((this.Providers == null && clusterInfraUpdateHaConfigInfo.Providers == null) || (this.Providers != null && clusterInfraUpdateHaConfigInfo.Providers != null && Enumerable.SequenceEqual(this.Providers, clusterInfraUpdateHaConfigInfo.Providers))));\n        }\n\n        public override bool Equals(object clusterInfraUpdateHaConfigInfo)\n        {\n            return Equals(clusterInfraUpdateHaConfigInfo as ClusterInfraUpdateHaConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + Behavior + \"_\" + ModerateRemediation + \"_\" + SevereRemediation + \"_\" + Providers).GetHashCode();\n        }\n    }\n\n    public class ClusterInitialPlacementAction : ClusterAction, IEquatable<ClusterInitialPlacementAction>\n    {\n        public ManagedObjectReference TargetHost { get; set; }\n\n        public ManagedObjectReference Pool { get; set; }\n\n        public ClusterInitialPlacementAction_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterInitialPlacementAction clusterInitialPlacementAction)\n        {\n            return (clusterInitialPlacementAction != null && ((this.TargetHost == null && clusterInitialPlacementAction.TargetHost == null) || (this.TargetHost != null && this.TargetHost.Equals(clusterInitialPlacementAction.TargetHost))) && ((this.Pool == null && clusterInitialPlacementAction.Pool == null) || (this.Pool != null && this.Pool.Equals(clusterInitialPlacementAction.Pool))) && ((this.LinkedView == null && clusterInitialPlacementAction.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterInitialPlacementAction.LinkedView))));\n        }\n\n        public override bool Equals(object clusterInitialPlacementAction)\n        {\n            return Equals(clusterInitialPlacementAction as ClusterInitialPlacementAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TargetHost + \"_\" + Pool + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterInitialPlacementAction_LinkedView : IEquatable<ClusterInitialPlacementAction_LinkedView>\n    {\n        public HostSystem TargetHost { get; set; }\n\n        public ResourcePool Pool { get; set; }\n\n        public bool Equals(ClusterInitialPlacementAction_LinkedView clusterInitialPlacementAction_LinkedView)\n        {\n            return (clusterInitialPlacementAction_LinkedView != null && ((this.TargetHost == null && clusterInitialPlacementAction_LinkedView.TargetHost == null) || (this.TargetHost != null && this.TargetHost.Equals(clusterInitialPlacementAction_LinkedView.TargetHost))) && ((this.Pool == null && clusterInitialPlacementAction_LinkedView.Pool == null) || (this.Pool != null && this.Pool.Equals(clusterInitialPlacementAction_LinkedView.Pool))));\n        }\n\n        public override bool Equals(object clusterInitialPlacementAction_LinkedView)\n        {\n            return Equals(clusterInitialPlacementAction_LinkedView as ClusterInitialPlacementAction_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TargetHost + \"_\" + Pool).GetHashCode();\n        }\n    }\n\n    public class ClusterIoFilterInfo : IoFilterInfo, IEquatable<ClusterIoFilterInfo>\n    {\n        public string OpType { get; set; }\n\n        public string VibUrl { get; set; }\n\n        public bool Equals(ClusterIoFilterInfo clusterIoFilterInfo)\n        {\n            return (clusterIoFilterInfo != null && this.OpType == clusterIoFilterInfo.OpType && this.VibUrl == clusterIoFilterInfo.VibUrl);\n        }\n\n        public override bool Equals(object clusterIoFilterInfo)\n        {\n            return Equals(clusterIoFilterInfo as ClusterIoFilterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OpType + \"_\" + VibUrl).GetHashCode();\n        }\n    }\n\n    public class ClusterMigrationAction : ClusterAction, IEquatable<ClusterMigrationAction>\n    {\n        public ClusterDrsMigration DrsMigration { get; set; }\n\n        public bool Equals(ClusterMigrationAction clusterMigrationAction)\n        {\n            return (clusterMigrationAction != null && ((this.DrsMigration == null && clusterMigrationAction.DrsMigration == null) || (this.DrsMigration != null && this.DrsMigration.Equals(clusterMigrationAction.DrsMigration))));\n        }\n\n        public override bool Equals(object clusterMigrationAction)\n        {\n            return Equals(clusterMigrationAction as ClusterMigrationAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DrsMigration).GetHashCode();\n        }\n    }\n\n    public class ClusterNetworkConfigSpec : DynamicData, IEquatable<ClusterNetworkConfigSpec>\n    {\n        public ManagedObjectReference NetworkPortGroup { get; set; }\n\n        public CustomizationIPSettings IpSettings { get; set; }\n\n        public ClusterNetworkConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterNetworkConfigSpec clusterNetworkConfigSpec)\n        {\n            return (clusterNetworkConfigSpec != null && ((this.NetworkPortGroup == null && clusterNetworkConfigSpec.NetworkPortGroup == null) || (this.NetworkPortGroup != null && this.NetworkPortGroup.Equals(clusterNetworkConfigSpec.NetworkPortGroup))) && ((this.IpSettings == null && clusterNetworkConfigSpec.IpSettings == null) || (this.IpSettings != null && this.IpSettings.Equals(clusterNetworkConfigSpec.IpSettings))) && ((this.LinkedView == null && clusterNetworkConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterNetworkConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object clusterNetworkConfigSpec)\n        {\n            return Equals(clusterNetworkConfigSpec as ClusterNetworkConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetworkPortGroup + \"_\" + IpSettings + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterNetworkConfigSpec_LinkedView : IEquatable<ClusterNetworkConfigSpec_LinkedView>\n    {\n        public Network NetworkPortGroup { get; set; }\n\n        public bool Equals(ClusterNetworkConfigSpec_LinkedView clusterNetworkConfigSpec_LinkedView)\n        {\n            return (clusterNetworkConfigSpec_LinkedView != null && ((this.NetworkPortGroup == null && clusterNetworkConfigSpec_LinkedView.NetworkPortGroup == null) || (this.NetworkPortGroup != null && this.NetworkPortGroup.Equals(clusterNetworkConfigSpec_LinkedView.NetworkPortGroup))));\n        }\n\n        public override bool Equals(object clusterNetworkConfigSpec_LinkedView)\n        {\n            return Equals(clusterNetworkConfigSpec_LinkedView as ClusterNetworkConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetworkPortGroup).GetHashCode();\n        }\n    }\n\n    public class ClusterNotAttemptedVmInfo : DynamicData, IEquatable<ClusterNotAttemptedVmInfo>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public ClusterNotAttemptedVmInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterNotAttemptedVmInfo clusterNotAttemptedVmInfo)\n        {\n            return (clusterNotAttemptedVmInfo != null && ((this.Vm == null && clusterNotAttemptedVmInfo.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterNotAttemptedVmInfo.Vm))) && ((this.Fault == null && clusterNotAttemptedVmInfo.Fault == null) || (this.Fault != null && this.Fault.Equals(clusterNotAttemptedVmInfo.Fault))) && ((this.LinkedView == null && clusterNotAttemptedVmInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterNotAttemptedVmInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterNotAttemptedVmInfo)\n        {\n            return Equals(clusterNotAttemptedVmInfo as ClusterNotAttemptedVmInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterNotAttemptedVmInfo_LinkedView : IEquatable<ClusterNotAttemptedVmInfo_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(ClusterNotAttemptedVmInfo_LinkedView clusterNotAttemptedVmInfo_LinkedView)\n        {\n            return (clusterNotAttemptedVmInfo_LinkedView != null && ((this.Vm == null && clusterNotAttemptedVmInfo_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterNotAttemptedVmInfo_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterNotAttemptedVmInfo_LinkedView)\n        {\n            return Equals(clusterNotAttemptedVmInfo_LinkedView as ClusterNotAttemptedVmInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterOrchestrationInfo : DynamicData, IEquatable<ClusterOrchestrationInfo>\n    {\n        public ClusterVmReadiness DefaultVmReadiness { get; set; }\n\n        public bool Equals(ClusterOrchestrationInfo clusterOrchestrationInfo)\n        {\n            return (clusterOrchestrationInfo != null && ((this.DefaultVmReadiness == null && clusterOrchestrationInfo.DefaultVmReadiness == null) || (this.DefaultVmReadiness != null && this.DefaultVmReadiness.Equals(clusterOrchestrationInfo.DefaultVmReadiness))));\n        }\n\n        public override bool Equals(object clusterOrchestrationInfo)\n        {\n            return Equals(clusterOrchestrationInfo as ClusterOrchestrationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultVmReadiness).GetHashCode();\n        }\n    }\n\n    public class ClusterOvercommittedEvent : ClusterEvent, IEquatable<ClusterOvercommittedEvent>\n    {\n        public bool Equals(ClusterOvercommittedEvent clusterOvercommittedEvent)\n        {\n            return (clusterOvercommittedEvent != null && base.Equals(clusterOvercommittedEvent));\n        }\n\n        public override bool Equals(object clusterOvercommittedEvent)\n        {\n            return Equals(clusterOvercommittedEvent as ClusterOvercommittedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterPowerOnVmResult : DynamicData, IEquatable<ClusterPowerOnVmResult>\n    {\n        public ClusterAttemptedVmInfo[] Attempted { get; set; }\n\n        public ClusterNotAttemptedVmInfo[] NotAttempted { get; set; }\n\n        public ClusterRecommendation[] Recommendations { get; set; }\n\n        public bool Equals(ClusterPowerOnVmResult clusterPowerOnVmResult)\n        {\n            return (clusterPowerOnVmResult != null && ((this.Attempted == null && clusterPowerOnVmResult.Attempted == null) || (this.Attempted != null && clusterPowerOnVmResult.Attempted != null && Enumerable.SequenceEqual(this.Attempted, clusterPowerOnVmResult.Attempted))) && ((this.NotAttempted == null && clusterPowerOnVmResult.NotAttempted == null) || (this.NotAttempted != null && clusterPowerOnVmResult.NotAttempted != null && Enumerable.SequenceEqual(this.NotAttempted, clusterPowerOnVmResult.NotAttempted))) && ((this.Recommendations == null && clusterPowerOnVmResult.Recommendations == null) || (this.Recommendations != null && clusterPowerOnVmResult.Recommendations != null && Enumerable.SequenceEqual(this.Recommendations, clusterPowerOnVmResult.Recommendations))));\n        }\n\n        public override bool Equals(object clusterPowerOnVmResult)\n        {\n            return Equals(clusterPowerOnVmResult as ClusterPowerOnVmResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Attempted + \"_\" + NotAttempted + \"_\" + Recommendations).GetHashCode();\n        }\n    }\n\n    public class ClusterProactiveDrsConfigInfo : DynamicData, IEquatable<ClusterProactiveDrsConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public bool Equals(ClusterProactiveDrsConfigInfo clusterProactiveDrsConfigInfo)\n        {\n            return (clusterProactiveDrsConfigInfo != null && ((this.Enabled == null && clusterProactiveDrsConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterProactiveDrsConfigInfo.Enabled))));\n        }\n\n        public override bool Equals(object clusterProactiveDrsConfigInfo)\n        {\n            return Equals(clusterProactiveDrsConfigInfo as ClusterProactiveDrsConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled).GetHashCode();\n        }\n    }\n\n    public class ClusterProfile : Profile, IEquatable<ClusterProfile>\n    {\n        public new ClusterProfile_LinkedView LinkedView { get; set; }\n\n        public void UpdateClusterProfile(ClusterProfileConfigSpec config)\n        {\n        }\n\n        public bool Equals(ClusterProfile clusterProfile)\n        {\n            return (clusterProfile != null && ((this.LinkedView == null && clusterProfile.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterProfile.LinkedView))));\n        }\n\n        public override bool Equals(object clusterProfile)\n        {\n            return Equals(clusterProfile as ClusterProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterProfile_LinkedView : Profile_LinkedView, IEquatable<ClusterProfile_LinkedView>\n    {\n        public bool Equals(ClusterProfile_LinkedView clusterProfile_LinkedView)\n        {\n            return (clusterProfile_LinkedView != null && base.Equals(clusterProfile_LinkedView));\n        }\n\n        public override bool Equals(object clusterProfile_LinkedView)\n        {\n            return Equals(clusterProfile_LinkedView as ClusterProfile_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterProfileCompleteConfigSpec : ClusterProfileConfigSpec, IEquatable<ClusterProfileCompleteConfigSpec>\n    {\n        public ComplianceProfile ComplyProfile { get; set; }\n\n        public bool Equals(ClusterProfileCompleteConfigSpec clusterProfileCompleteConfigSpec)\n        {\n            return (clusterProfileCompleteConfigSpec != null && ((this.ComplyProfile == null && clusterProfileCompleteConfigSpec.ComplyProfile == null) || (this.ComplyProfile != null && this.ComplyProfile.Equals(clusterProfileCompleteConfigSpec.ComplyProfile))));\n        }\n\n        public override bool Equals(object clusterProfileCompleteConfigSpec)\n        {\n            return Equals(clusterProfileCompleteConfigSpec as ClusterProfileCompleteConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComplyProfile).GetHashCode();\n        }\n    }\n\n    public class ClusterProfileConfigInfo : ProfileConfigInfo, IEquatable<ClusterProfileConfigInfo>\n    {\n        public ComplianceProfile ComplyProfile { get; set; }\n\n        public bool Equals(ClusterProfileConfigInfo clusterProfileConfigInfo)\n        {\n            return (clusterProfileConfigInfo != null && ((this.ComplyProfile == null && clusterProfileConfigInfo.ComplyProfile == null) || (this.ComplyProfile != null && this.ComplyProfile.Equals(clusterProfileConfigInfo.ComplyProfile))));\n        }\n\n        public override bool Equals(object clusterProfileConfigInfo)\n        {\n            return Equals(clusterProfileConfigInfo as ClusterProfileConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComplyProfile).GetHashCode();\n        }\n    }\n\n    public class ClusterProfileConfigServiceCreateSpec : ClusterProfileConfigSpec, IEquatable<ClusterProfileConfigServiceCreateSpec>\n    {\n        public string[] ServiceType { get; set; }\n\n        public bool Equals(ClusterProfileConfigServiceCreateSpec clusterProfileConfigServiceCreateSpec)\n        {\n            return (clusterProfileConfigServiceCreateSpec != null && ((this.ServiceType == null && clusterProfileConfigServiceCreateSpec.ServiceType == null) || (this.ServiceType != null && clusterProfileConfigServiceCreateSpec.ServiceType != null && Enumerable.SequenceEqual(this.ServiceType, clusterProfileConfigServiceCreateSpec.ServiceType))));\n        }\n\n        public override bool Equals(object clusterProfileConfigServiceCreateSpec)\n        {\n            return Equals(clusterProfileConfigServiceCreateSpec as ClusterProfileConfigServiceCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceType).GetHashCode();\n        }\n    }\n\n    public class ClusterProfileConfigSpec : ClusterProfileCreateSpec, IEquatable<ClusterProfileConfigSpec>\n    {\n        public bool Equals(ClusterProfileConfigSpec clusterProfileConfigSpec)\n        {\n            return (clusterProfileConfigSpec != null && base.Equals(clusterProfileConfigSpec));\n        }\n\n        public override bool Equals(object clusterProfileConfigSpec)\n        {\n            return Equals(clusterProfileConfigSpec as ClusterProfileConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterProfileCreateSpec : ProfileCreateSpec, IEquatable<ClusterProfileCreateSpec>\n    {\n        public bool Equals(ClusterProfileCreateSpec clusterProfileCreateSpec)\n        {\n            return (clusterProfileCreateSpec != null && base.Equals(clusterProfileCreateSpec));\n        }\n\n        public override bool Equals(object clusterProfileCreateSpec)\n        {\n            return Equals(clusterProfileCreateSpec as ClusterProfileCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterProfileManager : ProfileManager, IEquatable<ClusterProfileManager>\n    {\n        public new ClusterProfileManager_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterProfileManager clusterProfileManager)\n        {\n            return (clusterProfileManager != null && ((this.LinkedView == null && clusterProfileManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterProfileManager.LinkedView))));\n        }\n\n        public override bool Equals(object clusterProfileManager)\n        {\n            return Equals(clusterProfileManager as ClusterProfileManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterProfileManager_LinkedView : ProfileManager_LinkedView, IEquatable<ClusterProfileManager_LinkedView>\n    {\n        public bool Equals(ClusterProfileManager_LinkedView clusterProfileManager_LinkedView)\n        {\n            return (clusterProfileManager_LinkedView != null && base.Equals(clusterProfileManager_LinkedView));\n        }\n\n        public override bool Equals(object clusterProfileManager_LinkedView)\n        {\n            return Equals(clusterProfileManager_LinkedView as ClusterProfileManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterRecommendation : DynamicData, IEquatable<ClusterRecommendation>\n    {\n        public string Key { get; set; }\n\n        public string Type { get; set; }\n\n        public DateTime Time { get; set; }\n\n        public int Rating { get; set; }\n\n        public string Reason { get; set; }\n\n        public string ReasonText { get; set; }\n\n        public string WarningText { get; set; }\n\n        public LocalizableMessage WarningDetails { get; set; }\n\n        public string[] Prerequisite { get; set; }\n\n        public ClusterAction[] Action { get; set; }\n\n        public ManagedObjectReference Target { get; set; }\n\n        public bool Equals(ClusterRecommendation clusterRecommendation)\n        {\n            return (clusterRecommendation != null && this.Key == clusterRecommendation.Key && this.Type == clusterRecommendation.Type && this.Time == clusterRecommendation.Time && this.Rating == clusterRecommendation.Rating && this.Reason == clusterRecommendation.Reason && this.ReasonText == clusterRecommendation.ReasonText && this.WarningText == clusterRecommendation.WarningText && ((this.WarningDetails == null && clusterRecommendation.WarningDetails == null) || (this.WarningDetails != null && this.WarningDetails.Equals(clusterRecommendation.WarningDetails))) && ((this.Prerequisite == null && clusterRecommendation.Prerequisite == null) || (this.Prerequisite != null && clusterRecommendation.Prerequisite != null && Enumerable.SequenceEqual(this.Prerequisite, clusterRecommendation.Prerequisite))) && ((this.Action == null && clusterRecommendation.Action == null) || (this.Action != null && clusterRecommendation.Action != null && Enumerable.SequenceEqual(this.Action, clusterRecommendation.Action))) && ((this.Target == null && clusterRecommendation.Target == null) || (this.Target != null && this.Target.Equals(clusterRecommendation.Target))));\n        }\n\n        public override bool Equals(object clusterRecommendation)\n        {\n            return Equals(clusterRecommendation as ClusterRecommendation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Type + \"_\" + Time + \"_\" + Rating + \"_\" + Reason + \"_\" + ReasonText + \"_\" + WarningText + \"_\" + WarningDetails + \"_\" + Prerequisite + \"_\" + Action + \"_\" + Target).GetHashCode();\n        }\n    }\n\n    public class ClusterReconfiguredEvent : ClusterEvent, IEquatable<ClusterReconfiguredEvent>\n    {\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(ClusterReconfiguredEvent clusterReconfiguredEvent)\n        {\n            return (clusterReconfiguredEvent != null && ((this.ConfigChanges == null && clusterReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(clusterReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object clusterReconfiguredEvent)\n        {\n            return Equals(clusterReconfiguredEvent as ClusterReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class ClusterResourceUsageSummary : DynamicData, IEquatable<ClusterResourceUsageSummary>\n    {\n        public int CpuUsedMHz { get; set; }\n\n        public int CpuCapacityMHz { get; set; }\n\n        public int MemUsedMB { get; set; }\n\n        public int MemCapacityMB { get; set; }\n\n        public long? PMemAvailableMB { get; set; }\n\n        public long? PMemCapacityMB { get; set; }\n\n        public long StorageUsedMB { get; set; }\n\n        public long StorageCapacityMB { get; set; }\n\n        public bool Equals(ClusterResourceUsageSummary clusterResourceUsageSummary)\n        {\n            return (clusterResourceUsageSummary != null && this.CpuUsedMHz == clusterResourceUsageSummary.CpuUsedMHz && this.CpuCapacityMHz == clusterResourceUsageSummary.CpuCapacityMHz && this.MemUsedMB == clusterResourceUsageSummary.MemUsedMB && this.MemCapacityMB == clusterResourceUsageSummary.MemCapacityMB && ((this.PMemAvailableMB == null && clusterResourceUsageSummary.PMemAvailableMB == null) || (this.PMemAvailableMB != null && this.PMemAvailableMB.Equals(clusterResourceUsageSummary.PMemAvailableMB))) && ((this.PMemCapacityMB == null && clusterResourceUsageSummary.PMemCapacityMB == null) || (this.PMemCapacityMB != null && this.PMemCapacityMB.Equals(clusterResourceUsageSummary.PMemCapacityMB))) && this.StorageUsedMB == clusterResourceUsageSummary.StorageUsedMB && this.StorageCapacityMB == clusterResourceUsageSummary.StorageCapacityMB);\n        }\n\n        public override bool Equals(object clusterResourceUsageSummary)\n        {\n            return Equals(clusterResourceUsageSummary as ClusterResourceUsageSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CpuUsedMHz + \"_\" + CpuCapacityMHz + \"_\" + MemUsedMB + \"_\" + MemCapacityMB + \"_\" + PMemAvailableMB + \"_\" + PMemCapacityMB + \"_\" + StorageUsedMB + \"_\" + StorageCapacityMB).GetHashCode();\n        }\n    }\n\n    public class ClusterRuleInfo : DynamicData, IEquatable<ClusterRuleInfo>\n    {\n        public int? Key { get; set; }\n\n        public ManagedEntityStatus? Status { get; set; }\n\n        public bool? Enabled { get; set; }\n\n        public string Name { get; set; }\n\n        public bool? Mandatory { get; set; }\n\n        public bool? UserCreated { get; set; }\n\n        public bool? InCompliance { get; set; }\n\n        public string RuleUuid { get; set; }\n\n        public bool Equals(ClusterRuleInfo clusterRuleInfo)\n        {\n            return (clusterRuleInfo != null && ((this.Key == null && clusterRuleInfo.Key == null) || (this.Key != null && this.Key.Equals(clusterRuleInfo.Key))) && ((this.Status == null && clusterRuleInfo.Status == null) || (this.Status != null && this.Status.Equals(clusterRuleInfo.Status))) && ((this.Enabled == null && clusterRuleInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterRuleInfo.Enabled))) && this.Name == clusterRuleInfo.Name && ((this.Mandatory == null && clusterRuleInfo.Mandatory == null) || (this.Mandatory != null && this.Mandatory.Equals(clusterRuleInfo.Mandatory))) && ((this.UserCreated == null && clusterRuleInfo.UserCreated == null) || (this.UserCreated != null && this.UserCreated.Equals(clusterRuleInfo.UserCreated))) && ((this.InCompliance == null && clusterRuleInfo.InCompliance == null) || (this.InCompliance != null && this.InCompliance.Equals(clusterRuleInfo.InCompliance))) && this.RuleUuid == clusterRuleInfo.RuleUuid);\n        }\n\n        public override bool Equals(object clusterRuleInfo)\n        {\n            return Equals(clusterRuleInfo as ClusterRuleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Status + \"_\" + Enabled + \"_\" + Name + \"_\" + Mandatory + \"_\" + UserCreated + \"_\" + InCompliance + \"_\" + RuleUuid).GetHashCode();\n        }\n    }\n\n    public class ClusterRuleSpec : ArrayUpdateSpec, IEquatable<ClusterRuleSpec>\n    {\n        public ClusterRuleInfo Info { get; set; }\n\n        public bool Equals(ClusterRuleSpec clusterRuleSpec)\n        {\n            return (clusterRuleSpec != null && ((this.Info == null && clusterRuleSpec.Info == null) || (this.Info != null && this.Info.Equals(clusterRuleSpec.Info))));\n        }\n\n        public override bool Equals(object clusterRuleSpec)\n        {\n            return Equals(clusterRuleSpec as ClusterRuleSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterSlotPolicy : DynamicData, IEquatable<ClusterSlotPolicy>\n    {\n        public bool Equals(ClusterSlotPolicy clusterSlotPolicy)\n        {\n            return (clusterSlotPolicy != null && base.Equals(clusterSlotPolicy));\n        }\n\n        public override bool Equals(object clusterSlotPolicy)\n        {\n            return Equals(clusterSlotPolicy as ClusterSlotPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ClusterStatusChangedEvent : ClusterEvent, IEquatable<ClusterStatusChangedEvent>\n    {\n        public string OldStatus { get; set; }\n\n        public string NewStatus { get; set; }\n\n        public bool Equals(ClusterStatusChangedEvent clusterStatusChangedEvent)\n        {\n            return (clusterStatusChangedEvent != null && this.OldStatus == clusterStatusChangedEvent.OldStatus && this.NewStatus == clusterStatusChangedEvent.NewStatus);\n        }\n\n        public override bool Equals(object clusterStatusChangedEvent)\n        {\n            return Equals(clusterStatusChangedEvent as ClusterStatusChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldStatus + \"_\" + NewStatus).GetHashCode();\n        }\n    }\n\n    public class ClusterUsageSummary : DynamicData, IEquatable<ClusterUsageSummary>\n    {\n        public int TotalCpuCapacityMhz { get; set; }\n\n        public int TotalMemCapacityMB { get; set; }\n\n        public int CpuReservationMhz { get; set; }\n\n        public int MemReservationMB { get; set; }\n\n        public int? PoweredOffCpuReservationMhz { get; set; }\n\n        public int? PoweredOffMemReservationMB { get; set; }\n\n        public int CpuDemandMhz { get; set; }\n\n        public int MemDemandMB { get; set; }\n\n        public long StatsGenNumber { get; set; }\n\n        public int CpuEntitledMhz { get; set; }\n\n        public int MemEntitledMB { get; set; }\n\n        public int PoweredOffVmCount { get; set; }\n\n        public int TotalVmCount { get; set; }\n\n        public bool Equals(ClusterUsageSummary clusterUsageSummary)\n        {\n            return (clusterUsageSummary != null && this.TotalCpuCapacityMhz == clusterUsageSummary.TotalCpuCapacityMhz && this.TotalMemCapacityMB == clusterUsageSummary.TotalMemCapacityMB && this.CpuReservationMhz == clusterUsageSummary.CpuReservationMhz && this.MemReservationMB == clusterUsageSummary.MemReservationMB && ((this.PoweredOffCpuReservationMhz == null && clusterUsageSummary.PoweredOffCpuReservationMhz == null) || (this.PoweredOffCpuReservationMhz != null && this.PoweredOffCpuReservationMhz.Equals(clusterUsageSummary.PoweredOffCpuReservationMhz))) && ((this.PoweredOffMemReservationMB == null && clusterUsageSummary.PoweredOffMemReservationMB == null) || (this.PoweredOffMemReservationMB != null && this.PoweredOffMemReservationMB.Equals(clusterUsageSummary.PoweredOffMemReservationMB))) && this.CpuDemandMhz == clusterUsageSummary.CpuDemandMhz && this.MemDemandMB == clusterUsageSummary.MemDemandMB && this.StatsGenNumber == clusterUsageSummary.StatsGenNumber && this.CpuEntitledMhz == clusterUsageSummary.CpuEntitledMhz && this.MemEntitledMB == clusterUsageSummary.MemEntitledMB && this.PoweredOffVmCount == clusterUsageSummary.PoweredOffVmCount && this.TotalVmCount == clusterUsageSummary.TotalVmCount);\n        }\n\n        public override bool Equals(object clusterUsageSummary)\n        {\n            return Equals(clusterUsageSummary as ClusterUsageSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TotalCpuCapacityMhz + \"_\" + TotalMemCapacityMB + \"_\" + CpuReservationMhz + \"_\" + MemReservationMB + \"_\" + PoweredOffCpuReservationMhz + \"_\" + PoweredOffMemReservationMB + \"_\" + CpuDemandMhz + \"_\" + MemDemandMB + \"_\" + StatsGenNumber + \"_\" + CpuEntitledMhz + \"_\" + MemEntitledMB + \"_\" + PoweredOffVmCount + \"_\" + TotalVmCount).GetHashCode();\n        }\n    }\n\n    public class ClusterVmComponentProtectionSettings : DynamicData, IEquatable<ClusterVmComponentProtectionSettings>\n    {\n        public string VmStorageProtectionForAPD { get; set; }\n\n        public bool? EnableAPDTimeoutForHosts { get; set; }\n\n        public int? VmTerminateDelayForAPDSec { get; set; }\n\n        public string VmReactionOnAPDCleared { get; set; }\n\n        public string VmStorageProtectionForPDL { get; set; }\n\n        public bool Equals(ClusterVmComponentProtectionSettings clusterVmComponentProtectionSettings)\n        {\n            return (clusterVmComponentProtectionSettings != null && this.VmStorageProtectionForAPD == clusterVmComponentProtectionSettings.VmStorageProtectionForAPD && ((this.EnableAPDTimeoutForHosts == null && clusterVmComponentProtectionSettings.EnableAPDTimeoutForHosts == null) || (this.EnableAPDTimeoutForHosts != null && this.EnableAPDTimeoutForHosts.Equals(clusterVmComponentProtectionSettings.EnableAPDTimeoutForHosts))) && ((this.VmTerminateDelayForAPDSec == null && clusterVmComponentProtectionSettings.VmTerminateDelayForAPDSec == null) || (this.VmTerminateDelayForAPDSec != null && this.VmTerminateDelayForAPDSec.Equals(clusterVmComponentProtectionSettings.VmTerminateDelayForAPDSec))) && this.VmReactionOnAPDCleared == clusterVmComponentProtectionSettings.VmReactionOnAPDCleared && this.VmStorageProtectionForPDL == clusterVmComponentProtectionSettings.VmStorageProtectionForPDL);\n        }\n\n        public override bool Equals(object clusterVmComponentProtectionSettings)\n        {\n            return Equals(clusterVmComponentProtectionSettings as ClusterVmComponentProtectionSettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmStorageProtectionForAPD + \"_\" + EnableAPDTimeoutForHosts + \"_\" + VmTerminateDelayForAPDSec + \"_\" + VmReactionOnAPDCleared + \"_\" + VmStorageProtectionForPDL).GetHashCode();\n        }\n    }\n\n    public class ClusterVmGroup : ClusterGroupInfo, IEquatable<ClusterVmGroup>\n    {\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ClusterVmGroup_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterVmGroup clusterVmGroup)\n        {\n            return (clusterVmGroup != null && ((this.Vm == null && clusterVmGroup.Vm == null) || (this.Vm != null && clusterVmGroup.Vm != null && Enumerable.SequenceEqual(this.Vm, clusterVmGroup.Vm))) && ((this.LinkedView == null && clusterVmGroup.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterVmGroup.LinkedView))));\n        }\n\n        public override bool Equals(object clusterVmGroup)\n        {\n            return Equals(clusterVmGroup as ClusterVmGroup);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterVmGroup_LinkedView : IEquatable<ClusterVmGroup_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(ClusterVmGroup_LinkedView clusterVmGroup_LinkedView)\n        {\n            return (clusterVmGroup_LinkedView != null && ((this.Vm == null && clusterVmGroup_LinkedView.Vm == null) || (this.Vm != null && clusterVmGroup_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, clusterVmGroup_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterVmGroup_LinkedView)\n        {\n            return Equals(clusterVmGroup_LinkedView as ClusterVmGroup_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterVmHostRuleInfo : ClusterRuleInfo, IEquatable<ClusterVmHostRuleInfo>\n    {\n        public string VmGroupName { get; set; }\n\n        public string AffineHostGroupName { get; set; }\n\n        public string AntiAffineHostGroupName { get; set; }\n\n        public bool Equals(ClusterVmHostRuleInfo clusterVmHostRuleInfo)\n        {\n            return (clusterVmHostRuleInfo != null && this.VmGroupName == clusterVmHostRuleInfo.VmGroupName && this.AffineHostGroupName == clusterVmHostRuleInfo.AffineHostGroupName && this.AntiAffineHostGroupName == clusterVmHostRuleInfo.AntiAffineHostGroupName);\n        }\n\n        public override bool Equals(object clusterVmHostRuleInfo)\n        {\n            return Equals(clusterVmHostRuleInfo as ClusterVmHostRuleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmGroupName + \"_\" + AffineHostGroupName + \"_\" + AntiAffineHostGroupName).GetHashCode();\n        }\n    }\n\n    public class ClusterVmOrchestrationInfo : DynamicData, IEquatable<ClusterVmOrchestrationInfo>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public ClusterVmReadiness VmReadiness { get; set; }\n\n        public ClusterVmOrchestrationInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ClusterVmOrchestrationInfo clusterVmOrchestrationInfo)\n        {\n            return (clusterVmOrchestrationInfo != null && ((this.Vm == null && clusterVmOrchestrationInfo.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterVmOrchestrationInfo.Vm))) && ((this.VmReadiness == null && clusterVmOrchestrationInfo.VmReadiness == null) || (this.VmReadiness != null && this.VmReadiness.Equals(clusterVmOrchestrationInfo.VmReadiness))) && ((this.LinkedView == null && clusterVmOrchestrationInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(clusterVmOrchestrationInfo.LinkedView))));\n        }\n\n        public override bool Equals(object clusterVmOrchestrationInfo)\n        {\n            return Equals(clusterVmOrchestrationInfo as ClusterVmOrchestrationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmReadiness + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ClusterVmOrchestrationInfo_LinkedView : IEquatable<ClusterVmOrchestrationInfo_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(ClusterVmOrchestrationInfo_LinkedView clusterVmOrchestrationInfo_LinkedView)\n        {\n            return (clusterVmOrchestrationInfo_LinkedView != null && ((this.Vm == null && clusterVmOrchestrationInfo_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(clusterVmOrchestrationInfo_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object clusterVmOrchestrationInfo_LinkedView)\n        {\n            return Equals(clusterVmOrchestrationInfo_LinkedView as ClusterVmOrchestrationInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ClusterVmOrchestrationSpec : ArrayUpdateSpec, IEquatable<ClusterVmOrchestrationSpec>\n    {\n        public ClusterVmOrchestrationInfo Info { get; set; }\n\n        public bool Equals(ClusterVmOrchestrationSpec clusterVmOrchestrationSpec)\n        {\n            return (clusterVmOrchestrationSpec != null && ((this.Info == null && clusterVmOrchestrationSpec.Info == null) || (this.Info != null && this.Info.Equals(clusterVmOrchestrationSpec.Info))));\n        }\n\n        public override bool Equals(object clusterVmOrchestrationSpec)\n        {\n            return Equals(clusterVmOrchestrationSpec as ClusterVmOrchestrationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ClusterVmReadiness : DynamicData, IEquatable<ClusterVmReadiness>\n    {\n        public string ReadyCondition { get; set; }\n\n        public int? PostReadyDelay { get; set; }\n\n        public bool Equals(ClusterVmReadiness clusterVmReadiness)\n        {\n            return (clusterVmReadiness != null && this.ReadyCondition == clusterVmReadiness.ReadyCondition && ((this.PostReadyDelay == null && clusterVmReadiness.PostReadyDelay == null) || (this.PostReadyDelay != null && this.PostReadyDelay.Equals(clusterVmReadiness.PostReadyDelay))));\n        }\n\n        public override bool Equals(object clusterVmReadiness)\n        {\n            return Equals(clusterVmReadiness as ClusterVmReadiness);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReadyCondition + \"_\" + PostReadyDelay).GetHashCode();\n        }\n    }\n\n    public class ClusterVmToolsMonitoringSettings : DynamicData, IEquatable<ClusterVmToolsMonitoringSettings>\n    {\n        public bool? Enabled { get; set; }\n\n        public string VmMonitoring { get; set; }\n\n        public bool? ClusterSettings { get; set; }\n\n        public int? FailureInterval { get; set; }\n\n        public int? MinUpTime { get; set; }\n\n        public int? MaxFailures { get; set; }\n\n        public int? MaxFailureWindow { get; set; }\n\n        public bool Equals(ClusterVmToolsMonitoringSettings clusterVmToolsMonitoringSettings)\n        {\n            return (clusterVmToolsMonitoringSettings != null && ((this.Enabled == null && clusterVmToolsMonitoringSettings.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(clusterVmToolsMonitoringSettings.Enabled))) && this.VmMonitoring == clusterVmToolsMonitoringSettings.VmMonitoring && ((this.ClusterSettings == null && clusterVmToolsMonitoringSettings.ClusterSettings == null) || (this.ClusterSettings != null && this.ClusterSettings.Equals(clusterVmToolsMonitoringSettings.ClusterSettings))) && ((this.FailureInterval == null && clusterVmToolsMonitoringSettings.FailureInterval == null) || (this.FailureInterval != null && this.FailureInterval.Equals(clusterVmToolsMonitoringSettings.FailureInterval))) && ((this.MinUpTime == null && clusterVmToolsMonitoringSettings.MinUpTime == null) || (this.MinUpTime != null && this.MinUpTime.Equals(clusterVmToolsMonitoringSettings.MinUpTime))) && ((this.MaxFailures == null && clusterVmToolsMonitoringSettings.MaxFailures == null) || (this.MaxFailures != null && this.MaxFailures.Equals(clusterVmToolsMonitoringSettings.MaxFailures))) && ((this.MaxFailureWindow == null && clusterVmToolsMonitoringSettings.MaxFailureWindow == null) || (this.MaxFailureWindow != null && this.MaxFailureWindow.Equals(clusterVmToolsMonitoringSettings.MaxFailureWindow))));\n        }\n\n        public override bool Equals(object clusterVmToolsMonitoringSettings)\n        {\n            return Equals(clusterVmToolsMonitoringSettings as ClusterVmToolsMonitoringSettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + VmMonitoring + \"_\" + ClusterSettings + \"_\" + FailureInterval + \"_\" + MinUpTime + \"_\" + MaxFailures + \"_\" + MaxFailureWindow).GetHashCode();\n        }\n    }\n\n    public class CollectorAddressUnset : DvsFault, IEquatable<CollectorAddressUnset>\n    {\n        public bool Equals(CollectorAddressUnset collectorAddressUnset)\n        {\n            return (collectorAddressUnset != null && base.Equals(collectorAddressUnset));\n        }\n\n        public override bool Equals(object collectorAddressUnset)\n        {\n            return Equals(collectorAddressUnset as CollectorAddressUnset);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ComplianceFailure : DynamicData, IEquatable<ComplianceFailure>\n    {\n        public string FailureType { get; set; }\n\n        public LocalizableMessage Message { get; set; }\n\n        public string ExpressionName { get; set; }\n\n        public ComplianceFailureComplianceFailureValues[] FailureValues { get; set; }\n\n        public bool Equals(ComplianceFailure complianceFailure)\n        {\n            return (complianceFailure != null && this.FailureType == complianceFailure.FailureType && ((this.Message == null && complianceFailure.Message == null) || (this.Message != null && this.Message.Equals(complianceFailure.Message))) && this.ExpressionName == complianceFailure.ExpressionName && ((this.FailureValues == null && complianceFailure.FailureValues == null) || (this.FailureValues != null && complianceFailure.FailureValues != null && Enumerable.SequenceEqual(this.FailureValues, complianceFailure.FailureValues))));\n        }\n\n        public override bool Equals(object complianceFailure)\n        {\n            return Equals(complianceFailure as ComplianceFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailureType + \"_\" + Message + \"_\" + ExpressionName + \"_\" + FailureValues).GetHashCode();\n        }\n    }\n\n    public class ComplianceFailureComplianceFailureValues : DynamicData, IEquatable<ComplianceFailureComplianceFailureValues>\n    {\n        public string ComparisonIdentifier { get; set; }\n\n        public string ProfileInstance { get; set; }\n\n        public object HostValue { get; set; }\n\n        public object ProfileValue { get; set; }\n\n        public bool Equals(ComplianceFailureComplianceFailureValues complianceFailureComplianceFailureValues)\n        {\n            return (complianceFailureComplianceFailureValues != null && this.ComparisonIdentifier == complianceFailureComplianceFailureValues.ComparisonIdentifier && this.ProfileInstance == complianceFailureComplianceFailureValues.ProfileInstance && ((this.HostValue == null && complianceFailureComplianceFailureValues.HostValue == null) || (this.HostValue != null && this.HostValue.Equals(complianceFailureComplianceFailureValues.HostValue))) && ((this.ProfileValue == null && complianceFailureComplianceFailureValues.ProfileValue == null) || (this.ProfileValue != null && this.ProfileValue.Equals(complianceFailureComplianceFailureValues.ProfileValue))));\n        }\n\n        public override bool Equals(object complianceFailureComplianceFailureValues)\n        {\n            return Equals(complianceFailureComplianceFailureValues as ComplianceFailureComplianceFailureValues);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComparisonIdentifier + \"_\" + ProfileInstance + \"_\" + HostValue + \"_\" + ProfileValue).GetHashCode();\n        }\n    }\n\n    public class ComplianceLocator : DynamicData, IEquatable<ComplianceLocator>\n    {\n        public string ExpressionName { get; set; }\n\n        public ProfilePropertyPath ApplyPath { get; set; }\n\n        public bool Equals(ComplianceLocator complianceLocator)\n        {\n            return (complianceLocator != null && this.ExpressionName == complianceLocator.ExpressionName && ((this.ApplyPath == null && complianceLocator.ApplyPath == null) || (this.ApplyPath != null && this.ApplyPath.Equals(complianceLocator.ApplyPath))));\n        }\n\n        public override bool Equals(object complianceLocator)\n        {\n            return Equals(complianceLocator as ComplianceLocator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExpressionName + \"_\" + ApplyPath).GetHashCode();\n        }\n    }\n\n    public class ComplianceProfile : DynamicData, IEquatable<ComplianceProfile>\n    {\n        public ProfileExpression[] Expression { get; set; }\n\n        public string RootExpression { get; set; }\n\n        public bool Equals(ComplianceProfile complianceProfile)\n        {\n            return (complianceProfile != null && ((this.Expression == null && complianceProfile.Expression == null) || (this.Expression != null && complianceProfile.Expression != null && Enumerable.SequenceEqual(this.Expression, complianceProfile.Expression))) && this.RootExpression == complianceProfile.RootExpression);\n        }\n\n        public override bool Equals(object complianceProfile)\n        {\n            return Equals(complianceProfile as ComplianceProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Expression + \"_\" + RootExpression).GetHashCode();\n        }\n    }\n\n    public class ComplianceResult : DynamicData, IEquatable<ComplianceResult>\n    {\n        public ManagedObjectReference Profile { get; set; }\n\n        public string ComplianceStatus { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public DateTime? CheckTime { get; set; }\n\n        public ComplianceFailure[] Failure { get; set; }\n\n        public ComplianceResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ComplianceResult complianceResult)\n        {\n            return (complianceResult != null && ((this.Profile == null && complianceResult.Profile == null) || (this.Profile != null && this.Profile.Equals(complianceResult.Profile))) && this.ComplianceStatus == complianceResult.ComplianceStatus && ((this.Entity == null && complianceResult.Entity == null) || (this.Entity != null && this.Entity.Equals(complianceResult.Entity))) && ((this.CheckTime == null && complianceResult.CheckTime == null) || (this.CheckTime != null && this.CheckTime.Equals(complianceResult.CheckTime))) && ((this.Failure == null && complianceResult.Failure == null) || (this.Failure != null && complianceResult.Failure != null && Enumerable.SequenceEqual(this.Failure, complianceResult.Failure))) && ((this.LinkedView == null && complianceResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(complianceResult.LinkedView))));\n        }\n\n        public override bool Equals(object complianceResult)\n        {\n            return Equals(complianceResult as ComplianceResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile + \"_\" + ComplianceStatus + \"_\" + Entity + \"_\" + CheckTime + \"_\" + Failure + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ComplianceResult_LinkedView : IEquatable<ComplianceResult_LinkedView>\n    {\n        public Profile Profile { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(ComplianceResult_LinkedView complianceResult_LinkedView)\n        {\n            return (complianceResult_LinkedView != null && ((this.Profile == null && complianceResult_LinkedView.Profile == null) || (this.Profile != null && this.Profile.Equals(complianceResult_LinkedView.Profile))) && ((this.Entity == null && complianceResult_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(complianceResult_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object complianceResult_LinkedView)\n        {\n            return Equals(complianceResult_LinkedView as ComplianceResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class CompositePolicyOption : PolicyOption, IEquatable<CompositePolicyOption>\n    {\n        public PolicyOption[] Option { get; set; }\n\n        public bool Equals(CompositePolicyOption compositePolicyOption)\n        {\n            return (compositePolicyOption != null && ((this.Option == null && compositePolicyOption.Option == null) || (this.Option != null && compositePolicyOption.Option != null && Enumerable.SequenceEqual(this.Option, compositePolicyOption.Option))));\n        }\n\n        public override bool Equals(object compositePolicyOption)\n        {\n            return Equals(compositePolicyOption as CompositePolicyOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Option).GetHashCode();\n        }\n    }\n\n    public class ComputeResource : ManagedEntity, IEquatable<ComputeResource>\n    {\n        public ManagedObjectReference ResourcePool { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public ManagedObjectReference[] Network { get; set; }\n\n        public ComputeResourceSummary Summary { get; set; }\n\n        public ManagedObjectReference EnvironmentBrowser { get; set; }\n\n        public ComputeResourceConfigInfo ConfigurationEx { get; set; }\n\n        public new ComputeResource_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference ReconfigureComputeResource_Task(ComputeResourceConfigSpec spec, bool modify)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureComputeResource(ComputeResourceConfigSpec spec, bool modify)\n        {\n        }\n\n        public bool Equals(ComputeResource computeResource)\n        {\n            return (computeResource != null && ((this.ResourcePool == null && computeResource.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(computeResource.ResourcePool))) && ((this.Host == null && computeResource.Host == null) || (this.Host != null && computeResource.Host != null && Enumerable.SequenceEqual(this.Host, computeResource.Host))) && ((this.Datastore == null && computeResource.Datastore == null) || (this.Datastore != null && computeResource.Datastore != null && Enumerable.SequenceEqual(this.Datastore, computeResource.Datastore))) && ((this.Network == null && computeResource.Network == null) || (this.Network != null && computeResource.Network != null && Enumerable.SequenceEqual(this.Network, computeResource.Network))) && ((this.Summary == null && computeResource.Summary == null) || (this.Summary != null && this.Summary.Equals(computeResource.Summary))) && ((this.EnvironmentBrowser == null && computeResource.EnvironmentBrowser == null) || (this.EnvironmentBrowser != null && this.EnvironmentBrowser.Equals(computeResource.EnvironmentBrowser))) && ((this.ConfigurationEx == null && computeResource.ConfigurationEx == null) || (this.ConfigurationEx != null && this.ConfigurationEx.Equals(computeResource.ConfigurationEx))) && ((this.LinkedView == null && computeResource.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(computeResource.LinkedView))));\n        }\n\n        public override bool Equals(object computeResource)\n        {\n            return Equals(computeResource as ComputeResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResourcePool + \"_\" + Host + \"_\" + Datastore + \"_\" + Network + \"_\" + Summary + \"_\" + EnvironmentBrowser + \"_\" + ConfigurationEx + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ComputeResource_LinkedView : ManagedEntity_LinkedView, IEquatable<ComputeResource_LinkedView>\n    {\n        public ResourcePool ResourcePool { get; set; }\n\n        public HostSystem[] Host { get; set; }\n\n        public Datastore[] Datastore { get; set; }\n\n        public Network[] Network { get; set; }\n\n        public EnvironmentBrowser EnvironmentBrowser { get; set; }\n\n        public bool Equals(ComputeResource_LinkedView computeResource_LinkedView)\n        {\n            return (computeResource_LinkedView != null && ((this.ResourcePool == null && computeResource_LinkedView.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(computeResource_LinkedView.ResourcePool))) && ((this.Host == null && computeResource_LinkedView.Host == null) || (this.Host != null && computeResource_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, computeResource_LinkedView.Host))) && ((this.Datastore == null && computeResource_LinkedView.Datastore == null) || (this.Datastore != null && computeResource_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, computeResource_LinkedView.Datastore))) && ((this.Network == null && computeResource_LinkedView.Network == null) || (this.Network != null && computeResource_LinkedView.Network != null && Enumerable.SequenceEqual(this.Network, computeResource_LinkedView.Network))) && ((this.EnvironmentBrowser == null && computeResource_LinkedView.EnvironmentBrowser == null) || (this.EnvironmentBrowser != null && this.EnvironmentBrowser.Equals(computeResource_LinkedView.EnvironmentBrowser))));\n        }\n\n        public override bool Equals(object computeResource_LinkedView)\n        {\n            return Equals(computeResource_LinkedView as ComputeResource_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResourcePool + \"_\" + Host + \"_\" + Datastore + \"_\" + Network + \"_\" + EnvironmentBrowser).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceConfigInfo : DynamicData, IEquatable<ComputeResourceConfigInfo>\n    {\n        public string VmSwapPlacement { get; set; }\n\n        public bool? SpbmEnabled { get; set; }\n\n        public string DefaultHardwareVersionKey { get; set; }\n\n        public bool Equals(ComputeResourceConfigInfo computeResourceConfigInfo)\n        {\n            return (computeResourceConfigInfo != null && this.VmSwapPlacement == computeResourceConfigInfo.VmSwapPlacement && ((this.SpbmEnabled == null && computeResourceConfigInfo.SpbmEnabled == null) || (this.SpbmEnabled != null && this.SpbmEnabled.Equals(computeResourceConfigInfo.SpbmEnabled))) && this.DefaultHardwareVersionKey == computeResourceConfigInfo.DefaultHardwareVersionKey);\n        }\n\n        public override bool Equals(object computeResourceConfigInfo)\n        {\n            return Equals(computeResourceConfigInfo as ComputeResourceConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmSwapPlacement + \"_\" + SpbmEnabled + \"_\" + DefaultHardwareVersionKey).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceConfigSpec : DynamicData, IEquatable<ComputeResourceConfigSpec>\n    {\n        public string VmSwapPlacement { get; set; }\n\n        public bool? SpbmEnabled { get; set; }\n\n        public string DefaultHardwareVersionKey { get; set; }\n\n        public bool Equals(ComputeResourceConfigSpec computeResourceConfigSpec)\n        {\n            return (computeResourceConfigSpec != null && this.VmSwapPlacement == computeResourceConfigSpec.VmSwapPlacement && ((this.SpbmEnabled == null && computeResourceConfigSpec.SpbmEnabled == null) || (this.SpbmEnabled != null && this.SpbmEnabled.Equals(computeResourceConfigSpec.SpbmEnabled))) && this.DefaultHardwareVersionKey == computeResourceConfigSpec.DefaultHardwareVersionKey);\n        }\n\n        public override bool Equals(object computeResourceConfigSpec)\n        {\n            return Equals(computeResourceConfigSpec as ComputeResourceConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmSwapPlacement + \"_\" + SpbmEnabled + \"_\" + DefaultHardwareVersionKey).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceEventArgument : EntityEventArgument, IEquatable<ComputeResourceEventArgument>\n    {\n        public ManagedObjectReference ComputeResource { get; set; }\n\n        public ComputeResourceEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ComputeResourceEventArgument computeResourceEventArgument)\n        {\n            return (computeResourceEventArgument != null && ((this.ComputeResource == null && computeResourceEventArgument.ComputeResource == null) || (this.ComputeResource != null && this.ComputeResource.Equals(computeResourceEventArgument.ComputeResource))) && ((this.LinkedView == null && computeResourceEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(computeResourceEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object computeResourceEventArgument)\n        {\n            return Equals(computeResourceEventArgument as ComputeResourceEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComputeResource + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceEventArgument_LinkedView : IEquatable<ComputeResourceEventArgument_LinkedView>\n    {\n        public ComputeResource ComputeResource { get; set; }\n\n        public bool Equals(ComputeResourceEventArgument_LinkedView computeResourceEventArgument_LinkedView)\n        {\n            return (computeResourceEventArgument_LinkedView != null && ((this.ComputeResource == null && computeResourceEventArgument_LinkedView.ComputeResource == null) || (this.ComputeResource != null && this.ComputeResource.Equals(computeResourceEventArgument_LinkedView.ComputeResource))));\n        }\n\n        public override bool Equals(object computeResourceEventArgument_LinkedView)\n        {\n            return Equals(computeResourceEventArgument_LinkedView as ComputeResourceEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComputeResource).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceHostSPBMLicenseInfo : DynamicData, IEquatable<ComputeResourceHostSPBMLicenseInfo>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState LicenseState { get; set; }\n\n        public ComputeResourceHostSPBMLicenseInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ComputeResourceHostSPBMLicenseInfo computeResourceHostSPBMLicenseInfo)\n        {\n            return (computeResourceHostSPBMLicenseInfo != null && ((this.Host == null && computeResourceHostSPBMLicenseInfo.Host == null) || (this.Host != null && this.Host.Equals(computeResourceHostSPBMLicenseInfo.Host))) && this.LicenseState == computeResourceHostSPBMLicenseInfo.LicenseState && ((this.LinkedView == null && computeResourceHostSPBMLicenseInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(computeResourceHostSPBMLicenseInfo.LinkedView))));\n        }\n\n        public override bool Equals(object computeResourceHostSPBMLicenseInfo)\n        {\n            return Equals(computeResourceHostSPBMLicenseInfo as ComputeResourceHostSPBMLicenseInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LicenseState + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceHostSPBMLicenseInfo_LinkedView : IEquatable<ComputeResourceHostSPBMLicenseInfo_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ComputeResourceHostSPBMLicenseInfo_LinkedView computeResourceHostSPBMLicenseInfo_LinkedView)\n        {\n            return (computeResourceHostSPBMLicenseInfo_LinkedView != null && ((this.Host == null && computeResourceHostSPBMLicenseInfo_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(computeResourceHostSPBMLicenseInfo_LinkedView.Host))));\n        }\n\n        public override bool Equals(object computeResourceHostSPBMLicenseInfo_LinkedView)\n        {\n            return Equals(computeResourceHostSPBMLicenseInfo_LinkedView as ComputeResourceHostSPBMLicenseInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceSummary : DynamicData, IEquatable<ComputeResourceSummary>\n    {\n        public int TotalCpu { get; set; }\n\n        public long TotalMemory { get; set; }\n\n        public short NumCpuCores { get; set; }\n\n        public short NumCpuThreads { get; set; }\n\n        public int EffectiveCpu { get; set; }\n\n        public long EffectiveMemory { get; set; }\n\n        public int NumHosts { get; set; }\n\n        public int NumEffectiveHosts { get; set; }\n\n        public ManagedEntityStatus OverallStatus { get; set; }\n\n        public bool Equals(ComputeResourceSummary computeResourceSummary)\n        {\n            return (computeResourceSummary != null && this.TotalCpu == computeResourceSummary.TotalCpu && this.TotalMemory == computeResourceSummary.TotalMemory && this.NumCpuCores == computeResourceSummary.NumCpuCores && this.NumCpuThreads == computeResourceSummary.NumCpuThreads && this.EffectiveCpu == computeResourceSummary.EffectiveCpu && this.EffectiveMemory == computeResourceSummary.EffectiveMemory && this.NumHosts == computeResourceSummary.NumHosts && this.NumEffectiveHosts == computeResourceSummary.NumEffectiveHosts && this.OverallStatus == computeResourceSummary.OverallStatus);\n        }\n\n        public override bool Equals(object computeResourceSummary)\n        {\n            return Equals(computeResourceSummary as ComputeResourceSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TotalCpu + \"_\" + TotalMemory + \"_\" + NumCpuCores + \"_\" + NumCpuThreads + \"_\" + EffectiveCpu + \"_\" + EffectiveMemory + \"_\" + NumHosts + \"_\" + NumEffectiveHosts + \"_\" + OverallStatus).GetHashCode();\n        }\n    }\n\n    public class ConcurrentAccess : VimFault, IEquatable<ConcurrentAccess>\n    {\n        public bool Equals(ConcurrentAccess concurrentAccess)\n        {\n            return (concurrentAccess != null && base.Equals(concurrentAccess));\n        }\n\n        public override bool Equals(object concurrentAccess)\n        {\n            return Equals(concurrentAccess as ConcurrentAccess);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ConfigTarget : DynamicData, IEquatable<ConfigTarget>\n    {\n        public int NumCpus { get; set; }\n\n        public int NumCpuCores { get; set; }\n\n        public int NumNumaNodes { get; set; }\n\n        public bool SmcPresent { get; set; }\n\n        public VirtualMachineDatastoreInfo[] Datastore { get; set; }\n\n        public VirtualMachineNetworkInfo[] Network { get; set; }\n\n        public OpaqueNetworkTargetInfo[] OpaqueNetwork { get; set; }\n\n        public DistributedVirtualPortgroupInfo[] DistributedVirtualPortgroup { get; set; }\n\n        public DistributedVirtualSwitchInfo[] DistributedVirtualSwitch { get; set; }\n\n        public VirtualMachineCdromInfo[] CdRom { get; set; }\n\n        public VirtualMachineSerialInfo[] Serial { get; set; }\n\n        public VirtualMachineParallelInfo[] Parallel { get; set; }\n\n        public VirtualMachineSoundInfo[] Sound { get; set; }\n\n        public VirtualMachineUsbInfo[] Usb { get; set; }\n\n        public VirtualMachineFloppyInfo[] Floppy { get; set; }\n\n        public VirtualMachineLegacyNetworkSwitchInfo[] LegacyNetworkInfo { get; set; }\n\n        public VirtualMachineScsiPassthroughInfo[] ScsiPassthrough { get; set; }\n\n        public VirtualMachineScsiDiskDeviceInfo[] ScsiDisk { get; set; }\n\n        public VirtualMachineIdeDiskDeviceInfo[] IdeDisk { get; set; }\n\n        public int MaxMemMBOptimalPerf { get; set; }\n\n        public ResourcePoolRuntimeInfo ResourcePool { get; set; }\n\n        public bool? AutoVmotion { get; set; }\n\n        public VirtualMachinePciPassthroughInfo[] PciPassthrough { get; set; }\n\n        public VirtualMachineSriovInfo[] Sriov { get; set; }\n\n        public VirtualMachineVFlashModuleInfo[] VFlashModule { get; set; }\n\n        public VirtualMachinePciSharedGpuPassthroughInfo[] SharedGpuPassthroughTypes { get; set; }\n\n        public long? AvailablePersistentMemoryReservationMB { get; set; }\n\n        public bool Equals(ConfigTarget configTarget)\n        {\n            return (configTarget != null && this.NumCpus == configTarget.NumCpus && this.NumCpuCores == configTarget.NumCpuCores && this.NumNumaNodes == configTarget.NumNumaNodes && this.SmcPresent == configTarget.SmcPresent && ((this.Datastore == null && configTarget.Datastore == null) || (this.Datastore != null && configTarget.Datastore != null && Enumerable.SequenceEqual(this.Datastore, configTarget.Datastore))) && ((this.Network == null && configTarget.Network == null) || (this.Network != null && configTarget.Network != null && Enumerable.SequenceEqual(this.Network, configTarget.Network))) && ((this.OpaqueNetwork == null && configTarget.OpaqueNetwork == null) || (this.OpaqueNetwork != null && configTarget.OpaqueNetwork != null && Enumerable.SequenceEqual(this.OpaqueNetwork, configTarget.OpaqueNetwork))) && ((this.DistributedVirtualPortgroup == null && configTarget.DistributedVirtualPortgroup == null) || (this.DistributedVirtualPortgroup != null && configTarget.DistributedVirtualPortgroup != null && Enumerable.SequenceEqual(this.DistributedVirtualPortgroup, configTarget.DistributedVirtualPortgroup))) && ((this.DistributedVirtualSwitch == null && configTarget.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && configTarget.DistributedVirtualSwitch != null && Enumerable.SequenceEqual(this.DistributedVirtualSwitch, configTarget.DistributedVirtualSwitch))) && ((this.CdRom == null && configTarget.CdRom == null) || (this.CdRom != null && configTarget.CdRom != null && Enumerable.SequenceEqual(this.CdRom, configTarget.CdRom))) && ((this.Serial == null && configTarget.Serial == null) || (this.Serial != null && configTarget.Serial != null && Enumerable.SequenceEqual(this.Serial, configTarget.Serial))) && ((this.Parallel == null && configTarget.Parallel == null) || (this.Parallel != null && configTarget.Parallel != null && Enumerable.SequenceEqual(this.Parallel, configTarget.Parallel))) && ((this.Sound == null && configTarget.Sound == null) || (this.Sound != null && configTarget.Sound != null && Enumerable.SequenceEqual(this.Sound, configTarget.Sound))) && ((this.Usb == null && configTarget.Usb == null) || (this.Usb != null && configTarget.Usb != null && Enumerable.SequenceEqual(this.Usb, configTarget.Usb))) && ((this.Floppy == null && configTarget.Floppy == null) || (this.Floppy != null && configTarget.Floppy != null && Enumerable.SequenceEqual(this.Floppy, configTarget.Floppy))) && ((this.LegacyNetworkInfo == null && configTarget.LegacyNetworkInfo == null) || (this.LegacyNetworkInfo != null && configTarget.LegacyNetworkInfo != null && Enumerable.SequenceEqual(this.LegacyNetworkInfo, configTarget.LegacyNetworkInfo))) && ((this.ScsiPassthrough == null && configTarget.ScsiPassthrough == null) || (this.ScsiPassthrough != null && configTarget.ScsiPassthrough != null && Enumerable.SequenceEqual(this.ScsiPassthrough, configTarget.ScsiPassthrough))) && ((this.ScsiDisk == null && configTarget.ScsiDisk == null) || (this.ScsiDisk != null && configTarget.ScsiDisk != null && Enumerable.SequenceEqual(this.ScsiDisk, configTarget.ScsiDisk))) && ((this.IdeDisk == null && configTarget.IdeDisk == null) || (this.IdeDisk != null && configTarget.IdeDisk != null && Enumerable.SequenceEqual(this.IdeDisk, configTarget.IdeDisk))) && this.MaxMemMBOptimalPerf == configTarget.MaxMemMBOptimalPerf && ((this.ResourcePool == null && configTarget.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(configTarget.ResourcePool))) && ((this.AutoVmotion == null && configTarget.AutoVmotion == null) || (this.AutoVmotion != null && this.AutoVmotion.Equals(configTarget.AutoVmotion))) && ((this.PciPassthrough == null && configTarget.PciPassthrough == null) || (this.PciPassthrough != null && configTarget.PciPassthrough != null && Enumerable.SequenceEqual(this.PciPassthrough, configTarget.PciPassthrough))) && ((this.Sriov == null && configTarget.Sriov == null) || (this.Sriov != null && configTarget.Sriov != null && Enumerable.SequenceEqual(this.Sriov, configTarget.Sriov))) && ((this.VFlashModule == null && configTarget.VFlashModule == null) || (this.VFlashModule != null && configTarget.VFlashModule != null && Enumerable.SequenceEqual(this.VFlashModule, configTarget.VFlashModule))) && ((this.SharedGpuPassthroughTypes == null && configTarget.SharedGpuPassthroughTypes == null) || (this.SharedGpuPassthroughTypes != null && configTarget.SharedGpuPassthroughTypes != null && Enumerable.SequenceEqual(this.SharedGpuPassthroughTypes, configTarget.SharedGpuPassthroughTypes))) && ((this.AvailablePersistentMemoryReservationMB == null && configTarget.AvailablePersistentMemoryReservationMB == null) || (this.AvailablePersistentMemoryReservationMB != null && this.AvailablePersistentMemoryReservationMB.Equals(configTarget.AvailablePersistentMemoryReservationMB))));\n        }\n\n        public override bool Equals(object configTarget)\n        {\n            return Equals(configTarget as ConfigTarget);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumCpus + \"_\" + NumCpuCores + \"_\" + NumNumaNodes + \"_\" + SmcPresent + \"_\" + Datastore + \"_\" + Network + \"_\" + OpaqueNetwork + \"_\" + DistributedVirtualPortgroup + \"_\" + DistributedVirtualSwitch + \"_\" + CdRom + \"_\" + Serial + \"_\" + Parallel + \"_\" + Sound + \"_\" + Usb + \"_\" + Floppy + \"_\" + LegacyNetworkInfo + \"_\" + ScsiPassthrough + \"_\" + ScsiDisk + \"_\" + IdeDisk + \"_\" + MaxMemMBOptimalPerf + \"_\" + ResourcePool + \"_\" + AutoVmotion + \"_\" + PciPassthrough + \"_\" + Sriov + \"_\" + VFlashModule + \"_\" + SharedGpuPassthroughTypes + \"_\" + AvailablePersistentMemoryReservationMB).GetHashCode();\n        }\n    }\n\n    public class ConflictingConfiguration : DvsFault, IEquatable<ConflictingConfiguration>\n    {\n        public ConflictingConfigurationConfig[] ConfigInConflict { get; set; }\n\n        public bool Equals(ConflictingConfiguration conflictingConfiguration)\n        {\n            return (conflictingConfiguration != null && ((this.ConfigInConflict == null && conflictingConfiguration.ConfigInConflict == null) || (this.ConfigInConflict != null && conflictingConfiguration.ConfigInConflict != null && Enumerable.SequenceEqual(this.ConfigInConflict, conflictingConfiguration.ConfigInConflict))));\n        }\n\n        public override bool Equals(object conflictingConfiguration)\n        {\n            return Equals(conflictingConfiguration as ConflictingConfiguration);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigInConflict).GetHashCode();\n        }\n    }\n\n    public class ConflictingConfigurationConfig : DynamicData, IEquatable<ConflictingConfigurationConfig>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public string PropertyPath { get; set; }\n\n        public ConflictingConfigurationConfig_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ConflictingConfigurationConfig conflictingConfigurationConfig)\n        {\n            return (conflictingConfigurationConfig != null && ((this.Entity == null && conflictingConfigurationConfig.Entity == null) || (this.Entity != null && this.Entity.Equals(conflictingConfigurationConfig.Entity))) && this.PropertyPath == conflictingConfigurationConfig.PropertyPath && ((this.LinkedView == null && conflictingConfigurationConfig.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(conflictingConfigurationConfig.LinkedView))));\n        }\n\n        public override bool Equals(object conflictingConfigurationConfig)\n        {\n            return Equals(conflictingConfigurationConfig as ConflictingConfigurationConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + PropertyPath + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ConflictingConfigurationConfig_LinkedView : IEquatable<ConflictingConfigurationConfig_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(ConflictingConfigurationConfig_LinkedView conflictingConfigurationConfig_LinkedView)\n        {\n            return (conflictingConfigurationConfig_LinkedView != null && ((this.Entity == null && conflictingConfigurationConfig_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(conflictingConfigurationConfig_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object conflictingConfigurationConfig_LinkedView)\n        {\n            return Equals(conflictingConfigurationConfig_LinkedView as ConflictingConfigurationConfig_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class ConflictingDatastoreFound : RuntimeFault, IEquatable<ConflictingDatastoreFound>\n    {\n        public string Name { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(ConflictingDatastoreFound conflictingDatastoreFound)\n        {\n            return (conflictingDatastoreFound != null && this.Name == conflictingDatastoreFound.Name && this.Url == conflictingDatastoreFound.Url);\n        }\n\n        public override bool Equals(object conflictingDatastoreFound)\n        {\n            return Equals(conflictingDatastoreFound as ConflictingDatastoreFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class ConnectedIso : OvfExport, IEquatable<ConnectedIso>\n    {\n        public VirtualCdrom Cdrom { get; set; }\n\n        public string Filename { get; set; }\n\n        public bool Equals(ConnectedIso connectedIso)\n        {\n            return (connectedIso != null && ((this.Cdrom == null && connectedIso.Cdrom == null) || (this.Cdrom != null && this.Cdrom.Equals(connectedIso.Cdrom))) && this.Filename == connectedIso.Filename);\n        }\n\n        public override bool Equals(object connectedIso)\n        {\n            return Equals(connectedIso as ConnectedIso);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Cdrom + \"_\" + Filename).GetHashCode();\n        }\n    }\n\n    public class ContainerView : ManagedObjectView, IEquatable<ContainerView>\n    {\n        public ManagedObjectReference Container { get; set; }\n\n        public string[] Type { get; set; }\n\n        public bool Recursive { get; set; }\n\n        public ContainerView_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ContainerView containerView)\n        {\n            return (containerView != null && ((this.Container == null && containerView.Container == null) || (this.Container != null && this.Container.Equals(containerView.Container))) && ((this.Type == null && containerView.Type == null) || (this.Type != null && containerView.Type != null && Enumerable.SequenceEqual(this.Type, containerView.Type))) && this.Recursive == containerView.Recursive && ((this.LinkedView == null && containerView.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(containerView.LinkedView))));\n        }\n\n        public override bool Equals(object containerView)\n        {\n            return Equals(containerView as ContainerView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Container + \"_\" + Type + \"_\" + Recursive + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ContainerView_LinkedView : IEquatable<ContainerView_LinkedView>\n    {\n        public ManagedEntity Container { get; set; }\n\n        public bool Equals(ContainerView_LinkedView containerView_LinkedView)\n        {\n            return (containerView_LinkedView != null && ((this.Container == null && containerView_LinkedView.Container == null) || (this.Container != null && this.Container.Equals(containerView_LinkedView.Container))));\n        }\n\n        public override bool Equals(object containerView_LinkedView)\n        {\n            return Equals(containerView_LinkedView as ContainerView_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Container).GetHashCode();\n        }\n    }\n\n    public class CpuCompatibilityUnknown : CpuIncompatible, IEquatable<CpuCompatibilityUnknown>\n    {\n        public new CpuCompatibilityUnknown_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CpuCompatibilityUnknown cpuCompatibilityUnknown)\n        {\n            return (cpuCompatibilityUnknown != null && ((this.LinkedView == null && cpuCompatibilityUnknown.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cpuCompatibilityUnknown.LinkedView))));\n        }\n\n        public override bool Equals(object cpuCompatibilityUnknown)\n        {\n            return Equals(cpuCompatibilityUnknown as CpuCompatibilityUnknown);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class CpuCompatibilityUnknown_LinkedView : CpuIncompatible_LinkedView, IEquatable<CpuCompatibilityUnknown_LinkedView>\n    {\n        public bool Equals(CpuCompatibilityUnknown_LinkedView cpuCompatibilityUnknown_LinkedView)\n        {\n            return (cpuCompatibilityUnknown_LinkedView != null && base.Equals(cpuCompatibilityUnknown_LinkedView));\n        }\n\n        public override bool Equals(object cpuCompatibilityUnknown_LinkedView)\n        {\n            return Equals(cpuCompatibilityUnknown_LinkedView as CpuCompatibilityUnknown_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CpuHotPlugNotSupported : VmConfigFault, IEquatable<CpuHotPlugNotSupported>\n    {\n        public bool Equals(CpuHotPlugNotSupported cpuHotPlugNotSupported)\n        {\n            return (cpuHotPlugNotSupported != null && base.Equals(cpuHotPlugNotSupported));\n        }\n\n        public override bool Equals(object cpuHotPlugNotSupported)\n        {\n            return Equals(cpuHotPlugNotSupported as CpuHotPlugNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CpuIncompatible : VirtualHardwareCompatibilityIssue, IEquatable<CpuIncompatible>\n    {\n        public int Level { get; set; }\n\n        public string RegisterName { get; set; }\n\n        public string RegisterBits { get; set; }\n\n        public string DesiredBits { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public CpuIncompatible_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CpuIncompatible cpuIncompatible)\n        {\n            return (cpuIncompatible != null && this.Level == cpuIncompatible.Level && this.RegisterName == cpuIncompatible.RegisterName && this.RegisterBits == cpuIncompatible.RegisterBits && this.DesiredBits == cpuIncompatible.DesiredBits && ((this.Host == null && cpuIncompatible.Host == null) || (this.Host != null && this.Host.Equals(cpuIncompatible.Host))) && ((this.LinkedView == null && cpuIncompatible.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cpuIncompatible.LinkedView))));\n        }\n\n        public override bool Equals(object cpuIncompatible)\n        {\n            return Equals(cpuIncompatible as CpuIncompatible);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Level + \"_\" + RegisterName + \"_\" + RegisterBits + \"_\" + DesiredBits + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CpuIncompatible_LinkedView : IEquatable<CpuIncompatible_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(CpuIncompatible_LinkedView cpuIncompatible_LinkedView)\n        {\n            return (cpuIncompatible_LinkedView != null && ((this.Host == null && cpuIncompatible_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(cpuIncompatible_LinkedView.Host))));\n        }\n\n        public override bool Equals(object cpuIncompatible_LinkedView)\n        {\n            return Equals(cpuIncompatible_LinkedView as CpuIncompatible_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class CpuIncompatible1ECX : CpuIncompatible, IEquatable<CpuIncompatible1ECX>\n    {\n        public bool Sse3 { get; set; }\n\n        public bool Pclmulqdq { get; set; }\n\n        public bool Ssse3 { get; set; }\n\n        public bool Sse41 { get; set; }\n\n        public bool Sse42 { get; set; }\n\n        public bool Aes { get; set; }\n\n        public bool Other { get; set; }\n\n        public bool OtherOnly { get; set; }\n\n        public new CpuIncompatible1ECX_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CpuIncompatible1ECX cpuIncompatible1ECX)\n        {\n            return (cpuIncompatible1ECX != null && this.Sse3 == cpuIncompatible1ECX.Sse3 && this.Pclmulqdq == cpuIncompatible1ECX.Pclmulqdq && this.Ssse3 == cpuIncompatible1ECX.Ssse3 && this.Sse41 == cpuIncompatible1ECX.Sse41 && this.Sse42 == cpuIncompatible1ECX.Sse42 && this.Aes == cpuIncompatible1ECX.Aes && this.Other == cpuIncompatible1ECX.Other && this.OtherOnly == cpuIncompatible1ECX.OtherOnly && ((this.LinkedView == null && cpuIncompatible1ECX.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cpuIncompatible1ECX.LinkedView))));\n        }\n\n        public override bool Equals(object cpuIncompatible1ECX)\n        {\n            return Equals(cpuIncompatible1ECX as CpuIncompatible1ECX);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Sse3 + \"_\" + Pclmulqdq + \"_\" + Ssse3 + \"_\" + Sse41 + \"_\" + Sse42 + \"_\" + Aes + \"_\" + Other + \"_\" + OtherOnly + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CpuIncompatible1ECX_LinkedView : CpuIncompatible_LinkedView, IEquatable<CpuIncompatible1ECX_LinkedView>\n    {\n        public bool Equals(CpuIncompatible1ECX_LinkedView cpuIncompatible1ECX_LinkedView)\n        {\n            return (cpuIncompatible1ECX_LinkedView != null && base.Equals(cpuIncompatible1ECX_LinkedView));\n        }\n\n        public override bool Equals(object cpuIncompatible1ECX_LinkedView)\n        {\n            return Equals(cpuIncompatible1ECX_LinkedView as CpuIncompatible1ECX_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CpuIncompatible81EDX : CpuIncompatible, IEquatable<CpuIncompatible81EDX>\n    {\n        public bool Nx { get; set; }\n\n        public bool Ffxsr { get; set; }\n\n        public bool Rdtscp { get; set; }\n\n        public bool Lm { get; set; }\n\n        public bool Other { get; set; }\n\n        public bool OtherOnly { get; set; }\n\n        public new CpuIncompatible81EDX_LinkedView LinkedView { get; set; }\n\n        public bool Equals(CpuIncompatible81EDX cpuIncompatible81EDX)\n        {\n            return (cpuIncompatible81EDX != null && this.Nx == cpuIncompatible81EDX.Nx && this.Ffxsr == cpuIncompatible81EDX.Ffxsr && this.Rdtscp == cpuIncompatible81EDX.Rdtscp && this.Lm == cpuIncompatible81EDX.Lm && this.Other == cpuIncompatible81EDX.Other && this.OtherOnly == cpuIncompatible81EDX.OtherOnly && ((this.LinkedView == null && cpuIncompatible81EDX.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(cpuIncompatible81EDX.LinkedView))));\n        }\n\n        public override bool Equals(object cpuIncompatible81EDX)\n        {\n            return Equals(cpuIncompatible81EDX as CpuIncompatible81EDX);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Nx + \"_\" + Ffxsr + \"_\" + Rdtscp + \"_\" + Lm + \"_\" + Other + \"_\" + OtherOnly + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class CpuIncompatible81EDX_LinkedView : CpuIncompatible_LinkedView, IEquatable<CpuIncompatible81EDX_LinkedView>\n    {\n        public bool Equals(CpuIncompatible81EDX_LinkedView cpuIncompatible81EDX_LinkedView)\n        {\n            return (cpuIncompatible81EDX_LinkedView != null && base.Equals(cpuIncompatible81EDX_LinkedView));\n        }\n\n        public override bool Equals(object cpuIncompatible81EDX_LinkedView)\n        {\n            return Equals(cpuIncompatible81EDX_LinkedView as CpuIncompatible81EDX_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CreateTaskAction : Action, IEquatable<CreateTaskAction>\n    {\n        public string TaskTypeId { get; set; }\n\n        public bool Cancelable { get; set; }\n\n        public bool Equals(CreateTaskAction createTaskAction)\n        {\n            return (createTaskAction != null && this.TaskTypeId == createTaskAction.TaskTypeId && this.Cancelable == createTaskAction.Cancelable);\n        }\n\n        public override bool Equals(object createTaskAction)\n        {\n            return Equals(createTaskAction as CreateTaskAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TaskTypeId + \"_\" + Cancelable).GetHashCode();\n        }\n    }\n\n    public class CryptoKeyId : DynamicData, IEquatable<CryptoKeyId>\n    {\n        public string KeyId { get; set; }\n\n        public KeyProviderId ProviderId { get; set; }\n\n        public bool Equals(CryptoKeyId cryptoKeyId)\n        {\n            return (cryptoKeyId != null && this.KeyId == cryptoKeyId.KeyId && ((this.ProviderId == null && cryptoKeyId.ProviderId == null) || (this.ProviderId != null && this.ProviderId.Equals(cryptoKeyId.ProviderId))));\n        }\n\n        public override bool Equals(object cryptoKeyId)\n        {\n            return Equals(cryptoKeyId as CryptoKeyId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyId + \"_\" + ProviderId).GetHashCode();\n        }\n    }\n\n    public class CryptoKeyPlain : DynamicData, IEquatable<CryptoKeyPlain>\n    {\n        public CryptoKeyId KeyId { get; set; }\n\n        public string Algorithm { get; set; }\n\n        public string KeyData { get; set; }\n\n        public bool Equals(CryptoKeyPlain cryptoKeyPlain)\n        {\n            return (cryptoKeyPlain != null && ((this.KeyId == null && cryptoKeyPlain.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(cryptoKeyPlain.KeyId))) && this.Algorithm == cryptoKeyPlain.Algorithm && this.KeyData == cryptoKeyPlain.KeyData);\n        }\n\n        public override bool Equals(object cryptoKeyPlain)\n        {\n            return Equals(cryptoKeyPlain as CryptoKeyPlain);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyId + \"_\" + Algorithm + \"_\" + KeyData).GetHashCode();\n        }\n    }\n\n    public class CryptoKeyResult : DynamicData, IEquatable<CryptoKeyResult>\n    {\n        public CryptoKeyId KeyId { get; set; }\n\n        public bool Success { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(CryptoKeyResult cryptoKeyResult)\n        {\n            return (cryptoKeyResult != null && ((this.KeyId == null && cryptoKeyResult.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(cryptoKeyResult.KeyId))) && this.Success == cryptoKeyResult.Success && this.Reason == cryptoKeyResult.Reason);\n        }\n\n        public override bool Equals(object cryptoKeyResult)\n        {\n            return Equals(cryptoKeyResult as CryptoKeyResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyId + \"_\" + Success + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class CryptoManager : ViewBase, IEquatable<CryptoManager>\n    {\n        public bool Enabled { get; set; }\n\n        public void AddKey(CryptoKeyPlain key)\n        {\n        }\n\n        public CryptoKeyResult[] AddKeys(CryptoKeyPlain[] keys)\n        {\n            return default(CryptoKeyResult[]);\n        }\n\n        public void RemoveKey(CryptoKeyId key, bool force)\n        {\n        }\n\n        public CryptoKeyResult[] RemoveKeys(CryptoKeyId[] keys, bool force)\n        {\n            return default(CryptoKeyResult[]);\n        }\n\n        public CryptoKeyId[] ListKeys(int? limit)\n        {\n            return default(CryptoKeyId[]);\n        }\n\n        public bool Equals(CryptoManager cryptoManager)\n        {\n            return (cryptoManager != null && this.Enabled == cryptoManager.Enabled);\n        }\n\n        public override bool Equals(object cryptoManager)\n        {\n            return Equals(cryptoManager as CryptoManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled).GetHashCode();\n        }\n    }\n\n    public class CryptoManagerHost : CryptoManager, IEquatable<CryptoManagerHost>\n    {\n        public void CryptoManagerHostPrepare()\n        {\n        }\n\n        public void CryptoManagerHostEnable(CryptoKeyPlain initialKey)\n        {\n        }\n\n        public ManagedObjectReference ChangeKey_Task(CryptoKeyPlain newKey)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ChangeKey(CryptoKeyPlain newKey)\n        {\n        }\n\n        public bool Equals(CryptoManagerHost cryptoManagerHost)\n        {\n            return (cryptoManagerHost != null && base.Equals(cryptoManagerHost));\n        }\n\n        public override bool Equals(object cryptoManagerHost)\n        {\n            return Equals(cryptoManagerHost as CryptoManagerHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CryptoManagerHostKMS : CryptoManagerHost, IEquatable<CryptoManagerHostKMS>\n    {\n        public bool Equals(CryptoManagerHostKMS cryptoManagerHostKMS)\n        {\n            return (cryptoManagerHostKMS != null && base.Equals(cryptoManagerHostKMS));\n        }\n\n        public override bool Equals(object cryptoManagerHostKMS)\n        {\n            return Equals(cryptoManagerHostKMS as CryptoManagerHostKMS);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CryptoManagerKmip : CryptoManager, IEquatable<CryptoManagerKmip>\n    {\n        public KmipClusterInfo[] KmipServers { get; set; }\n\n        public void RegisterKmipServer(KmipServerSpec server)\n        {\n        }\n\n        public void MarkDefault(KeyProviderId clusterId)\n        {\n        }\n\n        public void UpdateKmipServer(KmipServerSpec server)\n        {\n        }\n\n        public void RemoveKmipServer(KeyProviderId clusterId, string serverName)\n        {\n        }\n\n        public KmipClusterInfo[] ListKmipServers(int? limit)\n        {\n            return default(KmipClusterInfo[]);\n        }\n\n        public ManagedObjectReference RetrieveKmipServersStatus_Task(KmipClusterInfo[] clusters)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CryptoManagerKmipClusterStatus[] RetrieveKmipServersStatus(KmipClusterInfo[] clusters)\n        {\n            return default(CryptoManagerKmipClusterStatus[]);\n        }\n\n        public CryptoKeyResult GenerateKey(KeyProviderId keyProvider)\n        {\n            return default(CryptoKeyResult);\n        }\n\n        public CryptoManagerKmipServerCertInfo RetrieveKmipServerCert(KeyProviderId keyProvider, KmipServerInfo server)\n        {\n            return default(CryptoManagerKmipServerCertInfo);\n        }\n\n        public void UploadKmipServerCert(KeyProviderId cluster, string certificate)\n        {\n        }\n\n        public string GenerateSelfSignedClientCert(KeyProviderId cluster)\n        {\n            return default(string);\n        }\n\n        public string GenerateClientCsr(KeyProviderId cluster)\n        {\n            return default(string);\n        }\n\n        public string RetrieveSelfSignedClientCert(KeyProviderId cluster)\n        {\n            return default(string);\n        }\n\n        public string RetrieveClientCsr(KeyProviderId cluster)\n        {\n            return default(string);\n        }\n\n        public string RetrieveClientCert(KeyProviderId cluster)\n        {\n            return default(string);\n        }\n\n        public void UpdateSelfSignedClientCert(KeyProviderId cluster, string certificate)\n        {\n        }\n\n        public void UpdateKmsSignedCsrClientCert(KeyProviderId cluster, string certificate)\n        {\n        }\n\n        public void UploadClientCert(KeyProviderId cluster, string certificate, string privateKey)\n        {\n        }\n\n        public bool Equals(CryptoManagerKmip cryptoManagerKmip)\n        {\n            return (cryptoManagerKmip != null && ((this.KmipServers == null && cryptoManagerKmip.KmipServers == null) || (this.KmipServers != null && cryptoManagerKmip.KmipServers != null && Enumerable.SequenceEqual(this.KmipServers, cryptoManagerKmip.KmipServers))));\n        }\n\n        public override bool Equals(object cryptoManagerKmip)\n        {\n            return Equals(cryptoManagerKmip as CryptoManagerKmip);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KmipServers).GetHashCode();\n        }\n    }\n\n    public class CryptoManagerKmipCertificateInfo : DynamicData, IEquatable<CryptoManagerKmipCertificateInfo>\n    {\n        public string Subject { get; set; }\n\n        public string Issuer { get; set; }\n\n        public string SerialNumber { get; set; }\n\n        public DateTime NotBefore { get; set; }\n\n        public DateTime NotAfter { get; set; }\n\n        public string Fingerprint { get; set; }\n\n        public DateTime CheckTime { get; set; }\n\n        public int? SecondsSinceValid { get; set; }\n\n        public int? SecondsBeforeExpire { get; set; }\n\n        public bool Equals(CryptoManagerKmipCertificateInfo cryptoManagerKmipCertificateInfo)\n        {\n            return (cryptoManagerKmipCertificateInfo != null && this.Subject == cryptoManagerKmipCertificateInfo.Subject && this.Issuer == cryptoManagerKmipCertificateInfo.Issuer && this.SerialNumber == cryptoManagerKmipCertificateInfo.SerialNumber && this.NotBefore == cryptoManagerKmipCertificateInfo.NotBefore && this.NotAfter == cryptoManagerKmipCertificateInfo.NotAfter && this.Fingerprint == cryptoManagerKmipCertificateInfo.Fingerprint && this.CheckTime == cryptoManagerKmipCertificateInfo.CheckTime && ((this.SecondsSinceValid == null && cryptoManagerKmipCertificateInfo.SecondsSinceValid == null) || (this.SecondsSinceValid != null && this.SecondsSinceValid.Equals(cryptoManagerKmipCertificateInfo.SecondsSinceValid))) && ((this.SecondsBeforeExpire == null && cryptoManagerKmipCertificateInfo.SecondsBeforeExpire == null) || (this.SecondsBeforeExpire != null && this.SecondsBeforeExpire.Equals(cryptoManagerKmipCertificateInfo.SecondsBeforeExpire))));\n        }\n\n        public override bool Equals(object cryptoManagerKmipCertificateInfo)\n        {\n            return Equals(cryptoManagerKmipCertificateInfo as CryptoManagerKmipCertificateInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Subject + \"_\" + Issuer + \"_\" + SerialNumber + \"_\" + NotBefore + \"_\" + NotAfter + \"_\" + Fingerprint + \"_\" + CheckTime + \"_\" + SecondsSinceValid + \"_\" + SecondsBeforeExpire).GetHashCode();\n        }\n    }\n\n    public class CryptoManagerKmipClusterStatus : DynamicData, IEquatable<CryptoManagerKmipClusterStatus>\n    {\n        public KeyProviderId ClusterId { get; set; }\n\n        public CryptoManagerKmipServerStatus[] Servers { get; set; }\n\n        public CryptoManagerKmipCertificateInfo ClientCertInfo { get; set; }\n\n        public bool Equals(CryptoManagerKmipClusterStatus cryptoManagerKmipClusterStatus)\n        {\n            return (cryptoManagerKmipClusterStatus != null && ((this.ClusterId == null && cryptoManagerKmipClusterStatus.ClusterId == null) || (this.ClusterId != null && this.ClusterId.Equals(cryptoManagerKmipClusterStatus.ClusterId))) && ((this.Servers == null && cryptoManagerKmipClusterStatus.Servers == null) || (this.Servers != null && cryptoManagerKmipClusterStatus.Servers != null && Enumerable.SequenceEqual(this.Servers, cryptoManagerKmipClusterStatus.Servers))) && ((this.ClientCertInfo == null && cryptoManagerKmipClusterStatus.ClientCertInfo == null) || (this.ClientCertInfo != null && this.ClientCertInfo.Equals(cryptoManagerKmipClusterStatus.ClientCertInfo))));\n        }\n\n        public override bool Equals(object cryptoManagerKmipClusterStatus)\n        {\n            return Equals(cryptoManagerKmipClusterStatus as CryptoManagerKmipClusterStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterId + \"_\" + Servers + \"_\" + ClientCertInfo).GetHashCode();\n        }\n    }\n\n    public class CryptoManagerKmipServerCertInfo : DynamicData, IEquatable<CryptoManagerKmipServerCertInfo>\n    {\n        public string Certificate { get; set; }\n\n        public CryptoManagerKmipCertificateInfo CertInfo { get; set; }\n\n        public bool? ClientTrustServer { get; set; }\n\n        public bool Equals(CryptoManagerKmipServerCertInfo cryptoManagerKmipServerCertInfo)\n        {\n            return (cryptoManagerKmipServerCertInfo != null && this.Certificate == cryptoManagerKmipServerCertInfo.Certificate && ((this.CertInfo == null && cryptoManagerKmipServerCertInfo.CertInfo == null) || (this.CertInfo != null && this.CertInfo.Equals(cryptoManagerKmipServerCertInfo.CertInfo))) && ((this.ClientTrustServer == null && cryptoManagerKmipServerCertInfo.ClientTrustServer == null) || (this.ClientTrustServer != null && this.ClientTrustServer.Equals(cryptoManagerKmipServerCertInfo.ClientTrustServer))));\n        }\n\n        public override bool Equals(object cryptoManagerKmipServerCertInfo)\n        {\n            return Equals(cryptoManagerKmipServerCertInfo as CryptoManagerKmipServerCertInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Certificate + \"_\" + CertInfo + \"_\" + ClientTrustServer).GetHashCode();\n        }\n    }\n\n    public class CryptoManagerKmipServerStatus : DynamicData, IEquatable<CryptoManagerKmipServerStatus>\n    {\n        public string Name { get; set; }\n\n        public ManagedEntityStatus Status { get; set; }\n\n        public string ConnectionStatus { get; set; }\n\n        public CryptoManagerKmipCertificateInfo CertInfo { get; set; }\n\n        public bool? ClientTrustServer { get; set; }\n\n        public bool? ServerTrustClient { get; set; }\n\n        public bool Equals(CryptoManagerKmipServerStatus cryptoManagerKmipServerStatus)\n        {\n            return (cryptoManagerKmipServerStatus != null && this.Name == cryptoManagerKmipServerStatus.Name && this.Status == cryptoManagerKmipServerStatus.Status && this.ConnectionStatus == cryptoManagerKmipServerStatus.ConnectionStatus && ((this.CertInfo == null && cryptoManagerKmipServerStatus.CertInfo == null) || (this.CertInfo != null && this.CertInfo.Equals(cryptoManagerKmipServerStatus.CertInfo))) && ((this.ClientTrustServer == null && cryptoManagerKmipServerStatus.ClientTrustServer == null) || (this.ClientTrustServer != null && this.ClientTrustServer.Equals(cryptoManagerKmipServerStatus.ClientTrustServer))) && ((this.ServerTrustClient == null && cryptoManagerKmipServerStatus.ServerTrustClient == null) || (this.ServerTrustClient != null && this.ServerTrustClient.Equals(cryptoManagerKmipServerStatus.ServerTrustClient))));\n        }\n\n        public override bool Equals(object cryptoManagerKmipServerStatus)\n        {\n            return Equals(cryptoManagerKmipServerStatus as CryptoManagerKmipServerStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Status + \"_\" + ConnectionStatus + \"_\" + CertInfo + \"_\" + ClientTrustServer + \"_\" + ServerTrustClient).GetHashCode();\n        }\n    }\n\n    public class CryptoSpec : DynamicData, IEquatable<CryptoSpec>\n    {\n        public bool Equals(CryptoSpec cryptoSpec)\n        {\n            return (cryptoSpec != null && base.Equals(cryptoSpec));\n        }\n\n        public override bool Equals(object cryptoSpec)\n        {\n            return Equals(cryptoSpec as CryptoSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CryptoSpecDecrypt : CryptoSpec, IEquatable<CryptoSpecDecrypt>\n    {\n        public bool Equals(CryptoSpecDecrypt cryptoSpecDecrypt)\n        {\n            return (cryptoSpecDecrypt != null && base.Equals(cryptoSpecDecrypt));\n        }\n\n        public override bool Equals(object cryptoSpecDecrypt)\n        {\n            return Equals(cryptoSpecDecrypt as CryptoSpecDecrypt);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CryptoSpecDeepRecrypt : CryptoSpec, IEquatable<CryptoSpecDeepRecrypt>\n    {\n        public CryptoKeyId NewKeyId { get; set; }\n\n        public bool Equals(CryptoSpecDeepRecrypt cryptoSpecDeepRecrypt)\n        {\n            return (cryptoSpecDeepRecrypt != null && ((this.NewKeyId == null && cryptoSpecDeepRecrypt.NewKeyId == null) || (this.NewKeyId != null && this.NewKeyId.Equals(cryptoSpecDeepRecrypt.NewKeyId))));\n        }\n\n        public override bool Equals(object cryptoSpecDeepRecrypt)\n        {\n            return Equals(cryptoSpecDeepRecrypt as CryptoSpecDeepRecrypt);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NewKeyId).GetHashCode();\n        }\n    }\n\n    public class CryptoSpecEncrypt : CryptoSpec, IEquatable<CryptoSpecEncrypt>\n    {\n        public CryptoKeyId CryptoKeyId { get; set; }\n\n        public bool Equals(CryptoSpecEncrypt cryptoSpecEncrypt)\n        {\n            return (cryptoSpecEncrypt != null && ((this.CryptoKeyId == null && cryptoSpecEncrypt.CryptoKeyId == null) || (this.CryptoKeyId != null && this.CryptoKeyId.Equals(cryptoSpecEncrypt.CryptoKeyId))));\n        }\n\n        public override bool Equals(object cryptoSpecEncrypt)\n        {\n            return Equals(cryptoSpecEncrypt as CryptoSpecEncrypt);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CryptoKeyId).GetHashCode();\n        }\n    }\n\n    public class CryptoSpecNoOp : CryptoSpec, IEquatable<CryptoSpecNoOp>\n    {\n        public bool Equals(CryptoSpecNoOp cryptoSpecNoOp)\n        {\n            return (cryptoSpecNoOp != null && base.Equals(cryptoSpecNoOp));\n        }\n\n        public override bool Equals(object cryptoSpecNoOp)\n        {\n            return Equals(cryptoSpecNoOp as CryptoSpecNoOp);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CryptoSpecRegister : CryptoSpecNoOp, IEquatable<CryptoSpecRegister>\n    {\n        public CryptoKeyId CryptoKeyId { get; set; }\n\n        public bool Equals(CryptoSpecRegister cryptoSpecRegister)\n        {\n            return (cryptoSpecRegister != null && ((this.CryptoKeyId == null && cryptoSpecRegister.CryptoKeyId == null) || (this.CryptoKeyId != null && this.CryptoKeyId.Equals(cryptoSpecRegister.CryptoKeyId))));\n        }\n\n        public override bool Equals(object cryptoSpecRegister)\n        {\n            return Equals(cryptoSpecRegister as CryptoSpecRegister);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CryptoKeyId).GetHashCode();\n        }\n    }\n\n    public class CryptoSpecShallowRecrypt : CryptoSpec, IEquatable<CryptoSpecShallowRecrypt>\n    {\n        public CryptoKeyId NewKeyId { get; set; }\n\n        public bool Equals(CryptoSpecShallowRecrypt cryptoSpecShallowRecrypt)\n        {\n            return (cryptoSpecShallowRecrypt != null && ((this.NewKeyId == null && cryptoSpecShallowRecrypt.NewKeyId == null) || (this.NewKeyId != null && this.NewKeyId.Equals(cryptoSpecShallowRecrypt.NewKeyId))));\n        }\n\n        public override bool Equals(object cryptoSpecShallowRecrypt)\n        {\n            return Equals(cryptoSpecShallowRecrypt as CryptoSpecShallowRecrypt);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NewKeyId).GetHashCode();\n        }\n    }\n\n    public class CustomFieldDef : DynamicData, IEquatable<CustomFieldDef>\n    {\n        public int Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Type { get; set; }\n\n        public string ManagedObjectType { get; set; }\n\n        public PrivilegePolicyDef FieldDefPrivileges { get; set; }\n\n        public PrivilegePolicyDef FieldInstancePrivileges { get; set; }\n\n        public bool Equals(CustomFieldDef customFieldDef)\n        {\n            return (customFieldDef != null && this.Key == customFieldDef.Key && this.Name == customFieldDef.Name && this.Type == customFieldDef.Type && this.ManagedObjectType == customFieldDef.ManagedObjectType && ((this.FieldDefPrivileges == null && customFieldDef.FieldDefPrivileges == null) || (this.FieldDefPrivileges != null && this.FieldDefPrivileges.Equals(customFieldDef.FieldDefPrivileges))) && ((this.FieldInstancePrivileges == null && customFieldDef.FieldInstancePrivileges == null) || (this.FieldInstancePrivileges != null && this.FieldInstancePrivileges.Equals(customFieldDef.FieldInstancePrivileges))));\n        }\n\n        public override bool Equals(object customFieldDef)\n        {\n            return Equals(customFieldDef as CustomFieldDef);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Type + \"_\" + ManagedObjectType + \"_\" + FieldDefPrivileges + \"_\" + FieldInstancePrivileges).GetHashCode();\n        }\n    }\n\n    public class CustomFieldDefAddedEvent : CustomFieldDefEvent, IEquatable<CustomFieldDefAddedEvent>\n    {\n        public bool Equals(CustomFieldDefAddedEvent customFieldDefAddedEvent)\n        {\n            return (customFieldDefAddedEvent != null && base.Equals(customFieldDefAddedEvent));\n        }\n\n        public override bool Equals(object customFieldDefAddedEvent)\n        {\n            return Equals(customFieldDefAddedEvent as CustomFieldDefAddedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomFieldDefEvent : CustomFieldEvent, IEquatable<CustomFieldDefEvent>\n    {\n        public int FieldKey { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(CustomFieldDefEvent customFieldDefEvent)\n        {\n            return (customFieldDefEvent != null && this.FieldKey == customFieldDefEvent.FieldKey && this.Name == customFieldDefEvent.Name);\n        }\n\n        public override bool Equals(object customFieldDefEvent)\n        {\n            return Equals(customFieldDefEvent as CustomFieldDefEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FieldKey + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class CustomFieldDefRemovedEvent : CustomFieldDefEvent, IEquatable<CustomFieldDefRemovedEvent>\n    {\n        public bool Equals(CustomFieldDefRemovedEvent customFieldDefRemovedEvent)\n        {\n            return (customFieldDefRemovedEvent != null && base.Equals(customFieldDefRemovedEvent));\n        }\n\n        public override bool Equals(object customFieldDefRemovedEvent)\n        {\n            return Equals(customFieldDefRemovedEvent as CustomFieldDefRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomFieldDefRenamedEvent : CustomFieldDefEvent, IEquatable<CustomFieldDefRenamedEvent>\n    {\n        public string NewName { get; set; }\n\n        public bool Equals(CustomFieldDefRenamedEvent customFieldDefRenamedEvent)\n        {\n            return (customFieldDefRenamedEvent != null && this.NewName == customFieldDefRenamedEvent.NewName);\n        }\n\n        public override bool Equals(object customFieldDefRenamedEvent)\n        {\n            return Equals(customFieldDefRenamedEvent as CustomFieldDefRenamedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NewName).GetHashCode();\n        }\n    }\n\n    public class CustomFieldEvent : Event, IEquatable<CustomFieldEvent>\n    {\n        public bool Equals(CustomFieldEvent customFieldEvent)\n        {\n            return (customFieldEvent != null && base.Equals(customFieldEvent));\n        }\n\n        public override bool Equals(object customFieldEvent)\n        {\n            return Equals(customFieldEvent as CustomFieldEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomFieldsManager : ViewBase, IEquatable<CustomFieldsManager>\n    {\n        public CustomFieldDef[] Field { get; set; }\n\n        public CustomFieldDef AddCustomFieldDef(string name, string moType, PrivilegePolicyDef fieldDefPolicy, PrivilegePolicyDef fieldPolicy)\n        {\n            return default(CustomFieldDef);\n        }\n\n        public void RemoveCustomFieldDef(int key)\n        {\n        }\n\n        public void RenameCustomFieldDef(int key, string name)\n        {\n        }\n\n        public void SetField(ManagedObjectReference entity, int key, string value)\n        {\n        }\n\n        public bool Equals(CustomFieldsManager customFieldsManager)\n        {\n            return (customFieldsManager != null && ((this.Field == null && customFieldsManager.Field == null) || (this.Field != null && customFieldsManager.Field != null && Enumerable.SequenceEqual(this.Field, customFieldsManager.Field))));\n        }\n\n        public override bool Equals(object customFieldsManager)\n        {\n            return Equals(customFieldsManager as CustomFieldsManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Field).GetHashCode();\n        }\n    }\n\n    public class CustomFieldStringValue : CustomFieldValue, IEquatable<CustomFieldStringValue>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(CustomFieldStringValue customFieldStringValue)\n        {\n            return (customFieldStringValue != null && this.Value == customFieldStringValue.Value);\n        }\n\n        public override bool Equals(object customFieldStringValue)\n        {\n            return Equals(customFieldStringValue as CustomFieldStringValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class CustomFieldValue : DynamicData, IEquatable<CustomFieldValue>\n    {\n        public int Key { get; set; }\n\n        public bool Equals(CustomFieldValue customFieldValue)\n        {\n            return (customFieldValue != null && this.Key == customFieldValue.Key);\n        }\n\n        public override bool Equals(object customFieldValue)\n        {\n            return Equals(customFieldValue as CustomFieldValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class CustomFieldValueChangedEvent : CustomFieldEvent, IEquatable<CustomFieldValueChangedEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public int FieldKey { get; set; }\n\n        public string Name { get; set; }\n\n        public string Value { get; set; }\n\n        public string PrevState { get; set; }\n\n        public bool Equals(CustomFieldValueChangedEvent customFieldValueChangedEvent)\n        {\n            return (customFieldValueChangedEvent != null && ((this.Entity == null && customFieldValueChangedEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(customFieldValueChangedEvent.Entity))) && this.FieldKey == customFieldValueChangedEvent.FieldKey && this.Name == customFieldValueChangedEvent.Name && this.Value == customFieldValueChangedEvent.Value && this.PrevState == customFieldValueChangedEvent.PrevState);\n        }\n\n        public override bool Equals(object customFieldValueChangedEvent)\n        {\n            return Equals(customFieldValueChangedEvent as CustomFieldValueChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + FieldKey + \"_\" + Name + \"_\" + Value + \"_\" + PrevState).GetHashCode();\n        }\n    }\n\n    public class CustomizationAdapterMapping : DynamicData, IEquatable<CustomizationAdapterMapping>\n    {\n        public string MacAddress { get; set; }\n\n        public CustomizationIPSettings Adapter { get; set; }\n\n        public bool Equals(CustomizationAdapterMapping customizationAdapterMapping)\n        {\n            return (customizationAdapterMapping != null && this.MacAddress == customizationAdapterMapping.MacAddress && ((this.Adapter == null && customizationAdapterMapping.Adapter == null) || (this.Adapter != null && this.Adapter.Equals(customizationAdapterMapping.Adapter))));\n        }\n\n        public override bool Equals(object customizationAdapterMapping)\n        {\n            return Equals(customizationAdapterMapping as CustomizationAdapterMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MacAddress + \"_\" + Adapter).GetHashCode();\n        }\n    }\n\n    public class CustomizationAutoIpV6Generator : CustomizationIpV6Generator, IEquatable<CustomizationAutoIpV6Generator>\n    {\n        public bool Equals(CustomizationAutoIpV6Generator customizationAutoIpV6Generator)\n        {\n            return (customizationAutoIpV6Generator != null && base.Equals(customizationAutoIpV6Generator));\n        }\n\n        public override bool Equals(object customizationAutoIpV6Generator)\n        {\n            return Equals(customizationAutoIpV6Generator as CustomizationAutoIpV6Generator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationCustomIpGenerator : CustomizationIpGenerator, IEquatable<CustomizationCustomIpGenerator>\n    {\n        public string Argument { get; set; }\n\n        public bool Equals(CustomizationCustomIpGenerator customizationCustomIpGenerator)\n        {\n            return (customizationCustomIpGenerator != null && this.Argument == customizationCustomIpGenerator.Argument);\n        }\n\n        public override bool Equals(object customizationCustomIpGenerator)\n        {\n            return Equals(customizationCustomIpGenerator as CustomizationCustomIpGenerator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Argument).GetHashCode();\n        }\n    }\n\n    public class CustomizationCustomIpV6Generator : CustomizationIpV6Generator, IEquatable<CustomizationCustomIpV6Generator>\n    {\n        public string Argument { get; set; }\n\n        public bool Equals(CustomizationCustomIpV6Generator customizationCustomIpV6Generator)\n        {\n            return (customizationCustomIpV6Generator != null && this.Argument == customizationCustomIpV6Generator.Argument);\n        }\n\n        public override bool Equals(object customizationCustomIpV6Generator)\n        {\n            return Equals(customizationCustomIpV6Generator as CustomizationCustomIpV6Generator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Argument).GetHashCode();\n        }\n    }\n\n    public class CustomizationCustomName : CustomizationName, IEquatable<CustomizationCustomName>\n    {\n        public string Argument { get; set; }\n\n        public bool Equals(CustomizationCustomName customizationCustomName)\n        {\n            return (customizationCustomName != null && this.Argument == customizationCustomName.Argument);\n        }\n\n        public override bool Equals(object customizationCustomName)\n        {\n            return Equals(customizationCustomName as CustomizationCustomName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Argument).GetHashCode();\n        }\n    }\n\n    public class CustomizationDhcpIpGenerator : CustomizationIpGenerator, IEquatable<CustomizationDhcpIpGenerator>\n    {\n        public bool Equals(CustomizationDhcpIpGenerator customizationDhcpIpGenerator)\n        {\n            return (customizationDhcpIpGenerator != null && base.Equals(customizationDhcpIpGenerator));\n        }\n\n        public override bool Equals(object customizationDhcpIpGenerator)\n        {\n            return Equals(customizationDhcpIpGenerator as CustomizationDhcpIpGenerator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationDhcpIpV6Generator : CustomizationIpV6Generator, IEquatable<CustomizationDhcpIpV6Generator>\n    {\n        public bool Equals(CustomizationDhcpIpV6Generator customizationDhcpIpV6Generator)\n        {\n            return (customizationDhcpIpV6Generator != null && base.Equals(customizationDhcpIpV6Generator));\n        }\n\n        public override bool Equals(object customizationDhcpIpV6Generator)\n        {\n            return Equals(customizationDhcpIpV6Generator as CustomizationDhcpIpV6Generator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationEvent : VmEvent, IEquatable<CustomizationEvent>\n    {\n        public string LogLocation { get; set; }\n\n        public bool Equals(CustomizationEvent customizationEvent)\n        {\n            return (customizationEvent != null && this.LogLocation == customizationEvent.LogLocation);\n        }\n\n        public override bool Equals(object customizationEvent)\n        {\n            return Equals(customizationEvent as CustomizationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LogLocation).GetHashCode();\n        }\n    }\n\n    public class CustomizationFailed : CustomizationEvent, IEquatable<CustomizationFailed>\n    {\n        public bool Equals(CustomizationFailed customizationFailed)\n        {\n            return (customizationFailed != null && base.Equals(customizationFailed));\n        }\n\n        public override bool Equals(object customizationFailed)\n        {\n            return Equals(customizationFailed as CustomizationFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationFault : VimFault, IEquatable<CustomizationFault>\n    {\n        public bool Equals(CustomizationFault customizationFault)\n        {\n            return (customizationFault != null && base.Equals(customizationFault));\n        }\n\n        public override bool Equals(object customizationFault)\n        {\n            return Equals(customizationFault as CustomizationFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationFixedIp : CustomizationIpGenerator, IEquatable<CustomizationFixedIp>\n    {\n        public string IpAddress { get; set; }\n\n        public bool Equals(CustomizationFixedIp customizationFixedIp)\n        {\n            return (customizationFixedIp != null && this.IpAddress == customizationFixedIp.IpAddress);\n        }\n\n        public override bool Equals(object customizationFixedIp)\n        {\n            return Equals(customizationFixedIp as CustomizationFixedIp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress).GetHashCode();\n        }\n    }\n\n    public class CustomizationFixedIpV6 : CustomizationIpV6Generator, IEquatable<CustomizationFixedIpV6>\n    {\n        public string IpAddress { get; set; }\n\n        public int SubnetMask { get; set; }\n\n        public bool Equals(CustomizationFixedIpV6 customizationFixedIpV6)\n        {\n            return (customizationFixedIpV6 != null && this.IpAddress == customizationFixedIpV6.IpAddress && this.SubnetMask == customizationFixedIpV6.SubnetMask);\n        }\n\n        public override bool Equals(object customizationFixedIpV6)\n        {\n            return Equals(customizationFixedIpV6 as CustomizationFixedIpV6);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + SubnetMask).GetHashCode();\n        }\n    }\n\n    public class CustomizationFixedName : CustomizationName, IEquatable<CustomizationFixedName>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(CustomizationFixedName customizationFixedName)\n        {\n            return (customizationFixedName != null && this.Name == customizationFixedName.Name);\n        }\n\n        public override bool Equals(object customizationFixedName)\n        {\n            return Equals(customizationFixedName as CustomizationFixedName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class CustomizationGlobalIPSettings : DynamicData, IEquatable<CustomizationGlobalIPSettings>\n    {\n        public string[] DnsSuffixList { get; set; }\n\n        public string[] DnsServerList { get; set; }\n\n        public bool Equals(CustomizationGlobalIPSettings customizationGlobalIPSettings)\n        {\n            return (customizationGlobalIPSettings != null && ((this.DnsSuffixList == null && customizationGlobalIPSettings.DnsSuffixList == null) || (this.DnsSuffixList != null && customizationGlobalIPSettings.DnsSuffixList != null && Enumerable.SequenceEqual(this.DnsSuffixList, customizationGlobalIPSettings.DnsSuffixList))) && ((this.DnsServerList == null && customizationGlobalIPSettings.DnsServerList == null) || (this.DnsServerList != null && customizationGlobalIPSettings.DnsServerList != null && Enumerable.SequenceEqual(this.DnsServerList, customizationGlobalIPSettings.DnsServerList))));\n        }\n\n        public override bool Equals(object customizationGlobalIPSettings)\n        {\n            return Equals(customizationGlobalIPSettings as CustomizationGlobalIPSettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DnsSuffixList + \"_\" + DnsServerList).GetHashCode();\n        }\n    }\n\n    public class CustomizationGuiRunOnce : DynamicData, IEquatable<CustomizationGuiRunOnce>\n    {\n        public string[] CommandList { get; set; }\n\n        public bool Equals(CustomizationGuiRunOnce customizationGuiRunOnce)\n        {\n            return (customizationGuiRunOnce != null && ((this.CommandList == null && customizationGuiRunOnce.CommandList == null) || (this.CommandList != null && customizationGuiRunOnce.CommandList != null && Enumerable.SequenceEqual(this.CommandList, customizationGuiRunOnce.CommandList))));\n        }\n\n        public override bool Equals(object customizationGuiRunOnce)\n        {\n            return Equals(customizationGuiRunOnce as CustomizationGuiRunOnce);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CommandList).GetHashCode();\n        }\n    }\n\n    public class CustomizationGuiUnattended : DynamicData, IEquatable<CustomizationGuiUnattended>\n    {\n        public CustomizationPassword Password { get; set; }\n\n        public int TimeZone { get; set; }\n\n        public bool AutoLogon { get; set; }\n\n        public int AutoLogonCount { get; set; }\n\n        public bool Equals(CustomizationGuiUnattended customizationGuiUnattended)\n        {\n            return (customizationGuiUnattended != null && ((this.Password == null && customizationGuiUnattended.Password == null) || (this.Password != null && this.Password.Equals(customizationGuiUnattended.Password))) && this.TimeZone == customizationGuiUnattended.TimeZone && this.AutoLogon == customizationGuiUnattended.AutoLogon && this.AutoLogonCount == customizationGuiUnattended.AutoLogonCount);\n        }\n\n        public override bool Equals(object customizationGuiUnattended)\n        {\n            return Equals(customizationGuiUnattended as CustomizationGuiUnattended);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Password + \"_\" + TimeZone + \"_\" + AutoLogon + \"_\" + AutoLogonCount).GetHashCode();\n        }\n    }\n\n    public class CustomizationIdentification : DynamicData, IEquatable<CustomizationIdentification>\n    {\n        public string JoinWorkgroup { get; set; }\n\n        public string JoinDomain { get; set; }\n\n        public string DomainAdmin { get; set; }\n\n        public CustomizationPassword DomainAdminPassword { get; set; }\n\n        public bool Equals(CustomizationIdentification customizationIdentification)\n        {\n            return (customizationIdentification != null && this.JoinWorkgroup == customizationIdentification.JoinWorkgroup && this.JoinDomain == customizationIdentification.JoinDomain && this.DomainAdmin == customizationIdentification.DomainAdmin && ((this.DomainAdminPassword == null && customizationIdentification.DomainAdminPassword == null) || (this.DomainAdminPassword != null && this.DomainAdminPassword.Equals(customizationIdentification.DomainAdminPassword))));\n        }\n\n        public override bool Equals(object customizationIdentification)\n        {\n            return Equals(customizationIdentification as CustomizationIdentification);\n        }\n\n        public override int GetHashCode()\n        {\n            return (JoinWorkgroup + \"_\" + JoinDomain + \"_\" + DomainAdmin + \"_\" + DomainAdminPassword).GetHashCode();\n        }\n    }\n\n    public class CustomizationIdentitySettings : DynamicData, IEquatable<CustomizationIdentitySettings>\n    {\n        public bool Equals(CustomizationIdentitySettings customizationIdentitySettings)\n        {\n            return (customizationIdentitySettings != null && base.Equals(customizationIdentitySettings));\n        }\n\n        public override bool Equals(object customizationIdentitySettings)\n        {\n            return Equals(customizationIdentitySettings as CustomizationIdentitySettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationIpGenerator : DynamicData, IEquatable<CustomizationIpGenerator>\n    {\n        public bool Equals(CustomizationIpGenerator customizationIpGenerator)\n        {\n            return (customizationIpGenerator != null && base.Equals(customizationIpGenerator));\n        }\n\n        public override bool Equals(object customizationIpGenerator)\n        {\n            return Equals(customizationIpGenerator as CustomizationIpGenerator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationIPSettings : DynamicData, IEquatable<CustomizationIPSettings>\n    {\n        public CustomizationIpGenerator Ip { get; set; }\n\n        public string SubnetMask { get; set; }\n\n        public string[] Gateway { get; set; }\n\n        public CustomizationIPSettingsIpV6AddressSpec IpV6Spec { get; set; }\n\n        public string[] DnsServerList { get; set; }\n\n        public string DnsDomain { get; set; }\n\n        public string PrimaryWINS { get; set; }\n\n        public string SecondaryWINS { get; set; }\n\n        public CustomizationNetBIOSMode? NetBIOS { get; set; }\n\n        public bool Equals(CustomizationIPSettings customizationIPSettings)\n        {\n            return (customizationIPSettings != null && ((this.Ip == null && customizationIPSettings.Ip == null) || (this.Ip != null && this.Ip.Equals(customizationIPSettings.Ip))) && this.SubnetMask == customizationIPSettings.SubnetMask && ((this.Gateway == null && customizationIPSettings.Gateway == null) || (this.Gateway != null && customizationIPSettings.Gateway != null && Enumerable.SequenceEqual(this.Gateway, customizationIPSettings.Gateway))) && ((this.IpV6Spec == null && customizationIPSettings.IpV6Spec == null) || (this.IpV6Spec != null && this.IpV6Spec.Equals(customizationIPSettings.IpV6Spec))) && ((this.DnsServerList == null && customizationIPSettings.DnsServerList == null) || (this.DnsServerList != null && customizationIPSettings.DnsServerList != null && Enumerable.SequenceEqual(this.DnsServerList, customizationIPSettings.DnsServerList))) && this.DnsDomain == customizationIPSettings.DnsDomain && this.PrimaryWINS == customizationIPSettings.PrimaryWINS && this.SecondaryWINS == customizationIPSettings.SecondaryWINS && ((this.NetBIOS == null && customizationIPSettings.NetBIOS == null) || (this.NetBIOS != null && this.NetBIOS.Equals(customizationIPSettings.NetBIOS))));\n        }\n\n        public override bool Equals(object customizationIPSettings)\n        {\n            return Equals(customizationIPSettings as CustomizationIPSettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ip + \"_\" + SubnetMask + \"_\" + Gateway + \"_\" + IpV6Spec + \"_\" + DnsServerList + \"_\" + DnsDomain + \"_\" + PrimaryWINS + \"_\" + SecondaryWINS + \"_\" + NetBIOS).GetHashCode();\n        }\n    }\n\n    public class CustomizationIPSettingsIpV6AddressSpec : DynamicData, IEquatable<CustomizationIPSettingsIpV6AddressSpec>\n    {\n        public CustomizationIpV6Generator[] Ip { get; set; }\n\n        public string[] Gateway { get; set; }\n\n        public bool Equals(CustomizationIPSettingsIpV6AddressSpec customizationIPSettingsIpV6AddressSpec)\n        {\n            return (customizationIPSettingsIpV6AddressSpec != null && ((this.Ip == null && customizationIPSettingsIpV6AddressSpec.Ip == null) || (this.Ip != null && customizationIPSettingsIpV6AddressSpec.Ip != null && Enumerable.SequenceEqual(this.Ip, customizationIPSettingsIpV6AddressSpec.Ip))) && ((this.Gateway == null && customizationIPSettingsIpV6AddressSpec.Gateway == null) || (this.Gateway != null && customizationIPSettingsIpV6AddressSpec.Gateway != null && Enumerable.SequenceEqual(this.Gateway, customizationIPSettingsIpV6AddressSpec.Gateway))));\n        }\n\n        public override bool Equals(object customizationIPSettingsIpV6AddressSpec)\n        {\n            return Equals(customizationIPSettingsIpV6AddressSpec as CustomizationIPSettingsIpV6AddressSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ip + \"_\" + Gateway).GetHashCode();\n        }\n    }\n\n    public class CustomizationIpV6Generator : DynamicData, IEquatable<CustomizationIpV6Generator>\n    {\n        public bool Equals(CustomizationIpV6Generator customizationIpV6Generator)\n        {\n            return (customizationIpV6Generator != null && base.Equals(customizationIpV6Generator));\n        }\n\n        public override bool Equals(object customizationIpV6Generator)\n        {\n            return Equals(customizationIpV6Generator as CustomizationIpV6Generator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationLicenseFilePrintData : DynamicData, IEquatable<CustomizationLicenseFilePrintData>\n    {\n        public CustomizationLicenseDataMode AutoMode { get; set; }\n\n        public int? AutoUsers { get; set; }\n\n        public bool Equals(CustomizationLicenseFilePrintData customizationLicenseFilePrintData)\n        {\n            return (customizationLicenseFilePrintData != null && this.AutoMode == customizationLicenseFilePrintData.AutoMode && ((this.AutoUsers == null && customizationLicenseFilePrintData.AutoUsers == null) || (this.AutoUsers != null && this.AutoUsers.Equals(customizationLicenseFilePrintData.AutoUsers))));\n        }\n\n        public override bool Equals(object customizationLicenseFilePrintData)\n        {\n            return Equals(customizationLicenseFilePrintData as CustomizationLicenseFilePrintData);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoMode + \"_\" + AutoUsers).GetHashCode();\n        }\n    }\n\n    public class CustomizationLinuxIdentityFailed : CustomizationFailed, IEquatable<CustomizationLinuxIdentityFailed>\n    {\n        public bool Equals(CustomizationLinuxIdentityFailed customizationLinuxIdentityFailed)\n        {\n            return (customizationLinuxIdentityFailed != null && base.Equals(customizationLinuxIdentityFailed));\n        }\n\n        public override bool Equals(object customizationLinuxIdentityFailed)\n        {\n            return Equals(customizationLinuxIdentityFailed as CustomizationLinuxIdentityFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationLinuxOptions : CustomizationOptions, IEquatable<CustomizationLinuxOptions>\n    {\n        public bool Equals(CustomizationLinuxOptions customizationLinuxOptions)\n        {\n            return (customizationLinuxOptions != null && base.Equals(customizationLinuxOptions));\n        }\n\n        public override bool Equals(object customizationLinuxOptions)\n        {\n            return Equals(customizationLinuxOptions as CustomizationLinuxOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationLinuxPrep : CustomizationIdentitySettings, IEquatable<CustomizationLinuxPrep>\n    {\n        public CustomizationName HostName { get; set; }\n\n        public string Domain { get; set; }\n\n        public string TimeZone { get; set; }\n\n        public bool? HwClockUTC { get; set; }\n\n        public bool Equals(CustomizationLinuxPrep customizationLinuxPrep)\n        {\n            return (customizationLinuxPrep != null && ((this.HostName == null && customizationLinuxPrep.HostName == null) || (this.HostName != null && this.HostName.Equals(customizationLinuxPrep.HostName))) && this.Domain == customizationLinuxPrep.Domain && this.TimeZone == customizationLinuxPrep.TimeZone && ((this.HwClockUTC == null && customizationLinuxPrep.HwClockUTC == null) || (this.HwClockUTC != null && this.HwClockUTC.Equals(customizationLinuxPrep.HwClockUTC))));\n        }\n\n        public override bool Equals(object customizationLinuxPrep)\n        {\n            return Equals(customizationLinuxPrep as CustomizationLinuxPrep);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Domain + \"_\" + TimeZone + \"_\" + HwClockUTC).GetHashCode();\n        }\n    }\n\n    public class CustomizationName : DynamicData, IEquatable<CustomizationName>\n    {\n        public bool Equals(CustomizationName customizationName)\n        {\n            return (customizationName != null && base.Equals(customizationName));\n        }\n\n        public override bool Equals(object customizationName)\n        {\n            return Equals(customizationName as CustomizationName);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationNetworkSetupFailed : CustomizationFailed, IEquatable<CustomizationNetworkSetupFailed>\n    {\n        public bool Equals(CustomizationNetworkSetupFailed customizationNetworkSetupFailed)\n        {\n            return (customizationNetworkSetupFailed != null && base.Equals(customizationNetworkSetupFailed));\n        }\n\n        public override bool Equals(object customizationNetworkSetupFailed)\n        {\n            return Equals(customizationNetworkSetupFailed as CustomizationNetworkSetupFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationOptions : DynamicData, IEquatable<CustomizationOptions>\n    {\n        public bool Equals(CustomizationOptions customizationOptions)\n        {\n            return (customizationOptions != null && base.Equals(customizationOptions));\n        }\n\n        public override bool Equals(object customizationOptions)\n        {\n            return Equals(customizationOptions as CustomizationOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationPassword : DynamicData, IEquatable<CustomizationPassword>\n    {\n        public string Value { get; set; }\n\n        public bool PlainText { get; set; }\n\n        public bool Equals(CustomizationPassword customizationPassword)\n        {\n            return (customizationPassword != null && this.Value == customizationPassword.Value && this.PlainText == customizationPassword.PlainText);\n        }\n\n        public override bool Equals(object customizationPassword)\n        {\n            return Equals(customizationPassword as CustomizationPassword);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value + \"_\" + PlainText).GetHashCode();\n        }\n    }\n\n    public class CustomizationPending : CustomizationFault, IEquatable<CustomizationPending>\n    {\n        public bool Equals(CustomizationPending customizationPending)\n        {\n            return (customizationPending != null && base.Equals(customizationPending));\n        }\n\n        public override bool Equals(object customizationPending)\n        {\n            return Equals(customizationPending as CustomizationPending);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationPrefixName : CustomizationName, IEquatable<CustomizationPrefixName>\n    {\n        public string Base { get; set; }\n\n        public bool Equals(CustomizationPrefixName customizationPrefixName)\n        {\n            return (customizationPrefixName != null && this.Base == customizationPrefixName.Base);\n        }\n\n        public override bool Equals(object customizationPrefixName)\n        {\n            return Equals(customizationPrefixName as CustomizationPrefixName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Base).GetHashCode();\n        }\n    }\n\n    public class CustomizationSpec : DynamicData, IEquatable<CustomizationSpec>\n    {\n        public CustomizationOptions Options { get; set; }\n\n        public CustomizationIdentitySettings Identity { get; set; }\n\n        public CustomizationGlobalIPSettings GlobalIPSettings { get; set; }\n\n        public CustomizationAdapterMapping[] NicSettingMap { get; set; }\n\n        public sbyte[] EncryptionKey { get; set; }\n\n        public bool Equals(CustomizationSpec customizationSpec)\n        {\n            return (customizationSpec != null && ((this.Options == null && customizationSpec.Options == null) || (this.Options != null && this.Options.Equals(customizationSpec.Options))) && ((this.Identity == null && customizationSpec.Identity == null) || (this.Identity != null && this.Identity.Equals(customizationSpec.Identity))) && ((this.GlobalIPSettings == null && customizationSpec.GlobalIPSettings == null) || (this.GlobalIPSettings != null && this.GlobalIPSettings.Equals(customizationSpec.GlobalIPSettings))) && ((this.NicSettingMap == null && customizationSpec.NicSettingMap == null) || (this.NicSettingMap != null && customizationSpec.NicSettingMap != null && Enumerable.SequenceEqual(this.NicSettingMap, customizationSpec.NicSettingMap))) && ((this.EncryptionKey == null && customizationSpec.EncryptionKey == null) || (this.EncryptionKey != null && customizationSpec.EncryptionKey != null && Enumerable.SequenceEqual(this.EncryptionKey, customizationSpec.EncryptionKey))));\n        }\n\n        public override bool Equals(object customizationSpec)\n        {\n            return Equals(customizationSpec as CustomizationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Options + \"_\" + Identity + \"_\" + GlobalIPSettings + \"_\" + NicSettingMap + \"_\" + EncryptionKey).GetHashCode();\n        }\n    }\n\n    public class CustomizationSpecInfo : DynamicData, IEquatable<CustomizationSpecInfo>\n    {\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public string Type { get; set; }\n\n        public string ChangeVersion { get; set; }\n\n        public DateTime? LastUpdateTime { get; set; }\n\n        public bool Equals(CustomizationSpecInfo customizationSpecInfo)\n        {\n            return (customizationSpecInfo != null && this.Name == customizationSpecInfo.Name && this.Description == customizationSpecInfo.Description && this.Type == customizationSpecInfo.Type && this.ChangeVersion == customizationSpecInfo.ChangeVersion && ((this.LastUpdateTime == null && customizationSpecInfo.LastUpdateTime == null) || (this.LastUpdateTime != null && this.LastUpdateTime.Equals(customizationSpecInfo.LastUpdateTime))));\n        }\n\n        public override bool Equals(object customizationSpecInfo)\n        {\n            return Equals(customizationSpecInfo as CustomizationSpecInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Description + \"_\" + Type + \"_\" + ChangeVersion + \"_\" + LastUpdateTime).GetHashCode();\n        }\n    }\n\n    public class CustomizationSpecItem : DynamicData, IEquatable<CustomizationSpecItem>\n    {\n        public CustomizationSpecInfo Info { get; set; }\n\n        public CustomizationSpec Spec { get; set; }\n\n        public bool Equals(CustomizationSpecItem customizationSpecItem)\n        {\n            return (customizationSpecItem != null && ((this.Info == null && customizationSpecItem.Info == null) || (this.Info != null && this.Info.Equals(customizationSpecItem.Info))) && ((this.Spec == null && customizationSpecItem.Spec == null) || (this.Spec != null && this.Spec.Equals(customizationSpecItem.Spec))));\n        }\n\n        public override bool Equals(object customizationSpecItem)\n        {\n            return Equals(customizationSpecItem as CustomizationSpecItem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class CustomizationSpecManager : ViewBase, IEquatable<CustomizationSpecManager>\n    {\n        public CustomizationSpecInfo[] Info { get; set; }\n\n        public sbyte[] EncryptionKey { get; set; }\n\n        public bool DoesCustomizationSpecExist(string name)\n        {\n            return default(bool);\n        }\n\n        public CustomizationSpecItem GetCustomizationSpec(string name)\n        {\n            return default(CustomizationSpecItem);\n        }\n\n        public void CreateCustomizationSpec(CustomizationSpecItem item)\n        {\n        }\n\n        public void OverwriteCustomizationSpec(CustomizationSpecItem item)\n        {\n        }\n\n        public void DeleteCustomizationSpec(string name)\n        {\n        }\n\n        public void DuplicateCustomizationSpec(string name, string newName)\n        {\n        }\n\n        public void RenameCustomizationSpec(string name, string newName)\n        {\n        }\n\n        public string CustomizationSpecItemToXml(CustomizationSpecItem item)\n        {\n            return default(string);\n        }\n\n        public CustomizationSpecItem XmlToCustomizationSpecItem(string specItemXml)\n        {\n            return default(CustomizationSpecItem);\n        }\n\n        public void CheckCustomizationResources(string guestOs)\n        {\n        }\n\n        public bool Equals(CustomizationSpecManager customizationSpecManager)\n        {\n            return (customizationSpecManager != null && ((this.Info == null && customizationSpecManager.Info == null) || (this.Info != null && customizationSpecManager.Info != null && Enumerable.SequenceEqual(this.Info, customizationSpecManager.Info))) && ((this.EncryptionKey == null && customizationSpecManager.EncryptionKey == null) || (this.EncryptionKey != null && customizationSpecManager.EncryptionKey != null && Enumerable.SequenceEqual(this.EncryptionKey, customizationSpecManager.EncryptionKey))));\n        }\n\n        public override bool Equals(object customizationSpecManager)\n        {\n            return Equals(customizationSpecManager as CustomizationSpecManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info + \"_\" + EncryptionKey).GetHashCode();\n        }\n    }\n\n    public class CustomizationStartedEvent : CustomizationEvent, IEquatable<CustomizationStartedEvent>\n    {\n        public bool Equals(CustomizationStartedEvent customizationStartedEvent)\n        {\n            return (customizationStartedEvent != null && base.Equals(customizationStartedEvent));\n        }\n\n        public override bool Equals(object customizationStartedEvent)\n        {\n            return Equals(customizationStartedEvent as CustomizationStartedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationStatelessIpV6Generator : CustomizationIpV6Generator, IEquatable<CustomizationStatelessIpV6Generator>\n    {\n        public bool Equals(CustomizationStatelessIpV6Generator customizationStatelessIpV6Generator)\n        {\n            return (customizationStatelessIpV6Generator != null && base.Equals(customizationStatelessIpV6Generator));\n        }\n\n        public override bool Equals(object customizationStatelessIpV6Generator)\n        {\n            return Equals(customizationStatelessIpV6Generator as CustomizationStatelessIpV6Generator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationSucceeded : CustomizationEvent, IEquatable<CustomizationSucceeded>\n    {\n        public bool Equals(CustomizationSucceeded customizationSucceeded)\n        {\n            return (customizationSucceeded != null && base.Equals(customizationSucceeded));\n        }\n\n        public override bool Equals(object customizationSucceeded)\n        {\n            return Equals(customizationSucceeded as CustomizationSucceeded);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationSysprep : CustomizationIdentitySettings, IEquatable<CustomizationSysprep>\n    {\n        public CustomizationGuiUnattended GuiUnattended { get; set; }\n\n        public CustomizationUserData UserData { get; set; }\n\n        public CustomizationGuiRunOnce GuiRunOnce { get; set; }\n\n        public CustomizationIdentification Identification { get; set; }\n\n        public CustomizationLicenseFilePrintData LicenseFilePrintData { get; set; }\n\n        public bool Equals(CustomizationSysprep customizationSysprep)\n        {\n            return (customizationSysprep != null && ((this.GuiUnattended == null && customizationSysprep.GuiUnattended == null) || (this.GuiUnattended != null && this.GuiUnattended.Equals(customizationSysprep.GuiUnattended))) && ((this.UserData == null && customizationSysprep.UserData == null) || (this.UserData != null && this.UserData.Equals(customizationSysprep.UserData))) && ((this.GuiRunOnce == null && customizationSysprep.GuiRunOnce == null) || (this.GuiRunOnce != null && this.GuiRunOnce.Equals(customizationSysprep.GuiRunOnce))) && ((this.Identification == null && customizationSysprep.Identification == null) || (this.Identification != null && this.Identification.Equals(customizationSysprep.Identification))) && ((this.LicenseFilePrintData == null && customizationSysprep.LicenseFilePrintData == null) || (this.LicenseFilePrintData != null && this.LicenseFilePrintData.Equals(customizationSysprep.LicenseFilePrintData))));\n        }\n\n        public override bool Equals(object customizationSysprep)\n        {\n            return Equals(customizationSysprep as CustomizationSysprep);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GuiUnattended + \"_\" + UserData + \"_\" + GuiRunOnce + \"_\" + Identification + \"_\" + LicenseFilePrintData).GetHashCode();\n        }\n    }\n\n    public class CustomizationSysprepFailed : CustomizationFailed, IEquatable<CustomizationSysprepFailed>\n    {\n        public string SysprepVersion { get; set; }\n\n        public string SystemVersion { get; set; }\n\n        public bool Equals(CustomizationSysprepFailed customizationSysprepFailed)\n        {\n            return (customizationSysprepFailed != null && this.SysprepVersion == customizationSysprepFailed.SysprepVersion && this.SystemVersion == customizationSysprepFailed.SystemVersion);\n        }\n\n        public override bool Equals(object customizationSysprepFailed)\n        {\n            return Equals(customizationSysprepFailed as CustomizationSysprepFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SysprepVersion + \"_\" + SystemVersion).GetHashCode();\n        }\n    }\n\n    public class CustomizationSysprepText : CustomizationIdentitySettings, IEquatable<CustomizationSysprepText>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(CustomizationSysprepText customizationSysprepText)\n        {\n            return (customizationSysprepText != null && this.Value == customizationSysprepText.Value);\n        }\n\n        public override bool Equals(object customizationSysprepText)\n        {\n            return Equals(customizationSysprepText as CustomizationSysprepText);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class CustomizationUnknownFailure : CustomizationFailed, IEquatable<CustomizationUnknownFailure>\n    {\n        public bool Equals(CustomizationUnknownFailure customizationUnknownFailure)\n        {\n            return (customizationUnknownFailure != null && base.Equals(customizationUnknownFailure));\n        }\n\n        public override bool Equals(object customizationUnknownFailure)\n        {\n            return Equals(customizationUnknownFailure as CustomizationUnknownFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationUnknownIpGenerator : CustomizationIpGenerator, IEquatable<CustomizationUnknownIpGenerator>\n    {\n        public bool Equals(CustomizationUnknownIpGenerator customizationUnknownIpGenerator)\n        {\n            return (customizationUnknownIpGenerator != null && base.Equals(customizationUnknownIpGenerator));\n        }\n\n        public override bool Equals(object customizationUnknownIpGenerator)\n        {\n            return Equals(customizationUnknownIpGenerator as CustomizationUnknownIpGenerator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationUnknownIpV6Generator : CustomizationIpV6Generator, IEquatable<CustomizationUnknownIpV6Generator>\n    {\n        public bool Equals(CustomizationUnknownIpV6Generator customizationUnknownIpV6Generator)\n        {\n            return (customizationUnknownIpV6Generator != null && base.Equals(customizationUnknownIpV6Generator));\n        }\n\n        public override bool Equals(object customizationUnknownIpV6Generator)\n        {\n            return Equals(customizationUnknownIpV6Generator as CustomizationUnknownIpV6Generator);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationUnknownName : CustomizationName, IEquatable<CustomizationUnknownName>\n    {\n        public bool Equals(CustomizationUnknownName customizationUnknownName)\n        {\n            return (customizationUnknownName != null && base.Equals(customizationUnknownName));\n        }\n\n        public override bool Equals(object customizationUnknownName)\n        {\n            return Equals(customizationUnknownName as CustomizationUnknownName);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationUserData : DynamicData, IEquatable<CustomizationUserData>\n    {\n        public string FullName { get; set; }\n\n        public string OrgName { get; set; }\n\n        public CustomizationName ComputerName { get; set; }\n\n        public string ProductId { get; set; }\n\n        public bool Equals(CustomizationUserData customizationUserData)\n        {\n            return (customizationUserData != null && this.FullName == customizationUserData.FullName && this.OrgName == customizationUserData.OrgName && ((this.ComputerName == null && customizationUserData.ComputerName == null) || (this.ComputerName != null && this.ComputerName.Equals(customizationUserData.ComputerName))) && this.ProductId == customizationUserData.ProductId);\n        }\n\n        public override bool Equals(object customizationUserData)\n        {\n            return Equals(customizationUserData as CustomizationUserData);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FullName + \"_\" + OrgName + \"_\" + ComputerName + \"_\" + ProductId).GetHashCode();\n        }\n    }\n\n    public class CustomizationVirtualMachineName : CustomizationName, IEquatable<CustomizationVirtualMachineName>\n    {\n        public bool Equals(CustomizationVirtualMachineName customizationVirtualMachineName)\n        {\n            return (customizationVirtualMachineName != null && base.Equals(customizationVirtualMachineName));\n        }\n\n        public override bool Equals(object customizationVirtualMachineName)\n        {\n            return Equals(customizationVirtualMachineName as CustomizationVirtualMachineName);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class CustomizationWinOptions : CustomizationOptions, IEquatable<CustomizationWinOptions>\n    {\n        public bool ChangeSID { get; set; }\n\n        public bool DeleteAccounts { get; set; }\n\n        public CustomizationSysprepRebootOption? Reboot { get; set; }\n\n        public bool Equals(CustomizationWinOptions customizationWinOptions)\n        {\n            return (customizationWinOptions != null && this.ChangeSID == customizationWinOptions.ChangeSID && this.DeleteAccounts == customizationWinOptions.DeleteAccounts && ((this.Reboot == null && customizationWinOptions.Reboot == null) || (this.Reboot != null && this.Reboot.Equals(customizationWinOptions.Reboot))));\n        }\n\n        public override bool Equals(object customizationWinOptions)\n        {\n            return Equals(customizationWinOptions as CustomizationWinOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeSID + \"_\" + DeleteAccounts + \"_\" + Reboot).GetHashCode();\n        }\n    }\n\n    public class DailyTaskScheduler : HourlyTaskScheduler, IEquatable<DailyTaskScheduler>\n    {\n        public int Hour { get; set; }\n\n        public bool Equals(DailyTaskScheduler dailyTaskScheduler)\n        {\n            return (dailyTaskScheduler != null && this.Hour == dailyTaskScheduler.Hour);\n        }\n\n        public override bool Equals(object dailyTaskScheduler)\n        {\n            return Equals(dailyTaskScheduler as DailyTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hour).GetHashCode();\n        }\n    }\n\n    public class DasAdmissionControlDisabledEvent : ClusterEvent, IEquatable<DasAdmissionControlDisabledEvent>\n    {\n        public bool Equals(DasAdmissionControlDisabledEvent dasAdmissionControlDisabledEvent)\n        {\n            return (dasAdmissionControlDisabledEvent != null && base.Equals(dasAdmissionControlDisabledEvent));\n        }\n\n        public override bool Equals(object dasAdmissionControlDisabledEvent)\n        {\n            return Equals(dasAdmissionControlDisabledEvent as DasAdmissionControlDisabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasAdmissionControlEnabledEvent : ClusterEvent, IEquatable<DasAdmissionControlEnabledEvent>\n    {\n        public bool Equals(DasAdmissionControlEnabledEvent dasAdmissionControlEnabledEvent)\n        {\n            return (dasAdmissionControlEnabledEvent != null && base.Equals(dasAdmissionControlEnabledEvent));\n        }\n\n        public override bool Equals(object dasAdmissionControlEnabledEvent)\n        {\n            return Equals(dasAdmissionControlEnabledEvent as DasAdmissionControlEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasAgentFoundEvent : ClusterEvent, IEquatable<DasAgentFoundEvent>\n    {\n        public bool Equals(DasAgentFoundEvent dasAgentFoundEvent)\n        {\n            return (dasAgentFoundEvent != null && base.Equals(dasAgentFoundEvent));\n        }\n\n        public override bool Equals(object dasAgentFoundEvent)\n        {\n            return Equals(dasAgentFoundEvent as DasAgentFoundEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasAgentUnavailableEvent : ClusterEvent, IEquatable<DasAgentUnavailableEvent>\n    {\n        public bool Equals(DasAgentUnavailableEvent dasAgentUnavailableEvent)\n        {\n            return (dasAgentUnavailableEvent != null && base.Equals(dasAgentUnavailableEvent));\n        }\n\n        public override bool Equals(object dasAgentUnavailableEvent)\n        {\n            return Equals(dasAgentUnavailableEvent as DasAgentUnavailableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasClusterIsolatedEvent : ClusterEvent, IEquatable<DasClusterIsolatedEvent>\n    {\n        public bool Equals(DasClusterIsolatedEvent dasClusterIsolatedEvent)\n        {\n            return (dasClusterIsolatedEvent != null && base.Equals(dasClusterIsolatedEvent));\n        }\n\n        public override bool Equals(object dasClusterIsolatedEvent)\n        {\n            return Equals(dasClusterIsolatedEvent as DasClusterIsolatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasConfigFault : VimFault, IEquatable<DasConfigFault>\n    {\n        public string Reason { get; set; }\n\n        public string Output { get; set; }\n\n        public Event[] Event { get; set; }\n\n        public bool Equals(DasConfigFault dasConfigFault)\n        {\n            return (dasConfigFault != null && this.Reason == dasConfigFault.Reason && this.Output == dasConfigFault.Output && ((this.Event == null && dasConfigFault.Event == null) || (this.Event != null && dasConfigFault.Event != null && Enumerable.SequenceEqual(this.Event, dasConfigFault.Event))));\n        }\n\n        public override bool Equals(object dasConfigFault)\n        {\n            return Equals(dasConfigFault as DasConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + Output + \"_\" + Event).GetHashCode();\n        }\n    }\n\n    public class DasDisabledEvent : ClusterEvent, IEquatable<DasDisabledEvent>\n    {\n        public bool Equals(DasDisabledEvent dasDisabledEvent)\n        {\n            return (dasDisabledEvent != null && base.Equals(dasDisabledEvent));\n        }\n\n        public override bool Equals(object dasDisabledEvent)\n        {\n            return Equals(dasDisabledEvent as DasDisabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasEnabledEvent : ClusterEvent, IEquatable<DasEnabledEvent>\n    {\n        public bool Equals(DasEnabledEvent dasEnabledEvent)\n        {\n            return (dasEnabledEvent != null && base.Equals(dasEnabledEvent));\n        }\n\n        public override bool Equals(object dasEnabledEvent)\n        {\n            return Equals(dasEnabledEvent as DasEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DasHeartbeatDatastoreInfo : DynamicData, IEquatable<DasHeartbeatDatastoreInfo>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public DasHeartbeatDatastoreInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DasHeartbeatDatastoreInfo dasHeartbeatDatastoreInfo)\n        {\n            return (dasHeartbeatDatastoreInfo != null && ((this.Datastore == null && dasHeartbeatDatastoreInfo.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(dasHeartbeatDatastoreInfo.Datastore))) && ((this.Hosts == null && dasHeartbeatDatastoreInfo.Hosts == null) || (this.Hosts != null && dasHeartbeatDatastoreInfo.Hosts != null && Enumerable.SequenceEqual(this.Hosts, dasHeartbeatDatastoreInfo.Hosts))) && ((this.LinkedView == null && dasHeartbeatDatastoreInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dasHeartbeatDatastoreInfo.LinkedView))));\n        }\n\n        public override bool Equals(object dasHeartbeatDatastoreInfo)\n        {\n            return Equals(dasHeartbeatDatastoreInfo as DasHeartbeatDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DasHeartbeatDatastoreInfo_LinkedView : IEquatable<DasHeartbeatDatastoreInfo_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(DasHeartbeatDatastoreInfo_LinkedView dasHeartbeatDatastoreInfo_LinkedView)\n        {\n            return (dasHeartbeatDatastoreInfo_LinkedView != null && ((this.Datastore == null && dasHeartbeatDatastoreInfo_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(dasHeartbeatDatastoreInfo_LinkedView.Datastore))) && ((this.Hosts == null && dasHeartbeatDatastoreInfo_LinkedView.Hosts == null) || (this.Hosts != null && dasHeartbeatDatastoreInfo_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, dasHeartbeatDatastoreInfo_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object dasHeartbeatDatastoreInfo_LinkedView)\n        {\n            return Equals(dasHeartbeatDatastoreInfo_LinkedView as DasHeartbeatDatastoreInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Hosts).GetHashCode();\n        }\n    }\n\n    public class DasHostFailedEvent : ClusterEvent, IEquatable<DasHostFailedEvent>\n    {\n        public HostEventArgument FailedHost { get; set; }\n\n        public bool Equals(DasHostFailedEvent dasHostFailedEvent)\n        {\n            return (dasHostFailedEvent != null && ((this.FailedHost == null && dasHostFailedEvent.FailedHost == null) || (this.FailedHost != null && this.FailedHost.Equals(dasHostFailedEvent.FailedHost))));\n        }\n\n        public override bool Equals(object dasHostFailedEvent)\n        {\n            return Equals(dasHostFailedEvent as DasHostFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailedHost).GetHashCode();\n        }\n    }\n\n    public class DasHostIsolatedEvent : ClusterEvent, IEquatable<DasHostIsolatedEvent>\n    {\n        public HostEventArgument IsolatedHost { get; set; }\n\n        public bool Equals(DasHostIsolatedEvent dasHostIsolatedEvent)\n        {\n            return (dasHostIsolatedEvent != null && ((this.IsolatedHost == null && dasHostIsolatedEvent.IsolatedHost == null) || (this.IsolatedHost != null && this.IsolatedHost.Equals(dasHostIsolatedEvent.IsolatedHost))));\n        }\n\n        public override bool Equals(object dasHostIsolatedEvent)\n        {\n            return Equals(dasHostIsolatedEvent as DasHostIsolatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsolatedHost).GetHashCode();\n        }\n    }\n\n    public class DatabaseError : RuntimeFault, IEquatable<DatabaseError>\n    {\n        public bool Equals(DatabaseError databaseError)\n        {\n            return (databaseError != null && base.Equals(databaseError));\n        }\n\n        public override bool Equals(object databaseError)\n        {\n            return Equals(databaseError as DatabaseError);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatabaseSizeEstimate : DynamicData, IEquatable<DatabaseSizeEstimate>\n    {\n        public long Size { get; set; }\n\n        public bool Equals(DatabaseSizeEstimate databaseSizeEstimate)\n        {\n            return (databaseSizeEstimate != null && this.Size == databaseSizeEstimate.Size);\n        }\n\n        public override bool Equals(object databaseSizeEstimate)\n        {\n            return Equals(databaseSizeEstimate as DatabaseSizeEstimate);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Size).GetHashCode();\n        }\n    }\n\n    public class DatabaseSizeParam : DynamicData, IEquatable<DatabaseSizeParam>\n    {\n        public InventoryDescription InventoryDesc { get; set; }\n\n        public PerformanceStatisticsDescription PerfStatsDesc { get; set; }\n\n        public bool Equals(DatabaseSizeParam databaseSizeParam)\n        {\n            return (databaseSizeParam != null && ((this.InventoryDesc == null && databaseSizeParam.InventoryDesc == null) || (this.InventoryDesc != null && this.InventoryDesc.Equals(databaseSizeParam.InventoryDesc))) && ((this.PerfStatsDesc == null && databaseSizeParam.PerfStatsDesc == null) || (this.PerfStatsDesc != null && this.PerfStatsDesc.Equals(databaseSizeParam.PerfStatsDesc))));\n        }\n\n        public override bool Equals(object databaseSizeParam)\n        {\n            return Equals(databaseSizeParam as DatabaseSizeParam);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InventoryDesc + \"_\" + PerfStatsDesc).GetHashCode();\n        }\n    }\n\n    public class Datacenter : ManagedEntity, IEquatable<Datacenter>\n    {\n        public ManagedObjectReference VmFolder { get; set; }\n\n        public ManagedObjectReference HostFolder { get; set; }\n\n        public ManagedObjectReference DatastoreFolder { get; set; }\n\n        public ManagedObjectReference NetworkFolder { get; set; }\n\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public ManagedObjectReference[] Network { get; set; }\n\n        public DatacenterConfigInfo Configuration { get; set; }\n\n        public new Datacenter_LinkedView LinkedView { get; set; }\n\n        public DatacenterBasicConnectInfo[] BatchQueryConnectInfo(HostConnectSpec[] hostSpecs)\n        {\n            return default(DatacenterBasicConnectInfo[]);\n        }\n\n        public HostConnectInfo QueryConnectionInfo(string hostname, int port, string username, string password, string sslThumbprint)\n        {\n            return default(HostConnectInfo);\n        }\n\n        public HostConnectInfo QueryConnectionInfoViaSpec(HostConnectSpec spec)\n        {\n            return default(HostConnectInfo);\n        }\n\n        public ManagedObjectReference PowerOnMultiVM_Task(ManagedObjectReference[] vm, OptionValue[] option)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterPowerOnVmResult PowerOnMultiVM(ManagedObjectReference[] vm, OptionValue[] option)\n        {\n            return default(ClusterPowerOnVmResult);\n        }\n\n        public VirtualMachineConfigOptionDescriptor[] queryDatacenterConfigOptionDescriptor()\n        {\n            return default(VirtualMachineConfigOptionDescriptor[]);\n        }\n\n        public ManagedObjectReference ReconfigureDatacenter_Task(DatacenterConfigSpec spec, bool modify)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureDatacenter(DatacenterConfigSpec spec, bool modify)\n        {\n        }\n\n        public bool Equals(Datacenter datacenter)\n        {\n            return (datacenter != null && ((this.VmFolder == null && datacenter.VmFolder == null) || (this.VmFolder != null && this.VmFolder.Equals(datacenter.VmFolder))) && ((this.HostFolder == null && datacenter.HostFolder == null) || (this.HostFolder != null && this.HostFolder.Equals(datacenter.HostFolder))) && ((this.DatastoreFolder == null && datacenter.DatastoreFolder == null) || (this.DatastoreFolder != null && this.DatastoreFolder.Equals(datacenter.DatastoreFolder))) && ((this.NetworkFolder == null && datacenter.NetworkFolder == null) || (this.NetworkFolder != null && this.NetworkFolder.Equals(datacenter.NetworkFolder))) && ((this.Datastore == null && datacenter.Datastore == null) || (this.Datastore != null && datacenter.Datastore != null && Enumerable.SequenceEqual(this.Datastore, datacenter.Datastore))) && ((this.Network == null && datacenter.Network == null) || (this.Network != null && datacenter.Network != null && Enumerable.SequenceEqual(this.Network, datacenter.Network))) && ((this.Configuration == null && datacenter.Configuration == null) || (this.Configuration != null && this.Configuration.Equals(datacenter.Configuration))) && ((this.LinkedView == null && datacenter.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datacenter.LinkedView))));\n        }\n\n        public override bool Equals(object datacenter)\n        {\n            return Equals(datacenter as Datacenter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmFolder + \"_\" + HostFolder + \"_\" + DatastoreFolder + \"_\" + NetworkFolder + \"_\" + Datastore + \"_\" + Network + \"_\" + Configuration + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class Datacenter_LinkedView : ManagedEntity_LinkedView, IEquatable<Datacenter_LinkedView>\n    {\n        public Folder VmFolder { get; set; }\n\n        public Folder HostFolder { get; set; }\n\n        public Folder DatastoreFolder { get; set; }\n\n        public Folder NetworkFolder { get; set; }\n\n        public Datastore[] Datastore { get; set; }\n\n        public Network[] Network { get; set; }\n\n        public bool Equals(Datacenter_LinkedView datacenter_LinkedView)\n        {\n            return (datacenter_LinkedView != null && ((this.VmFolder == null && datacenter_LinkedView.VmFolder == null) || (this.VmFolder != null && this.VmFolder.Equals(datacenter_LinkedView.VmFolder))) && ((this.HostFolder == null && datacenter_LinkedView.HostFolder == null) || (this.HostFolder != null && this.HostFolder.Equals(datacenter_LinkedView.HostFolder))) && ((this.DatastoreFolder == null && datacenter_LinkedView.DatastoreFolder == null) || (this.DatastoreFolder != null && this.DatastoreFolder.Equals(datacenter_LinkedView.DatastoreFolder))) && ((this.NetworkFolder == null && datacenter_LinkedView.NetworkFolder == null) || (this.NetworkFolder != null && this.NetworkFolder.Equals(datacenter_LinkedView.NetworkFolder))) && ((this.Datastore == null && datacenter_LinkedView.Datastore == null) || (this.Datastore != null && datacenter_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, datacenter_LinkedView.Datastore))) && ((this.Network == null && datacenter_LinkedView.Network == null) || (this.Network != null && datacenter_LinkedView.Network != null && Enumerable.SequenceEqual(this.Network, datacenter_LinkedView.Network))));\n        }\n\n        public override bool Equals(object datacenter_LinkedView)\n        {\n            return Equals(datacenter_LinkedView as Datacenter_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmFolder + \"_\" + HostFolder + \"_\" + DatastoreFolder + \"_\" + NetworkFolder + \"_\" + Datastore + \"_\" + Network).GetHashCode();\n        }\n    }\n\n    public class DatacenterBasicConnectInfo : DynamicData, IEquatable<DatacenterBasicConnectInfo>\n    {\n        public string Hostname { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public string ServerIp { get; set; }\n\n        public int? NumVm { get; set; }\n\n        public int? NumPoweredOnVm { get; set; }\n\n        public AboutInfo HostProductInfo { get; set; }\n\n        public string HardwareVendor { get; set; }\n\n        public string HardwareModel { get; set; }\n\n        public bool Equals(DatacenterBasicConnectInfo datacenterBasicConnectInfo)\n        {\n            return (datacenterBasicConnectInfo != null && this.Hostname == datacenterBasicConnectInfo.Hostname && ((this.Error == null && datacenterBasicConnectInfo.Error == null) || (this.Error != null && this.Error.Equals(datacenterBasicConnectInfo.Error))) && this.ServerIp == datacenterBasicConnectInfo.ServerIp && ((this.NumVm == null && datacenterBasicConnectInfo.NumVm == null) || (this.NumVm != null && this.NumVm.Equals(datacenterBasicConnectInfo.NumVm))) && ((this.NumPoweredOnVm == null && datacenterBasicConnectInfo.NumPoweredOnVm == null) || (this.NumPoweredOnVm != null && this.NumPoweredOnVm.Equals(datacenterBasicConnectInfo.NumPoweredOnVm))) && ((this.HostProductInfo == null && datacenterBasicConnectInfo.HostProductInfo == null) || (this.HostProductInfo != null && this.HostProductInfo.Equals(datacenterBasicConnectInfo.HostProductInfo))) && this.HardwareVendor == datacenterBasicConnectInfo.HardwareVendor && this.HardwareModel == datacenterBasicConnectInfo.HardwareModel);\n        }\n\n        public override bool Equals(object datacenterBasicConnectInfo)\n        {\n            return Equals(datacenterBasicConnectInfo as DatacenterBasicConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hostname + \"_\" + Error + \"_\" + ServerIp + \"_\" + NumVm + \"_\" + NumPoweredOnVm + \"_\" + HostProductInfo + \"_\" + HardwareVendor + \"_\" + HardwareModel).GetHashCode();\n        }\n    }\n\n    public class DatacenterConfigInfo : DynamicData, IEquatable<DatacenterConfigInfo>\n    {\n        public string DefaultHardwareVersionKey { get; set; }\n\n        public bool Equals(DatacenterConfigInfo datacenterConfigInfo)\n        {\n            return (datacenterConfigInfo != null && this.DefaultHardwareVersionKey == datacenterConfigInfo.DefaultHardwareVersionKey);\n        }\n\n        public override bool Equals(object datacenterConfigInfo)\n        {\n            return Equals(datacenterConfigInfo as DatacenterConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultHardwareVersionKey).GetHashCode();\n        }\n    }\n\n    public class DatacenterConfigSpec : DynamicData, IEquatable<DatacenterConfigSpec>\n    {\n        public string DefaultHardwareVersionKey { get; set; }\n\n        public bool Equals(DatacenterConfigSpec datacenterConfigSpec)\n        {\n            return (datacenterConfigSpec != null && this.DefaultHardwareVersionKey == datacenterConfigSpec.DefaultHardwareVersionKey);\n        }\n\n        public override bool Equals(object datacenterConfigSpec)\n        {\n            return Equals(datacenterConfigSpec as DatacenterConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultHardwareVersionKey).GetHashCode();\n        }\n    }\n\n    public class DatacenterCreatedEvent : DatacenterEvent, IEquatable<DatacenterCreatedEvent>\n    {\n        public FolderEventArgument Parent { get; set; }\n\n        public bool Equals(DatacenterCreatedEvent datacenterCreatedEvent)\n        {\n            return (datacenterCreatedEvent != null && ((this.Parent == null && datacenterCreatedEvent.Parent == null) || (this.Parent != null && this.Parent.Equals(datacenterCreatedEvent.Parent))));\n        }\n\n        public override bool Equals(object datacenterCreatedEvent)\n        {\n            return Equals(datacenterCreatedEvent as DatacenterCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent).GetHashCode();\n        }\n    }\n\n    public class DatacenterEvent : Event, IEquatable<DatacenterEvent>\n    {\n        public bool Equals(DatacenterEvent datacenterEvent)\n        {\n            return (datacenterEvent != null && base.Equals(datacenterEvent));\n        }\n\n        public override bool Equals(object datacenterEvent)\n        {\n            return Equals(datacenterEvent as DatacenterEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatacenterEventArgument : EntityEventArgument, IEquatable<DatacenterEventArgument>\n    {\n        public ManagedObjectReference Datacenter { get; set; }\n\n        public DatacenterEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatacenterEventArgument datacenterEventArgument)\n        {\n            return (datacenterEventArgument != null && ((this.Datacenter == null && datacenterEventArgument.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(datacenterEventArgument.Datacenter))) && ((this.LinkedView == null && datacenterEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datacenterEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object datacenterEventArgument)\n        {\n            return Equals(datacenterEventArgument as DatacenterEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datacenter + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatacenterEventArgument_LinkedView : IEquatable<DatacenterEventArgument_LinkedView>\n    {\n        public Datacenter Datacenter { get; set; }\n\n        public bool Equals(DatacenterEventArgument_LinkedView datacenterEventArgument_LinkedView)\n        {\n            return (datacenterEventArgument_LinkedView != null && ((this.Datacenter == null && datacenterEventArgument_LinkedView.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(datacenterEventArgument_LinkedView.Datacenter))));\n        }\n\n        public override bool Equals(object datacenterEventArgument_LinkedView)\n        {\n            return Equals(datacenterEventArgument_LinkedView as DatacenterEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datacenter).GetHashCode();\n        }\n    }\n\n    public class DatacenterMismatch : MigrationFault, IEquatable<DatacenterMismatch>\n    {\n        public DatacenterMismatchArgument[] InvalidArgument { get; set; }\n\n        public ManagedObjectReference ExpectedDatacenter { get; set; }\n\n        public DatacenterMismatch_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatacenterMismatch datacenterMismatch)\n        {\n            return (datacenterMismatch != null && ((this.InvalidArgument == null && datacenterMismatch.InvalidArgument == null) || (this.InvalidArgument != null && datacenterMismatch.InvalidArgument != null && Enumerable.SequenceEqual(this.InvalidArgument, datacenterMismatch.InvalidArgument))) && ((this.ExpectedDatacenter == null && datacenterMismatch.ExpectedDatacenter == null) || (this.ExpectedDatacenter != null && this.ExpectedDatacenter.Equals(datacenterMismatch.ExpectedDatacenter))) && ((this.LinkedView == null && datacenterMismatch.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datacenterMismatch.LinkedView))));\n        }\n\n        public override bool Equals(object datacenterMismatch)\n        {\n            return Equals(datacenterMismatch as DatacenterMismatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InvalidArgument + \"_\" + ExpectedDatacenter + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatacenterMismatch_LinkedView : IEquatable<DatacenterMismatch_LinkedView>\n    {\n        public Datacenter ExpectedDatacenter { get; set; }\n\n        public bool Equals(DatacenterMismatch_LinkedView datacenterMismatch_LinkedView)\n        {\n            return (datacenterMismatch_LinkedView != null && ((this.ExpectedDatacenter == null && datacenterMismatch_LinkedView.ExpectedDatacenter == null) || (this.ExpectedDatacenter != null && this.ExpectedDatacenter.Equals(datacenterMismatch_LinkedView.ExpectedDatacenter))));\n        }\n\n        public override bool Equals(object datacenterMismatch_LinkedView)\n        {\n            return Equals(datacenterMismatch_LinkedView as DatacenterMismatch_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExpectedDatacenter).GetHashCode();\n        }\n    }\n\n    public class DatacenterMismatchArgument : DynamicData, IEquatable<DatacenterMismatchArgument>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public ManagedObjectReference InputDatacenter { get; set; }\n\n        public DatacenterMismatchArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatacenterMismatchArgument datacenterMismatchArgument)\n        {\n            return (datacenterMismatchArgument != null && ((this.Entity == null && datacenterMismatchArgument.Entity == null) || (this.Entity != null && this.Entity.Equals(datacenterMismatchArgument.Entity))) && ((this.InputDatacenter == null && datacenterMismatchArgument.InputDatacenter == null) || (this.InputDatacenter != null && this.InputDatacenter.Equals(datacenterMismatchArgument.InputDatacenter))) && ((this.LinkedView == null && datacenterMismatchArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datacenterMismatchArgument.LinkedView))));\n        }\n\n        public override bool Equals(object datacenterMismatchArgument)\n        {\n            return Equals(datacenterMismatchArgument as DatacenterMismatchArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + InputDatacenter + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatacenterMismatchArgument_LinkedView : IEquatable<DatacenterMismatchArgument_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public Datacenter InputDatacenter { get; set; }\n\n        public bool Equals(DatacenterMismatchArgument_LinkedView datacenterMismatchArgument_LinkedView)\n        {\n            return (datacenterMismatchArgument_LinkedView != null && ((this.Entity == null && datacenterMismatchArgument_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(datacenterMismatchArgument_LinkedView.Entity))) && ((this.InputDatacenter == null && datacenterMismatchArgument_LinkedView.InputDatacenter == null) || (this.InputDatacenter != null && this.InputDatacenter.Equals(datacenterMismatchArgument_LinkedView.InputDatacenter))));\n        }\n\n        public override bool Equals(object datacenterMismatchArgument_LinkedView)\n        {\n            return Equals(datacenterMismatchArgument_LinkedView as DatacenterMismatchArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + InputDatacenter).GetHashCode();\n        }\n    }\n\n    public class DatacenterRenamedEvent : DatacenterEvent, IEquatable<DatacenterRenamedEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(DatacenterRenamedEvent datacenterRenamedEvent)\n        {\n            return (datacenterRenamedEvent != null && this.OldName == datacenterRenamedEvent.OldName && this.NewName == datacenterRenamedEvent.NewName);\n        }\n\n        public override bool Equals(object datacenterRenamedEvent)\n        {\n            return Equals(datacenterRenamedEvent as DatacenterRenamedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class Datastore : ManagedEntity, IEquatable<Datastore>\n    {\n        public DatastoreInfo Info { get; set; }\n\n        public DatastoreSummary Summary { get; set; }\n\n        public DatastoreHostMount[] Host { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ManagedObjectReference Browser { get; set; }\n\n        public DatastoreCapability Capability { get; set; }\n\n        public StorageIORMInfo IormConfiguration { get; set; }\n\n        public new Datastore_LinkedView LinkedView { get; set; }\n\n        public void RefreshDatastore()\n        {\n        }\n\n        public void RefreshDatastoreStorageInfo()\n        {\n        }\n\n        public ManagedObjectReference UpdateVirtualMachineFiles_Task(DatastoreMountPathDatastorePair[] mountPathDatastoreMapping)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public UpdateVirtualMachineFilesResult UpdateVirtualMachineFiles(DatastoreMountPathDatastorePair[] mountPathDatastoreMapping)\n        {\n            return default(UpdateVirtualMachineFilesResult);\n        }\n\n        public void RenameDatastore(string newName)\n        {\n        }\n\n        public void DestroyDatastore()\n        {\n        }\n\n        public StoragePlacementResult DatastoreEnterMaintenanceMode()\n        {\n            return default(StoragePlacementResult);\n        }\n\n        public ManagedObjectReference DatastoreExitMaintenanceMode_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DatastoreExitMaintenanceMode()\n        {\n        }\n\n        public ManagedObjectReference UpdateVVolVirtualMachineFiles_Task(DatastoreVVolContainerFailoverPair[] failoverPair)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VVolVmConfigFileUpdateResult UpdateVVolVirtualMachineFiles(DatastoreVVolContainerFailoverPair[] failoverPair)\n        {\n            return default(VVolVmConfigFileUpdateResult);\n        }\n\n        public bool Equals(Datastore datastore)\n        {\n            return (datastore != null && ((this.Info == null && datastore.Info == null) || (this.Info != null && this.Info.Equals(datastore.Info))) && ((this.Summary == null && datastore.Summary == null) || (this.Summary != null && this.Summary.Equals(datastore.Summary))) && ((this.Host == null && datastore.Host == null) || (this.Host != null && datastore.Host != null && Enumerable.SequenceEqual(this.Host, datastore.Host))) && ((this.Vm == null && datastore.Vm == null) || (this.Vm != null && datastore.Vm != null && Enumerable.SequenceEqual(this.Vm, datastore.Vm))) && ((this.Browser == null && datastore.Browser == null) || (this.Browser != null && this.Browser.Equals(datastore.Browser))) && ((this.Capability == null && datastore.Capability == null) || (this.Capability != null && this.Capability.Equals(datastore.Capability))) && ((this.IormConfiguration == null && datastore.IormConfiguration == null) || (this.IormConfiguration != null && this.IormConfiguration.Equals(datastore.IormConfiguration))) && ((this.LinkedView == null && datastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datastore.LinkedView))));\n        }\n\n        public override bool Equals(object datastore)\n        {\n            return Equals(datastore as Datastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info + \"_\" + Summary + \"_\" + Host + \"_\" + Vm + \"_\" + Browser + \"_\" + Capability + \"_\" + IormConfiguration + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class Datastore_LinkedView : ManagedEntity_LinkedView, IEquatable<Datastore_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public HostDatastoreBrowser Browser { get; set; }\n\n        public bool Equals(Datastore_LinkedView datastore_LinkedView)\n        {\n            return (datastore_LinkedView != null && ((this.Vm == null && datastore_LinkedView.Vm == null) || (this.Vm != null && datastore_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, datastore_LinkedView.Vm))) && ((this.Browser == null && datastore_LinkedView.Browser == null) || (this.Browser != null && this.Browser.Equals(datastore_LinkedView.Browser))));\n        }\n\n        public override bool Equals(object datastore_LinkedView)\n        {\n            return Equals(datastore_LinkedView as Datastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Browser).GetHashCode();\n        }\n    }\n\n    public class DatastoreCapability : DynamicData, IEquatable<DatastoreCapability>\n    {\n        public bool DirectoryHierarchySupported { get; set; }\n\n        public bool RawDiskMappingsSupported { get; set; }\n\n        public bool PerFileThinProvisioningSupported { get; set; }\n\n        public bool StorageIORMSupported { get; set; }\n\n        public bool NativeSnapshotSupported { get; set; }\n\n        public bool? TopLevelDirectoryCreateSupported { get; set; }\n\n        public bool? SeSparseSupported { get; set; }\n\n        public bool? VmfsSparseSupported { get; set; }\n\n        public bool? VsanSparseSupported { get; set; }\n\n        public bool? UpitSupported { get; set; }\n\n        public bool? VmdkExpandSupported { get; set; }\n\n        public bool Equals(DatastoreCapability datastoreCapability)\n        {\n            return (datastoreCapability != null && this.DirectoryHierarchySupported == datastoreCapability.DirectoryHierarchySupported && this.RawDiskMappingsSupported == datastoreCapability.RawDiskMappingsSupported && this.PerFileThinProvisioningSupported == datastoreCapability.PerFileThinProvisioningSupported && this.StorageIORMSupported == datastoreCapability.StorageIORMSupported && this.NativeSnapshotSupported == datastoreCapability.NativeSnapshotSupported && ((this.TopLevelDirectoryCreateSupported == null && datastoreCapability.TopLevelDirectoryCreateSupported == null) || (this.TopLevelDirectoryCreateSupported != null && this.TopLevelDirectoryCreateSupported.Equals(datastoreCapability.TopLevelDirectoryCreateSupported))) && ((this.SeSparseSupported == null && datastoreCapability.SeSparseSupported == null) || (this.SeSparseSupported != null && this.SeSparseSupported.Equals(datastoreCapability.SeSparseSupported))) && ((this.VmfsSparseSupported == null && datastoreCapability.VmfsSparseSupported == null) || (this.VmfsSparseSupported != null && this.VmfsSparseSupported.Equals(datastoreCapability.VmfsSparseSupported))) && ((this.VsanSparseSupported == null && datastoreCapability.VsanSparseSupported == null) || (this.VsanSparseSupported != null && this.VsanSparseSupported.Equals(datastoreCapability.VsanSparseSupported))) && ((this.UpitSupported == null && datastoreCapability.UpitSupported == null) || (this.UpitSupported != null && this.UpitSupported.Equals(datastoreCapability.UpitSupported))) && ((this.VmdkExpandSupported == null && datastoreCapability.VmdkExpandSupported == null) || (this.VmdkExpandSupported != null && this.VmdkExpandSupported.Equals(datastoreCapability.VmdkExpandSupported))));\n        }\n\n        public override bool Equals(object datastoreCapability)\n        {\n            return Equals(datastoreCapability as DatastoreCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DirectoryHierarchySupported + \"_\" + RawDiskMappingsSupported + \"_\" + PerFileThinProvisioningSupported + \"_\" + StorageIORMSupported + \"_\" + NativeSnapshotSupported + \"_\" + TopLevelDirectoryCreateSupported + \"_\" + SeSparseSupported + \"_\" + VmfsSparseSupported + \"_\" + VsanSparseSupported + \"_\" + UpitSupported + \"_\" + VmdkExpandSupported).GetHashCode();\n        }\n    }\n\n    public class DatastoreCapacityIncreasedEvent : DatastoreEvent, IEquatable<DatastoreCapacityIncreasedEvent>\n    {\n        public long OldCapacity { get; set; }\n\n        public long NewCapacity { get; set; }\n\n        public bool Equals(DatastoreCapacityIncreasedEvent datastoreCapacityIncreasedEvent)\n        {\n            return (datastoreCapacityIncreasedEvent != null && this.OldCapacity == datastoreCapacityIncreasedEvent.OldCapacity && this.NewCapacity == datastoreCapacityIncreasedEvent.NewCapacity);\n        }\n\n        public override bool Equals(object datastoreCapacityIncreasedEvent)\n        {\n            return Equals(datastoreCapacityIncreasedEvent as DatastoreCapacityIncreasedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldCapacity + \"_\" + NewCapacity).GetHashCode();\n        }\n    }\n\n    public class DatastoreDestroyedEvent : DatastoreEvent, IEquatable<DatastoreDestroyedEvent>\n    {\n        public bool Equals(DatastoreDestroyedEvent datastoreDestroyedEvent)\n        {\n            return (datastoreDestroyedEvent != null && base.Equals(datastoreDestroyedEvent));\n        }\n\n        public override bool Equals(object datastoreDestroyedEvent)\n        {\n            return Equals(datastoreDestroyedEvent as DatastoreDestroyedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatastoreDiscoveredEvent : HostEvent, IEquatable<DatastoreDiscoveredEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public bool Equals(DatastoreDiscoveredEvent datastoreDiscoveredEvent)\n        {\n            return (datastoreDiscoveredEvent != null && ((this.Datastore == null && datastoreDiscoveredEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreDiscoveredEvent.Datastore))));\n        }\n\n        public override bool Equals(object datastoreDiscoveredEvent)\n        {\n            return Equals(datastoreDiscoveredEvent as DatastoreDiscoveredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class DatastoreDuplicatedEvent : DatastoreEvent, IEquatable<DatastoreDuplicatedEvent>\n    {\n        public bool Equals(DatastoreDuplicatedEvent datastoreDuplicatedEvent)\n        {\n            return (datastoreDuplicatedEvent != null && base.Equals(datastoreDuplicatedEvent));\n        }\n\n        public override bool Equals(object datastoreDuplicatedEvent)\n        {\n            return Equals(datastoreDuplicatedEvent as DatastoreDuplicatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatastoreEvent : Event, IEquatable<DatastoreEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public bool Equals(DatastoreEvent datastoreEvent)\n        {\n            return (datastoreEvent != null && ((this.Datastore == null && datastoreEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreEvent.Datastore))));\n        }\n\n        public override bool Equals(object datastoreEvent)\n        {\n            return Equals(datastoreEvent as DatastoreEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class DatastoreEventArgument : EntityEventArgument, IEquatable<DatastoreEventArgument>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public DatastoreEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatastoreEventArgument datastoreEventArgument)\n        {\n            return (datastoreEventArgument != null && ((this.Datastore == null && datastoreEventArgument.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreEventArgument.Datastore))) && ((this.LinkedView == null && datastoreEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datastoreEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object datastoreEventArgument)\n        {\n            return Equals(datastoreEventArgument as DatastoreEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatastoreEventArgument_LinkedView : IEquatable<DatastoreEventArgument_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(DatastoreEventArgument_LinkedView datastoreEventArgument_LinkedView)\n        {\n            return (datastoreEventArgument_LinkedView != null && ((this.Datastore == null && datastoreEventArgument_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreEventArgument_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object datastoreEventArgument_LinkedView)\n        {\n            return Equals(datastoreEventArgument_LinkedView as DatastoreEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class DatastoreFileCopiedEvent : DatastoreFileEvent, IEquatable<DatastoreFileCopiedEvent>\n    {\n        public DatastoreEventArgument SourceDatastore { get; set; }\n\n        public string SourceFile { get; set; }\n\n        public bool Equals(DatastoreFileCopiedEvent datastoreFileCopiedEvent)\n        {\n            return (datastoreFileCopiedEvent != null && ((this.SourceDatastore == null && datastoreFileCopiedEvent.SourceDatastore == null) || (this.SourceDatastore != null && this.SourceDatastore.Equals(datastoreFileCopiedEvent.SourceDatastore))) && this.SourceFile == datastoreFileCopiedEvent.SourceFile);\n        }\n\n        public override bool Equals(object datastoreFileCopiedEvent)\n        {\n            return Equals(datastoreFileCopiedEvent as DatastoreFileCopiedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceDatastore + \"_\" + SourceFile).GetHashCode();\n        }\n    }\n\n    public class DatastoreFileDeletedEvent : DatastoreFileEvent, IEquatable<DatastoreFileDeletedEvent>\n    {\n        public bool Equals(DatastoreFileDeletedEvent datastoreFileDeletedEvent)\n        {\n            return (datastoreFileDeletedEvent != null && base.Equals(datastoreFileDeletedEvent));\n        }\n\n        public override bool Equals(object datastoreFileDeletedEvent)\n        {\n            return Equals(datastoreFileDeletedEvent as DatastoreFileDeletedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatastoreFileEvent : DatastoreEvent, IEquatable<DatastoreFileEvent>\n    {\n        public string TargetFile { get; set; }\n\n        public string SourceOfOperation { get; set; }\n\n        public bool? Succeeded { get; set; }\n\n        public bool Equals(DatastoreFileEvent datastoreFileEvent)\n        {\n            return (datastoreFileEvent != null && this.TargetFile == datastoreFileEvent.TargetFile && this.SourceOfOperation == datastoreFileEvent.SourceOfOperation && ((this.Succeeded == null && datastoreFileEvent.Succeeded == null) || (this.Succeeded != null && this.Succeeded.Equals(datastoreFileEvent.Succeeded))));\n        }\n\n        public override bool Equals(object datastoreFileEvent)\n        {\n            return Equals(datastoreFileEvent as DatastoreFileEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TargetFile + \"_\" + SourceOfOperation + \"_\" + Succeeded).GetHashCode();\n        }\n    }\n\n    public class DatastoreFileMovedEvent : DatastoreFileEvent, IEquatable<DatastoreFileMovedEvent>\n    {\n        public DatastoreEventArgument SourceDatastore { get; set; }\n\n        public string SourceFile { get; set; }\n\n        public bool Equals(DatastoreFileMovedEvent datastoreFileMovedEvent)\n        {\n            return (datastoreFileMovedEvent != null && ((this.SourceDatastore == null && datastoreFileMovedEvent.SourceDatastore == null) || (this.SourceDatastore != null && this.SourceDatastore.Equals(datastoreFileMovedEvent.SourceDatastore))) && this.SourceFile == datastoreFileMovedEvent.SourceFile);\n        }\n\n        public override bool Equals(object datastoreFileMovedEvent)\n        {\n            return Equals(datastoreFileMovedEvent as DatastoreFileMovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceDatastore + \"_\" + SourceFile).GetHashCode();\n        }\n    }\n\n    public class DatastoreHostMount : DynamicData, IEquatable<DatastoreHostMount>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public HostMountInfo MountInfo { get; set; }\n\n        public DatastoreHostMount_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatastoreHostMount datastoreHostMount)\n        {\n            return (datastoreHostMount != null && ((this.Key == null && datastoreHostMount.Key == null) || (this.Key != null && this.Key.Equals(datastoreHostMount.Key))) && ((this.MountInfo == null && datastoreHostMount.MountInfo == null) || (this.MountInfo != null && this.MountInfo.Equals(datastoreHostMount.MountInfo))) && ((this.LinkedView == null && datastoreHostMount.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datastoreHostMount.LinkedView))));\n        }\n\n        public override bool Equals(object datastoreHostMount)\n        {\n            return Equals(datastoreHostMount as DatastoreHostMount);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + MountInfo + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatastoreHostMount_LinkedView : IEquatable<DatastoreHostMount_LinkedView>\n    {\n        public HostSystem Key { get; set; }\n\n        public bool Equals(DatastoreHostMount_LinkedView datastoreHostMount_LinkedView)\n        {\n            return (datastoreHostMount_LinkedView != null && ((this.Key == null && datastoreHostMount_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(datastoreHostMount_LinkedView.Key))));\n        }\n\n        public override bool Equals(object datastoreHostMount_LinkedView)\n        {\n            return Equals(datastoreHostMount_LinkedView as DatastoreHostMount_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class DatastoreInfo : DynamicData, IEquatable<DatastoreInfo>\n    {\n        public string Name { get; set; }\n\n        public string Url { get; set; }\n\n        public long FreeSpace { get; set; }\n\n        public long MaxFileSize { get; set; }\n\n        public long? MaxVirtualDiskCapacity { get; set; }\n\n        public long MaxMemoryFileSize { get; set; }\n\n        public DateTime? Timestamp { get; set; }\n\n        public string ContainerId { get; set; }\n\n        public string AliasOf { get; set; }\n\n        public bool Equals(DatastoreInfo datastoreInfo)\n        {\n            return (datastoreInfo != null && this.Name == datastoreInfo.Name && this.Url == datastoreInfo.Url && this.FreeSpace == datastoreInfo.FreeSpace && this.MaxFileSize == datastoreInfo.MaxFileSize && ((this.MaxVirtualDiskCapacity == null && datastoreInfo.MaxVirtualDiskCapacity == null) || (this.MaxVirtualDiskCapacity != null && this.MaxVirtualDiskCapacity.Equals(datastoreInfo.MaxVirtualDiskCapacity))) && this.MaxMemoryFileSize == datastoreInfo.MaxMemoryFileSize && ((this.Timestamp == null && datastoreInfo.Timestamp == null) || (this.Timestamp != null && this.Timestamp.Equals(datastoreInfo.Timestamp))) && this.ContainerId == datastoreInfo.ContainerId && this.AliasOf == datastoreInfo.AliasOf);\n        }\n\n        public override bool Equals(object datastoreInfo)\n        {\n            return Equals(datastoreInfo as DatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Url + \"_\" + FreeSpace + \"_\" + MaxFileSize + \"_\" + MaxVirtualDiskCapacity + \"_\" + MaxMemoryFileSize + \"_\" + Timestamp + \"_\" + ContainerId + \"_\" + AliasOf).GetHashCode();\n        }\n    }\n\n    public class DatastoreIORMReconfiguredEvent : DatastoreEvent, IEquatable<DatastoreIORMReconfiguredEvent>\n    {\n        public bool Equals(DatastoreIORMReconfiguredEvent datastoreIORMReconfiguredEvent)\n        {\n            return (datastoreIORMReconfiguredEvent != null && base.Equals(datastoreIORMReconfiguredEvent));\n        }\n\n        public override bool Equals(object datastoreIORMReconfiguredEvent)\n        {\n            return Equals(datastoreIORMReconfiguredEvent as DatastoreIORMReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatastoreMountPathDatastorePair : DynamicData, IEquatable<DatastoreMountPathDatastorePair>\n    {\n        public string OldMountPath { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public DatastoreMountPathDatastorePair_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatastoreMountPathDatastorePair datastoreMountPathDatastorePair)\n        {\n            return (datastoreMountPathDatastorePair != null && this.OldMountPath == datastoreMountPathDatastorePair.OldMountPath && ((this.Datastore == null && datastoreMountPathDatastorePair.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreMountPathDatastorePair.Datastore))) && ((this.LinkedView == null && datastoreMountPathDatastorePair.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datastoreMountPathDatastorePair.LinkedView))));\n        }\n\n        public override bool Equals(object datastoreMountPathDatastorePair)\n        {\n            return Equals(datastoreMountPathDatastorePair as DatastoreMountPathDatastorePair);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldMountPath + \"_\" + Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatastoreMountPathDatastorePair_LinkedView : IEquatable<DatastoreMountPathDatastorePair_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(DatastoreMountPathDatastorePair_LinkedView datastoreMountPathDatastorePair_LinkedView)\n        {\n            return (datastoreMountPathDatastorePair_LinkedView != null && ((this.Datastore == null && datastoreMountPathDatastorePair_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreMountPathDatastorePair_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object datastoreMountPathDatastorePair_LinkedView)\n        {\n            return Equals(datastoreMountPathDatastorePair_LinkedView as DatastoreMountPathDatastorePair_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class DatastoreNamespaceManager : ViewBase, IEquatable<DatastoreNamespaceManager>\n    {\n        public string CreateDirectory(ManagedObjectReference datastore, string displayName, string policy)\n        {\n            return default(string);\n        }\n\n        public void DeleteDirectory(ManagedObjectReference datacenter, string datastorePath)\n        {\n        }\n\n        public string ConvertNamespacePathToUuidPath(ManagedObjectReference datacenter, string namespaceUrl)\n        {\n            return default(string);\n        }\n\n        public bool Equals(DatastoreNamespaceManager datastoreNamespaceManager)\n        {\n            return (datastoreNamespaceManager != null && base.Equals(datastoreNamespaceManager));\n        }\n\n        public override bool Equals(object datastoreNamespaceManager)\n        {\n            return Equals(datastoreNamespaceManager as DatastoreNamespaceManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DatastoreNotWritableOnHost : InvalidDatastore, IEquatable<DatastoreNotWritableOnHost>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public new DatastoreNotWritableOnHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatastoreNotWritableOnHost datastoreNotWritableOnHost)\n        {\n            return (datastoreNotWritableOnHost != null && ((this.Host == null && datastoreNotWritableOnHost.Host == null) || (this.Host != null && this.Host.Equals(datastoreNotWritableOnHost.Host))) && ((this.LinkedView == null && datastoreNotWritableOnHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datastoreNotWritableOnHost.LinkedView))));\n        }\n\n        public override bool Equals(object datastoreNotWritableOnHost)\n        {\n            return Equals(datastoreNotWritableOnHost as DatastoreNotWritableOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatastoreNotWritableOnHost_LinkedView : InvalidDatastore_LinkedView, IEquatable<DatastoreNotWritableOnHost_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DatastoreNotWritableOnHost_LinkedView datastoreNotWritableOnHost_LinkedView)\n        {\n            return (datastoreNotWritableOnHost_LinkedView != null && ((this.Host == null && datastoreNotWritableOnHost_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(datastoreNotWritableOnHost_LinkedView.Host))));\n        }\n\n        public override bool Equals(object datastoreNotWritableOnHost_LinkedView)\n        {\n            return Equals(datastoreNotWritableOnHost_LinkedView as DatastoreNotWritableOnHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DatastoreOption : DynamicData, IEquatable<DatastoreOption>\n    {\n        public VirtualMachineDatastoreVolumeOption[] UnsupportedVolumes { get; set; }\n\n        public bool Equals(DatastoreOption datastoreOption)\n        {\n            return (datastoreOption != null && ((this.UnsupportedVolumes == null && datastoreOption.UnsupportedVolumes == null) || (this.UnsupportedVolumes != null && datastoreOption.UnsupportedVolumes != null && Enumerable.SequenceEqual(this.UnsupportedVolumes, datastoreOption.UnsupportedVolumes))));\n        }\n\n        public override bool Equals(object datastoreOption)\n        {\n            return Equals(datastoreOption as DatastoreOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UnsupportedVolumes).GetHashCode();\n        }\n    }\n\n    public class DatastorePrincipalConfigured : HostEvent, IEquatable<DatastorePrincipalConfigured>\n    {\n        public string DatastorePrincipal { get; set; }\n\n        public bool Equals(DatastorePrincipalConfigured datastorePrincipalConfigured)\n        {\n            return (datastorePrincipalConfigured != null && this.DatastorePrincipal == datastorePrincipalConfigured.DatastorePrincipal);\n        }\n\n        public override bool Equals(object datastorePrincipalConfigured)\n        {\n            return Equals(datastorePrincipalConfigured as DatastorePrincipalConfigured);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastorePrincipal).GetHashCode();\n        }\n    }\n\n    public class DatastoreRemovedOnHostEvent : HostEvent, IEquatable<DatastoreRemovedOnHostEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public bool Equals(DatastoreRemovedOnHostEvent datastoreRemovedOnHostEvent)\n        {\n            return (datastoreRemovedOnHostEvent != null && ((this.Datastore == null && datastoreRemovedOnHostEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreRemovedOnHostEvent.Datastore))));\n        }\n\n        public override bool Equals(object datastoreRemovedOnHostEvent)\n        {\n            return Equals(datastoreRemovedOnHostEvent as DatastoreRemovedOnHostEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class DatastoreRenamedEvent : DatastoreEvent, IEquatable<DatastoreRenamedEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(DatastoreRenamedEvent datastoreRenamedEvent)\n        {\n            return (datastoreRenamedEvent != null && this.OldName == datastoreRenamedEvent.OldName && this.NewName == datastoreRenamedEvent.NewName);\n        }\n\n        public override bool Equals(object datastoreRenamedEvent)\n        {\n            return Equals(datastoreRenamedEvent as DatastoreRenamedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class DatastoreRenamedOnHostEvent : HostEvent, IEquatable<DatastoreRenamedOnHostEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(DatastoreRenamedOnHostEvent datastoreRenamedOnHostEvent)\n        {\n            return (datastoreRenamedOnHostEvent != null && this.OldName == datastoreRenamedOnHostEvent.OldName && this.NewName == datastoreRenamedOnHostEvent.NewName);\n        }\n\n        public override bool Equals(object datastoreRenamedOnHostEvent)\n        {\n            return Equals(datastoreRenamedOnHostEvent as DatastoreRenamedOnHostEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class DatastoreSummary : DynamicData, IEquatable<DatastoreSummary>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string Name { get; set; }\n\n        public string Url { get; set; }\n\n        public long Capacity { get; set; }\n\n        public long FreeSpace { get; set; }\n\n        public long? Uncommitted { get; set; }\n\n        public bool Accessible { get; set; }\n\n        public bool? MultipleHostAccess { get; set; }\n\n        public string Type { get; set; }\n\n        public string MaintenanceMode { get; set; }\n\n        public DatastoreSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DatastoreSummary datastoreSummary)\n        {\n            return (datastoreSummary != null && ((this.Datastore == null && datastoreSummary.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreSummary.Datastore))) && this.Name == datastoreSummary.Name && this.Url == datastoreSummary.Url && this.Capacity == datastoreSummary.Capacity && this.FreeSpace == datastoreSummary.FreeSpace && ((this.Uncommitted == null && datastoreSummary.Uncommitted == null) || (this.Uncommitted != null && this.Uncommitted.Equals(datastoreSummary.Uncommitted))) && this.Accessible == datastoreSummary.Accessible && ((this.MultipleHostAccess == null && datastoreSummary.MultipleHostAccess == null) || (this.MultipleHostAccess != null && this.MultipleHostAccess.Equals(datastoreSummary.MultipleHostAccess))) && this.Type == datastoreSummary.Type && this.MaintenanceMode == datastoreSummary.MaintenanceMode && ((this.LinkedView == null && datastoreSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(datastoreSummary.LinkedView))));\n        }\n\n        public override bool Equals(object datastoreSummary)\n        {\n            return Equals(datastoreSummary as DatastoreSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Name + \"_\" + Url + \"_\" + Capacity + \"_\" + FreeSpace + \"_\" + Uncommitted + \"_\" + Accessible + \"_\" + MultipleHostAccess + \"_\" + Type + \"_\" + MaintenanceMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DatastoreSummary_LinkedView : IEquatable<DatastoreSummary_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(DatastoreSummary_LinkedView datastoreSummary_LinkedView)\n        {\n            return (datastoreSummary_LinkedView != null && ((this.Datastore == null && datastoreSummary_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreSummary_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object datastoreSummary_LinkedView)\n        {\n            return Equals(datastoreSummary_LinkedView as DatastoreSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class DatastoreVVolContainerFailoverPair : DynamicData, IEquatable<DatastoreVVolContainerFailoverPair>\n    {\n        public string SrcContainer { get; set; }\n\n        public string TgtContainer { get; set; }\n\n        public KeyValue[] VvolMapping { get; set; }\n\n        public bool Equals(DatastoreVVolContainerFailoverPair datastoreVVolContainerFailoverPair)\n        {\n            return (datastoreVVolContainerFailoverPair != null && this.SrcContainer == datastoreVVolContainerFailoverPair.SrcContainer && this.TgtContainer == datastoreVVolContainerFailoverPair.TgtContainer && ((this.VvolMapping == null && datastoreVVolContainerFailoverPair.VvolMapping == null) || (this.VvolMapping != null && datastoreVVolContainerFailoverPair.VvolMapping != null && Enumerable.SequenceEqual(this.VvolMapping, datastoreVVolContainerFailoverPair.VvolMapping))));\n        }\n\n        public override bool Equals(object datastoreVVolContainerFailoverPair)\n        {\n            return Equals(datastoreVVolContainerFailoverPair as DatastoreVVolContainerFailoverPair);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SrcContainer + \"_\" + TgtContainer + \"_\" + VvolMapping).GetHashCode();\n        }\n    }\n\n    public class DateTimeProfile : ApplyProfile, IEquatable<DateTimeProfile>\n    {\n        public bool Equals(DateTimeProfile dateTimeProfile)\n        {\n            return (dateTimeProfile != null && base.Equals(dateTimeProfile));\n        }\n\n        public override bool Equals(object dateTimeProfile)\n        {\n            return Equals(dateTimeProfile as DateTimeProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DeltaDiskFormatNotSupported : VmConfigFault, IEquatable<DeltaDiskFormatNotSupported>\n    {\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public string DeltaDiskFormat { get; set; }\n\n        public DeltaDiskFormatNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DeltaDiskFormatNotSupported deltaDiskFormatNotSupported)\n        {\n            return (deltaDiskFormatNotSupported != null && ((this.Datastore == null && deltaDiskFormatNotSupported.Datastore == null) || (this.Datastore != null && deltaDiskFormatNotSupported.Datastore != null && Enumerable.SequenceEqual(this.Datastore, deltaDiskFormatNotSupported.Datastore))) && this.DeltaDiskFormat == deltaDiskFormatNotSupported.DeltaDiskFormat && ((this.LinkedView == null && deltaDiskFormatNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(deltaDiskFormatNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object deltaDiskFormatNotSupported)\n        {\n            return Equals(deltaDiskFormatNotSupported as DeltaDiskFormatNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + DeltaDiskFormat + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DeltaDiskFormatNotSupported_LinkedView : IEquatable<DeltaDiskFormatNotSupported_LinkedView>\n    {\n        public Datastore[] Datastore { get; set; }\n\n        public bool Equals(DeltaDiskFormatNotSupported_LinkedView deltaDiskFormatNotSupported_LinkedView)\n        {\n            return (deltaDiskFormatNotSupported_LinkedView != null && ((this.Datastore == null && deltaDiskFormatNotSupported_LinkedView.Datastore == null) || (this.Datastore != null && deltaDiskFormatNotSupported_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, deltaDiskFormatNotSupported_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object deltaDiskFormatNotSupported_LinkedView)\n        {\n            return Equals(deltaDiskFormatNotSupported_LinkedView as DeltaDiskFormatNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class Description : DynamicData, IEquatable<Description>\n    {\n        public string Label { get; set; }\n\n        public string Summary { get; set; }\n\n        public bool Equals(Description description)\n        {\n            return (description != null && this.Label == description.Label && this.Summary == description.Summary);\n        }\n\n        public override bool Equals(object description)\n        {\n            return Equals(description as Description);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Label + \"_\" + Summary).GetHashCode();\n        }\n    }\n\n    public class DestinationSwitchFull : CannotAccessNetwork, IEquatable<DestinationSwitchFull>\n    {\n        public new DestinationSwitchFull_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DestinationSwitchFull destinationSwitchFull)\n        {\n            return (destinationSwitchFull != null && ((this.LinkedView == null && destinationSwitchFull.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(destinationSwitchFull.LinkedView))));\n        }\n\n        public override bool Equals(object destinationSwitchFull)\n        {\n            return Equals(destinationSwitchFull as DestinationSwitchFull);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class DestinationSwitchFull_LinkedView : CannotAccessNetwork_LinkedView, IEquatable<DestinationSwitchFull_LinkedView>\n    {\n        public bool Equals(DestinationSwitchFull_LinkedView destinationSwitchFull_LinkedView)\n        {\n            return (destinationSwitchFull_LinkedView != null && base.Equals(destinationSwitchFull_LinkedView));\n        }\n\n        public override bool Equals(object destinationSwitchFull_LinkedView)\n        {\n            return Equals(destinationSwitchFull_LinkedView as DestinationSwitchFull_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DestinationVsanDisabled : CannotMoveVsanEnabledHost, IEquatable<DestinationVsanDisabled>\n    {\n        public string DestinationCluster { get; set; }\n\n        public bool Equals(DestinationVsanDisabled destinationVsanDisabled)\n        {\n            return (destinationVsanDisabled != null && this.DestinationCluster == destinationVsanDisabled.DestinationCluster);\n        }\n\n        public override bool Equals(object destinationVsanDisabled)\n        {\n            return Equals(destinationVsanDisabled as DestinationVsanDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestinationCluster).GetHashCode();\n        }\n    }\n\n    public class DeviceBackedVirtualDiskSpec : VirtualDiskSpec, IEquatable<DeviceBackedVirtualDiskSpec>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(DeviceBackedVirtualDiskSpec deviceBackedVirtualDiskSpec)\n        {\n            return (deviceBackedVirtualDiskSpec != null && this.Device == deviceBackedVirtualDiskSpec.Device);\n        }\n\n        public override bool Equals(object deviceBackedVirtualDiskSpec)\n        {\n            return Equals(deviceBackedVirtualDiskSpec as DeviceBackedVirtualDiskSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class DeviceBackingNotSupported : DeviceNotSupported, IEquatable<DeviceBackingNotSupported>\n    {\n        public string Backing { get; set; }\n\n        public bool Equals(DeviceBackingNotSupported deviceBackingNotSupported)\n        {\n            return (deviceBackingNotSupported != null && this.Backing == deviceBackingNotSupported.Backing);\n        }\n\n        public override bool Equals(object deviceBackingNotSupported)\n        {\n            return Equals(deviceBackingNotSupported as DeviceBackingNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Backing).GetHashCode();\n        }\n    }\n\n    public class DeviceControllerNotSupported : DeviceNotSupported, IEquatable<DeviceControllerNotSupported>\n    {\n        public string Controller { get; set; }\n\n        public bool Equals(DeviceControllerNotSupported deviceControllerNotSupported)\n        {\n            return (deviceControllerNotSupported != null && this.Controller == deviceControllerNotSupported.Controller);\n        }\n\n        public override bool Equals(object deviceControllerNotSupported)\n        {\n            return Equals(deviceControllerNotSupported as DeviceControllerNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Controller).GetHashCode();\n        }\n    }\n\n    public class DeviceGroupId : DynamicData, IEquatable<DeviceGroupId>\n    {\n        public string Id { get; set; }\n\n        public bool Equals(DeviceGroupId deviceGroupId)\n        {\n            return (deviceGroupId != null && this.Id == deviceGroupId.Id);\n        }\n\n        public override bool Equals(object deviceGroupId)\n        {\n            return Equals(deviceGroupId as DeviceGroupId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id).GetHashCode();\n        }\n    }\n\n    public class DeviceHotPlugNotSupported : InvalidDeviceSpec, IEquatable<DeviceHotPlugNotSupported>\n    {\n        public bool Equals(DeviceHotPlugNotSupported deviceHotPlugNotSupported)\n        {\n            return (deviceHotPlugNotSupported != null && base.Equals(deviceHotPlugNotSupported));\n        }\n\n        public override bool Equals(object deviceHotPlugNotSupported)\n        {\n            return Equals(deviceHotPlugNotSupported as DeviceHotPlugNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DeviceNotFound : InvalidDeviceSpec, IEquatable<DeviceNotFound>\n    {\n        public bool Equals(DeviceNotFound deviceNotFound)\n        {\n            return (deviceNotFound != null && base.Equals(deviceNotFound));\n        }\n\n        public override bool Equals(object deviceNotFound)\n        {\n            return Equals(deviceNotFound as DeviceNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DeviceNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<DeviceNotSupported>\n    {\n        public string Device { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(DeviceNotSupported deviceNotSupported)\n        {\n            return (deviceNotSupported != null && this.Device == deviceNotSupported.Device && this.Reason == deviceNotSupported.Reason);\n        }\n\n        public override bool Equals(object deviceNotSupported)\n        {\n            return Equals(deviceNotSupported as DeviceNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class DeviceUnsupportedForVmPlatform : InvalidDeviceSpec, IEquatable<DeviceUnsupportedForVmPlatform>\n    {\n        public bool Equals(DeviceUnsupportedForVmPlatform deviceUnsupportedForVmPlatform)\n        {\n            return (deviceUnsupportedForVmPlatform != null && base.Equals(deviceUnsupportedForVmPlatform));\n        }\n\n        public override bool Equals(object deviceUnsupportedForVmPlatform)\n        {\n            return Equals(deviceUnsupportedForVmPlatform as DeviceUnsupportedForVmPlatform);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DeviceUnsupportedForVmVersion : InvalidDeviceSpec, IEquatable<DeviceUnsupportedForVmVersion>\n    {\n        public string CurrentVersion { get; set; }\n\n        public string ExpectedVersion { get; set; }\n\n        public bool Equals(DeviceUnsupportedForVmVersion deviceUnsupportedForVmVersion)\n        {\n            return (deviceUnsupportedForVmVersion != null && this.CurrentVersion == deviceUnsupportedForVmVersion.CurrentVersion && this.ExpectedVersion == deviceUnsupportedForVmVersion.ExpectedVersion);\n        }\n\n        public override bool Equals(object deviceUnsupportedForVmVersion)\n        {\n            return Equals(deviceUnsupportedForVmVersion as DeviceUnsupportedForVmVersion);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentVersion + \"_\" + ExpectedVersion).GetHashCode();\n        }\n    }\n\n    public class DiagnosticManager : ViewBase, IEquatable<DiagnosticManager>\n    {\n        public DiagnosticManagerLogDescriptor[] QueryDescriptions(ManagedObjectReference host)\n        {\n            return default(DiagnosticManagerLogDescriptor[]);\n        }\n\n        public DiagnosticManagerLogHeader BrowseDiagnosticLog(ManagedObjectReference host, string key, int? start, int? lines)\n        {\n            return default(DiagnosticManagerLogHeader);\n        }\n\n        public ManagedObjectReference GenerateLogBundles_Task(bool includeDefault, ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public DiagnosticManagerBundleInfo[] GenerateLogBundles(bool includeDefault, ManagedObjectReference[] host)\n        {\n            return default(DiagnosticManagerBundleInfo[]);\n        }\n\n        public bool Equals(DiagnosticManager diagnosticManager)\n        {\n            return (diagnosticManager != null && base.Equals(diagnosticManager));\n        }\n\n        public override bool Equals(object diagnosticManager)\n        {\n            return Equals(diagnosticManager as DiagnosticManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiagnosticManagerBundleInfo : DynamicData, IEquatable<DiagnosticManagerBundleInfo>\n    {\n        public ManagedObjectReference System { get; set; }\n\n        public string Url { get; set; }\n\n        public DiagnosticManagerBundleInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DiagnosticManagerBundleInfo diagnosticManagerBundleInfo)\n        {\n            return (diagnosticManagerBundleInfo != null && ((this.System == null && diagnosticManagerBundleInfo.System == null) || (this.System != null && this.System.Equals(diagnosticManagerBundleInfo.System))) && this.Url == diagnosticManagerBundleInfo.Url && ((this.LinkedView == null && diagnosticManagerBundleInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(diagnosticManagerBundleInfo.LinkedView))));\n        }\n\n        public override bool Equals(object diagnosticManagerBundleInfo)\n        {\n            return Equals(diagnosticManagerBundleInfo as DiagnosticManagerBundleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (System + \"_\" + Url + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DiagnosticManagerBundleInfo_LinkedView : IEquatable<DiagnosticManagerBundleInfo_LinkedView>\n    {\n        public HostSystem System { get; set; }\n\n        public bool Equals(DiagnosticManagerBundleInfo_LinkedView diagnosticManagerBundleInfo_LinkedView)\n        {\n            return (diagnosticManagerBundleInfo_LinkedView != null && ((this.System == null && diagnosticManagerBundleInfo_LinkedView.System == null) || (this.System != null && this.System.Equals(diagnosticManagerBundleInfo_LinkedView.System))));\n        }\n\n        public override bool Equals(object diagnosticManagerBundleInfo_LinkedView)\n        {\n            return Equals(diagnosticManagerBundleInfo_LinkedView as DiagnosticManagerBundleInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (System).GetHashCode();\n        }\n    }\n\n    public class DiagnosticManagerLogDescriptor : DynamicData, IEquatable<DiagnosticManagerLogDescriptor>\n    {\n        public string Key { get; set; }\n\n        public string FileName { get; set; }\n\n        public string Creator { get; set; }\n\n        public string Format { get; set; }\n\n        public string MimeType { get; set; }\n\n        public Description Info { get; set; }\n\n        public bool Equals(DiagnosticManagerLogDescriptor diagnosticManagerLogDescriptor)\n        {\n            return (diagnosticManagerLogDescriptor != null && this.Key == diagnosticManagerLogDescriptor.Key && this.FileName == diagnosticManagerLogDescriptor.FileName && this.Creator == diagnosticManagerLogDescriptor.Creator && this.Format == diagnosticManagerLogDescriptor.Format && this.MimeType == diagnosticManagerLogDescriptor.MimeType && ((this.Info == null && diagnosticManagerLogDescriptor.Info == null) || (this.Info != null && this.Info.Equals(diagnosticManagerLogDescriptor.Info))));\n        }\n\n        public override bool Equals(object diagnosticManagerLogDescriptor)\n        {\n            return Equals(diagnosticManagerLogDescriptor as DiagnosticManagerLogDescriptor);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + FileName + \"_\" + Creator + \"_\" + Format + \"_\" + MimeType + \"_\" + Info).GetHashCode();\n        }\n    }\n\n    public class DiagnosticManagerLogHeader : DynamicData, IEquatable<DiagnosticManagerLogHeader>\n    {\n        public int LineStart { get; set; }\n\n        public int LineEnd { get; set; }\n\n        public string[] LineText { get; set; }\n\n        public bool Equals(DiagnosticManagerLogHeader diagnosticManagerLogHeader)\n        {\n            return (diagnosticManagerLogHeader != null && this.LineStart == diagnosticManagerLogHeader.LineStart && this.LineEnd == diagnosticManagerLogHeader.LineEnd && ((this.LineText == null && diagnosticManagerLogHeader.LineText == null) || (this.LineText != null && diagnosticManagerLogHeader.LineText != null && Enumerable.SequenceEqual(this.LineText, diagnosticManagerLogHeader.LineText))));\n        }\n\n        public override bool Equals(object diagnosticManagerLogHeader)\n        {\n            return Equals(diagnosticManagerLogHeader as DiagnosticManagerLogHeader);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LineStart + \"_\" + LineEnd + \"_\" + LineText).GetHashCode();\n        }\n    }\n\n    public class DigestNotSupported : DeviceNotSupported, IEquatable<DigestNotSupported>\n    {\n        public bool Equals(DigestNotSupported digestNotSupported)\n        {\n            return (digestNotSupported != null && base.Equals(digestNotSupported));\n        }\n\n        public override bool Equals(object digestNotSupported)\n        {\n            return Equals(digestNotSupported as DigestNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DirectoryNotEmpty : FileFault, IEquatable<DirectoryNotEmpty>\n    {\n        public bool Equals(DirectoryNotEmpty directoryNotEmpty)\n        {\n            return (directoryNotEmpty != null && base.Equals(directoryNotEmpty));\n        }\n\n        public override bool Equals(object directoryNotEmpty)\n        {\n            return Equals(directoryNotEmpty as DirectoryNotEmpty);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DisableAdminNotSupported : HostConfigFault, IEquatable<DisableAdminNotSupported>\n    {\n        public bool Equals(DisableAdminNotSupported disableAdminNotSupported)\n        {\n            return (disableAdminNotSupported != null && base.Equals(disableAdminNotSupported));\n        }\n\n        public override bool Equals(object disableAdminNotSupported)\n        {\n            return Equals(disableAdminNotSupported as DisableAdminNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DisallowedChangeByService : RuntimeFault, IEquatable<DisallowedChangeByService>\n    {\n        public string ServiceName { get; set; }\n\n        public string DisallowedChange { get; set; }\n\n        public bool Equals(DisallowedChangeByService disallowedChangeByService)\n        {\n            return (disallowedChangeByService != null && this.ServiceName == disallowedChangeByService.ServiceName && this.DisallowedChange == disallowedChangeByService.DisallowedChange);\n        }\n\n        public override bool Equals(object disallowedChangeByService)\n        {\n            return Equals(disallowedChangeByService as DisallowedChangeByService);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceName + \"_\" + DisallowedChange).GetHashCode();\n        }\n    }\n\n    public class DisallowedDiskModeChange : InvalidDeviceSpec, IEquatable<DisallowedDiskModeChange>\n    {\n        public bool Equals(DisallowedDiskModeChange disallowedDiskModeChange)\n        {\n            return (disallowedDiskModeChange != null && base.Equals(disallowedDiskModeChange));\n        }\n\n        public override bool Equals(object disallowedDiskModeChange)\n        {\n            return Equals(disallowedDiskModeChange as DisallowedDiskModeChange);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DisallowedMigrationDeviceAttached : MigrationFault, IEquatable<DisallowedMigrationDeviceAttached>\n    {\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(DisallowedMigrationDeviceAttached disallowedMigrationDeviceAttached)\n        {\n            return (disallowedMigrationDeviceAttached != null && ((this.Fault == null && disallowedMigrationDeviceAttached.Fault == null) || (this.Fault != null && this.Fault.Equals(disallowedMigrationDeviceAttached.Fault))));\n        }\n\n        public override bool Equals(object disallowedMigrationDeviceAttached)\n        {\n            return Equals(disallowedMigrationDeviceAttached as DisallowedMigrationDeviceAttached);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault).GetHashCode();\n        }\n    }\n\n    public class DisallowedOperationOnFailoverHost : RuntimeFault, IEquatable<DisallowedOperationOnFailoverHost>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string Hostname { get; set; }\n\n        public DisallowedOperationOnFailoverHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DisallowedOperationOnFailoverHost disallowedOperationOnFailoverHost)\n        {\n            return (disallowedOperationOnFailoverHost != null && ((this.Host == null && disallowedOperationOnFailoverHost.Host == null) || (this.Host != null && this.Host.Equals(disallowedOperationOnFailoverHost.Host))) && this.Hostname == disallowedOperationOnFailoverHost.Hostname && ((this.LinkedView == null && disallowedOperationOnFailoverHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(disallowedOperationOnFailoverHost.LinkedView))));\n        }\n\n        public override bool Equals(object disallowedOperationOnFailoverHost)\n        {\n            return Equals(disallowedOperationOnFailoverHost as DisallowedOperationOnFailoverHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Hostname + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DisallowedOperationOnFailoverHost_LinkedView : IEquatable<DisallowedOperationOnFailoverHost_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DisallowedOperationOnFailoverHost_LinkedView disallowedOperationOnFailoverHost_LinkedView)\n        {\n            return (disallowedOperationOnFailoverHost_LinkedView != null && ((this.Host == null && disallowedOperationOnFailoverHost_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(disallowedOperationOnFailoverHost_LinkedView.Host))));\n        }\n\n        public override bool Equals(object disallowedOperationOnFailoverHost_LinkedView)\n        {\n            return Equals(disallowedOperationOnFailoverHost_LinkedView as DisallowedOperationOnFailoverHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DisconnectedHostsBlockingEVC : EVCConfigFault, IEquatable<DisconnectedHostsBlockingEVC>\n    {\n        public bool Equals(DisconnectedHostsBlockingEVC disconnectedHostsBlockingEVC)\n        {\n            return (disconnectedHostsBlockingEVC != null && base.Equals(disconnectedHostsBlockingEVC));\n        }\n\n        public override bool Equals(object disconnectedHostsBlockingEVC)\n        {\n            return Equals(disconnectedHostsBlockingEVC as DisconnectedHostsBlockingEVC);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiskChangeExtent : DynamicData, IEquatable<DiskChangeExtent>\n    {\n        public long Start { get; set; }\n\n        public long Length { get; set; }\n\n        public bool Equals(DiskChangeExtent diskChangeExtent)\n        {\n            return (diskChangeExtent != null && this.Start == diskChangeExtent.Start && this.Length == diskChangeExtent.Length);\n        }\n\n        public override bool Equals(object diskChangeExtent)\n        {\n            return Equals(diskChangeExtent as DiskChangeExtent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Start + \"_\" + Length).GetHashCode();\n        }\n    }\n\n    public class DiskChangeInfo : DynamicData, IEquatable<DiskChangeInfo>\n    {\n        public long StartOffset { get; set; }\n\n        public long Length { get; set; }\n\n        public DiskChangeExtent[] ChangedArea { get; set; }\n\n        public bool Equals(DiskChangeInfo diskChangeInfo)\n        {\n            return (diskChangeInfo != null && this.StartOffset == diskChangeInfo.StartOffset && this.Length == diskChangeInfo.Length && ((this.ChangedArea == null && diskChangeInfo.ChangedArea == null) || (this.ChangedArea != null && diskChangeInfo.ChangedArea != null && Enumerable.SequenceEqual(this.ChangedArea, diskChangeInfo.ChangedArea))));\n        }\n\n        public override bool Equals(object diskChangeInfo)\n        {\n            return Equals(diskChangeInfo as DiskChangeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StartOffset + \"_\" + Length + \"_\" + ChangedArea).GetHashCode();\n        }\n    }\n\n    public class DiskHasPartitions : VsanDiskFault, IEquatable<DiskHasPartitions>\n    {\n        public bool Equals(DiskHasPartitions diskHasPartitions)\n        {\n            return (diskHasPartitions != null && base.Equals(diskHasPartitions));\n        }\n\n        public override bool Equals(object diskHasPartitions)\n        {\n            return Equals(diskHasPartitions as DiskHasPartitions);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiskIsLastRemainingNonSSD : VsanDiskFault, IEquatable<DiskIsLastRemainingNonSSD>\n    {\n        public bool Equals(DiskIsLastRemainingNonSSD diskIsLastRemainingNonSSD)\n        {\n            return (diskIsLastRemainingNonSSD != null && base.Equals(diskIsLastRemainingNonSSD));\n        }\n\n        public override bool Equals(object diskIsLastRemainingNonSSD)\n        {\n            return Equals(diskIsLastRemainingNonSSD as DiskIsLastRemainingNonSSD);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiskIsNonLocal : VsanDiskFault, IEquatable<DiskIsNonLocal>\n    {\n        public bool Equals(DiskIsNonLocal diskIsNonLocal)\n        {\n            return (diskIsNonLocal != null && base.Equals(diskIsNonLocal));\n        }\n\n        public override bool Equals(object diskIsNonLocal)\n        {\n            return Equals(diskIsNonLocal as DiskIsNonLocal);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiskIsUSB : VsanDiskFault, IEquatable<DiskIsUSB>\n    {\n        public bool Equals(DiskIsUSB diskIsUSB)\n        {\n            return (diskIsUSB != null && base.Equals(diskIsUSB));\n        }\n\n        public override bool Equals(object diskIsUSB)\n        {\n            return Equals(diskIsUSB as DiskIsUSB);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiskMoveTypeNotSupported : MigrationFault, IEquatable<DiskMoveTypeNotSupported>\n    {\n        public bool Equals(DiskMoveTypeNotSupported diskMoveTypeNotSupported)\n        {\n            return (diskMoveTypeNotSupported != null && base.Equals(diskMoveTypeNotSupported));\n        }\n\n        public override bool Equals(object diskMoveTypeNotSupported)\n        {\n            return Equals(diskMoveTypeNotSupported as DiskMoveTypeNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DiskNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<DiskNotSupported>\n    {\n        public int Disk { get; set; }\n\n        public bool Equals(DiskNotSupported diskNotSupported)\n        {\n            return (diskNotSupported != null && this.Disk == diskNotSupported.Disk);\n        }\n\n        public override bool Equals(object diskNotSupported)\n        {\n            return Equals(diskNotSupported as DiskNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk).GetHashCode();\n        }\n    }\n\n    public class DiskTooSmall : VsanDiskFault, IEquatable<DiskTooSmall>\n    {\n        public bool Equals(DiskTooSmall diskTooSmall)\n        {\n            return (diskTooSmall != null && base.Equals(diskTooSmall));\n        }\n\n        public override bool Equals(object diskTooSmall)\n        {\n            return Equals(diskTooSmall as DiskTooSmall);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualPort : DynamicData, IEquatable<DistributedVirtualPort>\n    {\n        public string Key { get; set; }\n\n        public DVPortConfigInfo Config { get; set; }\n\n        public string DvsUuid { get; set; }\n\n        public string PortgroupKey { get; set; }\n\n        public ManagedObjectReference ProxyHost { get; set; }\n\n        public DistributedVirtualSwitchPortConnectee Connectee { get; set; }\n\n        public bool Conflict { get; set; }\n\n        public string ConflictPortKey { get; set; }\n\n        public DVPortState State { get; set; }\n\n        public int? ConnectionCookie { get; set; }\n\n        public DateTime LastStatusChange { get; set; }\n\n        public bool? HostLocalPort { get; set; }\n\n        public DistributedVirtualPort_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualPort distributedVirtualPort)\n        {\n            return (distributedVirtualPort != null && this.Key == distributedVirtualPort.Key && ((this.Config == null && distributedVirtualPort.Config == null) || (this.Config != null && this.Config.Equals(distributedVirtualPort.Config))) && this.DvsUuid == distributedVirtualPort.DvsUuid && this.PortgroupKey == distributedVirtualPort.PortgroupKey && ((this.ProxyHost == null && distributedVirtualPort.ProxyHost == null) || (this.ProxyHost != null && this.ProxyHost.Equals(distributedVirtualPort.ProxyHost))) && ((this.Connectee == null && distributedVirtualPort.Connectee == null) || (this.Connectee != null && this.Connectee.Equals(distributedVirtualPort.Connectee))) && this.Conflict == distributedVirtualPort.Conflict && this.ConflictPortKey == distributedVirtualPort.ConflictPortKey && ((this.State == null && distributedVirtualPort.State == null) || (this.State != null && this.State.Equals(distributedVirtualPort.State))) && ((this.ConnectionCookie == null && distributedVirtualPort.ConnectionCookie == null) || (this.ConnectionCookie != null && this.ConnectionCookie.Equals(distributedVirtualPort.ConnectionCookie))) && this.LastStatusChange == distributedVirtualPort.LastStatusChange && ((this.HostLocalPort == null && distributedVirtualPort.HostLocalPort == null) || (this.HostLocalPort != null && this.HostLocalPort.Equals(distributedVirtualPort.HostLocalPort))) && ((this.LinkedView == null && distributedVirtualPort.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualPort.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualPort)\n        {\n            return Equals(distributedVirtualPort as DistributedVirtualPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Config + \"_\" + DvsUuid + \"_\" + PortgroupKey + \"_\" + ProxyHost + \"_\" + Connectee + \"_\" + Conflict + \"_\" + ConflictPortKey + \"_\" + State + \"_\" + ConnectionCookie + \"_\" + LastStatusChange + \"_\" + HostLocalPort + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualPort_LinkedView : IEquatable<DistributedVirtualPort_LinkedView>\n    {\n        public HostSystem ProxyHost { get; set; }\n\n        public bool Equals(DistributedVirtualPort_LinkedView distributedVirtualPort_LinkedView)\n        {\n            return (distributedVirtualPort_LinkedView != null && ((this.ProxyHost == null && distributedVirtualPort_LinkedView.ProxyHost == null) || (this.ProxyHost != null && this.ProxyHost.Equals(distributedVirtualPort_LinkedView.ProxyHost))));\n        }\n\n        public override bool Equals(object distributedVirtualPort_LinkedView)\n        {\n            return Equals(distributedVirtualPort_LinkedView as DistributedVirtualPort_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProxyHost).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualPortgroup : Network, IEquatable<DistributedVirtualPortgroup>\n    {\n        public string Key { get; set; }\n\n        public DVPortgroupConfigInfo Config { get; set; }\n\n        public string[] PortKeys { get; set; }\n\n        public new DistributedVirtualPortgroup_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference ReconfigureDVPortgroup_Task(DVPortgroupConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureDVPortgroup(DVPortgroupConfigSpec spec)\n        {\n        }\n\n        public ManagedObjectReference DVPortgroupRollback_Task(EntityBackupConfig entityBackup)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public DVPortgroupConfigSpec DVPortgroupRollback(EntityBackupConfig entityBackup)\n        {\n            return default(DVPortgroupConfigSpec);\n        }\n\n        public bool Equals(DistributedVirtualPortgroup distributedVirtualPortgroup)\n        {\n            return (distributedVirtualPortgroup != null && this.Key == distributedVirtualPortgroup.Key && ((this.Config == null && distributedVirtualPortgroup.Config == null) || (this.Config != null && this.Config.Equals(distributedVirtualPortgroup.Config))) && ((this.PortKeys == null && distributedVirtualPortgroup.PortKeys == null) || (this.PortKeys != null && distributedVirtualPortgroup.PortKeys != null && Enumerable.SequenceEqual(this.PortKeys, distributedVirtualPortgroup.PortKeys))) && ((this.LinkedView == null && distributedVirtualPortgroup.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualPortgroup.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualPortgroup)\n        {\n            return Equals(distributedVirtualPortgroup as DistributedVirtualPortgroup);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Config + \"_\" + PortKeys + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualPortgroup_LinkedView : Network_LinkedView, IEquatable<DistributedVirtualPortgroup_LinkedView>\n    {\n        public bool Equals(DistributedVirtualPortgroup_LinkedView distributedVirtualPortgroup_LinkedView)\n        {\n            return (distributedVirtualPortgroup_LinkedView != null && base.Equals(distributedVirtualPortgroup_LinkedView));\n        }\n\n        public override bool Equals(object distributedVirtualPortgroup_LinkedView)\n        {\n            return Equals(distributedVirtualPortgroup_LinkedView as DistributedVirtualPortgroup_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualPortgroupInfo : DynamicData, IEquatable<DistributedVirtualPortgroupInfo>\n    {\n        public string SwitchName { get; set; }\n\n        public string SwitchUuid { get; set; }\n\n        public string PortgroupName { get; set; }\n\n        public string PortgroupKey { get; set; }\n\n        public string PortgroupType { get; set; }\n\n        public bool UplinkPortgroup { get; set; }\n\n        public ManagedObjectReference Portgroup { get; set; }\n\n        public bool? NetworkReservationSupported { get; set; }\n\n        public DistributedVirtualPortgroupInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualPortgroupInfo distributedVirtualPortgroupInfo)\n        {\n            return (distributedVirtualPortgroupInfo != null && this.SwitchName == distributedVirtualPortgroupInfo.SwitchName && this.SwitchUuid == distributedVirtualPortgroupInfo.SwitchUuid && this.PortgroupName == distributedVirtualPortgroupInfo.PortgroupName && this.PortgroupKey == distributedVirtualPortgroupInfo.PortgroupKey && this.PortgroupType == distributedVirtualPortgroupInfo.PortgroupType && this.UplinkPortgroup == distributedVirtualPortgroupInfo.UplinkPortgroup && ((this.Portgroup == null && distributedVirtualPortgroupInfo.Portgroup == null) || (this.Portgroup != null && this.Portgroup.Equals(distributedVirtualPortgroupInfo.Portgroup))) && ((this.NetworkReservationSupported == null && distributedVirtualPortgroupInfo.NetworkReservationSupported == null) || (this.NetworkReservationSupported != null && this.NetworkReservationSupported.Equals(distributedVirtualPortgroupInfo.NetworkReservationSupported))) && ((this.LinkedView == null && distributedVirtualPortgroupInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualPortgroupInfo.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualPortgroupInfo)\n        {\n            return Equals(distributedVirtualPortgroupInfo as DistributedVirtualPortgroupInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchName + \"_\" + SwitchUuid + \"_\" + PortgroupName + \"_\" + PortgroupKey + \"_\" + PortgroupType + \"_\" + UplinkPortgroup + \"_\" + Portgroup + \"_\" + NetworkReservationSupported + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualPortgroupInfo_LinkedView : IEquatable<DistributedVirtualPortgroupInfo_LinkedView>\n    {\n        public DistributedVirtualPortgroup Portgroup { get; set; }\n\n        public bool Equals(DistributedVirtualPortgroupInfo_LinkedView distributedVirtualPortgroupInfo_LinkedView)\n        {\n            return (distributedVirtualPortgroupInfo_LinkedView != null && ((this.Portgroup == null && distributedVirtualPortgroupInfo_LinkedView.Portgroup == null) || (this.Portgroup != null && this.Portgroup.Equals(distributedVirtualPortgroupInfo_LinkedView.Portgroup))));\n        }\n\n        public override bool Equals(object distributedVirtualPortgroupInfo_LinkedView)\n        {\n            return Equals(distributedVirtualPortgroupInfo_LinkedView as DistributedVirtualPortgroupInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Portgroup).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitch : ManagedEntity, IEquatable<DistributedVirtualSwitch>\n    {\n        public string Uuid { get; set; }\n\n        public DVSCapability Capability { get; set; }\n\n        public DVSSummary Summary { get; set; }\n\n        public DVSConfigInfo Config { get; set; }\n\n        public DVSNetworkResourcePool[] NetworkResourcePool { get; set; }\n\n        public ManagedObjectReference[] Portgroup { get; set; }\n\n        public DVSRuntimeInfo Runtime { get; set; }\n\n        public new DistributedVirtualSwitch_LinkedView LinkedView { get; set; }\n\n        public string[] FetchDVPortKeys(DistributedVirtualSwitchPortCriteria criteria)\n        {\n            return default(string[]);\n        }\n\n        public DistributedVirtualPort[] FetchDVPorts(DistributedVirtualSwitchPortCriteria criteria)\n        {\n            return default(DistributedVirtualPort[]);\n        }\n\n        public int[] QueryUsedVlanIdInDvs()\n        {\n            return default(int[]);\n        }\n\n        public ManagedObjectReference ReconfigureDvs_Task(DVSConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureDvs(DVSConfigSpec spec)\n        {\n        }\n\n        public ManagedObjectReference PerformDvsProductSpecOperation_Task(string operation, DistributedVirtualSwitchProductSpec productSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PerformDvsProductSpecOperation(string operation, DistributedVirtualSwitchProductSpec productSpec)\n        {\n        }\n\n        public ManagedObjectReference MergeDvs_Task(ManagedObjectReference dvs)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MergeDvs(ManagedObjectReference dvs)\n        {\n        }\n\n        public ManagedObjectReference AddDVPortgroup_Task(DVPortgroupConfigSpec[] spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void AddDVPortgroup(DVPortgroupConfigSpec[] spec)\n        {\n        }\n\n        public ManagedObjectReference MoveDVPort_Task(string[] portKey, string destinationPortgroupKey)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MoveDVPort(string[] portKey, string destinationPortgroupKey)\n        {\n        }\n\n        public void UpdateDvsCapability(DVSCapability capability)\n        {\n        }\n\n        public ManagedObjectReference ReconfigureDVPort_Task(DVPortConfigSpec[] port)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureDVPort(DVPortConfigSpec[] port)\n        {\n        }\n\n        public void RefreshDVPortState(string[] portKeys)\n        {\n        }\n\n        public ManagedObjectReference RectifyDvsHost_Task(ManagedObjectReference[] hosts)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RectifyDvsHost(ManagedObjectReference[] hosts)\n        {\n        }\n\n        public void UpdateNetworkResourcePool(DVSNetworkResourcePoolConfigSpec[] configSpec)\n        {\n        }\n\n        public void AddNetworkResourcePool(DVSNetworkResourcePoolConfigSpec[] configSpec)\n        {\n        }\n\n        public void RemoveNetworkResourcePool(string[] key)\n        {\n        }\n\n        public ManagedObjectReference DvsReconfigureVmVnicNetworkResourcePool_Task(DvsVmVnicResourcePoolConfigSpec[] configSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DvsReconfigureVmVnicNetworkResourcePool(DvsVmVnicResourcePoolConfigSpec[] configSpec)\n        {\n        }\n\n        public void EnableNetworkResourceManagement(bool enable)\n        {\n        }\n\n        public ManagedObjectReference DVSRollback_Task(EntityBackupConfig entityBackup)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public DVSConfigSpec DVSRollback(EntityBackupConfig entityBackup)\n        {\n            return default(DVSConfigSpec);\n        }\n\n        public ManagedObjectReference CreateDVPortgroup_Task(DVPortgroupConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateDVPortgroup(DVPortgroupConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference UpdateDVSHealthCheckConfig_Task(DVSHealthCheckConfig[] healthCheckConfig)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpdateDVSHealthCheckConfig(DVSHealthCheckConfig[] healthCheckConfig)\n        {\n        }\n\n        public ManagedObjectReference LookupDvPortGroup(string portgroupKey)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(DistributedVirtualSwitch distributedVirtualSwitch)\n        {\n            return (distributedVirtualSwitch != null && this.Uuid == distributedVirtualSwitch.Uuid && ((this.Capability == null && distributedVirtualSwitch.Capability == null) || (this.Capability != null && this.Capability.Equals(distributedVirtualSwitch.Capability))) && ((this.Summary == null && distributedVirtualSwitch.Summary == null) || (this.Summary != null && this.Summary.Equals(distributedVirtualSwitch.Summary))) && ((this.Config == null && distributedVirtualSwitch.Config == null) || (this.Config != null && this.Config.Equals(distributedVirtualSwitch.Config))) && ((this.NetworkResourcePool == null && distributedVirtualSwitch.NetworkResourcePool == null) || (this.NetworkResourcePool != null && distributedVirtualSwitch.NetworkResourcePool != null && Enumerable.SequenceEqual(this.NetworkResourcePool, distributedVirtualSwitch.NetworkResourcePool))) && ((this.Portgroup == null && distributedVirtualSwitch.Portgroup == null) || (this.Portgroup != null && distributedVirtualSwitch.Portgroup != null && Enumerable.SequenceEqual(this.Portgroup, distributedVirtualSwitch.Portgroup))) && ((this.Runtime == null && distributedVirtualSwitch.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(distributedVirtualSwitch.Runtime))) && ((this.LinkedView == null && distributedVirtualSwitch.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitch.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitch)\n        {\n            return Equals(distributedVirtualSwitch as DistributedVirtualSwitch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + Capability + \"_\" + Summary + \"_\" + Config + \"_\" + NetworkResourcePool + \"_\" + Portgroup + \"_\" + Runtime + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitch_LinkedView : ManagedEntity_LinkedView, IEquatable<DistributedVirtualSwitch_LinkedView>\n    {\n        public DistributedVirtualPortgroup[] Portgroup { get; set; }\n\n        public bool Equals(DistributedVirtualSwitch_LinkedView distributedVirtualSwitch_LinkedView)\n        {\n            return (distributedVirtualSwitch_LinkedView != null && ((this.Portgroup == null && distributedVirtualSwitch_LinkedView.Portgroup == null) || (this.Portgroup != null && distributedVirtualSwitch_LinkedView.Portgroup != null && Enumerable.SequenceEqual(this.Portgroup, distributedVirtualSwitch_LinkedView.Portgroup))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitch_LinkedView)\n        {\n            return Equals(distributedVirtualSwitch_LinkedView as DistributedVirtualSwitch_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Portgroup).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMember : DynamicData, IEquatable<DistributedVirtualSwitchHostMember>\n    {\n        public DistributedVirtualSwitchHostMemberRuntimeState RuntimeState { get; set; }\n\n        public DistributedVirtualSwitchHostMemberConfigInfo Config { get; set; }\n\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public string[] UplinkPortKey { get; set; }\n\n        public string Status { get; set; }\n\n        public string StatusDetail { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMember distributedVirtualSwitchHostMember)\n        {\n            return (distributedVirtualSwitchHostMember != null && ((this.RuntimeState == null && distributedVirtualSwitchHostMember.RuntimeState == null) || (this.RuntimeState != null && this.RuntimeState.Equals(distributedVirtualSwitchHostMember.RuntimeState))) && ((this.Config == null && distributedVirtualSwitchHostMember.Config == null) || (this.Config != null && this.Config.Equals(distributedVirtualSwitchHostMember.Config))) && ((this.ProductInfo == null && distributedVirtualSwitchHostMember.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(distributedVirtualSwitchHostMember.ProductInfo))) && ((this.UplinkPortKey == null && distributedVirtualSwitchHostMember.UplinkPortKey == null) || (this.UplinkPortKey != null && distributedVirtualSwitchHostMember.UplinkPortKey != null && Enumerable.SequenceEqual(this.UplinkPortKey, distributedVirtualSwitchHostMember.UplinkPortKey))) && this.Status == distributedVirtualSwitchHostMember.Status && this.StatusDetail == distributedVirtualSwitchHostMember.StatusDetail);\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMember)\n        {\n            return Equals(distributedVirtualSwitchHostMember as DistributedVirtualSwitchHostMember);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RuntimeState + \"_\" + Config + \"_\" + ProductInfo + \"_\" + UplinkPortKey + \"_\" + Status + \"_\" + StatusDetail).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberBacking : DynamicData, IEquatable<DistributedVirtualSwitchHostMemberBacking>\n    {\n        public bool Equals(DistributedVirtualSwitchHostMemberBacking distributedVirtualSwitchHostMemberBacking)\n        {\n            return (distributedVirtualSwitchHostMemberBacking != null && base.Equals(distributedVirtualSwitchHostMemberBacking));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberBacking)\n        {\n            return Equals(distributedVirtualSwitchHostMemberBacking as DistributedVirtualSwitchHostMemberBacking);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberConfigInfo : DynamicData, IEquatable<DistributedVirtualSwitchHostMemberConfigInfo>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public int MaxProxySwitchPorts { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificConfig { get; set; }\n\n        public DistributedVirtualSwitchHostMemberBacking Backing { get; set; }\n\n        public DistributedVirtualSwitchHostMemberConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberConfigInfo distributedVirtualSwitchHostMemberConfigInfo)\n        {\n            return (distributedVirtualSwitchHostMemberConfigInfo != null && ((this.Host == null && distributedVirtualSwitchHostMemberConfigInfo.Host == null) || (this.Host != null && this.Host.Equals(distributedVirtualSwitchHostMemberConfigInfo.Host))) && this.MaxProxySwitchPorts == distributedVirtualSwitchHostMemberConfigInfo.MaxProxySwitchPorts && ((this.VendorSpecificConfig == null && distributedVirtualSwitchHostMemberConfigInfo.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && distributedVirtualSwitchHostMemberConfigInfo.VendorSpecificConfig != null && Enumerable.SequenceEqual(this.VendorSpecificConfig, distributedVirtualSwitchHostMemberConfigInfo.VendorSpecificConfig))) && ((this.Backing == null && distributedVirtualSwitchHostMemberConfigInfo.Backing == null) || (this.Backing != null && this.Backing.Equals(distributedVirtualSwitchHostMemberConfigInfo.Backing))) && ((this.LinkedView == null && distributedVirtualSwitchHostMemberConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchHostMemberConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberConfigInfo)\n        {\n            return Equals(distributedVirtualSwitchHostMemberConfigInfo as DistributedVirtualSwitchHostMemberConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + MaxProxySwitchPorts + \"_\" + VendorSpecificConfig + \"_\" + Backing + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberConfigInfo_LinkedView : IEquatable<DistributedVirtualSwitchHostMemberConfigInfo_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberConfigInfo_LinkedView distributedVirtualSwitchHostMemberConfigInfo_LinkedView)\n        {\n            return (distributedVirtualSwitchHostMemberConfigInfo_LinkedView != null && ((this.Host == null && distributedVirtualSwitchHostMemberConfigInfo_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(distributedVirtualSwitchHostMemberConfigInfo_LinkedView.Host))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberConfigInfo_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchHostMemberConfigInfo_LinkedView as DistributedVirtualSwitchHostMemberConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberConfigSpec : DynamicData, IEquatable<DistributedVirtualSwitchHostMemberConfigSpec>\n    {\n        public string Operation { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public DistributedVirtualSwitchHostMemberBacking Backing { get; set; }\n\n        public int? MaxProxySwitchPorts { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificConfig { get; set; }\n\n        public DistributedVirtualSwitchHostMemberConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberConfigSpec distributedVirtualSwitchHostMemberConfigSpec)\n        {\n            return (distributedVirtualSwitchHostMemberConfigSpec != null && this.Operation == distributedVirtualSwitchHostMemberConfigSpec.Operation && ((this.Host == null && distributedVirtualSwitchHostMemberConfigSpec.Host == null) || (this.Host != null && this.Host.Equals(distributedVirtualSwitchHostMemberConfigSpec.Host))) && ((this.Backing == null && distributedVirtualSwitchHostMemberConfigSpec.Backing == null) || (this.Backing != null && this.Backing.Equals(distributedVirtualSwitchHostMemberConfigSpec.Backing))) && ((this.MaxProxySwitchPorts == null && distributedVirtualSwitchHostMemberConfigSpec.MaxProxySwitchPorts == null) || (this.MaxProxySwitchPorts != null && this.MaxProxySwitchPorts.Equals(distributedVirtualSwitchHostMemberConfigSpec.MaxProxySwitchPorts))) && ((this.VendorSpecificConfig == null && distributedVirtualSwitchHostMemberConfigSpec.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && distributedVirtualSwitchHostMemberConfigSpec.VendorSpecificConfig != null && Enumerable.SequenceEqual(this.VendorSpecificConfig, distributedVirtualSwitchHostMemberConfigSpec.VendorSpecificConfig))) && ((this.LinkedView == null && distributedVirtualSwitchHostMemberConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchHostMemberConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberConfigSpec)\n        {\n            return Equals(distributedVirtualSwitchHostMemberConfigSpec as DistributedVirtualSwitchHostMemberConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + Host + \"_\" + Backing + \"_\" + MaxProxySwitchPorts + \"_\" + VendorSpecificConfig + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberConfigSpec_LinkedView : IEquatable<DistributedVirtualSwitchHostMemberConfigSpec_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberConfigSpec_LinkedView distributedVirtualSwitchHostMemberConfigSpec_LinkedView)\n        {\n            return (distributedVirtualSwitchHostMemberConfigSpec_LinkedView != null && ((this.Host == null && distributedVirtualSwitchHostMemberConfigSpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(distributedVirtualSwitchHostMemberConfigSpec_LinkedView.Host))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberConfigSpec_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchHostMemberConfigSpec_LinkedView as DistributedVirtualSwitchHostMemberConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberPnicBacking : DistributedVirtualSwitchHostMemberBacking, IEquatable<DistributedVirtualSwitchHostMemberPnicBacking>\n    {\n        public DistributedVirtualSwitchHostMemberPnicSpec[] PnicSpec { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberPnicBacking distributedVirtualSwitchHostMemberPnicBacking)\n        {\n            return (distributedVirtualSwitchHostMemberPnicBacking != null && ((this.PnicSpec == null && distributedVirtualSwitchHostMemberPnicBacking.PnicSpec == null) || (this.PnicSpec != null && distributedVirtualSwitchHostMemberPnicBacking.PnicSpec != null && Enumerable.SequenceEqual(this.PnicSpec, distributedVirtualSwitchHostMemberPnicBacking.PnicSpec))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberPnicBacking)\n        {\n            return Equals(distributedVirtualSwitchHostMemberPnicBacking as DistributedVirtualSwitchHostMemberPnicBacking);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PnicSpec).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberPnicSpec : DynamicData, IEquatable<DistributedVirtualSwitchHostMemberPnicSpec>\n    {\n        public string PnicDevice { get; set; }\n\n        public string UplinkPortKey { get; set; }\n\n        public string UplinkPortgroupKey { get; set; }\n\n        public int? ConnectionCookie { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberPnicSpec distributedVirtualSwitchHostMemberPnicSpec)\n        {\n            return (distributedVirtualSwitchHostMemberPnicSpec != null && this.PnicDevice == distributedVirtualSwitchHostMemberPnicSpec.PnicDevice && this.UplinkPortKey == distributedVirtualSwitchHostMemberPnicSpec.UplinkPortKey && this.UplinkPortgroupKey == distributedVirtualSwitchHostMemberPnicSpec.UplinkPortgroupKey && ((this.ConnectionCookie == null && distributedVirtualSwitchHostMemberPnicSpec.ConnectionCookie == null) || (this.ConnectionCookie != null && this.ConnectionCookie.Equals(distributedVirtualSwitchHostMemberPnicSpec.ConnectionCookie))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberPnicSpec)\n        {\n            return Equals(distributedVirtualSwitchHostMemberPnicSpec as DistributedVirtualSwitchHostMemberPnicSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PnicDevice + \"_\" + UplinkPortKey + \"_\" + UplinkPortgroupKey + \"_\" + ConnectionCookie).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostMemberRuntimeState : DynamicData, IEquatable<DistributedVirtualSwitchHostMemberRuntimeState>\n    {\n        public int CurrentMaxProxySwitchPorts { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostMemberRuntimeState distributedVirtualSwitchHostMemberRuntimeState)\n        {\n            return (distributedVirtualSwitchHostMemberRuntimeState != null && this.CurrentMaxProxySwitchPorts == distributedVirtualSwitchHostMemberRuntimeState.CurrentMaxProxySwitchPorts);\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostMemberRuntimeState)\n        {\n            return Equals(distributedVirtualSwitchHostMemberRuntimeState as DistributedVirtualSwitchHostMemberRuntimeState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentMaxProxySwitchPorts).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchHostProductSpec : DynamicData, IEquatable<DistributedVirtualSwitchHostProductSpec>\n    {\n        public string ProductLineId { get; set; }\n\n        public string Version { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchHostProductSpec distributedVirtualSwitchHostProductSpec)\n        {\n            return (distributedVirtualSwitchHostProductSpec != null && this.ProductLineId == distributedVirtualSwitchHostProductSpec.ProductLineId && this.Version == distributedVirtualSwitchHostProductSpec.Version);\n        }\n\n        public override bool Equals(object distributedVirtualSwitchHostProductSpec)\n        {\n            return Equals(distributedVirtualSwitchHostProductSpec as DistributedVirtualSwitchHostProductSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProductLineId + \"_\" + Version).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchInfo : DynamicData, IEquatable<DistributedVirtualSwitchInfo>\n    {\n        public string SwitchName { get; set; }\n\n        public string SwitchUuid { get; set; }\n\n        public ManagedObjectReference DistributedVirtualSwitch { get; set; }\n\n        public bool? NetworkReservationSupported { get; set; }\n\n        public DistributedVirtualSwitchInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchInfo distributedVirtualSwitchInfo)\n        {\n            return (distributedVirtualSwitchInfo != null && this.SwitchName == distributedVirtualSwitchInfo.SwitchName && this.SwitchUuid == distributedVirtualSwitchInfo.SwitchUuid && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchInfo.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(distributedVirtualSwitchInfo.DistributedVirtualSwitch))) && ((this.NetworkReservationSupported == null && distributedVirtualSwitchInfo.NetworkReservationSupported == null) || (this.NetworkReservationSupported != null && this.NetworkReservationSupported.Equals(distributedVirtualSwitchInfo.NetworkReservationSupported))) && ((this.LinkedView == null && distributedVirtualSwitchInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchInfo.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchInfo)\n        {\n            return Equals(distributedVirtualSwitchInfo as DistributedVirtualSwitchInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchName + \"_\" + SwitchUuid + \"_\" + DistributedVirtualSwitch + \"_\" + NetworkReservationSupported + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchInfo_LinkedView : IEquatable<DistributedVirtualSwitchInfo_LinkedView>\n    {\n        public DistributedVirtualSwitch DistributedVirtualSwitch { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchInfo_LinkedView distributedVirtualSwitchInfo_LinkedView)\n        {\n            return (distributedVirtualSwitchInfo_LinkedView != null && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchInfo_LinkedView.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(distributedVirtualSwitchInfo_LinkedView.DistributedVirtualSwitch))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchInfo_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchInfo_LinkedView as DistributedVirtualSwitchInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchKeyedOpaqueBlob : DynamicData, IEquatable<DistributedVirtualSwitchKeyedOpaqueBlob>\n    {\n        public string Key { get; set; }\n\n        public string OpaqueData { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchKeyedOpaqueBlob distributedVirtualSwitchKeyedOpaqueBlob)\n        {\n            return (distributedVirtualSwitchKeyedOpaqueBlob != null && this.Key == distributedVirtualSwitchKeyedOpaqueBlob.Key && this.OpaqueData == distributedVirtualSwitchKeyedOpaqueBlob.OpaqueData);\n        }\n\n        public override bool Equals(object distributedVirtualSwitchKeyedOpaqueBlob)\n        {\n            return Equals(distributedVirtualSwitchKeyedOpaqueBlob as DistributedVirtualSwitchKeyedOpaqueBlob);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + OpaqueData).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManager : ViewBase, IEquatable<DistributedVirtualSwitchManager>\n    {\n        public DistributedVirtualSwitchProductSpec[] QueryAvailableDvsSpec(bool? recommended)\n        {\n            return default(DistributedVirtualSwitchProductSpec[]);\n        }\n\n        public ManagedObjectReference[] QueryCompatibleHostForNewDvs(ManagedObjectReference container, bool recursive, DistributedVirtualSwitchProductSpec switchProductSpec)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ManagedObjectReference[] QueryCompatibleHostForExistingDvs(ManagedObjectReference container, bool recursive, ManagedObjectReference dvs)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public DistributedVirtualSwitchHostProductSpec[] QueryDvsCompatibleHostSpec(DistributedVirtualSwitchProductSpec switchProductSpec)\n        {\n            return default(DistributedVirtualSwitchHostProductSpec[]);\n        }\n\n        public DVSFeatureCapability QueryDvsFeatureCapability(DistributedVirtualSwitchProductSpec switchProductSpec)\n        {\n            return default(DVSFeatureCapability);\n        }\n\n        public ManagedObjectReference QueryDvsByUuid(string uuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public DVSManagerDvsConfigTarget QueryDvsConfigTarget(ManagedObjectReference host, ManagedObjectReference dvs)\n        {\n            return default(DVSManagerDvsConfigTarget);\n        }\n\n        public DistributedVirtualSwitchManagerCompatibilityResult[] QueryDvsCheckCompatibility(DistributedVirtualSwitchManagerHostContainer hostContainer, DistributedVirtualSwitchManagerDvsProductSpec dvsProductSpec, DistributedVirtualSwitchManagerHostDvsFilterSpec[] hostFilterSpec)\n        {\n            return default(DistributedVirtualSwitchManagerCompatibilityResult[]);\n        }\n\n        public ManagedObjectReference RectifyDvsOnHost_Task(ManagedObjectReference[] hosts)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RectifyDvsOnHost(ManagedObjectReference[] hosts)\n        {\n        }\n\n        public ManagedObjectReference DVSManagerExportEntity_Task(SelectionSet[] selectionSet)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public EntityBackupConfig[] DVSManagerExportEntity(SelectionSet[] selectionSet)\n        {\n            return default(EntityBackupConfig[]);\n        }\n\n        public ManagedObjectReference DVSManagerImportEntity_Task(EntityBackupConfig[] entityBackup, string importType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public DistributedVirtualSwitchManagerImportResult DVSManagerImportEntity(EntityBackupConfig[] entityBackup, string importType)\n        {\n            return default(DistributedVirtualSwitchManagerImportResult);\n        }\n\n        public ManagedObjectReference DVSManagerLookupDvPortGroup(string switchUuid, string portgroupKey)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(DistributedVirtualSwitchManager distributedVirtualSwitchManager)\n        {\n            return (distributedVirtualSwitchManager != null && base.Equals(distributedVirtualSwitchManager));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManager)\n        {\n            return Equals(distributedVirtualSwitchManager as DistributedVirtualSwitchManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerCompatibilityResult : DynamicData, IEquatable<DistributedVirtualSwitchManagerCompatibilityResult>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public DistributedVirtualSwitchManagerCompatibilityResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerCompatibilityResult distributedVirtualSwitchManagerCompatibilityResult)\n        {\n            return (distributedVirtualSwitchManagerCompatibilityResult != null && ((this.Host == null && distributedVirtualSwitchManagerCompatibilityResult.Host == null) || (this.Host != null && this.Host.Equals(distributedVirtualSwitchManagerCompatibilityResult.Host))) && ((this.Error == null && distributedVirtualSwitchManagerCompatibilityResult.Error == null) || (this.Error != null && distributedVirtualSwitchManagerCompatibilityResult.Error != null && Enumerable.SequenceEqual(this.Error, distributedVirtualSwitchManagerCompatibilityResult.Error))) && ((this.LinkedView == null && distributedVirtualSwitchManagerCompatibilityResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchManagerCompatibilityResult.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerCompatibilityResult)\n        {\n            return Equals(distributedVirtualSwitchManagerCompatibilityResult as DistributedVirtualSwitchManagerCompatibilityResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Error + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerCompatibilityResult_LinkedView : IEquatable<DistributedVirtualSwitchManagerCompatibilityResult_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerCompatibilityResult_LinkedView distributedVirtualSwitchManagerCompatibilityResult_LinkedView)\n        {\n            return (distributedVirtualSwitchManagerCompatibilityResult_LinkedView != null && ((this.Host == null && distributedVirtualSwitchManagerCompatibilityResult_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(distributedVirtualSwitchManagerCompatibilityResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerCompatibilityResult_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchManagerCompatibilityResult_LinkedView as DistributedVirtualSwitchManagerCompatibilityResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerDvsProductSpec : DynamicData, IEquatable<DistributedVirtualSwitchManagerDvsProductSpec>\n    {\n        public DistributedVirtualSwitchProductSpec NewSwitchProductSpec { get; set; }\n\n        public ManagedObjectReference DistributedVirtualSwitch { get; set; }\n\n        public DistributedVirtualSwitchManagerDvsProductSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerDvsProductSpec distributedVirtualSwitchManagerDvsProductSpec)\n        {\n            return (distributedVirtualSwitchManagerDvsProductSpec != null && ((this.NewSwitchProductSpec == null && distributedVirtualSwitchManagerDvsProductSpec.NewSwitchProductSpec == null) || (this.NewSwitchProductSpec != null && this.NewSwitchProductSpec.Equals(distributedVirtualSwitchManagerDvsProductSpec.NewSwitchProductSpec))) && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchManagerDvsProductSpec.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(distributedVirtualSwitchManagerDvsProductSpec.DistributedVirtualSwitch))) && ((this.LinkedView == null && distributedVirtualSwitchManagerDvsProductSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchManagerDvsProductSpec.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerDvsProductSpec)\n        {\n            return Equals(distributedVirtualSwitchManagerDvsProductSpec as DistributedVirtualSwitchManagerDvsProductSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NewSwitchProductSpec + \"_\" + DistributedVirtualSwitch + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerDvsProductSpec_LinkedView : IEquatable<DistributedVirtualSwitchManagerDvsProductSpec_LinkedView>\n    {\n        public DistributedVirtualSwitch DistributedVirtualSwitch { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerDvsProductSpec_LinkedView distributedVirtualSwitchManagerDvsProductSpec_LinkedView)\n        {\n            return (distributedVirtualSwitchManagerDvsProductSpec_LinkedView != null && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchManagerDvsProductSpec_LinkedView.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(distributedVirtualSwitchManagerDvsProductSpec_LinkedView.DistributedVirtualSwitch))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerDvsProductSpec_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchManagerDvsProductSpec_LinkedView as DistributedVirtualSwitchManagerDvsProductSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostArrayFilter : DistributedVirtualSwitchManagerHostDvsFilterSpec, IEquatable<DistributedVirtualSwitchManagerHostArrayFilter>\n    {\n        public ManagedObjectReference[] Host { get; set; }\n\n        public DistributedVirtualSwitchManagerHostArrayFilter_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostArrayFilter distributedVirtualSwitchManagerHostArrayFilter)\n        {\n            return (distributedVirtualSwitchManagerHostArrayFilter != null && ((this.Host == null && distributedVirtualSwitchManagerHostArrayFilter.Host == null) || (this.Host != null && distributedVirtualSwitchManagerHostArrayFilter.Host != null && Enumerable.SequenceEqual(this.Host, distributedVirtualSwitchManagerHostArrayFilter.Host))) && ((this.LinkedView == null && distributedVirtualSwitchManagerHostArrayFilter.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchManagerHostArrayFilter.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostArrayFilter)\n        {\n            return Equals(distributedVirtualSwitchManagerHostArrayFilter as DistributedVirtualSwitchManagerHostArrayFilter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostArrayFilter_LinkedView : IEquatable<DistributedVirtualSwitchManagerHostArrayFilter_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostArrayFilter_LinkedView distributedVirtualSwitchManagerHostArrayFilter_LinkedView)\n        {\n            return (distributedVirtualSwitchManagerHostArrayFilter_LinkedView != null && ((this.Host == null && distributedVirtualSwitchManagerHostArrayFilter_LinkedView.Host == null) || (this.Host != null && distributedVirtualSwitchManagerHostArrayFilter_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, distributedVirtualSwitchManagerHostArrayFilter_LinkedView.Host))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostArrayFilter_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchManagerHostArrayFilter_LinkedView as DistributedVirtualSwitchManagerHostArrayFilter_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostContainer : DynamicData, IEquatable<DistributedVirtualSwitchManagerHostContainer>\n    {\n        public ManagedObjectReference Container { get; set; }\n\n        public bool Recursive { get; set; }\n\n        public DistributedVirtualSwitchManagerHostContainer_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostContainer distributedVirtualSwitchManagerHostContainer)\n        {\n            return (distributedVirtualSwitchManagerHostContainer != null && ((this.Container == null && distributedVirtualSwitchManagerHostContainer.Container == null) || (this.Container != null && this.Container.Equals(distributedVirtualSwitchManagerHostContainer.Container))) && this.Recursive == distributedVirtualSwitchManagerHostContainer.Recursive && ((this.LinkedView == null && distributedVirtualSwitchManagerHostContainer.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchManagerHostContainer.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostContainer)\n        {\n            return Equals(distributedVirtualSwitchManagerHostContainer as DistributedVirtualSwitchManagerHostContainer);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Container + \"_\" + Recursive + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostContainer_LinkedView : IEquatable<DistributedVirtualSwitchManagerHostContainer_LinkedView>\n    {\n        public ManagedEntity Container { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostContainer_LinkedView distributedVirtualSwitchManagerHostContainer_LinkedView)\n        {\n            return (distributedVirtualSwitchManagerHostContainer_LinkedView != null && ((this.Container == null && distributedVirtualSwitchManagerHostContainer_LinkedView.Container == null) || (this.Container != null && this.Container.Equals(distributedVirtualSwitchManagerHostContainer_LinkedView.Container))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostContainer_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchManagerHostContainer_LinkedView as DistributedVirtualSwitchManagerHostContainer_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Container).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostContainerFilter : DistributedVirtualSwitchManagerHostDvsFilterSpec, IEquatable<DistributedVirtualSwitchManagerHostContainerFilter>\n    {\n        public DistributedVirtualSwitchManagerHostContainer HostContainer { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostContainerFilter distributedVirtualSwitchManagerHostContainerFilter)\n        {\n            return (distributedVirtualSwitchManagerHostContainerFilter != null && ((this.HostContainer == null && distributedVirtualSwitchManagerHostContainerFilter.HostContainer == null) || (this.HostContainer != null && this.HostContainer.Equals(distributedVirtualSwitchManagerHostContainerFilter.HostContainer))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostContainerFilter)\n        {\n            return Equals(distributedVirtualSwitchManagerHostContainerFilter as DistributedVirtualSwitchManagerHostContainerFilter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostContainer).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostDvsFilterSpec : DynamicData, IEquatable<DistributedVirtualSwitchManagerHostDvsFilterSpec>\n    {\n        public bool Inclusive { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostDvsFilterSpec distributedVirtualSwitchManagerHostDvsFilterSpec)\n        {\n            return (distributedVirtualSwitchManagerHostDvsFilterSpec != null && this.Inclusive == distributedVirtualSwitchManagerHostDvsFilterSpec.Inclusive);\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostDvsFilterSpec)\n        {\n            return Equals(distributedVirtualSwitchManagerHostDvsFilterSpec as DistributedVirtualSwitchManagerHostDvsFilterSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Inclusive).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostDvsMembershipFilter : DistributedVirtualSwitchManagerHostDvsFilterSpec, IEquatable<DistributedVirtualSwitchManagerHostDvsMembershipFilter>\n    {\n        public ManagedObjectReference DistributedVirtualSwitch { get; set; }\n\n        public DistributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostDvsMembershipFilter distributedVirtualSwitchManagerHostDvsMembershipFilter)\n        {\n            return (distributedVirtualSwitchManagerHostDvsMembershipFilter != null && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchManagerHostDvsMembershipFilter.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(distributedVirtualSwitchManagerHostDvsMembershipFilter.DistributedVirtualSwitch))) && ((this.LinkedView == null && distributedVirtualSwitchManagerHostDvsMembershipFilter.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchManagerHostDvsMembershipFilter.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostDvsMembershipFilter)\n        {\n            return Equals(distributedVirtualSwitchManagerHostDvsMembershipFilter as DistributedVirtualSwitchManagerHostDvsMembershipFilter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView : IEquatable<DistributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView>\n    {\n        public DistributedVirtualSwitch DistributedVirtualSwitch { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView distributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView)\n        {\n            return (distributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView != null && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(distributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView.DistributedVirtualSwitch))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView as DistributedVirtualSwitchManagerHostDvsMembershipFilter_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerImportResult : DynamicData, IEquatable<DistributedVirtualSwitchManagerImportResult>\n    {\n        public ManagedObjectReference[] DistributedVirtualSwitch { get; set; }\n\n        public ManagedObjectReference[] DistributedVirtualPortgroup { get; set; }\n\n        public ImportOperationBulkFaultFaultOnImport[] ImportFault { get; set; }\n\n        public DistributedVirtualSwitchManagerImportResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerImportResult distributedVirtualSwitchManagerImportResult)\n        {\n            return (distributedVirtualSwitchManagerImportResult != null && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchManagerImportResult.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && distributedVirtualSwitchManagerImportResult.DistributedVirtualSwitch != null && Enumerable.SequenceEqual(this.DistributedVirtualSwitch, distributedVirtualSwitchManagerImportResult.DistributedVirtualSwitch))) && ((this.DistributedVirtualPortgroup == null && distributedVirtualSwitchManagerImportResult.DistributedVirtualPortgroup == null) || (this.DistributedVirtualPortgroup != null && distributedVirtualSwitchManagerImportResult.DistributedVirtualPortgroup != null && Enumerable.SequenceEqual(this.DistributedVirtualPortgroup, distributedVirtualSwitchManagerImportResult.DistributedVirtualPortgroup))) && ((this.ImportFault == null && distributedVirtualSwitchManagerImportResult.ImportFault == null) || (this.ImportFault != null && distributedVirtualSwitchManagerImportResult.ImportFault != null && Enumerable.SequenceEqual(this.ImportFault, distributedVirtualSwitchManagerImportResult.ImportFault))) && ((this.LinkedView == null && distributedVirtualSwitchManagerImportResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchManagerImportResult.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerImportResult)\n        {\n            return Equals(distributedVirtualSwitchManagerImportResult as DistributedVirtualSwitchManagerImportResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch + \"_\" + DistributedVirtualPortgroup + \"_\" + ImportFault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchManagerImportResult_LinkedView : IEquatable<DistributedVirtualSwitchManagerImportResult_LinkedView>\n    {\n        public DistributedVirtualSwitch[] DistributedVirtualSwitch { get; set; }\n\n        public DistributedVirtualPortgroup[] DistributedVirtualPortgroup { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchManagerImportResult_LinkedView distributedVirtualSwitchManagerImportResult_LinkedView)\n        {\n            return (distributedVirtualSwitchManagerImportResult_LinkedView != null && ((this.DistributedVirtualSwitch == null && distributedVirtualSwitchManagerImportResult_LinkedView.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && distributedVirtualSwitchManagerImportResult_LinkedView.DistributedVirtualSwitch != null && Enumerable.SequenceEqual(this.DistributedVirtualSwitch, distributedVirtualSwitchManagerImportResult_LinkedView.DistributedVirtualSwitch))) && ((this.DistributedVirtualPortgroup == null && distributedVirtualSwitchManagerImportResult_LinkedView.DistributedVirtualPortgroup == null) || (this.DistributedVirtualPortgroup != null && distributedVirtualSwitchManagerImportResult_LinkedView.DistributedVirtualPortgroup != null && Enumerable.SequenceEqual(this.DistributedVirtualPortgroup, distributedVirtualSwitchManagerImportResult_LinkedView.DistributedVirtualPortgroup))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchManagerImportResult_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchManagerImportResult_LinkedView as DistributedVirtualSwitchManagerImportResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch + \"_\" + DistributedVirtualPortgroup).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchPortConnectee : DynamicData, IEquatable<DistributedVirtualSwitchPortConnectee>\n    {\n        public ManagedObjectReference ConnectedEntity { get; set; }\n\n        public string NicKey { get; set; }\n\n        public string Type { get; set; }\n\n        public string AddressHint { get; set; }\n\n        public DistributedVirtualSwitchPortConnectee_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchPortConnectee distributedVirtualSwitchPortConnectee)\n        {\n            return (distributedVirtualSwitchPortConnectee != null && ((this.ConnectedEntity == null && distributedVirtualSwitchPortConnectee.ConnectedEntity == null) || (this.ConnectedEntity != null && this.ConnectedEntity.Equals(distributedVirtualSwitchPortConnectee.ConnectedEntity))) && this.NicKey == distributedVirtualSwitchPortConnectee.NicKey && this.Type == distributedVirtualSwitchPortConnectee.Type && this.AddressHint == distributedVirtualSwitchPortConnectee.AddressHint && ((this.LinkedView == null && distributedVirtualSwitchPortConnectee.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchPortConnectee.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchPortConnectee)\n        {\n            return Equals(distributedVirtualSwitchPortConnectee as DistributedVirtualSwitchPortConnectee);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConnectedEntity + \"_\" + NicKey + \"_\" + Type + \"_\" + AddressHint + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchPortConnectee_LinkedView : IEquatable<DistributedVirtualSwitchPortConnectee_LinkedView>\n    {\n        public ManagedEntity ConnectedEntity { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchPortConnectee_LinkedView distributedVirtualSwitchPortConnectee_LinkedView)\n        {\n            return (distributedVirtualSwitchPortConnectee_LinkedView != null && ((this.ConnectedEntity == null && distributedVirtualSwitchPortConnectee_LinkedView.ConnectedEntity == null) || (this.ConnectedEntity != null && this.ConnectedEntity.Equals(distributedVirtualSwitchPortConnectee_LinkedView.ConnectedEntity))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchPortConnectee_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchPortConnectee_LinkedView as DistributedVirtualSwitchPortConnectee_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConnectedEntity).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchPortConnection : DynamicData, IEquatable<DistributedVirtualSwitchPortConnection>\n    {\n        public string SwitchUuid { get; set; }\n\n        public string PortgroupKey { get; set; }\n\n        public string PortKey { get; set; }\n\n        public int? ConnectionCookie { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchPortConnection distributedVirtualSwitchPortConnection)\n        {\n            return (distributedVirtualSwitchPortConnection != null && this.SwitchUuid == distributedVirtualSwitchPortConnection.SwitchUuid && this.PortgroupKey == distributedVirtualSwitchPortConnection.PortgroupKey && this.PortKey == distributedVirtualSwitchPortConnection.PortKey && ((this.ConnectionCookie == null && distributedVirtualSwitchPortConnection.ConnectionCookie == null) || (this.ConnectionCookie != null && this.ConnectionCookie.Equals(distributedVirtualSwitchPortConnection.ConnectionCookie))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchPortConnection)\n        {\n            return Equals(distributedVirtualSwitchPortConnection as DistributedVirtualSwitchPortConnection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchUuid + \"_\" + PortgroupKey + \"_\" + PortKey + \"_\" + ConnectionCookie).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchPortCriteria : DynamicData, IEquatable<DistributedVirtualSwitchPortCriteria>\n    {\n        public bool? Connected { get; set; }\n\n        public bool? Active { get; set; }\n\n        public bool? UplinkPort { get; set; }\n\n        public ManagedObjectReference Scope { get; set; }\n\n        public string[] PortgroupKey { get; set; }\n\n        public bool? Inside { get; set; }\n\n        public string[] PortKey { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public DistributedVirtualSwitchPortCriteria_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchPortCriteria distributedVirtualSwitchPortCriteria)\n        {\n            return (distributedVirtualSwitchPortCriteria != null && ((this.Connected == null && distributedVirtualSwitchPortCriteria.Connected == null) || (this.Connected != null && this.Connected.Equals(distributedVirtualSwitchPortCriteria.Connected))) && ((this.Active == null && distributedVirtualSwitchPortCriteria.Active == null) || (this.Active != null && this.Active.Equals(distributedVirtualSwitchPortCriteria.Active))) && ((this.UplinkPort == null && distributedVirtualSwitchPortCriteria.UplinkPort == null) || (this.UplinkPort != null && this.UplinkPort.Equals(distributedVirtualSwitchPortCriteria.UplinkPort))) && ((this.Scope == null && distributedVirtualSwitchPortCriteria.Scope == null) || (this.Scope != null && this.Scope.Equals(distributedVirtualSwitchPortCriteria.Scope))) && ((this.PortgroupKey == null && distributedVirtualSwitchPortCriteria.PortgroupKey == null) || (this.PortgroupKey != null && distributedVirtualSwitchPortCriteria.PortgroupKey != null && Enumerable.SequenceEqual(this.PortgroupKey, distributedVirtualSwitchPortCriteria.PortgroupKey))) && ((this.Inside == null && distributedVirtualSwitchPortCriteria.Inside == null) || (this.Inside != null && this.Inside.Equals(distributedVirtualSwitchPortCriteria.Inside))) && ((this.PortKey == null && distributedVirtualSwitchPortCriteria.PortKey == null) || (this.PortKey != null && distributedVirtualSwitchPortCriteria.PortKey != null && Enumerable.SequenceEqual(this.PortKey, distributedVirtualSwitchPortCriteria.PortKey))) && ((this.Host == null && distributedVirtualSwitchPortCriteria.Host == null) || (this.Host != null && distributedVirtualSwitchPortCriteria.Host != null && Enumerable.SequenceEqual(this.Host, distributedVirtualSwitchPortCriteria.Host))) && ((this.LinkedView == null && distributedVirtualSwitchPortCriteria.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(distributedVirtualSwitchPortCriteria.LinkedView))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchPortCriteria)\n        {\n            return Equals(distributedVirtualSwitchPortCriteria as DistributedVirtualSwitchPortCriteria);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Connected + \"_\" + Active + \"_\" + UplinkPort + \"_\" + Scope + \"_\" + PortgroupKey + \"_\" + Inside + \"_\" + PortKey + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchPortCriteria_LinkedView : IEquatable<DistributedVirtualSwitchPortCriteria_LinkedView>\n    {\n        public ManagedEntity Scope { get; set; }\n\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchPortCriteria_LinkedView distributedVirtualSwitchPortCriteria_LinkedView)\n        {\n            return (distributedVirtualSwitchPortCriteria_LinkedView != null && ((this.Scope == null && distributedVirtualSwitchPortCriteria_LinkedView.Scope == null) || (this.Scope != null && this.Scope.Equals(distributedVirtualSwitchPortCriteria_LinkedView.Scope))) && ((this.Host == null && distributedVirtualSwitchPortCriteria_LinkedView.Host == null) || (this.Host != null && distributedVirtualSwitchPortCriteria_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, distributedVirtualSwitchPortCriteria_LinkedView.Host))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchPortCriteria_LinkedView)\n        {\n            return Equals(distributedVirtualSwitchPortCriteria_LinkedView as DistributedVirtualSwitchPortCriteria_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Scope + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchPortStatistics : DynamicData, IEquatable<DistributedVirtualSwitchPortStatistics>\n    {\n        public long PacketsInMulticast { get; set; }\n\n        public long PacketsOutMulticast { get; set; }\n\n        public long BytesInMulticast { get; set; }\n\n        public long BytesOutMulticast { get; set; }\n\n        public long PacketsInUnicast { get; set; }\n\n        public long PacketsOutUnicast { get; set; }\n\n        public long BytesInUnicast { get; set; }\n\n        public long BytesOutUnicast { get; set; }\n\n        public long PacketsInBroadcast { get; set; }\n\n        public long PacketsOutBroadcast { get; set; }\n\n        public long BytesInBroadcast { get; set; }\n\n        public long BytesOutBroadcast { get; set; }\n\n        public long PacketsInDropped { get; set; }\n\n        public long PacketsOutDropped { get; set; }\n\n        public long PacketsInException { get; set; }\n\n        public long PacketsOutException { get; set; }\n\n        public long? BytesInFromPnic { get; set; }\n\n        public long? BytesOutToPnic { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchPortStatistics distributedVirtualSwitchPortStatistics)\n        {\n            return (distributedVirtualSwitchPortStatistics != null && this.PacketsInMulticast == distributedVirtualSwitchPortStatistics.PacketsInMulticast && this.PacketsOutMulticast == distributedVirtualSwitchPortStatistics.PacketsOutMulticast && this.BytesInMulticast == distributedVirtualSwitchPortStatistics.BytesInMulticast && this.BytesOutMulticast == distributedVirtualSwitchPortStatistics.BytesOutMulticast && this.PacketsInUnicast == distributedVirtualSwitchPortStatistics.PacketsInUnicast && this.PacketsOutUnicast == distributedVirtualSwitchPortStatistics.PacketsOutUnicast && this.BytesInUnicast == distributedVirtualSwitchPortStatistics.BytesInUnicast && this.BytesOutUnicast == distributedVirtualSwitchPortStatistics.BytesOutUnicast && this.PacketsInBroadcast == distributedVirtualSwitchPortStatistics.PacketsInBroadcast && this.PacketsOutBroadcast == distributedVirtualSwitchPortStatistics.PacketsOutBroadcast && this.BytesInBroadcast == distributedVirtualSwitchPortStatistics.BytesInBroadcast && this.BytesOutBroadcast == distributedVirtualSwitchPortStatistics.BytesOutBroadcast && this.PacketsInDropped == distributedVirtualSwitchPortStatistics.PacketsInDropped && this.PacketsOutDropped == distributedVirtualSwitchPortStatistics.PacketsOutDropped && this.PacketsInException == distributedVirtualSwitchPortStatistics.PacketsInException && this.PacketsOutException == distributedVirtualSwitchPortStatistics.PacketsOutException && ((this.BytesInFromPnic == null && distributedVirtualSwitchPortStatistics.BytesInFromPnic == null) || (this.BytesInFromPnic != null && this.BytesInFromPnic.Equals(distributedVirtualSwitchPortStatistics.BytesInFromPnic))) && ((this.BytesOutToPnic == null && distributedVirtualSwitchPortStatistics.BytesOutToPnic == null) || (this.BytesOutToPnic != null && this.BytesOutToPnic.Equals(distributedVirtualSwitchPortStatistics.BytesOutToPnic))));\n        }\n\n        public override bool Equals(object distributedVirtualSwitchPortStatistics)\n        {\n            return Equals(distributedVirtualSwitchPortStatistics as DistributedVirtualSwitchPortStatistics);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PacketsInMulticast + \"_\" + PacketsOutMulticast + \"_\" + BytesInMulticast + \"_\" + BytesOutMulticast + \"_\" + PacketsInUnicast + \"_\" + PacketsOutUnicast + \"_\" + BytesInUnicast + \"_\" + BytesOutUnicast + \"_\" + PacketsInBroadcast + \"_\" + PacketsOutBroadcast + \"_\" + BytesInBroadcast + \"_\" + BytesOutBroadcast + \"_\" + PacketsInDropped + \"_\" + PacketsOutDropped + \"_\" + PacketsInException + \"_\" + PacketsOutException + \"_\" + BytesInFromPnic + \"_\" + BytesOutToPnic).GetHashCode();\n        }\n    }\n\n    public class DistributedVirtualSwitchProductSpec : DynamicData, IEquatable<DistributedVirtualSwitchProductSpec>\n    {\n        public string Name { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Version { get; set; }\n\n        public string Build { get; set; }\n\n        public string ForwardingClass { get; set; }\n\n        public string BundleId { get; set; }\n\n        public string BundleUrl { get; set; }\n\n        public bool Equals(DistributedVirtualSwitchProductSpec distributedVirtualSwitchProductSpec)\n        {\n            return (distributedVirtualSwitchProductSpec != null && this.Name == distributedVirtualSwitchProductSpec.Name && this.Vendor == distributedVirtualSwitchProductSpec.Vendor && this.Version == distributedVirtualSwitchProductSpec.Version && this.Build == distributedVirtualSwitchProductSpec.Build && this.ForwardingClass == distributedVirtualSwitchProductSpec.ForwardingClass && this.BundleId == distributedVirtualSwitchProductSpec.BundleId && this.BundleUrl == distributedVirtualSwitchProductSpec.BundleUrl);\n        }\n\n        public override bool Equals(object distributedVirtualSwitchProductSpec)\n        {\n            return Equals(distributedVirtualSwitchProductSpec as DistributedVirtualSwitchProductSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Vendor + \"_\" + Version + \"_\" + Build + \"_\" + ForwardingClass + \"_\" + BundleId + \"_\" + BundleUrl).GetHashCode();\n        }\n    }\n\n    public class DomainNotFound : ActiveDirectoryFault, IEquatable<DomainNotFound>\n    {\n        public string DomainName { get; set; }\n\n        public bool Equals(DomainNotFound domainNotFound)\n        {\n            return (domainNotFound != null && this.DomainName == domainNotFound.DomainName);\n        }\n\n        public override bool Equals(object domainNotFound)\n        {\n            return Equals(domainNotFound as DomainNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DomainName).GetHashCode();\n        }\n    }\n\n    public class DrsDisabledEvent : ClusterEvent, IEquatable<DrsDisabledEvent>\n    {\n        public bool Equals(DrsDisabledEvent drsDisabledEvent)\n        {\n            return (drsDisabledEvent != null && base.Equals(drsDisabledEvent));\n        }\n\n        public override bool Equals(object drsDisabledEvent)\n        {\n            return Equals(drsDisabledEvent as DrsDisabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsDisabledOnVm : VimFault, IEquatable<DrsDisabledOnVm>\n    {\n        public bool Equals(DrsDisabledOnVm drsDisabledOnVm)\n        {\n            return (drsDisabledOnVm != null && base.Equals(drsDisabledOnVm));\n        }\n\n        public override bool Equals(object drsDisabledOnVm)\n        {\n            return Equals(drsDisabledOnVm as DrsDisabledOnVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsEnabledEvent : ClusterEvent, IEquatable<DrsEnabledEvent>\n    {\n        public string Behavior { get; set; }\n\n        public bool Equals(DrsEnabledEvent drsEnabledEvent)\n        {\n            return (drsEnabledEvent != null && this.Behavior == drsEnabledEvent.Behavior);\n        }\n\n        public override bool Equals(object drsEnabledEvent)\n        {\n            return Equals(drsEnabledEvent as DrsEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Behavior).GetHashCode();\n        }\n    }\n\n    public class DrsEnteredStandbyModeEvent : EnteredStandbyModeEvent, IEquatable<DrsEnteredStandbyModeEvent>\n    {\n        public bool Equals(DrsEnteredStandbyModeEvent drsEnteredStandbyModeEvent)\n        {\n            return (drsEnteredStandbyModeEvent != null && base.Equals(drsEnteredStandbyModeEvent));\n        }\n\n        public override bool Equals(object drsEnteredStandbyModeEvent)\n        {\n            return Equals(drsEnteredStandbyModeEvent as DrsEnteredStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsEnteringStandbyModeEvent : EnteringStandbyModeEvent, IEquatable<DrsEnteringStandbyModeEvent>\n    {\n        public bool Equals(DrsEnteringStandbyModeEvent drsEnteringStandbyModeEvent)\n        {\n            return (drsEnteringStandbyModeEvent != null && base.Equals(drsEnteringStandbyModeEvent));\n        }\n\n        public override bool Equals(object drsEnteringStandbyModeEvent)\n        {\n            return Equals(drsEnteringStandbyModeEvent as DrsEnteringStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsExitedStandbyModeEvent : ExitedStandbyModeEvent, IEquatable<DrsExitedStandbyModeEvent>\n    {\n        public bool Equals(DrsExitedStandbyModeEvent drsExitedStandbyModeEvent)\n        {\n            return (drsExitedStandbyModeEvent != null && base.Equals(drsExitedStandbyModeEvent));\n        }\n\n        public override bool Equals(object drsExitedStandbyModeEvent)\n        {\n            return Equals(drsExitedStandbyModeEvent as DrsExitedStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsExitingStandbyModeEvent : ExitingStandbyModeEvent, IEquatable<DrsExitingStandbyModeEvent>\n    {\n        public bool Equals(DrsExitingStandbyModeEvent drsExitingStandbyModeEvent)\n        {\n            return (drsExitingStandbyModeEvent != null && base.Equals(drsExitingStandbyModeEvent));\n        }\n\n        public override bool Equals(object drsExitingStandbyModeEvent)\n        {\n            return Equals(drsExitingStandbyModeEvent as DrsExitingStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsExitStandbyModeFailedEvent : ExitStandbyModeFailedEvent, IEquatable<DrsExitStandbyModeFailedEvent>\n    {\n        public bool Equals(DrsExitStandbyModeFailedEvent drsExitStandbyModeFailedEvent)\n        {\n            return (drsExitStandbyModeFailedEvent != null && base.Equals(drsExitStandbyModeFailedEvent));\n        }\n\n        public override bool Equals(object drsExitStandbyModeFailedEvent)\n        {\n            return Equals(drsExitStandbyModeFailedEvent as DrsExitStandbyModeFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsInvocationFailedEvent : ClusterEvent, IEquatable<DrsInvocationFailedEvent>\n    {\n        public bool Equals(DrsInvocationFailedEvent drsInvocationFailedEvent)\n        {\n            return (drsInvocationFailedEvent != null && base.Equals(drsInvocationFailedEvent));\n        }\n\n        public override bool Equals(object drsInvocationFailedEvent)\n        {\n            return Equals(drsInvocationFailedEvent as DrsInvocationFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsRecoveredFromFailureEvent : ClusterEvent, IEquatable<DrsRecoveredFromFailureEvent>\n    {\n        public bool Equals(DrsRecoveredFromFailureEvent drsRecoveredFromFailureEvent)\n        {\n            return (drsRecoveredFromFailureEvent != null && base.Equals(drsRecoveredFromFailureEvent));\n        }\n\n        public override bool Equals(object drsRecoveredFromFailureEvent)\n        {\n            return Equals(drsRecoveredFromFailureEvent as DrsRecoveredFromFailureEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsResourceConfigureFailedEvent : HostEvent, IEquatable<DrsResourceConfigureFailedEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(DrsResourceConfigureFailedEvent drsResourceConfigureFailedEvent)\n        {\n            return (drsResourceConfigureFailedEvent != null && ((this.Reason == null && drsResourceConfigureFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(drsResourceConfigureFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object drsResourceConfigureFailedEvent)\n        {\n            return Equals(drsResourceConfigureFailedEvent as DrsResourceConfigureFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class DrsResourceConfigureSyncedEvent : HostEvent, IEquatable<DrsResourceConfigureSyncedEvent>\n    {\n        public bool Equals(DrsResourceConfigureSyncedEvent drsResourceConfigureSyncedEvent)\n        {\n            return (drsResourceConfigureSyncedEvent != null && base.Equals(drsResourceConfigureSyncedEvent));\n        }\n\n        public override bool Equals(object drsResourceConfigureSyncedEvent)\n        {\n            return Equals(drsResourceConfigureSyncedEvent as DrsResourceConfigureSyncedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsRuleComplianceEvent : VmEvent, IEquatable<DrsRuleComplianceEvent>\n    {\n        public bool Equals(DrsRuleComplianceEvent drsRuleComplianceEvent)\n        {\n            return (drsRuleComplianceEvent != null && base.Equals(drsRuleComplianceEvent));\n        }\n\n        public override bool Equals(object drsRuleComplianceEvent)\n        {\n            return Equals(drsRuleComplianceEvent as DrsRuleComplianceEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsRuleViolationEvent : VmEvent, IEquatable<DrsRuleViolationEvent>\n    {\n        public bool Equals(DrsRuleViolationEvent drsRuleViolationEvent)\n        {\n            return (drsRuleViolationEvent != null && base.Equals(drsRuleViolationEvent));\n        }\n\n        public override bool Equals(object drsRuleViolationEvent)\n        {\n            return Equals(drsRuleViolationEvent as DrsRuleViolationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsSoftRuleViolationEvent : VmEvent, IEquatable<DrsSoftRuleViolationEvent>\n    {\n        public bool Equals(DrsSoftRuleViolationEvent drsSoftRuleViolationEvent)\n        {\n            return (drsSoftRuleViolationEvent != null && base.Equals(drsSoftRuleViolationEvent));\n        }\n\n        public override bool Equals(object drsSoftRuleViolationEvent)\n        {\n            return Equals(drsSoftRuleViolationEvent as DrsSoftRuleViolationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsVmMigratedEvent : VmMigratedEvent, IEquatable<DrsVmMigratedEvent>\n    {\n        public bool Equals(DrsVmMigratedEvent drsVmMigratedEvent)\n        {\n            return (drsVmMigratedEvent != null && base.Equals(drsVmMigratedEvent));\n        }\n\n        public override bool Equals(object drsVmMigratedEvent)\n        {\n            return Equals(drsVmMigratedEvent as DrsVmMigratedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DrsVmotionIncompatibleFault : VirtualHardwareCompatibilityIssue, IEquatable<DrsVmotionIncompatibleFault>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public DrsVmotionIncompatibleFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DrsVmotionIncompatibleFault drsVmotionIncompatibleFault)\n        {\n            return (drsVmotionIncompatibleFault != null && ((this.Host == null && drsVmotionIncompatibleFault.Host == null) || (this.Host != null && this.Host.Equals(drsVmotionIncompatibleFault.Host))) && ((this.LinkedView == null && drsVmotionIncompatibleFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(drsVmotionIncompatibleFault.LinkedView))));\n        }\n\n        public override bool Equals(object drsVmotionIncompatibleFault)\n        {\n            return Equals(drsVmotionIncompatibleFault as DrsVmotionIncompatibleFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DrsVmotionIncompatibleFault_LinkedView : IEquatable<DrsVmotionIncompatibleFault_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DrsVmotionIncompatibleFault_LinkedView drsVmotionIncompatibleFault_LinkedView)\n        {\n            return (drsVmotionIncompatibleFault_LinkedView != null && ((this.Host == null && drsVmotionIncompatibleFault_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(drsVmotionIncompatibleFault_LinkedView.Host))));\n        }\n\n        public override bool Equals(object drsVmotionIncompatibleFault_LinkedView)\n        {\n            return Equals(drsVmotionIncompatibleFault_LinkedView as DrsVmotionIncompatibleFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DrsVmPoweredOnEvent : VmPoweredOnEvent, IEquatable<DrsVmPoweredOnEvent>\n    {\n        public bool Equals(DrsVmPoweredOnEvent drsVmPoweredOnEvent)\n        {\n            return (drsVmPoweredOnEvent != null && base.Equals(drsVmPoweredOnEvent));\n        }\n\n        public override bool Equals(object drsVmPoweredOnEvent)\n        {\n            return Equals(drsVmPoweredOnEvent as DrsVmPoweredOnEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DuplicateDisks : VsanDiskFault, IEquatable<DuplicateDisks>\n    {\n        public bool Equals(DuplicateDisks duplicateDisks)\n        {\n            return (duplicateDisks != null && base.Equals(duplicateDisks));\n        }\n\n        public override bool Equals(object duplicateDisks)\n        {\n            return Equals(duplicateDisks as DuplicateDisks);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DuplicateIpDetectedEvent : HostEvent, IEquatable<DuplicateIpDetectedEvent>\n    {\n        public string DuplicateIP { get; set; }\n\n        public string MacAddress { get; set; }\n\n        public bool Equals(DuplicateIpDetectedEvent duplicateIpDetectedEvent)\n        {\n            return (duplicateIpDetectedEvent != null && this.DuplicateIP == duplicateIpDetectedEvent.DuplicateIP && this.MacAddress == duplicateIpDetectedEvent.MacAddress);\n        }\n\n        public override bool Equals(object duplicateIpDetectedEvent)\n        {\n            return Equals(duplicateIpDetectedEvent as DuplicateIpDetectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DuplicateIP + \"_\" + MacAddress).GetHashCode();\n        }\n    }\n\n    public class DuplicateName : VimFault, IEquatable<DuplicateName>\n    {\n        public string Name { get; set; }\n\n        public ManagedObjectReference Object { get; set; }\n\n        public bool Equals(DuplicateName duplicateName)\n        {\n            return (duplicateName != null && this.Name == duplicateName.Name && ((this.Object == null && duplicateName.Object == null) || (this.Object != null && this.Object.Equals(duplicateName.Object))));\n        }\n\n        public override bool Equals(object duplicateName)\n        {\n            return Equals(duplicateName as DuplicateName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Object).GetHashCode();\n        }\n    }\n\n    public class DuplicateVsanNetworkInterface : VsanFault, IEquatable<DuplicateVsanNetworkInterface>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(DuplicateVsanNetworkInterface duplicateVsanNetworkInterface)\n        {\n            return (duplicateVsanNetworkInterface != null && this.Device == duplicateVsanNetworkInterface.Device);\n        }\n\n        public override bool Equals(object duplicateVsanNetworkInterface)\n        {\n            return Equals(duplicateVsanNetworkInterface as DuplicateVsanNetworkInterface);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class DvpgImportEvent : DVPortgroupEvent, IEquatable<DvpgImportEvent>\n    {\n        public string ImportType { get; set; }\n\n        public bool Equals(DvpgImportEvent dvpgImportEvent)\n        {\n            return (dvpgImportEvent != null && this.ImportType == dvpgImportEvent.ImportType);\n        }\n\n        public override bool Equals(object dvpgImportEvent)\n        {\n            return Equals(dvpgImportEvent as DvpgImportEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ImportType).GetHashCode();\n        }\n    }\n\n    public class DvpgRestoreEvent : DVPortgroupEvent, IEquatable<DvpgRestoreEvent>\n    {\n        public bool Equals(DvpgRestoreEvent dvpgRestoreEvent)\n        {\n            return (dvpgRestoreEvent != null && base.Equals(dvpgRestoreEvent));\n        }\n\n        public override bool Equals(object dvpgRestoreEvent)\n        {\n            return Equals(dvpgRestoreEvent as DvpgRestoreEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVPortConfigInfo : DynamicData, IEquatable<DVPortConfigInfo>\n    {\n        public string Name { get; set; }\n\n        public ManagedObjectReference[] Scope { get; set; }\n\n        public string Description { get; set; }\n\n        public DVPortSetting Setting { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DVPortConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVPortConfigInfo dVPortConfigInfo)\n        {\n            return (dVPortConfigInfo != null && this.Name == dVPortConfigInfo.Name && ((this.Scope == null && dVPortConfigInfo.Scope == null) || (this.Scope != null && dVPortConfigInfo.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortConfigInfo.Scope))) && this.Description == dVPortConfigInfo.Description && ((this.Setting == null && dVPortConfigInfo.Setting == null) || (this.Setting != null && this.Setting.Equals(dVPortConfigInfo.Setting))) && this.ConfigVersion == dVPortConfigInfo.ConfigVersion && ((this.LinkedView == null && dVPortConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVPortConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object dVPortConfigInfo)\n        {\n            return Equals(dVPortConfigInfo as DVPortConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Scope + \"_\" + Description + \"_\" + Setting + \"_\" + ConfigVersion + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVPortConfigInfo_LinkedView : IEquatable<DVPortConfigInfo_LinkedView>\n    {\n        public ManagedEntity[] Scope { get; set; }\n\n        public bool Equals(DVPortConfigInfo_LinkedView dVPortConfigInfo_LinkedView)\n        {\n            return (dVPortConfigInfo_LinkedView != null && ((this.Scope == null && dVPortConfigInfo_LinkedView.Scope == null) || (this.Scope != null && dVPortConfigInfo_LinkedView.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortConfigInfo_LinkedView.Scope))));\n        }\n\n        public override bool Equals(object dVPortConfigInfo_LinkedView)\n        {\n            return Equals(dVPortConfigInfo_LinkedView as DVPortConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Scope).GetHashCode();\n        }\n    }\n\n    public class DVPortConfigSpec : DynamicData, IEquatable<DVPortConfigSpec>\n    {\n        public string Operation { get; set; }\n\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public ManagedObjectReference[] Scope { get; set; }\n\n        public string Description { get; set; }\n\n        public DVPortSetting Setting { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DVPortConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVPortConfigSpec dVPortConfigSpec)\n        {\n            return (dVPortConfigSpec != null && this.Operation == dVPortConfigSpec.Operation && this.Key == dVPortConfigSpec.Key && this.Name == dVPortConfigSpec.Name && ((this.Scope == null && dVPortConfigSpec.Scope == null) || (this.Scope != null && dVPortConfigSpec.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortConfigSpec.Scope))) && this.Description == dVPortConfigSpec.Description && ((this.Setting == null && dVPortConfigSpec.Setting == null) || (this.Setting != null && this.Setting.Equals(dVPortConfigSpec.Setting))) && this.ConfigVersion == dVPortConfigSpec.ConfigVersion && ((this.LinkedView == null && dVPortConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVPortConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object dVPortConfigSpec)\n        {\n            return Equals(dVPortConfigSpec as DVPortConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + Key + \"_\" + Name + \"_\" + Scope + \"_\" + Description + \"_\" + Setting + \"_\" + ConfigVersion + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVPortConfigSpec_LinkedView : IEquatable<DVPortConfigSpec_LinkedView>\n    {\n        public ManagedEntity[] Scope { get; set; }\n\n        public bool Equals(DVPortConfigSpec_LinkedView dVPortConfigSpec_LinkedView)\n        {\n            return (dVPortConfigSpec_LinkedView != null && ((this.Scope == null && dVPortConfigSpec_LinkedView.Scope == null) || (this.Scope != null && dVPortConfigSpec_LinkedView.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortConfigSpec_LinkedView.Scope))));\n        }\n\n        public override bool Equals(object dVPortConfigSpec_LinkedView)\n        {\n            return Equals(dVPortConfigSpec_LinkedView as DVPortConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Scope).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupConfigInfo : DynamicData, IEquatable<DVPortgroupConfigInfo>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public ManagedObjectReference DistributedVirtualSwitch { get; set; }\n\n        public DVPortSetting DefaultPortConfig { get; set; }\n\n        public string Description { get; set; }\n\n        public string Type { get; set; }\n\n        public DVPortgroupPolicy Policy { get; set; }\n\n        public string PortNameFormat { get; set; }\n\n        public ManagedObjectReference[] Scope { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificConfig { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public bool? AutoExpand { get; set; }\n\n        public string VmVnicNetworkResourcePoolKey { get; set; }\n\n        public bool? Uplink { get; set; }\n\n        public DVPortgroupConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVPortgroupConfigInfo dVPortgroupConfigInfo)\n        {\n            return (dVPortgroupConfigInfo != null && this.Key == dVPortgroupConfigInfo.Key && this.Name == dVPortgroupConfigInfo.Name && this.NumPorts == dVPortgroupConfigInfo.NumPorts && ((this.DistributedVirtualSwitch == null && dVPortgroupConfigInfo.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(dVPortgroupConfigInfo.DistributedVirtualSwitch))) && ((this.DefaultPortConfig == null && dVPortgroupConfigInfo.DefaultPortConfig == null) || (this.DefaultPortConfig != null && this.DefaultPortConfig.Equals(dVPortgroupConfigInfo.DefaultPortConfig))) && this.Description == dVPortgroupConfigInfo.Description && this.Type == dVPortgroupConfigInfo.Type && ((this.Policy == null && dVPortgroupConfigInfo.Policy == null) || (this.Policy != null && this.Policy.Equals(dVPortgroupConfigInfo.Policy))) && this.PortNameFormat == dVPortgroupConfigInfo.PortNameFormat && ((this.Scope == null && dVPortgroupConfigInfo.Scope == null) || (this.Scope != null && dVPortgroupConfigInfo.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortgroupConfigInfo.Scope))) && ((this.VendorSpecificConfig == null && dVPortgroupConfigInfo.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && dVPortgroupConfigInfo.VendorSpecificConfig != null && Enumerable.SequenceEqual(this.VendorSpecificConfig, dVPortgroupConfigInfo.VendorSpecificConfig))) && this.ConfigVersion == dVPortgroupConfigInfo.ConfigVersion && ((this.AutoExpand == null && dVPortgroupConfigInfo.AutoExpand == null) || (this.AutoExpand != null && this.AutoExpand.Equals(dVPortgroupConfigInfo.AutoExpand))) && this.VmVnicNetworkResourcePoolKey == dVPortgroupConfigInfo.VmVnicNetworkResourcePoolKey && ((this.Uplink == null && dVPortgroupConfigInfo.Uplink == null) || (this.Uplink != null && this.Uplink.Equals(dVPortgroupConfigInfo.Uplink))) && ((this.LinkedView == null && dVPortgroupConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVPortgroupConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object dVPortgroupConfigInfo)\n        {\n            return Equals(dVPortgroupConfigInfo as DVPortgroupConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + NumPorts + \"_\" + DistributedVirtualSwitch + \"_\" + DefaultPortConfig + \"_\" + Description + \"_\" + Type + \"_\" + Policy + \"_\" + PortNameFormat + \"_\" + Scope + \"_\" + VendorSpecificConfig + \"_\" + ConfigVersion + \"_\" + AutoExpand + \"_\" + VmVnicNetworkResourcePoolKey + \"_\" + Uplink + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupConfigInfo_LinkedView : IEquatable<DVPortgroupConfigInfo_LinkedView>\n    {\n        public DistributedVirtualSwitch DistributedVirtualSwitch { get; set; }\n\n        public ManagedEntity[] Scope { get; set; }\n\n        public bool Equals(DVPortgroupConfigInfo_LinkedView dVPortgroupConfigInfo_LinkedView)\n        {\n            return (dVPortgroupConfigInfo_LinkedView != null && ((this.DistributedVirtualSwitch == null && dVPortgroupConfigInfo_LinkedView.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && this.DistributedVirtualSwitch.Equals(dVPortgroupConfigInfo_LinkedView.DistributedVirtualSwitch))) && ((this.Scope == null && dVPortgroupConfigInfo_LinkedView.Scope == null) || (this.Scope != null && dVPortgroupConfigInfo_LinkedView.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortgroupConfigInfo_LinkedView.Scope))));\n        }\n\n        public override bool Equals(object dVPortgroupConfigInfo_LinkedView)\n        {\n            return Equals(dVPortgroupConfigInfo_LinkedView as DVPortgroupConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualSwitch + \"_\" + Scope).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupConfigSpec : DynamicData, IEquatable<DVPortgroupConfigSpec>\n    {\n        public string ConfigVersion { get; set; }\n\n        public string Name { get; set; }\n\n        public int? NumPorts { get; set; }\n\n        public string PortNameFormat { get; set; }\n\n        public DVPortSetting DefaultPortConfig { get; set; }\n\n        public string Description { get; set; }\n\n        public string Type { get; set; }\n\n        public ManagedObjectReference[] Scope { get; set; }\n\n        public DVPortgroupPolicy Policy { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificConfig { get; set; }\n\n        public bool? AutoExpand { get; set; }\n\n        public string VmVnicNetworkResourcePoolKey { get; set; }\n\n        public DVPortgroupConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVPortgroupConfigSpec dVPortgroupConfigSpec)\n        {\n            return (dVPortgroupConfigSpec != null && this.ConfigVersion == dVPortgroupConfigSpec.ConfigVersion && this.Name == dVPortgroupConfigSpec.Name && ((this.NumPorts == null && dVPortgroupConfigSpec.NumPorts == null) || (this.NumPorts != null && this.NumPorts.Equals(dVPortgroupConfigSpec.NumPorts))) && this.PortNameFormat == dVPortgroupConfigSpec.PortNameFormat && ((this.DefaultPortConfig == null && dVPortgroupConfigSpec.DefaultPortConfig == null) || (this.DefaultPortConfig != null && this.DefaultPortConfig.Equals(dVPortgroupConfigSpec.DefaultPortConfig))) && this.Description == dVPortgroupConfigSpec.Description && this.Type == dVPortgroupConfigSpec.Type && ((this.Scope == null && dVPortgroupConfigSpec.Scope == null) || (this.Scope != null && dVPortgroupConfigSpec.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortgroupConfigSpec.Scope))) && ((this.Policy == null && dVPortgroupConfigSpec.Policy == null) || (this.Policy != null && this.Policy.Equals(dVPortgroupConfigSpec.Policy))) && ((this.VendorSpecificConfig == null && dVPortgroupConfigSpec.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && dVPortgroupConfigSpec.VendorSpecificConfig != null && Enumerable.SequenceEqual(this.VendorSpecificConfig, dVPortgroupConfigSpec.VendorSpecificConfig))) && ((this.AutoExpand == null && dVPortgroupConfigSpec.AutoExpand == null) || (this.AutoExpand != null && this.AutoExpand.Equals(dVPortgroupConfigSpec.AutoExpand))) && this.VmVnicNetworkResourcePoolKey == dVPortgroupConfigSpec.VmVnicNetworkResourcePoolKey && ((this.LinkedView == null && dVPortgroupConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVPortgroupConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object dVPortgroupConfigSpec)\n        {\n            return Equals(dVPortgroupConfigSpec as DVPortgroupConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigVersion + \"_\" + Name + \"_\" + NumPorts + \"_\" + PortNameFormat + \"_\" + DefaultPortConfig + \"_\" + Description + \"_\" + Type + \"_\" + Scope + \"_\" + Policy + \"_\" + VendorSpecificConfig + \"_\" + AutoExpand + \"_\" + VmVnicNetworkResourcePoolKey + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupConfigSpec_LinkedView : IEquatable<DVPortgroupConfigSpec_LinkedView>\n    {\n        public ManagedEntity[] Scope { get; set; }\n\n        public bool Equals(DVPortgroupConfigSpec_LinkedView dVPortgroupConfigSpec_LinkedView)\n        {\n            return (dVPortgroupConfigSpec_LinkedView != null && ((this.Scope == null && dVPortgroupConfigSpec_LinkedView.Scope == null) || (this.Scope != null && dVPortgroupConfigSpec_LinkedView.Scope != null && Enumerable.SequenceEqual(this.Scope, dVPortgroupConfigSpec_LinkedView.Scope))));\n        }\n\n        public override bool Equals(object dVPortgroupConfigSpec_LinkedView)\n        {\n            return Equals(dVPortgroupConfigSpec_LinkedView as DVPortgroupConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Scope).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupCreatedEvent : DVPortgroupEvent, IEquatable<DVPortgroupCreatedEvent>\n    {\n        public bool Equals(DVPortgroupCreatedEvent dVPortgroupCreatedEvent)\n        {\n            return (dVPortgroupCreatedEvent != null && base.Equals(dVPortgroupCreatedEvent));\n        }\n\n        public override bool Equals(object dVPortgroupCreatedEvent)\n        {\n            return Equals(dVPortgroupCreatedEvent as DVPortgroupCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVPortgroupDestroyedEvent : DVPortgroupEvent, IEquatable<DVPortgroupDestroyedEvent>\n    {\n        public bool Equals(DVPortgroupDestroyedEvent dVPortgroupDestroyedEvent)\n        {\n            return (dVPortgroupDestroyedEvent != null && base.Equals(dVPortgroupDestroyedEvent));\n        }\n\n        public override bool Equals(object dVPortgroupDestroyedEvent)\n        {\n            return Equals(dVPortgroupDestroyedEvent as DVPortgroupDestroyedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVPortgroupEvent : Event, IEquatable<DVPortgroupEvent>\n    {\n        public bool Equals(DVPortgroupEvent dVPortgroupEvent)\n        {\n            return (dVPortgroupEvent != null && base.Equals(dVPortgroupEvent));\n        }\n\n        public override bool Equals(object dVPortgroupEvent)\n        {\n            return Equals(dVPortgroupEvent as DVPortgroupEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVPortgroupPolicy : DynamicData, IEquatable<DVPortgroupPolicy>\n    {\n        public bool BlockOverrideAllowed { get; set; }\n\n        public bool ShapingOverrideAllowed { get; set; }\n\n        public bool VendorConfigOverrideAllowed { get; set; }\n\n        public bool LivePortMovingAllowed { get; set; }\n\n        public bool PortConfigResetAtDisconnect { get; set; }\n\n        public bool? NetworkResourcePoolOverrideAllowed { get; set; }\n\n        public bool? TrafficFilterOverrideAllowed { get; set; }\n\n        public bool Equals(DVPortgroupPolicy dVPortgroupPolicy)\n        {\n            return (dVPortgroupPolicy != null && this.BlockOverrideAllowed == dVPortgroupPolicy.BlockOverrideAllowed && this.ShapingOverrideAllowed == dVPortgroupPolicy.ShapingOverrideAllowed && this.VendorConfigOverrideAllowed == dVPortgroupPolicy.VendorConfigOverrideAllowed && this.LivePortMovingAllowed == dVPortgroupPolicy.LivePortMovingAllowed && this.PortConfigResetAtDisconnect == dVPortgroupPolicy.PortConfigResetAtDisconnect && ((this.NetworkResourcePoolOverrideAllowed == null && dVPortgroupPolicy.NetworkResourcePoolOverrideAllowed == null) || (this.NetworkResourcePoolOverrideAllowed != null && this.NetworkResourcePoolOverrideAllowed.Equals(dVPortgroupPolicy.NetworkResourcePoolOverrideAllowed))) && ((this.TrafficFilterOverrideAllowed == null && dVPortgroupPolicy.TrafficFilterOverrideAllowed == null) || (this.TrafficFilterOverrideAllowed != null && this.TrafficFilterOverrideAllowed.Equals(dVPortgroupPolicy.TrafficFilterOverrideAllowed))));\n        }\n\n        public override bool Equals(object dVPortgroupPolicy)\n        {\n            return Equals(dVPortgroupPolicy as DVPortgroupPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BlockOverrideAllowed + \"_\" + ShapingOverrideAllowed + \"_\" + VendorConfigOverrideAllowed + \"_\" + LivePortMovingAllowed + \"_\" + PortConfigResetAtDisconnect + \"_\" + NetworkResourcePoolOverrideAllowed + \"_\" + TrafficFilterOverrideAllowed).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupReconfiguredEvent : DVPortgroupEvent, IEquatable<DVPortgroupReconfiguredEvent>\n    {\n        public DVPortgroupConfigSpec ConfigSpec { get; set; }\n\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(DVPortgroupReconfiguredEvent dVPortgroupReconfiguredEvent)\n        {\n            return (dVPortgroupReconfiguredEvent != null && ((this.ConfigSpec == null && dVPortgroupReconfiguredEvent.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(dVPortgroupReconfiguredEvent.ConfigSpec))) && ((this.ConfigChanges == null && dVPortgroupReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(dVPortgroupReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object dVPortgroupReconfiguredEvent)\n        {\n            return Equals(dVPortgroupReconfiguredEvent as DVPortgroupReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec + \"_\" + ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupRenamedEvent : DVPortgroupEvent, IEquatable<DVPortgroupRenamedEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(DVPortgroupRenamedEvent dVPortgroupRenamedEvent)\n        {\n            return (dVPortgroupRenamedEvent != null && this.OldName == dVPortgroupRenamedEvent.OldName && this.NewName == dVPortgroupRenamedEvent.NewName);\n        }\n\n        public override bool Equals(object dVPortgroupRenamedEvent)\n        {\n            return Equals(dVPortgroupRenamedEvent as DVPortgroupRenamedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class DVPortgroupSelection : SelectionSet, IEquatable<DVPortgroupSelection>\n    {\n        public string DvsUuid { get; set; }\n\n        public string[] PortgroupKey { get; set; }\n\n        public bool Equals(DVPortgroupSelection dVPortgroupSelection)\n        {\n            return (dVPortgroupSelection != null && this.DvsUuid == dVPortgroupSelection.DvsUuid && ((this.PortgroupKey == null && dVPortgroupSelection.PortgroupKey == null) || (this.PortgroupKey != null && dVPortgroupSelection.PortgroupKey != null && Enumerable.SequenceEqual(this.PortgroupKey, dVPortgroupSelection.PortgroupKey))));\n        }\n\n        public override bool Equals(object dVPortgroupSelection)\n        {\n            return Equals(dVPortgroupSelection as DVPortgroupSelection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsUuid + \"_\" + PortgroupKey).GetHashCode();\n        }\n    }\n\n    public class DVPortNotSupported : DeviceBackingNotSupported, IEquatable<DVPortNotSupported>\n    {\n        public bool Equals(DVPortNotSupported dVPortNotSupported)\n        {\n            return (dVPortNotSupported != null && base.Equals(dVPortNotSupported));\n        }\n\n        public override bool Equals(object dVPortNotSupported)\n        {\n            return Equals(dVPortNotSupported as DVPortNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVPortSetting : DynamicData, IEquatable<DVPortSetting>\n    {\n        public BoolPolicy Blocked { get; set; }\n\n        public BoolPolicy VmDirectPathGen2Allowed { get; set; }\n\n        public DVSTrafficShapingPolicy InShapingPolicy { get; set; }\n\n        public DVSTrafficShapingPolicy OutShapingPolicy { get; set; }\n\n        public DVSVendorSpecificConfig VendorSpecificConfig { get; set; }\n\n        public StringPolicy NetworkResourcePoolKey { get; set; }\n\n        public DvsFilterPolicy FilterPolicy { get; set; }\n\n        public bool Equals(DVPortSetting dVPortSetting)\n        {\n            return (dVPortSetting != null && ((this.Blocked == null && dVPortSetting.Blocked == null) || (this.Blocked != null && this.Blocked.Equals(dVPortSetting.Blocked))) && ((this.VmDirectPathGen2Allowed == null && dVPortSetting.VmDirectPathGen2Allowed == null) || (this.VmDirectPathGen2Allowed != null && this.VmDirectPathGen2Allowed.Equals(dVPortSetting.VmDirectPathGen2Allowed))) && ((this.InShapingPolicy == null && dVPortSetting.InShapingPolicy == null) || (this.InShapingPolicy != null && this.InShapingPolicy.Equals(dVPortSetting.InShapingPolicy))) && ((this.OutShapingPolicy == null && dVPortSetting.OutShapingPolicy == null) || (this.OutShapingPolicy != null && this.OutShapingPolicy.Equals(dVPortSetting.OutShapingPolicy))) && ((this.VendorSpecificConfig == null && dVPortSetting.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && this.VendorSpecificConfig.Equals(dVPortSetting.VendorSpecificConfig))) && ((this.NetworkResourcePoolKey == null && dVPortSetting.NetworkResourcePoolKey == null) || (this.NetworkResourcePoolKey != null && this.NetworkResourcePoolKey.Equals(dVPortSetting.NetworkResourcePoolKey))) && ((this.FilterPolicy == null && dVPortSetting.FilterPolicy == null) || (this.FilterPolicy != null && this.FilterPolicy.Equals(dVPortSetting.FilterPolicy))));\n        }\n\n        public override bool Equals(object dVPortSetting)\n        {\n            return Equals(dVPortSetting as DVPortSetting);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Blocked + \"_\" + VmDirectPathGen2Allowed + \"_\" + InShapingPolicy + \"_\" + OutShapingPolicy + \"_\" + VendorSpecificConfig + \"_\" + NetworkResourcePoolKey + \"_\" + FilterPolicy).GetHashCode();\n        }\n    }\n\n    public class DVPortState : DynamicData, IEquatable<DVPortState>\n    {\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public DistributedVirtualSwitchPortStatistics Stats { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificState { get; set; }\n\n        public bool Equals(DVPortState dVPortState)\n        {\n            return (dVPortState != null && ((this.RuntimeInfo == null && dVPortState.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dVPortState.RuntimeInfo))) && ((this.Stats == null && dVPortState.Stats == null) || (this.Stats != null && this.Stats.Equals(dVPortState.Stats))) && ((this.VendorSpecificState == null && dVPortState.VendorSpecificState == null) || (this.VendorSpecificState != null && dVPortState.VendorSpecificState != null && Enumerable.SequenceEqual(this.VendorSpecificState, dVPortState.VendorSpecificState))));\n        }\n\n        public override bool Equals(object dVPortState)\n        {\n            return Equals(dVPortState as DVPortState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RuntimeInfo + \"_\" + Stats + \"_\" + VendorSpecificState).GetHashCode();\n        }\n    }\n\n    public class DVPortStatus : DynamicData, IEquatable<DVPortStatus>\n    {\n        public bool LinkUp { get; set; }\n\n        public bool Blocked { get; set; }\n\n        public NumericRange[] VlanIds { get; set; }\n\n        public bool? TrunkingMode { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public string LinkPeer { get; set; }\n\n        public string MacAddress { get; set; }\n\n        public string StatusDetail { get; set; }\n\n        public bool? VmDirectPathGen2Active { get; set; }\n\n        public string[] VmDirectPathGen2InactiveReasonNetwork { get; set; }\n\n        public string[] VmDirectPathGen2InactiveReasonOther { get; set; }\n\n        public string VmDirectPathGen2InactiveReasonExtended { get; set; }\n\n        public bool Equals(DVPortStatus dVPortStatus)\n        {\n            return (dVPortStatus != null && this.LinkUp == dVPortStatus.LinkUp && this.Blocked == dVPortStatus.Blocked && ((this.VlanIds == null && dVPortStatus.VlanIds == null) || (this.VlanIds != null && dVPortStatus.VlanIds != null && Enumerable.SequenceEqual(this.VlanIds, dVPortStatus.VlanIds))) && ((this.TrunkingMode == null && dVPortStatus.TrunkingMode == null) || (this.TrunkingMode != null && this.TrunkingMode.Equals(dVPortStatus.TrunkingMode))) && ((this.Mtu == null && dVPortStatus.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(dVPortStatus.Mtu))) && this.LinkPeer == dVPortStatus.LinkPeer && this.MacAddress == dVPortStatus.MacAddress && this.StatusDetail == dVPortStatus.StatusDetail && ((this.VmDirectPathGen2Active == null && dVPortStatus.VmDirectPathGen2Active == null) || (this.VmDirectPathGen2Active != null && this.VmDirectPathGen2Active.Equals(dVPortStatus.VmDirectPathGen2Active))) && ((this.VmDirectPathGen2InactiveReasonNetwork == null && dVPortStatus.VmDirectPathGen2InactiveReasonNetwork == null) || (this.VmDirectPathGen2InactiveReasonNetwork != null && dVPortStatus.VmDirectPathGen2InactiveReasonNetwork != null && Enumerable.SequenceEqual(this.VmDirectPathGen2InactiveReasonNetwork, dVPortStatus.VmDirectPathGen2InactiveReasonNetwork))) && ((this.VmDirectPathGen2InactiveReasonOther == null && dVPortStatus.VmDirectPathGen2InactiveReasonOther == null) || (this.VmDirectPathGen2InactiveReasonOther != null && dVPortStatus.VmDirectPathGen2InactiveReasonOther != null && Enumerable.SequenceEqual(this.VmDirectPathGen2InactiveReasonOther, dVPortStatus.VmDirectPathGen2InactiveReasonOther))) && this.VmDirectPathGen2InactiveReasonExtended == dVPortStatus.VmDirectPathGen2InactiveReasonExtended);\n        }\n\n        public override bool Equals(object dVPortStatus)\n        {\n            return Equals(dVPortStatus as DVPortStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkUp + \"_\" + Blocked + \"_\" + VlanIds + \"_\" + TrunkingMode + \"_\" + Mtu + \"_\" + LinkPeer + \"_\" + MacAddress + \"_\" + StatusDetail + \"_\" + VmDirectPathGen2Active + \"_\" + VmDirectPathGen2InactiveReasonNetwork + \"_\" + VmDirectPathGen2InactiveReasonOther + \"_\" + VmDirectPathGen2InactiveReasonExtended).GetHashCode();\n        }\n    }\n\n    public class DvsAcceptNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsAcceptNetworkRuleAction>\n    {\n        public bool Equals(DvsAcceptNetworkRuleAction dvsAcceptNetworkRuleAction)\n        {\n            return (dvsAcceptNetworkRuleAction != null && base.Equals(dvsAcceptNetworkRuleAction));\n        }\n\n        public override bool Equals(object dvsAcceptNetworkRuleAction)\n        {\n            return Equals(dvsAcceptNetworkRuleAction as DvsAcceptNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsApplyOperationFault : DvsFault, IEquatable<DvsApplyOperationFault>\n    {\n        public DvsApplyOperationFaultFaultOnObject[] ObjectFault { get; set; }\n\n        public bool Equals(DvsApplyOperationFault dvsApplyOperationFault)\n        {\n            return (dvsApplyOperationFault != null && ((this.ObjectFault == null && dvsApplyOperationFault.ObjectFault == null) || (this.ObjectFault != null && dvsApplyOperationFault.ObjectFault != null && Enumerable.SequenceEqual(this.ObjectFault, dvsApplyOperationFault.ObjectFault))));\n        }\n\n        public override bool Equals(object dvsApplyOperationFault)\n        {\n            return Equals(dvsApplyOperationFault as DvsApplyOperationFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ObjectFault).GetHashCode();\n        }\n    }\n\n    public class DvsApplyOperationFaultFaultOnObject : DynamicData, IEquatable<DvsApplyOperationFaultFaultOnObject>\n    {\n        public string ObjectId { get; set; }\n\n        public string Type { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(DvsApplyOperationFaultFaultOnObject dvsApplyOperationFaultFaultOnObject)\n        {\n            return (dvsApplyOperationFaultFaultOnObject != null && this.ObjectId == dvsApplyOperationFaultFaultOnObject.ObjectId && this.Type == dvsApplyOperationFaultFaultOnObject.Type && ((this.Fault == null && dvsApplyOperationFaultFaultOnObject.Fault == null) || (this.Fault != null && this.Fault.Equals(dvsApplyOperationFaultFaultOnObject.Fault))));\n        }\n\n        public override bool Equals(object dvsApplyOperationFaultFaultOnObject)\n        {\n            return Equals(dvsApplyOperationFaultFaultOnObject as DvsApplyOperationFaultFaultOnObject);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ObjectId + \"_\" + Type + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class DVSBackupRestoreCapability : DynamicData, IEquatable<DVSBackupRestoreCapability>\n    {\n        public bool BackupRestoreSupported { get; set; }\n\n        public bool Equals(DVSBackupRestoreCapability dVSBackupRestoreCapability)\n        {\n            return (dVSBackupRestoreCapability != null && this.BackupRestoreSupported == dVSBackupRestoreCapability.BackupRestoreSupported);\n        }\n\n        public override bool Equals(object dVSBackupRestoreCapability)\n        {\n            return Equals(dVSBackupRestoreCapability as DVSBackupRestoreCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BackupRestoreSupported).GetHashCode();\n        }\n    }\n\n    public class DVSCapability : DynamicData, IEquatable<DVSCapability>\n    {\n        public bool? DvsOperationSupported { get; set; }\n\n        public bool? DvPortGroupOperationSupported { get; set; }\n\n        public bool? DvPortOperationSupported { get; set; }\n\n        public DistributedVirtualSwitchHostProductSpec[] CompatibleHostComponentProductInfo { get; set; }\n\n        public DVSFeatureCapability FeaturesSupported { get; set; }\n\n        public bool Equals(DVSCapability dVSCapability)\n        {\n            return (dVSCapability != null && ((this.DvsOperationSupported == null && dVSCapability.DvsOperationSupported == null) || (this.DvsOperationSupported != null && this.DvsOperationSupported.Equals(dVSCapability.DvsOperationSupported))) && ((this.DvPortGroupOperationSupported == null && dVSCapability.DvPortGroupOperationSupported == null) || (this.DvPortGroupOperationSupported != null && this.DvPortGroupOperationSupported.Equals(dVSCapability.DvPortGroupOperationSupported))) && ((this.DvPortOperationSupported == null && dVSCapability.DvPortOperationSupported == null) || (this.DvPortOperationSupported != null && this.DvPortOperationSupported.Equals(dVSCapability.DvPortOperationSupported))) && ((this.CompatibleHostComponentProductInfo == null && dVSCapability.CompatibleHostComponentProductInfo == null) || (this.CompatibleHostComponentProductInfo != null && dVSCapability.CompatibleHostComponentProductInfo != null && Enumerable.SequenceEqual(this.CompatibleHostComponentProductInfo, dVSCapability.CompatibleHostComponentProductInfo))) && ((this.FeaturesSupported == null && dVSCapability.FeaturesSupported == null) || (this.FeaturesSupported != null && this.FeaturesSupported.Equals(dVSCapability.FeaturesSupported))));\n        }\n\n        public override bool Equals(object dVSCapability)\n        {\n            return Equals(dVSCapability as DVSCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsOperationSupported + \"_\" + DvPortGroupOperationSupported + \"_\" + DvPortOperationSupported + \"_\" + CompatibleHostComponentProductInfo + \"_\" + FeaturesSupported).GetHashCode();\n        }\n    }\n\n    public class DVSConfigInfo : DynamicData, IEquatable<DVSConfigInfo>\n    {\n        public string Uuid { get; set; }\n\n        public string Name { get; set; }\n\n        public int NumStandalonePorts { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public int MaxPorts { get; set; }\n\n        public DVSUplinkPortPolicy UplinkPortPolicy { get; set; }\n\n        public ManagedObjectReference[] UplinkPortgroup { get; set; }\n\n        public DVPortSetting DefaultPortConfig { get; set; }\n\n        public DistributedVirtualSwitchHostMember[] Host { get; set; }\n\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public DistributedVirtualSwitchProductSpec TargetInfo { get; set; }\n\n        public string ExtensionKey { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificConfig { get; set; }\n\n        public DVSPolicy Policy { get; set; }\n\n        public string Description { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DVSContactInfo Contact { get; set; }\n\n        public string SwitchIpAddress { get; set; }\n\n        public DateTime CreateTime { get; set; }\n\n        public bool NetworkResourceManagementEnabled { get; set; }\n\n        public int? DefaultProxySwitchMaxNumPorts { get; set; }\n\n        public DVSHealthCheckConfig[] HealthCheckConfig { get; set; }\n\n        public DvsHostInfrastructureTrafficResource[] InfrastructureTrafficResourceConfig { get; set; }\n\n        public DvsHostInfrastructureTrafficResource[] NetResourcePoolTrafficResourceConfig { get; set; }\n\n        public string NetworkResourceControlVersion { get; set; }\n\n        public DVSVmVnicNetworkResourcePool[] VmVnicNetworkResourcePool { get; set; }\n\n        public int? PnicCapacityRatioForReservation { get; set; }\n\n        public DVSConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVSConfigInfo dVSConfigInfo)\n        {\n            return (dVSConfigInfo != null && this.Uuid == dVSConfigInfo.Uuid && this.Name == dVSConfigInfo.Name && this.NumStandalonePorts == dVSConfigInfo.NumStandalonePorts && this.NumPorts == dVSConfigInfo.NumPorts && this.MaxPorts == dVSConfigInfo.MaxPorts && ((this.UplinkPortPolicy == null && dVSConfigInfo.UplinkPortPolicy == null) || (this.UplinkPortPolicy != null && this.UplinkPortPolicy.Equals(dVSConfigInfo.UplinkPortPolicy))) && ((this.UplinkPortgroup == null && dVSConfigInfo.UplinkPortgroup == null) || (this.UplinkPortgroup != null && dVSConfigInfo.UplinkPortgroup != null && Enumerable.SequenceEqual(this.UplinkPortgroup, dVSConfigInfo.UplinkPortgroup))) && ((this.DefaultPortConfig == null && dVSConfigInfo.DefaultPortConfig == null) || (this.DefaultPortConfig != null && this.DefaultPortConfig.Equals(dVSConfigInfo.DefaultPortConfig))) && ((this.Host == null && dVSConfigInfo.Host == null) || (this.Host != null && dVSConfigInfo.Host != null && Enumerable.SequenceEqual(this.Host, dVSConfigInfo.Host))) && ((this.ProductInfo == null && dVSConfigInfo.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dVSConfigInfo.ProductInfo))) && ((this.TargetInfo == null && dVSConfigInfo.TargetInfo == null) || (this.TargetInfo != null && this.TargetInfo.Equals(dVSConfigInfo.TargetInfo))) && this.ExtensionKey == dVSConfigInfo.ExtensionKey && ((this.VendorSpecificConfig == null && dVSConfigInfo.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && dVSConfigInfo.VendorSpecificConfig != null && Enumerable.SequenceEqual(this.VendorSpecificConfig, dVSConfigInfo.VendorSpecificConfig))) && ((this.Policy == null && dVSConfigInfo.Policy == null) || (this.Policy != null && this.Policy.Equals(dVSConfigInfo.Policy))) && this.Description == dVSConfigInfo.Description && this.ConfigVersion == dVSConfigInfo.ConfigVersion && ((this.Contact == null && dVSConfigInfo.Contact == null) || (this.Contact != null && this.Contact.Equals(dVSConfigInfo.Contact))) && this.SwitchIpAddress == dVSConfigInfo.SwitchIpAddress && this.CreateTime == dVSConfigInfo.CreateTime && this.NetworkResourceManagementEnabled == dVSConfigInfo.NetworkResourceManagementEnabled && ((this.DefaultProxySwitchMaxNumPorts == null && dVSConfigInfo.DefaultProxySwitchMaxNumPorts == null) || (this.DefaultProxySwitchMaxNumPorts != null && this.DefaultProxySwitchMaxNumPorts.Equals(dVSConfigInfo.DefaultProxySwitchMaxNumPorts))) && ((this.HealthCheckConfig == null && dVSConfigInfo.HealthCheckConfig == null) || (this.HealthCheckConfig != null && dVSConfigInfo.HealthCheckConfig != null && Enumerable.SequenceEqual(this.HealthCheckConfig, dVSConfigInfo.HealthCheckConfig))) && ((this.InfrastructureTrafficResourceConfig == null && dVSConfigInfo.InfrastructureTrafficResourceConfig == null) || (this.InfrastructureTrafficResourceConfig != null && dVSConfigInfo.InfrastructureTrafficResourceConfig != null && Enumerable.SequenceEqual(this.InfrastructureTrafficResourceConfig, dVSConfigInfo.InfrastructureTrafficResourceConfig))) && ((this.NetResourcePoolTrafficResourceConfig == null && dVSConfigInfo.NetResourcePoolTrafficResourceConfig == null) || (this.NetResourcePoolTrafficResourceConfig != null && dVSConfigInfo.NetResourcePoolTrafficResourceConfig != null && Enumerable.SequenceEqual(this.NetResourcePoolTrafficResourceConfig, dVSConfigInfo.NetResourcePoolTrafficResourceConfig))) && this.NetworkResourceControlVersion == dVSConfigInfo.NetworkResourceControlVersion && ((this.VmVnicNetworkResourcePool == null && dVSConfigInfo.VmVnicNetworkResourcePool == null) || (this.VmVnicNetworkResourcePool != null && dVSConfigInfo.VmVnicNetworkResourcePool != null && Enumerable.SequenceEqual(this.VmVnicNetworkResourcePool, dVSConfigInfo.VmVnicNetworkResourcePool))) && ((this.PnicCapacityRatioForReservation == null && dVSConfigInfo.PnicCapacityRatioForReservation == null) || (this.PnicCapacityRatioForReservation != null && this.PnicCapacityRatioForReservation.Equals(dVSConfigInfo.PnicCapacityRatioForReservation))) && ((this.LinkedView == null && dVSConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVSConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object dVSConfigInfo)\n        {\n            return Equals(dVSConfigInfo as DVSConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + Name + \"_\" + NumStandalonePorts + \"_\" + NumPorts + \"_\" + MaxPorts + \"_\" + UplinkPortPolicy + \"_\" + UplinkPortgroup + \"_\" + DefaultPortConfig + \"_\" + Host + \"_\" + ProductInfo + \"_\" + TargetInfo + \"_\" + ExtensionKey + \"_\" + VendorSpecificConfig + \"_\" + Policy + \"_\" + Description + \"_\" + ConfigVersion + \"_\" + Contact + \"_\" + SwitchIpAddress + \"_\" + CreateTime + \"_\" + NetworkResourceManagementEnabled + \"_\" + DefaultProxySwitchMaxNumPorts + \"_\" + HealthCheckConfig + \"_\" + InfrastructureTrafficResourceConfig + \"_\" + NetResourcePoolTrafficResourceConfig + \"_\" + NetworkResourceControlVersion + \"_\" + VmVnicNetworkResourcePool + \"_\" + PnicCapacityRatioForReservation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVSConfigInfo_LinkedView : IEquatable<DVSConfigInfo_LinkedView>\n    {\n        public DistributedVirtualPortgroup[] UplinkPortgroup { get; set; }\n\n        public bool Equals(DVSConfigInfo_LinkedView dVSConfigInfo_LinkedView)\n        {\n            return (dVSConfigInfo_LinkedView != null && ((this.UplinkPortgroup == null && dVSConfigInfo_LinkedView.UplinkPortgroup == null) || (this.UplinkPortgroup != null && dVSConfigInfo_LinkedView.UplinkPortgroup != null && Enumerable.SequenceEqual(this.UplinkPortgroup, dVSConfigInfo_LinkedView.UplinkPortgroup))));\n        }\n\n        public override bool Equals(object dVSConfigInfo_LinkedView)\n        {\n            return Equals(dVSConfigInfo_LinkedView as DVSConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UplinkPortgroup).GetHashCode();\n        }\n    }\n\n    public class DVSConfigSpec : DynamicData, IEquatable<DVSConfigSpec>\n    {\n        public string ConfigVersion { get; set; }\n\n        public string Name { get; set; }\n\n        public int? NumStandalonePorts { get; set; }\n\n        public int? MaxPorts { get; set; }\n\n        public DVSUplinkPortPolicy UplinkPortPolicy { get; set; }\n\n        public ManagedObjectReference[] UplinkPortgroup { get; set; }\n\n        public DVPortSetting DefaultPortConfig { get; set; }\n\n        public DistributedVirtualSwitchHostMemberConfigSpec[] Host { get; set; }\n\n        public string ExtensionKey { get; set; }\n\n        public string Description { get; set; }\n\n        public DVSPolicy Policy { get; set; }\n\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] VendorSpecificConfig { get; set; }\n\n        public DVSContactInfo Contact { get; set; }\n\n        public string SwitchIpAddress { get; set; }\n\n        public int? DefaultProxySwitchMaxNumPorts { get; set; }\n\n        public DvsHostInfrastructureTrafficResource[] InfrastructureTrafficResourceConfig { get; set; }\n\n        public DvsHostInfrastructureTrafficResource[] NetResourcePoolTrafficResourceConfig { get; set; }\n\n        public string NetworkResourceControlVersion { get; set; }\n\n        public DVSConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVSConfigSpec dVSConfigSpec)\n        {\n            return (dVSConfigSpec != null && this.ConfigVersion == dVSConfigSpec.ConfigVersion && this.Name == dVSConfigSpec.Name && ((this.NumStandalonePorts == null && dVSConfigSpec.NumStandalonePorts == null) || (this.NumStandalonePorts != null && this.NumStandalonePorts.Equals(dVSConfigSpec.NumStandalonePorts))) && ((this.MaxPorts == null && dVSConfigSpec.MaxPorts == null) || (this.MaxPorts != null && this.MaxPorts.Equals(dVSConfigSpec.MaxPorts))) && ((this.UplinkPortPolicy == null && dVSConfigSpec.UplinkPortPolicy == null) || (this.UplinkPortPolicy != null && this.UplinkPortPolicy.Equals(dVSConfigSpec.UplinkPortPolicy))) && ((this.UplinkPortgroup == null && dVSConfigSpec.UplinkPortgroup == null) || (this.UplinkPortgroup != null && dVSConfigSpec.UplinkPortgroup != null && Enumerable.SequenceEqual(this.UplinkPortgroup, dVSConfigSpec.UplinkPortgroup))) && ((this.DefaultPortConfig == null && dVSConfigSpec.DefaultPortConfig == null) || (this.DefaultPortConfig != null && this.DefaultPortConfig.Equals(dVSConfigSpec.DefaultPortConfig))) && ((this.Host == null && dVSConfigSpec.Host == null) || (this.Host != null && dVSConfigSpec.Host != null && Enumerable.SequenceEqual(this.Host, dVSConfigSpec.Host))) && this.ExtensionKey == dVSConfigSpec.ExtensionKey && this.Description == dVSConfigSpec.Description && ((this.Policy == null && dVSConfigSpec.Policy == null) || (this.Policy != null && this.Policy.Equals(dVSConfigSpec.Policy))) && ((this.VendorSpecificConfig == null && dVSConfigSpec.VendorSpecificConfig == null) || (this.VendorSpecificConfig != null && dVSConfigSpec.VendorSpecificConfig != null && Enumerable.SequenceEqual(this.VendorSpecificConfig, dVSConfigSpec.VendorSpecificConfig))) && ((this.Contact == null && dVSConfigSpec.Contact == null) || (this.Contact != null && this.Contact.Equals(dVSConfigSpec.Contact))) && this.SwitchIpAddress == dVSConfigSpec.SwitchIpAddress && ((this.DefaultProxySwitchMaxNumPorts == null && dVSConfigSpec.DefaultProxySwitchMaxNumPorts == null) || (this.DefaultProxySwitchMaxNumPorts != null && this.DefaultProxySwitchMaxNumPorts.Equals(dVSConfigSpec.DefaultProxySwitchMaxNumPorts))) && ((this.InfrastructureTrafficResourceConfig == null && dVSConfigSpec.InfrastructureTrafficResourceConfig == null) || (this.InfrastructureTrafficResourceConfig != null && dVSConfigSpec.InfrastructureTrafficResourceConfig != null && Enumerable.SequenceEqual(this.InfrastructureTrafficResourceConfig, dVSConfigSpec.InfrastructureTrafficResourceConfig))) && ((this.NetResourcePoolTrafficResourceConfig == null && dVSConfigSpec.NetResourcePoolTrafficResourceConfig == null) || (this.NetResourcePoolTrafficResourceConfig != null && dVSConfigSpec.NetResourcePoolTrafficResourceConfig != null && Enumerable.SequenceEqual(this.NetResourcePoolTrafficResourceConfig, dVSConfigSpec.NetResourcePoolTrafficResourceConfig))) && this.NetworkResourceControlVersion == dVSConfigSpec.NetworkResourceControlVersion && ((this.LinkedView == null && dVSConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVSConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object dVSConfigSpec)\n        {\n            return Equals(dVSConfigSpec as DVSConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigVersion + \"_\" + Name + \"_\" + NumStandalonePorts + \"_\" + MaxPorts + \"_\" + UplinkPortPolicy + \"_\" + UplinkPortgroup + \"_\" + DefaultPortConfig + \"_\" + Host + \"_\" + ExtensionKey + \"_\" + Description + \"_\" + Policy + \"_\" + VendorSpecificConfig + \"_\" + Contact + \"_\" + SwitchIpAddress + \"_\" + DefaultProxySwitchMaxNumPorts + \"_\" + InfrastructureTrafficResourceConfig + \"_\" + NetResourcePoolTrafficResourceConfig + \"_\" + NetworkResourceControlVersion + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVSConfigSpec_LinkedView : IEquatable<DVSConfigSpec_LinkedView>\n    {\n        public DistributedVirtualPortgroup[] UplinkPortgroup { get; set; }\n\n        public bool Equals(DVSConfigSpec_LinkedView dVSConfigSpec_LinkedView)\n        {\n            return (dVSConfigSpec_LinkedView != null && ((this.UplinkPortgroup == null && dVSConfigSpec_LinkedView.UplinkPortgroup == null) || (this.UplinkPortgroup != null && dVSConfigSpec_LinkedView.UplinkPortgroup != null && Enumerable.SequenceEqual(this.UplinkPortgroup, dVSConfigSpec_LinkedView.UplinkPortgroup))));\n        }\n\n        public override bool Equals(object dVSConfigSpec_LinkedView)\n        {\n            return Equals(dVSConfigSpec_LinkedView as DVSConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UplinkPortgroup).GetHashCode();\n        }\n    }\n\n    public class DVSContactInfo : DynamicData, IEquatable<DVSContactInfo>\n    {\n        public string Name { get; set; }\n\n        public string Contact { get; set; }\n\n        public bool Equals(DVSContactInfo dVSContactInfo)\n        {\n            return (dVSContactInfo != null && this.Name == dVSContactInfo.Name && this.Contact == dVSContactInfo.Contact);\n        }\n\n        public override bool Equals(object dVSContactInfo)\n        {\n            return Equals(dVSContactInfo as DVSContactInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Contact).GetHashCode();\n        }\n    }\n\n    public class DvsCopyNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsCopyNetworkRuleAction>\n    {\n        public bool Equals(DvsCopyNetworkRuleAction dvsCopyNetworkRuleAction)\n        {\n            return (dvsCopyNetworkRuleAction != null && base.Equals(dvsCopyNetworkRuleAction));\n        }\n\n        public override bool Equals(object dvsCopyNetworkRuleAction)\n        {\n            return Equals(dvsCopyNetworkRuleAction as DvsCopyNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsCreatedEvent : DvsEvent, IEquatable<DvsCreatedEvent>\n    {\n        public FolderEventArgument Parent { get; set; }\n\n        public bool Equals(DvsCreatedEvent dvsCreatedEvent)\n        {\n            return (dvsCreatedEvent != null && ((this.Parent == null && dvsCreatedEvent.Parent == null) || (this.Parent != null && this.Parent.Equals(dvsCreatedEvent.Parent))));\n        }\n\n        public override bool Equals(object dvsCreatedEvent)\n        {\n            return Equals(dvsCreatedEvent as DvsCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent).GetHashCode();\n        }\n    }\n\n    public class DVSCreateSpec : DynamicData, IEquatable<DVSCreateSpec>\n    {\n        public DVSConfigSpec ConfigSpec { get; set; }\n\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public DVSCapability Capability { get; set; }\n\n        public bool Equals(DVSCreateSpec dVSCreateSpec)\n        {\n            return (dVSCreateSpec != null && ((this.ConfigSpec == null && dVSCreateSpec.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(dVSCreateSpec.ConfigSpec))) && ((this.ProductInfo == null && dVSCreateSpec.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dVSCreateSpec.ProductInfo))) && ((this.Capability == null && dVSCreateSpec.Capability == null) || (this.Capability != null && this.Capability.Equals(dVSCreateSpec.Capability))));\n        }\n\n        public override bool Equals(object dVSCreateSpec)\n        {\n            return Equals(dVSCreateSpec as DVSCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec + \"_\" + ProductInfo + \"_\" + Capability).GetHashCode();\n        }\n    }\n\n    public class DvsDestroyedEvent : DvsEvent, IEquatable<DvsDestroyedEvent>\n    {\n        public bool Equals(DvsDestroyedEvent dvsDestroyedEvent)\n        {\n            return (dvsDestroyedEvent != null && base.Equals(dvsDestroyedEvent));\n        }\n\n        public override bool Equals(object dvsDestroyedEvent)\n        {\n            return Equals(dvsDestroyedEvent as DvsDestroyedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsDropNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsDropNetworkRuleAction>\n    {\n        public bool Equals(DvsDropNetworkRuleAction dvsDropNetworkRuleAction)\n        {\n            return (dvsDropNetworkRuleAction != null && base.Equals(dvsDropNetworkRuleAction));\n        }\n\n        public override bool Equals(object dvsDropNetworkRuleAction)\n        {\n            return Equals(dvsDropNetworkRuleAction as DvsDropNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsEvent : Event, IEquatable<DvsEvent>\n    {\n        public bool Equals(DvsEvent dvsEvent)\n        {\n            return (dvsEvent != null && base.Equals(dvsEvent));\n        }\n\n        public override bool Equals(object dvsEvent)\n        {\n            return Equals(dvsEvent as DvsEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsEventArgument : EntityEventArgument, IEquatable<DvsEventArgument>\n    {\n        public ManagedObjectReference Dvs { get; set; }\n\n        public DvsEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DvsEventArgument dvsEventArgument)\n        {\n            return (dvsEventArgument != null && ((this.Dvs == null && dvsEventArgument.Dvs == null) || (this.Dvs != null && this.Dvs.Equals(dvsEventArgument.Dvs))) && ((this.LinkedView == null && dvsEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dvsEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object dvsEventArgument)\n        {\n            return Equals(dvsEventArgument as DvsEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Dvs + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DvsEventArgument_LinkedView : IEquatable<DvsEventArgument_LinkedView>\n    {\n        public DistributedVirtualSwitch Dvs { get; set; }\n\n        public bool Equals(DvsEventArgument_LinkedView dvsEventArgument_LinkedView)\n        {\n            return (dvsEventArgument_LinkedView != null && ((this.Dvs == null && dvsEventArgument_LinkedView.Dvs == null) || (this.Dvs != null && this.Dvs.Equals(dvsEventArgument_LinkedView.Dvs))));\n        }\n\n        public override bool Equals(object dvsEventArgument_LinkedView)\n        {\n            return Equals(dvsEventArgument_LinkedView as DvsEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Dvs).GetHashCode();\n        }\n    }\n\n    public class DVSFailureCriteria : InheritablePolicy, IEquatable<DVSFailureCriteria>\n    {\n        public StringPolicy CheckSpeed { get; set; }\n\n        public IntPolicy Speed { get; set; }\n\n        public BoolPolicy CheckDuplex { get; set; }\n\n        public BoolPolicy FullDuplex { get; set; }\n\n        public BoolPolicy CheckErrorPercent { get; set; }\n\n        public IntPolicy Percentage { get; set; }\n\n        public BoolPolicy CheckBeacon { get; set; }\n\n        public bool Equals(DVSFailureCriteria dVSFailureCriteria)\n        {\n            return (dVSFailureCriteria != null && ((this.CheckSpeed == null && dVSFailureCriteria.CheckSpeed == null) || (this.CheckSpeed != null && this.CheckSpeed.Equals(dVSFailureCriteria.CheckSpeed))) && ((this.Speed == null && dVSFailureCriteria.Speed == null) || (this.Speed != null && this.Speed.Equals(dVSFailureCriteria.Speed))) && ((this.CheckDuplex == null && dVSFailureCriteria.CheckDuplex == null) || (this.CheckDuplex != null && this.CheckDuplex.Equals(dVSFailureCriteria.CheckDuplex))) && ((this.FullDuplex == null && dVSFailureCriteria.FullDuplex == null) || (this.FullDuplex != null && this.FullDuplex.Equals(dVSFailureCriteria.FullDuplex))) && ((this.CheckErrorPercent == null && dVSFailureCriteria.CheckErrorPercent == null) || (this.CheckErrorPercent != null && this.CheckErrorPercent.Equals(dVSFailureCriteria.CheckErrorPercent))) && ((this.Percentage == null && dVSFailureCriteria.Percentage == null) || (this.Percentage != null && this.Percentage.Equals(dVSFailureCriteria.Percentage))) && ((this.CheckBeacon == null && dVSFailureCriteria.CheckBeacon == null) || (this.CheckBeacon != null && this.CheckBeacon.Equals(dVSFailureCriteria.CheckBeacon))));\n        }\n\n        public override bool Equals(object dVSFailureCriteria)\n        {\n            return Equals(dVSFailureCriteria as DVSFailureCriteria);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CheckSpeed + \"_\" + Speed + \"_\" + CheckDuplex + \"_\" + FullDuplex + \"_\" + CheckErrorPercent + \"_\" + Percentage + \"_\" + CheckBeacon).GetHashCode();\n        }\n    }\n\n    public class DvsFault : VimFault, IEquatable<DvsFault>\n    {\n        public bool Equals(DvsFault dvsFault)\n        {\n            return (dvsFault != null && base.Equals(dvsFault));\n        }\n\n        public override bool Equals(object dvsFault)\n        {\n            return Equals(dvsFault as DvsFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVSFeatureCapability : DynamicData, IEquatable<DVSFeatureCapability>\n    {\n        public bool NetworkResourceManagementSupported { get; set; }\n\n        public bool VmDirectPathGen2Supported { get; set; }\n\n        public string[] NicTeamingPolicy { get; set; }\n\n        public int? NetworkResourcePoolHighShareValue { get; set; }\n\n        public DVSNetworkResourceManagementCapability NetworkResourceManagementCapability { get; set; }\n\n        public DVSHealthCheckCapability HealthCheckCapability { get; set; }\n\n        public DVSRollbackCapability RollbackCapability { get; set; }\n\n        public DVSBackupRestoreCapability BackupRestoreCapability { get; set; }\n\n        public bool? NetworkFilterSupported { get; set; }\n\n        public bool? MacLearningSupported { get; set; }\n\n        public bool Equals(DVSFeatureCapability dVSFeatureCapability)\n        {\n            return (dVSFeatureCapability != null && this.NetworkResourceManagementSupported == dVSFeatureCapability.NetworkResourceManagementSupported && this.VmDirectPathGen2Supported == dVSFeatureCapability.VmDirectPathGen2Supported && ((this.NicTeamingPolicy == null && dVSFeatureCapability.NicTeamingPolicy == null) || (this.NicTeamingPolicy != null && dVSFeatureCapability.NicTeamingPolicy != null && Enumerable.SequenceEqual(this.NicTeamingPolicy, dVSFeatureCapability.NicTeamingPolicy))) && ((this.NetworkResourcePoolHighShareValue == null && dVSFeatureCapability.NetworkResourcePoolHighShareValue == null) || (this.NetworkResourcePoolHighShareValue != null && this.NetworkResourcePoolHighShareValue.Equals(dVSFeatureCapability.NetworkResourcePoolHighShareValue))) && ((this.NetworkResourceManagementCapability == null && dVSFeatureCapability.NetworkResourceManagementCapability == null) || (this.NetworkResourceManagementCapability != null && this.NetworkResourceManagementCapability.Equals(dVSFeatureCapability.NetworkResourceManagementCapability))) && ((this.HealthCheckCapability == null && dVSFeatureCapability.HealthCheckCapability == null) || (this.HealthCheckCapability != null && this.HealthCheckCapability.Equals(dVSFeatureCapability.HealthCheckCapability))) && ((this.RollbackCapability == null && dVSFeatureCapability.RollbackCapability == null) || (this.RollbackCapability != null && this.RollbackCapability.Equals(dVSFeatureCapability.RollbackCapability))) && ((this.BackupRestoreCapability == null && dVSFeatureCapability.BackupRestoreCapability == null) || (this.BackupRestoreCapability != null && this.BackupRestoreCapability.Equals(dVSFeatureCapability.BackupRestoreCapability))) && ((this.NetworkFilterSupported == null && dVSFeatureCapability.NetworkFilterSupported == null) || (this.NetworkFilterSupported != null && this.NetworkFilterSupported.Equals(dVSFeatureCapability.NetworkFilterSupported))) && ((this.MacLearningSupported == null && dVSFeatureCapability.MacLearningSupported == null) || (this.MacLearningSupported != null && this.MacLearningSupported.Equals(dVSFeatureCapability.MacLearningSupported))));\n        }\n\n        public override bool Equals(object dVSFeatureCapability)\n        {\n            return Equals(dVSFeatureCapability as DVSFeatureCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetworkResourceManagementSupported + \"_\" + VmDirectPathGen2Supported + \"_\" + NicTeamingPolicy + \"_\" + NetworkResourcePoolHighShareValue + \"_\" + NetworkResourceManagementCapability + \"_\" + HealthCheckCapability + \"_\" + RollbackCapability + \"_\" + BackupRestoreCapability + \"_\" + NetworkFilterSupported + \"_\" + MacLearningSupported).GetHashCode();\n        }\n    }\n\n    public class DvsFilterConfig : InheritablePolicy, IEquatable<DvsFilterConfig>\n    {\n        public string Key { get; set; }\n\n        public string AgentName { get; set; }\n\n        public string SlotNumber { get; set; }\n\n        public DvsFilterParameter Parameters { get; set; }\n\n        public string OnFailure { get; set; }\n\n        public bool Equals(DvsFilterConfig dvsFilterConfig)\n        {\n            return (dvsFilterConfig != null && this.Key == dvsFilterConfig.Key && this.AgentName == dvsFilterConfig.AgentName && this.SlotNumber == dvsFilterConfig.SlotNumber && ((this.Parameters == null && dvsFilterConfig.Parameters == null) || (this.Parameters != null && this.Parameters.Equals(dvsFilterConfig.Parameters))) && this.OnFailure == dvsFilterConfig.OnFailure);\n        }\n\n        public override bool Equals(object dvsFilterConfig)\n        {\n            return Equals(dvsFilterConfig as DvsFilterConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + AgentName + \"_\" + SlotNumber + \"_\" + Parameters + \"_\" + OnFailure).GetHashCode();\n        }\n    }\n\n    public class DvsFilterConfigSpec : DvsFilterConfig, IEquatable<DvsFilterConfigSpec>\n    {\n        public string Operation { get; set; }\n\n        public bool Equals(DvsFilterConfigSpec dvsFilterConfigSpec)\n        {\n            return (dvsFilterConfigSpec != null && this.Operation == dvsFilterConfigSpec.Operation);\n        }\n\n        public override bool Equals(object dvsFilterConfigSpec)\n        {\n            return Equals(dvsFilterConfigSpec as DvsFilterConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation).GetHashCode();\n        }\n    }\n\n    public class DvsFilterParameter : DynamicData, IEquatable<DvsFilterParameter>\n    {\n        public string[] Parameters { get; set; }\n\n        public bool Equals(DvsFilterParameter dvsFilterParameter)\n        {\n            return (dvsFilterParameter != null && ((this.Parameters == null && dvsFilterParameter.Parameters == null) || (this.Parameters != null && dvsFilterParameter.Parameters != null && Enumerable.SequenceEqual(this.Parameters, dvsFilterParameter.Parameters))));\n        }\n\n        public override bool Equals(object dvsFilterParameter)\n        {\n            return Equals(dvsFilterParameter as DvsFilterParameter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parameters).GetHashCode();\n        }\n    }\n\n    public class DvsFilterPolicy : InheritablePolicy, IEquatable<DvsFilterPolicy>\n    {\n        public DvsFilterConfig[] FilterConfig { get; set; }\n\n        public bool Equals(DvsFilterPolicy dvsFilterPolicy)\n        {\n            return (dvsFilterPolicy != null && ((this.FilterConfig == null && dvsFilterPolicy.FilterConfig == null) || (this.FilterConfig != null && dvsFilterPolicy.FilterConfig != null && Enumerable.SequenceEqual(this.FilterConfig, dvsFilterPolicy.FilterConfig))));\n        }\n\n        public override bool Equals(object dvsFilterPolicy)\n        {\n            return Equals(dvsFilterPolicy as DvsFilterPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FilterConfig).GetHashCode();\n        }\n    }\n\n    public class DvsGreEncapNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsGreEncapNetworkRuleAction>\n    {\n        public SingleIp EncapsulationIp { get; set; }\n\n        public bool Equals(DvsGreEncapNetworkRuleAction dvsGreEncapNetworkRuleAction)\n        {\n            return (dvsGreEncapNetworkRuleAction != null && ((this.EncapsulationIp == null && dvsGreEncapNetworkRuleAction.EncapsulationIp == null) || (this.EncapsulationIp != null && this.EncapsulationIp.Equals(dvsGreEncapNetworkRuleAction.EncapsulationIp))));\n        }\n\n        public override bool Equals(object dvsGreEncapNetworkRuleAction)\n        {\n            return Equals(dvsGreEncapNetworkRuleAction as DvsGreEncapNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EncapsulationIp).GetHashCode();\n        }\n    }\n\n    public class DVSHealthCheckCapability : DynamicData, IEquatable<DVSHealthCheckCapability>\n    {\n        public bool Equals(DVSHealthCheckCapability dVSHealthCheckCapability)\n        {\n            return (dVSHealthCheckCapability != null && base.Equals(dVSHealthCheckCapability));\n        }\n\n        public override bool Equals(object dVSHealthCheckCapability)\n        {\n            return Equals(dVSHealthCheckCapability as DVSHealthCheckCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVSHealthCheckConfig : DynamicData, IEquatable<DVSHealthCheckConfig>\n    {\n        public bool? Enable { get; set; }\n\n        public int? Interval { get; set; }\n\n        public bool Equals(DVSHealthCheckConfig dVSHealthCheckConfig)\n        {\n            return (dVSHealthCheckConfig != null && ((this.Enable == null && dVSHealthCheckConfig.Enable == null) || (this.Enable != null && this.Enable.Equals(dVSHealthCheckConfig.Enable))) && ((this.Interval == null && dVSHealthCheckConfig.Interval == null) || (this.Interval != null && this.Interval.Equals(dVSHealthCheckConfig.Interval))));\n        }\n\n        public override bool Equals(object dVSHealthCheckConfig)\n        {\n            return Equals(dVSHealthCheckConfig as DVSHealthCheckConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enable + \"_\" + Interval).GetHashCode();\n        }\n    }\n\n    public class DvsHealthStatusChangeEvent : HostEvent, IEquatable<DvsHealthStatusChangeEvent>\n    {\n        public string SwitchUuid { get; set; }\n\n        public HostMemberHealthCheckResult HealthResult { get; set; }\n\n        public bool Equals(DvsHealthStatusChangeEvent dvsHealthStatusChangeEvent)\n        {\n            return (dvsHealthStatusChangeEvent != null && this.SwitchUuid == dvsHealthStatusChangeEvent.SwitchUuid && ((this.HealthResult == null && dvsHealthStatusChangeEvent.HealthResult == null) || (this.HealthResult != null && this.HealthResult.Equals(dvsHealthStatusChangeEvent.HealthResult))));\n        }\n\n        public override bool Equals(object dvsHealthStatusChangeEvent)\n        {\n            return Equals(dvsHealthStatusChangeEvent as DvsHealthStatusChangeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchUuid + \"_\" + HealthResult).GetHashCode();\n        }\n    }\n\n    public class DvsHostBackInSyncEvent : DvsEvent, IEquatable<DvsHostBackInSyncEvent>\n    {\n        public HostEventArgument HostBackInSync { get; set; }\n\n        public bool Equals(DvsHostBackInSyncEvent dvsHostBackInSyncEvent)\n        {\n            return (dvsHostBackInSyncEvent != null && ((this.HostBackInSync == null && dvsHostBackInSyncEvent.HostBackInSync == null) || (this.HostBackInSync != null && this.HostBackInSync.Equals(dvsHostBackInSyncEvent.HostBackInSync))));\n        }\n\n        public override bool Equals(object dvsHostBackInSyncEvent)\n        {\n            return Equals(dvsHostBackInSyncEvent as DvsHostBackInSyncEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostBackInSync).GetHashCode();\n        }\n    }\n\n    public class DvsHostInfrastructureTrafficResource : DynamicData, IEquatable<DvsHostInfrastructureTrafficResource>\n    {\n        public string Key { get; set; }\n\n        public string Description { get; set; }\n\n        public DvsHostInfrastructureTrafficResourceAllocation AllocationInfo { get; set; }\n\n        public bool Equals(DvsHostInfrastructureTrafficResource dvsHostInfrastructureTrafficResource)\n        {\n            return (dvsHostInfrastructureTrafficResource != null && this.Key == dvsHostInfrastructureTrafficResource.Key && this.Description == dvsHostInfrastructureTrafficResource.Description && ((this.AllocationInfo == null && dvsHostInfrastructureTrafficResource.AllocationInfo == null) || (this.AllocationInfo != null && this.AllocationInfo.Equals(dvsHostInfrastructureTrafficResource.AllocationInfo))));\n        }\n\n        public override bool Equals(object dvsHostInfrastructureTrafficResource)\n        {\n            return Equals(dvsHostInfrastructureTrafficResource as DvsHostInfrastructureTrafficResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Description + \"_\" + AllocationInfo).GetHashCode();\n        }\n    }\n\n    public class DvsHostInfrastructureTrafficResourceAllocation : DynamicData, IEquatable<DvsHostInfrastructureTrafficResourceAllocation>\n    {\n        public long? Limit { get; set; }\n\n        public SharesInfo Shares { get; set; }\n\n        public long? Reservation { get; set; }\n\n        public bool Equals(DvsHostInfrastructureTrafficResourceAllocation dvsHostInfrastructureTrafficResourceAllocation)\n        {\n            return (dvsHostInfrastructureTrafficResourceAllocation != null && ((this.Limit == null && dvsHostInfrastructureTrafficResourceAllocation.Limit == null) || (this.Limit != null && this.Limit.Equals(dvsHostInfrastructureTrafficResourceAllocation.Limit))) && ((this.Shares == null && dvsHostInfrastructureTrafficResourceAllocation.Shares == null) || (this.Shares != null && this.Shares.Equals(dvsHostInfrastructureTrafficResourceAllocation.Shares))) && ((this.Reservation == null && dvsHostInfrastructureTrafficResourceAllocation.Reservation == null) || (this.Reservation != null && this.Reservation.Equals(dvsHostInfrastructureTrafficResourceAllocation.Reservation))));\n        }\n\n        public override bool Equals(object dvsHostInfrastructureTrafficResourceAllocation)\n        {\n            return Equals(dvsHostInfrastructureTrafficResourceAllocation as DvsHostInfrastructureTrafficResourceAllocation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Limit + \"_\" + Shares + \"_\" + Reservation).GetHashCode();\n        }\n    }\n\n    public class DvsHostJoinedEvent : DvsEvent, IEquatable<DvsHostJoinedEvent>\n    {\n        public HostEventArgument HostJoined { get; set; }\n\n        public bool Equals(DvsHostJoinedEvent dvsHostJoinedEvent)\n        {\n            return (dvsHostJoinedEvent != null && ((this.HostJoined == null && dvsHostJoinedEvent.HostJoined == null) || (this.HostJoined != null && this.HostJoined.Equals(dvsHostJoinedEvent.HostJoined))));\n        }\n\n        public override bool Equals(object dvsHostJoinedEvent)\n        {\n            return Equals(dvsHostJoinedEvent as DvsHostJoinedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostJoined).GetHashCode();\n        }\n    }\n\n    public class DvsHostLeftEvent : DvsEvent, IEquatable<DvsHostLeftEvent>\n    {\n        public HostEventArgument HostLeft { get; set; }\n\n        public bool Equals(DvsHostLeftEvent dvsHostLeftEvent)\n        {\n            return (dvsHostLeftEvent != null && ((this.HostLeft == null && dvsHostLeftEvent.HostLeft == null) || (this.HostLeft != null && this.HostLeft.Equals(dvsHostLeftEvent.HostLeft))));\n        }\n\n        public override bool Equals(object dvsHostLeftEvent)\n        {\n            return Equals(dvsHostLeftEvent as DvsHostLeftEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostLeft).GetHashCode();\n        }\n    }\n\n    public class DVSHostLocalPortInfo : DynamicData, IEquatable<DVSHostLocalPortInfo>\n    {\n        public string SwitchUuid { get; set; }\n\n        public string PortKey { get; set; }\n\n        public DVPortSetting Setting { get; set; }\n\n        public string Vnic { get; set; }\n\n        public bool Equals(DVSHostLocalPortInfo dVSHostLocalPortInfo)\n        {\n            return (dVSHostLocalPortInfo != null && this.SwitchUuid == dVSHostLocalPortInfo.SwitchUuid && this.PortKey == dVSHostLocalPortInfo.PortKey && ((this.Setting == null && dVSHostLocalPortInfo.Setting == null) || (this.Setting != null && this.Setting.Equals(dVSHostLocalPortInfo.Setting))) && this.Vnic == dVSHostLocalPortInfo.Vnic);\n        }\n\n        public override bool Equals(object dVSHostLocalPortInfo)\n        {\n            return Equals(dVSHostLocalPortInfo as DVSHostLocalPortInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchUuid + \"_\" + PortKey + \"_\" + Setting + \"_\" + Vnic).GetHashCode();\n        }\n    }\n\n    public class DvsHostStatusUpdated : DvsEvent, IEquatable<DvsHostStatusUpdated>\n    {\n        public HostEventArgument HostMember { get; set; }\n\n        public string OldStatus { get; set; }\n\n        public string NewStatus { get; set; }\n\n        public string OldStatusDetail { get; set; }\n\n        public string NewStatusDetail { get; set; }\n\n        public bool Equals(DvsHostStatusUpdated dvsHostStatusUpdated)\n        {\n            return (dvsHostStatusUpdated != null && ((this.HostMember == null && dvsHostStatusUpdated.HostMember == null) || (this.HostMember != null && this.HostMember.Equals(dvsHostStatusUpdated.HostMember))) && this.OldStatus == dvsHostStatusUpdated.OldStatus && this.NewStatus == dvsHostStatusUpdated.NewStatus && this.OldStatusDetail == dvsHostStatusUpdated.OldStatusDetail && this.NewStatusDetail == dvsHostStatusUpdated.NewStatusDetail);\n        }\n\n        public override bool Equals(object dvsHostStatusUpdated)\n        {\n            return Equals(dvsHostStatusUpdated as DvsHostStatusUpdated);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostMember + \"_\" + OldStatus + \"_\" + NewStatus + \"_\" + OldStatusDetail + \"_\" + NewStatusDetail).GetHashCode();\n        }\n    }\n\n    public class DvsHostVNicProfile : DvsVNicProfile, IEquatable<DvsHostVNicProfile>\n    {\n        public bool Equals(DvsHostVNicProfile dvsHostVNicProfile)\n        {\n            return (dvsHostVNicProfile != null && base.Equals(dvsHostVNicProfile));\n        }\n\n        public override bool Equals(object dvsHostVNicProfile)\n        {\n            return Equals(dvsHostVNicProfile as DvsHostVNicProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsHostWentOutOfSyncEvent : DvsEvent, IEquatable<DvsHostWentOutOfSyncEvent>\n    {\n        public DvsOutOfSyncHostArgument HostOutOfSync { get; set; }\n\n        public bool Equals(DvsHostWentOutOfSyncEvent dvsHostWentOutOfSyncEvent)\n        {\n            return (dvsHostWentOutOfSyncEvent != null && ((this.HostOutOfSync == null && dvsHostWentOutOfSyncEvent.HostOutOfSync == null) || (this.HostOutOfSync != null && this.HostOutOfSync.Equals(dvsHostWentOutOfSyncEvent.HostOutOfSync))));\n        }\n\n        public override bool Equals(object dvsHostWentOutOfSyncEvent)\n        {\n            return Equals(dvsHostWentOutOfSyncEvent as DvsHostWentOutOfSyncEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostOutOfSync).GetHashCode();\n        }\n    }\n\n    public class DvsImportEvent : DvsEvent, IEquatable<DvsImportEvent>\n    {\n        public string ImportType { get; set; }\n\n        public bool Equals(DvsImportEvent dvsImportEvent)\n        {\n            return (dvsImportEvent != null && this.ImportType == dvsImportEvent.ImportType);\n        }\n\n        public override bool Equals(object dvsImportEvent)\n        {\n            return Equals(dvsImportEvent as DvsImportEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ImportType).GetHashCode();\n        }\n    }\n\n    public class DvsIpNetworkRuleQualifier : DvsNetworkRuleQualifier, IEquatable<DvsIpNetworkRuleQualifier>\n    {\n        public IpAddress SourceAddress { get; set; }\n\n        public IpAddress DestinationAddress { get; set; }\n\n        public IntExpression Protocol { get; set; }\n\n        public DvsIpPort SourceIpPort { get; set; }\n\n        public DvsIpPort DestinationIpPort { get; set; }\n\n        public IntExpression TcpFlags { get; set; }\n\n        public bool Equals(DvsIpNetworkRuleQualifier dvsIpNetworkRuleQualifier)\n        {\n            return (dvsIpNetworkRuleQualifier != null && ((this.SourceAddress == null && dvsIpNetworkRuleQualifier.SourceAddress == null) || (this.SourceAddress != null && this.SourceAddress.Equals(dvsIpNetworkRuleQualifier.SourceAddress))) && ((this.DestinationAddress == null && dvsIpNetworkRuleQualifier.DestinationAddress == null) || (this.DestinationAddress != null && this.DestinationAddress.Equals(dvsIpNetworkRuleQualifier.DestinationAddress))) && ((this.Protocol == null && dvsIpNetworkRuleQualifier.Protocol == null) || (this.Protocol != null && this.Protocol.Equals(dvsIpNetworkRuleQualifier.Protocol))) && ((this.SourceIpPort == null && dvsIpNetworkRuleQualifier.SourceIpPort == null) || (this.SourceIpPort != null && this.SourceIpPort.Equals(dvsIpNetworkRuleQualifier.SourceIpPort))) && ((this.DestinationIpPort == null && dvsIpNetworkRuleQualifier.DestinationIpPort == null) || (this.DestinationIpPort != null && this.DestinationIpPort.Equals(dvsIpNetworkRuleQualifier.DestinationIpPort))) && ((this.TcpFlags == null && dvsIpNetworkRuleQualifier.TcpFlags == null) || (this.TcpFlags != null && this.TcpFlags.Equals(dvsIpNetworkRuleQualifier.TcpFlags))));\n        }\n\n        public override bool Equals(object dvsIpNetworkRuleQualifier)\n        {\n            return Equals(dvsIpNetworkRuleQualifier as DvsIpNetworkRuleQualifier);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceAddress + \"_\" + DestinationAddress + \"_\" + Protocol + \"_\" + SourceIpPort + \"_\" + DestinationIpPort + \"_\" + TcpFlags).GetHashCode();\n        }\n    }\n\n    public class DvsIpPort : NegatableExpression, IEquatable<DvsIpPort>\n    {\n        public bool Equals(DvsIpPort dvsIpPort)\n        {\n            return (dvsIpPort != null && base.Equals(dvsIpPort));\n        }\n\n        public override bool Equals(object dvsIpPort)\n        {\n            return Equals(dvsIpPort as DvsIpPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsIpPortRange : DvsIpPort, IEquatable<DvsIpPortRange>\n    {\n        public int StartPortNumber { get; set; }\n\n        public int EndPortNumber { get; set; }\n\n        public bool Equals(DvsIpPortRange dvsIpPortRange)\n        {\n            return (dvsIpPortRange != null && this.StartPortNumber == dvsIpPortRange.StartPortNumber && this.EndPortNumber == dvsIpPortRange.EndPortNumber);\n        }\n\n        public override bool Equals(object dvsIpPortRange)\n        {\n            return Equals(dvsIpPortRange as DvsIpPortRange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StartPortNumber + \"_\" + EndPortNumber).GetHashCode();\n        }\n    }\n\n    public class DvsLogNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsLogNetworkRuleAction>\n    {\n        public bool Equals(DvsLogNetworkRuleAction dvsLogNetworkRuleAction)\n        {\n            return (dvsLogNetworkRuleAction != null && base.Equals(dvsLogNetworkRuleAction));\n        }\n\n        public override bool Equals(object dvsLogNetworkRuleAction)\n        {\n            return Equals(dvsLogNetworkRuleAction as DvsLogNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVSMacLearningPolicy : InheritablePolicy, IEquatable<DVSMacLearningPolicy>\n    {\n        public bool Enabled { get; set; }\n\n        public bool? AllowUnicastFlooding { get; set; }\n\n        public int? Limit { get; set; }\n\n        public string LimitPolicy { get; set; }\n\n        public bool Equals(DVSMacLearningPolicy dVSMacLearningPolicy)\n        {\n            return (dVSMacLearningPolicy != null && this.Enabled == dVSMacLearningPolicy.Enabled && ((this.AllowUnicastFlooding == null && dVSMacLearningPolicy.AllowUnicastFlooding == null) || (this.AllowUnicastFlooding != null && this.AllowUnicastFlooding.Equals(dVSMacLearningPolicy.AllowUnicastFlooding))) && ((this.Limit == null && dVSMacLearningPolicy.Limit == null) || (this.Limit != null && this.Limit.Equals(dVSMacLearningPolicy.Limit))) && this.LimitPolicy == dVSMacLearningPolicy.LimitPolicy);\n        }\n\n        public override bool Equals(object dVSMacLearningPolicy)\n        {\n            return Equals(dVSMacLearningPolicy as DVSMacLearningPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + AllowUnicastFlooding + \"_\" + Limit + \"_\" + LimitPolicy).GetHashCode();\n        }\n    }\n\n    public class DVSMacManagementPolicy : InheritablePolicy, IEquatable<DVSMacManagementPolicy>\n    {\n        public bool? AllowPromiscuous { get; set; }\n\n        public bool? MacChanges { get; set; }\n\n        public bool? ForgedTransmits { get; set; }\n\n        public DVSMacLearningPolicy MacLearningPolicy { get; set; }\n\n        public bool Equals(DVSMacManagementPolicy dVSMacManagementPolicy)\n        {\n            return (dVSMacManagementPolicy != null && ((this.AllowPromiscuous == null && dVSMacManagementPolicy.AllowPromiscuous == null) || (this.AllowPromiscuous != null && this.AllowPromiscuous.Equals(dVSMacManagementPolicy.AllowPromiscuous))) && ((this.MacChanges == null && dVSMacManagementPolicy.MacChanges == null) || (this.MacChanges != null && this.MacChanges.Equals(dVSMacManagementPolicy.MacChanges))) && ((this.ForgedTransmits == null && dVSMacManagementPolicy.ForgedTransmits == null) || (this.ForgedTransmits != null && this.ForgedTransmits.Equals(dVSMacManagementPolicy.ForgedTransmits))) && ((this.MacLearningPolicy == null && dVSMacManagementPolicy.MacLearningPolicy == null) || (this.MacLearningPolicy != null && this.MacLearningPolicy.Equals(dVSMacManagementPolicy.MacLearningPolicy))));\n        }\n\n        public override bool Equals(object dVSMacManagementPolicy)\n        {\n            return Equals(dVSMacManagementPolicy as DVSMacManagementPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowPromiscuous + \"_\" + MacChanges + \"_\" + ForgedTransmits + \"_\" + MacLearningPolicy).GetHashCode();\n        }\n    }\n\n    public class DvsMacNetworkRuleQualifier : DvsNetworkRuleQualifier, IEquatable<DvsMacNetworkRuleQualifier>\n    {\n        public MacAddress SourceAddress { get; set; }\n\n        public MacAddress DestinationAddress { get; set; }\n\n        public IntExpression Protocol { get; set; }\n\n        public IntExpression VlanId { get; set; }\n\n        public bool Equals(DvsMacNetworkRuleQualifier dvsMacNetworkRuleQualifier)\n        {\n            return (dvsMacNetworkRuleQualifier != null && ((this.SourceAddress == null && dvsMacNetworkRuleQualifier.SourceAddress == null) || (this.SourceAddress != null && this.SourceAddress.Equals(dvsMacNetworkRuleQualifier.SourceAddress))) && ((this.DestinationAddress == null && dvsMacNetworkRuleQualifier.DestinationAddress == null) || (this.DestinationAddress != null && this.DestinationAddress.Equals(dvsMacNetworkRuleQualifier.DestinationAddress))) && ((this.Protocol == null && dvsMacNetworkRuleQualifier.Protocol == null) || (this.Protocol != null && this.Protocol.Equals(dvsMacNetworkRuleQualifier.Protocol))) && ((this.VlanId == null && dvsMacNetworkRuleQualifier.VlanId == null) || (this.VlanId != null && this.VlanId.Equals(dvsMacNetworkRuleQualifier.VlanId))));\n        }\n\n        public override bool Equals(object dvsMacNetworkRuleQualifier)\n        {\n            return Equals(dvsMacNetworkRuleQualifier as DvsMacNetworkRuleQualifier);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceAddress + \"_\" + DestinationAddress + \"_\" + Protocol + \"_\" + VlanId).GetHashCode();\n        }\n    }\n\n    public class DvsMacRewriteNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsMacRewriteNetworkRuleAction>\n    {\n        public string RewriteMac { get; set; }\n\n        public bool Equals(DvsMacRewriteNetworkRuleAction dvsMacRewriteNetworkRuleAction)\n        {\n            return (dvsMacRewriteNetworkRuleAction != null && this.RewriteMac == dvsMacRewriteNetworkRuleAction.RewriteMac);\n        }\n\n        public override bool Equals(object dvsMacRewriteNetworkRuleAction)\n        {\n            return Equals(dvsMacRewriteNetworkRuleAction as DvsMacRewriteNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RewriteMac).GetHashCode();\n        }\n    }\n\n    public class DVSManagerDvsConfigTarget : DynamicData, IEquatable<DVSManagerDvsConfigTarget>\n    {\n        public DistributedVirtualPortgroupInfo[] DistributedVirtualPortgroup { get; set; }\n\n        public DistributedVirtualSwitchInfo[] DistributedVirtualSwitch { get; set; }\n\n        public bool Equals(DVSManagerDvsConfigTarget dVSManagerDvsConfigTarget)\n        {\n            return (dVSManagerDvsConfigTarget != null && ((this.DistributedVirtualPortgroup == null && dVSManagerDvsConfigTarget.DistributedVirtualPortgroup == null) || (this.DistributedVirtualPortgroup != null && dVSManagerDvsConfigTarget.DistributedVirtualPortgroup != null && Enumerable.SequenceEqual(this.DistributedVirtualPortgroup, dVSManagerDvsConfigTarget.DistributedVirtualPortgroup))) && ((this.DistributedVirtualSwitch == null && dVSManagerDvsConfigTarget.DistributedVirtualSwitch == null) || (this.DistributedVirtualSwitch != null && dVSManagerDvsConfigTarget.DistributedVirtualSwitch != null && Enumerable.SequenceEqual(this.DistributedVirtualSwitch, dVSManagerDvsConfigTarget.DistributedVirtualSwitch))));\n        }\n\n        public override bool Equals(object dVSManagerDvsConfigTarget)\n        {\n            return Equals(dVSManagerDvsConfigTarget as DVSManagerDvsConfigTarget);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DistributedVirtualPortgroup + \"_\" + DistributedVirtualSwitch).GetHashCode();\n        }\n    }\n\n    public class DvsMergedEvent : DvsEvent, IEquatable<DvsMergedEvent>\n    {\n        public DvsEventArgument SourceDvs { get; set; }\n\n        public DvsEventArgument DestinationDvs { get; set; }\n\n        public bool Equals(DvsMergedEvent dvsMergedEvent)\n        {\n            return (dvsMergedEvent != null && ((this.SourceDvs == null && dvsMergedEvent.SourceDvs == null) || (this.SourceDvs != null && this.SourceDvs.Equals(dvsMergedEvent.SourceDvs))) && ((this.DestinationDvs == null && dvsMergedEvent.DestinationDvs == null) || (this.DestinationDvs != null && this.DestinationDvs.Equals(dvsMergedEvent.DestinationDvs))));\n        }\n\n        public override bool Equals(object dvsMergedEvent)\n        {\n            return Equals(dvsMergedEvent as DvsMergedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceDvs + \"_\" + DestinationDvs).GetHashCode();\n        }\n    }\n\n    public class DVSNameArrayUplinkPortPolicy : DVSUplinkPortPolicy, IEquatable<DVSNameArrayUplinkPortPolicy>\n    {\n        public string[] UplinkPortName { get; set; }\n\n        public bool Equals(DVSNameArrayUplinkPortPolicy dVSNameArrayUplinkPortPolicy)\n        {\n            return (dVSNameArrayUplinkPortPolicy != null && ((this.UplinkPortName == null && dVSNameArrayUplinkPortPolicy.UplinkPortName == null) || (this.UplinkPortName != null && dVSNameArrayUplinkPortPolicy.UplinkPortName != null && Enumerable.SequenceEqual(this.UplinkPortName, dVSNameArrayUplinkPortPolicy.UplinkPortName))));\n        }\n\n        public override bool Equals(object dVSNameArrayUplinkPortPolicy)\n        {\n            return Equals(dVSNameArrayUplinkPortPolicy as DVSNameArrayUplinkPortPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UplinkPortName).GetHashCode();\n        }\n    }\n\n    public class DVSNetworkResourceManagementCapability : DynamicData, IEquatable<DVSNetworkResourceManagementCapability>\n    {\n        public bool NetworkResourceManagementSupported { get; set; }\n\n        public int NetworkResourcePoolHighShareValue { get; set; }\n\n        public bool QosSupported { get; set; }\n\n        public bool UserDefinedNetworkResourcePoolsSupported { get; set; }\n\n        public bool? NetworkResourceControlVersion3Supported { get; set; }\n\n        public bool? UserDefinedInfraTrafficPoolSupported { get; set; }\n\n        public bool Equals(DVSNetworkResourceManagementCapability dVSNetworkResourceManagementCapability)\n        {\n            return (dVSNetworkResourceManagementCapability != null && this.NetworkResourceManagementSupported == dVSNetworkResourceManagementCapability.NetworkResourceManagementSupported && this.NetworkResourcePoolHighShareValue == dVSNetworkResourceManagementCapability.NetworkResourcePoolHighShareValue && this.QosSupported == dVSNetworkResourceManagementCapability.QosSupported && this.UserDefinedNetworkResourcePoolsSupported == dVSNetworkResourceManagementCapability.UserDefinedNetworkResourcePoolsSupported && ((this.NetworkResourceControlVersion3Supported == null && dVSNetworkResourceManagementCapability.NetworkResourceControlVersion3Supported == null) || (this.NetworkResourceControlVersion3Supported != null && this.NetworkResourceControlVersion3Supported.Equals(dVSNetworkResourceManagementCapability.NetworkResourceControlVersion3Supported))) && ((this.UserDefinedInfraTrafficPoolSupported == null && dVSNetworkResourceManagementCapability.UserDefinedInfraTrafficPoolSupported == null) || (this.UserDefinedInfraTrafficPoolSupported != null && this.UserDefinedInfraTrafficPoolSupported.Equals(dVSNetworkResourceManagementCapability.UserDefinedInfraTrafficPoolSupported))));\n        }\n\n        public override bool Equals(object dVSNetworkResourceManagementCapability)\n        {\n            return Equals(dVSNetworkResourceManagementCapability as DVSNetworkResourceManagementCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetworkResourceManagementSupported + \"_\" + NetworkResourcePoolHighShareValue + \"_\" + QosSupported + \"_\" + UserDefinedNetworkResourcePoolsSupported + \"_\" + NetworkResourceControlVersion3Supported + \"_\" + UserDefinedInfraTrafficPoolSupported).GetHashCode();\n        }\n    }\n\n    public class DVSNetworkResourcePool : DynamicData, IEquatable<DVSNetworkResourcePool>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DVSNetworkResourcePoolAllocationInfo AllocationInfo { get; set; }\n\n        public bool Equals(DVSNetworkResourcePool dVSNetworkResourcePool)\n        {\n            return (dVSNetworkResourcePool != null && this.Key == dVSNetworkResourcePool.Key && this.Name == dVSNetworkResourcePool.Name && this.Description == dVSNetworkResourcePool.Description && this.ConfigVersion == dVSNetworkResourcePool.ConfigVersion && ((this.AllocationInfo == null && dVSNetworkResourcePool.AllocationInfo == null) || (this.AllocationInfo != null && this.AllocationInfo.Equals(dVSNetworkResourcePool.AllocationInfo))));\n        }\n\n        public override bool Equals(object dVSNetworkResourcePool)\n        {\n            return Equals(dVSNetworkResourcePool as DVSNetworkResourcePool);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Description + \"_\" + ConfigVersion + \"_\" + AllocationInfo).GetHashCode();\n        }\n    }\n\n    public class DVSNetworkResourcePoolAllocationInfo : DynamicData, IEquatable<DVSNetworkResourcePoolAllocationInfo>\n    {\n        public long? Limit { get; set; }\n\n        public SharesInfo Shares { get; set; }\n\n        public int? PriorityTag { get; set; }\n\n        public bool Equals(DVSNetworkResourcePoolAllocationInfo dVSNetworkResourcePoolAllocationInfo)\n        {\n            return (dVSNetworkResourcePoolAllocationInfo != null && ((this.Limit == null && dVSNetworkResourcePoolAllocationInfo.Limit == null) || (this.Limit != null && this.Limit.Equals(dVSNetworkResourcePoolAllocationInfo.Limit))) && ((this.Shares == null && dVSNetworkResourcePoolAllocationInfo.Shares == null) || (this.Shares != null && this.Shares.Equals(dVSNetworkResourcePoolAllocationInfo.Shares))) && ((this.PriorityTag == null && dVSNetworkResourcePoolAllocationInfo.PriorityTag == null) || (this.PriorityTag != null && this.PriorityTag.Equals(dVSNetworkResourcePoolAllocationInfo.PriorityTag))));\n        }\n\n        public override bool Equals(object dVSNetworkResourcePoolAllocationInfo)\n        {\n            return Equals(dVSNetworkResourcePoolAllocationInfo as DVSNetworkResourcePoolAllocationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Limit + \"_\" + Shares + \"_\" + PriorityTag).GetHashCode();\n        }\n    }\n\n    public class DVSNetworkResourcePoolConfigSpec : DynamicData, IEquatable<DVSNetworkResourcePoolConfigSpec>\n    {\n        public string Key { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DVSNetworkResourcePoolAllocationInfo AllocationInfo { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(DVSNetworkResourcePoolConfigSpec dVSNetworkResourcePoolConfigSpec)\n        {\n            return (dVSNetworkResourcePoolConfigSpec != null && this.Key == dVSNetworkResourcePoolConfigSpec.Key && this.ConfigVersion == dVSNetworkResourcePoolConfigSpec.ConfigVersion && ((this.AllocationInfo == null && dVSNetworkResourcePoolConfigSpec.AllocationInfo == null) || (this.AllocationInfo != null && this.AllocationInfo.Equals(dVSNetworkResourcePoolConfigSpec.AllocationInfo))) && this.Name == dVSNetworkResourcePoolConfigSpec.Name && this.Description == dVSNetworkResourcePoolConfigSpec.Description);\n        }\n\n        public override bool Equals(object dVSNetworkResourcePoolConfigSpec)\n        {\n            return Equals(dVSNetworkResourcePoolConfigSpec as DVSNetworkResourcePoolConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ConfigVersion + \"_\" + AllocationInfo + \"_\" + Name + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class DvsNetworkRuleAction : DynamicData, IEquatable<DvsNetworkRuleAction>\n    {\n        public bool Equals(DvsNetworkRuleAction dvsNetworkRuleAction)\n        {\n            return (dvsNetworkRuleAction != null && base.Equals(dvsNetworkRuleAction));\n        }\n\n        public override bool Equals(object dvsNetworkRuleAction)\n        {\n            return Equals(dvsNetworkRuleAction as DvsNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsNetworkRuleQualifier : DynamicData, IEquatable<DvsNetworkRuleQualifier>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(DvsNetworkRuleQualifier dvsNetworkRuleQualifier)\n        {\n            return (dvsNetworkRuleQualifier != null && this.Key == dvsNetworkRuleQualifier.Key);\n        }\n\n        public override bool Equals(object dvsNetworkRuleQualifier)\n        {\n            return Equals(dvsNetworkRuleQualifier as DvsNetworkRuleQualifier);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class DvsNotAuthorized : DvsFault, IEquatable<DvsNotAuthorized>\n    {\n        public string SessionExtensionKey { get; set; }\n\n        public string DvsExtensionKey { get; set; }\n\n        public bool Equals(DvsNotAuthorized dvsNotAuthorized)\n        {\n            return (dvsNotAuthorized != null && this.SessionExtensionKey == dvsNotAuthorized.SessionExtensionKey && this.DvsExtensionKey == dvsNotAuthorized.DvsExtensionKey);\n        }\n\n        public override bool Equals(object dvsNotAuthorized)\n        {\n            return Equals(dvsNotAuthorized as DvsNotAuthorized);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SessionExtensionKey + \"_\" + DvsExtensionKey).GetHashCode();\n        }\n    }\n\n    public class DvsOperationBulkFault : DvsFault, IEquatable<DvsOperationBulkFault>\n    {\n        public DvsOperationBulkFaultFaultOnHost[] HostFault { get; set; }\n\n        public bool Equals(DvsOperationBulkFault dvsOperationBulkFault)\n        {\n            return (dvsOperationBulkFault != null && ((this.HostFault == null && dvsOperationBulkFault.HostFault == null) || (this.HostFault != null && dvsOperationBulkFault.HostFault != null && Enumerable.SequenceEqual(this.HostFault, dvsOperationBulkFault.HostFault))));\n        }\n\n        public override bool Equals(object dvsOperationBulkFault)\n        {\n            return Equals(dvsOperationBulkFault as DvsOperationBulkFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostFault).GetHashCode();\n        }\n    }\n\n    public class DvsOperationBulkFaultFaultOnHost : DynamicData, IEquatable<DvsOperationBulkFaultFaultOnHost>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public DvsOperationBulkFaultFaultOnHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DvsOperationBulkFaultFaultOnHost dvsOperationBulkFaultFaultOnHost)\n        {\n            return (dvsOperationBulkFaultFaultOnHost != null && ((this.Host == null && dvsOperationBulkFaultFaultOnHost.Host == null) || (this.Host != null && this.Host.Equals(dvsOperationBulkFaultFaultOnHost.Host))) && ((this.Fault == null && dvsOperationBulkFaultFaultOnHost.Fault == null) || (this.Fault != null && this.Fault.Equals(dvsOperationBulkFaultFaultOnHost.Fault))) && ((this.LinkedView == null && dvsOperationBulkFaultFaultOnHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dvsOperationBulkFaultFaultOnHost.LinkedView))));\n        }\n\n        public override bool Equals(object dvsOperationBulkFaultFaultOnHost)\n        {\n            return Equals(dvsOperationBulkFaultFaultOnHost as DvsOperationBulkFaultFaultOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DvsOperationBulkFaultFaultOnHost_LinkedView : IEquatable<DvsOperationBulkFaultFaultOnHost_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(DvsOperationBulkFaultFaultOnHost_LinkedView dvsOperationBulkFaultFaultOnHost_LinkedView)\n        {\n            return (dvsOperationBulkFaultFaultOnHost_LinkedView != null && ((this.Host == null && dvsOperationBulkFaultFaultOnHost_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(dvsOperationBulkFaultFaultOnHost_LinkedView.Host))));\n        }\n\n        public override bool Equals(object dvsOperationBulkFaultFaultOnHost_LinkedView)\n        {\n            return Equals(dvsOperationBulkFaultFaultOnHost_LinkedView as DvsOperationBulkFaultFaultOnHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class DvsOutOfSyncHostArgument : DynamicData, IEquatable<DvsOutOfSyncHostArgument>\n    {\n        public HostEventArgument OutOfSyncHost { get; set; }\n\n        public string[] ConfigParamters { get; set; }\n\n        public bool Equals(DvsOutOfSyncHostArgument dvsOutOfSyncHostArgument)\n        {\n            return (dvsOutOfSyncHostArgument != null && ((this.OutOfSyncHost == null && dvsOutOfSyncHostArgument.OutOfSyncHost == null) || (this.OutOfSyncHost != null && this.OutOfSyncHost.Equals(dvsOutOfSyncHostArgument.OutOfSyncHost))) && ((this.ConfigParamters == null && dvsOutOfSyncHostArgument.ConfigParamters == null) || (this.ConfigParamters != null && dvsOutOfSyncHostArgument.ConfigParamters != null && Enumerable.SequenceEqual(this.ConfigParamters, dvsOutOfSyncHostArgument.ConfigParamters))));\n        }\n\n        public override bool Equals(object dvsOutOfSyncHostArgument)\n        {\n            return Equals(dvsOutOfSyncHostArgument as DvsOutOfSyncHostArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OutOfSyncHost + \"_\" + ConfigParamters).GetHashCode();\n        }\n    }\n\n    public class DVSPolicy : DynamicData, IEquatable<DVSPolicy>\n    {\n        public bool? AutoPreInstallAllowed { get; set; }\n\n        public bool? AutoUpgradeAllowed { get; set; }\n\n        public bool? PartialUpgradeAllowed { get; set; }\n\n        public bool Equals(DVSPolicy dVSPolicy)\n        {\n            return (dVSPolicy != null && ((this.AutoPreInstallAllowed == null && dVSPolicy.AutoPreInstallAllowed == null) || (this.AutoPreInstallAllowed != null && this.AutoPreInstallAllowed.Equals(dVSPolicy.AutoPreInstallAllowed))) && ((this.AutoUpgradeAllowed == null && dVSPolicy.AutoUpgradeAllowed == null) || (this.AutoUpgradeAllowed != null && this.AutoUpgradeAllowed.Equals(dVSPolicy.AutoUpgradeAllowed))) && ((this.PartialUpgradeAllowed == null && dVSPolicy.PartialUpgradeAllowed == null) || (this.PartialUpgradeAllowed != null && this.PartialUpgradeAllowed.Equals(dVSPolicy.PartialUpgradeAllowed))));\n        }\n\n        public override bool Equals(object dVSPolicy)\n        {\n            return Equals(dVSPolicy as DVSPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoPreInstallAllowed + \"_\" + AutoUpgradeAllowed + \"_\" + PartialUpgradeAllowed).GetHashCode();\n        }\n    }\n\n    public class DvsPortBlockedEvent : DvsEvent, IEquatable<DvsPortBlockedEvent>\n    {\n        public string PortKey { get; set; }\n\n        public string StatusDetail { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public string PrevBlockState { get; set; }\n\n        public bool Equals(DvsPortBlockedEvent dvsPortBlockedEvent)\n        {\n            return (dvsPortBlockedEvent != null && this.PortKey == dvsPortBlockedEvent.PortKey && this.StatusDetail == dvsPortBlockedEvent.StatusDetail && ((this.RuntimeInfo == null && dvsPortBlockedEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortBlockedEvent.RuntimeInfo))) && this.PrevBlockState == dvsPortBlockedEvent.PrevBlockState);\n        }\n\n        public override bool Equals(object dvsPortBlockedEvent)\n        {\n            return Equals(dvsPortBlockedEvent as DvsPortBlockedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + StatusDetail + \"_\" + RuntimeInfo + \"_\" + PrevBlockState).GetHashCode();\n        }\n    }\n\n    public class DvsPortConnectedEvent : DvsEvent, IEquatable<DvsPortConnectedEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DistributedVirtualSwitchPortConnectee Connectee { get; set; }\n\n        public bool Equals(DvsPortConnectedEvent dvsPortConnectedEvent)\n        {\n            return (dvsPortConnectedEvent != null && this.PortKey == dvsPortConnectedEvent.PortKey && ((this.Connectee == null && dvsPortConnectedEvent.Connectee == null) || (this.Connectee != null && this.Connectee.Equals(dvsPortConnectedEvent.Connectee))));\n        }\n\n        public override bool Equals(object dvsPortConnectedEvent)\n        {\n            return Equals(dvsPortConnectedEvent as DvsPortConnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + Connectee).GetHashCode();\n        }\n    }\n\n    public class DvsPortCreatedEvent : DvsEvent, IEquatable<DvsPortCreatedEvent>\n    {\n        public string[] PortKey { get; set; }\n\n        public bool Equals(DvsPortCreatedEvent dvsPortCreatedEvent)\n        {\n            return (dvsPortCreatedEvent != null && ((this.PortKey == null && dvsPortCreatedEvent.PortKey == null) || (this.PortKey != null && dvsPortCreatedEvent.PortKey != null && Enumerable.SequenceEqual(this.PortKey, dvsPortCreatedEvent.PortKey))));\n        }\n\n        public override bool Equals(object dvsPortCreatedEvent)\n        {\n            return Equals(dvsPortCreatedEvent as DvsPortCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey).GetHashCode();\n        }\n    }\n\n    public class DvsPortDeletedEvent : DvsEvent, IEquatable<DvsPortDeletedEvent>\n    {\n        public string[] PortKey { get; set; }\n\n        public bool Equals(DvsPortDeletedEvent dvsPortDeletedEvent)\n        {\n            return (dvsPortDeletedEvent != null && ((this.PortKey == null && dvsPortDeletedEvent.PortKey == null) || (this.PortKey != null && dvsPortDeletedEvent.PortKey != null && Enumerable.SequenceEqual(this.PortKey, dvsPortDeletedEvent.PortKey))));\n        }\n\n        public override bool Equals(object dvsPortDeletedEvent)\n        {\n            return Equals(dvsPortDeletedEvent as DvsPortDeletedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey).GetHashCode();\n        }\n    }\n\n    public class DvsPortDisconnectedEvent : DvsEvent, IEquatable<DvsPortDisconnectedEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DistributedVirtualSwitchPortConnectee Connectee { get; set; }\n\n        public bool Equals(DvsPortDisconnectedEvent dvsPortDisconnectedEvent)\n        {\n            return (dvsPortDisconnectedEvent != null && this.PortKey == dvsPortDisconnectedEvent.PortKey && ((this.Connectee == null && dvsPortDisconnectedEvent.Connectee == null) || (this.Connectee != null && this.Connectee.Equals(dvsPortDisconnectedEvent.Connectee))));\n        }\n\n        public override bool Equals(object dvsPortDisconnectedEvent)\n        {\n            return Equals(dvsPortDisconnectedEvent as DvsPortDisconnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + Connectee).GetHashCode();\n        }\n    }\n\n    public class DvsPortEnteredPassthruEvent : DvsEvent, IEquatable<DvsPortEnteredPassthruEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public bool Equals(DvsPortEnteredPassthruEvent dvsPortEnteredPassthruEvent)\n        {\n            return (dvsPortEnteredPassthruEvent != null && this.PortKey == dvsPortEnteredPassthruEvent.PortKey && ((this.RuntimeInfo == null && dvsPortEnteredPassthruEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortEnteredPassthruEvent.RuntimeInfo))));\n        }\n\n        public override bool Equals(object dvsPortEnteredPassthruEvent)\n        {\n            return Equals(dvsPortEnteredPassthruEvent as DvsPortEnteredPassthruEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + RuntimeInfo).GetHashCode();\n        }\n    }\n\n    public class DvsPortExitedPassthruEvent : DvsEvent, IEquatable<DvsPortExitedPassthruEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public bool Equals(DvsPortExitedPassthruEvent dvsPortExitedPassthruEvent)\n        {\n            return (dvsPortExitedPassthruEvent != null && this.PortKey == dvsPortExitedPassthruEvent.PortKey && ((this.RuntimeInfo == null && dvsPortExitedPassthruEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortExitedPassthruEvent.RuntimeInfo))));\n        }\n\n        public override bool Equals(object dvsPortExitedPassthruEvent)\n        {\n            return Equals(dvsPortExitedPassthruEvent as DvsPortExitedPassthruEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + RuntimeInfo).GetHashCode();\n        }\n    }\n\n    public class DvsPortJoinPortgroupEvent : DvsEvent, IEquatable<DvsPortJoinPortgroupEvent>\n    {\n        public string PortKey { get; set; }\n\n        public string PortgroupKey { get; set; }\n\n        public string PortgroupName { get; set; }\n\n        public bool Equals(DvsPortJoinPortgroupEvent dvsPortJoinPortgroupEvent)\n        {\n            return (dvsPortJoinPortgroupEvent != null && this.PortKey == dvsPortJoinPortgroupEvent.PortKey && this.PortgroupKey == dvsPortJoinPortgroupEvent.PortgroupKey && this.PortgroupName == dvsPortJoinPortgroupEvent.PortgroupName);\n        }\n\n        public override bool Equals(object dvsPortJoinPortgroupEvent)\n        {\n            return Equals(dvsPortJoinPortgroupEvent as DvsPortJoinPortgroupEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + PortgroupKey + \"_\" + PortgroupName).GetHashCode();\n        }\n    }\n\n    public class DvsPortLeavePortgroupEvent : DvsEvent, IEquatable<DvsPortLeavePortgroupEvent>\n    {\n        public string PortKey { get; set; }\n\n        public string PortgroupKey { get; set; }\n\n        public string PortgroupName { get; set; }\n\n        public bool Equals(DvsPortLeavePortgroupEvent dvsPortLeavePortgroupEvent)\n        {\n            return (dvsPortLeavePortgroupEvent != null && this.PortKey == dvsPortLeavePortgroupEvent.PortKey && this.PortgroupKey == dvsPortLeavePortgroupEvent.PortgroupKey && this.PortgroupName == dvsPortLeavePortgroupEvent.PortgroupName);\n        }\n\n        public override bool Equals(object dvsPortLeavePortgroupEvent)\n        {\n            return Equals(dvsPortLeavePortgroupEvent as DvsPortLeavePortgroupEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + PortgroupKey + \"_\" + PortgroupName).GetHashCode();\n        }\n    }\n\n    public class DvsPortLinkDownEvent : DvsEvent, IEquatable<DvsPortLinkDownEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public bool Equals(DvsPortLinkDownEvent dvsPortLinkDownEvent)\n        {\n            return (dvsPortLinkDownEvent != null && this.PortKey == dvsPortLinkDownEvent.PortKey && ((this.RuntimeInfo == null && dvsPortLinkDownEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortLinkDownEvent.RuntimeInfo))));\n        }\n\n        public override bool Equals(object dvsPortLinkDownEvent)\n        {\n            return Equals(dvsPortLinkDownEvent as DvsPortLinkDownEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + RuntimeInfo).GetHashCode();\n        }\n    }\n\n    public class DvsPortLinkUpEvent : DvsEvent, IEquatable<DvsPortLinkUpEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public bool Equals(DvsPortLinkUpEvent dvsPortLinkUpEvent)\n        {\n            return (dvsPortLinkUpEvent != null && this.PortKey == dvsPortLinkUpEvent.PortKey && ((this.RuntimeInfo == null && dvsPortLinkUpEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortLinkUpEvent.RuntimeInfo))));\n        }\n\n        public override bool Equals(object dvsPortLinkUpEvent)\n        {\n            return Equals(dvsPortLinkUpEvent as DvsPortLinkUpEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + RuntimeInfo).GetHashCode();\n        }\n    }\n\n    public class DvsPortReconfiguredEvent : DvsEvent, IEquatable<DvsPortReconfiguredEvent>\n    {\n        public string[] PortKey { get; set; }\n\n        public ChangesInfoEventArgument[] ConfigChanges { get; set; }\n\n        public bool Equals(DvsPortReconfiguredEvent dvsPortReconfiguredEvent)\n        {\n            return (dvsPortReconfiguredEvent != null && ((this.PortKey == null && dvsPortReconfiguredEvent.PortKey == null) || (this.PortKey != null && dvsPortReconfiguredEvent.PortKey != null && Enumerable.SequenceEqual(this.PortKey, dvsPortReconfiguredEvent.PortKey))) && ((this.ConfigChanges == null && dvsPortReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && dvsPortReconfiguredEvent.ConfigChanges != null && Enumerable.SequenceEqual(this.ConfigChanges, dvsPortReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object dvsPortReconfiguredEvent)\n        {\n            return Equals(dvsPortReconfiguredEvent as DvsPortReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class DvsPortRuntimeChangeEvent : DvsEvent, IEquatable<DvsPortRuntimeChangeEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public bool Equals(DvsPortRuntimeChangeEvent dvsPortRuntimeChangeEvent)\n        {\n            return (dvsPortRuntimeChangeEvent != null && this.PortKey == dvsPortRuntimeChangeEvent.PortKey && ((this.RuntimeInfo == null && dvsPortRuntimeChangeEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortRuntimeChangeEvent.RuntimeInfo))));\n        }\n\n        public override bool Equals(object dvsPortRuntimeChangeEvent)\n        {\n            return Equals(dvsPortRuntimeChangeEvent as DvsPortRuntimeChangeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + RuntimeInfo).GetHashCode();\n        }\n    }\n\n    public class DvsPortUnblockedEvent : DvsEvent, IEquatable<DvsPortUnblockedEvent>\n    {\n        public string PortKey { get; set; }\n\n        public DVPortStatus RuntimeInfo { get; set; }\n\n        public string PrevBlockState { get; set; }\n\n        public bool Equals(DvsPortUnblockedEvent dvsPortUnblockedEvent)\n        {\n            return (dvsPortUnblockedEvent != null && this.PortKey == dvsPortUnblockedEvent.PortKey && ((this.RuntimeInfo == null && dvsPortUnblockedEvent.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(dvsPortUnblockedEvent.RuntimeInfo))) && this.PrevBlockState == dvsPortUnblockedEvent.PrevBlockState);\n        }\n\n        public override bool Equals(object dvsPortUnblockedEvent)\n        {\n            return Equals(dvsPortUnblockedEvent as DvsPortUnblockedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + RuntimeInfo + \"_\" + PrevBlockState).GetHashCode();\n        }\n    }\n\n    public class DvsPortVendorSpecificStateChangeEvent : DvsEvent, IEquatable<DvsPortVendorSpecificStateChangeEvent>\n    {\n        public string PortKey { get; set; }\n\n        public bool Equals(DvsPortVendorSpecificStateChangeEvent dvsPortVendorSpecificStateChangeEvent)\n        {\n            return (dvsPortVendorSpecificStateChangeEvent != null && this.PortKey == dvsPortVendorSpecificStateChangeEvent.PortKey);\n        }\n\n        public override bool Equals(object dvsPortVendorSpecificStateChangeEvent)\n        {\n            return Equals(dvsPortVendorSpecificStateChangeEvent as DvsPortVendorSpecificStateChangeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey).GetHashCode();\n        }\n    }\n\n    public class DvsProfile : ApplyProfile, IEquatable<DvsProfile>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public PnicUplinkProfile[] Uplink { get; set; }\n\n        public bool Equals(DvsProfile dvsProfile)\n        {\n            return (dvsProfile != null && this.Key == dvsProfile.Key && this.Name == dvsProfile.Name && ((this.Uplink == null && dvsProfile.Uplink == null) || (this.Uplink != null && dvsProfile.Uplink != null && Enumerable.SequenceEqual(this.Uplink, dvsProfile.Uplink))));\n        }\n\n        public override bool Equals(object dvsProfile)\n        {\n            return Equals(dvsProfile as DvsProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Uplink).GetHashCode();\n        }\n    }\n\n    public class DvsPuntNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsPuntNetworkRuleAction>\n    {\n        public bool Equals(DvsPuntNetworkRuleAction dvsPuntNetworkRuleAction)\n        {\n            return (dvsPuntNetworkRuleAction != null && base.Equals(dvsPuntNetworkRuleAction));\n        }\n\n        public override bool Equals(object dvsPuntNetworkRuleAction)\n        {\n            return Equals(dvsPuntNetworkRuleAction as DvsPuntNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsRateLimitNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsRateLimitNetworkRuleAction>\n    {\n        public int PacketsPerSecond { get; set; }\n\n        public bool Equals(DvsRateLimitNetworkRuleAction dvsRateLimitNetworkRuleAction)\n        {\n            return (dvsRateLimitNetworkRuleAction != null && this.PacketsPerSecond == dvsRateLimitNetworkRuleAction.PacketsPerSecond);\n        }\n\n        public override bool Equals(object dvsRateLimitNetworkRuleAction)\n        {\n            return Equals(dvsRateLimitNetworkRuleAction as DvsRateLimitNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PacketsPerSecond).GetHashCode();\n        }\n    }\n\n    public class DvsReconfiguredEvent : DvsEvent, IEquatable<DvsReconfiguredEvent>\n    {\n        public DVSConfigSpec ConfigSpec { get; set; }\n\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(DvsReconfiguredEvent dvsReconfiguredEvent)\n        {\n            return (dvsReconfiguredEvent != null && ((this.ConfigSpec == null && dvsReconfiguredEvent.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(dvsReconfiguredEvent.ConfigSpec))) && ((this.ConfigChanges == null && dvsReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(dvsReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object dvsReconfiguredEvent)\n        {\n            return Equals(dvsReconfiguredEvent as DvsReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec + \"_\" + ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class DvsRenamedEvent : DvsEvent, IEquatable<DvsRenamedEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(DvsRenamedEvent dvsRenamedEvent)\n        {\n            return (dvsRenamedEvent != null && this.OldName == dvsRenamedEvent.OldName && this.NewName == dvsRenamedEvent.NewName);\n        }\n\n        public override bool Equals(object dvsRenamedEvent)\n        {\n            return Equals(dvsRenamedEvent as DvsRenamedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class DvsResourceRuntimeInfo : DynamicData, IEquatable<DvsResourceRuntimeInfo>\n    {\n        public int? Capacity { get; set; }\n\n        public int? Usage { get; set; }\n\n        public int? Available { get; set; }\n\n        public DvsVnicAllocatedResource[] AllocatedResource { get; set; }\n\n        public DvsVmVnicNetworkResourcePoolRuntimeInfo[] VmVnicNetworkResourcePoolRuntime { get; set; }\n\n        public bool Equals(DvsResourceRuntimeInfo dvsResourceRuntimeInfo)\n        {\n            return (dvsResourceRuntimeInfo != null && ((this.Capacity == null && dvsResourceRuntimeInfo.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(dvsResourceRuntimeInfo.Capacity))) && ((this.Usage == null && dvsResourceRuntimeInfo.Usage == null) || (this.Usage != null && this.Usage.Equals(dvsResourceRuntimeInfo.Usage))) && ((this.Available == null && dvsResourceRuntimeInfo.Available == null) || (this.Available != null && this.Available.Equals(dvsResourceRuntimeInfo.Available))) && ((this.AllocatedResource == null && dvsResourceRuntimeInfo.AllocatedResource == null) || (this.AllocatedResource != null && dvsResourceRuntimeInfo.AllocatedResource != null && Enumerable.SequenceEqual(this.AllocatedResource, dvsResourceRuntimeInfo.AllocatedResource))) && ((this.VmVnicNetworkResourcePoolRuntime == null && dvsResourceRuntimeInfo.VmVnicNetworkResourcePoolRuntime == null) || (this.VmVnicNetworkResourcePoolRuntime != null && dvsResourceRuntimeInfo.VmVnicNetworkResourcePoolRuntime != null && Enumerable.SequenceEqual(this.VmVnicNetworkResourcePoolRuntime, dvsResourceRuntimeInfo.VmVnicNetworkResourcePoolRuntime))));\n        }\n\n        public override bool Equals(object dvsResourceRuntimeInfo)\n        {\n            return Equals(dvsResourceRuntimeInfo as DvsResourceRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capacity + \"_\" + Usage + \"_\" + Available + \"_\" + AllocatedResource + \"_\" + VmVnicNetworkResourcePoolRuntime).GetHashCode();\n        }\n    }\n\n    public class DvsRestoreEvent : DvsEvent, IEquatable<DvsRestoreEvent>\n    {\n        public bool Equals(DvsRestoreEvent dvsRestoreEvent)\n        {\n            return (dvsRestoreEvent != null && base.Equals(dvsRestoreEvent));\n        }\n\n        public override bool Equals(object dvsRestoreEvent)\n        {\n            return Equals(dvsRestoreEvent as DvsRestoreEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVSRollbackCapability : DynamicData, IEquatable<DVSRollbackCapability>\n    {\n        public bool RollbackSupported { get; set; }\n\n        public bool Equals(DVSRollbackCapability dVSRollbackCapability)\n        {\n            return (dVSRollbackCapability != null && this.RollbackSupported == dVSRollbackCapability.RollbackSupported);\n        }\n\n        public override bool Equals(object dVSRollbackCapability)\n        {\n            return Equals(dVSRollbackCapability as DVSRollbackCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RollbackSupported).GetHashCode();\n        }\n    }\n\n    public class DVSRuntimeInfo : DynamicData, IEquatable<DVSRuntimeInfo>\n    {\n        public HostMemberRuntimeInfo[] HostMemberRuntime { get; set; }\n\n        public DvsResourceRuntimeInfo ResourceRuntimeInfo { get; set; }\n\n        public bool Equals(DVSRuntimeInfo dVSRuntimeInfo)\n        {\n            return (dVSRuntimeInfo != null && ((this.HostMemberRuntime == null && dVSRuntimeInfo.HostMemberRuntime == null) || (this.HostMemberRuntime != null && dVSRuntimeInfo.HostMemberRuntime != null && Enumerable.SequenceEqual(this.HostMemberRuntime, dVSRuntimeInfo.HostMemberRuntime))) && ((this.ResourceRuntimeInfo == null && dVSRuntimeInfo.ResourceRuntimeInfo == null) || (this.ResourceRuntimeInfo != null && this.ResourceRuntimeInfo.Equals(dVSRuntimeInfo.ResourceRuntimeInfo))));\n        }\n\n        public override bool Equals(object dVSRuntimeInfo)\n        {\n            return Equals(dVSRuntimeInfo as DVSRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostMemberRuntime + \"_\" + ResourceRuntimeInfo).GetHashCode();\n        }\n    }\n\n    public class DvsScopeViolated : DvsFault, IEquatable<DvsScopeViolated>\n    {\n        public ManagedObjectReference[] Scope { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public DvsScopeViolated_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DvsScopeViolated dvsScopeViolated)\n        {\n            return (dvsScopeViolated != null && ((this.Scope == null && dvsScopeViolated.Scope == null) || (this.Scope != null && dvsScopeViolated.Scope != null && Enumerable.SequenceEqual(this.Scope, dvsScopeViolated.Scope))) && ((this.Entity == null && dvsScopeViolated.Entity == null) || (this.Entity != null && this.Entity.Equals(dvsScopeViolated.Entity))) && ((this.LinkedView == null && dvsScopeViolated.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dvsScopeViolated.LinkedView))));\n        }\n\n        public override bool Equals(object dvsScopeViolated)\n        {\n            return Equals(dvsScopeViolated as DvsScopeViolated);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Scope + \"_\" + Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DvsScopeViolated_LinkedView : IEquatable<DvsScopeViolated_LinkedView>\n    {\n        public ManagedEntity[] Scope { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(DvsScopeViolated_LinkedView dvsScopeViolated_LinkedView)\n        {\n            return (dvsScopeViolated_LinkedView != null && ((this.Scope == null && dvsScopeViolated_LinkedView.Scope == null) || (this.Scope != null && dvsScopeViolated_LinkedView.Scope != null && Enumerable.SequenceEqual(this.Scope, dvsScopeViolated_LinkedView.Scope))) && ((this.Entity == null && dvsScopeViolated_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(dvsScopeViolated_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object dvsScopeViolated_LinkedView)\n        {\n            return Equals(dvsScopeViolated_LinkedView as DvsScopeViolated_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Scope + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class DVSSecurityPolicy : InheritablePolicy, IEquatable<DVSSecurityPolicy>\n    {\n        public BoolPolicy AllowPromiscuous { get; set; }\n\n        public BoolPolicy MacChanges { get; set; }\n\n        public BoolPolicy ForgedTransmits { get; set; }\n\n        public bool Equals(DVSSecurityPolicy dVSSecurityPolicy)\n        {\n            return (dVSSecurityPolicy != null && ((this.AllowPromiscuous == null && dVSSecurityPolicy.AllowPromiscuous == null) || (this.AllowPromiscuous != null && this.AllowPromiscuous.Equals(dVSSecurityPolicy.AllowPromiscuous))) && ((this.MacChanges == null && dVSSecurityPolicy.MacChanges == null) || (this.MacChanges != null && this.MacChanges.Equals(dVSSecurityPolicy.MacChanges))) && ((this.ForgedTransmits == null && dVSSecurityPolicy.ForgedTransmits == null) || (this.ForgedTransmits != null && this.ForgedTransmits.Equals(dVSSecurityPolicy.ForgedTransmits))));\n        }\n\n        public override bool Equals(object dVSSecurityPolicy)\n        {\n            return Equals(dVSSecurityPolicy as DVSSecurityPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowPromiscuous + \"_\" + MacChanges + \"_\" + ForgedTransmits).GetHashCode();\n        }\n    }\n\n    public class DVSSelection : SelectionSet, IEquatable<DVSSelection>\n    {\n        public string DvsUuid { get; set; }\n\n        public bool Equals(DVSSelection dVSSelection)\n        {\n            return (dVSSelection != null && this.DvsUuid == dVSSelection.DvsUuid);\n        }\n\n        public override bool Equals(object dVSSelection)\n        {\n            return Equals(dVSSelection as DVSSelection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsUuid).GetHashCode();\n        }\n    }\n\n    public class DvsServiceConsoleVNicProfile : DvsVNicProfile, IEquatable<DvsServiceConsoleVNicProfile>\n    {\n        public bool Equals(DvsServiceConsoleVNicProfile dvsServiceConsoleVNicProfile)\n        {\n            return (dvsServiceConsoleVNicProfile != null && base.Equals(dvsServiceConsoleVNicProfile));\n        }\n\n        public override bool Equals(object dvsServiceConsoleVNicProfile)\n        {\n            return Equals(dvsServiceConsoleVNicProfile as DvsServiceConsoleVNicProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DvsSingleIpPort : DvsIpPort, IEquatable<DvsSingleIpPort>\n    {\n        public int PortNumber { get; set; }\n\n        public bool Equals(DvsSingleIpPort dvsSingleIpPort)\n        {\n            return (dvsSingleIpPort != null && this.PortNumber == dvsSingleIpPort.PortNumber);\n        }\n\n        public override bool Equals(object dvsSingleIpPort)\n        {\n            return Equals(dvsSingleIpPort as DvsSingleIpPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortNumber).GetHashCode();\n        }\n    }\n\n    public class DVSSummary : DynamicData, IEquatable<DVSSummary>\n    {\n        public string Name { get; set; }\n\n        public string Uuid { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public ManagedObjectReference[] HostMember { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public string[] PortgroupName { get; set; }\n\n        public string Description { get; set; }\n\n        public DVSContactInfo Contact { get; set; }\n\n        public int? NumHosts { get; set; }\n\n        public DVSSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DVSSummary dVSSummary)\n        {\n            return (dVSSummary != null && this.Name == dVSSummary.Name && this.Uuid == dVSSummary.Uuid && this.NumPorts == dVSSummary.NumPorts && ((this.ProductInfo == null && dVSSummary.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dVSSummary.ProductInfo))) && ((this.HostMember == null && dVSSummary.HostMember == null) || (this.HostMember != null && dVSSummary.HostMember != null && Enumerable.SequenceEqual(this.HostMember, dVSSummary.HostMember))) && ((this.Vm == null && dVSSummary.Vm == null) || (this.Vm != null && dVSSummary.Vm != null && Enumerable.SequenceEqual(this.Vm, dVSSummary.Vm))) && ((this.Host == null && dVSSummary.Host == null) || (this.Host != null && dVSSummary.Host != null && Enumerable.SequenceEqual(this.Host, dVSSummary.Host))) && ((this.PortgroupName == null && dVSSummary.PortgroupName == null) || (this.PortgroupName != null && dVSSummary.PortgroupName != null && Enumerable.SequenceEqual(this.PortgroupName, dVSSummary.PortgroupName))) && this.Description == dVSSummary.Description && ((this.Contact == null && dVSSummary.Contact == null) || (this.Contact != null && this.Contact.Equals(dVSSummary.Contact))) && ((this.NumHosts == null && dVSSummary.NumHosts == null) || (this.NumHosts != null && this.NumHosts.Equals(dVSSummary.NumHosts))) && ((this.LinkedView == null && dVSSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dVSSummary.LinkedView))));\n        }\n\n        public override bool Equals(object dVSSummary)\n        {\n            return Equals(dVSSummary as DVSSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Uuid + \"_\" + NumPorts + \"_\" + ProductInfo + \"_\" + HostMember + \"_\" + Vm + \"_\" + Host + \"_\" + PortgroupName + \"_\" + Description + \"_\" + Contact + \"_\" + NumHosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DVSSummary_LinkedView : IEquatable<DVSSummary_LinkedView>\n    {\n        public HostSystem[] HostMember { get; set; }\n\n        public VirtualMachine[] Vm { get; set; }\n\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(DVSSummary_LinkedView dVSSummary_LinkedView)\n        {\n            return (dVSSummary_LinkedView != null && ((this.HostMember == null && dVSSummary_LinkedView.HostMember == null) || (this.HostMember != null && dVSSummary_LinkedView.HostMember != null && Enumerable.SequenceEqual(this.HostMember, dVSSummary_LinkedView.HostMember))) && ((this.Vm == null && dVSSummary_LinkedView.Vm == null) || (this.Vm != null && dVSSummary_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, dVSSummary_LinkedView.Vm))) && ((this.Host == null && dVSSummary_LinkedView.Host == null) || (this.Host != null && dVSSummary_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, dVSSummary_LinkedView.Host))));\n        }\n\n        public override bool Equals(object dVSSummary_LinkedView)\n        {\n            return Equals(dVSSummary_LinkedView as DVSSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostMember + \"_\" + Vm + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class DvsSystemTrafficNetworkRuleQualifier : DvsNetworkRuleQualifier, IEquatable<DvsSystemTrafficNetworkRuleQualifier>\n    {\n        public StringExpression TypeOfSystemTraffic { get; set; }\n\n        public bool Equals(DvsSystemTrafficNetworkRuleQualifier dvsSystemTrafficNetworkRuleQualifier)\n        {\n            return (dvsSystemTrafficNetworkRuleQualifier != null && ((this.TypeOfSystemTraffic == null && dvsSystemTrafficNetworkRuleQualifier.TypeOfSystemTraffic == null) || (this.TypeOfSystemTraffic != null && this.TypeOfSystemTraffic.Equals(dvsSystemTrafficNetworkRuleQualifier.TypeOfSystemTraffic))));\n        }\n\n        public override bool Equals(object dvsSystemTrafficNetworkRuleQualifier)\n        {\n            return Equals(dvsSystemTrafficNetworkRuleQualifier as DvsSystemTrafficNetworkRuleQualifier);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TypeOfSystemTraffic).GetHashCode();\n        }\n    }\n\n    public class DvsTrafficFilterConfig : DvsFilterConfig, IEquatable<DvsTrafficFilterConfig>\n    {\n        public DvsTrafficRuleset TrafficRuleset { get; set; }\n\n        public bool Equals(DvsTrafficFilterConfig dvsTrafficFilterConfig)\n        {\n            return (dvsTrafficFilterConfig != null && ((this.TrafficRuleset == null && dvsTrafficFilterConfig.TrafficRuleset == null) || (this.TrafficRuleset != null && this.TrafficRuleset.Equals(dvsTrafficFilterConfig.TrafficRuleset))));\n        }\n\n        public override bool Equals(object dvsTrafficFilterConfig)\n        {\n            return Equals(dvsTrafficFilterConfig as DvsTrafficFilterConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TrafficRuleset).GetHashCode();\n        }\n    }\n\n    public class DvsTrafficFilterConfigSpec : DvsTrafficFilterConfig, IEquatable<DvsTrafficFilterConfigSpec>\n    {\n        public string Operation { get; set; }\n\n        public bool Equals(DvsTrafficFilterConfigSpec dvsTrafficFilterConfigSpec)\n        {\n            return (dvsTrafficFilterConfigSpec != null && this.Operation == dvsTrafficFilterConfigSpec.Operation);\n        }\n\n        public override bool Equals(object dvsTrafficFilterConfigSpec)\n        {\n            return Equals(dvsTrafficFilterConfigSpec as DvsTrafficFilterConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation).GetHashCode();\n        }\n    }\n\n    public class DvsTrafficRule : DynamicData, IEquatable<DvsTrafficRule>\n    {\n        public string Key { get; set; }\n\n        public string Description { get; set; }\n\n        public int? Sequence { get; set; }\n\n        public DvsNetworkRuleQualifier[] Qualifier { get; set; }\n\n        public DvsNetworkRuleAction Action { get; set; }\n\n        public string Direction { get; set; }\n\n        public bool Equals(DvsTrafficRule dvsTrafficRule)\n        {\n            return (dvsTrafficRule != null && this.Key == dvsTrafficRule.Key && this.Description == dvsTrafficRule.Description && ((this.Sequence == null && dvsTrafficRule.Sequence == null) || (this.Sequence != null && this.Sequence.Equals(dvsTrafficRule.Sequence))) && ((this.Qualifier == null && dvsTrafficRule.Qualifier == null) || (this.Qualifier != null && dvsTrafficRule.Qualifier != null && Enumerable.SequenceEqual(this.Qualifier, dvsTrafficRule.Qualifier))) && ((this.Action == null && dvsTrafficRule.Action == null) || (this.Action != null && this.Action.Equals(dvsTrafficRule.Action))) && this.Direction == dvsTrafficRule.Direction);\n        }\n\n        public override bool Equals(object dvsTrafficRule)\n        {\n            return Equals(dvsTrafficRule as DvsTrafficRule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Description + \"_\" + Sequence + \"_\" + Qualifier + \"_\" + Action + \"_\" + Direction).GetHashCode();\n        }\n    }\n\n    public class DvsTrafficRuleset : DynamicData, IEquatable<DvsTrafficRuleset>\n    {\n        public string Key { get; set; }\n\n        public bool? Enabled { get; set; }\n\n        public int? Precedence { get; set; }\n\n        public DvsTrafficRule[] Rules { get; set; }\n\n        public bool Equals(DvsTrafficRuleset dvsTrafficRuleset)\n        {\n            return (dvsTrafficRuleset != null && this.Key == dvsTrafficRuleset.Key && ((this.Enabled == null && dvsTrafficRuleset.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(dvsTrafficRuleset.Enabled))) && ((this.Precedence == null && dvsTrafficRuleset.Precedence == null) || (this.Precedence != null && this.Precedence.Equals(dvsTrafficRuleset.Precedence))) && ((this.Rules == null && dvsTrafficRuleset.Rules == null) || (this.Rules != null && dvsTrafficRuleset.Rules != null && Enumerable.SequenceEqual(this.Rules, dvsTrafficRuleset.Rules))));\n        }\n\n        public override bool Equals(object dvsTrafficRuleset)\n        {\n            return Equals(dvsTrafficRuleset as DvsTrafficRuleset);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Enabled + \"_\" + Precedence + \"_\" + Rules).GetHashCode();\n        }\n    }\n\n    public class DVSTrafficShapingPolicy : InheritablePolicy, IEquatable<DVSTrafficShapingPolicy>\n    {\n        public BoolPolicy Enabled { get; set; }\n\n        public LongPolicy AverageBandwidth { get; set; }\n\n        public LongPolicy PeakBandwidth { get; set; }\n\n        public LongPolicy BurstSize { get; set; }\n\n        public bool Equals(DVSTrafficShapingPolicy dVSTrafficShapingPolicy)\n        {\n            return (dVSTrafficShapingPolicy != null && ((this.Enabled == null && dVSTrafficShapingPolicy.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(dVSTrafficShapingPolicy.Enabled))) && ((this.AverageBandwidth == null && dVSTrafficShapingPolicy.AverageBandwidth == null) || (this.AverageBandwidth != null && this.AverageBandwidth.Equals(dVSTrafficShapingPolicy.AverageBandwidth))) && ((this.PeakBandwidth == null && dVSTrafficShapingPolicy.PeakBandwidth == null) || (this.PeakBandwidth != null && this.PeakBandwidth.Equals(dVSTrafficShapingPolicy.PeakBandwidth))) && ((this.BurstSize == null && dVSTrafficShapingPolicy.BurstSize == null) || (this.BurstSize != null && this.BurstSize.Equals(dVSTrafficShapingPolicy.BurstSize))));\n        }\n\n        public override bool Equals(object dVSTrafficShapingPolicy)\n        {\n            return Equals(dVSTrafficShapingPolicy as DVSTrafficShapingPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + AverageBandwidth + \"_\" + PeakBandwidth + \"_\" + BurstSize).GetHashCode();\n        }\n    }\n\n    public class DvsUpdateTagNetworkRuleAction : DvsNetworkRuleAction, IEquatable<DvsUpdateTagNetworkRuleAction>\n    {\n        public int? QosTag { get; set; }\n\n        public int? DscpTag { get; set; }\n\n        public bool Equals(DvsUpdateTagNetworkRuleAction dvsUpdateTagNetworkRuleAction)\n        {\n            return (dvsUpdateTagNetworkRuleAction != null && ((this.QosTag == null && dvsUpdateTagNetworkRuleAction.QosTag == null) || (this.QosTag != null && this.QosTag.Equals(dvsUpdateTagNetworkRuleAction.QosTag))) && ((this.DscpTag == null && dvsUpdateTagNetworkRuleAction.DscpTag == null) || (this.DscpTag != null && this.DscpTag.Equals(dvsUpdateTagNetworkRuleAction.DscpTag))));\n        }\n\n        public override bool Equals(object dvsUpdateTagNetworkRuleAction)\n        {\n            return Equals(dvsUpdateTagNetworkRuleAction as DvsUpdateTagNetworkRuleAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (QosTag + \"_\" + DscpTag).GetHashCode();\n        }\n    }\n\n    public class DvsUpgradeAvailableEvent : DvsEvent, IEquatable<DvsUpgradeAvailableEvent>\n    {\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public bool Equals(DvsUpgradeAvailableEvent dvsUpgradeAvailableEvent)\n        {\n            return (dvsUpgradeAvailableEvent != null && ((this.ProductInfo == null && dvsUpgradeAvailableEvent.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dvsUpgradeAvailableEvent.ProductInfo))));\n        }\n\n        public override bool Equals(object dvsUpgradeAvailableEvent)\n        {\n            return Equals(dvsUpgradeAvailableEvent as DvsUpgradeAvailableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProductInfo).GetHashCode();\n        }\n    }\n\n    public class DvsUpgradedEvent : DvsEvent, IEquatable<DvsUpgradedEvent>\n    {\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public bool Equals(DvsUpgradedEvent dvsUpgradedEvent)\n        {\n            return (dvsUpgradedEvent != null && ((this.ProductInfo == null && dvsUpgradedEvent.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dvsUpgradedEvent.ProductInfo))));\n        }\n\n        public override bool Equals(object dvsUpgradedEvent)\n        {\n            return Equals(dvsUpgradedEvent as DvsUpgradedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProductInfo).GetHashCode();\n        }\n    }\n\n    public class DvsUpgradeInProgressEvent : DvsEvent, IEquatable<DvsUpgradeInProgressEvent>\n    {\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public bool Equals(DvsUpgradeInProgressEvent dvsUpgradeInProgressEvent)\n        {\n            return (dvsUpgradeInProgressEvent != null && ((this.ProductInfo == null && dvsUpgradeInProgressEvent.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dvsUpgradeInProgressEvent.ProductInfo))));\n        }\n\n        public override bool Equals(object dvsUpgradeInProgressEvent)\n        {\n            return Equals(dvsUpgradeInProgressEvent as DvsUpgradeInProgressEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProductInfo).GetHashCode();\n        }\n    }\n\n    public class DvsUpgradeRejectedEvent : DvsEvent, IEquatable<DvsUpgradeRejectedEvent>\n    {\n        public DistributedVirtualSwitchProductSpec ProductInfo { get; set; }\n\n        public bool Equals(DvsUpgradeRejectedEvent dvsUpgradeRejectedEvent)\n        {\n            return (dvsUpgradeRejectedEvent != null && ((this.ProductInfo == null && dvsUpgradeRejectedEvent.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(dvsUpgradeRejectedEvent.ProductInfo))));\n        }\n\n        public override bool Equals(object dvsUpgradeRejectedEvent)\n        {\n            return Equals(dvsUpgradeRejectedEvent as DvsUpgradeRejectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProductInfo).GetHashCode();\n        }\n    }\n\n    public class DVSUplinkPortPolicy : DynamicData, IEquatable<DVSUplinkPortPolicy>\n    {\n        public bool Equals(DVSUplinkPortPolicy dVSUplinkPortPolicy)\n        {\n            return (dVSUplinkPortPolicy != null && base.Equals(dVSUplinkPortPolicy));\n        }\n\n        public override bool Equals(object dVSUplinkPortPolicy)\n        {\n            return Equals(dVSUplinkPortPolicy as DVSUplinkPortPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DVSVendorSpecificConfig : InheritablePolicy, IEquatable<DVSVendorSpecificConfig>\n    {\n        public DistributedVirtualSwitchKeyedOpaqueBlob[] KeyValue { get; set; }\n\n        public bool Equals(DVSVendorSpecificConfig dVSVendorSpecificConfig)\n        {\n            return (dVSVendorSpecificConfig != null && ((this.KeyValue == null && dVSVendorSpecificConfig.KeyValue == null) || (this.KeyValue != null && dVSVendorSpecificConfig.KeyValue != null && Enumerable.SequenceEqual(this.KeyValue, dVSVendorSpecificConfig.KeyValue))));\n        }\n\n        public override bool Equals(object dVSVendorSpecificConfig)\n        {\n            return Equals(dVSVendorSpecificConfig as DVSVendorSpecificConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyValue).GetHashCode();\n        }\n    }\n\n    public class DVSVmVnicNetworkResourcePool : DynamicData, IEquatable<DVSVmVnicNetworkResourcePool>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DvsVmVnicResourceAllocation AllocationInfo { get; set; }\n\n        public bool Equals(DVSVmVnicNetworkResourcePool dVSVmVnicNetworkResourcePool)\n        {\n            return (dVSVmVnicNetworkResourcePool != null && this.Key == dVSVmVnicNetworkResourcePool.Key && this.Name == dVSVmVnicNetworkResourcePool.Name && this.Description == dVSVmVnicNetworkResourcePool.Description && this.ConfigVersion == dVSVmVnicNetworkResourcePool.ConfigVersion && ((this.AllocationInfo == null && dVSVmVnicNetworkResourcePool.AllocationInfo == null) || (this.AllocationInfo != null && this.AllocationInfo.Equals(dVSVmVnicNetworkResourcePool.AllocationInfo))));\n        }\n\n        public override bool Equals(object dVSVmVnicNetworkResourcePool)\n        {\n            return Equals(dVSVmVnicNetworkResourcePool as DVSVmVnicNetworkResourcePool);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Description + \"_\" + ConfigVersion + \"_\" + AllocationInfo).GetHashCode();\n        }\n    }\n\n    public class DvsVmVnicNetworkResourcePoolRuntimeInfo : DynamicData, IEquatable<DvsVmVnicNetworkResourcePoolRuntimeInfo>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public int? Capacity { get; set; }\n\n        public int? Usage { get; set; }\n\n        public int? Available { get; set; }\n\n        public string Status { get; set; }\n\n        public DvsVnicAllocatedResource[] AllocatedResource { get; set; }\n\n        public bool Equals(DvsVmVnicNetworkResourcePoolRuntimeInfo dvsVmVnicNetworkResourcePoolRuntimeInfo)\n        {\n            return (dvsVmVnicNetworkResourcePoolRuntimeInfo != null && this.Key == dvsVmVnicNetworkResourcePoolRuntimeInfo.Key && this.Name == dvsVmVnicNetworkResourcePoolRuntimeInfo.Name && ((this.Capacity == null && dvsVmVnicNetworkResourcePoolRuntimeInfo.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(dvsVmVnicNetworkResourcePoolRuntimeInfo.Capacity))) && ((this.Usage == null && dvsVmVnicNetworkResourcePoolRuntimeInfo.Usage == null) || (this.Usage != null && this.Usage.Equals(dvsVmVnicNetworkResourcePoolRuntimeInfo.Usage))) && ((this.Available == null && dvsVmVnicNetworkResourcePoolRuntimeInfo.Available == null) || (this.Available != null && this.Available.Equals(dvsVmVnicNetworkResourcePoolRuntimeInfo.Available))) && this.Status == dvsVmVnicNetworkResourcePoolRuntimeInfo.Status && ((this.AllocatedResource == null && dvsVmVnicNetworkResourcePoolRuntimeInfo.AllocatedResource == null) || (this.AllocatedResource != null && dvsVmVnicNetworkResourcePoolRuntimeInfo.AllocatedResource != null && Enumerable.SequenceEqual(this.AllocatedResource, dvsVmVnicNetworkResourcePoolRuntimeInfo.AllocatedResource))));\n        }\n\n        public override bool Equals(object dvsVmVnicNetworkResourcePoolRuntimeInfo)\n        {\n            return Equals(dvsVmVnicNetworkResourcePoolRuntimeInfo as DvsVmVnicNetworkResourcePoolRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Capacity + \"_\" + Usage + \"_\" + Available + \"_\" + Status + \"_\" + AllocatedResource).GetHashCode();\n        }\n    }\n\n    public class DvsVmVnicResourceAllocation : DynamicData, IEquatable<DvsVmVnicResourceAllocation>\n    {\n        public long? ReservationQuota { get; set; }\n\n        public bool Equals(DvsVmVnicResourceAllocation dvsVmVnicResourceAllocation)\n        {\n            return (dvsVmVnicResourceAllocation != null && ((this.ReservationQuota == null && dvsVmVnicResourceAllocation.ReservationQuota == null) || (this.ReservationQuota != null && this.ReservationQuota.Equals(dvsVmVnicResourceAllocation.ReservationQuota))));\n        }\n\n        public override bool Equals(object dvsVmVnicResourceAllocation)\n        {\n            return Equals(dvsVmVnicResourceAllocation as DvsVmVnicResourceAllocation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReservationQuota).GetHashCode();\n        }\n    }\n\n    public class DvsVmVnicResourcePoolConfigSpec : DynamicData, IEquatable<DvsVmVnicResourcePoolConfigSpec>\n    {\n        public string Operation { get; set; }\n\n        public string Key { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public DvsVmVnicResourceAllocation AllocationInfo { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(DvsVmVnicResourcePoolConfigSpec dvsVmVnicResourcePoolConfigSpec)\n        {\n            return (dvsVmVnicResourcePoolConfigSpec != null && this.Operation == dvsVmVnicResourcePoolConfigSpec.Operation && this.Key == dvsVmVnicResourcePoolConfigSpec.Key && this.ConfigVersion == dvsVmVnicResourcePoolConfigSpec.ConfigVersion && ((this.AllocationInfo == null && dvsVmVnicResourcePoolConfigSpec.AllocationInfo == null) || (this.AllocationInfo != null && this.AllocationInfo.Equals(dvsVmVnicResourcePoolConfigSpec.AllocationInfo))) && this.Name == dvsVmVnicResourcePoolConfigSpec.Name && this.Description == dvsVmVnicResourcePoolConfigSpec.Description);\n        }\n\n        public override bool Equals(object dvsVmVnicResourcePoolConfigSpec)\n        {\n            return Equals(dvsVmVnicResourcePoolConfigSpec as DvsVmVnicResourcePoolConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + Key + \"_\" + ConfigVersion + \"_\" + AllocationInfo + \"_\" + Name + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class DvsVnicAllocatedResource : DynamicData, IEquatable<DvsVnicAllocatedResource>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VnicKey { get; set; }\n\n        public long? Reservation { get; set; }\n\n        public DvsVnicAllocatedResource_LinkedView LinkedView { get; set; }\n\n        public bool Equals(DvsVnicAllocatedResource dvsVnicAllocatedResource)\n        {\n            return (dvsVnicAllocatedResource != null && ((this.Vm == null && dvsVnicAllocatedResource.Vm == null) || (this.Vm != null && this.Vm.Equals(dvsVnicAllocatedResource.Vm))) && this.VnicKey == dvsVnicAllocatedResource.VnicKey && ((this.Reservation == null && dvsVnicAllocatedResource.Reservation == null) || (this.Reservation != null && this.Reservation.Equals(dvsVnicAllocatedResource.Reservation))) && ((this.LinkedView == null && dvsVnicAllocatedResource.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(dvsVnicAllocatedResource.LinkedView))));\n        }\n\n        public override bool Equals(object dvsVnicAllocatedResource)\n        {\n            return Equals(dvsVnicAllocatedResource as DvsVnicAllocatedResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VnicKey + \"_\" + Reservation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class DvsVnicAllocatedResource_LinkedView : IEquatable<DvsVnicAllocatedResource_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(DvsVnicAllocatedResource_LinkedView dvsVnicAllocatedResource_LinkedView)\n        {\n            return (dvsVnicAllocatedResource_LinkedView != null && ((this.Vm == null && dvsVnicAllocatedResource_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(dvsVnicAllocatedResource_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object dvsVnicAllocatedResource_LinkedView)\n        {\n            return Equals(dvsVnicAllocatedResource_LinkedView as DvsVnicAllocatedResource_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class DvsVNicProfile : ApplyProfile, IEquatable<DvsVNicProfile>\n    {\n        public string Key { get; set; }\n\n        public IpAddressProfile IpConfig { get; set; }\n\n        public bool Equals(DvsVNicProfile dvsVNicProfile)\n        {\n            return (dvsVNicProfile != null && this.Key == dvsVNicProfile.Key && ((this.IpConfig == null && dvsVNicProfile.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(dvsVNicProfile.IpConfig))));\n        }\n\n        public override bool Equals(object dvsVNicProfile)\n        {\n            return Equals(dvsVNicProfile as DvsVNicProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + IpConfig).GetHashCode();\n        }\n    }\n\n    public class DynamicArray : IEquatable<DynamicArray>\n    {\n        public object[] Val { get; set; }\n\n        public bool Equals(DynamicArray dynamicArray)\n        {\n            return (dynamicArray != null && ((this.Val == null && dynamicArray.Val == null) || (this.Val != null && dynamicArray.Val != null && Enumerable.SequenceEqual(this.Val, dynamicArray.Val))));\n        }\n\n        public override bool Equals(object dynamicArray)\n        {\n            return Equals(dynamicArray as DynamicArray);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Val).GetHashCode();\n        }\n    }\n\n    public class DynamicData : IEquatable<DynamicData>\n    {\n        public bool Equals(DynamicData dynamicData)\n        {\n            return (dynamicData != null);\n        }\n\n        public override bool Equals(object dynamicData)\n        {\n            return Equals(dynamicData as DynamicData);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class DynamicProperty : IEquatable<DynamicProperty>\n    {\n        public string Name { get; set; }\n\n        public object Val { get; set; }\n\n        public bool Equals(DynamicProperty dynamicProperty)\n        {\n            return (dynamicProperty != null && this.Name == dynamicProperty.Name && ((this.Val == null && dynamicProperty.Val == null) || (this.Val != null && this.Val.Equals(dynamicProperty.Val))));\n        }\n\n        public override bool Equals(object dynamicProperty)\n        {\n            return Equals(dynamicProperty as DynamicProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Val).GetHashCode();\n        }\n    }\n\n    public class EightHostLimitViolated : VmConfigFault, IEquatable<EightHostLimitViolated>\n    {\n        public bool Equals(EightHostLimitViolated eightHostLimitViolated)\n        {\n            return (eightHostLimitViolated != null && base.Equals(eightHostLimitViolated));\n        }\n\n        public override bool Equals(object eightHostLimitViolated)\n        {\n            return Equals(eightHostLimitViolated as EightHostLimitViolated);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ElementDescription : Description, IEquatable<ElementDescription>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(ElementDescription elementDescription)\n        {\n            return (elementDescription != null && this.Key == elementDescription.Key);\n        }\n\n        public override bool Equals(object elementDescription)\n        {\n            return Equals(elementDescription as ElementDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class EncryptionKeyRequired : InvalidState, IEquatable<EncryptionKeyRequired>\n    {\n        public CryptoKeyId[] RequiredKey { get; set; }\n\n        public bool Equals(EncryptionKeyRequired encryptionKeyRequired)\n        {\n            return (encryptionKeyRequired != null && ((this.RequiredKey == null && encryptionKeyRequired.RequiredKey == null) || (this.RequiredKey != null && encryptionKeyRequired.RequiredKey != null && Enumerable.SequenceEqual(this.RequiredKey, encryptionKeyRequired.RequiredKey))));\n        }\n\n        public override bool Equals(object encryptionKeyRequired)\n        {\n            return Equals(encryptionKeyRequired as EncryptionKeyRequired);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RequiredKey).GetHashCode();\n        }\n    }\n\n    public class EnteredMaintenanceModeEvent : HostEvent, IEquatable<EnteredMaintenanceModeEvent>\n    {\n        public bool Equals(EnteredMaintenanceModeEvent enteredMaintenanceModeEvent)\n        {\n            return (enteredMaintenanceModeEvent != null && base.Equals(enteredMaintenanceModeEvent));\n        }\n\n        public override bool Equals(object enteredMaintenanceModeEvent)\n        {\n            return Equals(enteredMaintenanceModeEvent as EnteredMaintenanceModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EnteredStandbyModeEvent : HostEvent, IEquatable<EnteredStandbyModeEvent>\n    {\n        public bool Equals(EnteredStandbyModeEvent enteredStandbyModeEvent)\n        {\n            return (enteredStandbyModeEvent != null && base.Equals(enteredStandbyModeEvent));\n        }\n\n        public override bool Equals(object enteredStandbyModeEvent)\n        {\n            return Equals(enteredStandbyModeEvent as EnteredStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EnteringMaintenanceModeEvent : HostEvent, IEquatable<EnteringMaintenanceModeEvent>\n    {\n        public bool Equals(EnteringMaintenanceModeEvent enteringMaintenanceModeEvent)\n        {\n            return (enteringMaintenanceModeEvent != null && base.Equals(enteringMaintenanceModeEvent));\n        }\n\n        public override bool Equals(object enteringMaintenanceModeEvent)\n        {\n            return Equals(enteringMaintenanceModeEvent as EnteringMaintenanceModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EnteringStandbyModeEvent : HostEvent, IEquatable<EnteringStandbyModeEvent>\n    {\n        public bool Equals(EnteringStandbyModeEvent enteringStandbyModeEvent)\n        {\n            return (enteringStandbyModeEvent != null && base.Equals(enteringStandbyModeEvent));\n        }\n\n        public override bool Equals(object enteringStandbyModeEvent)\n        {\n            return Equals(enteringStandbyModeEvent as EnteringStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EntityBackup : DynamicData, IEquatable<EntityBackup>\n    {\n        public bool Equals(EntityBackup entityBackup)\n        {\n            return (entityBackup != null && base.Equals(entityBackup));\n        }\n\n        public override bool Equals(object entityBackup)\n        {\n            return Equals(entityBackup as EntityBackup);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EntityBackupConfig : DynamicData, IEquatable<EntityBackupConfig>\n    {\n        public string EntityType { get; set; }\n\n        public byte[] ConfigBlob { get; set; }\n\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public ManagedObjectReference Container { get; set; }\n\n        public string ConfigVersion { get; set; }\n\n        public EntityBackupConfig_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EntityBackupConfig entityBackupConfig)\n        {\n            return (entityBackupConfig != null && this.EntityType == entityBackupConfig.EntityType && ((this.ConfigBlob == null && entityBackupConfig.ConfigBlob == null) || (this.ConfigBlob != null && entityBackupConfig.ConfigBlob != null && Enumerable.SequenceEqual(this.ConfigBlob, entityBackupConfig.ConfigBlob))) && this.Key == entityBackupConfig.Key && this.Name == entityBackupConfig.Name && ((this.Container == null && entityBackupConfig.Container == null) || (this.Container != null && this.Container.Equals(entityBackupConfig.Container))) && this.ConfigVersion == entityBackupConfig.ConfigVersion && ((this.LinkedView == null && entityBackupConfig.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(entityBackupConfig.LinkedView))));\n        }\n\n        public override bool Equals(object entityBackupConfig)\n        {\n            return Equals(entityBackupConfig as EntityBackupConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityType + \"_\" + ConfigBlob + \"_\" + Key + \"_\" + Name + \"_\" + Container + \"_\" + ConfigVersion + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EntityBackupConfig_LinkedView : IEquatable<EntityBackupConfig_LinkedView>\n    {\n        public ManagedEntity Container { get; set; }\n\n        public bool Equals(EntityBackupConfig_LinkedView entityBackupConfig_LinkedView)\n        {\n            return (entityBackupConfig_LinkedView != null && ((this.Container == null && entityBackupConfig_LinkedView.Container == null) || (this.Container != null && this.Container.Equals(entityBackupConfig_LinkedView.Container))));\n        }\n\n        public override bool Equals(object entityBackupConfig_LinkedView)\n        {\n            return Equals(entityBackupConfig_LinkedView as EntityBackupConfig_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Container).GetHashCode();\n        }\n    }\n\n    public class EntityEventArgument : EventArgument, IEquatable<EntityEventArgument>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(EntityEventArgument entityEventArgument)\n        {\n            return (entityEventArgument != null && this.Name == entityEventArgument.Name);\n        }\n\n        public override bool Equals(object entityEventArgument)\n        {\n            return Equals(entityEventArgument as EntityEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class EntityPrivilege : DynamicData, IEquatable<EntityPrivilege>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public PrivilegeAvailability[] PrivAvailability { get; set; }\n\n        public EntityPrivilege_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EntityPrivilege entityPrivilege)\n        {\n            return (entityPrivilege != null && ((this.Entity == null && entityPrivilege.Entity == null) || (this.Entity != null && this.Entity.Equals(entityPrivilege.Entity))) && ((this.PrivAvailability == null && entityPrivilege.PrivAvailability == null) || (this.PrivAvailability != null && entityPrivilege.PrivAvailability != null && Enumerable.SequenceEqual(this.PrivAvailability, entityPrivilege.PrivAvailability))) && ((this.LinkedView == null && entityPrivilege.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(entityPrivilege.LinkedView))));\n        }\n\n        public override bool Equals(object entityPrivilege)\n        {\n            return Equals(entityPrivilege as EntityPrivilege);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + PrivAvailability + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EntityPrivilege_LinkedView : IEquatable<EntityPrivilege_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(EntityPrivilege_LinkedView entityPrivilege_LinkedView)\n        {\n            return (entityPrivilege_LinkedView != null && ((this.Entity == null && entityPrivilege_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(entityPrivilege_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object entityPrivilege_LinkedView)\n        {\n            return Equals(entityPrivilege_LinkedView as EntityPrivilege_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class EntityViewBase : ExtensibleManagedObject, IEquatable<EntityViewBase>\n    {\n        public TaskHistoryCollector GetTaskCollectorView(TaskFilterSpecRecursionOption recursionOption, TaskFilterSpec taskFilterSpec)\n        {\n            return default(TaskHistoryCollector);\n        }\n\n        public TaskHistoryCollector GetEntityOnlyTasksCollectorView(TaskFilterSpec taskFilterSpec)\n        {\n            return default(TaskHistoryCollector);\n        }\n\n        public TaskHistoryCollector GetAllTasksView(TaskFilterSpec taskFilterSpec)\n        {\n            return default(TaskHistoryCollector);\n        }\n\n        public EventHistoryCollector GetEventCollectorView(EventFilterSpecRecursionOption recursionOption, EventFilterSpec eventFilterSpec)\n        {\n            return default(EventHistoryCollector);\n        }\n\n        public EventHistoryCollector GetEntityOnlyEventsCollectorView(EventFilterSpec eventFilterSpec)\n        {\n            return default(EventHistoryCollector);\n        }\n\n        public EventHistoryCollector GetAllEventsView(EventFilterSpec eventFilterSpec)\n        {\n            return default(EventHistoryCollector);\n        }\n\n        public bool Equals(EntityViewBase entityViewBase)\n        {\n            return (entityViewBase != null && base.Equals(entityViewBase));\n        }\n\n        public override bool Equals(object entityViewBase)\n        {\n            return Equals(entityViewBase as EntityViewBase);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EnumDescription : DynamicData, IEquatable<EnumDescription>\n    {\n        public string Key { get; set; }\n\n        public ElementDescription[] Tags { get; set; }\n\n        public bool Equals(EnumDescription enumDescription)\n        {\n            return (enumDescription != null && this.Key == enumDescription.Key && ((this.Tags == null && enumDescription.Tags == null) || (this.Tags != null && enumDescription.Tags != null && Enumerable.SequenceEqual(this.Tags, enumDescription.Tags))));\n        }\n\n        public override bool Equals(object enumDescription)\n        {\n            return Equals(enumDescription as EnumDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Tags).GetHashCode();\n        }\n    }\n\n    public class EnvironmentBrowser : ViewBase, IEquatable<EnvironmentBrowser>\n    {\n        public ManagedObjectReference DatastoreBrowser { get; set; }\n\n        public EnvironmentBrowser_LinkedView LinkedView { get; set; }\n\n        public VirtualMachineConfigOptionDescriptor[] QueryConfigOptionDescriptor()\n        {\n            return default(VirtualMachineConfigOptionDescriptor[]);\n        }\n\n        public VirtualMachineConfigOption QueryConfigOption(string key, ManagedObjectReference host)\n        {\n            return default(VirtualMachineConfigOption);\n        }\n\n        public VirtualMachineConfigOption QueryConfigOptionEx(EnvironmentBrowserConfigOptionQuerySpec spec)\n        {\n            return default(VirtualMachineConfigOption);\n        }\n\n        public ConfigTarget QueryConfigTarget(ManagedObjectReference host)\n        {\n            return default(ConfigTarget);\n        }\n\n        public HostCapability QueryTargetCapabilities(ManagedObjectReference host)\n        {\n            return default(HostCapability);\n        }\n\n        public bool Equals(EnvironmentBrowser environmentBrowser)\n        {\n            return (environmentBrowser != null && ((this.DatastoreBrowser == null && environmentBrowser.DatastoreBrowser == null) || (this.DatastoreBrowser != null && this.DatastoreBrowser.Equals(environmentBrowser.DatastoreBrowser))) && ((this.LinkedView == null && environmentBrowser.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(environmentBrowser.LinkedView))));\n        }\n\n        public override bool Equals(object environmentBrowser)\n        {\n            return Equals(environmentBrowser as EnvironmentBrowser);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreBrowser + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EnvironmentBrowser_LinkedView : IEquatable<EnvironmentBrowser_LinkedView>\n    {\n        public HostDatastoreBrowser DatastoreBrowser { get; set; }\n\n        public bool Equals(EnvironmentBrowser_LinkedView environmentBrowser_LinkedView)\n        {\n            return (environmentBrowser_LinkedView != null && ((this.DatastoreBrowser == null && environmentBrowser_LinkedView.DatastoreBrowser == null) || (this.DatastoreBrowser != null && this.DatastoreBrowser.Equals(environmentBrowser_LinkedView.DatastoreBrowser))));\n        }\n\n        public override bool Equals(object environmentBrowser_LinkedView)\n        {\n            return Equals(environmentBrowser_LinkedView as EnvironmentBrowser_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreBrowser).GetHashCode();\n        }\n    }\n\n    public class EnvironmentBrowserConfigOptionQuerySpec : DynamicData, IEquatable<EnvironmentBrowserConfigOptionQuerySpec>\n    {\n        public string Key { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public string[] GuestId { get; set; }\n\n        public EnvironmentBrowserConfigOptionQuerySpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EnvironmentBrowserConfigOptionQuerySpec environmentBrowserConfigOptionQuerySpec)\n        {\n            return (environmentBrowserConfigOptionQuerySpec != null && this.Key == environmentBrowserConfigOptionQuerySpec.Key && ((this.Host == null && environmentBrowserConfigOptionQuerySpec.Host == null) || (this.Host != null && this.Host.Equals(environmentBrowserConfigOptionQuerySpec.Host))) && ((this.GuestId == null && environmentBrowserConfigOptionQuerySpec.GuestId == null) || (this.GuestId != null && environmentBrowserConfigOptionQuerySpec.GuestId != null && Enumerable.SequenceEqual(this.GuestId, environmentBrowserConfigOptionQuerySpec.GuestId))) && ((this.LinkedView == null && environmentBrowserConfigOptionQuerySpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(environmentBrowserConfigOptionQuerySpec.LinkedView))));\n        }\n\n        public override bool Equals(object environmentBrowserConfigOptionQuerySpec)\n        {\n            return Equals(environmentBrowserConfigOptionQuerySpec as EnvironmentBrowserConfigOptionQuerySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Host + \"_\" + GuestId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EnvironmentBrowserConfigOptionQuerySpec_LinkedView : IEquatable<EnvironmentBrowserConfigOptionQuerySpec_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(EnvironmentBrowserConfigOptionQuerySpec_LinkedView environmentBrowserConfigOptionQuerySpec_LinkedView)\n        {\n            return (environmentBrowserConfigOptionQuerySpec_LinkedView != null && ((this.Host == null && environmentBrowserConfigOptionQuerySpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(environmentBrowserConfigOptionQuerySpec_LinkedView.Host))));\n        }\n\n        public override bool Equals(object environmentBrowserConfigOptionQuerySpec_LinkedView)\n        {\n            return Equals(environmentBrowserConfigOptionQuerySpec_LinkedView as EnvironmentBrowserConfigOptionQuerySpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class ErrorUpgradeEvent : UpgradeEvent, IEquatable<ErrorUpgradeEvent>\n    {\n        public bool Equals(ErrorUpgradeEvent errorUpgradeEvent)\n        {\n            return (errorUpgradeEvent != null && base.Equals(errorUpgradeEvent));\n        }\n\n        public override bool Equals(object errorUpgradeEvent)\n        {\n            return Equals(errorUpgradeEvent as ErrorUpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EvaluationLicenseSource : LicenseSource, IEquatable<EvaluationLicenseSource>\n    {\n        public long? RemainingHours { get; set; }\n\n        public bool Equals(EvaluationLicenseSource evaluationLicenseSource)\n        {\n            return (evaluationLicenseSource != null && ((this.RemainingHours == null && evaluationLicenseSource.RemainingHours == null) || (this.RemainingHours != null && this.RemainingHours.Equals(evaluationLicenseSource.RemainingHours))));\n        }\n\n        public override bool Equals(object evaluationLicenseSource)\n        {\n            return Equals(evaluationLicenseSource as EvaluationLicenseSource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemainingHours).GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailed : NotSupportedHostInCluster, IEquatable<EVCAdmissionFailed>\n    {\n        public LocalizedMethodFault[] Faults { get; set; }\n\n        public bool Equals(EVCAdmissionFailed eVCAdmissionFailed)\n        {\n            return (eVCAdmissionFailed != null && ((this.Faults == null && eVCAdmissionFailed.Faults == null) || (this.Faults != null && eVCAdmissionFailed.Faults != null && Enumerable.SequenceEqual(this.Faults, eVCAdmissionFailed.Faults))));\n        }\n\n        public override bool Equals(object eVCAdmissionFailed)\n        {\n            return Equals(eVCAdmissionFailed as EVCAdmissionFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Faults).GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedCPUFeaturesForMode : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedCPUFeaturesForMode>\n    {\n        public string CurrentEVCModeKey { get; set; }\n\n        public bool Equals(EVCAdmissionFailedCPUFeaturesForMode eVCAdmissionFailedCPUFeaturesForMode)\n        {\n            return (eVCAdmissionFailedCPUFeaturesForMode != null && this.CurrentEVCModeKey == eVCAdmissionFailedCPUFeaturesForMode.CurrentEVCModeKey);\n        }\n\n        public override bool Equals(object eVCAdmissionFailedCPUFeaturesForMode)\n        {\n            return Equals(eVCAdmissionFailedCPUFeaturesForMode as EVCAdmissionFailedCPUFeaturesForMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentEVCModeKey).GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedCPUModel : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedCPUModel>\n    {\n        public bool Equals(EVCAdmissionFailedCPUModel eVCAdmissionFailedCPUModel)\n        {\n            return (eVCAdmissionFailedCPUModel != null && base.Equals(eVCAdmissionFailedCPUModel));\n        }\n\n        public override bool Equals(object eVCAdmissionFailedCPUModel)\n        {\n            return Equals(eVCAdmissionFailedCPUModel as EVCAdmissionFailedCPUModel);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedCPUModelForMode : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedCPUModelForMode>\n    {\n        public string CurrentEVCModeKey { get; set; }\n\n        public bool Equals(EVCAdmissionFailedCPUModelForMode eVCAdmissionFailedCPUModelForMode)\n        {\n            return (eVCAdmissionFailedCPUModelForMode != null && this.CurrentEVCModeKey == eVCAdmissionFailedCPUModelForMode.CurrentEVCModeKey);\n        }\n\n        public override bool Equals(object eVCAdmissionFailedCPUModelForMode)\n        {\n            return Equals(eVCAdmissionFailedCPUModelForMode as EVCAdmissionFailedCPUModelForMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentEVCModeKey).GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedCPUVendor : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedCPUVendor>\n    {\n        public string ClusterCPUVendor { get; set; }\n\n        public string HostCPUVendor { get; set; }\n\n        public bool Equals(EVCAdmissionFailedCPUVendor eVCAdmissionFailedCPUVendor)\n        {\n            return (eVCAdmissionFailedCPUVendor != null && this.ClusterCPUVendor == eVCAdmissionFailedCPUVendor.ClusterCPUVendor && this.HostCPUVendor == eVCAdmissionFailedCPUVendor.HostCPUVendor);\n        }\n\n        public override bool Equals(object eVCAdmissionFailedCPUVendor)\n        {\n            return Equals(eVCAdmissionFailedCPUVendor as EVCAdmissionFailedCPUVendor);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterCPUVendor + \"_\" + HostCPUVendor).GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedCPUVendorUnknown : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedCPUVendorUnknown>\n    {\n        public bool Equals(EVCAdmissionFailedCPUVendorUnknown eVCAdmissionFailedCPUVendorUnknown)\n        {\n            return (eVCAdmissionFailedCPUVendorUnknown != null && base.Equals(eVCAdmissionFailedCPUVendorUnknown));\n        }\n\n        public override bool Equals(object eVCAdmissionFailedCPUVendorUnknown)\n        {\n            return Equals(eVCAdmissionFailedCPUVendorUnknown as EVCAdmissionFailedCPUVendorUnknown);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedHostDisconnected : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedHostDisconnected>\n    {\n        public bool Equals(EVCAdmissionFailedHostDisconnected eVCAdmissionFailedHostDisconnected)\n        {\n            return (eVCAdmissionFailedHostDisconnected != null && base.Equals(eVCAdmissionFailedHostDisconnected));\n        }\n\n        public override bool Equals(object eVCAdmissionFailedHostDisconnected)\n        {\n            return Equals(eVCAdmissionFailedHostDisconnected as EVCAdmissionFailedHostDisconnected);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedHostSoftware : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedHostSoftware>\n    {\n        public bool Equals(EVCAdmissionFailedHostSoftware eVCAdmissionFailedHostSoftware)\n        {\n            return (eVCAdmissionFailedHostSoftware != null && base.Equals(eVCAdmissionFailedHostSoftware));\n        }\n\n        public override bool Equals(object eVCAdmissionFailedHostSoftware)\n        {\n            return Equals(eVCAdmissionFailedHostSoftware as EVCAdmissionFailedHostSoftware);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedHostSoftwareForMode : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedHostSoftwareForMode>\n    {\n        public bool Equals(EVCAdmissionFailedHostSoftwareForMode eVCAdmissionFailedHostSoftwareForMode)\n        {\n            return (eVCAdmissionFailedHostSoftwareForMode != null && base.Equals(eVCAdmissionFailedHostSoftwareForMode));\n        }\n\n        public override bool Equals(object eVCAdmissionFailedHostSoftwareForMode)\n        {\n            return Equals(eVCAdmissionFailedHostSoftwareForMode as EVCAdmissionFailedHostSoftwareForMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EVCAdmissionFailedVmActive : EVCAdmissionFailed, IEquatable<EVCAdmissionFailedVmActive>\n    {\n        public bool Equals(EVCAdmissionFailedVmActive eVCAdmissionFailedVmActive)\n        {\n            return (eVCAdmissionFailedVmActive != null && base.Equals(eVCAdmissionFailedVmActive));\n        }\n\n        public override bool Equals(object eVCAdmissionFailedVmActive)\n        {\n            return Equals(eVCAdmissionFailedVmActive as EVCAdmissionFailedVmActive);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EVCConfigFault : VimFault, IEquatable<EVCConfigFault>\n    {\n        public LocalizedMethodFault[] Faults { get; set; }\n\n        public bool Equals(EVCConfigFault eVCConfigFault)\n        {\n            return (eVCConfigFault != null && ((this.Faults == null && eVCConfigFault.Faults == null) || (this.Faults != null && eVCConfigFault.Faults != null && Enumerable.SequenceEqual(this.Faults, eVCConfigFault.Faults))));\n        }\n\n        public override bool Equals(object eVCConfigFault)\n        {\n            return Equals(eVCConfigFault as EVCConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Faults).GetHashCode();\n        }\n    }\n\n    public class EVCMode : ElementDescription, IEquatable<EVCMode>\n    {\n        public HostCpuIdInfo[] GuaranteedCPUFeatures { get; set; }\n\n        public HostFeatureCapability[] FeatureCapability { get; set; }\n\n        public HostFeatureMask[] FeatureMask { get; set; }\n\n        public VirtualMachineFeatureRequirement[] FeatureRequirement { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string[] Track { get; set; }\n\n        public int VendorTier { get; set; }\n\n        public bool Equals(EVCMode eVCMode)\n        {\n            return (eVCMode != null && ((this.GuaranteedCPUFeatures == null && eVCMode.GuaranteedCPUFeatures == null) || (this.GuaranteedCPUFeatures != null && eVCMode.GuaranteedCPUFeatures != null && Enumerable.SequenceEqual(this.GuaranteedCPUFeatures, eVCMode.GuaranteedCPUFeatures))) && ((this.FeatureCapability == null && eVCMode.FeatureCapability == null) || (this.FeatureCapability != null && eVCMode.FeatureCapability != null && Enumerable.SequenceEqual(this.FeatureCapability, eVCMode.FeatureCapability))) && ((this.FeatureMask == null && eVCMode.FeatureMask == null) || (this.FeatureMask != null && eVCMode.FeatureMask != null && Enumerable.SequenceEqual(this.FeatureMask, eVCMode.FeatureMask))) && ((this.FeatureRequirement == null && eVCMode.FeatureRequirement == null) || (this.FeatureRequirement != null && eVCMode.FeatureRequirement != null && Enumerable.SequenceEqual(this.FeatureRequirement, eVCMode.FeatureRequirement))) && this.Vendor == eVCMode.Vendor && ((this.Track == null && eVCMode.Track == null) || (this.Track != null && eVCMode.Track != null && Enumerable.SequenceEqual(this.Track, eVCMode.Track))) && this.VendorTier == eVCMode.VendorTier);\n        }\n\n        public override bool Equals(object eVCMode)\n        {\n            return Equals(eVCMode as EVCMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GuaranteedCPUFeatures + \"_\" + FeatureCapability + \"_\" + FeatureMask + \"_\" + FeatureRequirement + \"_\" + Vendor + \"_\" + Track + \"_\" + VendorTier).GetHashCode();\n        }\n    }\n\n    public class EVCModeIllegalByVendor : EVCConfigFault, IEquatable<EVCModeIllegalByVendor>\n    {\n        public string ClusterCPUVendor { get; set; }\n\n        public string ModeCPUVendor { get; set; }\n\n        public bool Equals(EVCModeIllegalByVendor eVCModeIllegalByVendor)\n        {\n            return (eVCModeIllegalByVendor != null && this.ClusterCPUVendor == eVCModeIllegalByVendor.ClusterCPUVendor && this.ModeCPUVendor == eVCModeIllegalByVendor.ModeCPUVendor);\n        }\n\n        public override bool Equals(object eVCModeIllegalByVendor)\n        {\n            return Equals(eVCModeIllegalByVendor as EVCModeIllegalByVendor);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterCPUVendor + \"_\" + ModeCPUVendor).GetHashCode();\n        }\n    }\n\n    public class EVCModeUnsupportedByHosts : EVCConfigFault, IEquatable<EVCModeUnsupportedByHosts>\n    {\n        public string EvcMode { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public string[] HostName { get; set; }\n\n        public EVCModeUnsupportedByHosts_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EVCModeUnsupportedByHosts eVCModeUnsupportedByHosts)\n        {\n            return (eVCModeUnsupportedByHosts != null && this.EvcMode == eVCModeUnsupportedByHosts.EvcMode && ((this.Host == null && eVCModeUnsupportedByHosts.Host == null) || (this.Host != null && eVCModeUnsupportedByHosts.Host != null && Enumerable.SequenceEqual(this.Host, eVCModeUnsupportedByHosts.Host))) && ((this.HostName == null && eVCModeUnsupportedByHosts.HostName == null) || (this.HostName != null && eVCModeUnsupportedByHosts.HostName != null && Enumerable.SequenceEqual(this.HostName, eVCModeUnsupportedByHosts.HostName))) && ((this.LinkedView == null && eVCModeUnsupportedByHosts.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(eVCModeUnsupportedByHosts.LinkedView))));\n        }\n\n        public override bool Equals(object eVCModeUnsupportedByHosts)\n        {\n            return Equals(eVCModeUnsupportedByHosts as EVCModeUnsupportedByHosts);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EvcMode + \"_\" + Host + \"_\" + HostName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EVCModeUnsupportedByHosts_LinkedView : IEquatable<EVCModeUnsupportedByHosts_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(EVCModeUnsupportedByHosts_LinkedView eVCModeUnsupportedByHosts_LinkedView)\n        {\n            return (eVCModeUnsupportedByHosts_LinkedView != null && ((this.Host == null && eVCModeUnsupportedByHosts_LinkedView.Host == null) || (this.Host != null && eVCModeUnsupportedByHosts_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, eVCModeUnsupportedByHosts_LinkedView.Host))));\n        }\n\n        public override bool Equals(object eVCModeUnsupportedByHosts_LinkedView)\n        {\n            return Equals(eVCModeUnsupportedByHosts_LinkedView as EVCModeUnsupportedByHosts_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class EVCUnsupportedByHostHardware : EVCConfigFault, IEquatable<EVCUnsupportedByHostHardware>\n    {\n        public ManagedObjectReference[] Host { get; set; }\n\n        public string[] HostName { get; set; }\n\n        public EVCUnsupportedByHostHardware_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EVCUnsupportedByHostHardware eVCUnsupportedByHostHardware)\n        {\n            return (eVCUnsupportedByHostHardware != null && ((this.Host == null && eVCUnsupportedByHostHardware.Host == null) || (this.Host != null && eVCUnsupportedByHostHardware.Host != null && Enumerable.SequenceEqual(this.Host, eVCUnsupportedByHostHardware.Host))) && ((this.HostName == null && eVCUnsupportedByHostHardware.HostName == null) || (this.HostName != null && eVCUnsupportedByHostHardware.HostName != null && Enumerable.SequenceEqual(this.HostName, eVCUnsupportedByHostHardware.HostName))) && ((this.LinkedView == null && eVCUnsupportedByHostHardware.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(eVCUnsupportedByHostHardware.LinkedView))));\n        }\n\n        public override bool Equals(object eVCUnsupportedByHostHardware)\n        {\n            return Equals(eVCUnsupportedByHostHardware as EVCUnsupportedByHostHardware);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EVCUnsupportedByHostHardware_LinkedView : IEquatable<EVCUnsupportedByHostHardware_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(EVCUnsupportedByHostHardware_LinkedView eVCUnsupportedByHostHardware_LinkedView)\n        {\n            return (eVCUnsupportedByHostHardware_LinkedView != null && ((this.Host == null && eVCUnsupportedByHostHardware_LinkedView.Host == null) || (this.Host != null && eVCUnsupportedByHostHardware_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, eVCUnsupportedByHostHardware_LinkedView.Host))));\n        }\n\n        public override bool Equals(object eVCUnsupportedByHostHardware_LinkedView)\n        {\n            return Equals(eVCUnsupportedByHostHardware_LinkedView as EVCUnsupportedByHostHardware_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class EVCUnsupportedByHostSoftware : EVCConfigFault, IEquatable<EVCUnsupportedByHostSoftware>\n    {\n        public ManagedObjectReference[] Host { get; set; }\n\n        public string[] HostName { get; set; }\n\n        public EVCUnsupportedByHostSoftware_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EVCUnsupportedByHostSoftware eVCUnsupportedByHostSoftware)\n        {\n            return (eVCUnsupportedByHostSoftware != null && ((this.Host == null && eVCUnsupportedByHostSoftware.Host == null) || (this.Host != null && eVCUnsupportedByHostSoftware.Host != null && Enumerable.SequenceEqual(this.Host, eVCUnsupportedByHostSoftware.Host))) && ((this.HostName == null && eVCUnsupportedByHostSoftware.HostName == null) || (this.HostName != null && eVCUnsupportedByHostSoftware.HostName != null && Enumerable.SequenceEqual(this.HostName, eVCUnsupportedByHostSoftware.HostName))) && ((this.LinkedView == null && eVCUnsupportedByHostSoftware.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(eVCUnsupportedByHostSoftware.LinkedView))));\n        }\n\n        public override bool Equals(object eVCUnsupportedByHostSoftware)\n        {\n            return Equals(eVCUnsupportedByHostSoftware as EVCUnsupportedByHostSoftware);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EVCUnsupportedByHostSoftware_LinkedView : IEquatable<EVCUnsupportedByHostSoftware_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(EVCUnsupportedByHostSoftware_LinkedView eVCUnsupportedByHostSoftware_LinkedView)\n        {\n            return (eVCUnsupportedByHostSoftware_LinkedView != null && ((this.Host == null && eVCUnsupportedByHostSoftware_LinkedView.Host == null) || (this.Host != null && eVCUnsupportedByHostSoftware_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, eVCUnsupportedByHostSoftware_LinkedView.Host))));\n        }\n\n        public override bool Equals(object eVCUnsupportedByHostSoftware_LinkedView)\n        {\n            return Equals(eVCUnsupportedByHostSoftware_LinkedView as EVCUnsupportedByHostSoftware_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class Event : DynamicData, IEquatable<Event>\n    {\n        public int Key { get; set; }\n\n        public int ChainId { get; set; }\n\n        public DateTime CreatedTime { get; set; }\n\n        public string UserName { get; set; }\n\n        public DatacenterEventArgument Datacenter { get; set; }\n\n        public ComputeResourceEventArgument ComputeResource { get; set; }\n\n        public HostEventArgument Host { get; set; }\n\n        public VmEventArgument Vm { get; set; }\n\n        public DatastoreEventArgument Ds { get; set; }\n\n        public NetworkEventArgument Net { get; set; }\n\n        public DvsEventArgument Dvs { get; set; }\n\n        public string FullFormattedMessage { get; set; }\n\n        public string ChangeTag { get; set; }\n\n        public bool Equals(Event _event)\n        {\n            return (_event != null && this.Key == _event.Key && this.ChainId == _event.ChainId && this.CreatedTime == _event.CreatedTime && this.UserName == _event.UserName && ((this.Datacenter == null && _event.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(_event.Datacenter))) && ((this.ComputeResource == null && _event.ComputeResource == null) || (this.ComputeResource != null && this.ComputeResource.Equals(_event.ComputeResource))) && ((this.Host == null && _event.Host == null) || (this.Host != null && this.Host.Equals(_event.Host))) && ((this.Vm == null && _event.Vm == null) || (this.Vm != null && this.Vm.Equals(_event.Vm))) && ((this.Ds == null && _event.Ds == null) || (this.Ds != null && this.Ds.Equals(_event.Ds))) && ((this.Net == null && _event.Net == null) || (this.Net != null && this.Net.Equals(_event.Net))) && ((this.Dvs == null && _event.Dvs == null) || (this.Dvs != null && this.Dvs.Equals(_event.Dvs))) && this.FullFormattedMessage == _event.FullFormattedMessage && this.ChangeTag == _event.ChangeTag);\n        }\n\n        public override bool Equals(object _event)\n        {\n            return Equals(_event as Event);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ChainId + \"_\" + CreatedTime + \"_\" + UserName + \"_\" + Datacenter + \"_\" + ComputeResource + \"_\" + Host + \"_\" + Vm + \"_\" + Ds + \"_\" + Net + \"_\" + Dvs + \"_\" + FullFormattedMessage + \"_\" + ChangeTag).GetHashCode();\n        }\n    }\n\n    public class EventAlarmExpression : AlarmExpression, IEquatable<EventAlarmExpression>\n    {\n        public EventAlarmExpressionComparison[] Comparisons { get; set; }\n\n        public string EventType { get; set; }\n\n        public string EventTypeId { get; set; }\n\n        public string ObjectType { get; set; }\n\n        public ManagedEntityStatus? Status { get; set; }\n\n        public bool Equals(EventAlarmExpression eventAlarmExpression)\n        {\n            return (eventAlarmExpression != null && ((this.Comparisons == null && eventAlarmExpression.Comparisons == null) || (this.Comparisons != null && eventAlarmExpression.Comparisons != null && Enumerable.SequenceEqual(this.Comparisons, eventAlarmExpression.Comparisons))) && this.EventType == eventAlarmExpression.EventType && this.EventTypeId == eventAlarmExpression.EventTypeId && this.ObjectType == eventAlarmExpression.ObjectType && ((this.Status == null && eventAlarmExpression.Status == null) || (this.Status != null && this.Status.Equals(eventAlarmExpression.Status))));\n        }\n\n        public override bool Equals(object eventAlarmExpression)\n        {\n            return Equals(eventAlarmExpression as EventAlarmExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Comparisons + \"_\" + EventType + \"_\" + EventTypeId + \"_\" + ObjectType + \"_\" + Status).GetHashCode();\n        }\n    }\n\n    public class EventAlarmExpressionComparison : DynamicData, IEquatable<EventAlarmExpressionComparison>\n    {\n        public string AttributeName { get; set; }\n\n        public string Operator { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(EventAlarmExpressionComparison eventAlarmExpressionComparison)\n        {\n            return (eventAlarmExpressionComparison != null && this.AttributeName == eventAlarmExpressionComparison.AttributeName && this.Operator == eventAlarmExpressionComparison.Operator && this.Value == eventAlarmExpressionComparison.Value);\n        }\n\n        public override bool Equals(object eventAlarmExpressionComparison)\n        {\n            return Equals(eventAlarmExpressionComparison as EventAlarmExpressionComparison);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AttributeName + \"_\" + Operator + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class EventArgDesc : DynamicData, IEquatable<EventArgDesc>\n    {\n        public string Name { get; set; }\n\n        public string Type { get; set; }\n\n        public ElementDescription Description { get; set; }\n\n        public bool Equals(EventArgDesc eventArgDesc)\n        {\n            return (eventArgDesc != null && this.Name == eventArgDesc.Name && this.Type == eventArgDesc.Type && ((this.Description == null && eventArgDesc.Description == null) || (this.Description != null && this.Description.Equals(eventArgDesc.Description))));\n        }\n\n        public override bool Equals(object eventArgDesc)\n        {\n            return Equals(eventArgDesc as EventArgDesc);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Type + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class EventArgument : DynamicData, IEquatable<EventArgument>\n    {\n        public bool Equals(EventArgument eventArgument)\n        {\n            return (eventArgument != null && base.Equals(eventArgument));\n        }\n\n        public override bool Equals(object eventArgument)\n        {\n            return Equals(eventArgument as EventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EventDescription : DynamicData, IEquatable<EventDescription>\n    {\n        public ElementDescription[] Category { get; set; }\n\n        public EventDescriptionEventDetail[] EventInfo { get; set; }\n\n        public EnumDescription[] EnumeratedTypes { get; set; }\n\n        public bool Equals(EventDescription eventDescription)\n        {\n            return (eventDescription != null && ((this.Category == null && eventDescription.Category == null) || (this.Category != null && eventDescription.Category != null && Enumerable.SequenceEqual(this.Category, eventDescription.Category))) && ((this.EventInfo == null && eventDescription.EventInfo == null) || (this.EventInfo != null && eventDescription.EventInfo != null && Enumerable.SequenceEqual(this.EventInfo, eventDescription.EventInfo))) && ((this.EnumeratedTypes == null && eventDescription.EnumeratedTypes == null) || (this.EnumeratedTypes != null && eventDescription.EnumeratedTypes != null && Enumerable.SequenceEqual(this.EnumeratedTypes, eventDescription.EnumeratedTypes))));\n        }\n\n        public override bool Equals(object eventDescription)\n        {\n            return Equals(eventDescription as EventDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Category + \"_\" + EventInfo + \"_\" + EnumeratedTypes).GetHashCode();\n        }\n    }\n\n    public class EventDescriptionEventDetail : DynamicData, IEquatable<EventDescriptionEventDetail>\n    {\n        public string Key { get; set; }\n\n        public string Description { get; set; }\n\n        public string Category { get; set; }\n\n        public string FormatOnDatacenter { get; set; }\n\n        public string FormatOnComputeResource { get; set; }\n\n        public string FormatOnHost { get; set; }\n\n        public string FormatOnVm { get; set; }\n\n        public string FullFormat { get; set; }\n\n        public string LongDescription { get; set; }\n\n        public bool Equals(EventDescriptionEventDetail eventDescriptionEventDetail)\n        {\n            return (eventDescriptionEventDetail != null && this.Key == eventDescriptionEventDetail.Key && this.Description == eventDescriptionEventDetail.Description && this.Category == eventDescriptionEventDetail.Category && this.FormatOnDatacenter == eventDescriptionEventDetail.FormatOnDatacenter && this.FormatOnComputeResource == eventDescriptionEventDetail.FormatOnComputeResource && this.FormatOnHost == eventDescriptionEventDetail.FormatOnHost && this.FormatOnVm == eventDescriptionEventDetail.FormatOnVm && this.FullFormat == eventDescriptionEventDetail.FullFormat && this.LongDescription == eventDescriptionEventDetail.LongDescription);\n        }\n\n        public override bool Equals(object eventDescriptionEventDetail)\n        {\n            return Equals(eventDescriptionEventDetail as EventDescriptionEventDetail);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Description + \"_\" + Category + \"_\" + FormatOnDatacenter + \"_\" + FormatOnComputeResource + \"_\" + FormatOnHost + \"_\" + FormatOnVm + \"_\" + FullFormat + \"_\" + LongDescription).GetHashCode();\n        }\n    }\n\n    public class EventEx : Event, IEquatable<EventEx>\n    {\n        public string EventTypeId { get; set; }\n\n        public string Severity { get; set; }\n\n        public string Message { get; set; }\n\n        public KeyAnyValue[] Arguments { get; set; }\n\n        public string ObjectId { get; set; }\n\n        public string ObjectType { get; set; }\n\n        public string ObjectName { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(EventEx eventEx)\n        {\n            return (eventEx != null && this.EventTypeId == eventEx.EventTypeId && this.Severity == eventEx.Severity && this.Message == eventEx.Message && ((this.Arguments == null && eventEx.Arguments == null) || (this.Arguments != null && eventEx.Arguments != null && Enumerable.SequenceEqual(this.Arguments, eventEx.Arguments))) && this.ObjectId == eventEx.ObjectId && this.ObjectType == eventEx.ObjectType && this.ObjectName == eventEx.ObjectName && ((this.Fault == null && eventEx.Fault == null) || (this.Fault != null && this.Fault.Equals(eventEx.Fault))));\n        }\n\n        public override bool Equals(object eventEx)\n        {\n            return Equals(eventEx as EventEx);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EventTypeId + \"_\" + Severity + \"_\" + Message + \"_\" + Arguments + \"_\" + ObjectId + \"_\" + ObjectType + \"_\" + ObjectName + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class EventFilterSpec : DynamicData, IEquatable<EventFilterSpec>\n    {\n        public EventFilterSpecByEntity Entity { get; set; }\n\n        public EventFilterSpecByTime Time { get; set; }\n\n        public EventFilterSpecByUsername UserName { get; set; }\n\n        public int? EventChainId { get; set; }\n\n        public ManagedObjectReference Alarm { get; set; }\n\n        public ManagedObjectReference ScheduledTask { get; set; }\n\n        public bool? DisableFullMessage { get; set; }\n\n        public string[] Category { get; set; }\n\n        public string[] Type { get; set; }\n\n        public string[] Tag { get; set; }\n\n        public string[] EventTypeId { get; set; }\n\n        public int? MaxCount { get; set; }\n\n        public EventFilterSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EventFilterSpec eventFilterSpec)\n        {\n            return (eventFilterSpec != null && ((this.Entity == null && eventFilterSpec.Entity == null) || (this.Entity != null && this.Entity.Equals(eventFilterSpec.Entity))) && ((this.Time == null && eventFilterSpec.Time == null) || (this.Time != null && this.Time.Equals(eventFilterSpec.Time))) && ((this.UserName == null && eventFilterSpec.UserName == null) || (this.UserName != null && this.UserName.Equals(eventFilterSpec.UserName))) && ((this.EventChainId == null && eventFilterSpec.EventChainId == null) || (this.EventChainId != null && this.EventChainId.Equals(eventFilterSpec.EventChainId))) && ((this.Alarm == null && eventFilterSpec.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(eventFilterSpec.Alarm))) && ((this.ScheduledTask == null && eventFilterSpec.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(eventFilterSpec.ScheduledTask))) && ((this.DisableFullMessage == null && eventFilterSpec.DisableFullMessage == null) || (this.DisableFullMessage != null && this.DisableFullMessage.Equals(eventFilterSpec.DisableFullMessage))) && ((this.Category == null && eventFilterSpec.Category == null) || (this.Category != null && eventFilterSpec.Category != null && Enumerable.SequenceEqual(this.Category, eventFilterSpec.Category))) && ((this.Type == null && eventFilterSpec.Type == null) || (this.Type != null && eventFilterSpec.Type != null && Enumerable.SequenceEqual(this.Type, eventFilterSpec.Type))) && ((this.Tag == null && eventFilterSpec.Tag == null) || (this.Tag != null && eventFilterSpec.Tag != null && Enumerable.SequenceEqual(this.Tag, eventFilterSpec.Tag))) && ((this.EventTypeId == null && eventFilterSpec.EventTypeId == null) || (this.EventTypeId != null && eventFilterSpec.EventTypeId != null && Enumerable.SequenceEqual(this.EventTypeId, eventFilterSpec.EventTypeId))) && ((this.MaxCount == null && eventFilterSpec.MaxCount == null) || (this.MaxCount != null && this.MaxCount.Equals(eventFilterSpec.MaxCount))) && ((this.LinkedView == null && eventFilterSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(eventFilterSpec.LinkedView))));\n        }\n\n        public override bool Equals(object eventFilterSpec)\n        {\n            return Equals(eventFilterSpec as EventFilterSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Time + \"_\" + UserName + \"_\" + EventChainId + \"_\" + Alarm + \"_\" + ScheduledTask + \"_\" + DisableFullMessage + \"_\" + Category + \"_\" + Type + \"_\" + Tag + \"_\" + EventTypeId + \"_\" + MaxCount + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EventFilterSpec_LinkedView : IEquatable<EventFilterSpec_LinkedView>\n    {\n        public Alarm Alarm { get; set; }\n\n        public ScheduledTask ScheduledTask { get; set; }\n\n        public bool Equals(EventFilterSpec_LinkedView eventFilterSpec_LinkedView)\n        {\n            return (eventFilterSpec_LinkedView != null && ((this.Alarm == null && eventFilterSpec_LinkedView.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(eventFilterSpec_LinkedView.Alarm))) && ((this.ScheduledTask == null && eventFilterSpec_LinkedView.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(eventFilterSpec_LinkedView.ScheduledTask))));\n        }\n\n        public override bool Equals(object eventFilterSpec_LinkedView)\n        {\n            return Equals(eventFilterSpec_LinkedView as EventFilterSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm + \"_\" + ScheduledTask).GetHashCode();\n        }\n    }\n\n    public class EventFilterSpecByEntity : DynamicData, IEquatable<EventFilterSpecByEntity>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public EventFilterSpecRecursionOption Recursion { get; set; }\n\n        public EventFilterSpecByEntity_LinkedView LinkedView { get; set; }\n\n        public bool Equals(EventFilterSpecByEntity eventFilterSpecByEntity)\n        {\n            return (eventFilterSpecByEntity != null && ((this.Entity == null && eventFilterSpecByEntity.Entity == null) || (this.Entity != null && this.Entity.Equals(eventFilterSpecByEntity.Entity))) && this.Recursion == eventFilterSpecByEntity.Recursion && ((this.LinkedView == null && eventFilterSpecByEntity.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(eventFilterSpecByEntity.LinkedView))));\n        }\n\n        public override bool Equals(object eventFilterSpecByEntity)\n        {\n            return Equals(eventFilterSpecByEntity as EventFilterSpecByEntity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Recursion + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class EventFilterSpecByEntity_LinkedView : IEquatable<EventFilterSpecByEntity_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(EventFilterSpecByEntity_LinkedView eventFilterSpecByEntity_LinkedView)\n        {\n            return (eventFilterSpecByEntity_LinkedView != null && ((this.Entity == null && eventFilterSpecByEntity_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(eventFilterSpecByEntity_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object eventFilterSpecByEntity_LinkedView)\n        {\n            return Equals(eventFilterSpecByEntity_LinkedView as EventFilterSpecByEntity_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class EventFilterSpecByTime : DynamicData, IEquatable<EventFilterSpecByTime>\n    {\n        public DateTime? BeginTime { get; set; }\n\n        public DateTime? EndTime { get; set; }\n\n        public bool Equals(EventFilterSpecByTime eventFilterSpecByTime)\n        {\n            return (eventFilterSpecByTime != null && ((this.BeginTime == null && eventFilterSpecByTime.BeginTime == null) || (this.BeginTime != null && this.BeginTime.Equals(eventFilterSpecByTime.BeginTime))) && ((this.EndTime == null && eventFilterSpecByTime.EndTime == null) || (this.EndTime != null && this.EndTime.Equals(eventFilterSpecByTime.EndTime))));\n        }\n\n        public override bool Equals(object eventFilterSpecByTime)\n        {\n            return Equals(eventFilterSpecByTime as EventFilterSpecByTime);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BeginTime + \"_\" + EndTime).GetHashCode();\n        }\n    }\n\n    public class EventFilterSpecByUsername : DynamicData, IEquatable<EventFilterSpecByUsername>\n    {\n        public bool SystemUser { get; set; }\n\n        public string[] UserList { get; set; }\n\n        public bool Equals(EventFilterSpecByUsername eventFilterSpecByUsername)\n        {\n            return (eventFilterSpecByUsername != null && this.SystemUser == eventFilterSpecByUsername.SystemUser && ((this.UserList == null && eventFilterSpecByUsername.UserList == null) || (this.UserList != null && eventFilterSpecByUsername.UserList != null && Enumerable.SequenceEqual(this.UserList, eventFilterSpecByUsername.UserList))));\n        }\n\n        public override bool Equals(object eventFilterSpecByUsername)\n        {\n            return Equals(eventFilterSpecByUsername as EventFilterSpecByUsername);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SystemUser + \"_\" + UserList).GetHashCode();\n        }\n    }\n\n    public class EventHistoryCollector : HistoryCollector, IEquatable<EventHistoryCollector>\n    {\n        public Event[] LatestPage { get; set; }\n\n        public Event[] ReadNextEvents(int maxCount)\n        {\n            return default(Event[]);\n        }\n\n        public Event[] ReadPreviousEvents(int maxCount)\n        {\n            return default(Event[]);\n        }\n\n        public bool Equals(EventHistoryCollector eventHistoryCollector)\n        {\n            return (eventHistoryCollector != null && ((this.LatestPage == null && eventHistoryCollector.LatestPage == null) || (this.LatestPage != null && eventHistoryCollector.LatestPage != null && Enumerable.SequenceEqual(this.LatestPage, eventHistoryCollector.LatestPage))));\n        }\n\n        public override bool Equals(object eventHistoryCollector)\n        {\n            return Equals(eventHistoryCollector as EventHistoryCollector);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LatestPage).GetHashCode();\n        }\n    }\n\n    public class EventManager : ViewBase, IEquatable<EventManager>\n    {\n        public EventDescription Description { get; set; }\n\n        public Event LatestEvent { get; set; }\n\n        public int MaxCollector { get; set; }\n\n        public EventArgDesc[] RetrieveArgumentDescription(string eventTypeId)\n        {\n            return default(EventArgDesc[]);\n        }\n\n        public ManagedObjectReference CreateCollectorForEvents(EventFilterSpec filter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void LogUserEvent(ManagedObjectReference entity, string msg)\n        {\n        }\n\n        public Event[] QueryEvents(EventFilterSpec filter)\n        {\n            return default(Event[]);\n        }\n\n        public void PostEvent(Event eventToPost, TaskInfo taskInfo)\n        {\n        }\n\n        public bool Equals(EventManager eventManager)\n        {\n            return (eventManager != null && ((this.Description == null && eventManager.Description == null) || (this.Description != null && this.Description.Equals(eventManager.Description))) && ((this.LatestEvent == null && eventManager.LatestEvent == null) || (this.LatestEvent != null && this.LatestEvent.Equals(eventManager.LatestEvent))) && this.MaxCollector == eventManager.MaxCollector);\n        }\n\n        public override bool Equals(object eventManager)\n        {\n            return Equals(eventManager as EventManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + LatestEvent + \"_\" + MaxCollector).GetHashCode();\n        }\n    }\n\n    public class ExitedStandbyModeEvent : HostEvent, IEquatable<ExitedStandbyModeEvent>\n    {\n        public bool Equals(ExitedStandbyModeEvent exitedStandbyModeEvent)\n        {\n            return (exitedStandbyModeEvent != null && base.Equals(exitedStandbyModeEvent));\n        }\n\n        public override bool Equals(object exitedStandbyModeEvent)\n        {\n            return Equals(exitedStandbyModeEvent as ExitedStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ExitingStandbyModeEvent : HostEvent, IEquatable<ExitingStandbyModeEvent>\n    {\n        public bool Equals(ExitingStandbyModeEvent exitingStandbyModeEvent)\n        {\n            return (exitingStandbyModeEvent != null && base.Equals(exitingStandbyModeEvent));\n        }\n\n        public override bool Equals(object exitingStandbyModeEvent)\n        {\n            return Equals(exitingStandbyModeEvent as ExitingStandbyModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ExitMaintenanceModeEvent : HostEvent, IEquatable<ExitMaintenanceModeEvent>\n    {\n        public bool Equals(ExitMaintenanceModeEvent exitMaintenanceModeEvent)\n        {\n            return (exitMaintenanceModeEvent != null && base.Equals(exitMaintenanceModeEvent));\n        }\n\n        public override bool Equals(object exitMaintenanceModeEvent)\n        {\n            return Equals(exitMaintenanceModeEvent as ExitMaintenanceModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ExitStandbyModeFailedEvent : HostEvent, IEquatable<ExitStandbyModeFailedEvent>\n    {\n        public bool Equals(ExitStandbyModeFailedEvent exitStandbyModeFailedEvent)\n        {\n            return (exitStandbyModeFailedEvent != null && base.Equals(exitStandbyModeFailedEvent));\n        }\n\n        public override bool Equals(object exitStandbyModeFailedEvent)\n        {\n            return Equals(exitStandbyModeFailedEvent as ExitStandbyModeFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ExpiredAddonLicense : ExpiredFeatureLicense, IEquatable<ExpiredAddonLicense>\n    {\n        public bool Equals(ExpiredAddonLicense expiredAddonLicense)\n        {\n            return (expiredAddonLicense != null && base.Equals(expiredAddonLicense));\n        }\n\n        public override bool Equals(object expiredAddonLicense)\n        {\n            return Equals(expiredAddonLicense as ExpiredAddonLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ExpiredEditionLicense : ExpiredFeatureLicense, IEquatable<ExpiredEditionLicense>\n    {\n        public bool Equals(ExpiredEditionLicense expiredEditionLicense)\n        {\n            return (expiredEditionLicense != null && base.Equals(expiredEditionLicense));\n        }\n\n        public override bool Equals(object expiredEditionLicense)\n        {\n            return Equals(expiredEditionLicense as ExpiredEditionLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ExpiredFeatureLicense : NotEnoughLicenses, IEquatable<ExpiredFeatureLicense>\n    {\n        public string Feature { get; set; }\n\n        public int Count { get; set; }\n\n        public DateTime ExpirationDate { get; set; }\n\n        public bool Equals(ExpiredFeatureLicense expiredFeatureLicense)\n        {\n            return (expiredFeatureLicense != null && this.Feature == expiredFeatureLicense.Feature && this.Count == expiredFeatureLicense.Count && this.ExpirationDate == expiredFeatureLicense.ExpirationDate);\n        }\n\n        public override bool Equals(object expiredFeatureLicense)\n        {\n            return Equals(expiredFeatureLicense as ExpiredFeatureLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Feature + \"_\" + Count + \"_\" + ExpirationDate).GetHashCode();\n        }\n    }\n\n    public class ExtendedDescription : Description, IEquatable<ExtendedDescription>\n    {\n        public string MessageCatalogKeyPrefix { get; set; }\n\n        public KeyAnyValue[] MessageArg { get; set; }\n\n        public bool Equals(ExtendedDescription extendedDescription)\n        {\n            return (extendedDescription != null && this.MessageCatalogKeyPrefix == extendedDescription.MessageCatalogKeyPrefix && ((this.MessageArg == null && extendedDescription.MessageArg == null) || (this.MessageArg != null && extendedDescription.MessageArg != null && Enumerable.SequenceEqual(this.MessageArg, extendedDescription.MessageArg))));\n        }\n\n        public override bool Equals(object extendedDescription)\n        {\n            return Equals(extendedDescription as ExtendedDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MessageCatalogKeyPrefix + \"_\" + MessageArg).GetHashCode();\n        }\n    }\n\n    public class ExtendedElementDescription : ElementDescription, IEquatable<ExtendedElementDescription>\n    {\n        public string MessageCatalogKeyPrefix { get; set; }\n\n        public KeyAnyValue[] MessageArg { get; set; }\n\n        public bool Equals(ExtendedElementDescription extendedElementDescription)\n        {\n            return (extendedElementDescription != null && this.MessageCatalogKeyPrefix == extendedElementDescription.MessageCatalogKeyPrefix && ((this.MessageArg == null && extendedElementDescription.MessageArg == null) || (this.MessageArg != null && extendedElementDescription.MessageArg != null && Enumerable.SequenceEqual(this.MessageArg, extendedElementDescription.MessageArg))));\n        }\n\n        public override bool Equals(object extendedElementDescription)\n        {\n            return Equals(extendedElementDescription as ExtendedElementDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MessageCatalogKeyPrefix + \"_\" + MessageArg).GetHashCode();\n        }\n    }\n\n    public class ExtendedEvent : GeneralEvent, IEquatable<ExtendedEvent>\n    {\n        public string EventTypeId { get; set; }\n\n        public ManagedObjectReference ManagedObject { get; set; }\n\n        public ExtendedEventPair[] Data { get; set; }\n\n        public bool Equals(ExtendedEvent extendedEvent)\n        {\n            return (extendedEvent != null && this.EventTypeId == extendedEvent.EventTypeId && ((this.ManagedObject == null && extendedEvent.ManagedObject == null) || (this.ManagedObject != null && this.ManagedObject.Equals(extendedEvent.ManagedObject))) && ((this.Data == null && extendedEvent.Data == null) || (this.Data != null && extendedEvent.Data != null && Enumerable.SequenceEqual(this.Data, extendedEvent.Data))));\n        }\n\n        public override bool Equals(object extendedEvent)\n        {\n            return Equals(extendedEvent as ExtendedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EventTypeId + \"_\" + ManagedObject + \"_\" + Data).GetHashCode();\n        }\n    }\n\n    public class ExtendedEventPair : DynamicData, IEquatable<ExtendedEventPair>\n    {\n        public string Key { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(ExtendedEventPair extendedEventPair)\n        {\n            return (extendedEventPair != null && this.Key == extendedEventPair.Key && this.Value == extendedEventPair.Value);\n        }\n\n        public override bool Equals(object extendedEventPair)\n        {\n            return Equals(extendedEventPair as ExtendedEventPair);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class ExtendedFault : VimFault, IEquatable<ExtendedFault>\n    {\n        public string FaultTypeId { get; set; }\n\n        public KeyValue[] Data { get; set; }\n\n        public bool Equals(ExtendedFault extendedFault)\n        {\n            return (extendedFault != null && this.FaultTypeId == extendedFault.FaultTypeId && ((this.Data == null && extendedFault.Data == null) || (this.Data != null && extendedFault.Data != null && Enumerable.SequenceEqual(this.Data, extendedFault.Data))));\n        }\n\n        public override bool Equals(object extendedFault)\n        {\n            return Equals(extendedFault as ExtendedFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FaultTypeId + \"_\" + Data).GetHashCode();\n        }\n    }\n\n    public class ExtensibleManagedObject : ViewBase, IEquatable<ExtensibleManagedObject>\n    {\n        public CustomFieldValue[] Value { get; set; }\n\n        public CustomFieldDef[] AvailableField { get; set; }\n\n        public void setCustomValue(string key, string value)\n        {\n        }\n\n        public bool Equals(ExtensibleManagedObject extensibleManagedObject)\n        {\n            return (extensibleManagedObject != null && ((this.Value == null && extensibleManagedObject.Value == null) || (this.Value != null && extensibleManagedObject.Value != null && Enumerable.SequenceEqual(this.Value, extensibleManagedObject.Value))) && ((this.AvailableField == null && extensibleManagedObject.AvailableField == null) || (this.AvailableField != null && extensibleManagedObject.AvailableField != null && Enumerable.SequenceEqual(this.AvailableField, extensibleManagedObject.AvailableField))));\n        }\n\n        public override bool Equals(object extensibleManagedObject)\n        {\n            return Equals(extensibleManagedObject as ExtensibleManagedObject);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value + \"_\" + AvailableField).GetHashCode();\n        }\n    }\n\n    public class Extension : DynamicData, IEquatable<Extension>\n    {\n        public Description Description { get; set; }\n\n        public string Key { get; set; }\n\n        public string Company { get; set; }\n\n        public string Type { get; set; }\n\n        public string Version { get; set; }\n\n        public string SubjectName { get; set; }\n\n        public ExtensionServerInfo[] Server { get; set; }\n\n        public ExtensionClientInfo[] Client { get; set; }\n\n        public ExtensionTaskTypeInfo[] TaskList { get; set; }\n\n        public ExtensionEventTypeInfo[] EventList { get; set; }\n\n        public ExtensionFaultTypeInfo[] FaultList { get; set; }\n\n        public ExtensionPrivilegeInfo[] PrivilegeList { get; set; }\n\n        public ExtensionResourceInfo[] ResourceList { get; set; }\n\n        public DateTime LastHeartbeatTime { get; set; }\n\n        public ExtensionHealthInfo HealthInfo { get; set; }\n\n        public ExtensionOvfConsumerInfo OvfConsumerInfo { get; set; }\n\n        public ExtExtendedProductInfo ExtendedProductInfo { get; set; }\n\n        public ExtManagedEntityInfo[] ManagedEntityInfo { get; set; }\n\n        public bool? ShownInSolutionManager { get; set; }\n\n        public ExtSolutionManagerInfo SolutionManagerInfo { get; set; }\n\n        public bool Equals(Extension extension)\n        {\n            return (extension != null && ((this.Description == null && extension.Description == null) || (this.Description != null && this.Description.Equals(extension.Description))) && this.Key == extension.Key && this.Company == extension.Company && this.Type == extension.Type && this.Version == extension.Version && this.SubjectName == extension.SubjectName && ((this.Server == null && extension.Server == null) || (this.Server != null && extension.Server != null && Enumerable.SequenceEqual(this.Server, extension.Server))) && ((this.Client == null && extension.Client == null) || (this.Client != null && extension.Client != null && Enumerable.SequenceEqual(this.Client, extension.Client))) && ((this.TaskList == null && extension.TaskList == null) || (this.TaskList != null && extension.TaskList != null && Enumerable.SequenceEqual(this.TaskList, extension.TaskList))) && ((this.EventList == null && extension.EventList == null) || (this.EventList != null && extension.EventList != null && Enumerable.SequenceEqual(this.EventList, extension.EventList))) && ((this.FaultList == null && extension.FaultList == null) || (this.FaultList != null && extension.FaultList != null && Enumerable.SequenceEqual(this.FaultList, extension.FaultList))) && ((this.PrivilegeList == null && extension.PrivilegeList == null) || (this.PrivilegeList != null && extension.PrivilegeList != null && Enumerable.SequenceEqual(this.PrivilegeList, extension.PrivilegeList))) && ((this.ResourceList == null && extension.ResourceList == null) || (this.ResourceList != null && extension.ResourceList != null && Enumerable.SequenceEqual(this.ResourceList, extension.ResourceList))) && this.LastHeartbeatTime == extension.LastHeartbeatTime && ((this.HealthInfo == null && extension.HealthInfo == null) || (this.HealthInfo != null && this.HealthInfo.Equals(extension.HealthInfo))) && ((this.OvfConsumerInfo == null && extension.OvfConsumerInfo == null) || (this.OvfConsumerInfo != null && this.OvfConsumerInfo.Equals(extension.OvfConsumerInfo))) && ((this.ExtendedProductInfo == null && extension.ExtendedProductInfo == null) || (this.ExtendedProductInfo != null && this.ExtendedProductInfo.Equals(extension.ExtendedProductInfo))) && ((this.ManagedEntityInfo == null && extension.ManagedEntityInfo == null) || (this.ManagedEntityInfo != null && extension.ManagedEntityInfo != null && Enumerable.SequenceEqual(this.ManagedEntityInfo, extension.ManagedEntityInfo))) && ((this.ShownInSolutionManager == null && extension.ShownInSolutionManager == null) || (this.ShownInSolutionManager != null && this.ShownInSolutionManager.Equals(extension.ShownInSolutionManager))) && ((this.SolutionManagerInfo == null && extension.SolutionManagerInfo == null) || (this.SolutionManagerInfo != null && this.SolutionManagerInfo.Equals(extension.SolutionManagerInfo))));\n        }\n\n        public override bool Equals(object extension)\n        {\n            return Equals(extension as Extension);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + Key + \"_\" + Company + \"_\" + Type + \"_\" + Version + \"_\" + SubjectName + \"_\" + Server + \"_\" + Client + \"_\" + TaskList + \"_\" + EventList + \"_\" + FaultList + \"_\" + PrivilegeList + \"_\" + ResourceList + \"_\" + LastHeartbeatTime + \"_\" + HealthInfo + \"_\" + OvfConsumerInfo + \"_\" + ExtendedProductInfo + \"_\" + ManagedEntityInfo + \"_\" + ShownInSolutionManager + \"_\" + SolutionManagerInfo).GetHashCode();\n        }\n    }\n\n    public class ExtensionClientInfo : DynamicData, IEquatable<ExtensionClientInfo>\n    {\n        public string Version { get; set; }\n\n        public Description Description { get; set; }\n\n        public string Company { get; set; }\n\n        public string Type { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(ExtensionClientInfo extensionClientInfo)\n        {\n            return (extensionClientInfo != null && this.Version == extensionClientInfo.Version && ((this.Description == null && extensionClientInfo.Description == null) || (this.Description != null && this.Description.Equals(extensionClientInfo.Description))) && this.Company == extensionClientInfo.Company && this.Type == extensionClientInfo.Type && this.Url == extensionClientInfo.Url);\n        }\n\n        public override bool Equals(object extensionClientInfo)\n        {\n            return Equals(extensionClientInfo as ExtensionClientInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version + \"_\" + Description + \"_\" + Company + \"_\" + Type + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class ExtensionEventTypeInfo : DynamicData, IEquatable<ExtensionEventTypeInfo>\n    {\n        public string EventID { get; set; }\n\n        public string EventTypeSchema { get; set; }\n\n        public bool Equals(ExtensionEventTypeInfo extensionEventTypeInfo)\n        {\n            return (extensionEventTypeInfo != null && this.EventID == extensionEventTypeInfo.EventID && this.EventTypeSchema == extensionEventTypeInfo.EventTypeSchema);\n        }\n\n        public override bool Equals(object extensionEventTypeInfo)\n        {\n            return Equals(extensionEventTypeInfo as ExtensionEventTypeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EventID + \"_\" + EventTypeSchema).GetHashCode();\n        }\n    }\n\n    public class ExtensionFaultTypeInfo : DynamicData, IEquatable<ExtensionFaultTypeInfo>\n    {\n        public string FaultID { get; set; }\n\n        public bool Equals(ExtensionFaultTypeInfo extensionFaultTypeInfo)\n        {\n            return (extensionFaultTypeInfo != null && this.FaultID == extensionFaultTypeInfo.FaultID);\n        }\n\n        public override bool Equals(object extensionFaultTypeInfo)\n        {\n            return Equals(extensionFaultTypeInfo as ExtensionFaultTypeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FaultID).GetHashCode();\n        }\n    }\n\n    public class ExtensionHealthInfo : DynamicData, IEquatable<ExtensionHealthInfo>\n    {\n        public string Url { get; set; }\n\n        public bool Equals(ExtensionHealthInfo extensionHealthInfo)\n        {\n            return (extensionHealthInfo != null && this.Url == extensionHealthInfo.Url);\n        }\n\n        public override bool Equals(object extensionHealthInfo)\n        {\n            return Equals(extensionHealthInfo as ExtensionHealthInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Url).GetHashCode();\n        }\n    }\n\n    public class ExtensionManager : ViewBase, IEquatable<ExtensionManager>\n    {\n        public Extension[] ExtensionList { get; set; }\n\n        public void UnregisterExtension(string extensionKey)\n        {\n        }\n\n        public Extension FindExtension(string extensionKey)\n        {\n            return default(Extension);\n        }\n\n        public void RegisterExtension(Extension extension)\n        {\n        }\n\n        public void UpdateExtension(Extension extension)\n        {\n        }\n\n        public string GetPublicKey()\n        {\n            return default(string);\n        }\n\n        public void SetPublicKey(string extensionKey, string publicKey)\n        {\n        }\n\n        public void SetExtensionCertificate(string extensionKey, string certificatePem)\n        {\n        }\n\n        public ManagedObjectReference[] QueryManagedBy(string extensionKey)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ExtensionManagerIpAllocationUsage[] QueryExtensionIpAllocationUsage(string[] extensionKeys)\n        {\n            return default(ExtensionManagerIpAllocationUsage[]);\n        }\n\n        public bool Equals(ExtensionManager extensionManager)\n        {\n            return (extensionManager != null && ((this.ExtensionList == null && extensionManager.ExtensionList == null) || (this.ExtensionList != null && extensionManager.ExtensionList != null && Enumerable.SequenceEqual(this.ExtensionList, extensionManager.ExtensionList))));\n        }\n\n        public override bool Equals(object extensionManager)\n        {\n            return Equals(extensionManager as ExtensionManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionList).GetHashCode();\n        }\n    }\n\n    public class ExtensionManagerIpAllocationUsage : DynamicData, IEquatable<ExtensionManagerIpAllocationUsage>\n    {\n        public string ExtensionKey { get; set; }\n\n        public int NumAddresses { get; set; }\n\n        public bool Equals(ExtensionManagerIpAllocationUsage extensionManagerIpAllocationUsage)\n        {\n            return (extensionManagerIpAllocationUsage != null && this.ExtensionKey == extensionManagerIpAllocationUsage.ExtensionKey && this.NumAddresses == extensionManagerIpAllocationUsage.NumAddresses);\n        }\n\n        public override bool Equals(object extensionManagerIpAllocationUsage)\n        {\n            return Equals(extensionManagerIpAllocationUsage as ExtensionManagerIpAllocationUsage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionKey + \"_\" + NumAddresses).GetHashCode();\n        }\n    }\n\n    public class ExtensionOvfConsumerInfo : DynamicData, IEquatable<ExtensionOvfConsumerInfo>\n    {\n        public string CallbackUrl { get; set; }\n\n        public string[] SectionType { get; set; }\n\n        public bool Equals(ExtensionOvfConsumerInfo extensionOvfConsumerInfo)\n        {\n            return (extensionOvfConsumerInfo != null && this.CallbackUrl == extensionOvfConsumerInfo.CallbackUrl && ((this.SectionType == null && extensionOvfConsumerInfo.SectionType == null) || (this.SectionType != null && extensionOvfConsumerInfo.SectionType != null && Enumerable.SequenceEqual(this.SectionType, extensionOvfConsumerInfo.SectionType))));\n        }\n\n        public override bool Equals(object extensionOvfConsumerInfo)\n        {\n            return Equals(extensionOvfConsumerInfo as ExtensionOvfConsumerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CallbackUrl + \"_\" + SectionType).GetHashCode();\n        }\n    }\n\n    public class ExtensionPrivilegeInfo : DynamicData, IEquatable<ExtensionPrivilegeInfo>\n    {\n        public string PrivID { get; set; }\n\n        public string PrivGroupName { get; set; }\n\n        public bool Equals(ExtensionPrivilegeInfo extensionPrivilegeInfo)\n        {\n            return (extensionPrivilegeInfo != null && this.PrivID == extensionPrivilegeInfo.PrivID && this.PrivGroupName == extensionPrivilegeInfo.PrivGroupName);\n        }\n\n        public override bool Equals(object extensionPrivilegeInfo)\n        {\n            return Equals(extensionPrivilegeInfo as ExtensionPrivilegeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrivID + \"_\" + PrivGroupName).GetHashCode();\n        }\n    }\n\n    public class ExtensionResourceInfo : DynamicData, IEquatable<ExtensionResourceInfo>\n    {\n        public string Locale { get; set; }\n\n        public string Module { get; set; }\n\n        public KeyValue[] Data { get; set; }\n\n        public bool Equals(ExtensionResourceInfo extensionResourceInfo)\n        {\n            return (extensionResourceInfo != null && this.Locale == extensionResourceInfo.Locale && this.Module == extensionResourceInfo.Module && ((this.Data == null && extensionResourceInfo.Data == null) || (this.Data != null && extensionResourceInfo.Data != null && Enumerable.SequenceEqual(this.Data, extensionResourceInfo.Data))));\n        }\n\n        public override bool Equals(object extensionResourceInfo)\n        {\n            return Equals(extensionResourceInfo as ExtensionResourceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Locale + \"_\" + Module + \"_\" + Data).GetHashCode();\n        }\n    }\n\n    public class ExtensionServerInfo : DynamicData, IEquatable<ExtensionServerInfo>\n    {\n        public string Url { get; set; }\n\n        public Description Description { get; set; }\n\n        public string Company { get; set; }\n\n        public string Type { get; set; }\n\n        public string[] AdminEmail { get; set; }\n\n        public string ServerThumbprint { get; set; }\n\n        public bool Equals(ExtensionServerInfo extensionServerInfo)\n        {\n            return (extensionServerInfo != null && this.Url == extensionServerInfo.Url && ((this.Description == null && extensionServerInfo.Description == null) || (this.Description != null && this.Description.Equals(extensionServerInfo.Description))) && this.Company == extensionServerInfo.Company && this.Type == extensionServerInfo.Type && ((this.AdminEmail == null && extensionServerInfo.AdminEmail == null) || (this.AdminEmail != null && extensionServerInfo.AdminEmail != null && Enumerable.SequenceEqual(this.AdminEmail, extensionServerInfo.AdminEmail))) && this.ServerThumbprint == extensionServerInfo.ServerThumbprint);\n        }\n\n        public override bool Equals(object extensionServerInfo)\n        {\n            return Equals(extensionServerInfo as ExtensionServerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Url + \"_\" + Description + \"_\" + Company + \"_\" + Type + \"_\" + AdminEmail + \"_\" + ServerThumbprint).GetHashCode();\n        }\n    }\n\n    public class ExtensionTaskTypeInfo : DynamicData, IEquatable<ExtensionTaskTypeInfo>\n    {\n        public string TaskID { get; set; }\n\n        public bool Equals(ExtensionTaskTypeInfo extensionTaskTypeInfo)\n        {\n            return (extensionTaskTypeInfo != null && this.TaskID == extensionTaskTypeInfo.TaskID);\n        }\n\n        public override bool Equals(object extensionTaskTypeInfo)\n        {\n            return Equals(extensionTaskTypeInfo as ExtensionTaskTypeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TaskID).GetHashCode();\n        }\n    }\n\n    public class ExtExtendedProductInfo : DynamicData, IEquatable<ExtExtendedProductInfo>\n    {\n        public string CompanyUrl { get; set; }\n\n        public string ProductUrl { get; set; }\n\n        public string ManagementUrl { get; set; }\n\n        public ManagedObjectReference Self { get; set; }\n\n        public ExtExtendedProductInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ExtExtendedProductInfo extExtendedProductInfo)\n        {\n            return (extExtendedProductInfo != null && this.CompanyUrl == extExtendedProductInfo.CompanyUrl && this.ProductUrl == extExtendedProductInfo.ProductUrl && this.ManagementUrl == extExtendedProductInfo.ManagementUrl && ((this.Self == null && extExtendedProductInfo.Self == null) || (this.Self != null && this.Self.Equals(extExtendedProductInfo.Self))) && ((this.LinkedView == null && extExtendedProductInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(extExtendedProductInfo.LinkedView))));\n        }\n\n        public override bool Equals(object extExtendedProductInfo)\n        {\n            return Equals(extExtendedProductInfo as ExtExtendedProductInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CompanyUrl + \"_\" + ProductUrl + \"_\" + ManagementUrl + \"_\" + Self + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ExtExtendedProductInfo_LinkedView : IEquatable<ExtExtendedProductInfo_LinkedView>\n    {\n        public ManagedEntity Self { get; set; }\n\n        public bool Equals(ExtExtendedProductInfo_LinkedView extExtendedProductInfo_LinkedView)\n        {\n            return (extExtendedProductInfo_LinkedView != null && ((this.Self == null && extExtendedProductInfo_LinkedView.Self == null) || (this.Self != null && this.Self.Equals(extExtendedProductInfo_LinkedView.Self))));\n        }\n\n        public override bool Equals(object extExtendedProductInfo_LinkedView)\n        {\n            return Equals(extExtendedProductInfo_LinkedView as ExtExtendedProductInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Self).GetHashCode();\n        }\n    }\n\n    public class ExtManagedEntityInfo : DynamicData, IEquatable<ExtManagedEntityInfo>\n    {\n        public string Type { get; set; }\n\n        public string SmallIconUrl { get; set; }\n\n        public string IconUrl { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(ExtManagedEntityInfo extManagedEntityInfo)\n        {\n            return (extManagedEntityInfo != null && this.Type == extManagedEntityInfo.Type && this.SmallIconUrl == extManagedEntityInfo.SmallIconUrl && this.IconUrl == extManagedEntityInfo.IconUrl && this.Description == extManagedEntityInfo.Description);\n        }\n\n        public override bool Equals(object extManagedEntityInfo)\n        {\n            return Equals(extManagedEntityInfo as ExtManagedEntityInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + SmallIconUrl + \"_\" + IconUrl + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class ExtSolutionManagerInfo : DynamicData, IEquatable<ExtSolutionManagerInfo>\n    {\n        public ExtSolutionManagerInfoTabInfo[] Tab { get; set; }\n\n        public string SmallIconUrl { get; set; }\n\n        public bool Equals(ExtSolutionManagerInfo extSolutionManagerInfo)\n        {\n            return (extSolutionManagerInfo != null && ((this.Tab == null && extSolutionManagerInfo.Tab == null) || (this.Tab != null && extSolutionManagerInfo.Tab != null && Enumerable.SequenceEqual(this.Tab, extSolutionManagerInfo.Tab))) && this.SmallIconUrl == extSolutionManagerInfo.SmallIconUrl);\n        }\n\n        public override bool Equals(object extSolutionManagerInfo)\n        {\n            return Equals(extSolutionManagerInfo as ExtSolutionManagerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Tab + \"_\" + SmallIconUrl).GetHashCode();\n        }\n    }\n\n    public class ExtSolutionManagerInfoTabInfo : DynamicData, IEquatable<ExtSolutionManagerInfoTabInfo>\n    {\n        public string Label { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(ExtSolutionManagerInfoTabInfo extSolutionManagerInfoTabInfo)\n        {\n            return (extSolutionManagerInfoTabInfo != null && this.Label == extSolutionManagerInfoTabInfo.Label && this.Url == extSolutionManagerInfoTabInfo.Url);\n        }\n\n        public override bool Equals(object extSolutionManagerInfoTabInfo)\n        {\n            return Equals(extSolutionManagerInfoTabInfo as ExtSolutionManagerInfoTabInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Label + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class FailoverClusterConfigurator : ViewBase, IEquatable<FailoverClusterConfigurator>\n    {\n        public string[] DisabledConfigureMethod { get; set; }\n\n        public ManagedObjectReference prepareVcha_Task(VchaClusterNetworkSpec networkSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void prepareVcha(VchaClusterNetworkSpec networkSpec)\n        {\n        }\n\n        public ManagedObjectReference deployVcha_Task(VchaClusterDeploymentSpec deploymentSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void deployVcha(VchaClusterDeploymentSpec deploymentSpec)\n        {\n        }\n\n        public ManagedObjectReference configureVcha_Task(VchaClusterConfigSpec configSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void configureVcha(VchaClusterConfigSpec configSpec)\n        {\n        }\n\n        public ManagedObjectReference createPassiveNode_Task(PassiveNodeDeploymentSpec passiveDeploymentSpec, SourceNodeSpec sourceVcSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void createPassiveNode(PassiveNodeDeploymentSpec passiveDeploymentSpec, SourceNodeSpec sourceVcSpec)\n        {\n        }\n\n        public ManagedObjectReference createWitnessNode_Task(NodeDeploymentSpec witnessDeploymentSpec, SourceNodeSpec sourceVcSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void createWitnessNode(NodeDeploymentSpec witnessDeploymentSpec, SourceNodeSpec sourceVcSpec)\n        {\n        }\n\n        public VchaClusterConfigInfo getVchaConfig()\n        {\n            return default(VchaClusterConfigInfo);\n        }\n\n        public ManagedObjectReference destroyVcha_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void destroyVcha()\n        {\n        }\n\n        public bool Equals(FailoverClusterConfigurator failoverClusterConfigurator)\n        {\n            return (failoverClusterConfigurator != null && ((this.DisabledConfigureMethod == null && failoverClusterConfigurator.DisabledConfigureMethod == null) || (this.DisabledConfigureMethod != null && failoverClusterConfigurator.DisabledConfigureMethod != null && Enumerable.SequenceEqual(this.DisabledConfigureMethod, failoverClusterConfigurator.DisabledConfigureMethod))));\n        }\n\n        public override bool Equals(object failoverClusterConfigurator)\n        {\n            return Equals(failoverClusterConfigurator as FailoverClusterConfigurator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DisabledConfigureMethod).GetHashCode();\n        }\n    }\n\n    public class FailoverClusterManager : ViewBase, IEquatable<FailoverClusterManager>\n    {\n        public string[] DisabledClusterMethod { get; set; }\n\n        public ManagedObjectReference setClusterMode_Task(string mode)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void setClusterMode(string mode)\n        {\n        }\n\n        public string getClusterMode()\n        {\n            return default(string);\n        }\n\n        public VchaClusterHealth GetVchaClusterHealth()\n        {\n            return default(VchaClusterHealth);\n        }\n\n        public ManagedObjectReference initiateFailover_Task(bool planned)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void initiateFailover(bool planned)\n        {\n        }\n\n        public bool Equals(FailoverClusterManager failoverClusterManager)\n        {\n            return (failoverClusterManager != null && ((this.DisabledClusterMethod == null && failoverClusterManager.DisabledClusterMethod == null) || (this.DisabledClusterMethod != null && failoverClusterManager.DisabledClusterMethod != null && Enumerable.SequenceEqual(this.DisabledClusterMethod, failoverClusterManager.DisabledClusterMethod))));\n        }\n\n        public override bool Equals(object failoverClusterManager)\n        {\n            return Equals(failoverClusterManager as FailoverClusterManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DisabledClusterMethod).GetHashCode();\n        }\n    }\n\n    public class FailoverLevelRestored : ClusterEvent, IEquatable<FailoverLevelRestored>\n    {\n        public bool Equals(FailoverLevelRestored failoverLevelRestored)\n        {\n            return (failoverLevelRestored != null && base.Equals(failoverLevelRestored));\n        }\n\n        public override bool Equals(object failoverLevelRestored)\n        {\n            return Equals(failoverLevelRestored as FailoverLevelRestored);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FailoverNodeInfo : DynamicData, IEquatable<FailoverNodeInfo>\n    {\n        public CustomizationIPSettings ClusterIpSettings { get; set; }\n\n        public CustomizationIPSettings FailoverIp { get; set; }\n\n        public string BiosUuid { get; set; }\n\n        public bool Equals(FailoverNodeInfo failoverNodeInfo)\n        {\n            return (failoverNodeInfo != null && ((this.ClusterIpSettings == null && failoverNodeInfo.ClusterIpSettings == null) || (this.ClusterIpSettings != null && this.ClusterIpSettings.Equals(failoverNodeInfo.ClusterIpSettings))) && ((this.FailoverIp == null && failoverNodeInfo.FailoverIp == null) || (this.FailoverIp != null && this.FailoverIp.Equals(failoverNodeInfo.FailoverIp))) && this.BiosUuid == failoverNodeInfo.BiosUuid);\n        }\n\n        public override bool Equals(object failoverNodeInfo)\n        {\n            return Equals(failoverNodeInfo as FailoverNodeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterIpSettings + \"_\" + FailoverIp + \"_\" + BiosUuid).GetHashCode();\n        }\n    }\n\n    public class FailToEnableSPBM : NotEnoughLicenses, IEquatable<FailToEnableSPBM>\n    {\n        public ManagedObjectReference Cs { get; set; }\n\n        public string CsName { get; set; }\n\n        public ComputeResourceHostSPBMLicenseInfo[] HostLicenseStates { get; set; }\n\n        public FailToEnableSPBM_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FailToEnableSPBM failToEnableSPBM)\n        {\n            return (failToEnableSPBM != null && ((this.Cs == null && failToEnableSPBM.Cs == null) || (this.Cs != null && this.Cs.Equals(failToEnableSPBM.Cs))) && this.CsName == failToEnableSPBM.CsName && ((this.HostLicenseStates == null && failToEnableSPBM.HostLicenseStates == null) || (this.HostLicenseStates != null && failToEnableSPBM.HostLicenseStates != null && Enumerable.SequenceEqual(this.HostLicenseStates, failToEnableSPBM.HostLicenseStates))) && ((this.LinkedView == null && failToEnableSPBM.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(failToEnableSPBM.LinkedView))));\n        }\n\n        public override bool Equals(object failToEnableSPBM)\n        {\n            return Equals(failToEnableSPBM as FailToEnableSPBM);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Cs + \"_\" + CsName + \"_\" + HostLicenseStates + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FailToEnableSPBM_LinkedView : IEquatable<FailToEnableSPBM_LinkedView>\n    {\n        public ComputeResource Cs { get; set; }\n\n        public bool Equals(FailToEnableSPBM_LinkedView failToEnableSPBM_LinkedView)\n        {\n            return (failToEnableSPBM_LinkedView != null && ((this.Cs == null && failToEnableSPBM_LinkedView.Cs == null) || (this.Cs != null && this.Cs.Equals(failToEnableSPBM_LinkedView.Cs))));\n        }\n\n        public override bool Equals(object failToEnableSPBM_LinkedView)\n        {\n            return Equals(failToEnableSPBM_LinkedView as FailToEnableSPBM_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Cs).GetHashCode();\n        }\n    }\n\n    public class FailToLockFaultToleranceVMs : RuntimeFault, IEquatable<FailToLockFaultToleranceVMs>\n    {\n        public string VmName { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public ManagedObjectReference AlreadyLockedVm { get; set; }\n\n        public FailToLockFaultToleranceVMs_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FailToLockFaultToleranceVMs failToLockFaultToleranceVMs)\n        {\n            return (failToLockFaultToleranceVMs != null && this.VmName == failToLockFaultToleranceVMs.VmName && ((this.Vm == null && failToLockFaultToleranceVMs.Vm == null) || (this.Vm != null && this.Vm.Equals(failToLockFaultToleranceVMs.Vm))) && ((this.AlreadyLockedVm == null && failToLockFaultToleranceVMs.AlreadyLockedVm == null) || (this.AlreadyLockedVm != null && this.AlreadyLockedVm.Equals(failToLockFaultToleranceVMs.AlreadyLockedVm))) && ((this.LinkedView == null && failToLockFaultToleranceVMs.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(failToLockFaultToleranceVMs.LinkedView))));\n        }\n\n        public override bool Equals(object failToLockFaultToleranceVMs)\n        {\n            return Equals(failToLockFaultToleranceVMs as FailToLockFaultToleranceVMs);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName + \"_\" + Vm + \"_\" + AlreadyLockedVm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FailToLockFaultToleranceVMs_LinkedView : IEquatable<FailToLockFaultToleranceVMs_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public VirtualMachine AlreadyLockedVm { get; set; }\n\n        public bool Equals(FailToLockFaultToleranceVMs_LinkedView failToLockFaultToleranceVMs_LinkedView)\n        {\n            return (failToLockFaultToleranceVMs_LinkedView != null && ((this.Vm == null && failToLockFaultToleranceVMs_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(failToLockFaultToleranceVMs_LinkedView.Vm))) && ((this.AlreadyLockedVm == null && failToLockFaultToleranceVMs_LinkedView.AlreadyLockedVm == null) || (this.AlreadyLockedVm != null && this.AlreadyLockedVm.Equals(failToLockFaultToleranceVMs_LinkedView.AlreadyLockedVm))));\n        }\n\n        public override bool Equals(object failToLockFaultToleranceVMs_LinkedView)\n        {\n            return Equals(failToLockFaultToleranceVMs_LinkedView as FailToLockFaultToleranceVMs_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + AlreadyLockedVm).GetHashCode();\n        }\n    }\n\n    public class FaultDomainId : DynamicData, IEquatable<FaultDomainId>\n    {\n        public string Id { get; set; }\n\n        public bool Equals(FaultDomainId faultDomainId)\n        {\n            return (faultDomainId != null && this.Id == faultDomainId.Id);\n        }\n\n        public override bool Equals(object faultDomainId)\n        {\n            return Equals(faultDomainId as FaultDomainId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id).GetHashCode();\n        }\n    }\n\n    public class FaultsByHost : DynamicData, IEquatable<FaultsByHost>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault[] Faults { get; set; }\n\n        public FaultsByHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultsByHost faultsByHost)\n        {\n            return (faultsByHost != null && ((this.Host == null && faultsByHost.Host == null) || (this.Host != null && this.Host.Equals(faultsByHost.Host))) && ((this.Faults == null && faultsByHost.Faults == null) || (this.Faults != null && faultsByHost.Faults != null && Enumerable.SequenceEqual(this.Faults, faultsByHost.Faults))) && ((this.LinkedView == null && faultsByHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultsByHost.LinkedView))));\n        }\n\n        public override bool Equals(object faultsByHost)\n        {\n            return Equals(faultsByHost as FaultsByHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Faults + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultsByHost_LinkedView : IEquatable<FaultsByHost_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(FaultsByHost_LinkedView faultsByHost_LinkedView)\n        {\n            return (faultsByHost_LinkedView != null && ((this.Host == null && faultsByHost_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(faultsByHost_LinkedView.Host))));\n        }\n\n        public override bool Equals(object faultsByHost_LinkedView)\n        {\n            return Equals(faultsByHost_LinkedView as FaultsByHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class FaultsByVM : DynamicData, IEquatable<FaultsByVM>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public LocalizedMethodFault[] Faults { get; set; }\n\n        public FaultsByVM_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultsByVM faultsByVM)\n        {\n            return (faultsByVM != null && ((this.Vm == null && faultsByVM.Vm == null) || (this.Vm != null && this.Vm.Equals(faultsByVM.Vm))) && ((this.Faults == null && faultsByVM.Faults == null) || (this.Faults != null && faultsByVM.Faults != null && Enumerable.SequenceEqual(this.Faults, faultsByVM.Faults))) && ((this.LinkedView == null && faultsByVM.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultsByVM.LinkedView))));\n        }\n\n        public override bool Equals(object faultsByVM)\n        {\n            return Equals(faultsByVM as FaultsByVM);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Faults + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultsByVM_LinkedView : IEquatable<FaultsByVM_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(FaultsByVM_LinkedView faultsByVM_LinkedView)\n        {\n            return (faultsByVM_LinkedView != null && ((this.Vm == null && faultsByVM_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(faultsByVM_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object faultsByVM_LinkedView)\n        {\n            return Equals(faultsByVM_LinkedView as FaultsByVM_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceAntiAffinityViolated : MigrationFault, IEquatable<FaultToleranceAntiAffinityViolated>\n    {\n        public string HostName { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public FaultToleranceAntiAffinityViolated_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceAntiAffinityViolated faultToleranceAntiAffinityViolated)\n        {\n            return (faultToleranceAntiAffinityViolated != null && this.HostName == faultToleranceAntiAffinityViolated.HostName && ((this.Host == null && faultToleranceAntiAffinityViolated.Host == null) || (this.Host != null && this.Host.Equals(faultToleranceAntiAffinityViolated.Host))) && ((this.LinkedView == null && faultToleranceAntiAffinityViolated.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceAntiAffinityViolated.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceAntiAffinityViolated)\n        {\n            return Equals(faultToleranceAntiAffinityViolated as FaultToleranceAntiAffinityViolated);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceAntiAffinityViolated_LinkedView : IEquatable<FaultToleranceAntiAffinityViolated_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(FaultToleranceAntiAffinityViolated_LinkedView faultToleranceAntiAffinityViolated_LinkedView)\n        {\n            return (faultToleranceAntiAffinityViolated_LinkedView != null && ((this.Host == null && faultToleranceAntiAffinityViolated_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(faultToleranceAntiAffinityViolated_LinkedView.Host))));\n        }\n\n        public override bool Equals(object faultToleranceAntiAffinityViolated_LinkedView)\n        {\n            return Equals(faultToleranceAntiAffinityViolated_LinkedView as FaultToleranceAntiAffinityViolated_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceCannotEditMem : VmConfigFault, IEquatable<FaultToleranceCannotEditMem>\n    {\n        public string VmName { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public FaultToleranceCannotEditMem_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceCannotEditMem faultToleranceCannotEditMem)\n        {\n            return (faultToleranceCannotEditMem != null && this.VmName == faultToleranceCannotEditMem.VmName && ((this.Vm == null && faultToleranceCannotEditMem.Vm == null) || (this.Vm != null && this.Vm.Equals(faultToleranceCannotEditMem.Vm))) && ((this.LinkedView == null && faultToleranceCannotEditMem.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceCannotEditMem.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceCannotEditMem)\n        {\n            return Equals(faultToleranceCannotEditMem as FaultToleranceCannotEditMem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceCannotEditMem_LinkedView : IEquatable<FaultToleranceCannotEditMem_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(FaultToleranceCannotEditMem_LinkedView faultToleranceCannotEditMem_LinkedView)\n        {\n            return (faultToleranceCannotEditMem_LinkedView != null && ((this.Vm == null && faultToleranceCannotEditMem_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(faultToleranceCannotEditMem_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object faultToleranceCannotEditMem_LinkedView)\n        {\n            return Equals(faultToleranceCannotEditMem_LinkedView as FaultToleranceCannotEditMem_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceConfigInfo : DynamicData, IEquatable<FaultToleranceConfigInfo>\n    {\n        public int Role { get; set; }\n\n        public string[] InstanceUuids { get; set; }\n\n        public string[] ConfigPaths { get; set; }\n\n        public bool? Orphaned { get; set; }\n\n        public bool Equals(FaultToleranceConfigInfo faultToleranceConfigInfo)\n        {\n            return (faultToleranceConfigInfo != null && this.Role == faultToleranceConfigInfo.Role && ((this.InstanceUuids == null && faultToleranceConfigInfo.InstanceUuids == null) || (this.InstanceUuids != null && faultToleranceConfigInfo.InstanceUuids != null && Enumerable.SequenceEqual(this.InstanceUuids, faultToleranceConfigInfo.InstanceUuids))) && ((this.ConfigPaths == null && faultToleranceConfigInfo.ConfigPaths == null) || (this.ConfigPaths != null && faultToleranceConfigInfo.ConfigPaths != null && Enumerable.SequenceEqual(this.ConfigPaths, faultToleranceConfigInfo.ConfigPaths))) && ((this.Orphaned == null && faultToleranceConfigInfo.Orphaned == null) || (this.Orphaned != null && this.Orphaned.Equals(faultToleranceConfigInfo.Orphaned))));\n        }\n\n        public override bool Equals(object faultToleranceConfigInfo)\n        {\n            return Equals(faultToleranceConfigInfo as FaultToleranceConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Role + \"_\" + InstanceUuids + \"_\" + ConfigPaths + \"_\" + Orphaned).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceConfigSpec : DynamicData, IEquatable<FaultToleranceConfigSpec>\n    {\n        public FaultToleranceMetaSpec MetaDataPath { get; set; }\n\n        public FaultToleranceVMConfigSpec SecondaryVmSpec { get; set; }\n\n        public bool Equals(FaultToleranceConfigSpec faultToleranceConfigSpec)\n        {\n            return (faultToleranceConfigSpec != null && ((this.MetaDataPath == null && faultToleranceConfigSpec.MetaDataPath == null) || (this.MetaDataPath != null && this.MetaDataPath.Equals(faultToleranceConfigSpec.MetaDataPath))) && ((this.SecondaryVmSpec == null && faultToleranceConfigSpec.SecondaryVmSpec == null) || (this.SecondaryVmSpec != null && this.SecondaryVmSpec.Equals(faultToleranceConfigSpec.SecondaryVmSpec))));\n        }\n\n        public override bool Equals(object faultToleranceConfigSpec)\n        {\n            return Equals(faultToleranceConfigSpec as FaultToleranceConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MetaDataPath + \"_\" + SecondaryVmSpec).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceCpuIncompatible : CpuIncompatible, IEquatable<FaultToleranceCpuIncompatible>\n    {\n        public bool Model { get; set; }\n\n        public bool Family { get; set; }\n\n        public bool Stepping { get; set; }\n\n        public new FaultToleranceCpuIncompatible_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceCpuIncompatible faultToleranceCpuIncompatible)\n        {\n            return (faultToleranceCpuIncompatible != null && this.Model == faultToleranceCpuIncompatible.Model && this.Family == faultToleranceCpuIncompatible.Family && this.Stepping == faultToleranceCpuIncompatible.Stepping && ((this.LinkedView == null && faultToleranceCpuIncompatible.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceCpuIncompatible.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceCpuIncompatible)\n        {\n            return Equals(faultToleranceCpuIncompatible as FaultToleranceCpuIncompatible);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Model + \"_\" + Family + \"_\" + Stepping + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceCpuIncompatible_LinkedView : CpuIncompatible_LinkedView, IEquatable<FaultToleranceCpuIncompatible_LinkedView>\n    {\n        public bool Equals(FaultToleranceCpuIncompatible_LinkedView faultToleranceCpuIncompatible_LinkedView)\n        {\n            return (faultToleranceCpuIncompatible_LinkedView != null && base.Equals(faultToleranceCpuIncompatible_LinkedView));\n        }\n\n        public override bool Equals(object faultToleranceCpuIncompatible_LinkedView)\n        {\n            return Equals(faultToleranceCpuIncompatible_LinkedView as FaultToleranceCpuIncompatible_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FaultToleranceDiskSpec : DynamicData, IEquatable<FaultToleranceDiskSpec>\n    {\n        public VirtualDevice Disk { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public FaultToleranceDiskSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceDiskSpec faultToleranceDiskSpec)\n        {\n            return (faultToleranceDiskSpec != null && ((this.Disk == null && faultToleranceDiskSpec.Disk == null) || (this.Disk != null && this.Disk.Equals(faultToleranceDiskSpec.Disk))) && ((this.Datastore == null && faultToleranceDiskSpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(faultToleranceDiskSpec.Datastore))) && ((this.LinkedView == null && faultToleranceDiskSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceDiskSpec.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceDiskSpec)\n        {\n            return Equals(faultToleranceDiskSpec as FaultToleranceDiskSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk + \"_\" + Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceDiskSpec_LinkedView : IEquatable<FaultToleranceDiskSpec_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(FaultToleranceDiskSpec_LinkedView faultToleranceDiskSpec_LinkedView)\n        {\n            return (faultToleranceDiskSpec_LinkedView != null && ((this.Datastore == null && faultToleranceDiskSpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(faultToleranceDiskSpec_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object faultToleranceDiskSpec_LinkedView)\n        {\n            return Equals(faultToleranceDiskSpec_LinkedView as FaultToleranceDiskSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceMetaSpec : DynamicData, IEquatable<FaultToleranceMetaSpec>\n    {\n        public ManagedObjectReference MetaDataDatastore { get; set; }\n\n        public FaultToleranceMetaSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceMetaSpec faultToleranceMetaSpec)\n        {\n            return (faultToleranceMetaSpec != null && ((this.MetaDataDatastore == null && faultToleranceMetaSpec.MetaDataDatastore == null) || (this.MetaDataDatastore != null && this.MetaDataDatastore.Equals(faultToleranceMetaSpec.MetaDataDatastore))) && ((this.LinkedView == null && faultToleranceMetaSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceMetaSpec.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceMetaSpec)\n        {\n            return Equals(faultToleranceMetaSpec as FaultToleranceMetaSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MetaDataDatastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceMetaSpec_LinkedView : IEquatable<FaultToleranceMetaSpec_LinkedView>\n    {\n        public Datastore MetaDataDatastore { get; set; }\n\n        public bool Equals(FaultToleranceMetaSpec_LinkedView faultToleranceMetaSpec_LinkedView)\n        {\n            return (faultToleranceMetaSpec_LinkedView != null && ((this.MetaDataDatastore == null && faultToleranceMetaSpec_LinkedView.MetaDataDatastore == null) || (this.MetaDataDatastore != null && this.MetaDataDatastore.Equals(faultToleranceMetaSpec_LinkedView.MetaDataDatastore))));\n        }\n\n        public override bool Equals(object faultToleranceMetaSpec_LinkedView)\n        {\n            return Equals(faultToleranceMetaSpec_LinkedView as FaultToleranceMetaSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MetaDataDatastore).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceNeedsThickDisk : MigrationFault, IEquatable<FaultToleranceNeedsThickDisk>\n    {\n        public string VmName { get; set; }\n\n        public bool Equals(FaultToleranceNeedsThickDisk faultToleranceNeedsThickDisk)\n        {\n            return (faultToleranceNeedsThickDisk != null && this.VmName == faultToleranceNeedsThickDisk.VmName);\n        }\n\n        public override bool Equals(object faultToleranceNeedsThickDisk)\n        {\n            return Equals(faultToleranceNeedsThickDisk as FaultToleranceNeedsThickDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceNotLicensed : VmFaultToleranceIssue, IEquatable<FaultToleranceNotLicensed>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(FaultToleranceNotLicensed faultToleranceNotLicensed)\n        {\n            return (faultToleranceNotLicensed != null && this.HostName == faultToleranceNotLicensed.HostName);\n        }\n\n        public override bool Equals(object faultToleranceNotLicensed)\n        {\n            return Equals(faultToleranceNotLicensed as FaultToleranceNotLicensed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceNotSameBuild : MigrationFault, IEquatable<FaultToleranceNotSameBuild>\n    {\n        public string Build { get; set; }\n\n        public bool Equals(FaultToleranceNotSameBuild faultToleranceNotSameBuild)\n        {\n            return (faultToleranceNotSameBuild != null && this.Build == faultToleranceNotSameBuild.Build);\n        }\n\n        public override bool Equals(object faultToleranceNotSameBuild)\n        {\n            return Equals(faultToleranceNotSameBuild as FaultToleranceNotSameBuild);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Build).GetHashCode();\n        }\n    }\n\n    public class FaultTolerancePrimaryConfigInfo : FaultToleranceConfigInfo, IEquatable<FaultTolerancePrimaryConfigInfo>\n    {\n        public ManagedObjectReference[] Secondaries { get; set; }\n\n        public FaultTolerancePrimaryConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultTolerancePrimaryConfigInfo faultTolerancePrimaryConfigInfo)\n        {\n            return (faultTolerancePrimaryConfigInfo != null && ((this.Secondaries == null && faultTolerancePrimaryConfigInfo.Secondaries == null) || (this.Secondaries != null && faultTolerancePrimaryConfigInfo.Secondaries != null && Enumerable.SequenceEqual(this.Secondaries, faultTolerancePrimaryConfigInfo.Secondaries))) && ((this.LinkedView == null && faultTolerancePrimaryConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultTolerancePrimaryConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object faultTolerancePrimaryConfigInfo)\n        {\n            return Equals(faultTolerancePrimaryConfigInfo as FaultTolerancePrimaryConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Secondaries + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultTolerancePrimaryConfigInfo_LinkedView : IEquatable<FaultTolerancePrimaryConfigInfo_LinkedView>\n    {\n        public VirtualMachine[] Secondaries { get; set; }\n\n        public bool Equals(FaultTolerancePrimaryConfigInfo_LinkedView faultTolerancePrimaryConfigInfo_LinkedView)\n        {\n            return (faultTolerancePrimaryConfigInfo_LinkedView != null && ((this.Secondaries == null && faultTolerancePrimaryConfigInfo_LinkedView.Secondaries == null) || (this.Secondaries != null && faultTolerancePrimaryConfigInfo_LinkedView.Secondaries != null && Enumerable.SequenceEqual(this.Secondaries, faultTolerancePrimaryConfigInfo_LinkedView.Secondaries))));\n        }\n\n        public override bool Equals(object faultTolerancePrimaryConfigInfo_LinkedView)\n        {\n            return Equals(faultTolerancePrimaryConfigInfo_LinkedView as FaultTolerancePrimaryConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Secondaries).GetHashCode();\n        }\n    }\n\n    public class FaultTolerancePrimaryPowerOnNotAttempted : VmFaultToleranceIssue, IEquatable<FaultTolerancePrimaryPowerOnNotAttempted>\n    {\n        public ManagedObjectReference SecondaryVm { get; set; }\n\n        public ManagedObjectReference PrimaryVm { get; set; }\n\n        public FaultTolerancePrimaryPowerOnNotAttempted_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultTolerancePrimaryPowerOnNotAttempted faultTolerancePrimaryPowerOnNotAttempted)\n        {\n            return (faultTolerancePrimaryPowerOnNotAttempted != null && ((this.SecondaryVm == null && faultTolerancePrimaryPowerOnNotAttempted.SecondaryVm == null) || (this.SecondaryVm != null && this.SecondaryVm.Equals(faultTolerancePrimaryPowerOnNotAttempted.SecondaryVm))) && ((this.PrimaryVm == null && faultTolerancePrimaryPowerOnNotAttempted.PrimaryVm == null) || (this.PrimaryVm != null && this.PrimaryVm.Equals(faultTolerancePrimaryPowerOnNotAttempted.PrimaryVm))) && ((this.LinkedView == null && faultTolerancePrimaryPowerOnNotAttempted.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultTolerancePrimaryPowerOnNotAttempted.LinkedView))));\n        }\n\n        public override bool Equals(object faultTolerancePrimaryPowerOnNotAttempted)\n        {\n            return Equals(faultTolerancePrimaryPowerOnNotAttempted as FaultTolerancePrimaryPowerOnNotAttempted);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SecondaryVm + \"_\" + PrimaryVm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultTolerancePrimaryPowerOnNotAttempted_LinkedView : IEquatable<FaultTolerancePrimaryPowerOnNotAttempted_LinkedView>\n    {\n        public VirtualMachine SecondaryVm { get; set; }\n\n        public VirtualMachine PrimaryVm { get; set; }\n\n        public bool Equals(FaultTolerancePrimaryPowerOnNotAttempted_LinkedView faultTolerancePrimaryPowerOnNotAttempted_LinkedView)\n        {\n            return (faultTolerancePrimaryPowerOnNotAttempted_LinkedView != null && ((this.SecondaryVm == null && faultTolerancePrimaryPowerOnNotAttempted_LinkedView.SecondaryVm == null) || (this.SecondaryVm != null && this.SecondaryVm.Equals(faultTolerancePrimaryPowerOnNotAttempted_LinkedView.SecondaryVm))) && ((this.PrimaryVm == null && faultTolerancePrimaryPowerOnNotAttempted_LinkedView.PrimaryVm == null) || (this.PrimaryVm != null && this.PrimaryVm.Equals(faultTolerancePrimaryPowerOnNotAttempted_LinkedView.PrimaryVm))));\n        }\n\n        public override bool Equals(object faultTolerancePrimaryPowerOnNotAttempted_LinkedView)\n        {\n            return Equals(faultTolerancePrimaryPowerOnNotAttempted_LinkedView as FaultTolerancePrimaryPowerOnNotAttempted_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SecondaryVm + \"_\" + PrimaryVm).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceSecondaryConfigInfo : FaultToleranceConfigInfo, IEquatable<FaultToleranceSecondaryConfigInfo>\n    {\n        public ManagedObjectReference PrimaryVM { get; set; }\n\n        public FaultToleranceSecondaryConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceSecondaryConfigInfo faultToleranceSecondaryConfigInfo)\n        {\n            return (faultToleranceSecondaryConfigInfo != null && ((this.PrimaryVM == null && faultToleranceSecondaryConfigInfo.PrimaryVM == null) || (this.PrimaryVM != null && this.PrimaryVM.Equals(faultToleranceSecondaryConfigInfo.PrimaryVM))) && ((this.LinkedView == null && faultToleranceSecondaryConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceSecondaryConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceSecondaryConfigInfo)\n        {\n            return Equals(faultToleranceSecondaryConfigInfo as FaultToleranceSecondaryConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrimaryVM + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceSecondaryConfigInfo_LinkedView : IEquatable<FaultToleranceSecondaryConfigInfo_LinkedView>\n    {\n        public VirtualMachine PrimaryVM { get; set; }\n\n        public bool Equals(FaultToleranceSecondaryConfigInfo_LinkedView faultToleranceSecondaryConfigInfo_LinkedView)\n        {\n            return (faultToleranceSecondaryConfigInfo_LinkedView != null && ((this.PrimaryVM == null && faultToleranceSecondaryConfigInfo_LinkedView.PrimaryVM == null) || (this.PrimaryVM != null && this.PrimaryVM.Equals(faultToleranceSecondaryConfigInfo_LinkedView.PrimaryVM))));\n        }\n\n        public override bool Equals(object faultToleranceSecondaryConfigInfo_LinkedView)\n        {\n            return Equals(faultToleranceSecondaryConfigInfo_LinkedView as FaultToleranceSecondaryConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrimaryVM).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceSecondaryOpResult : DynamicData, IEquatable<FaultToleranceSecondaryOpResult>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public bool PowerOnAttempted { get; set; }\n\n        public ClusterPowerOnVmResult PowerOnResult { get; set; }\n\n        public FaultToleranceSecondaryOpResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceSecondaryOpResult faultToleranceSecondaryOpResult)\n        {\n            return (faultToleranceSecondaryOpResult != null && ((this.Vm == null && faultToleranceSecondaryOpResult.Vm == null) || (this.Vm != null && this.Vm.Equals(faultToleranceSecondaryOpResult.Vm))) && this.PowerOnAttempted == faultToleranceSecondaryOpResult.PowerOnAttempted && ((this.PowerOnResult == null && faultToleranceSecondaryOpResult.PowerOnResult == null) || (this.PowerOnResult != null && this.PowerOnResult.Equals(faultToleranceSecondaryOpResult.PowerOnResult))) && ((this.LinkedView == null && faultToleranceSecondaryOpResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceSecondaryOpResult.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceSecondaryOpResult)\n        {\n            return Equals(faultToleranceSecondaryOpResult as FaultToleranceSecondaryOpResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + PowerOnAttempted + \"_\" + PowerOnResult + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceSecondaryOpResult_LinkedView : IEquatable<FaultToleranceSecondaryOpResult_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(FaultToleranceSecondaryOpResult_LinkedView faultToleranceSecondaryOpResult_LinkedView)\n        {\n            return (faultToleranceSecondaryOpResult_LinkedView != null && ((this.Vm == null && faultToleranceSecondaryOpResult_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(faultToleranceSecondaryOpResult_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object faultToleranceSecondaryOpResult_LinkedView)\n        {\n            return Equals(faultToleranceSecondaryOpResult_LinkedView as FaultToleranceSecondaryOpResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceVMConfigSpec : DynamicData, IEquatable<FaultToleranceVMConfigSpec>\n    {\n        public ManagedObjectReference VmConfig { get; set; }\n\n        public FaultToleranceDiskSpec[] Disks { get; set; }\n\n        public FaultToleranceVMConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceVMConfigSpec faultToleranceVMConfigSpec)\n        {\n            return (faultToleranceVMConfigSpec != null && ((this.VmConfig == null && faultToleranceVMConfigSpec.VmConfig == null) || (this.VmConfig != null && this.VmConfig.Equals(faultToleranceVMConfigSpec.VmConfig))) && ((this.Disks == null && faultToleranceVMConfigSpec.Disks == null) || (this.Disks != null && faultToleranceVMConfigSpec.Disks != null && Enumerable.SequenceEqual(this.Disks, faultToleranceVMConfigSpec.Disks))) && ((this.LinkedView == null && faultToleranceVMConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceVMConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceVMConfigSpec)\n        {\n            return Equals(faultToleranceVMConfigSpec as FaultToleranceVMConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmConfig + \"_\" + Disks + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceVMConfigSpec_LinkedView : IEquatable<FaultToleranceVMConfigSpec_LinkedView>\n    {\n        public Datastore VmConfig { get; set; }\n\n        public bool Equals(FaultToleranceVMConfigSpec_LinkedView faultToleranceVMConfigSpec_LinkedView)\n        {\n            return (faultToleranceVMConfigSpec_LinkedView != null && ((this.VmConfig == null && faultToleranceVMConfigSpec_LinkedView.VmConfig == null) || (this.VmConfig != null && this.VmConfig.Equals(faultToleranceVMConfigSpec_LinkedView.VmConfig))));\n        }\n\n        public override bool Equals(object faultToleranceVMConfigSpec_LinkedView)\n        {\n            return Equals(faultToleranceVMConfigSpec_LinkedView as FaultToleranceVMConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmConfig).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceVmNotDasProtected : VimFault, IEquatable<FaultToleranceVmNotDasProtected>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public FaultToleranceVmNotDasProtected_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FaultToleranceVmNotDasProtected faultToleranceVmNotDasProtected)\n        {\n            return (faultToleranceVmNotDasProtected != null && ((this.Vm == null && faultToleranceVmNotDasProtected.Vm == null) || (this.Vm != null && this.Vm.Equals(faultToleranceVmNotDasProtected.Vm))) && this.VmName == faultToleranceVmNotDasProtected.VmName && ((this.LinkedView == null && faultToleranceVmNotDasProtected.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(faultToleranceVmNotDasProtected.LinkedView))));\n        }\n\n        public override bool Equals(object faultToleranceVmNotDasProtected)\n        {\n            return Equals(faultToleranceVmNotDasProtected as FaultToleranceVmNotDasProtected);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FaultToleranceVmNotDasProtected_LinkedView : IEquatable<FaultToleranceVmNotDasProtected_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(FaultToleranceVmNotDasProtected_LinkedView faultToleranceVmNotDasProtected_LinkedView)\n        {\n            return (faultToleranceVmNotDasProtected_LinkedView != null && ((this.Vm == null && faultToleranceVmNotDasProtected_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(faultToleranceVmNotDasProtected_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object faultToleranceVmNotDasProtected_LinkedView)\n        {\n            return Equals(faultToleranceVmNotDasProtected_LinkedView as FaultToleranceVmNotDasProtected_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class FcoeConfig : DynamicData, IEquatable<FcoeConfig>\n    {\n        public int PriorityClass { get; set; }\n\n        public string SourceMac { get; set; }\n\n        public FcoeConfigVlanRange[] VlanRange { get; set; }\n\n        public FcoeConfigFcoeCapabilities Capabilities { get; set; }\n\n        public bool FcoeActive { get; set; }\n\n        public bool Equals(FcoeConfig fcoeConfig)\n        {\n            return (fcoeConfig != null && this.PriorityClass == fcoeConfig.PriorityClass && this.SourceMac == fcoeConfig.SourceMac && ((this.VlanRange == null && fcoeConfig.VlanRange == null) || (this.VlanRange != null && fcoeConfig.VlanRange != null && Enumerable.SequenceEqual(this.VlanRange, fcoeConfig.VlanRange))) && ((this.Capabilities == null && fcoeConfig.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(fcoeConfig.Capabilities))) && this.FcoeActive == fcoeConfig.FcoeActive);\n        }\n\n        public override bool Equals(object fcoeConfig)\n        {\n            return Equals(fcoeConfig as FcoeConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PriorityClass + \"_\" + SourceMac + \"_\" + VlanRange + \"_\" + Capabilities + \"_\" + FcoeActive).GetHashCode();\n        }\n    }\n\n    public class FcoeConfigFcoeCapabilities : DynamicData, IEquatable<FcoeConfigFcoeCapabilities>\n    {\n        public bool PriorityClass { get; set; }\n\n        public bool SourceMacAddress { get; set; }\n\n        public bool VlanRange { get; set; }\n\n        public bool Equals(FcoeConfigFcoeCapabilities fcoeConfigFcoeCapabilities)\n        {\n            return (fcoeConfigFcoeCapabilities != null && this.PriorityClass == fcoeConfigFcoeCapabilities.PriorityClass && this.SourceMacAddress == fcoeConfigFcoeCapabilities.SourceMacAddress && this.VlanRange == fcoeConfigFcoeCapabilities.VlanRange);\n        }\n\n        public override bool Equals(object fcoeConfigFcoeCapabilities)\n        {\n            return Equals(fcoeConfigFcoeCapabilities as FcoeConfigFcoeCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PriorityClass + \"_\" + SourceMacAddress + \"_\" + VlanRange).GetHashCode();\n        }\n    }\n\n    public class FcoeConfigFcoeSpecification : DynamicData, IEquatable<FcoeConfigFcoeSpecification>\n    {\n        public string UnderlyingPnic { get; set; }\n\n        public int? PriorityClass { get; set; }\n\n        public string SourceMac { get; set; }\n\n        public FcoeConfigVlanRange[] VlanRange { get; set; }\n\n        public bool Equals(FcoeConfigFcoeSpecification fcoeConfigFcoeSpecification)\n        {\n            return (fcoeConfigFcoeSpecification != null && this.UnderlyingPnic == fcoeConfigFcoeSpecification.UnderlyingPnic && ((this.PriorityClass == null && fcoeConfigFcoeSpecification.PriorityClass == null) || (this.PriorityClass != null && this.PriorityClass.Equals(fcoeConfigFcoeSpecification.PriorityClass))) && this.SourceMac == fcoeConfigFcoeSpecification.SourceMac && ((this.VlanRange == null && fcoeConfigFcoeSpecification.VlanRange == null) || (this.VlanRange != null && fcoeConfigFcoeSpecification.VlanRange != null && Enumerable.SequenceEqual(this.VlanRange, fcoeConfigFcoeSpecification.VlanRange))));\n        }\n\n        public override bool Equals(object fcoeConfigFcoeSpecification)\n        {\n            return Equals(fcoeConfigFcoeSpecification as FcoeConfigFcoeSpecification);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UnderlyingPnic + \"_\" + PriorityClass + \"_\" + SourceMac + \"_\" + VlanRange).GetHashCode();\n        }\n    }\n\n    public class FcoeConfigVlanRange : DynamicData, IEquatable<FcoeConfigVlanRange>\n    {\n        public int VlanLow { get; set; }\n\n        public int VlanHigh { get; set; }\n\n        public bool Equals(FcoeConfigVlanRange fcoeConfigVlanRange)\n        {\n            return (fcoeConfigVlanRange != null && this.VlanLow == fcoeConfigVlanRange.VlanLow && this.VlanHigh == fcoeConfigVlanRange.VlanHigh);\n        }\n\n        public override bool Equals(object fcoeConfigVlanRange)\n        {\n            return Equals(fcoeConfigVlanRange as FcoeConfigVlanRange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanLow + \"_\" + VlanHigh).GetHashCode();\n        }\n    }\n\n    public class FcoeFault : VimFault, IEquatable<FcoeFault>\n    {\n        public bool Equals(FcoeFault fcoeFault)\n        {\n            return (fcoeFault != null && base.Equals(fcoeFault));\n        }\n\n        public override bool Equals(object fcoeFault)\n        {\n            return Equals(fcoeFault as FcoeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FcoeFaultPnicHasNoPortSet : FcoeFault, IEquatable<FcoeFaultPnicHasNoPortSet>\n    {\n        public string NicDevice { get; set; }\n\n        public bool Equals(FcoeFaultPnicHasNoPortSet fcoeFaultPnicHasNoPortSet)\n        {\n            return (fcoeFaultPnicHasNoPortSet != null && this.NicDevice == fcoeFaultPnicHasNoPortSet.NicDevice);\n        }\n\n        public override bool Equals(object fcoeFaultPnicHasNoPortSet)\n        {\n            return Equals(fcoeFaultPnicHasNoPortSet as FcoeFaultPnicHasNoPortSet);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NicDevice).GetHashCode();\n        }\n    }\n\n    public class FeatureRequirementsNotMet : VirtualHardwareCompatibilityIssue, IEquatable<FeatureRequirementsNotMet>\n    {\n        public VirtualMachineFeatureRequirement[] FeatureRequirement { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public FeatureRequirementsNotMet_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FeatureRequirementsNotMet featureRequirementsNotMet)\n        {\n            return (featureRequirementsNotMet != null && ((this.FeatureRequirement == null && featureRequirementsNotMet.FeatureRequirement == null) || (this.FeatureRequirement != null && featureRequirementsNotMet.FeatureRequirement != null && Enumerable.SequenceEqual(this.FeatureRequirement, featureRequirementsNotMet.FeatureRequirement))) && ((this.Vm == null && featureRequirementsNotMet.Vm == null) || (this.Vm != null && this.Vm.Equals(featureRequirementsNotMet.Vm))) && ((this.Host == null && featureRequirementsNotMet.Host == null) || (this.Host != null && this.Host.Equals(featureRequirementsNotMet.Host))) && ((this.LinkedView == null && featureRequirementsNotMet.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(featureRequirementsNotMet.LinkedView))));\n        }\n\n        public override bool Equals(object featureRequirementsNotMet)\n        {\n            return Equals(featureRequirementsNotMet as FeatureRequirementsNotMet);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FeatureRequirement + \"_\" + Vm + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FeatureRequirementsNotMet_LinkedView : IEquatable<FeatureRequirementsNotMet_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public HostSystem Host { get; set; }\n\n        public bool Equals(FeatureRequirementsNotMet_LinkedView featureRequirementsNotMet_LinkedView)\n        {\n            return (featureRequirementsNotMet_LinkedView != null && ((this.Vm == null && featureRequirementsNotMet_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(featureRequirementsNotMet_LinkedView.Vm))) && ((this.Host == null && featureRequirementsNotMet_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(featureRequirementsNotMet_LinkedView.Host))));\n        }\n\n        public override bool Equals(object featureRequirementsNotMet_LinkedView)\n        {\n            return Equals(featureRequirementsNotMet_LinkedView as FeatureRequirementsNotMet_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class FileAlreadyExists : FileFault, IEquatable<FileAlreadyExists>\n    {\n        public bool Equals(FileAlreadyExists fileAlreadyExists)\n        {\n            return (fileAlreadyExists != null && base.Equals(fileAlreadyExists));\n        }\n\n        public override bool Equals(object fileAlreadyExists)\n        {\n            return Equals(fileAlreadyExists as FileAlreadyExists);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileBackedPortNotSupported : DeviceNotSupported, IEquatable<FileBackedPortNotSupported>\n    {\n        public bool Equals(FileBackedPortNotSupported fileBackedPortNotSupported)\n        {\n            return (fileBackedPortNotSupported != null && base.Equals(fileBackedPortNotSupported));\n        }\n\n        public override bool Equals(object fileBackedPortNotSupported)\n        {\n            return Equals(fileBackedPortNotSupported as FileBackedPortNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileBackedVirtualDiskSpec : VirtualDiskSpec, IEquatable<FileBackedVirtualDiskSpec>\n    {\n        public long CapacityKb { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public CryptoSpec Crypto { get; set; }\n\n        public bool Equals(FileBackedVirtualDiskSpec fileBackedVirtualDiskSpec)\n        {\n            return (fileBackedVirtualDiskSpec != null && this.CapacityKb == fileBackedVirtualDiskSpec.CapacityKb && ((this.Profile == null && fileBackedVirtualDiskSpec.Profile == null) || (this.Profile != null && fileBackedVirtualDiskSpec.Profile != null && Enumerable.SequenceEqual(this.Profile, fileBackedVirtualDiskSpec.Profile))) && ((this.Crypto == null && fileBackedVirtualDiskSpec.Crypto == null) || (this.Crypto != null && this.Crypto.Equals(fileBackedVirtualDiskSpec.Crypto))));\n        }\n\n        public override bool Equals(object fileBackedVirtualDiskSpec)\n        {\n            return Equals(fileBackedVirtualDiskSpec as FileBackedVirtualDiskSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityKb + \"_\" + Profile + \"_\" + Crypto).GetHashCode();\n        }\n    }\n\n    public class FileFault : VimFault, IEquatable<FileFault>\n    {\n        public string File { get; set; }\n\n        public bool Equals(FileFault fileFault)\n        {\n            return (fileFault != null && this.File == fileFault.File);\n        }\n\n        public override bool Equals(object fileFault)\n        {\n            return Equals(fileFault as FileFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (File).GetHashCode();\n        }\n    }\n\n    public class FileInfo : DynamicData, IEquatable<FileInfo>\n    {\n        public string Path { get; set; }\n\n        public string FriendlyName { get; set; }\n\n        public long? FileSize { get; set; }\n\n        public DateTime? Modification { get; set; }\n\n        public string Owner { get; set; }\n\n        public bool Equals(FileInfo fileInfo)\n        {\n            return (fileInfo != null && this.Path == fileInfo.Path && this.FriendlyName == fileInfo.FriendlyName && ((this.FileSize == null && fileInfo.FileSize == null) || (this.FileSize != null && this.FileSize.Equals(fileInfo.FileSize))) && ((this.Modification == null && fileInfo.Modification == null) || (this.Modification != null && this.Modification.Equals(fileInfo.Modification))) && this.Owner == fileInfo.Owner);\n        }\n\n        public override bool Equals(object fileInfo)\n        {\n            return Equals(fileInfo as FileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path + \"_\" + FriendlyName + \"_\" + FileSize + \"_\" + Modification + \"_\" + Owner).GetHashCode();\n        }\n    }\n\n    public class FileLocked : FileFault, IEquatable<FileLocked>\n    {\n        public bool Equals(FileLocked fileLocked)\n        {\n            return (fileLocked != null && base.Equals(fileLocked));\n        }\n\n        public override bool Equals(object fileLocked)\n        {\n            return Equals(fileLocked as FileLocked);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileManager : ViewBase, IEquatable<FileManager>\n    {\n        public ManagedObjectReference MoveDatastoreFile_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destinationName, ManagedObjectReference destinationDatacenter, bool? force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MoveDatastoreFile(string sourceName, ManagedObjectReference sourceDatacenter, string destinationName, ManagedObjectReference destinationDatacenter, bool? force)\n        {\n        }\n\n        public ManagedObjectReference CopyDatastoreFile_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destinationName, ManagedObjectReference destinationDatacenter, bool? force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void CopyDatastoreFile(string sourceName, ManagedObjectReference sourceDatacenter, string destinationName, ManagedObjectReference destinationDatacenter, bool? force)\n        {\n        }\n\n        public ManagedObjectReference DeleteDatastoreFile_Task(string name, ManagedObjectReference datacenter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DeleteDatastoreFile(string name, ManagedObjectReference datacenter)\n        {\n        }\n\n        public void MakeDirectory(string name, ManagedObjectReference datacenter, bool? createParentDirectories)\n        {\n        }\n\n        public void ChangeOwner(string name, ManagedObjectReference datacenter, string owner)\n        {\n        }\n\n        public bool Equals(FileManager fileManager)\n        {\n            return (fileManager != null && base.Equals(fileManager));\n        }\n\n        public override bool Equals(object fileManager)\n        {\n            return Equals(fileManager as FileManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileNameTooLong : FileFault, IEquatable<FileNameTooLong>\n    {\n        public bool Equals(FileNameTooLong fileNameTooLong)\n        {\n            return (fileNameTooLong != null && base.Equals(fileNameTooLong));\n        }\n\n        public override bool Equals(object fileNameTooLong)\n        {\n            return Equals(fileNameTooLong as FileNameTooLong);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileNotFound : FileFault, IEquatable<FileNotFound>\n    {\n        public bool Equals(FileNotFound fileNotFound)\n        {\n            return (fileNotFound != null && base.Equals(fileNotFound));\n        }\n\n        public override bool Equals(object fileNotFound)\n        {\n            return Equals(fileNotFound as FileNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileNotWritable : FileFault, IEquatable<FileNotWritable>\n    {\n        public bool Equals(FileNotWritable fileNotWritable)\n        {\n            return (fileNotWritable != null && base.Equals(fileNotWritable));\n        }\n\n        public override bool Equals(object fileNotWritable)\n        {\n            return Equals(fileNotWritable as FileNotWritable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileQuery : DynamicData, IEquatable<FileQuery>\n    {\n        public bool Equals(FileQuery fileQuery)\n        {\n            return (fileQuery != null && base.Equals(fileQuery));\n        }\n\n        public override bool Equals(object fileQuery)\n        {\n            return Equals(fileQuery as FileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileQueryFlags : DynamicData, IEquatable<FileQueryFlags>\n    {\n        public bool FileType { get; set; }\n\n        public bool FileSize { get; set; }\n\n        public bool Modification { get; set; }\n\n        public bool FileOwner { get; set; }\n\n        public bool Equals(FileQueryFlags fileQueryFlags)\n        {\n            return (fileQueryFlags != null && this.FileType == fileQueryFlags.FileType && this.FileSize == fileQueryFlags.FileSize && this.Modification == fileQueryFlags.Modification && this.FileOwner == fileQueryFlags.FileOwner);\n        }\n\n        public override bool Equals(object fileQueryFlags)\n        {\n            return Equals(fileQueryFlags as FileQueryFlags);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileType + \"_\" + FileSize + \"_\" + Modification + \"_\" + FileOwner).GetHashCode();\n        }\n    }\n\n    public class FilesystemQuiesceFault : SnapshotFault, IEquatable<FilesystemQuiesceFault>\n    {\n        public bool Equals(FilesystemQuiesceFault filesystemQuiesceFault)\n        {\n            return (filesystemQuiesceFault != null && base.Equals(filesystemQuiesceFault));\n        }\n\n        public override bool Equals(object filesystemQuiesceFault)\n        {\n            return Equals(filesystemQuiesceFault as FilesystemQuiesceFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FileTooLarge : FileFault, IEquatable<FileTooLarge>\n    {\n        public string Datastore { get; set; }\n\n        public long FileSize { get; set; }\n\n        public long? MaxFileSize { get; set; }\n\n        public bool Equals(FileTooLarge fileTooLarge)\n        {\n            return (fileTooLarge != null && this.Datastore == fileTooLarge.Datastore && this.FileSize == fileTooLarge.FileSize && ((this.MaxFileSize == null && fileTooLarge.MaxFileSize == null) || (this.MaxFileSize != null && this.MaxFileSize.Equals(fileTooLarge.MaxFileSize))));\n        }\n\n        public override bool Equals(object fileTooLarge)\n        {\n            return Equals(fileTooLarge as FileTooLarge);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + FileSize + \"_\" + MaxFileSize).GetHashCode();\n        }\n    }\n\n    public class FileTransferInformation : DynamicData, IEquatable<FileTransferInformation>\n    {\n        public GuestFileAttributes Attributes { get; set; }\n\n        public long Size { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(FileTransferInformation fileTransferInformation)\n        {\n            return (fileTransferInformation != null && ((this.Attributes == null && fileTransferInformation.Attributes == null) || (this.Attributes != null && this.Attributes.Equals(fileTransferInformation.Attributes))) && this.Size == fileTransferInformation.Size && this.Url == fileTransferInformation.Url);\n        }\n\n        public override bool Equals(object fileTransferInformation)\n        {\n            return Equals(fileTransferInformation as FileTransferInformation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Attributes + \"_\" + Size + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class FilterInUse : ResourceInUse, IEquatable<FilterInUse>\n    {\n        public VirtualDiskId[] Disk { get; set; }\n\n        public bool Equals(FilterInUse filterInUse)\n        {\n            return (filterInUse != null && ((this.Disk == null && filterInUse.Disk == null) || (this.Disk != null && filterInUse.Disk != null && Enumerable.SequenceEqual(this.Disk, filterInUse.Disk))));\n        }\n\n        public override bool Equals(object filterInUse)\n        {\n            return Equals(filterInUse as FilterInUse);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk).GetHashCode();\n        }\n    }\n\n    public class FirewallProfile : ApplyProfile, IEquatable<FirewallProfile>\n    {\n        public FirewallProfileRulesetProfile[] Ruleset { get; set; }\n\n        public bool Equals(FirewallProfile firewallProfile)\n        {\n            return (firewallProfile != null && ((this.Ruleset == null && firewallProfile.Ruleset == null) || (this.Ruleset != null && firewallProfile.Ruleset != null && Enumerable.SequenceEqual(this.Ruleset, firewallProfile.Ruleset))));\n        }\n\n        public override bool Equals(object firewallProfile)\n        {\n            return Equals(firewallProfile as FirewallProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ruleset).GetHashCode();\n        }\n    }\n\n    public class FirewallProfileRulesetProfile : ApplyProfile, IEquatable<FirewallProfileRulesetProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(FirewallProfileRulesetProfile firewallProfileRulesetProfile)\n        {\n            return (firewallProfileRulesetProfile != null && this.Key == firewallProfileRulesetProfile.Key);\n        }\n\n        public override bool Equals(object firewallProfileRulesetProfile)\n        {\n            return Equals(firewallProfileRulesetProfile as FirewallProfileRulesetProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class FloatOption : OptionType, IEquatable<FloatOption>\n    {\n        public float Min { get; set; }\n\n        public float Max { get; set; }\n\n        public float DefaultValue { get; set; }\n\n        public bool Equals(FloatOption floatOption)\n        {\n            return (floatOption != null && this.Min == floatOption.Min && this.Max == floatOption.Max && this.DefaultValue == floatOption.DefaultValue);\n        }\n\n        public override bool Equals(object floatOption)\n        {\n            return Equals(floatOption as FloatOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Min + \"_\" + Max + \"_\" + DefaultValue).GetHashCode();\n        }\n    }\n\n    public class FloppyImageFileInfo : FileInfo, IEquatable<FloppyImageFileInfo>\n    {\n        public bool Equals(FloppyImageFileInfo floppyImageFileInfo)\n        {\n            return (floppyImageFileInfo != null && base.Equals(floppyImageFileInfo));\n        }\n\n        public override bool Equals(object floppyImageFileInfo)\n        {\n            return Equals(floppyImageFileInfo as FloppyImageFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FloppyImageFileQuery : FileQuery, IEquatable<FloppyImageFileQuery>\n    {\n        public bool Equals(FloppyImageFileQuery floppyImageFileQuery)\n        {\n            return (floppyImageFileQuery != null && base.Equals(floppyImageFileQuery));\n        }\n\n        public override bool Equals(object floppyImageFileQuery)\n        {\n            return Equals(floppyImageFileQuery as FloppyImageFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class Folder : ManagedEntity, IEquatable<Folder>\n    {\n        public string[] ChildType { get; set; }\n\n        public ManagedObjectReference[] ChildEntity { get; set; }\n\n        public new Folder_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference CreateFolder(string name)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference MoveIntoFolder_Task(ManagedObjectReference[] list)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MoveIntoFolder(ManagedObjectReference[] list)\n        {\n        }\n\n        public ManagedObjectReference CreateVM_Task(VirtualMachineConfigSpec config, ManagedObjectReference pool, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateVM(VirtualMachineConfigSpec config, ManagedObjectReference pool, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference RegisterVM_Task(string path, string name, bool asTemplate, ManagedObjectReference pool, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference RegisterVM(string path, string name, bool asTemplate, ManagedObjectReference pool, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateCluster(string name, ClusterConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateClusterEx(string name, ClusterConfigSpecEx spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference AddStandaloneHost_Task(HostConnectSpec spec, ComputeResourceConfigSpec compResSpec, bool addConnected, string license)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference AddStandaloneHost(HostConnectSpec spec, ComputeResourceConfigSpec compResSpec, bool addConnected, string license)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateDatacenter(string name)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference UnregisterAndDestroy_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UnregisterAndDestroy()\n        {\n        }\n\n        public ManagedObjectReference CreateDVS_Task(DVSCreateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateDVS(DVSCreateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateStoragePod(string name)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference BatchAddStandaloneHosts_Task(FolderNewHostSpec[] newHosts, ComputeResourceConfigSpec compResSpec, bool addConnected)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public FolderBatchAddStandaloneHostsResult BatchAddStandaloneHosts(FolderNewHostSpec[] newHosts, ComputeResourceConfigSpec compResSpec, bool addConnected)\n        {\n            return default(FolderBatchAddStandaloneHostsResult);\n        }\n\n        public ManagedObjectReference BatchAddHostsToCluster_Task(ManagedObjectReference cluster, FolderNewHostSpec[] newHosts, ManagedObjectReference[] existingHosts, ComputeResourceConfigSpec compResSpec, string desiredState)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public FolderBatchAddHostsToClusterResult BatchAddHostsToCluster(ManagedObjectReference cluster, FolderNewHostSpec[] newHosts, ManagedObjectReference[] existingHosts, ComputeResourceConfigSpec compResSpec, string desiredState)\n        {\n            return default(FolderBatchAddHostsToClusterResult);\n        }\n\n        public bool Equals(Folder folder)\n        {\n            return (folder != null && ((this.ChildType == null && folder.ChildType == null) || (this.ChildType != null && folder.ChildType != null && Enumerable.SequenceEqual(this.ChildType, folder.ChildType))) && ((this.ChildEntity == null && folder.ChildEntity == null) || (this.ChildEntity != null && folder.ChildEntity != null && Enumerable.SequenceEqual(this.ChildEntity, folder.ChildEntity))) && ((this.LinkedView == null && folder.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(folder.LinkedView))));\n        }\n\n        public override bool Equals(object folder)\n        {\n            return Equals(folder as Folder);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChildType + \"_\" + ChildEntity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class Folder_LinkedView : ManagedEntity_LinkedView, IEquatable<Folder_LinkedView>\n    {\n        public ManagedEntity[] ChildEntity { get; set; }\n\n        public bool Equals(Folder_LinkedView folder_LinkedView)\n        {\n            return (folder_LinkedView != null && ((this.ChildEntity == null && folder_LinkedView.ChildEntity == null) || (this.ChildEntity != null && folder_LinkedView.ChildEntity != null && Enumerable.SequenceEqual(this.ChildEntity, folder_LinkedView.ChildEntity))));\n        }\n\n        public override bool Equals(object folder_LinkedView)\n        {\n            return Equals(folder_LinkedView as Folder_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChildEntity).GetHashCode();\n        }\n    }\n\n    public class FolderBatchAddHostsToClusterResult : DynamicData, IEquatable<FolderBatchAddHostsToClusterResult>\n    {\n        public ManagedObjectReference[] HostsAddedToCluster { get; set; }\n\n        public FolderFailedHostResult[] HostsFailedInventoryAdd { get; set; }\n\n        public FolderFailedHostResult[] HostsFailedMoveToCluster { get; set; }\n\n        public FolderBatchAddHostsToClusterResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FolderBatchAddHostsToClusterResult folderBatchAddHostsToClusterResult)\n        {\n            return (folderBatchAddHostsToClusterResult != null && ((this.HostsAddedToCluster == null && folderBatchAddHostsToClusterResult.HostsAddedToCluster == null) || (this.HostsAddedToCluster != null && folderBatchAddHostsToClusterResult.HostsAddedToCluster != null && Enumerable.SequenceEqual(this.HostsAddedToCluster, folderBatchAddHostsToClusterResult.HostsAddedToCluster))) && ((this.HostsFailedInventoryAdd == null && folderBatchAddHostsToClusterResult.HostsFailedInventoryAdd == null) || (this.HostsFailedInventoryAdd != null && folderBatchAddHostsToClusterResult.HostsFailedInventoryAdd != null && Enumerable.SequenceEqual(this.HostsFailedInventoryAdd, folderBatchAddHostsToClusterResult.HostsFailedInventoryAdd))) && ((this.HostsFailedMoveToCluster == null && folderBatchAddHostsToClusterResult.HostsFailedMoveToCluster == null) || (this.HostsFailedMoveToCluster != null && folderBatchAddHostsToClusterResult.HostsFailedMoveToCluster != null && Enumerable.SequenceEqual(this.HostsFailedMoveToCluster, folderBatchAddHostsToClusterResult.HostsFailedMoveToCluster))) && ((this.LinkedView == null && folderBatchAddHostsToClusterResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(folderBatchAddHostsToClusterResult.LinkedView))));\n        }\n\n        public override bool Equals(object folderBatchAddHostsToClusterResult)\n        {\n            return Equals(folderBatchAddHostsToClusterResult as FolderBatchAddHostsToClusterResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostsAddedToCluster + \"_\" + HostsFailedInventoryAdd + \"_\" + HostsFailedMoveToCluster + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FolderBatchAddHostsToClusterResult_LinkedView : IEquatable<FolderBatchAddHostsToClusterResult_LinkedView>\n    {\n        public HostSystem[] HostsAddedToCluster { get; set; }\n\n        public bool Equals(FolderBatchAddHostsToClusterResult_LinkedView folderBatchAddHostsToClusterResult_LinkedView)\n        {\n            return (folderBatchAddHostsToClusterResult_LinkedView != null && ((this.HostsAddedToCluster == null && folderBatchAddHostsToClusterResult_LinkedView.HostsAddedToCluster == null) || (this.HostsAddedToCluster != null && folderBatchAddHostsToClusterResult_LinkedView.HostsAddedToCluster != null && Enumerable.SequenceEqual(this.HostsAddedToCluster, folderBatchAddHostsToClusterResult_LinkedView.HostsAddedToCluster))));\n        }\n\n        public override bool Equals(object folderBatchAddHostsToClusterResult_LinkedView)\n        {\n            return Equals(folderBatchAddHostsToClusterResult_LinkedView as FolderBatchAddHostsToClusterResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostsAddedToCluster).GetHashCode();\n        }\n    }\n\n    public class FolderBatchAddStandaloneHostsResult : DynamicData, IEquatable<FolderBatchAddStandaloneHostsResult>\n    {\n        public ManagedObjectReference[] AddedHosts { get; set; }\n\n        public FolderFailedHostResult[] HostsFailedInventoryAdd { get; set; }\n\n        public FolderBatchAddStandaloneHostsResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FolderBatchAddStandaloneHostsResult folderBatchAddStandaloneHostsResult)\n        {\n            return (folderBatchAddStandaloneHostsResult != null && ((this.AddedHosts == null && folderBatchAddStandaloneHostsResult.AddedHosts == null) || (this.AddedHosts != null && folderBatchAddStandaloneHostsResult.AddedHosts != null && Enumerable.SequenceEqual(this.AddedHosts, folderBatchAddStandaloneHostsResult.AddedHosts))) && ((this.HostsFailedInventoryAdd == null && folderBatchAddStandaloneHostsResult.HostsFailedInventoryAdd == null) || (this.HostsFailedInventoryAdd != null && folderBatchAddStandaloneHostsResult.HostsFailedInventoryAdd != null && Enumerable.SequenceEqual(this.HostsFailedInventoryAdd, folderBatchAddStandaloneHostsResult.HostsFailedInventoryAdd))) && ((this.LinkedView == null && folderBatchAddStandaloneHostsResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(folderBatchAddStandaloneHostsResult.LinkedView))));\n        }\n\n        public override bool Equals(object folderBatchAddStandaloneHostsResult)\n        {\n            return Equals(folderBatchAddStandaloneHostsResult as FolderBatchAddStandaloneHostsResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AddedHosts + \"_\" + HostsFailedInventoryAdd + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FolderBatchAddStandaloneHostsResult_LinkedView : IEquatable<FolderBatchAddStandaloneHostsResult_LinkedView>\n    {\n        public HostSystem[] AddedHosts { get; set; }\n\n        public bool Equals(FolderBatchAddStandaloneHostsResult_LinkedView folderBatchAddStandaloneHostsResult_LinkedView)\n        {\n            return (folderBatchAddStandaloneHostsResult_LinkedView != null && ((this.AddedHosts == null && folderBatchAddStandaloneHostsResult_LinkedView.AddedHosts == null) || (this.AddedHosts != null && folderBatchAddStandaloneHostsResult_LinkedView.AddedHosts != null && Enumerable.SequenceEqual(this.AddedHosts, folderBatchAddStandaloneHostsResult_LinkedView.AddedHosts))));\n        }\n\n        public override bool Equals(object folderBatchAddStandaloneHostsResult_LinkedView)\n        {\n            return Equals(folderBatchAddStandaloneHostsResult_LinkedView as FolderBatchAddStandaloneHostsResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AddedHosts).GetHashCode();\n        }\n    }\n\n    public class FolderEventArgument : EntityEventArgument, IEquatable<FolderEventArgument>\n    {\n        public ManagedObjectReference Folder { get; set; }\n\n        public FolderEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FolderEventArgument folderEventArgument)\n        {\n            return (folderEventArgument != null && ((this.Folder == null && folderEventArgument.Folder == null) || (this.Folder != null && this.Folder.Equals(folderEventArgument.Folder))) && ((this.LinkedView == null && folderEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(folderEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object folderEventArgument)\n        {\n            return Equals(folderEventArgument as FolderEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Folder + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FolderEventArgument_LinkedView : IEquatable<FolderEventArgument_LinkedView>\n    {\n        public Folder Folder { get; set; }\n\n        public bool Equals(FolderEventArgument_LinkedView folderEventArgument_LinkedView)\n        {\n            return (folderEventArgument_LinkedView != null && ((this.Folder == null && folderEventArgument_LinkedView.Folder == null) || (this.Folder != null && this.Folder.Equals(folderEventArgument_LinkedView.Folder))));\n        }\n\n        public override bool Equals(object folderEventArgument_LinkedView)\n        {\n            return Equals(folderEventArgument_LinkedView as FolderEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Folder).GetHashCode();\n        }\n    }\n\n    public class FolderFailedHostResult : DynamicData, IEquatable<FolderFailedHostResult>\n    {\n        public string HostName { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizableMessage Context { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public FolderFailedHostResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FolderFailedHostResult folderFailedHostResult)\n        {\n            return (folderFailedHostResult != null && this.HostName == folderFailedHostResult.HostName && ((this.Host == null && folderFailedHostResult.Host == null) || (this.Host != null && this.Host.Equals(folderFailedHostResult.Host))) && ((this.Context == null && folderFailedHostResult.Context == null) || (this.Context != null && this.Context.Equals(folderFailedHostResult.Context))) && ((this.Fault == null && folderFailedHostResult.Fault == null) || (this.Fault != null && this.Fault.Equals(folderFailedHostResult.Fault))) && ((this.LinkedView == null && folderFailedHostResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(folderFailedHostResult.LinkedView))));\n        }\n\n        public override bool Equals(object folderFailedHostResult)\n        {\n            return Equals(folderFailedHostResult as FolderFailedHostResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Host + \"_\" + Context + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FolderFailedHostResult_LinkedView : IEquatable<FolderFailedHostResult_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(FolderFailedHostResult_LinkedView folderFailedHostResult_LinkedView)\n        {\n            return (folderFailedHostResult_LinkedView != null && ((this.Host == null && folderFailedHostResult_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(folderFailedHostResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object folderFailedHostResult_LinkedView)\n        {\n            return Equals(folderFailedHostResult_LinkedView as FolderFailedHostResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class FolderFileInfo : FileInfo, IEquatable<FolderFileInfo>\n    {\n        public bool Equals(FolderFileInfo folderFileInfo)\n        {\n            return (folderFileInfo != null && base.Equals(folderFileInfo));\n        }\n\n        public override bool Equals(object folderFileInfo)\n        {\n            return Equals(folderFileInfo as FolderFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FolderFileQuery : FileQuery, IEquatable<FolderFileQuery>\n    {\n        public bool Equals(FolderFileQuery folderFileQuery)\n        {\n            return (folderFileQuery != null && base.Equals(folderFileQuery));\n        }\n\n        public override bool Equals(object folderFileQuery)\n        {\n            return Equals(folderFileQuery as FolderFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class FolderNewHostSpec : DynamicData, IEquatable<FolderNewHostSpec>\n    {\n        public HostConnectSpec HostCnxSpec { get; set; }\n\n        public string EsxLicense { get; set; }\n\n        public bool Equals(FolderNewHostSpec folderNewHostSpec)\n        {\n            return (folderNewHostSpec != null && ((this.HostCnxSpec == null && folderNewHostSpec.HostCnxSpec == null) || (this.HostCnxSpec != null && this.HostCnxSpec.Equals(folderNewHostSpec.HostCnxSpec))) && this.EsxLicense == folderNewHostSpec.EsxLicense);\n        }\n\n        public override bool Equals(object folderNewHostSpec)\n        {\n            return Equals(folderNewHostSpec as FolderNewHostSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostCnxSpec + \"_\" + EsxLicense).GetHashCode();\n        }\n    }\n\n    public class FtIssuesOnHost : VmFaultToleranceIssue, IEquatable<FtIssuesOnHost>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string HostName { get; set; }\n\n        public LocalizedMethodFault[] Errors { get; set; }\n\n        public FtIssuesOnHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FtIssuesOnHost ftIssuesOnHost)\n        {\n            return (ftIssuesOnHost != null && ((this.Host == null && ftIssuesOnHost.Host == null) || (this.Host != null && this.Host.Equals(ftIssuesOnHost.Host))) && this.HostName == ftIssuesOnHost.HostName && ((this.Errors == null && ftIssuesOnHost.Errors == null) || (this.Errors != null && ftIssuesOnHost.Errors != null && Enumerable.SequenceEqual(this.Errors, ftIssuesOnHost.Errors))) && ((this.LinkedView == null && ftIssuesOnHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ftIssuesOnHost.LinkedView))));\n        }\n\n        public override bool Equals(object ftIssuesOnHost)\n        {\n            return Equals(ftIssuesOnHost as FtIssuesOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostName + \"_\" + Errors + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class FtIssuesOnHost_LinkedView : IEquatable<FtIssuesOnHost_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(FtIssuesOnHost_LinkedView ftIssuesOnHost_LinkedView)\n        {\n            return (ftIssuesOnHost_LinkedView != null && ((this.Host == null && ftIssuesOnHost_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(ftIssuesOnHost_LinkedView.Host))));\n        }\n\n        public override bool Equals(object ftIssuesOnHost_LinkedView)\n        {\n            return Equals(ftIssuesOnHost_LinkedView as FtIssuesOnHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class FullStorageVMotionNotSupported : MigrationFeatureNotSupported, IEquatable<FullStorageVMotionNotSupported>\n    {\n        public new FullStorageVMotionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(FullStorageVMotionNotSupported fullStorageVMotionNotSupported)\n        {\n            return (fullStorageVMotionNotSupported != null && ((this.LinkedView == null && fullStorageVMotionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(fullStorageVMotionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object fullStorageVMotionNotSupported)\n        {\n            return Equals(fullStorageVMotionNotSupported as FullStorageVMotionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class FullStorageVMotionNotSupported_LinkedView : MigrationFeatureNotSupported_LinkedView, IEquatable<FullStorageVMotionNotSupported_LinkedView>\n    {\n        public bool Equals(FullStorageVMotionNotSupported_LinkedView fullStorageVMotionNotSupported_LinkedView)\n        {\n            return (fullStorageVMotionNotSupported_LinkedView != null && base.Equals(fullStorageVMotionNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object fullStorageVMotionNotSupported_LinkedView)\n        {\n            return Equals(fullStorageVMotionNotSupported_LinkedView as FullStorageVMotionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GatewayConnectFault : HostConnectFault, IEquatable<GatewayConnectFault>\n    {\n        public string GatewayType { get; set; }\n\n        public string GatewayId { get; set; }\n\n        public string GatewayInfo { get; set; }\n\n        public LocalizableMessage Details { get; set; }\n\n        public bool Equals(GatewayConnectFault gatewayConnectFault)\n        {\n            return (gatewayConnectFault != null && this.GatewayType == gatewayConnectFault.GatewayType && this.GatewayId == gatewayConnectFault.GatewayId && this.GatewayInfo == gatewayConnectFault.GatewayInfo && ((this.Details == null && gatewayConnectFault.Details == null) || (this.Details != null && this.Details.Equals(gatewayConnectFault.Details))));\n        }\n\n        public override bool Equals(object gatewayConnectFault)\n        {\n            return Equals(gatewayConnectFault as GatewayConnectFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GatewayType + \"_\" + GatewayId + \"_\" + GatewayInfo + \"_\" + Details).GetHashCode();\n        }\n    }\n\n    public class GatewayHostNotReachable : GatewayToHostConnectFault, IEquatable<GatewayHostNotReachable>\n    {\n        public bool Equals(GatewayHostNotReachable gatewayHostNotReachable)\n        {\n            return (gatewayHostNotReachable != null && base.Equals(gatewayHostNotReachable));\n        }\n\n        public override bool Equals(object gatewayHostNotReachable)\n        {\n            return Equals(gatewayHostNotReachable as GatewayHostNotReachable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GatewayNotFound : GatewayConnectFault, IEquatable<GatewayNotFound>\n    {\n        public bool Equals(GatewayNotFound gatewayNotFound)\n        {\n            return (gatewayNotFound != null && base.Equals(gatewayNotFound));\n        }\n\n        public override bool Equals(object gatewayNotFound)\n        {\n            return Equals(gatewayNotFound as GatewayNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GatewayNotReachable : GatewayConnectFault, IEquatable<GatewayNotReachable>\n    {\n        public bool Equals(GatewayNotReachable gatewayNotReachable)\n        {\n            return (gatewayNotReachable != null && base.Equals(gatewayNotReachable));\n        }\n\n        public override bool Equals(object gatewayNotReachable)\n        {\n            return Equals(gatewayNotReachable as GatewayNotReachable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GatewayOperationRefused : GatewayConnectFault, IEquatable<GatewayOperationRefused>\n    {\n        public bool Equals(GatewayOperationRefused gatewayOperationRefused)\n        {\n            return (gatewayOperationRefused != null && base.Equals(gatewayOperationRefused));\n        }\n\n        public override bool Equals(object gatewayOperationRefused)\n        {\n            return Equals(gatewayOperationRefused as GatewayOperationRefused);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GatewayToHostAuthFault : GatewayToHostConnectFault, IEquatable<GatewayToHostAuthFault>\n    {\n        public string[] InvalidProperties { get; set; }\n\n        public string[] MissingProperties { get; set; }\n\n        public bool Equals(GatewayToHostAuthFault gatewayToHostAuthFault)\n        {\n            return (gatewayToHostAuthFault != null && ((this.InvalidProperties == null && gatewayToHostAuthFault.InvalidProperties == null) || (this.InvalidProperties != null && gatewayToHostAuthFault.InvalidProperties != null && Enumerable.SequenceEqual(this.InvalidProperties, gatewayToHostAuthFault.InvalidProperties))) && ((this.MissingProperties == null && gatewayToHostAuthFault.MissingProperties == null) || (this.MissingProperties != null && gatewayToHostAuthFault.MissingProperties != null && Enumerable.SequenceEqual(this.MissingProperties, gatewayToHostAuthFault.MissingProperties))));\n        }\n\n        public override bool Equals(object gatewayToHostAuthFault)\n        {\n            return Equals(gatewayToHostAuthFault as GatewayToHostAuthFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InvalidProperties + \"_\" + MissingProperties).GetHashCode();\n        }\n    }\n\n    public class GatewayToHostConnectFault : GatewayConnectFault, IEquatable<GatewayToHostConnectFault>\n    {\n        public string Hostname { get; set; }\n\n        public int? Port { get; set; }\n\n        public bool Equals(GatewayToHostConnectFault gatewayToHostConnectFault)\n        {\n            return (gatewayToHostConnectFault != null && this.Hostname == gatewayToHostConnectFault.Hostname && ((this.Port == null && gatewayToHostConnectFault.Port == null) || (this.Port != null && this.Port.Equals(gatewayToHostConnectFault.Port))));\n        }\n\n        public override bool Equals(object gatewayToHostConnectFault)\n        {\n            return Equals(gatewayToHostConnectFault as GatewayToHostConnectFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hostname + \"_\" + Port).GetHashCode();\n        }\n    }\n\n    public class GatewayToHostTrustVerifyFault : GatewayToHostConnectFault, IEquatable<GatewayToHostTrustVerifyFault>\n    {\n        public string VerificationToken { get; set; }\n\n        public KeyValue[] PropertiesToVerify { get; set; }\n\n        public bool Equals(GatewayToHostTrustVerifyFault gatewayToHostTrustVerifyFault)\n        {\n            return (gatewayToHostTrustVerifyFault != null && this.VerificationToken == gatewayToHostTrustVerifyFault.VerificationToken && ((this.PropertiesToVerify == null && gatewayToHostTrustVerifyFault.PropertiesToVerify == null) || (this.PropertiesToVerify != null && gatewayToHostTrustVerifyFault.PropertiesToVerify != null && Enumerable.SequenceEqual(this.PropertiesToVerify, gatewayToHostTrustVerifyFault.PropertiesToVerify))));\n        }\n\n        public override bool Equals(object gatewayToHostTrustVerifyFault)\n        {\n            return Equals(gatewayToHostTrustVerifyFault as GatewayToHostTrustVerifyFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VerificationToken + \"_\" + PropertiesToVerify).GetHashCode();\n        }\n    }\n\n    public class GeneralEvent : Event, IEquatable<GeneralEvent>\n    {\n        public string Message { get; set; }\n\n        public bool Equals(GeneralEvent generalEvent)\n        {\n            return (generalEvent != null && this.Message == generalEvent.Message);\n        }\n\n        public override bool Equals(object generalEvent)\n        {\n            return Equals(generalEvent as GeneralEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message).GetHashCode();\n        }\n    }\n\n    public class GeneralHostErrorEvent : GeneralEvent, IEquatable<GeneralHostErrorEvent>\n    {\n        public bool Equals(GeneralHostErrorEvent generalHostErrorEvent)\n        {\n            return (generalHostErrorEvent != null && base.Equals(generalHostErrorEvent));\n        }\n\n        public override bool Equals(object generalHostErrorEvent)\n        {\n            return Equals(generalHostErrorEvent as GeneralHostErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GeneralHostInfoEvent : GeneralEvent, IEquatable<GeneralHostInfoEvent>\n    {\n        public bool Equals(GeneralHostInfoEvent generalHostInfoEvent)\n        {\n            return (generalHostInfoEvent != null && base.Equals(generalHostInfoEvent));\n        }\n\n        public override bool Equals(object generalHostInfoEvent)\n        {\n            return Equals(generalHostInfoEvent as GeneralHostInfoEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GeneralHostWarningEvent : GeneralEvent, IEquatable<GeneralHostWarningEvent>\n    {\n        public bool Equals(GeneralHostWarningEvent generalHostWarningEvent)\n        {\n            return (generalHostWarningEvent != null && base.Equals(generalHostWarningEvent));\n        }\n\n        public override bool Equals(object generalHostWarningEvent)\n        {\n            return Equals(generalHostWarningEvent as GeneralHostWarningEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GeneralUserEvent : GeneralEvent, IEquatable<GeneralUserEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(GeneralUserEvent generalUserEvent)\n        {\n            return (generalUserEvent != null && ((this.Entity == null && generalUserEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(generalUserEvent.Entity))));\n        }\n\n        public override bool Equals(object generalUserEvent)\n        {\n            return Equals(generalUserEvent as GeneralUserEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class GeneralVmErrorEvent : GeneralEvent, IEquatable<GeneralVmErrorEvent>\n    {\n        public bool Equals(GeneralVmErrorEvent generalVmErrorEvent)\n        {\n            return (generalVmErrorEvent != null && base.Equals(generalVmErrorEvent));\n        }\n\n        public override bool Equals(object generalVmErrorEvent)\n        {\n            return Equals(generalVmErrorEvent as GeneralVmErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GeneralVmInfoEvent : GeneralEvent, IEquatable<GeneralVmInfoEvent>\n    {\n        public bool Equals(GeneralVmInfoEvent generalVmInfoEvent)\n        {\n            return (generalVmInfoEvent != null && base.Equals(generalVmInfoEvent));\n        }\n\n        public override bool Equals(object generalVmInfoEvent)\n        {\n            return Equals(generalVmInfoEvent as GeneralVmInfoEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GeneralVmWarningEvent : GeneralEvent, IEquatable<GeneralVmWarningEvent>\n    {\n        public bool Equals(GeneralVmWarningEvent generalVmWarningEvent)\n        {\n            return (generalVmWarningEvent != null && base.Equals(generalVmWarningEvent));\n        }\n\n        public override bool Equals(object generalVmWarningEvent)\n        {\n            return Equals(generalVmWarningEvent as GeneralVmWarningEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GenericDrsFault : VimFault, IEquatable<GenericDrsFault>\n    {\n        public LocalizedMethodFault[] HostFaults { get; set; }\n\n        public bool Equals(GenericDrsFault genericDrsFault)\n        {\n            return (genericDrsFault != null && ((this.HostFaults == null && genericDrsFault.HostFaults == null) || (this.HostFaults != null && genericDrsFault.HostFaults != null && Enumerable.SequenceEqual(this.HostFaults, genericDrsFault.HostFaults))));\n        }\n\n        public override bool Equals(object genericDrsFault)\n        {\n            return Equals(genericDrsFault as GenericDrsFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostFaults).GetHashCode();\n        }\n    }\n\n    public class GenericVmConfigFault : VmConfigFault, IEquatable<GenericVmConfigFault>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(GenericVmConfigFault genericVmConfigFault)\n        {\n            return (genericVmConfigFault != null && this.Reason == genericVmConfigFault.Reason);\n        }\n\n        public override bool Equals(object genericVmConfigFault)\n        {\n            return Equals(genericVmConfigFault as GenericVmConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class GhostDvsProxySwitchDetectedEvent : HostEvent, IEquatable<GhostDvsProxySwitchDetectedEvent>\n    {\n        public string[] SwitchUuid { get; set; }\n\n        public bool Equals(GhostDvsProxySwitchDetectedEvent ghostDvsProxySwitchDetectedEvent)\n        {\n            return (ghostDvsProxySwitchDetectedEvent != null && ((this.SwitchUuid == null && ghostDvsProxySwitchDetectedEvent.SwitchUuid == null) || (this.SwitchUuid != null && ghostDvsProxySwitchDetectedEvent.SwitchUuid != null && Enumerable.SequenceEqual(this.SwitchUuid, ghostDvsProxySwitchDetectedEvent.SwitchUuid))));\n        }\n\n        public override bool Equals(object ghostDvsProxySwitchDetectedEvent)\n        {\n            return Equals(ghostDvsProxySwitchDetectedEvent as GhostDvsProxySwitchDetectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchUuid).GetHashCode();\n        }\n    }\n\n    public class GhostDvsProxySwitchRemovedEvent : HostEvent, IEquatable<GhostDvsProxySwitchRemovedEvent>\n    {\n        public string[] SwitchUuid { get; set; }\n\n        public bool Equals(GhostDvsProxySwitchRemovedEvent ghostDvsProxySwitchRemovedEvent)\n        {\n            return (ghostDvsProxySwitchRemovedEvent != null && ((this.SwitchUuid == null && ghostDvsProxySwitchRemovedEvent.SwitchUuid == null) || (this.SwitchUuid != null && ghostDvsProxySwitchRemovedEvent.SwitchUuid != null && Enumerable.SequenceEqual(this.SwitchUuid, ghostDvsProxySwitchRemovedEvent.SwitchUuid))));\n        }\n\n        public override bool Equals(object ghostDvsProxySwitchRemovedEvent)\n        {\n            return Equals(ghostDvsProxySwitchRemovedEvent as GhostDvsProxySwitchRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchUuid).GetHashCode();\n        }\n    }\n\n    public class GlobalMessageChangedEvent : SessionEvent, IEquatable<GlobalMessageChangedEvent>\n    {\n        public string Message { get; set; }\n\n        public string PrevMessage { get; set; }\n\n        public bool Equals(GlobalMessageChangedEvent globalMessageChangedEvent)\n        {\n            return (globalMessageChangedEvent != null && this.Message == globalMessageChangedEvent.Message && this.PrevMessage == globalMessageChangedEvent.PrevMessage);\n        }\n\n        public override bool Equals(object globalMessageChangedEvent)\n        {\n            return Equals(globalMessageChangedEvent as GlobalMessageChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message + \"_\" + PrevMessage).GetHashCode();\n        }\n    }\n\n    public class GroupAlarmAction : AlarmAction, IEquatable<GroupAlarmAction>\n    {\n        public AlarmAction[] Action { get; set; }\n\n        public bool Equals(GroupAlarmAction groupAlarmAction)\n        {\n            return (groupAlarmAction != null && ((this.Action == null && groupAlarmAction.Action == null) || (this.Action != null && groupAlarmAction.Action != null && Enumerable.SequenceEqual(this.Action, groupAlarmAction.Action))));\n        }\n\n        public override bool Equals(object groupAlarmAction)\n        {\n            return Equals(groupAlarmAction as GroupAlarmAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Action).GetHashCode();\n        }\n    }\n\n    public class GuestAliases : DynamicData, IEquatable<GuestAliases>\n    {\n        public string Base64Cert { get; set; }\n\n        public GuestAuthAliasInfo[] Aliases { get; set; }\n\n        public bool Equals(GuestAliases guestAliases)\n        {\n            return (guestAliases != null && this.Base64Cert == guestAliases.Base64Cert && ((this.Aliases == null && guestAliases.Aliases == null) || (this.Aliases != null && guestAliases.Aliases != null && Enumerable.SequenceEqual(this.Aliases, guestAliases.Aliases))));\n        }\n\n        public override bool Equals(object guestAliases)\n        {\n            return Equals(guestAliases as GuestAliases);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Base64Cert + \"_\" + Aliases).GetHashCode();\n        }\n    }\n\n    public class GuestAliasManager : ViewBase, IEquatable<GuestAliasManager>\n    {\n        public void AddGuestAlias(ManagedObjectReference vm, GuestAuthentication auth, string username, bool mapCert, string base64Cert, GuestAuthAliasInfo aliasInfo)\n        {\n        }\n\n        public void RemoveGuestAlias(ManagedObjectReference vm, GuestAuthentication auth, string username, string base64Cert, GuestAuthSubject subject)\n        {\n        }\n\n        public void RemoveGuestAliasByCert(ManagedObjectReference vm, GuestAuthentication auth, string username, string base64Cert)\n        {\n        }\n\n        public GuestAliases[] ListGuestAliases(ManagedObjectReference vm, GuestAuthentication auth, string username)\n        {\n            return default(GuestAliases[]);\n        }\n\n        public GuestMappedAliases[] ListGuestMappedAliases(ManagedObjectReference vm, GuestAuthentication auth)\n        {\n            return default(GuestMappedAliases[]);\n        }\n\n        public bool Equals(GuestAliasManager guestAliasManager)\n        {\n            return (guestAliasManager != null && base.Equals(guestAliasManager));\n        }\n\n        public override bool Equals(object guestAliasManager)\n        {\n            return Equals(guestAliasManager as GuestAliasManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestAuthAliasInfo : DynamicData, IEquatable<GuestAuthAliasInfo>\n    {\n        public GuestAuthSubject Subject { get; set; }\n\n        public string Comment { get; set; }\n\n        public bool Equals(GuestAuthAliasInfo guestAuthAliasInfo)\n        {\n            return (guestAuthAliasInfo != null && ((this.Subject == null && guestAuthAliasInfo.Subject == null) || (this.Subject != null && this.Subject.Equals(guestAuthAliasInfo.Subject))) && this.Comment == guestAuthAliasInfo.Comment);\n        }\n\n        public override bool Equals(object guestAuthAliasInfo)\n        {\n            return Equals(guestAuthAliasInfo as GuestAuthAliasInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Subject + \"_\" + Comment).GetHashCode();\n        }\n    }\n\n    public class GuestAuthAnySubject : GuestAuthSubject, IEquatable<GuestAuthAnySubject>\n    {\n        public bool Equals(GuestAuthAnySubject guestAuthAnySubject)\n        {\n            return (guestAuthAnySubject != null && base.Equals(guestAuthAnySubject));\n        }\n\n        public override bool Equals(object guestAuthAnySubject)\n        {\n            return Equals(guestAuthAnySubject as GuestAuthAnySubject);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestAuthentication : DynamicData, IEquatable<GuestAuthentication>\n    {\n        public bool InteractiveSession { get; set; }\n\n        public bool Equals(GuestAuthentication guestAuthentication)\n        {\n            return (guestAuthentication != null && this.InteractiveSession == guestAuthentication.InteractiveSession);\n        }\n\n        public override bool Equals(object guestAuthentication)\n        {\n            return Equals(guestAuthentication as GuestAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InteractiveSession).GetHashCode();\n        }\n    }\n\n    public class GuestAuthenticationChallenge : GuestOperationsFault, IEquatable<GuestAuthenticationChallenge>\n    {\n        public GuestAuthentication ServerChallenge { get; set; }\n\n        public long SessionID { get; set; }\n\n        public bool Equals(GuestAuthenticationChallenge guestAuthenticationChallenge)\n        {\n            return (guestAuthenticationChallenge != null && ((this.ServerChallenge == null && guestAuthenticationChallenge.ServerChallenge == null) || (this.ServerChallenge != null && this.ServerChallenge.Equals(guestAuthenticationChallenge.ServerChallenge))) && this.SessionID == guestAuthenticationChallenge.SessionID);\n        }\n\n        public override bool Equals(object guestAuthenticationChallenge)\n        {\n            return Equals(guestAuthenticationChallenge as GuestAuthenticationChallenge);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerChallenge + \"_\" + SessionID).GetHashCode();\n        }\n    }\n\n    public class GuestAuthManager : ViewBase, IEquatable<GuestAuthManager>\n    {\n        public void ValidateCredentialsInGuest(ManagedObjectReference vm, GuestAuthentication auth)\n        {\n        }\n\n        public GuestAuthentication AcquireCredentialsInGuest(ManagedObjectReference vm, GuestAuthentication requestedAuth, long? sessionID)\n        {\n            return default(GuestAuthentication);\n        }\n\n        public void ReleaseCredentialsInGuest(ManagedObjectReference vm, GuestAuthentication auth)\n        {\n        }\n\n        public bool Equals(GuestAuthManager guestAuthManager)\n        {\n            return (guestAuthManager != null && base.Equals(guestAuthManager));\n        }\n\n        public override bool Equals(object guestAuthManager)\n        {\n            return Equals(guestAuthManager as GuestAuthManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestAuthNamedSubject : GuestAuthSubject, IEquatable<GuestAuthNamedSubject>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(GuestAuthNamedSubject guestAuthNamedSubject)\n        {\n            return (guestAuthNamedSubject != null && this.Name == guestAuthNamedSubject.Name);\n        }\n\n        public override bool Equals(object guestAuthNamedSubject)\n        {\n            return Equals(guestAuthNamedSubject as GuestAuthNamedSubject);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class GuestAuthSubject : DynamicData, IEquatable<GuestAuthSubject>\n    {\n        public bool Equals(GuestAuthSubject guestAuthSubject)\n        {\n            return (guestAuthSubject != null && base.Equals(guestAuthSubject));\n        }\n\n        public override bool Equals(object guestAuthSubject)\n        {\n            return Equals(guestAuthSubject as GuestAuthSubject);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestComponentsOutOfDate : GuestOperationsFault, IEquatable<GuestComponentsOutOfDate>\n    {\n        public bool Equals(GuestComponentsOutOfDate guestComponentsOutOfDate)\n        {\n            return (guestComponentsOutOfDate != null && base.Equals(guestComponentsOutOfDate));\n        }\n\n        public override bool Equals(object guestComponentsOutOfDate)\n        {\n            return Equals(guestComponentsOutOfDate as GuestComponentsOutOfDate);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestDiskInfo : DynamicData, IEquatable<GuestDiskInfo>\n    {\n        public string DiskPath { get; set; }\n\n        public long? Capacity { get; set; }\n\n        public long? FreeSpace { get; set; }\n\n        public bool Equals(GuestDiskInfo guestDiskInfo)\n        {\n            return (guestDiskInfo != null && this.DiskPath == guestDiskInfo.DiskPath && ((this.Capacity == null && guestDiskInfo.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(guestDiskInfo.Capacity))) && ((this.FreeSpace == null && guestDiskInfo.FreeSpace == null) || (this.FreeSpace != null && this.FreeSpace.Equals(guestDiskInfo.FreeSpace))));\n        }\n\n        public override bool Equals(object guestDiskInfo)\n        {\n            return Equals(guestDiskInfo as GuestDiskInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskPath + \"_\" + Capacity + \"_\" + FreeSpace).GetHashCode();\n        }\n    }\n\n    public class GuestFileAttributes : DynamicData, IEquatable<GuestFileAttributes>\n    {\n        public DateTime? ModificationTime { get; set; }\n\n        public DateTime? AccessTime { get; set; }\n\n        public string SymlinkTarget { get; set; }\n\n        public bool Equals(GuestFileAttributes guestFileAttributes)\n        {\n            return (guestFileAttributes != null && ((this.ModificationTime == null && guestFileAttributes.ModificationTime == null) || (this.ModificationTime != null && this.ModificationTime.Equals(guestFileAttributes.ModificationTime))) && ((this.AccessTime == null && guestFileAttributes.AccessTime == null) || (this.AccessTime != null && this.AccessTime.Equals(guestFileAttributes.AccessTime))) && this.SymlinkTarget == guestFileAttributes.SymlinkTarget);\n        }\n\n        public override bool Equals(object guestFileAttributes)\n        {\n            return Equals(guestFileAttributes as GuestFileAttributes);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ModificationTime + \"_\" + AccessTime + \"_\" + SymlinkTarget).GetHashCode();\n        }\n    }\n\n    public class GuestFileInfo : DynamicData, IEquatable<GuestFileInfo>\n    {\n        public string Path { get; set; }\n\n        public string Type { get; set; }\n\n        public long Size { get; set; }\n\n        public GuestFileAttributes Attributes { get; set; }\n\n        public bool Equals(GuestFileInfo guestFileInfo)\n        {\n            return (guestFileInfo != null && this.Path == guestFileInfo.Path && this.Type == guestFileInfo.Type && this.Size == guestFileInfo.Size && ((this.Attributes == null && guestFileInfo.Attributes == null) || (this.Attributes != null && this.Attributes.Equals(guestFileInfo.Attributes))));\n        }\n\n        public override bool Equals(object guestFileInfo)\n        {\n            return Equals(guestFileInfo as GuestFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path + \"_\" + Type + \"_\" + Size + \"_\" + Attributes).GetHashCode();\n        }\n    }\n\n    public class GuestFileManager : ViewBase, IEquatable<GuestFileManager>\n    {\n        public void MakeDirectoryInGuest(ManagedObjectReference vm, GuestAuthentication auth, string directoryPath, bool createParentDirectories)\n        {\n        }\n\n        public void DeleteFileInGuest(ManagedObjectReference vm, GuestAuthentication auth, string filePath)\n        {\n        }\n\n        public void DeleteDirectoryInGuest(ManagedObjectReference vm, GuestAuthentication auth, string directoryPath, bool recursive)\n        {\n        }\n\n        public void MoveDirectoryInGuest(ManagedObjectReference vm, GuestAuthentication auth, string srcDirectoryPath, string dstDirectoryPath)\n        {\n        }\n\n        public void MoveFileInGuest(ManagedObjectReference vm, GuestAuthentication auth, string srcFilePath, string dstFilePath, bool overwrite)\n        {\n        }\n\n        public string CreateTemporaryFileInGuest(ManagedObjectReference vm, GuestAuthentication auth, string prefix, string suffix, string directoryPath)\n        {\n            return default(string);\n        }\n\n        public string CreateTemporaryDirectoryInGuest(ManagedObjectReference vm, GuestAuthentication auth, string prefix, string suffix, string directoryPath)\n        {\n            return default(string);\n        }\n\n        public GuestListFileInfo ListFilesInGuest(ManagedObjectReference vm, GuestAuthentication auth, string filePath, int? index, int? maxResults, string matchPattern)\n        {\n            return default(GuestListFileInfo);\n        }\n\n        public void ChangeFileAttributesInGuest(ManagedObjectReference vm, GuestAuthentication auth, string guestFilePath, GuestFileAttributes fileAttributes)\n        {\n        }\n\n        public FileTransferInformation InitiateFileTransferFromGuest(ManagedObjectReference vm, GuestAuthentication auth, string guestFilePath)\n        {\n            return default(FileTransferInformation);\n        }\n\n        public string InitiateFileTransferToGuest(ManagedObjectReference vm, GuestAuthentication auth, string guestFilePath, GuestFileAttributes fileAttributes, long fileSize, bool overwrite)\n        {\n            return default(string);\n        }\n\n        public bool Equals(GuestFileManager guestFileManager)\n        {\n            return (guestFileManager != null && base.Equals(guestFileManager));\n        }\n\n        public override bool Equals(object guestFileManager)\n        {\n            return Equals(guestFileManager as GuestFileManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestInfo : DynamicData, IEquatable<GuestInfo>\n    {\n        public VirtualMachineToolsStatus? ToolsStatus { get; set; }\n\n        public string ToolsVersionStatus { get; set; }\n\n        public string ToolsVersionStatus2 { get; set; }\n\n        public string ToolsRunningStatus { get; set; }\n\n        public string ToolsVersion { get; set; }\n\n        public string ToolsInstallType { get; set; }\n\n        public string GuestId { get; set; }\n\n        public string GuestFamily { get; set; }\n\n        public string GuestFullName { get; set; }\n\n        public string HostName { get; set; }\n\n        public string IpAddress { get; set; }\n\n        public GuestNicInfo[] Net { get; set; }\n\n        public GuestStackInfo[] IpStack { get; set; }\n\n        public GuestDiskInfo[] Disk { get; set; }\n\n        public GuestScreenInfo Screen { get; set; }\n\n        public string GuestState { get; set; }\n\n        public string AppHeartbeatStatus { get; set; }\n\n        public bool? GuestKernelCrashed { get; set; }\n\n        public string AppState { get; set; }\n\n        public bool? GuestOperationsReady { get; set; }\n\n        public bool? InteractiveGuestOperationsReady { get; set; }\n\n        public bool? GuestStateChangeSupported { get; set; }\n\n        public GuestInfoNamespaceGenerationInfo[] GenerationInfo { get; set; }\n\n        public bool Equals(GuestInfo guestInfo)\n        {\n            return (guestInfo != null && ((this.ToolsStatus == null && guestInfo.ToolsStatus == null) || (this.ToolsStatus != null && this.ToolsStatus.Equals(guestInfo.ToolsStatus))) && this.ToolsVersionStatus == guestInfo.ToolsVersionStatus && this.ToolsVersionStatus2 == guestInfo.ToolsVersionStatus2 && this.ToolsRunningStatus == guestInfo.ToolsRunningStatus && this.ToolsVersion == guestInfo.ToolsVersion && this.ToolsInstallType == guestInfo.ToolsInstallType && this.GuestId == guestInfo.GuestId && this.GuestFamily == guestInfo.GuestFamily && this.GuestFullName == guestInfo.GuestFullName && this.HostName == guestInfo.HostName && this.IpAddress == guestInfo.IpAddress && ((this.Net == null && guestInfo.Net == null) || (this.Net != null && guestInfo.Net != null && Enumerable.SequenceEqual(this.Net, guestInfo.Net))) && ((this.IpStack == null && guestInfo.IpStack == null) || (this.IpStack != null && guestInfo.IpStack != null && Enumerable.SequenceEqual(this.IpStack, guestInfo.IpStack))) && ((this.Disk == null && guestInfo.Disk == null) || (this.Disk != null && guestInfo.Disk != null && Enumerable.SequenceEqual(this.Disk, guestInfo.Disk))) && ((this.Screen == null && guestInfo.Screen == null) || (this.Screen != null && this.Screen.Equals(guestInfo.Screen))) && this.GuestState == guestInfo.GuestState && this.AppHeartbeatStatus == guestInfo.AppHeartbeatStatus && ((this.GuestKernelCrashed == null && guestInfo.GuestKernelCrashed == null) || (this.GuestKernelCrashed != null && this.GuestKernelCrashed.Equals(guestInfo.GuestKernelCrashed))) && this.AppState == guestInfo.AppState && ((this.GuestOperationsReady == null && guestInfo.GuestOperationsReady == null) || (this.GuestOperationsReady != null && this.GuestOperationsReady.Equals(guestInfo.GuestOperationsReady))) && ((this.InteractiveGuestOperationsReady == null && guestInfo.InteractiveGuestOperationsReady == null) || (this.InteractiveGuestOperationsReady != null && this.InteractiveGuestOperationsReady.Equals(guestInfo.InteractiveGuestOperationsReady))) && ((this.GuestStateChangeSupported == null && guestInfo.GuestStateChangeSupported == null) || (this.GuestStateChangeSupported != null && this.GuestStateChangeSupported.Equals(guestInfo.GuestStateChangeSupported))) && ((this.GenerationInfo == null && guestInfo.GenerationInfo == null) || (this.GenerationInfo != null && guestInfo.GenerationInfo != null && Enumerable.SequenceEqual(this.GenerationInfo, guestInfo.GenerationInfo))));\n        }\n\n        public override bool Equals(object guestInfo)\n        {\n            return Equals(guestInfo as GuestInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ToolsStatus + \"_\" + ToolsVersionStatus + \"_\" + ToolsVersionStatus2 + \"_\" + ToolsRunningStatus + \"_\" + ToolsVersion + \"_\" + ToolsInstallType + \"_\" + GuestId + \"_\" + GuestFamily + \"_\" + GuestFullName + \"_\" + HostName + \"_\" + IpAddress + \"_\" + Net + \"_\" + IpStack + \"_\" + Disk + \"_\" + Screen + \"_\" + GuestState + \"_\" + AppHeartbeatStatus + \"_\" + GuestKernelCrashed + \"_\" + AppState + \"_\" + GuestOperationsReady + \"_\" + InteractiveGuestOperationsReady + \"_\" + GuestStateChangeSupported + \"_\" + GenerationInfo).GetHashCode();\n        }\n    }\n\n    public class GuestInfoNamespaceGenerationInfo : DynamicData, IEquatable<GuestInfoNamespaceGenerationInfo>\n    {\n        public string Key { get; set; }\n\n        public int GenerationNo { get; set; }\n\n        public bool Equals(GuestInfoNamespaceGenerationInfo guestInfoNamespaceGenerationInfo)\n        {\n            return (guestInfoNamespaceGenerationInfo != null && this.Key == guestInfoNamespaceGenerationInfo.Key && this.GenerationNo == guestInfoNamespaceGenerationInfo.GenerationNo);\n        }\n\n        public override bool Equals(object guestInfoNamespaceGenerationInfo)\n        {\n            return Equals(guestInfoNamespaceGenerationInfo as GuestInfoNamespaceGenerationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + GenerationNo).GetHashCode();\n        }\n    }\n\n    public class GuestListFileInfo : DynamicData, IEquatable<GuestListFileInfo>\n    {\n        public GuestFileInfo[] Files { get; set; }\n\n        public int Remaining { get; set; }\n\n        public bool Equals(GuestListFileInfo guestListFileInfo)\n        {\n            return (guestListFileInfo != null && ((this.Files == null && guestListFileInfo.Files == null) || (this.Files != null && guestListFileInfo.Files != null && Enumerable.SequenceEqual(this.Files, guestListFileInfo.Files))) && this.Remaining == guestListFileInfo.Remaining);\n        }\n\n        public override bool Equals(object guestListFileInfo)\n        {\n            return Equals(guestListFileInfo as GuestListFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Files + \"_\" + Remaining).GetHashCode();\n        }\n    }\n\n    public class GuestMappedAliases : DynamicData, IEquatable<GuestMappedAliases>\n    {\n        public string Base64Cert { get; set; }\n\n        public string Username { get; set; }\n\n        public GuestAuthSubject[] Subjects { get; set; }\n\n        public bool Equals(GuestMappedAliases guestMappedAliases)\n        {\n            return (guestMappedAliases != null && this.Base64Cert == guestMappedAliases.Base64Cert && this.Username == guestMappedAliases.Username && ((this.Subjects == null && guestMappedAliases.Subjects == null) || (this.Subjects != null && guestMappedAliases.Subjects != null && Enumerable.SequenceEqual(this.Subjects, guestMappedAliases.Subjects))));\n        }\n\n        public override bool Equals(object guestMappedAliases)\n        {\n            return Equals(guestMappedAliases as GuestMappedAliases);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Base64Cert + \"_\" + Username + \"_\" + Subjects).GetHashCode();\n        }\n    }\n\n    public class GuestMultipleMappings : GuestOperationsFault, IEquatable<GuestMultipleMappings>\n    {\n        public bool Equals(GuestMultipleMappings guestMultipleMappings)\n        {\n            return (guestMultipleMappings != null && base.Equals(guestMultipleMappings));\n        }\n\n        public override bool Equals(object guestMultipleMappings)\n        {\n            return Equals(guestMultipleMappings as GuestMultipleMappings);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestNicInfo : DynamicData, IEquatable<GuestNicInfo>\n    {\n        public string Network { get; set; }\n\n        public string[] IpAddress { get; set; }\n\n        public string MacAddress { get; set; }\n\n        public bool Connected { get; set; }\n\n        public int DeviceConfigId { get; set; }\n\n        public NetDnsConfigInfo DnsConfig { get; set; }\n\n        public NetIpConfigInfo IpConfig { get; set; }\n\n        public NetBIOSConfigInfo NetBIOSConfig { get; set; }\n\n        public bool Equals(GuestNicInfo guestNicInfo)\n        {\n            return (guestNicInfo != null && this.Network == guestNicInfo.Network && ((this.IpAddress == null && guestNicInfo.IpAddress == null) || (this.IpAddress != null && guestNicInfo.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, guestNicInfo.IpAddress))) && this.MacAddress == guestNicInfo.MacAddress && this.Connected == guestNicInfo.Connected && this.DeviceConfigId == guestNicInfo.DeviceConfigId && ((this.DnsConfig == null && guestNicInfo.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(guestNicInfo.DnsConfig))) && ((this.IpConfig == null && guestNicInfo.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(guestNicInfo.IpConfig))) && ((this.NetBIOSConfig == null && guestNicInfo.NetBIOSConfig == null) || (this.NetBIOSConfig != null && this.NetBIOSConfig.Equals(guestNicInfo.NetBIOSConfig))));\n        }\n\n        public override bool Equals(object guestNicInfo)\n        {\n            return Equals(guestNicInfo as GuestNicInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + IpAddress + \"_\" + MacAddress + \"_\" + Connected + \"_\" + DeviceConfigId + \"_\" + DnsConfig + \"_\" + IpConfig + \"_\" + NetBIOSConfig).GetHashCode();\n        }\n    }\n\n    public class GuestOperationsFault : VimFault, IEquatable<GuestOperationsFault>\n    {\n        public bool Equals(GuestOperationsFault guestOperationsFault)\n        {\n            return (guestOperationsFault != null && base.Equals(guestOperationsFault));\n        }\n\n        public override bool Equals(object guestOperationsFault)\n        {\n            return Equals(guestOperationsFault as GuestOperationsFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestOperationsManager : ViewBase, IEquatable<GuestOperationsManager>\n    {\n        public ManagedObjectReference AuthManager { get; set; }\n\n        public ManagedObjectReference FileManager { get; set; }\n\n        public ManagedObjectReference ProcessManager { get; set; }\n\n        public ManagedObjectReference GuestWindowsRegistryManager { get; set; }\n\n        public ManagedObjectReference AliasManager { get; set; }\n\n        public GuestOperationsManager_LinkedView LinkedView { get; set; }\n\n        public bool Equals(GuestOperationsManager guestOperationsManager)\n        {\n            return (guestOperationsManager != null && ((this.AuthManager == null && guestOperationsManager.AuthManager == null) || (this.AuthManager != null && this.AuthManager.Equals(guestOperationsManager.AuthManager))) && ((this.FileManager == null && guestOperationsManager.FileManager == null) || (this.FileManager != null && this.FileManager.Equals(guestOperationsManager.FileManager))) && ((this.ProcessManager == null && guestOperationsManager.ProcessManager == null) || (this.ProcessManager != null && this.ProcessManager.Equals(guestOperationsManager.ProcessManager))) && ((this.GuestWindowsRegistryManager == null && guestOperationsManager.GuestWindowsRegistryManager == null) || (this.GuestWindowsRegistryManager != null && this.GuestWindowsRegistryManager.Equals(guestOperationsManager.GuestWindowsRegistryManager))) && ((this.AliasManager == null && guestOperationsManager.AliasManager == null) || (this.AliasManager != null && this.AliasManager.Equals(guestOperationsManager.AliasManager))) && ((this.LinkedView == null && guestOperationsManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(guestOperationsManager.LinkedView))));\n        }\n\n        public override bool Equals(object guestOperationsManager)\n        {\n            return Equals(guestOperationsManager as GuestOperationsManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AuthManager + \"_\" + FileManager + \"_\" + ProcessManager + \"_\" + GuestWindowsRegistryManager + \"_\" + AliasManager + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class GuestOperationsManager_LinkedView : IEquatable<GuestOperationsManager_LinkedView>\n    {\n        public GuestAuthManager AuthManager { get; set; }\n\n        public GuestFileManager FileManager { get; set; }\n\n        public GuestProcessManager ProcessManager { get; set; }\n\n        public GuestWindowsRegistryManager GuestWindowsRegistryManager { get; set; }\n\n        public GuestAliasManager AliasManager { get; set; }\n\n        public bool Equals(GuestOperationsManager_LinkedView guestOperationsManager_LinkedView)\n        {\n            return (guestOperationsManager_LinkedView != null && ((this.AuthManager == null && guestOperationsManager_LinkedView.AuthManager == null) || (this.AuthManager != null && this.AuthManager.Equals(guestOperationsManager_LinkedView.AuthManager))) && ((this.FileManager == null && guestOperationsManager_LinkedView.FileManager == null) || (this.FileManager != null && this.FileManager.Equals(guestOperationsManager_LinkedView.FileManager))) && ((this.ProcessManager == null && guestOperationsManager_LinkedView.ProcessManager == null) || (this.ProcessManager != null && this.ProcessManager.Equals(guestOperationsManager_LinkedView.ProcessManager))) && ((this.GuestWindowsRegistryManager == null && guestOperationsManager_LinkedView.GuestWindowsRegistryManager == null) || (this.GuestWindowsRegistryManager != null && this.GuestWindowsRegistryManager.Equals(guestOperationsManager_LinkedView.GuestWindowsRegistryManager))) && ((this.AliasManager == null && guestOperationsManager_LinkedView.AliasManager == null) || (this.AliasManager != null && this.AliasManager.Equals(guestOperationsManager_LinkedView.AliasManager))));\n        }\n\n        public override bool Equals(object guestOperationsManager_LinkedView)\n        {\n            return Equals(guestOperationsManager_LinkedView as GuestOperationsManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AuthManager + \"_\" + FileManager + \"_\" + ProcessManager + \"_\" + GuestWindowsRegistryManager + \"_\" + AliasManager).GetHashCode();\n        }\n    }\n\n    public class GuestOperationsUnavailable : GuestOperationsFault, IEquatable<GuestOperationsUnavailable>\n    {\n        public bool Equals(GuestOperationsUnavailable guestOperationsUnavailable)\n        {\n            return (guestOperationsUnavailable != null && base.Equals(guestOperationsUnavailable));\n        }\n\n        public override bool Equals(object guestOperationsUnavailable)\n        {\n            return Equals(guestOperationsUnavailable as GuestOperationsUnavailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestOsDescriptor : DynamicData, IEquatable<GuestOsDescriptor>\n    {\n        public string Id { get; set; }\n\n        public string Family { get; set; }\n\n        public string FullName { get; set; }\n\n        public int SupportedMaxCPUs { get; set; }\n\n        public int NumSupportedPhysicalSockets { get; set; }\n\n        public int NumSupportedCoresPerSocket { get; set; }\n\n        public int SupportedMinMemMB { get; set; }\n\n        public int SupportedMaxMemMB { get; set; }\n\n        public int RecommendedMemMB { get; set; }\n\n        public int RecommendedColorDepth { get; set; }\n\n        public string[] SupportedDiskControllerList { get; set; }\n\n        public string RecommendedSCSIController { get; set; }\n\n        public string RecommendedDiskController { get; set; }\n\n        public int SupportedNumDisks { get; set; }\n\n        public int RecommendedDiskSizeMB { get; set; }\n\n        public string RecommendedCdromController { get; set; }\n\n        public string[] SupportedEthernetCard { get; set; }\n\n        public string RecommendedEthernetCard { get; set; }\n\n        public bool? SupportsSlaveDisk { get; set; }\n\n        public HostCpuIdInfo[] CpuFeatureMask { get; set; }\n\n        public bool SmcRequired { get; set; }\n\n        public bool SupportsWakeOnLan { get; set; }\n\n        public bool SupportsVMI { get; set; }\n\n        public bool SupportsMemoryHotAdd { get; set; }\n\n        public bool SupportsCpuHotAdd { get; set; }\n\n        public bool SupportsCpuHotRemove { get; set; }\n\n        public string[] SupportedFirmware { get; set; }\n\n        public string RecommendedFirmware { get; set; }\n\n        public string[] SupportedUSBControllerList { get; set; }\n\n        public string RecommendedUSBController { get; set; }\n\n        public bool Supports3D { get; set; }\n\n        public bool Recommended3D { get; set; }\n\n        public bool SmcRecommended { get; set; }\n\n        public bool Ich7mRecommended { get; set; }\n\n        public bool UsbRecommended { get; set; }\n\n        public string SupportLevel { get; set; }\n\n        public bool SupportedForCreate { get; set; }\n\n        public IntOption VRAMSizeInKB { get; set; }\n\n        public int NumSupportedFloppyDevices { get; set; }\n\n        public string[] WakeOnLanEthernetCard { get; set; }\n\n        public bool SupportsPvscsiControllerForBoot { get; set; }\n\n        public bool DiskUuidEnabled { get; set; }\n\n        public bool SupportsHotPlugPCI { get; set; }\n\n        public bool? SupportsSecureBoot { get; set; }\n\n        public bool? DefaultSecureBoot { get; set; }\n\n        public bool? PersistentMemorySupported { get; set; }\n\n        public long? SupportedMinPersistentMemoryMB { get; set; }\n\n        public long? SupportedMaxPersistentMemoryMB { get; set; }\n\n        public long? RecommendedPersistentMemoryMB { get; set; }\n\n        public bool? PersistentMemoryHotAddSupported { get; set; }\n\n        public bool? PersistentMemoryHotRemoveSupported { get; set; }\n\n        public bool? PersistentMemoryColdGrowthSupported { get; set; }\n\n        public long? PersistentMemoryColdGrowthGranularityMB { get; set; }\n\n        public bool? PersistentMemoryHotGrowthSupported { get; set; }\n\n        public long? PersistentMemoryHotGrowthGranularityMB { get; set; }\n\n        public int? NumRecommendedPhysicalSockets { get; set; }\n\n        public int? NumRecommendedCoresPerSocket { get; set; }\n\n        public BoolOption VvtdSupported { get; set; }\n\n        public BoolOption VbsSupported { get; set; }\n\n        public bool? SupportsTPM20 { get; set; }\n\n        public bool Equals(GuestOsDescriptor guestOsDescriptor)\n        {\n            return (guestOsDescriptor != null && this.Id == guestOsDescriptor.Id && this.Family == guestOsDescriptor.Family && this.FullName == guestOsDescriptor.FullName && this.SupportedMaxCPUs == guestOsDescriptor.SupportedMaxCPUs && this.NumSupportedPhysicalSockets == guestOsDescriptor.NumSupportedPhysicalSockets && this.NumSupportedCoresPerSocket == guestOsDescriptor.NumSupportedCoresPerSocket && this.SupportedMinMemMB == guestOsDescriptor.SupportedMinMemMB && this.SupportedMaxMemMB == guestOsDescriptor.SupportedMaxMemMB && this.RecommendedMemMB == guestOsDescriptor.RecommendedMemMB && this.RecommendedColorDepth == guestOsDescriptor.RecommendedColorDepth && ((this.SupportedDiskControllerList == null && guestOsDescriptor.SupportedDiskControllerList == null) || (this.SupportedDiskControllerList != null && guestOsDescriptor.SupportedDiskControllerList != null && Enumerable.SequenceEqual(this.SupportedDiskControllerList, guestOsDescriptor.SupportedDiskControllerList))) && this.RecommendedSCSIController == guestOsDescriptor.RecommendedSCSIController && this.RecommendedDiskController == guestOsDescriptor.RecommendedDiskController && this.SupportedNumDisks == guestOsDescriptor.SupportedNumDisks && this.RecommendedDiskSizeMB == guestOsDescriptor.RecommendedDiskSizeMB && this.RecommendedCdromController == guestOsDescriptor.RecommendedCdromController && ((this.SupportedEthernetCard == null && guestOsDescriptor.SupportedEthernetCard == null) || (this.SupportedEthernetCard != null && guestOsDescriptor.SupportedEthernetCard != null && Enumerable.SequenceEqual(this.SupportedEthernetCard, guestOsDescriptor.SupportedEthernetCard))) && this.RecommendedEthernetCard == guestOsDescriptor.RecommendedEthernetCard && ((this.SupportsSlaveDisk == null && guestOsDescriptor.SupportsSlaveDisk == null) || (this.SupportsSlaveDisk != null && this.SupportsSlaveDisk.Equals(guestOsDescriptor.SupportsSlaveDisk))) && ((this.CpuFeatureMask == null && guestOsDescriptor.CpuFeatureMask == null) || (this.CpuFeatureMask != null && guestOsDescriptor.CpuFeatureMask != null && Enumerable.SequenceEqual(this.CpuFeatureMask, guestOsDescriptor.CpuFeatureMask))) && this.SmcRequired == guestOsDescriptor.SmcRequired && this.SupportsWakeOnLan == guestOsDescriptor.SupportsWakeOnLan && this.SupportsVMI == guestOsDescriptor.SupportsVMI && this.SupportsMemoryHotAdd == guestOsDescriptor.SupportsMemoryHotAdd && this.SupportsCpuHotAdd == guestOsDescriptor.SupportsCpuHotAdd && this.SupportsCpuHotRemove == guestOsDescriptor.SupportsCpuHotRemove && ((this.SupportedFirmware == null && guestOsDescriptor.SupportedFirmware == null) || (this.SupportedFirmware != null && guestOsDescriptor.SupportedFirmware != null && Enumerable.SequenceEqual(this.SupportedFirmware, guestOsDescriptor.SupportedFirmware))) && this.RecommendedFirmware == guestOsDescriptor.RecommendedFirmware && ((this.SupportedUSBControllerList == null && guestOsDescriptor.SupportedUSBControllerList == null) || (this.SupportedUSBControllerList != null && guestOsDescriptor.SupportedUSBControllerList != null && Enumerable.SequenceEqual(this.SupportedUSBControllerList, guestOsDescriptor.SupportedUSBControllerList))) && this.RecommendedUSBController == guestOsDescriptor.RecommendedUSBController && this.Supports3D == guestOsDescriptor.Supports3D && this.Recommended3D == guestOsDescriptor.Recommended3D && this.SmcRecommended == guestOsDescriptor.SmcRecommended && this.Ich7mRecommended == guestOsDescriptor.Ich7mRecommended && this.UsbRecommended == guestOsDescriptor.UsbRecommended && this.SupportLevel == guestOsDescriptor.SupportLevel && this.SupportedForCreate == guestOsDescriptor.SupportedForCreate && ((this.VRAMSizeInKB == null && guestOsDescriptor.VRAMSizeInKB == null) || (this.VRAMSizeInKB != null && this.VRAMSizeInKB.Equals(guestOsDescriptor.VRAMSizeInKB))) && this.NumSupportedFloppyDevices == guestOsDescriptor.NumSupportedFloppyDevices && ((this.WakeOnLanEthernetCard == null && guestOsDescriptor.WakeOnLanEthernetCard == null) || (this.WakeOnLanEthernetCard != null && guestOsDescriptor.WakeOnLanEthernetCard != null && Enumerable.SequenceEqual(this.WakeOnLanEthernetCard, guestOsDescriptor.WakeOnLanEthernetCard))) && this.SupportsPvscsiControllerForBoot == guestOsDescriptor.SupportsPvscsiControllerForBoot && this.DiskUuidEnabled == guestOsDescriptor.DiskUuidEnabled && this.SupportsHotPlugPCI == guestOsDescriptor.SupportsHotPlugPCI && ((this.SupportsSecureBoot == null && guestOsDescriptor.SupportsSecureBoot == null) || (this.SupportsSecureBoot != null && this.SupportsSecureBoot.Equals(guestOsDescriptor.SupportsSecureBoot))) && ((this.DefaultSecureBoot == null && guestOsDescriptor.DefaultSecureBoot == null) || (this.DefaultSecureBoot != null && this.DefaultSecureBoot.Equals(guestOsDescriptor.DefaultSecureBoot))) && ((this.PersistentMemorySupported == null && guestOsDescriptor.PersistentMemorySupported == null) || (this.PersistentMemorySupported != null && this.PersistentMemorySupported.Equals(guestOsDescriptor.PersistentMemorySupported))) && ((this.SupportedMinPersistentMemoryMB == null && guestOsDescriptor.SupportedMinPersistentMemoryMB == null) || (this.SupportedMinPersistentMemoryMB != null && this.SupportedMinPersistentMemoryMB.Equals(guestOsDescriptor.SupportedMinPersistentMemoryMB))) && ((this.SupportedMaxPersistentMemoryMB == null && guestOsDescriptor.SupportedMaxPersistentMemoryMB == null) || (this.SupportedMaxPersistentMemoryMB != null && this.SupportedMaxPersistentMemoryMB.Equals(guestOsDescriptor.SupportedMaxPersistentMemoryMB))) && ((this.RecommendedPersistentMemoryMB == null && guestOsDescriptor.RecommendedPersistentMemoryMB == null) || (this.RecommendedPersistentMemoryMB != null && this.RecommendedPersistentMemoryMB.Equals(guestOsDescriptor.RecommendedPersistentMemoryMB))) && ((this.PersistentMemoryHotAddSupported == null && guestOsDescriptor.PersistentMemoryHotAddSupported == null) || (this.PersistentMemoryHotAddSupported != null && this.PersistentMemoryHotAddSupported.Equals(guestOsDescriptor.PersistentMemoryHotAddSupported))) && ((this.PersistentMemoryHotRemoveSupported == null && guestOsDescriptor.PersistentMemoryHotRemoveSupported == null) || (this.PersistentMemoryHotRemoveSupported != null && this.PersistentMemoryHotRemoveSupported.Equals(guestOsDescriptor.PersistentMemoryHotRemoveSupported))) && ((this.PersistentMemoryColdGrowthSupported == null && guestOsDescriptor.PersistentMemoryColdGrowthSupported == null) || (this.PersistentMemoryColdGrowthSupported != null && this.PersistentMemoryColdGrowthSupported.Equals(guestOsDescriptor.PersistentMemoryColdGrowthSupported))) && ((this.PersistentMemoryColdGrowthGranularityMB == null && guestOsDescriptor.PersistentMemoryColdGrowthGranularityMB == null) || (this.PersistentMemoryColdGrowthGranularityMB != null && this.PersistentMemoryColdGrowthGranularityMB.Equals(guestOsDescriptor.PersistentMemoryColdGrowthGranularityMB))) && ((this.PersistentMemoryHotGrowthSupported == null && guestOsDescriptor.PersistentMemoryHotGrowthSupported == null) || (this.PersistentMemoryHotGrowthSupported != null && this.PersistentMemoryHotGrowthSupported.Equals(guestOsDescriptor.PersistentMemoryHotGrowthSupported))) && ((this.PersistentMemoryHotGrowthGranularityMB == null && guestOsDescriptor.PersistentMemoryHotGrowthGranularityMB == null) || (this.PersistentMemoryHotGrowthGranularityMB != null && this.PersistentMemoryHotGrowthGranularityMB.Equals(guestOsDescriptor.PersistentMemoryHotGrowthGranularityMB))) && ((this.NumRecommendedPhysicalSockets == null && guestOsDescriptor.NumRecommendedPhysicalSockets == null) || (this.NumRecommendedPhysicalSockets != null && this.NumRecommendedPhysicalSockets.Equals(guestOsDescriptor.NumRecommendedPhysicalSockets))) && ((this.NumRecommendedCoresPerSocket == null && guestOsDescriptor.NumRecommendedCoresPerSocket == null) || (this.NumRecommendedCoresPerSocket != null && this.NumRecommendedCoresPerSocket.Equals(guestOsDescriptor.NumRecommendedCoresPerSocket))) && ((this.VvtdSupported == null && guestOsDescriptor.VvtdSupported == null) || (this.VvtdSupported != null && this.VvtdSupported.Equals(guestOsDescriptor.VvtdSupported))) && ((this.VbsSupported == null && guestOsDescriptor.VbsSupported == null) || (this.VbsSupported != null && this.VbsSupported.Equals(guestOsDescriptor.VbsSupported))) && ((this.SupportsTPM20 == null && guestOsDescriptor.SupportsTPM20 == null) || (this.SupportsTPM20 != null && this.SupportsTPM20.Equals(guestOsDescriptor.SupportsTPM20))));\n        }\n\n        public override bool Equals(object guestOsDescriptor)\n        {\n            return Equals(guestOsDescriptor as GuestOsDescriptor);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Family + \"_\" + FullName + \"_\" + SupportedMaxCPUs + \"_\" + NumSupportedPhysicalSockets + \"_\" + NumSupportedCoresPerSocket + \"_\" + SupportedMinMemMB + \"_\" + SupportedMaxMemMB + \"_\" + RecommendedMemMB + \"_\" + RecommendedColorDepth + \"_\" + SupportedDiskControllerList + \"_\" + RecommendedSCSIController + \"_\" + RecommendedDiskController + \"_\" + SupportedNumDisks + \"_\" + RecommendedDiskSizeMB + \"_\" + RecommendedCdromController + \"_\" + SupportedEthernetCard + \"_\" + RecommendedEthernetCard + \"_\" + SupportsSlaveDisk + \"_\" + CpuFeatureMask + \"_\" + SmcRequired + \"_\" + SupportsWakeOnLan + \"_\" + SupportsVMI + \"_\" + SupportsMemoryHotAdd + \"_\" + SupportsCpuHotAdd + \"_\" + SupportsCpuHotRemove + \"_\" + SupportedFirmware + \"_\" + RecommendedFirmware + \"_\" + SupportedUSBControllerList + \"_\" + RecommendedUSBController + \"_\" + Supports3D + \"_\" + Recommended3D + \"_\" + SmcRecommended + \"_\" + Ich7mRecommended + \"_\" + UsbRecommended + \"_\" + SupportLevel + \"_\" + SupportedForCreate + \"_\" + VRAMSizeInKB + \"_\" + NumSupportedFloppyDevices + \"_\" + WakeOnLanEthernetCard + \"_\" + SupportsPvscsiControllerForBoot + \"_\" + DiskUuidEnabled + \"_\" + SupportsHotPlugPCI + \"_\" + SupportsSecureBoot + \"_\" + DefaultSecureBoot + \"_\" + PersistentMemorySupported + \"_\" + SupportedMinPersistentMemoryMB + \"_\" + SupportedMaxPersistentMemoryMB + \"_\" + RecommendedPersistentMemoryMB + \"_\" + PersistentMemoryHotAddSupported + \"_\" + PersistentMemoryHotRemoveSupported + \"_\" + PersistentMemoryColdGrowthSupported + \"_\" + PersistentMemoryColdGrowthGranularityMB + \"_\" + PersistentMemoryHotGrowthSupported + \"_\" + PersistentMemoryHotGrowthGranularityMB + \"_\" + NumRecommendedPhysicalSockets + \"_\" + NumRecommendedCoresPerSocket + \"_\" + VvtdSupported + \"_\" + VbsSupported + \"_\" + SupportsTPM20).GetHashCode();\n        }\n    }\n\n    public class GuestPermissionDenied : GuestOperationsFault, IEquatable<GuestPermissionDenied>\n    {\n        public bool Equals(GuestPermissionDenied guestPermissionDenied)\n        {\n            return (guestPermissionDenied != null && base.Equals(guestPermissionDenied));\n        }\n\n        public override bool Equals(object guestPermissionDenied)\n        {\n            return Equals(guestPermissionDenied as GuestPermissionDenied);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestPosixFileAttributes : GuestFileAttributes, IEquatable<GuestPosixFileAttributes>\n    {\n        public int? OwnerId { get; set; }\n\n        public int? GroupId { get; set; }\n\n        public long? Permissions { get; set; }\n\n        public bool Equals(GuestPosixFileAttributes guestPosixFileAttributes)\n        {\n            return (guestPosixFileAttributes != null && ((this.OwnerId == null && guestPosixFileAttributes.OwnerId == null) || (this.OwnerId != null && this.OwnerId.Equals(guestPosixFileAttributes.OwnerId))) && ((this.GroupId == null && guestPosixFileAttributes.GroupId == null) || (this.GroupId != null && this.GroupId.Equals(guestPosixFileAttributes.GroupId))) && ((this.Permissions == null && guestPosixFileAttributes.Permissions == null) || (this.Permissions != null && this.Permissions.Equals(guestPosixFileAttributes.Permissions))));\n        }\n\n        public override bool Equals(object guestPosixFileAttributes)\n        {\n            return Equals(guestPosixFileAttributes as GuestPosixFileAttributes);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OwnerId + \"_\" + GroupId + \"_\" + Permissions).GetHashCode();\n        }\n    }\n\n    public class GuestProcessInfo : DynamicData, IEquatable<GuestProcessInfo>\n    {\n        public string Name { get; set; }\n\n        public long Pid { get; set; }\n\n        public string Owner { get; set; }\n\n        public string CmdLine { get; set; }\n\n        public DateTime StartTime { get; set; }\n\n        public DateTime? EndTime { get; set; }\n\n        public int? ExitCode { get; set; }\n\n        public bool Equals(GuestProcessInfo guestProcessInfo)\n        {\n            return (guestProcessInfo != null && this.Name == guestProcessInfo.Name && this.Pid == guestProcessInfo.Pid && this.Owner == guestProcessInfo.Owner && this.CmdLine == guestProcessInfo.CmdLine && this.StartTime == guestProcessInfo.StartTime && ((this.EndTime == null && guestProcessInfo.EndTime == null) || (this.EndTime != null && this.EndTime.Equals(guestProcessInfo.EndTime))) && ((this.ExitCode == null && guestProcessInfo.ExitCode == null) || (this.ExitCode != null && this.ExitCode.Equals(guestProcessInfo.ExitCode))));\n        }\n\n        public override bool Equals(object guestProcessInfo)\n        {\n            return Equals(guestProcessInfo as GuestProcessInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Pid + \"_\" + Owner + \"_\" + CmdLine + \"_\" + StartTime + \"_\" + EndTime + \"_\" + ExitCode).GetHashCode();\n        }\n    }\n\n    public class GuestProcessManager : ViewBase, IEquatable<GuestProcessManager>\n    {\n        public long StartProgramInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestProgramSpec spec)\n        {\n            return default(long);\n        }\n\n        public GuestProcessInfo[] ListProcessesInGuest(ManagedObjectReference vm, GuestAuthentication auth, long[] pids)\n        {\n            return default(GuestProcessInfo[]);\n        }\n\n        public void TerminateProcessInGuest(ManagedObjectReference vm, GuestAuthentication auth, long pid)\n        {\n        }\n\n        public string[] ReadEnvironmentVariableInGuest(ManagedObjectReference vm, GuestAuthentication auth, string[] names)\n        {\n            return default(string[]);\n        }\n\n        public bool Equals(GuestProcessManager guestProcessManager)\n        {\n            return (guestProcessManager != null && base.Equals(guestProcessManager));\n        }\n\n        public override bool Equals(object guestProcessManager)\n        {\n            return Equals(guestProcessManager as GuestProcessManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestProcessNotFound : GuestOperationsFault, IEquatable<GuestProcessNotFound>\n    {\n        public long Pid { get; set; }\n\n        public bool Equals(GuestProcessNotFound guestProcessNotFound)\n        {\n            return (guestProcessNotFound != null && this.Pid == guestProcessNotFound.Pid);\n        }\n\n        public override bool Equals(object guestProcessNotFound)\n        {\n            return Equals(guestProcessNotFound as GuestProcessNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Pid).GetHashCode();\n        }\n    }\n\n    public class GuestProgramSpec : DynamicData, IEquatable<GuestProgramSpec>\n    {\n        public string ProgramPath { get; set; }\n\n        public string Arguments { get; set; }\n\n        public string WorkingDirectory { get; set; }\n\n        public string[] EnvVariables { get; set; }\n\n        public bool Equals(GuestProgramSpec guestProgramSpec)\n        {\n            return (guestProgramSpec != null && this.ProgramPath == guestProgramSpec.ProgramPath && this.Arguments == guestProgramSpec.Arguments && this.WorkingDirectory == guestProgramSpec.WorkingDirectory && ((this.EnvVariables == null && guestProgramSpec.EnvVariables == null) || (this.EnvVariables != null && guestProgramSpec.EnvVariables != null && Enumerable.SequenceEqual(this.EnvVariables, guestProgramSpec.EnvVariables))));\n        }\n\n        public override bool Equals(object guestProgramSpec)\n        {\n            return Equals(guestProgramSpec as GuestProgramSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProgramPath + \"_\" + Arguments + \"_\" + WorkingDirectory + \"_\" + EnvVariables).GetHashCode();\n        }\n    }\n\n    public class GuestRegistryFault : GuestOperationsFault, IEquatable<GuestRegistryFault>\n    {\n        public long WindowsSystemErrorCode { get; set; }\n\n        public bool Equals(GuestRegistryFault guestRegistryFault)\n        {\n            return (guestRegistryFault != null && this.WindowsSystemErrorCode == guestRegistryFault.WindowsSystemErrorCode);\n        }\n\n        public override bool Equals(object guestRegistryFault)\n        {\n            return Equals(guestRegistryFault as GuestRegistryFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (WindowsSystemErrorCode).GetHashCode();\n        }\n    }\n\n    public class GuestRegistryKeyAlreadyExists : GuestRegistryKeyFault, IEquatable<GuestRegistryKeyAlreadyExists>\n    {\n        public bool Equals(GuestRegistryKeyAlreadyExists guestRegistryKeyAlreadyExists)\n        {\n            return (guestRegistryKeyAlreadyExists != null && base.Equals(guestRegistryKeyAlreadyExists));\n        }\n\n        public override bool Equals(object guestRegistryKeyAlreadyExists)\n        {\n            return Equals(guestRegistryKeyAlreadyExists as GuestRegistryKeyAlreadyExists);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestRegistryKeyFault : GuestRegistryFault, IEquatable<GuestRegistryKeyFault>\n    {\n        public string KeyName { get; set; }\n\n        public bool Equals(GuestRegistryKeyFault guestRegistryKeyFault)\n        {\n            return (guestRegistryKeyFault != null && this.KeyName == guestRegistryKeyFault.KeyName);\n        }\n\n        public override bool Equals(object guestRegistryKeyFault)\n        {\n            return Equals(guestRegistryKeyFault as GuestRegistryKeyFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyName).GetHashCode();\n        }\n    }\n\n    public class GuestRegistryKeyHasSubkeys : GuestRegistryKeyFault, IEquatable<GuestRegistryKeyHasSubkeys>\n    {\n        public bool Equals(GuestRegistryKeyHasSubkeys guestRegistryKeyHasSubkeys)\n        {\n            return (guestRegistryKeyHasSubkeys != null && base.Equals(guestRegistryKeyHasSubkeys));\n        }\n\n        public override bool Equals(object guestRegistryKeyHasSubkeys)\n        {\n            return Equals(guestRegistryKeyHasSubkeys as GuestRegistryKeyHasSubkeys);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestRegistryKeyInvalid : GuestRegistryKeyFault, IEquatable<GuestRegistryKeyInvalid>\n    {\n        public bool Equals(GuestRegistryKeyInvalid guestRegistryKeyInvalid)\n        {\n            return (guestRegistryKeyInvalid != null && base.Equals(guestRegistryKeyInvalid));\n        }\n\n        public override bool Equals(object guestRegistryKeyInvalid)\n        {\n            return Equals(guestRegistryKeyInvalid as GuestRegistryKeyInvalid);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestRegistryKeyParentVolatile : GuestRegistryKeyFault, IEquatable<GuestRegistryKeyParentVolatile>\n    {\n        public bool Equals(GuestRegistryKeyParentVolatile guestRegistryKeyParentVolatile)\n        {\n            return (guestRegistryKeyParentVolatile != null && base.Equals(guestRegistryKeyParentVolatile));\n        }\n\n        public override bool Equals(object guestRegistryKeyParentVolatile)\n        {\n            return Equals(guestRegistryKeyParentVolatile as GuestRegistryKeyParentVolatile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestRegistryValueFault : GuestRegistryFault, IEquatable<GuestRegistryValueFault>\n    {\n        public string KeyName { get; set; }\n\n        public string ValueName { get; set; }\n\n        public bool Equals(GuestRegistryValueFault guestRegistryValueFault)\n        {\n            return (guestRegistryValueFault != null && this.KeyName == guestRegistryValueFault.KeyName && this.ValueName == guestRegistryValueFault.ValueName);\n        }\n\n        public override bool Equals(object guestRegistryValueFault)\n        {\n            return Equals(guestRegistryValueFault as GuestRegistryValueFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyName + \"_\" + ValueName).GetHashCode();\n        }\n    }\n\n    public class GuestRegistryValueNotFound : GuestRegistryValueFault, IEquatable<GuestRegistryValueNotFound>\n    {\n        public bool Equals(GuestRegistryValueNotFound guestRegistryValueNotFound)\n        {\n            return (guestRegistryValueNotFound != null && base.Equals(guestRegistryValueNotFound));\n        }\n\n        public override bool Equals(object guestRegistryValueNotFound)\n        {\n            return Equals(guestRegistryValueNotFound as GuestRegistryValueNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestRegKeyNameSpec : DynamicData, IEquatable<GuestRegKeyNameSpec>\n    {\n        public string RegistryPath { get; set; }\n\n        public string WowBitness { get; set; }\n\n        public bool Equals(GuestRegKeyNameSpec guestRegKeyNameSpec)\n        {\n            return (guestRegKeyNameSpec != null && this.RegistryPath == guestRegKeyNameSpec.RegistryPath && this.WowBitness == guestRegKeyNameSpec.WowBitness);\n        }\n\n        public override bool Equals(object guestRegKeyNameSpec)\n        {\n            return Equals(guestRegKeyNameSpec as GuestRegKeyNameSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RegistryPath + \"_\" + WowBitness).GetHashCode();\n        }\n    }\n\n    public class GuestRegKeyRecordSpec : DynamicData, IEquatable<GuestRegKeyRecordSpec>\n    {\n        public GuestRegKeySpec Key { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(GuestRegKeyRecordSpec guestRegKeyRecordSpec)\n        {\n            return (guestRegKeyRecordSpec != null && ((this.Key == null && guestRegKeyRecordSpec.Key == null) || (this.Key != null && this.Key.Equals(guestRegKeyRecordSpec.Key))) && ((this.Fault == null && guestRegKeyRecordSpec.Fault == null) || (this.Fault != null && this.Fault.Equals(guestRegKeyRecordSpec.Fault))));\n        }\n\n        public override bool Equals(object guestRegKeyRecordSpec)\n        {\n            return Equals(guestRegKeyRecordSpec as GuestRegKeyRecordSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class GuestRegKeySpec : DynamicData, IEquatable<GuestRegKeySpec>\n    {\n        public GuestRegKeyNameSpec KeyName { get; set; }\n\n        public string ClassType { get; set; }\n\n        public DateTime LastWritten { get; set; }\n\n        public bool Equals(GuestRegKeySpec guestRegKeySpec)\n        {\n            return (guestRegKeySpec != null && ((this.KeyName == null && guestRegKeySpec.KeyName == null) || (this.KeyName != null && this.KeyName.Equals(guestRegKeySpec.KeyName))) && this.ClassType == guestRegKeySpec.ClassType && this.LastWritten == guestRegKeySpec.LastWritten);\n        }\n\n        public override bool Equals(object guestRegKeySpec)\n        {\n            return Equals(guestRegKeySpec as GuestRegKeySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyName + \"_\" + ClassType + \"_\" + LastWritten).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueBinarySpec : GuestRegValueDataSpec, IEquatable<GuestRegValueBinarySpec>\n    {\n        public byte[] Value { get; set; }\n\n        public bool Equals(GuestRegValueBinarySpec guestRegValueBinarySpec)\n        {\n            return (guestRegValueBinarySpec != null && ((this.Value == null && guestRegValueBinarySpec.Value == null) || (this.Value != null && guestRegValueBinarySpec.Value != null && Enumerable.SequenceEqual(this.Value, guestRegValueBinarySpec.Value))));\n        }\n\n        public override bool Equals(object guestRegValueBinarySpec)\n        {\n            return Equals(guestRegValueBinarySpec as GuestRegValueBinarySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueDataSpec : DynamicData, IEquatable<GuestRegValueDataSpec>\n    {\n        public bool Equals(GuestRegValueDataSpec guestRegValueDataSpec)\n        {\n            return (guestRegValueDataSpec != null && base.Equals(guestRegValueDataSpec));\n        }\n\n        public override bool Equals(object guestRegValueDataSpec)\n        {\n            return Equals(guestRegValueDataSpec as GuestRegValueDataSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class GuestRegValueDwordSpec : GuestRegValueDataSpec, IEquatable<GuestRegValueDwordSpec>\n    {\n        public int Value { get; set; }\n\n        public bool Equals(GuestRegValueDwordSpec guestRegValueDwordSpec)\n        {\n            return (guestRegValueDwordSpec != null && this.Value == guestRegValueDwordSpec.Value);\n        }\n\n        public override bool Equals(object guestRegValueDwordSpec)\n        {\n            return Equals(guestRegValueDwordSpec as GuestRegValueDwordSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueExpandStringSpec : GuestRegValueDataSpec, IEquatable<GuestRegValueExpandStringSpec>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(GuestRegValueExpandStringSpec guestRegValueExpandStringSpec)\n        {\n            return (guestRegValueExpandStringSpec != null && this.Value == guestRegValueExpandStringSpec.Value);\n        }\n\n        public override bool Equals(object guestRegValueExpandStringSpec)\n        {\n            return Equals(guestRegValueExpandStringSpec as GuestRegValueExpandStringSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueMultiStringSpec : GuestRegValueDataSpec, IEquatable<GuestRegValueMultiStringSpec>\n    {\n        public string[] Value { get; set; }\n\n        public bool Equals(GuestRegValueMultiStringSpec guestRegValueMultiStringSpec)\n        {\n            return (guestRegValueMultiStringSpec != null && ((this.Value == null && guestRegValueMultiStringSpec.Value == null) || (this.Value != null && guestRegValueMultiStringSpec.Value != null && Enumerable.SequenceEqual(this.Value, guestRegValueMultiStringSpec.Value))));\n        }\n\n        public override bool Equals(object guestRegValueMultiStringSpec)\n        {\n            return Equals(guestRegValueMultiStringSpec as GuestRegValueMultiStringSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueNameSpec : DynamicData, IEquatable<GuestRegValueNameSpec>\n    {\n        public GuestRegKeyNameSpec KeyName { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(GuestRegValueNameSpec guestRegValueNameSpec)\n        {\n            return (guestRegValueNameSpec != null && ((this.KeyName == null && guestRegValueNameSpec.KeyName == null) || (this.KeyName != null && this.KeyName.Equals(guestRegValueNameSpec.KeyName))) && this.Name == guestRegValueNameSpec.Name);\n        }\n\n        public override bool Equals(object guestRegValueNameSpec)\n        {\n            return Equals(guestRegValueNameSpec as GuestRegValueNameSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyName + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueQwordSpec : GuestRegValueDataSpec, IEquatable<GuestRegValueQwordSpec>\n    {\n        public long Value { get; set; }\n\n        public bool Equals(GuestRegValueQwordSpec guestRegValueQwordSpec)\n        {\n            return (guestRegValueQwordSpec != null && this.Value == guestRegValueQwordSpec.Value);\n        }\n\n        public override bool Equals(object guestRegValueQwordSpec)\n        {\n            return Equals(guestRegValueQwordSpec as GuestRegValueQwordSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueSpec : DynamicData, IEquatable<GuestRegValueSpec>\n    {\n        public GuestRegValueNameSpec Name { get; set; }\n\n        public GuestRegValueDataSpec Data { get; set; }\n\n        public bool Equals(GuestRegValueSpec guestRegValueSpec)\n        {\n            return (guestRegValueSpec != null && ((this.Name == null && guestRegValueSpec.Name == null) || (this.Name != null && this.Name.Equals(guestRegValueSpec.Name))) && ((this.Data == null && guestRegValueSpec.Data == null) || (this.Data != null && this.Data.Equals(guestRegValueSpec.Data))));\n        }\n\n        public override bool Equals(object guestRegValueSpec)\n        {\n            return Equals(guestRegValueSpec as GuestRegValueSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Data).GetHashCode();\n        }\n    }\n\n    public class GuestRegValueStringSpec : GuestRegValueDataSpec, IEquatable<GuestRegValueStringSpec>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(GuestRegValueStringSpec guestRegValueStringSpec)\n        {\n            return (guestRegValueStringSpec != null && this.Value == guestRegValueStringSpec.Value);\n        }\n\n        public override bool Equals(object guestRegValueStringSpec)\n        {\n            return Equals(guestRegValueStringSpec as GuestRegValueStringSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class GuestScreenInfo : DynamicData, IEquatable<GuestScreenInfo>\n    {\n        public int Width { get; set; }\n\n        public int Height { get; set; }\n\n        public bool Equals(GuestScreenInfo guestScreenInfo)\n        {\n            return (guestScreenInfo != null && this.Width == guestScreenInfo.Width && this.Height == guestScreenInfo.Height);\n        }\n\n        public override bool Equals(object guestScreenInfo)\n        {\n            return Equals(guestScreenInfo as GuestScreenInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Width + \"_\" + Height).GetHashCode();\n        }\n    }\n\n    public class GuestStackInfo : DynamicData, IEquatable<GuestStackInfo>\n    {\n        public NetDnsConfigInfo DnsConfig { get; set; }\n\n        public NetIpRouteConfigInfo IpRouteConfig { get; set; }\n\n        public KeyValue[] IpStackConfig { get; set; }\n\n        public NetDhcpConfigInfo DhcpConfig { get; set; }\n\n        public bool Equals(GuestStackInfo guestStackInfo)\n        {\n            return (guestStackInfo != null && ((this.DnsConfig == null && guestStackInfo.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(guestStackInfo.DnsConfig))) && ((this.IpRouteConfig == null && guestStackInfo.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(guestStackInfo.IpRouteConfig))) && ((this.IpStackConfig == null && guestStackInfo.IpStackConfig == null) || (this.IpStackConfig != null && guestStackInfo.IpStackConfig != null && Enumerable.SequenceEqual(this.IpStackConfig, guestStackInfo.IpStackConfig))) && ((this.DhcpConfig == null && guestStackInfo.DhcpConfig == null) || (this.DhcpConfig != null && this.DhcpConfig.Equals(guestStackInfo.DhcpConfig))));\n        }\n\n        public override bool Equals(object guestStackInfo)\n        {\n            return Equals(guestStackInfo as GuestStackInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DnsConfig + \"_\" + IpRouteConfig + \"_\" + IpStackConfig + \"_\" + DhcpConfig).GetHashCode();\n        }\n    }\n\n    public class GuestWindowsFileAttributes : GuestFileAttributes, IEquatable<GuestWindowsFileAttributes>\n    {\n        public bool? Hidden { get; set; }\n\n        public bool? ReadOnly { get; set; }\n\n        public DateTime? CreateTime { get; set; }\n\n        public bool Equals(GuestWindowsFileAttributes guestWindowsFileAttributes)\n        {\n            return (guestWindowsFileAttributes != null && ((this.Hidden == null && guestWindowsFileAttributes.Hidden == null) || (this.Hidden != null && this.Hidden.Equals(guestWindowsFileAttributes.Hidden))) && ((this.ReadOnly == null && guestWindowsFileAttributes.ReadOnly == null) || (this.ReadOnly != null && this.ReadOnly.Equals(guestWindowsFileAttributes.ReadOnly))) && ((this.CreateTime == null && guestWindowsFileAttributes.CreateTime == null) || (this.CreateTime != null && this.CreateTime.Equals(guestWindowsFileAttributes.CreateTime))));\n        }\n\n        public override bool Equals(object guestWindowsFileAttributes)\n        {\n            return Equals(guestWindowsFileAttributes as GuestWindowsFileAttributes);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hidden + \"_\" + ReadOnly + \"_\" + CreateTime).GetHashCode();\n        }\n    }\n\n    public class GuestWindowsProgramSpec : GuestProgramSpec, IEquatable<GuestWindowsProgramSpec>\n    {\n        public bool StartMinimized { get; set; }\n\n        public bool Equals(GuestWindowsProgramSpec guestWindowsProgramSpec)\n        {\n            return (guestWindowsProgramSpec != null && this.StartMinimized == guestWindowsProgramSpec.StartMinimized);\n        }\n\n        public override bool Equals(object guestWindowsProgramSpec)\n        {\n            return Equals(guestWindowsProgramSpec as GuestWindowsProgramSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StartMinimized).GetHashCode();\n        }\n    }\n\n    public class GuestWindowsRegistryManager : ViewBase, IEquatable<GuestWindowsRegistryManager>\n    {\n        public void CreateRegistryKeyInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, bool isVolatile, string classType)\n        {\n        }\n\n        public GuestRegKeyRecordSpec[] ListRegistryKeysInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, bool recursive, string matchPattern)\n        {\n            return default(GuestRegKeyRecordSpec[]);\n        }\n\n        public void DeleteRegistryKeyInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, bool recursive)\n        {\n        }\n\n        public void SetRegistryValueInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestRegValueSpec value)\n        {\n        }\n\n        public GuestRegValueSpec[] ListRegistryValuesInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, bool expandStrings, string matchPattern)\n        {\n            return default(GuestRegValueSpec[]);\n        }\n\n        public void DeleteRegistryValueInGuest(ManagedObjectReference vm, GuestAuthentication auth, GuestRegValueNameSpec valueName)\n        {\n        }\n\n        public bool Equals(GuestWindowsRegistryManager guestWindowsRegistryManager)\n        {\n            return (guestWindowsRegistryManager != null && base.Equals(guestWindowsRegistryManager));\n        }\n\n        public override bool Equals(object guestWindowsRegistryManager)\n        {\n            return Equals(guestWindowsRegistryManager as GuestWindowsRegistryManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HAErrorsAtDest : MigrationFault, IEquatable<HAErrorsAtDest>\n    {\n        public bool Equals(HAErrorsAtDest hAErrorsAtDest)\n        {\n            return (hAErrorsAtDest != null && base.Equals(hAErrorsAtDest));\n        }\n\n        public override bool Equals(object hAErrorsAtDest)\n        {\n            return Equals(hAErrorsAtDest as HAErrorsAtDest);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HbrDiskMigrationAction : ClusterAction, IEquatable<HbrDiskMigrationAction>\n    {\n        public string CollectionId { get; set; }\n\n        public string CollectionName { get; set; }\n\n        public string[] DiskIds { get; set; }\n\n        public ManagedObjectReference Source { get; set; }\n\n        public ManagedObjectReference Destination { get; set; }\n\n        public long SizeTransferred { get; set; }\n\n        public float? SpaceUtilSrcBefore { get; set; }\n\n        public float? SpaceUtilDstBefore { get; set; }\n\n        public float? SpaceUtilSrcAfter { get; set; }\n\n        public float? SpaceUtilDstAfter { get; set; }\n\n        public float? IoLatencySrcBefore { get; set; }\n\n        public float? IoLatencyDstBefore { get; set; }\n\n        public HbrDiskMigrationAction_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HbrDiskMigrationAction hbrDiskMigrationAction)\n        {\n            return (hbrDiskMigrationAction != null && this.CollectionId == hbrDiskMigrationAction.CollectionId && this.CollectionName == hbrDiskMigrationAction.CollectionName && ((this.DiskIds == null && hbrDiskMigrationAction.DiskIds == null) || (this.DiskIds != null && hbrDiskMigrationAction.DiskIds != null && Enumerable.SequenceEqual(this.DiskIds, hbrDiskMigrationAction.DiskIds))) && ((this.Source == null && hbrDiskMigrationAction.Source == null) || (this.Source != null && this.Source.Equals(hbrDiskMigrationAction.Source))) && ((this.Destination == null && hbrDiskMigrationAction.Destination == null) || (this.Destination != null && this.Destination.Equals(hbrDiskMigrationAction.Destination))) && this.SizeTransferred == hbrDiskMigrationAction.SizeTransferred && ((this.SpaceUtilSrcBefore == null && hbrDiskMigrationAction.SpaceUtilSrcBefore == null) || (this.SpaceUtilSrcBefore != null && this.SpaceUtilSrcBefore.Equals(hbrDiskMigrationAction.SpaceUtilSrcBefore))) && ((this.SpaceUtilDstBefore == null && hbrDiskMigrationAction.SpaceUtilDstBefore == null) || (this.SpaceUtilDstBefore != null && this.SpaceUtilDstBefore.Equals(hbrDiskMigrationAction.SpaceUtilDstBefore))) && ((this.SpaceUtilSrcAfter == null && hbrDiskMigrationAction.SpaceUtilSrcAfter == null) || (this.SpaceUtilSrcAfter != null && this.SpaceUtilSrcAfter.Equals(hbrDiskMigrationAction.SpaceUtilSrcAfter))) && ((this.SpaceUtilDstAfter == null && hbrDiskMigrationAction.SpaceUtilDstAfter == null) || (this.SpaceUtilDstAfter != null && this.SpaceUtilDstAfter.Equals(hbrDiskMigrationAction.SpaceUtilDstAfter))) && ((this.IoLatencySrcBefore == null && hbrDiskMigrationAction.IoLatencySrcBefore == null) || (this.IoLatencySrcBefore != null && this.IoLatencySrcBefore.Equals(hbrDiskMigrationAction.IoLatencySrcBefore))) && ((this.IoLatencyDstBefore == null && hbrDiskMigrationAction.IoLatencyDstBefore == null) || (this.IoLatencyDstBefore != null && this.IoLatencyDstBefore.Equals(hbrDiskMigrationAction.IoLatencyDstBefore))) && ((this.LinkedView == null && hbrDiskMigrationAction.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hbrDiskMigrationAction.LinkedView))));\n        }\n\n        public override bool Equals(object hbrDiskMigrationAction)\n        {\n            return Equals(hbrDiskMigrationAction as HbrDiskMigrationAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CollectionId + \"_\" + CollectionName + \"_\" + DiskIds + \"_\" + Source + \"_\" + Destination + \"_\" + SizeTransferred + \"_\" + SpaceUtilSrcBefore + \"_\" + SpaceUtilDstBefore + \"_\" + SpaceUtilSrcAfter + \"_\" + SpaceUtilDstAfter + \"_\" + IoLatencySrcBefore + \"_\" + IoLatencyDstBefore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HbrDiskMigrationAction_LinkedView : IEquatable<HbrDiskMigrationAction_LinkedView>\n    {\n        public Datastore Source { get; set; }\n\n        public Datastore Destination { get; set; }\n\n        public bool Equals(HbrDiskMigrationAction_LinkedView hbrDiskMigrationAction_LinkedView)\n        {\n            return (hbrDiskMigrationAction_LinkedView != null && ((this.Source == null && hbrDiskMigrationAction_LinkedView.Source == null) || (this.Source != null && this.Source.Equals(hbrDiskMigrationAction_LinkedView.Source))) && ((this.Destination == null && hbrDiskMigrationAction_LinkedView.Destination == null) || (this.Destination != null && this.Destination.Equals(hbrDiskMigrationAction_LinkedView.Destination))));\n        }\n\n        public override bool Equals(object hbrDiskMigrationAction_LinkedView)\n        {\n            return Equals(hbrDiskMigrationAction_LinkedView as HbrDiskMigrationAction_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Destination).GetHashCode();\n        }\n    }\n\n    public class HbrManagerReplicationVmInfo : DynamicData, IEquatable<HbrManagerReplicationVmInfo>\n    {\n        public string State { get; set; }\n\n        public ReplicationVmProgressInfo ProgressInfo { get; set; }\n\n        public string ImageId { get; set; }\n\n        public LocalizedMethodFault LastError { get; set; }\n\n        public bool Equals(HbrManagerReplicationVmInfo hbrManagerReplicationVmInfo)\n        {\n            return (hbrManagerReplicationVmInfo != null && this.State == hbrManagerReplicationVmInfo.State && ((this.ProgressInfo == null && hbrManagerReplicationVmInfo.ProgressInfo == null) || (this.ProgressInfo != null && this.ProgressInfo.Equals(hbrManagerReplicationVmInfo.ProgressInfo))) && this.ImageId == hbrManagerReplicationVmInfo.ImageId && ((this.LastError == null && hbrManagerReplicationVmInfo.LastError == null) || (this.LastError != null && this.LastError.Equals(hbrManagerReplicationVmInfo.LastError))));\n        }\n\n        public override bool Equals(object hbrManagerReplicationVmInfo)\n        {\n            return Equals(hbrManagerReplicationVmInfo as HbrManagerReplicationVmInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + ProgressInfo + \"_\" + ImageId + \"_\" + LastError).GetHashCode();\n        }\n    }\n\n    public class HbrManagerVmReplicationCapability : DynamicData, IEquatable<HbrManagerVmReplicationCapability>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string SupportedQuiesceMode { get; set; }\n\n        public bool CompressionSupported { get; set; }\n\n        public long MaxSupportedSourceDiskCapacity { get; set; }\n\n        public long? MinRpo { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public HbrManagerVmReplicationCapability_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HbrManagerVmReplicationCapability hbrManagerVmReplicationCapability)\n        {\n            return (hbrManagerVmReplicationCapability != null && ((this.Vm == null && hbrManagerVmReplicationCapability.Vm == null) || (this.Vm != null && this.Vm.Equals(hbrManagerVmReplicationCapability.Vm))) && this.SupportedQuiesceMode == hbrManagerVmReplicationCapability.SupportedQuiesceMode && this.CompressionSupported == hbrManagerVmReplicationCapability.CompressionSupported && this.MaxSupportedSourceDiskCapacity == hbrManagerVmReplicationCapability.MaxSupportedSourceDiskCapacity && ((this.MinRpo == null && hbrManagerVmReplicationCapability.MinRpo == null) || (this.MinRpo != null && this.MinRpo.Equals(hbrManagerVmReplicationCapability.MinRpo))) && ((this.Fault == null && hbrManagerVmReplicationCapability.Fault == null) || (this.Fault != null && this.Fault.Equals(hbrManagerVmReplicationCapability.Fault))) && ((this.LinkedView == null && hbrManagerVmReplicationCapability.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hbrManagerVmReplicationCapability.LinkedView))));\n        }\n\n        public override bool Equals(object hbrManagerVmReplicationCapability)\n        {\n            return Equals(hbrManagerVmReplicationCapability as HbrManagerVmReplicationCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + SupportedQuiesceMode + \"_\" + CompressionSupported + \"_\" + MaxSupportedSourceDiskCapacity + \"_\" + MinRpo + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HbrManagerVmReplicationCapability_LinkedView : IEquatable<HbrManagerVmReplicationCapability_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(HbrManagerVmReplicationCapability_LinkedView hbrManagerVmReplicationCapability_LinkedView)\n        {\n            return (hbrManagerVmReplicationCapability_LinkedView != null && ((this.Vm == null && hbrManagerVmReplicationCapability_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(hbrManagerVmReplicationCapability_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object hbrManagerVmReplicationCapability_LinkedView)\n        {\n            return Equals(hbrManagerVmReplicationCapability_LinkedView as HbrManagerVmReplicationCapability_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class HealthStatusChangedEvent : Event, IEquatable<HealthStatusChangedEvent>\n    {\n        public string ComponentId { get; set; }\n\n        public string OldStatus { get; set; }\n\n        public string NewStatus { get; set; }\n\n        public string ComponentName { get; set; }\n\n        public string ServiceId { get; set; }\n\n        public bool Equals(HealthStatusChangedEvent healthStatusChangedEvent)\n        {\n            return (healthStatusChangedEvent != null && this.ComponentId == healthStatusChangedEvent.ComponentId && this.OldStatus == healthStatusChangedEvent.OldStatus && this.NewStatus == healthStatusChangedEvent.NewStatus && this.ComponentName == healthStatusChangedEvent.ComponentName && this.ServiceId == healthStatusChangedEvent.ServiceId);\n        }\n\n        public override bool Equals(object healthStatusChangedEvent)\n        {\n            return Equals(healthStatusChangedEvent as HealthStatusChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComponentId + \"_\" + OldStatus + \"_\" + NewStatus + \"_\" + ComponentName + \"_\" + ServiceId).GetHashCode();\n        }\n    }\n\n    public class HealthSystemRuntime : DynamicData, IEquatable<HealthSystemRuntime>\n    {\n        public HostSystemHealthInfo SystemHealthInfo { get; set; }\n\n        public HostHardwareStatusInfo HardwareStatusInfo { get; set; }\n\n        public bool Equals(HealthSystemRuntime healthSystemRuntime)\n        {\n            return (healthSystemRuntime != null && ((this.SystemHealthInfo == null && healthSystemRuntime.SystemHealthInfo == null) || (this.SystemHealthInfo != null && this.SystemHealthInfo.Equals(healthSystemRuntime.SystemHealthInfo))) && ((this.HardwareStatusInfo == null && healthSystemRuntime.HardwareStatusInfo == null) || (this.HardwareStatusInfo != null && this.HardwareStatusInfo.Equals(healthSystemRuntime.HardwareStatusInfo))));\n        }\n\n        public override bool Equals(object healthSystemRuntime)\n        {\n            return Equals(healthSystemRuntime as HealthSystemRuntime);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SystemHealthInfo + \"_\" + HardwareStatusInfo).GetHashCode();\n        }\n    }\n\n    public class HealthUpdate : DynamicData, IEquatable<HealthUpdate>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public string HealthUpdateInfoId { get; set; }\n\n        public string Id { get; set; }\n\n        public ManagedEntityStatus Status { get; set; }\n\n        public string Remediation { get; set; }\n\n        public HealthUpdate_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HealthUpdate healthUpdate)\n        {\n            return (healthUpdate != null && ((this.Entity == null && healthUpdate.Entity == null) || (this.Entity != null && this.Entity.Equals(healthUpdate.Entity))) && this.HealthUpdateInfoId == healthUpdate.HealthUpdateInfoId && this.Id == healthUpdate.Id && this.Status == healthUpdate.Status && this.Remediation == healthUpdate.Remediation && ((this.LinkedView == null && healthUpdate.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(healthUpdate.LinkedView))));\n        }\n\n        public override bool Equals(object healthUpdate)\n        {\n            return Equals(healthUpdate as HealthUpdate);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + HealthUpdateInfoId + \"_\" + Id + \"_\" + Status + \"_\" + Remediation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HealthUpdate_LinkedView : IEquatable<HealthUpdate_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(HealthUpdate_LinkedView healthUpdate_LinkedView)\n        {\n            return (healthUpdate_LinkedView != null && ((this.Entity == null && healthUpdate_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(healthUpdate_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object healthUpdate_LinkedView)\n        {\n            return Equals(healthUpdate_LinkedView as HealthUpdate_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class HealthUpdateInfo : DynamicData, IEquatable<HealthUpdateInfo>\n    {\n        public string Id { get; set; }\n\n        public string ComponentType { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(HealthUpdateInfo healthUpdateInfo)\n        {\n            return (healthUpdateInfo != null && this.Id == healthUpdateInfo.Id && this.ComponentType == healthUpdateInfo.ComponentType && this.Description == healthUpdateInfo.Description);\n        }\n\n        public override bool Equals(object healthUpdateInfo)\n        {\n            return Equals(healthUpdateInfo as HealthUpdateInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + ComponentType + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class HealthUpdateManager : ViewBase, IEquatable<HealthUpdateManager>\n    {\n        public string RegisterHealthUpdateProvider(string name, HealthUpdateInfo[] healthUpdateInfo)\n        {\n            return default(string);\n        }\n\n        public void UnregisterHealthUpdateProvider(string providerId)\n        {\n        }\n\n        public string[] QueryProviderList()\n        {\n            return default(string[]);\n        }\n\n        public bool HasProvider(string id)\n        {\n            return default(bool);\n        }\n\n        public string QueryProviderName(string id)\n        {\n            return default(string);\n        }\n\n        public HealthUpdateInfo[] QueryHealthUpdateInfos(string providerId)\n        {\n            return default(HealthUpdateInfo[]);\n        }\n\n        public void AddMonitoredEntities(string providerId, ManagedObjectReference[] entities)\n        {\n        }\n\n        public void RemoveMonitoredEntities(string providerId, ManagedObjectReference[] entities)\n        {\n        }\n\n        public ManagedObjectReference[] QueryMonitoredEntities(string providerId)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool HasMonitoredEntity(string providerId, ManagedObjectReference entity)\n        {\n            return default(bool);\n        }\n\n        public ManagedObjectReference[] QueryUnmonitoredHosts(string providerId, ManagedObjectReference cluster)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public void PostHealthUpdates(string providerId, HealthUpdate[] updates)\n        {\n        }\n\n        public HealthUpdate[] QueryHealthUpdates(string providerId)\n        {\n            return default(HealthUpdate[]);\n        }\n\n        public string AddFilter(string providerId, string filterName, string[] infoIds)\n        {\n            return default(string);\n        }\n\n        public string[] QueryFilterList(string providerId)\n        {\n            return default(string[]);\n        }\n\n        public string QueryFilterName(string filterId)\n        {\n            return default(string);\n        }\n\n        public string[] QueryFilterInfoIds(string filterId)\n        {\n            return default(string[]);\n        }\n\n        public ManagedObjectReference[] QueryFilterEntities(string filterId)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public void AddFilterEntities(string filterId, ManagedObjectReference[] entities)\n        {\n        }\n\n        public void RemoveFilterEntities(string filterId, ManagedObjectReference[] entities)\n        {\n        }\n\n        public void RemoveFilter(string filterId)\n        {\n        }\n\n        public bool Equals(HealthUpdateManager healthUpdateManager)\n        {\n            return (healthUpdateManager != null && base.Equals(healthUpdateManager));\n        }\n\n        public override bool Equals(object healthUpdateManager)\n        {\n            return Equals(healthUpdateManager as HealthUpdateManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HeterogenousHostsBlockingEVC : EVCConfigFault, IEquatable<HeterogenousHostsBlockingEVC>\n    {\n        public bool Equals(HeterogenousHostsBlockingEVC heterogenousHostsBlockingEVC)\n        {\n            return (heterogenousHostsBlockingEVC != null && base.Equals(heterogenousHostsBlockingEVC));\n        }\n\n        public override bool Equals(object heterogenousHostsBlockingEVC)\n        {\n            return Equals(heterogenousHostsBlockingEVC as HeterogenousHostsBlockingEVC);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HistoryCollector : ViewBase, IEquatable<HistoryCollector>\n    {\n        public object Filter { get; set; }\n\n        public void SetCollectorPageSize(int maxCount)\n        {\n        }\n\n        public void RewindCollector()\n        {\n        }\n\n        public void ResetCollector()\n        {\n        }\n\n        public void DestroyCollector()\n        {\n        }\n\n        public bool Equals(HistoryCollector historyCollector)\n        {\n            return (historyCollector != null && ((this.Filter == null && historyCollector.Filter == null) || (this.Filter != null && this.Filter.Equals(historyCollector.Filter))));\n        }\n\n        public override bool Equals(object historyCollector)\n        {\n            return Equals(historyCollector as HistoryCollector);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter).GetHashCode();\n        }\n    }\n\n    public class HostAccessControlEntry : DynamicData, IEquatable<HostAccessControlEntry>\n    {\n        public string Principal { get; set; }\n\n        public bool Group { get; set; }\n\n        public HostAccessMode AccessMode { get; set; }\n\n        public bool Equals(HostAccessControlEntry hostAccessControlEntry)\n        {\n            return (hostAccessControlEntry != null && this.Principal == hostAccessControlEntry.Principal && this.Group == hostAccessControlEntry.Group && this.AccessMode == hostAccessControlEntry.AccessMode);\n        }\n\n        public override bool Equals(object hostAccessControlEntry)\n        {\n            return Equals(hostAccessControlEntry as HostAccessControlEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Principal + \"_\" + Group + \"_\" + AccessMode).GetHashCode();\n        }\n    }\n\n    public class HostAccessManager : ViewBase, IEquatable<HostAccessManager>\n    {\n        public HostLockdownMode LockdownMode { get; set; }\n\n        public HostAccessControlEntry[] RetrieveHostAccessControlEntries()\n        {\n            return default(HostAccessControlEntry[]);\n        }\n\n        public void ChangeAccessMode(string principal, bool isGroup, HostAccessMode accessMode)\n        {\n        }\n\n        public string[] QuerySystemUsers()\n        {\n            return default(string[]);\n        }\n\n        public void UpdateSystemUsers(string[] users)\n        {\n        }\n\n        public string[] QueryLockdownExceptions()\n        {\n            return default(string[]);\n        }\n\n        public void UpdateLockdownExceptions(string[] users)\n        {\n        }\n\n        public void ChangeLockdownMode(HostLockdownMode mode)\n        {\n        }\n\n        public bool Equals(HostAccessManager hostAccessManager)\n        {\n            return (hostAccessManager != null && this.LockdownMode == hostAccessManager.LockdownMode);\n        }\n\n        public override bool Equals(object hostAccessManager)\n        {\n            return Equals(hostAccessManager as HostAccessManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LockdownMode).GetHashCode();\n        }\n    }\n\n    public class HostAccessRestrictedToManagementServer : NotSupported, IEquatable<HostAccessRestrictedToManagementServer>\n    {\n        public string ManagementServer { get; set; }\n\n        public bool Equals(HostAccessRestrictedToManagementServer hostAccessRestrictedToManagementServer)\n        {\n            return (hostAccessRestrictedToManagementServer != null && this.ManagementServer == hostAccessRestrictedToManagementServer.ManagementServer);\n        }\n\n        public override bool Equals(object hostAccessRestrictedToManagementServer)\n        {\n            return Equals(hostAccessRestrictedToManagementServer as HostAccessRestrictedToManagementServer);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ManagementServer).GetHashCode();\n        }\n    }\n\n    public class HostAccountSpec : DynamicData, IEquatable<HostAccountSpec>\n    {\n        public string Id { get; set; }\n\n        public string Password { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(HostAccountSpec hostAccountSpec)\n        {\n            return (hostAccountSpec != null && this.Id == hostAccountSpec.Id && this.Password == hostAccountSpec.Password && this.Description == hostAccountSpec.Description);\n        }\n\n        public override bool Equals(object hostAccountSpec)\n        {\n            return Equals(hostAccountSpec as HostAccountSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Password + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class HostActiveDirectory : DynamicData, IEquatable<HostActiveDirectory>\n    {\n        public string ChangeOperation { get; set; }\n\n        public HostActiveDirectorySpec Spec { get; set; }\n\n        public bool Equals(HostActiveDirectory hostActiveDirectory)\n        {\n            return (hostActiveDirectory != null && this.ChangeOperation == hostActiveDirectory.ChangeOperation && ((this.Spec == null && hostActiveDirectory.Spec == null) || (this.Spec != null && this.Spec.Equals(hostActiveDirectory.Spec))));\n        }\n\n        public override bool Equals(object hostActiveDirectory)\n        {\n            return Equals(hostActiveDirectory as HostActiveDirectory);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostActiveDirectoryAuthentication : HostDirectoryStore, IEquatable<HostActiveDirectoryAuthentication>\n    {\n        public ManagedObjectReference JoinDomain_Task(string domainName, string userName, string password)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void JoinDomain(string domainName, string userName, string password)\n        {\n        }\n\n        public ManagedObjectReference JoinDomainWithCAM_Task(string domainName, string camServer)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void JoinDomainWithCAM(string domainName, string camServer)\n        {\n        }\n\n        public ManagedObjectReference ImportCertificateForCAM_Task(string certPath, string camServer)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ImportCertificateForCAM(string certPath, string camServer)\n        {\n        }\n\n        public ManagedObjectReference LeaveCurrentDomain_Task(bool force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void LeaveCurrentDomain(bool force)\n        {\n        }\n\n        public void EnableSmartCardAuthentication()\n        {\n        }\n\n        public void InstallSmartCardTrustAnchor(string cert)\n        {\n        }\n\n        public void ReplaceSmartCardTrustAnchors(string[] certs)\n        {\n        }\n\n        public void RemoveSmartCardTrustAnchor(string issuer, string serial)\n        {\n        }\n\n        public void RemoveSmartCardTrustAnchorByFingerprint(string fingerprint, string digest)\n        {\n        }\n\n        public string[] ListSmartCardTrustAnchors()\n        {\n            return default(string[]);\n        }\n\n        public void DisableSmartCardAuthentication()\n        {\n        }\n\n        public bool Equals(HostActiveDirectoryAuthentication hostActiveDirectoryAuthentication)\n        {\n            return (hostActiveDirectoryAuthentication != null && base.Equals(hostActiveDirectoryAuthentication));\n        }\n\n        public override bool Equals(object hostActiveDirectoryAuthentication)\n        {\n            return Equals(hostActiveDirectoryAuthentication as HostActiveDirectoryAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostActiveDirectoryInfo : HostDirectoryStoreInfo, IEquatable<HostActiveDirectoryInfo>\n    {\n        public string JoinedDomain { get; set; }\n\n        public string[] TrustedDomain { get; set; }\n\n        public string DomainMembershipStatus { get; set; }\n\n        public bool? SmartCardAuthenticationEnabled { get; set; }\n\n        public bool Equals(HostActiveDirectoryInfo hostActiveDirectoryInfo)\n        {\n            return (hostActiveDirectoryInfo != null && this.JoinedDomain == hostActiveDirectoryInfo.JoinedDomain && ((this.TrustedDomain == null && hostActiveDirectoryInfo.TrustedDomain == null) || (this.TrustedDomain != null && hostActiveDirectoryInfo.TrustedDomain != null && Enumerable.SequenceEqual(this.TrustedDomain, hostActiveDirectoryInfo.TrustedDomain))) && this.DomainMembershipStatus == hostActiveDirectoryInfo.DomainMembershipStatus && ((this.SmartCardAuthenticationEnabled == null && hostActiveDirectoryInfo.SmartCardAuthenticationEnabled == null) || (this.SmartCardAuthenticationEnabled != null && this.SmartCardAuthenticationEnabled.Equals(hostActiveDirectoryInfo.SmartCardAuthenticationEnabled))));\n        }\n\n        public override bool Equals(object hostActiveDirectoryInfo)\n        {\n            return Equals(hostActiveDirectoryInfo as HostActiveDirectoryInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (JoinedDomain + \"_\" + TrustedDomain + \"_\" + DomainMembershipStatus + \"_\" + SmartCardAuthenticationEnabled).GetHashCode();\n        }\n    }\n\n    public class HostActiveDirectorySpec : DynamicData, IEquatable<HostActiveDirectorySpec>\n    {\n        public string DomainName { get; set; }\n\n        public string UserName { get; set; }\n\n        public string Password { get; set; }\n\n        public string CamServer { get; set; }\n\n        public string Thumbprint { get; set; }\n\n        public bool? SmartCardAuthenticationEnabled { get; set; }\n\n        public string[] SmartCardTrustAnchors { get; set; }\n\n        public bool Equals(HostActiveDirectorySpec hostActiveDirectorySpec)\n        {\n            return (hostActiveDirectorySpec != null && this.DomainName == hostActiveDirectorySpec.DomainName && this.UserName == hostActiveDirectorySpec.UserName && this.Password == hostActiveDirectorySpec.Password && this.CamServer == hostActiveDirectorySpec.CamServer && this.Thumbprint == hostActiveDirectorySpec.Thumbprint && ((this.SmartCardAuthenticationEnabled == null && hostActiveDirectorySpec.SmartCardAuthenticationEnabled == null) || (this.SmartCardAuthenticationEnabled != null && this.SmartCardAuthenticationEnabled.Equals(hostActiveDirectorySpec.SmartCardAuthenticationEnabled))) && ((this.SmartCardTrustAnchors == null && hostActiveDirectorySpec.SmartCardTrustAnchors == null) || (this.SmartCardTrustAnchors != null && hostActiveDirectorySpec.SmartCardTrustAnchors != null && Enumerable.SequenceEqual(this.SmartCardTrustAnchors, hostActiveDirectorySpec.SmartCardTrustAnchors))));\n        }\n\n        public override bool Equals(object hostActiveDirectorySpec)\n        {\n            return Equals(hostActiveDirectorySpec as HostActiveDirectorySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DomainName + \"_\" + UserName + \"_\" + Password + \"_\" + CamServer + \"_\" + Thumbprint + \"_\" + SmartCardAuthenticationEnabled + \"_\" + SmartCardTrustAnchors).GetHashCode();\n        }\n    }\n\n    public class HostAddedEvent : HostEvent, IEquatable<HostAddedEvent>\n    {\n        public bool Equals(HostAddedEvent hostAddedEvent)\n        {\n            return (hostAddedEvent != null && base.Equals(hostAddedEvent));\n        }\n\n        public override bool Equals(object hostAddedEvent)\n        {\n            return Equals(hostAddedEvent as HostAddedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostAddFailedEvent : HostEvent, IEquatable<HostAddFailedEvent>\n    {\n        public string Hostname { get; set; }\n\n        public bool Equals(HostAddFailedEvent hostAddFailedEvent)\n        {\n            return (hostAddFailedEvent != null && this.Hostname == hostAddFailedEvent.Hostname);\n        }\n\n        public override bool Equals(object hostAddFailedEvent)\n        {\n            return Equals(hostAddFailedEvent as HostAddFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hostname).GetHashCode();\n        }\n    }\n\n    public class HostAdminDisableEvent : HostEvent, IEquatable<HostAdminDisableEvent>\n    {\n        public bool Equals(HostAdminDisableEvent hostAdminDisableEvent)\n        {\n            return (hostAdminDisableEvent != null && base.Equals(hostAdminDisableEvent));\n        }\n\n        public override bool Equals(object hostAdminDisableEvent)\n        {\n            return Equals(hostAdminDisableEvent as HostAdminDisableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostAdminEnableEvent : HostEvent, IEquatable<HostAdminEnableEvent>\n    {\n        public bool Equals(HostAdminEnableEvent hostAdminEnableEvent)\n        {\n            return (hostAdminEnableEvent != null && base.Equals(hostAdminEnableEvent));\n        }\n\n        public override bool Equals(object hostAdminEnableEvent)\n        {\n            return Equals(hostAdminEnableEvent as HostAdminEnableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostApplyProfile : ApplyProfile, IEquatable<HostApplyProfile>\n    {\n        public HostMemoryProfile Memory { get; set; }\n\n        public StorageProfile Storage { get; set; }\n\n        public NetworkProfile Network { get; set; }\n\n        public DateTimeProfile Datetime { get; set; }\n\n        public FirewallProfile Firewall { get; set; }\n\n        public SecurityProfile Security { get; set; }\n\n        public ServiceProfile[] Service { get; set; }\n\n        public OptionProfile[] Option { get; set; }\n\n        public UserProfile[] UserAccount { get; set; }\n\n        public UserGroupProfile[] UsergroupAccount { get; set; }\n\n        public AuthenticationProfile Authentication { get; set; }\n\n        public bool Equals(HostApplyProfile hostApplyProfile)\n        {\n            return (hostApplyProfile != null && ((this.Memory == null && hostApplyProfile.Memory == null) || (this.Memory != null && this.Memory.Equals(hostApplyProfile.Memory))) && ((this.Storage == null && hostApplyProfile.Storage == null) || (this.Storage != null && this.Storage.Equals(hostApplyProfile.Storage))) && ((this.Network == null && hostApplyProfile.Network == null) || (this.Network != null && this.Network.Equals(hostApplyProfile.Network))) && ((this.Datetime == null && hostApplyProfile.Datetime == null) || (this.Datetime != null && this.Datetime.Equals(hostApplyProfile.Datetime))) && ((this.Firewall == null && hostApplyProfile.Firewall == null) || (this.Firewall != null && this.Firewall.Equals(hostApplyProfile.Firewall))) && ((this.Security == null && hostApplyProfile.Security == null) || (this.Security != null && this.Security.Equals(hostApplyProfile.Security))) && ((this.Service == null && hostApplyProfile.Service == null) || (this.Service != null && hostApplyProfile.Service != null && Enumerable.SequenceEqual(this.Service, hostApplyProfile.Service))) && ((this.Option == null && hostApplyProfile.Option == null) || (this.Option != null && hostApplyProfile.Option != null && Enumerable.SequenceEqual(this.Option, hostApplyProfile.Option))) && ((this.UserAccount == null && hostApplyProfile.UserAccount == null) || (this.UserAccount != null && hostApplyProfile.UserAccount != null && Enumerable.SequenceEqual(this.UserAccount, hostApplyProfile.UserAccount))) && ((this.UsergroupAccount == null && hostApplyProfile.UsergroupAccount == null) || (this.UsergroupAccount != null && hostApplyProfile.UsergroupAccount != null && Enumerable.SequenceEqual(this.UsergroupAccount, hostApplyProfile.UsergroupAccount))) && ((this.Authentication == null && hostApplyProfile.Authentication == null) || (this.Authentication != null && this.Authentication.Equals(hostApplyProfile.Authentication))));\n        }\n\n        public override bool Equals(object hostApplyProfile)\n        {\n            return Equals(hostApplyProfile as HostApplyProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Memory + \"_\" + Storage + \"_\" + Network + \"_\" + Datetime + \"_\" + Firewall + \"_\" + Security + \"_\" + Service + \"_\" + Option + \"_\" + UserAccount + \"_\" + UsergroupAccount + \"_\" + Authentication).GetHashCode();\n        }\n    }\n\n    public class HostAuthenticationManager : ViewBase, IEquatable<HostAuthenticationManager>\n    {\n        public HostAuthenticationManagerInfo Info { get; set; }\n\n        public ManagedObjectReference[] SupportedStore { get; set; }\n\n        public HostAuthenticationManager_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostAuthenticationManager hostAuthenticationManager)\n        {\n            return (hostAuthenticationManager != null && ((this.Info == null && hostAuthenticationManager.Info == null) || (this.Info != null && this.Info.Equals(hostAuthenticationManager.Info))) && ((this.SupportedStore == null && hostAuthenticationManager.SupportedStore == null) || (this.SupportedStore != null && hostAuthenticationManager.SupportedStore != null && Enumerable.SequenceEqual(this.SupportedStore, hostAuthenticationManager.SupportedStore))) && ((this.LinkedView == null && hostAuthenticationManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostAuthenticationManager.LinkedView))));\n        }\n\n        public override bool Equals(object hostAuthenticationManager)\n        {\n            return Equals(hostAuthenticationManager as HostAuthenticationManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info + \"_\" + SupportedStore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostAuthenticationManager_LinkedView : IEquatable<HostAuthenticationManager_LinkedView>\n    {\n        public HostAuthenticationStore[] SupportedStore { get; set; }\n\n        public bool Equals(HostAuthenticationManager_LinkedView hostAuthenticationManager_LinkedView)\n        {\n            return (hostAuthenticationManager_LinkedView != null && ((this.SupportedStore == null && hostAuthenticationManager_LinkedView.SupportedStore == null) || (this.SupportedStore != null && hostAuthenticationManager_LinkedView.SupportedStore != null && Enumerable.SequenceEqual(this.SupportedStore, hostAuthenticationManager_LinkedView.SupportedStore))));\n        }\n\n        public override bool Equals(object hostAuthenticationManager_LinkedView)\n        {\n            return Equals(hostAuthenticationManager_LinkedView as HostAuthenticationManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportedStore).GetHashCode();\n        }\n    }\n\n    public class HostAuthenticationManagerInfo : DynamicData, IEquatable<HostAuthenticationManagerInfo>\n    {\n        public HostAuthenticationStoreInfo[] AuthConfig { get; set; }\n\n        public bool Equals(HostAuthenticationManagerInfo hostAuthenticationManagerInfo)\n        {\n            return (hostAuthenticationManagerInfo != null && ((this.AuthConfig == null && hostAuthenticationManagerInfo.AuthConfig == null) || (this.AuthConfig != null && hostAuthenticationManagerInfo.AuthConfig != null && Enumerable.SequenceEqual(this.AuthConfig, hostAuthenticationManagerInfo.AuthConfig))));\n        }\n\n        public override bool Equals(object hostAuthenticationManagerInfo)\n        {\n            return Equals(hostAuthenticationManagerInfo as HostAuthenticationManagerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AuthConfig).GetHashCode();\n        }\n    }\n\n    public class HostAuthenticationStore : ViewBase, IEquatable<HostAuthenticationStore>\n    {\n        public HostAuthenticationStoreInfo Info { get; set; }\n\n        public bool Equals(HostAuthenticationStore hostAuthenticationStore)\n        {\n            return (hostAuthenticationStore != null && ((this.Info == null && hostAuthenticationStore.Info == null) || (this.Info != null && this.Info.Equals(hostAuthenticationStore.Info))));\n        }\n\n        public override bool Equals(object hostAuthenticationStore)\n        {\n            return Equals(hostAuthenticationStore as HostAuthenticationStore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class HostAuthenticationStoreInfo : DynamicData, IEquatable<HostAuthenticationStoreInfo>\n    {\n        public bool Enabled { get; set; }\n\n        public bool Equals(HostAuthenticationStoreInfo hostAuthenticationStoreInfo)\n        {\n            return (hostAuthenticationStoreInfo != null && this.Enabled == hostAuthenticationStoreInfo.Enabled);\n        }\n\n        public override bool Equals(object hostAuthenticationStoreInfo)\n        {\n            return Equals(hostAuthenticationStoreInfo as HostAuthenticationStoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled).GetHashCode();\n        }\n    }\n\n    public class HostAutoStartManager : ViewBase, IEquatable<HostAutoStartManager>\n    {\n        public HostAutoStartManagerConfig Config { get; set; }\n\n        public void ReconfigureAutostart(HostAutoStartManagerConfig spec)\n        {\n        }\n\n        public void AutoStartPowerOn()\n        {\n        }\n\n        public void AutoStartPowerOff()\n        {\n        }\n\n        public bool Equals(HostAutoStartManager hostAutoStartManager)\n        {\n            return (hostAutoStartManager != null && ((this.Config == null && hostAutoStartManager.Config == null) || (this.Config != null && this.Config.Equals(hostAutoStartManager.Config))));\n        }\n\n        public override bool Equals(object hostAutoStartManager)\n        {\n            return Equals(hostAutoStartManager as HostAutoStartManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Config).GetHashCode();\n        }\n    }\n\n    public class HostAutoStartManagerConfig : DynamicData, IEquatable<HostAutoStartManagerConfig>\n    {\n        public AutoStartDefaults Defaults { get; set; }\n\n        public AutoStartPowerInfo[] PowerInfo { get; set; }\n\n        public bool Equals(HostAutoStartManagerConfig hostAutoStartManagerConfig)\n        {\n            return (hostAutoStartManagerConfig != null && ((this.Defaults == null && hostAutoStartManagerConfig.Defaults == null) || (this.Defaults != null && this.Defaults.Equals(hostAutoStartManagerConfig.Defaults))) && ((this.PowerInfo == null && hostAutoStartManagerConfig.PowerInfo == null) || (this.PowerInfo != null && hostAutoStartManagerConfig.PowerInfo != null && Enumerable.SequenceEqual(this.PowerInfo, hostAutoStartManagerConfig.PowerInfo))));\n        }\n\n        public override bool Equals(object hostAutoStartManagerConfig)\n        {\n            return Equals(hostAutoStartManagerConfig as HostAutoStartManagerConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Defaults + \"_\" + PowerInfo).GetHashCode();\n        }\n    }\n\n    public class HostBIOSInfo : DynamicData, IEquatable<HostBIOSInfo>\n    {\n        public string BiosVersion { get; set; }\n\n        public DateTime? ReleaseDate { get; set; }\n\n        public string Vendor { get; set; }\n\n        public int? MajorRelease { get; set; }\n\n        public int? MinorRelease { get; set; }\n\n        public int? FirmwareMajorRelease { get; set; }\n\n        public int? FirmwareMinorRelease { get; set; }\n\n        public bool Equals(HostBIOSInfo hostBIOSInfo)\n        {\n            return (hostBIOSInfo != null && this.BiosVersion == hostBIOSInfo.BiosVersion && ((this.ReleaseDate == null && hostBIOSInfo.ReleaseDate == null) || (this.ReleaseDate != null && this.ReleaseDate.Equals(hostBIOSInfo.ReleaseDate))) && this.Vendor == hostBIOSInfo.Vendor && ((this.MajorRelease == null && hostBIOSInfo.MajorRelease == null) || (this.MajorRelease != null && this.MajorRelease.Equals(hostBIOSInfo.MajorRelease))) && ((this.MinorRelease == null && hostBIOSInfo.MinorRelease == null) || (this.MinorRelease != null && this.MinorRelease.Equals(hostBIOSInfo.MinorRelease))) && ((this.FirmwareMajorRelease == null && hostBIOSInfo.FirmwareMajorRelease == null) || (this.FirmwareMajorRelease != null && this.FirmwareMajorRelease.Equals(hostBIOSInfo.FirmwareMajorRelease))) && ((this.FirmwareMinorRelease == null && hostBIOSInfo.FirmwareMinorRelease == null) || (this.FirmwareMinorRelease != null && this.FirmwareMinorRelease.Equals(hostBIOSInfo.FirmwareMinorRelease))));\n        }\n\n        public override bool Equals(object hostBIOSInfo)\n        {\n            return Equals(hostBIOSInfo as HostBIOSInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BiosVersion + \"_\" + ReleaseDate + \"_\" + Vendor + \"_\" + MajorRelease + \"_\" + MinorRelease + \"_\" + FirmwareMajorRelease + \"_\" + FirmwareMinorRelease).GetHashCode();\n        }\n    }\n\n    public class HostBlockAdapterTargetTransport : HostTargetTransport, IEquatable<HostBlockAdapterTargetTransport>\n    {\n        public bool Equals(HostBlockAdapterTargetTransport hostBlockAdapterTargetTransport)\n        {\n            return (hostBlockAdapterTargetTransport != null && base.Equals(hostBlockAdapterTargetTransport));\n        }\n\n        public override bool Equals(object hostBlockAdapterTargetTransport)\n        {\n            return Equals(hostBlockAdapterTargetTransport as HostBlockAdapterTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostBlockHba : HostHostBusAdapter, IEquatable<HostBlockHba>\n    {\n        public bool Equals(HostBlockHba hostBlockHba)\n        {\n            return (hostBlockHba != null && base.Equals(hostBlockHba));\n        }\n\n        public override bool Equals(object hostBlockHba)\n        {\n            return Equals(hostBlockHba as HostBlockHba);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostBootDevice : DynamicData, IEquatable<HostBootDevice>\n    {\n        public string Key { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(HostBootDevice hostBootDevice)\n        {\n            return (hostBootDevice != null && this.Key == hostBootDevice.Key && this.Description == hostBootDevice.Description);\n        }\n\n        public override bool Equals(object hostBootDevice)\n        {\n            return Equals(hostBootDevice as HostBootDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class HostBootDeviceInfo : DynamicData, IEquatable<HostBootDeviceInfo>\n    {\n        public HostBootDevice[] BootDevices { get; set; }\n\n        public string CurrentBootDeviceKey { get; set; }\n\n        public bool Equals(HostBootDeviceInfo hostBootDeviceInfo)\n        {\n            return (hostBootDeviceInfo != null && ((this.BootDevices == null && hostBootDeviceInfo.BootDevices == null) || (this.BootDevices != null && hostBootDeviceInfo.BootDevices != null && Enumerable.SequenceEqual(this.BootDevices, hostBootDeviceInfo.BootDevices))) && this.CurrentBootDeviceKey == hostBootDeviceInfo.CurrentBootDeviceKey);\n        }\n\n        public override bool Equals(object hostBootDeviceInfo)\n        {\n            return Equals(hostBootDeviceInfo as HostBootDeviceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BootDevices + \"_\" + CurrentBootDeviceKey).GetHashCode();\n        }\n    }\n\n    public class HostBootDeviceSystem : ViewBase, IEquatable<HostBootDeviceSystem>\n    {\n        public HostBootDeviceInfo QueryBootDevices()\n        {\n            return default(HostBootDeviceInfo);\n        }\n\n        public void UpdateBootDevice(string key)\n        {\n        }\n\n        public bool Equals(HostBootDeviceSystem hostBootDeviceSystem)\n        {\n            return (hostBootDeviceSystem != null && base.Equals(hostBootDeviceSystem));\n        }\n\n        public override bool Equals(object hostBootDeviceSystem)\n        {\n            return Equals(hostBootDeviceSystem as HostBootDeviceSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCacheConfigurationInfo : DynamicData, IEquatable<HostCacheConfigurationInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public long SwapSize { get; set; }\n\n        public HostCacheConfigurationInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostCacheConfigurationInfo hostCacheConfigurationInfo)\n        {\n            return (hostCacheConfigurationInfo != null && ((this.Key == null && hostCacheConfigurationInfo.Key == null) || (this.Key != null && this.Key.Equals(hostCacheConfigurationInfo.Key))) && this.SwapSize == hostCacheConfigurationInfo.SwapSize && ((this.LinkedView == null && hostCacheConfigurationInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostCacheConfigurationInfo.LinkedView))));\n        }\n\n        public override bool Equals(object hostCacheConfigurationInfo)\n        {\n            return Equals(hostCacheConfigurationInfo as HostCacheConfigurationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + SwapSize + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostCacheConfigurationInfo_LinkedView : IEquatable<HostCacheConfigurationInfo_LinkedView>\n    {\n        public Datastore Key { get; set; }\n\n        public bool Equals(HostCacheConfigurationInfo_LinkedView hostCacheConfigurationInfo_LinkedView)\n        {\n            return (hostCacheConfigurationInfo_LinkedView != null && ((this.Key == null && hostCacheConfigurationInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(hostCacheConfigurationInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object hostCacheConfigurationInfo_LinkedView)\n        {\n            return Equals(hostCacheConfigurationInfo_LinkedView as HostCacheConfigurationInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class HostCacheConfigurationManager : ViewBase, IEquatable<HostCacheConfigurationManager>\n    {\n        public HostCacheConfigurationInfo[] CacheConfigurationInfo { get; set; }\n\n        public ManagedObjectReference ConfigureHostCache_Task(HostCacheConfigurationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ConfigureHostCache(HostCacheConfigurationSpec spec)\n        {\n        }\n\n        public bool Equals(HostCacheConfigurationManager hostCacheConfigurationManager)\n        {\n            return (hostCacheConfigurationManager != null && ((this.CacheConfigurationInfo == null && hostCacheConfigurationManager.CacheConfigurationInfo == null) || (this.CacheConfigurationInfo != null && hostCacheConfigurationManager.CacheConfigurationInfo != null && Enumerable.SequenceEqual(this.CacheConfigurationInfo, hostCacheConfigurationManager.CacheConfigurationInfo))));\n        }\n\n        public override bool Equals(object hostCacheConfigurationManager)\n        {\n            return Equals(hostCacheConfigurationManager as HostCacheConfigurationManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CacheConfigurationInfo).GetHashCode();\n        }\n    }\n\n    public class HostCacheConfigurationSpec : DynamicData, IEquatable<HostCacheConfigurationSpec>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public long SwapSize { get; set; }\n\n        public HostCacheConfigurationSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostCacheConfigurationSpec hostCacheConfigurationSpec)\n        {\n            return (hostCacheConfigurationSpec != null && ((this.Datastore == null && hostCacheConfigurationSpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(hostCacheConfigurationSpec.Datastore))) && this.SwapSize == hostCacheConfigurationSpec.SwapSize && ((this.LinkedView == null && hostCacheConfigurationSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostCacheConfigurationSpec.LinkedView))));\n        }\n\n        public override bool Equals(object hostCacheConfigurationSpec)\n        {\n            return Equals(hostCacheConfigurationSpec as HostCacheConfigurationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + SwapSize + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostCacheConfigurationSpec_LinkedView : IEquatable<HostCacheConfigurationSpec_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(HostCacheConfigurationSpec_LinkedView hostCacheConfigurationSpec_LinkedView)\n        {\n            return (hostCacheConfigurationSpec_LinkedView != null && ((this.Datastore == null && hostCacheConfigurationSpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(hostCacheConfigurationSpec_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object hostCacheConfigurationSpec_LinkedView)\n        {\n            return Equals(hostCacheConfigurationSpec_LinkedView as HostCacheConfigurationSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class HostCapability : DynamicData, IEquatable<HostCapability>\n    {\n        public bool RecursiveResourcePoolsSupported { get; set; }\n\n        public bool CpuMemoryResourceConfigurationSupported { get; set; }\n\n        public bool RebootSupported { get; set; }\n\n        public bool ShutdownSupported { get; set; }\n\n        public bool VmotionSupported { get; set; }\n\n        public bool StandbySupported { get; set; }\n\n        public bool? IpmiSupported { get; set; }\n\n        public int? MaxSupportedVMs { get; set; }\n\n        public int? MaxRunningVMs { get; set; }\n\n        public int? MaxSupportedVcpus { get; set; }\n\n        public int? MaxRegisteredVMs { get; set; }\n\n        public bool DatastorePrincipalSupported { get; set; }\n\n        public bool SanSupported { get; set; }\n\n        public bool NfsSupported { get; set; }\n\n        public bool IscsiSupported { get; set; }\n\n        public bool VlanTaggingSupported { get; set; }\n\n        public bool NicTeamingSupported { get; set; }\n\n        public bool HighGuestMemSupported { get; set; }\n\n        public bool MaintenanceModeSupported { get; set; }\n\n        public bool SuspendedRelocateSupported { get; set; }\n\n        public bool RestrictedSnapshotRelocateSupported { get; set; }\n\n        public bool PerVmSwapFiles { get; set; }\n\n        public bool LocalSwapDatastoreSupported { get; set; }\n\n        public bool UnsharedSwapVMotionSupported { get; set; }\n\n        public bool BackgroundSnapshotsSupported { get; set; }\n\n        public bool PreAssignedPCIUnitNumbersSupported { get; set; }\n\n        public bool ScreenshotSupported { get; set; }\n\n        public bool ScaledScreenshotSupported { get; set; }\n\n        public bool StorageVMotionSupported { get; set; }\n\n        public bool VmotionWithStorageVMotionSupported { get; set; }\n\n        public bool? VmotionAcrossNetworkSupported { get; set; }\n\n        public int? MaxNumDisksSVMotion { get; set; }\n\n        public bool HbrNicSelectionSupported { get; set; }\n\n        public bool VrNfcNicSelectionSupported { get; set; }\n\n        public bool RecordReplaySupported { get; set; }\n\n        public bool FtSupported { get; set; }\n\n        public string ReplayUnsupportedReason { get; set; }\n\n        public string[] ReplayCompatibilityIssues { get; set; }\n\n        public bool SmpFtSupported { get; set; }\n\n        public string[] FtCompatibilityIssues { get; set; }\n\n        public string[] SmpFtCompatibilityIssues { get; set; }\n\n        public int? MaxVcpusPerFtVm { get; set; }\n\n        public bool? LoginBySSLThumbprintSupported { get; set; }\n\n        public bool CloneFromSnapshotSupported { get; set; }\n\n        public bool DeltaDiskBackingsSupported { get; set; }\n\n        public bool PerVMNetworkTrafficShapingSupported { get; set; }\n\n        public bool TpmSupported { get; set; }\n\n        public string TpmVersion { get; set; }\n\n        public bool? TxtEnabled { get; set; }\n\n        public HostCpuIdInfo[] SupportedCpuFeature { get; set; }\n\n        public bool VirtualExecUsageSupported { get; set; }\n\n        public bool StorageIORMSupported { get; set; }\n\n        public bool VmDirectPathGen2Supported { get; set; }\n\n        public string[] VmDirectPathGen2UnsupportedReason { get; set; }\n\n        public string VmDirectPathGen2UnsupportedReasonExtended { get; set; }\n\n        public int[] SupportedVmfsMajorVersion { get; set; }\n\n        public bool VStorageCapable { get; set; }\n\n        public bool SnapshotRelayoutSupported { get; set; }\n\n        public bool? FirewallIpRulesSupported { get; set; }\n\n        public bool? ServicePackageInfoSupported { get; set; }\n\n        public int? MaxHostRunningVms { get; set; }\n\n        public int? MaxHostSupportedVcpus { get; set; }\n\n        public bool VmfsDatastoreMountCapable { get; set; }\n\n        public bool EightPlusHostVmfsSharedAccessSupported { get; set; }\n\n        public bool NestedHVSupported { get; set; }\n\n        public bool VPMCSupported { get; set; }\n\n        public bool InterVMCommunicationThroughVMCISupported { get; set; }\n\n        public bool? ScheduledHardwareUpgradeSupported { get; set; }\n\n        public bool FeatureCapabilitiesSupported { get; set; }\n\n        public bool LatencySensitivitySupported { get; set; }\n\n        public bool? StoragePolicySupported { get; set; }\n\n        public bool Accel3dSupported { get; set; }\n\n        public bool? ReliableMemoryAware { get; set; }\n\n        public bool? MultipleNetworkStackInstanceSupported { get; set; }\n\n        public bool? MessageBusProxySupported { get; set; }\n\n        public bool? VsanSupported { get; set; }\n\n        public bool? VFlashSupported { get; set; }\n\n        public bool? HostAccessManagerSupported { get; set; }\n\n        public bool ProvisioningNicSelectionSupported { get; set; }\n\n        public bool? Nfs41Supported { get; set; }\n\n        public bool? Nfs41Krb5iSupported { get; set; }\n\n        public bool? TurnDiskLocatorLedSupported { get; set; }\n\n        public bool? VirtualVolumeDatastoreSupported { get; set; }\n\n        public bool? MarkAsSsdSupported { get; set; }\n\n        public bool? MarkAsLocalSupported { get; set; }\n\n        public bool? SmartCardAuthenticationSupported { get; set; }\n\n        public bool? PMemSupported { get; set; }\n\n        public bool? PMemSnapshotSupported { get; set; }\n\n        public bool? CryptoSupported { get; set; }\n\n        public bool? OneKVolumeAPIsSupported { get; set; }\n\n        public bool? GatewayOnNicSupported { get; set; }\n\n        public bool? UpitSupported { get; set; }\n\n        public bool? CpuHwMmuSupported { get; set; }\n\n        public bool? EncryptedVMotionSupported { get; set; }\n\n        public bool? EncryptionChangeOnAddRemoveSupported { get; set; }\n\n        public bool? EncryptionHotOperationSupported { get; set; }\n\n        public bool? EncryptionWithSnapshotsSupported { get; set; }\n\n        public bool? EncryptionFaultToleranceSupported { get; set; }\n\n        public bool? EncryptionMemorySaveSupported { get; set; }\n\n        public bool? EncryptionRDMSupported { get; set; }\n\n        public bool? EncryptionVFlashSupported { get; set; }\n\n        public bool? EncryptionCBRCSupported { get; set; }\n\n        public bool? EncryptionHBRSupported { get; set; }\n\n        public bool? FtEfiSupported { get; set; }\n\n        public string UnmapMethodSupported { get; set; }\n\n        public int? MaxMemMBPerFtVm { get; set; }\n\n        public bool? VirtualMmuUsageIgnored { get; set; }\n\n        public bool? VirtualExecUsageIgnored { get; set; }\n\n        public bool? VmCreateDateSupported { get; set; }\n\n        public bool? Vmfs3EOLSupported { get; set; }\n\n        public bool? FtVmcpSupported { get; set; }\n\n        public bool? QuickBootSupported { get; set; }\n\n        public bool Equals(HostCapability hostCapability)\n        {\n            return (hostCapability != null && this.RecursiveResourcePoolsSupported == hostCapability.RecursiveResourcePoolsSupported && this.CpuMemoryResourceConfigurationSupported == hostCapability.CpuMemoryResourceConfigurationSupported && this.RebootSupported == hostCapability.RebootSupported && this.ShutdownSupported == hostCapability.ShutdownSupported && this.VmotionSupported == hostCapability.VmotionSupported && this.StandbySupported == hostCapability.StandbySupported && ((this.IpmiSupported == null && hostCapability.IpmiSupported == null) || (this.IpmiSupported != null && this.IpmiSupported.Equals(hostCapability.IpmiSupported))) && ((this.MaxSupportedVMs == null && hostCapability.MaxSupportedVMs == null) || (this.MaxSupportedVMs != null && this.MaxSupportedVMs.Equals(hostCapability.MaxSupportedVMs))) && ((this.MaxRunningVMs == null && hostCapability.MaxRunningVMs == null) || (this.MaxRunningVMs != null && this.MaxRunningVMs.Equals(hostCapability.MaxRunningVMs))) && ((this.MaxSupportedVcpus == null && hostCapability.MaxSupportedVcpus == null) || (this.MaxSupportedVcpus != null && this.MaxSupportedVcpus.Equals(hostCapability.MaxSupportedVcpus))) && ((this.MaxRegisteredVMs == null && hostCapability.MaxRegisteredVMs == null) || (this.MaxRegisteredVMs != null && this.MaxRegisteredVMs.Equals(hostCapability.MaxRegisteredVMs))) && this.DatastorePrincipalSupported == hostCapability.DatastorePrincipalSupported && this.SanSupported == hostCapability.SanSupported && this.NfsSupported == hostCapability.NfsSupported && this.IscsiSupported == hostCapability.IscsiSupported && this.VlanTaggingSupported == hostCapability.VlanTaggingSupported && this.NicTeamingSupported == hostCapability.NicTeamingSupported && this.HighGuestMemSupported == hostCapability.HighGuestMemSupported && this.MaintenanceModeSupported == hostCapability.MaintenanceModeSupported && this.SuspendedRelocateSupported == hostCapability.SuspendedRelocateSupported && this.RestrictedSnapshotRelocateSupported == hostCapability.RestrictedSnapshotRelocateSupported && this.PerVmSwapFiles == hostCapability.PerVmSwapFiles && this.LocalSwapDatastoreSupported == hostCapability.LocalSwapDatastoreSupported && this.UnsharedSwapVMotionSupported == hostCapability.UnsharedSwapVMotionSupported && this.BackgroundSnapshotsSupported == hostCapability.BackgroundSnapshotsSupported && this.PreAssignedPCIUnitNumbersSupported == hostCapability.PreAssignedPCIUnitNumbersSupported && this.ScreenshotSupported == hostCapability.ScreenshotSupported && this.ScaledScreenshotSupported == hostCapability.ScaledScreenshotSupported && this.StorageVMotionSupported == hostCapability.StorageVMotionSupported && this.VmotionWithStorageVMotionSupported == hostCapability.VmotionWithStorageVMotionSupported && ((this.VmotionAcrossNetworkSupported == null && hostCapability.VmotionAcrossNetworkSupported == null) || (this.VmotionAcrossNetworkSupported != null && this.VmotionAcrossNetworkSupported.Equals(hostCapability.VmotionAcrossNetworkSupported))) && ((this.MaxNumDisksSVMotion == null && hostCapability.MaxNumDisksSVMotion == null) || (this.MaxNumDisksSVMotion != null && this.MaxNumDisksSVMotion.Equals(hostCapability.MaxNumDisksSVMotion))) && this.HbrNicSelectionSupported == hostCapability.HbrNicSelectionSupported && this.VrNfcNicSelectionSupported == hostCapability.VrNfcNicSelectionSupported && this.RecordReplaySupported == hostCapability.RecordReplaySupported && this.FtSupported == hostCapability.FtSupported && this.ReplayUnsupportedReason == hostCapability.ReplayUnsupportedReason && ((this.ReplayCompatibilityIssues == null && hostCapability.ReplayCompatibilityIssues == null) || (this.ReplayCompatibilityIssues != null && hostCapability.ReplayCompatibilityIssues != null && Enumerable.SequenceEqual(this.ReplayCompatibilityIssues, hostCapability.ReplayCompatibilityIssues))) && this.SmpFtSupported == hostCapability.SmpFtSupported && ((this.FtCompatibilityIssues == null && hostCapability.FtCompatibilityIssues == null) || (this.FtCompatibilityIssues != null && hostCapability.FtCompatibilityIssues != null && Enumerable.SequenceEqual(this.FtCompatibilityIssues, hostCapability.FtCompatibilityIssues))) && ((this.SmpFtCompatibilityIssues == null && hostCapability.SmpFtCompatibilityIssues == null) || (this.SmpFtCompatibilityIssues != null && hostCapability.SmpFtCompatibilityIssues != null && Enumerable.SequenceEqual(this.SmpFtCompatibilityIssues, hostCapability.SmpFtCompatibilityIssues))) && ((this.MaxVcpusPerFtVm == null && hostCapability.MaxVcpusPerFtVm == null) || (this.MaxVcpusPerFtVm != null && this.MaxVcpusPerFtVm.Equals(hostCapability.MaxVcpusPerFtVm))) && ((this.LoginBySSLThumbprintSupported == null && hostCapability.LoginBySSLThumbprintSupported == null) || (this.LoginBySSLThumbprintSupported != null && this.LoginBySSLThumbprintSupported.Equals(hostCapability.LoginBySSLThumbprintSupported))) && this.CloneFromSnapshotSupported == hostCapability.CloneFromSnapshotSupported && this.DeltaDiskBackingsSupported == hostCapability.DeltaDiskBackingsSupported && this.PerVMNetworkTrafficShapingSupported == hostCapability.PerVMNetworkTrafficShapingSupported && this.TpmSupported == hostCapability.TpmSupported && this.TpmVersion == hostCapability.TpmVersion && ((this.TxtEnabled == null && hostCapability.TxtEnabled == null) || (this.TxtEnabled != null && this.TxtEnabled.Equals(hostCapability.TxtEnabled))) && ((this.SupportedCpuFeature == null && hostCapability.SupportedCpuFeature == null) || (this.SupportedCpuFeature != null && hostCapability.SupportedCpuFeature != null && Enumerable.SequenceEqual(this.SupportedCpuFeature, hostCapability.SupportedCpuFeature))) && this.VirtualExecUsageSupported == hostCapability.VirtualExecUsageSupported && this.StorageIORMSupported == hostCapability.StorageIORMSupported && this.VmDirectPathGen2Supported == hostCapability.VmDirectPathGen2Supported && ((this.VmDirectPathGen2UnsupportedReason == null && hostCapability.VmDirectPathGen2UnsupportedReason == null) || (this.VmDirectPathGen2UnsupportedReason != null && hostCapability.VmDirectPathGen2UnsupportedReason != null && Enumerable.SequenceEqual(this.VmDirectPathGen2UnsupportedReason, hostCapability.VmDirectPathGen2UnsupportedReason))) && this.VmDirectPathGen2UnsupportedReasonExtended == hostCapability.VmDirectPathGen2UnsupportedReasonExtended && ((this.SupportedVmfsMajorVersion == null && hostCapability.SupportedVmfsMajorVersion == null) || (this.SupportedVmfsMajorVersion != null && hostCapability.SupportedVmfsMajorVersion != null && Enumerable.SequenceEqual(this.SupportedVmfsMajorVersion, hostCapability.SupportedVmfsMajorVersion))) && this.VStorageCapable == hostCapability.VStorageCapable && this.SnapshotRelayoutSupported == hostCapability.SnapshotRelayoutSupported && ((this.FirewallIpRulesSupported == null && hostCapability.FirewallIpRulesSupported == null) || (this.FirewallIpRulesSupported != null && this.FirewallIpRulesSupported.Equals(hostCapability.FirewallIpRulesSupported))) && ((this.ServicePackageInfoSupported == null && hostCapability.ServicePackageInfoSupported == null) || (this.ServicePackageInfoSupported != null && this.ServicePackageInfoSupported.Equals(hostCapability.ServicePackageInfoSupported))) && ((this.MaxHostRunningVms == null && hostCapability.MaxHostRunningVms == null) || (this.MaxHostRunningVms != null && this.MaxHostRunningVms.Equals(hostCapability.MaxHostRunningVms))) && ((this.MaxHostSupportedVcpus == null && hostCapability.MaxHostSupportedVcpus == null) || (this.MaxHostSupportedVcpus != null && this.MaxHostSupportedVcpus.Equals(hostCapability.MaxHostSupportedVcpus))) && this.VmfsDatastoreMountCapable == hostCapability.VmfsDatastoreMountCapable && this.EightPlusHostVmfsSharedAccessSupported == hostCapability.EightPlusHostVmfsSharedAccessSupported && this.NestedHVSupported == hostCapability.NestedHVSupported && this.VPMCSupported == hostCapability.VPMCSupported && this.InterVMCommunicationThroughVMCISupported == hostCapability.InterVMCommunicationThroughVMCISupported && ((this.ScheduledHardwareUpgradeSupported == null && hostCapability.ScheduledHardwareUpgradeSupported == null) || (this.ScheduledHardwareUpgradeSupported != null && this.ScheduledHardwareUpgradeSupported.Equals(hostCapability.ScheduledHardwareUpgradeSupported))) && this.FeatureCapabilitiesSupported == hostCapability.FeatureCapabilitiesSupported && this.LatencySensitivitySupported == hostCapability.LatencySensitivitySupported && ((this.StoragePolicySupported == null && hostCapability.StoragePolicySupported == null) || (this.StoragePolicySupported != null && this.StoragePolicySupported.Equals(hostCapability.StoragePolicySupported))) && this.Accel3dSupported == hostCapability.Accel3dSupported && ((this.ReliableMemoryAware == null && hostCapability.ReliableMemoryAware == null) || (this.ReliableMemoryAware != null && this.ReliableMemoryAware.Equals(hostCapability.ReliableMemoryAware))) && ((this.MultipleNetworkStackInstanceSupported == null && hostCapability.MultipleNetworkStackInstanceSupported == null) || (this.MultipleNetworkStackInstanceSupported != null && this.MultipleNetworkStackInstanceSupported.Equals(hostCapability.MultipleNetworkStackInstanceSupported))) && ((this.MessageBusProxySupported == null && hostCapability.MessageBusProxySupported == null) || (this.MessageBusProxySupported != null && this.MessageBusProxySupported.Equals(hostCapability.MessageBusProxySupported))) && ((this.VsanSupported == null && hostCapability.VsanSupported == null) || (this.VsanSupported != null && this.VsanSupported.Equals(hostCapability.VsanSupported))) && ((this.VFlashSupported == null && hostCapability.VFlashSupported == null) || (this.VFlashSupported != null && this.VFlashSupported.Equals(hostCapability.VFlashSupported))) && ((this.HostAccessManagerSupported == null && hostCapability.HostAccessManagerSupported == null) || (this.HostAccessManagerSupported != null && this.HostAccessManagerSupported.Equals(hostCapability.HostAccessManagerSupported))) && this.ProvisioningNicSelectionSupported == hostCapability.ProvisioningNicSelectionSupported && ((this.Nfs41Supported == null && hostCapability.Nfs41Supported == null) || (this.Nfs41Supported != null && this.Nfs41Supported.Equals(hostCapability.Nfs41Supported))) && ((this.Nfs41Krb5iSupported == null && hostCapability.Nfs41Krb5iSupported == null) || (this.Nfs41Krb5iSupported != null && this.Nfs41Krb5iSupported.Equals(hostCapability.Nfs41Krb5iSupported))) && ((this.TurnDiskLocatorLedSupported == null && hostCapability.TurnDiskLocatorLedSupported == null) || (this.TurnDiskLocatorLedSupported != null && this.TurnDiskLocatorLedSupported.Equals(hostCapability.TurnDiskLocatorLedSupported))) && ((this.VirtualVolumeDatastoreSupported == null && hostCapability.VirtualVolumeDatastoreSupported == null) || (this.VirtualVolumeDatastoreSupported != null && this.VirtualVolumeDatastoreSupported.Equals(hostCapability.VirtualVolumeDatastoreSupported))) && ((this.MarkAsSsdSupported == null && hostCapability.MarkAsSsdSupported == null) || (this.MarkAsSsdSupported != null && this.MarkAsSsdSupported.Equals(hostCapability.MarkAsSsdSupported))) && ((this.MarkAsLocalSupported == null && hostCapability.MarkAsLocalSupported == null) || (this.MarkAsLocalSupported != null && this.MarkAsLocalSupported.Equals(hostCapability.MarkAsLocalSupported))) && ((this.SmartCardAuthenticationSupported == null && hostCapability.SmartCardAuthenticationSupported == null) || (this.SmartCardAuthenticationSupported != null && this.SmartCardAuthenticationSupported.Equals(hostCapability.SmartCardAuthenticationSupported))) && ((this.PMemSupported == null && hostCapability.PMemSupported == null) || (this.PMemSupported != null && this.PMemSupported.Equals(hostCapability.PMemSupported))) && ((this.PMemSnapshotSupported == null && hostCapability.PMemSnapshotSupported == null) || (this.PMemSnapshotSupported != null && this.PMemSnapshotSupported.Equals(hostCapability.PMemSnapshotSupported))) && ((this.CryptoSupported == null && hostCapability.CryptoSupported == null) || (this.CryptoSupported != null && this.CryptoSupported.Equals(hostCapability.CryptoSupported))) && ((this.OneKVolumeAPIsSupported == null && hostCapability.OneKVolumeAPIsSupported == null) || (this.OneKVolumeAPIsSupported != null && this.OneKVolumeAPIsSupported.Equals(hostCapability.OneKVolumeAPIsSupported))) && ((this.GatewayOnNicSupported == null && hostCapability.GatewayOnNicSupported == null) || (this.GatewayOnNicSupported != null && this.GatewayOnNicSupported.Equals(hostCapability.GatewayOnNicSupported))) && ((this.UpitSupported == null && hostCapability.UpitSupported == null) || (this.UpitSupported != null && this.UpitSupported.Equals(hostCapability.UpitSupported))) && ((this.CpuHwMmuSupported == null && hostCapability.CpuHwMmuSupported == null) || (this.CpuHwMmuSupported != null && this.CpuHwMmuSupported.Equals(hostCapability.CpuHwMmuSupported))) && ((this.EncryptedVMotionSupported == null && hostCapability.EncryptedVMotionSupported == null) || (this.EncryptedVMotionSupported != null && this.EncryptedVMotionSupported.Equals(hostCapability.EncryptedVMotionSupported))) && ((this.EncryptionChangeOnAddRemoveSupported == null && hostCapability.EncryptionChangeOnAddRemoveSupported == null) || (this.EncryptionChangeOnAddRemoveSupported != null && this.EncryptionChangeOnAddRemoveSupported.Equals(hostCapability.EncryptionChangeOnAddRemoveSupported))) && ((this.EncryptionHotOperationSupported == null && hostCapability.EncryptionHotOperationSupported == null) || (this.EncryptionHotOperationSupported != null && this.EncryptionHotOperationSupported.Equals(hostCapability.EncryptionHotOperationSupported))) && ((this.EncryptionWithSnapshotsSupported == null && hostCapability.EncryptionWithSnapshotsSupported == null) || (this.EncryptionWithSnapshotsSupported != null && this.EncryptionWithSnapshotsSupported.Equals(hostCapability.EncryptionWithSnapshotsSupported))) && ((this.EncryptionFaultToleranceSupported == null && hostCapability.EncryptionFaultToleranceSupported == null) || (this.EncryptionFaultToleranceSupported != null && this.EncryptionFaultToleranceSupported.Equals(hostCapability.EncryptionFaultToleranceSupported))) && ((this.EncryptionMemorySaveSupported == null && hostCapability.EncryptionMemorySaveSupported == null) || (this.EncryptionMemorySaveSupported != null && this.EncryptionMemorySaveSupported.Equals(hostCapability.EncryptionMemorySaveSupported))) && ((this.EncryptionRDMSupported == null && hostCapability.EncryptionRDMSupported == null) || (this.EncryptionRDMSupported != null && this.EncryptionRDMSupported.Equals(hostCapability.EncryptionRDMSupported))) && ((this.EncryptionVFlashSupported == null && hostCapability.EncryptionVFlashSupported == null) || (this.EncryptionVFlashSupported != null && this.EncryptionVFlashSupported.Equals(hostCapability.EncryptionVFlashSupported))) && ((this.EncryptionCBRCSupported == null && hostCapability.EncryptionCBRCSupported == null) || (this.EncryptionCBRCSupported != null && this.EncryptionCBRCSupported.Equals(hostCapability.EncryptionCBRCSupported))) && ((this.EncryptionHBRSupported == null && hostCapability.EncryptionHBRSupported == null) || (this.EncryptionHBRSupported != null && this.EncryptionHBRSupported.Equals(hostCapability.EncryptionHBRSupported))) && ((this.FtEfiSupported == null && hostCapability.FtEfiSupported == null) || (this.FtEfiSupported != null && this.FtEfiSupported.Equals(hostCapability.FtEfiSupported))) && this.UnmapMethodSupported == hostCapability.UnmapMethodSupported && ((this.MaxMemMBPerFtVm == null && hostCapability.MaxMemMBPerFtVm == null) || (this.MaxMemMBPerFtVm != null && this.MaxMemMBPerFtVm.Equals(hostCapability.MaxMemMBPerFtVm))) && ((this.VirtualMmuUsageIgnored == null && hostCapability.VirtualMmuUsageIgnored == null) || (this.VirtualMmuUsageIgnored != null && this.VirtualMmuUsageIgnored.Equals(hostCapability.VirtualMmuUsageIgnored))) && ((this.VirtualExecUsageIgnored == null && hostCapability.VirtualExecUsageIgnored == null) || (this.VirtualExecUsageIgnored != null && this.VirtualExecUsageIgnored.Equals(hostCapability.VirtualExecUsageIgnored))) && ((this.VmCreateDateSupported == null && hostCapability.VmCreateDateSupported == null) || (this.VmCreateDateSupported != null && this.VmCreateDateSupported.Equals(hostCapability.VmCreateDateSupported))) && ((this.Vmfs3EOLSupported == null && hostCapability.Vmfs3EOLSupported == null) || (this.Vmfs3EOLSupported != null && this.Vmfs3EOLSupported.Equals(hostCapability.Vmfs3EOLSupported))) && ((this.FtVmcpSupported == null && hostCapability.FtVmcpSupported == null) || (this.FtVmcpSupported != null && this.FtVmcpSupported.Equals(hostCapability.FtVmcpSupported))) && ((this.QuickBootSupported == null && hostCapability.QuickBootSupported == null) || (this.QuickBootSupported != null && this.QuickBootSupported.Equals(hostCapability.QuickBootSupported))));\n        }\n\n        public override bool Equals(object hostCapability)\n        {\n            return Equals(hostCapability as HostCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RecursiveResourcePoolsSupported + \"_\" + CpuMemoryResourceConfigurationSupported + \"_\" + RebootSupported + \"_\" + ShutdownSupported + \"_\" + VmotionSupported + \"_\" + StandbySupported + \"_\" + IpmiSupported + \"_\" + MaxSupportedVMs + \"_\" + MaxRunningVMs + \"_\" + MaxSupportedVcpus + \"_\" + MaxRegisteredVMs + \"_\" + DatastorePrincipalSupported + \"_\" + SanSupported + \"_\" + NfsSupported + \"_\" + IscsiSupported + \"_\" + VlanTaggingSupported + \"_\" + NicTeamingSupported + \"_\" + HighGuestMemSupported + \"_\" + MaintenanceModeSupported + \"_\" + SuspendedRelocateSupported + \"_\" + RestrictedSnapshotRelocateSupported + \"_\" + PerVmSwapFiles + \"_\" + LocalSwapDatastoreSupported + \"_\" + UnsharedSwapVMotionSupported + \"_\" + BackgroundSnapshotsSupported + \"_\" + PreAssignedPCIUnitNumbersSupported + \"_\" + ScreenshotSupported + \"_\" + ScaledScreenshotSupported + \"_\" + StorageVMotionSupported + \"_\" + VmotionWithStorageVMotionSupported + \"_\" + VmotionAcrossNetworkSupported + \"_\" + MaxNumDisksSVMotion + \"_\" + HbrNicSelectionSupported + \"_\" + VrNfcNicSelectionSupported + \"_\" + RecordReplaySupported + \"_\" + FtSupported + \"_\" + ReplayUnsupportedReason + \"_\" + ReplayCompatibilityIssues + \"_\" + SmpFtSupported + \"_\" + FtCompatibilityIssues + \"_\" + SmpFtCompatibilityIssues + \"_\" + MaxVcpusPerFtVm + \"_\" + LoginBySSLThumbprintSupported + \"_\" + CloneFromSnapshotSupported + \"_\" + DeltaDiskBackingsSupported + \"_\" + PerVMNetworkTrafficShapingSupported + \"_\" + TpmSupported + \"_\" + TpmVersion + \"_\" + TxtEnabled + \"_\" + SupportedCpuFeature + \"_\" + VirtualExecUsageSupported + \"_\" + StorageIORMSupported + \"_\" + VmDirectPathGen2Supported + \"_\" + VmDirectPathGen2UnsupportedReason + \"_\" + VmDirectPathGen2UnsupportedReasonExtended + \"_\" + SupportedVmfsMajorVersion + \"_\" + VStorageCapable + \"_\" + SnapshotRelayoutSupported + \"_\" + FirewallIpRulesSupported + \"_\" + ServicePackageInfoSupported + \"_\" + MaxHostRunningVms + \"_\" + MaxHostSupportedVcpus + \"_\" + VmfsDatastoreMountCapable + \"_\" + EightPlusHostVmfsSharedAccessSupported + \"_\" + NestedHVSupported + \"_\" + VPMCSupported + \"_\" + InterVMCommunicationThroughVMCISupported + \"_\" + ScheduledHardwareUpgradeSupported + \"_\" + FeatureCapabilitiesSupported + \"_\" + LatencySensitivitySupported + \"_\" + StoragePolicySupported + \"_\" + Accel3dSupported + \"_\" + ReliableMemoryAware + \"_\" + MultipleNetworkStackInstanceSupported + \"_\" + MessageBusProxySupported + \"_\" + VsanSupported + \"_\" + VFlashSupported + \"_\" + HostAccessManagerSupported + \"_\" + ProvisioningNicSelectionSupported + \"_\" + Nfs41Supported + \"_\" + Nfs41Krb5iSupported + \"_\" + TurnDiskLocatorLedSupported + \"_\" + VirtualVolumeDatastoreSupported + \"_\" + MarkAsSsdSupported + \"_\" + MarkAsLocalSupported + \"_\" + SmartCardAuthenticationSupported + \"_\" + PMemSupported + \"_\" + PMemSnapshotSupported + \"_\" + CryptoSupported + \"_\" + OneKVolumeAPIsSupported + \"_\" + GatewayOnNicSupported + \"_\" + UpitSupported + \"_\" + CpuHwMmuSupported + \"_\" + EncryptedVMotionSupported + \"_\" + EncryptionChangeOnAddRemoveSupported + \"_\" + EncryptionHotOperationSupported + \"_\" + EncryptionWithSnapshotsSupported + \"_\" + EncryptionFaultToleranceSupported + \"_\" + EncryptionMemorySaveSupported + \"_\" + EncryptionRDMSupported + \"_\" + EncryptionVFlashSupported + \"_\" + EncryptionCBRCSupported + \"_\" + EncryptionHBRSupported + \"_\" + FtEfiSupported + \"_\" + UnmapMethodSupported + \"_\" + MaxMemMBPerFtVm + \"_\" + VirtualMmuUsageIgnored + \"_\" + VirtualExecUsageIgnored + \"_\" + VmCreateDateSupported + \"_\" + Vmfs3EOLSupported + \"_\" + FtVmcpSupported + \"_\" + QuickBootSupported).GetHashCode();\n        }\n    }\n\n    public class HostCertificateManager : ViewBase, IEquatable<HostCertificateManager>\n    {\n        public HostCertificateManagerCertificateInfo CertificateInfo { get; set; }\n\n        public string GenerateCertificateSigningRequest(bool useIpAddressAsCommonName)\n        {\n            return default(string);\n        }\n\n        public string GenerateCertificateSigningRequestByDn(string distinguishedName)\n        {\n            return default(string);\n        }\n\n        public void InstallServerCertificate(string cert)\n        {\n        }\n\n        public void ReplaceCACertificatesAndCRLs(string[] caCert, string[] caCrl)\n        {\n        }\n\n        public string[] ListCACertificates()\n        {\n            return default(string[]);\n        }\n\n        public string[] ListCACertificateRevocationLists()\n        {\n            return default(string[]);\n        }\n\n        public bool Equals(HostCertificateManager hostCertificateManager)\n        {\n            return (hostCertificateManager != null && ((this.CertificateInfo == null && hostCertificateManager.CertificateInfo == null) || (this.CertificateInfo != null && this.CertificateInfo.Equals(hostCertificateManager.CertificateInfo))));\n        }\n\n        public override bool Equals(object hostCertificateManager)\n        {\n            return Equals(hostCertificateManager as HostCertificateManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CertificateInfo).GetHashCode();\n        }\n    }\n\n    public class HostCertificateManagerCertificateInfo : DynamicData, IEquatable<HostCertificateManagerCertificateInfo>\n    {\n        public string Issuer { get; set; }\n\n        public DateTime? NotBefore { get; set; }\n\n        public DateTime? NotAfter { get; set; }\n\n        public string Subject { get; set; }\n\n        public string Status { get; set; }\n\n        public bool Equals(HostCertificateManagerCertificateInfo hostCertificateManagerCertificateInfo)\n        {\n            return (hostCertificateManagerCertificateInfo != null && this.Issuer == hostCertificateManagerCertificateInfo.Issuer && ((this.NotBefore == null && hostCertificateManagerCertificateInfo.NotBefore == null) || (this.NotBefore != null && this.NotBefore.Equals(hostCertificateManagerCertificateInfo.NotBefore))) && ((this.NotAfter == null && hostCertificateManagerCertificateInfo.NotAfter == null) || (this.NotAfter != null && this.NotAfter.Equals(hostCertificateManagerCertificateInfo.NotAfter))) && this.Subject == hostCertificateManagerCertificateInfo.Subject && this.Status == hostCertificateManagerCertificateInfo.Status);\n        }\n\n        public override bool Equals(object hostCertificateManagerCertificateInfo)\n        {\n            return Equals(hostCertificateManagerCertificateInfo as HostCertificateManagerCertificateInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Issuer + \"_\" + NotBefore + \"_\" + NotAfter + \"_\" + Subject + \"_\" + Status).GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedAccountFailedEvent : HostEvent, IEquatable<HostCnxFailedAccountFailedEvent>\n    {\n        public bool Equals(HostCnxFailedAccountFailedEvent hostCnxFailedAccountFailedEvent)\n        {\n            return (hostCnxFailedAccountFailedEvent != null && base.Equals(hostCnxFailedAccountFailedEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedAccountFailedEvent)\n        {\n            return Equals(hostCnxFailedAccountFailedEvent as HostCnxFailedAccountFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedAlreadyManagedEvent : HostEvent, IEquatable<HostCnxFailedAlreadyManagedEvent>\n    {\n        public string ServerName { get; set; }\n\n        public bool Equals(HostCnxFailedAlreadyManagedEvent hostCnxFailedAlreadyManagedEvent)\n        {\n            return (hostCnxFailedAlreadyManagedEvent != null && this.ServerName == hostCnxFailedAlreadyManagedEvent.ServerName);\n        }\n\n        public override bool Equals(object hostCnxFailedAlreadyManagedEvent)\n        {\n            return Equals(hostCnxFailedAlreadyManagedEvent as HostCnxFailedAlreadyManagedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerName).GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedBadCcagentEvent : HostEvent, IEquatable<HostCnxFailedBadCcagentEvent>\n    {\n        public bool Equals(HostCnxFailedBadCcagentEvent hostCnxFailedBadCcagentEvent)\n        {\n            return (hostCnxFailedBadCcagentEvent != null && base.Equals(hostCnxFailedBadCcagentEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedBadCcagentEvent)\n        {\n            return Equals(hostCnxFailedBadCcagentEvent as HostCnxFailedBadCcagentEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedBadUsernameEvent : HostEvent, IEquatable<HostCnxFailedBadUsernameEvent>\n    {\n        public bool Equals(HostCnxFailedBadUsernameEvent hostCnxFailedBadUsernameEvent)\n        {\n            return (hostCnxFailedBadUsernameEvent != null && base.Equals(hostCnxFailedBadUsernameEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedBadUsernameEvent)\n        {\n            return Equals(hostCnxFailedBadUsernameEvent as HostCnxFailedBadUsernameEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedBadVersionEvent : HostEvent, IEquatable<HostCnxFailedBadVersionEvent>\n    {\n        public bool Equals(HostCnxFailedBadVersionEvent hostCnxFailedBadVersionEvent)\n        {\n            return (hostCnxFailedBadVersionEvent != null && base.Equals(hostCnxFailedBadVersionEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedBadVersionEvent)\n        {\n            return Equals(hostCnxFailedBadVersionEvent as HostCnxFailedBadVersionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedCcagentUpgradeEvent : HostEvent, IEquatable<HostCnxFailedCcagentUpgradeEvent>\n    {\n        public bool Equals(HostCnxFailedCcagentUpgradeEvent hostCnxFailedCcagentUpgradeEvent)\n        {\n            return (hostCnxFailedCcagentUpgradeEvent != null && base.Equals(hostCnxFailedCcagentUpgradeEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedCcagentUpgradeEvent)\n        {\n            return Equals(hostCnxFailedCcagentUpgradeEvent as HostCnxFailedCcagentUpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedEvent : HostEvent, IEquatable<HostCnxFailedEvent>\n    {\n        public bool Equals(HostCnxFailedEvent hostCnxFailedEvent)\n        {\n            return (hostCnxFailedEvent != null && base.Equals(hostCnxFailedEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedEvent)\n        {\n            return Equals(hostCnxFailedEvent as HostCnxFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedNetworkErrorEvent : HostEvent, IEquatable<HostCnxFailedNetworkErrorEvent>\n    {\n        public bool Equals(HostCnxFailedNetworkErrorEvent hostCnxFailedNetworkErrorEvent)\n        {\n            return (hostCnxFailedNetworkErrorEvent != null && base.Equals(hostCnxFailedNetworkErrorEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedNetworkErrorEvent)\n        {\n            return Equals(hostCnxFailedNetworkErrorEvent as HostCnxFailedNetworkErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedNoAccessEvent : HostEvent, IEquatable<HostCnxFailedNoAccessEvent>\n    {\n        public bool Equals(HostCnxFailedNoAccessEvent hostCnxFailedNoAccessEvent)\n        {\n            return (hostCnxFailedNoAccessEvent != null && base.Equals(hostCnxFailedNoAccessEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedNoAccessEvent)\n        {\n            return Equals(hostCnxFailedNoAccessEvent as HostCnxFailedNoAccessEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedNoConnectionEvent : HostEvent, IEquatable<HostCnxFailedNoConnectionEvent>\n    {\n        public bool Equals(HostCnxFailedNoConnectionEvent hostCnxFailedNoConnectionEvent)\n        {\n            return (hostCnxFailedNoConnectionEvent != null && base.Equals(hostCnxFailedNoConnectionEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedNoConnectionEvent)\n        {\n            return Equals(hostCnxFailedNoConnectionEvent as HostCnxFailedNoConnectionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedNoLicenseEvent : HostEvent, IEquatable<HostCnxFailedNoLicenseEvent>\n    {\n        public bool Equals(HostCnxFailedNoLicenseEvent hostCnxFailedNoLicenseEvent)\n        {\n            return (hostCnxFailedNoLicenseEvent != null && base.Equals(hostCnxFailedNoLicenseEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedNoLicenseEvent)\n        {\n            return Equals(hostCnxFailedNoLicenseEvent as HostCnxFailedNoLicenseEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedNotFoundEvent : HostEvent, IEquatable<HostCnxFailedNotFoundEvent>\n    {\n        public bool Equals(HostCnxFailedNotFoundEvent hostCnxFailedNotFoundEvent)\n        {\n            return (hostCnxFailedNotFoundEvent != null && base.Equals(hostCnxFailedNotFoundEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedNotFoundEvent)\n        {\n            return Equals(hostCnxFailedNotFoundEvent as HostCnxFailedNotFoundEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCnxFailedTimeoutEvent : HostEvent, IEquatable<HostCnxFailedTimeoutEvent>\n    {\n        public bool Equals(HostCnxFailedTimeoutEvent hostCnxFailedTimeoutEvent)\n        {\n            return (hostCnxFailedTimeoutEvent != null && base.Equals(hostCnxFailedTimeoutEvent));\n        }\n\n        public override bool Equals(object hostCnxFailedTimeoutEvent)\n        {\n            return Equals(hostCnxFailedTimeoutEvent as HostCnxFailedTimeoutEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostCommunication : RuntimeFault, IEquatable<HostCommunication>\n    {\n        public bool Equals(HostCommunication hostCommunication)\n        {\n            return (hostCommunication != null && base.Equals(hostCommunication));\n        }\n\n        public override bool Equals(object hostCommunication)\n        {\n            return Equals(hostCommunication as HostCommunication);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostComplianceCheckedEvent : HostEvent, IEquatable<HostComplianceCheckedEvent>\n    {\n        public ProfileEventArgument Profile { get; set; }\n\n        public bool Equals(HostComplianceCheckedEvent hostComplianceCheckedEvent)\n        {\n            return (hostComplianceCheckedEvent != null && ((this.Profile == null && hostComplianceCheckedEvent.Profile == null) || (this.Profile != null && this.Profile.Equals(hostComplianceCheckedEvent.Profile))));\n        }\n\n        public override bool Equals(object hostComplianceCheckedEvent)\n        {\n            return Equals(hostComplianceCheckedEvent as HostComplianceCheckedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile).GetHashCode();\n        }\n    }\n\n    public class HostCompliantEvent : HostEvent, IEquatable<HostCompliantEvent>\n    {\n        public bool Equals(HostCompliantEvent hostCompliantEvent)\n        {\n            return (hostCompliantEvent != null && base.Equals(hostCompliantEvent));\n        }\n\n        public override bool Equals(object hostCompliantEvent)\n        {\n            return Equals(hostCompliantEvent as HostCompliantEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConfigAppliedEvent : HostEvent, IEquatable<HostConfigAppliedEvent>\n    {\n        public bool Equals(HostConfigAppliedEvent hostConfigAppliedEvent)\n        {\n            return (hostConfigAppliedEvent != null && base.Equals(hostConfigAppliedEvent));\n        }\n\n        public override bool Equals(object hostConfigAppliedEvent)\n        {\n            return Equals(hostConfigAppliedEvent as HostConfigAppliedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConfigChange : DynamicData, IEquatable<HostConfigChange>\n    {\n        public bool Equals(HostConfigChange hostConfigChange)\n        {\n            return (hostConfigChange != null && base.Equals(hostConfigChange));\n        }\n\n        public override bool Equals(object hostConfigChange)\n        {\n            return Equals(hostConfigChange as HostConfigChange);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConfigFailed : HostConfigFault, IEquatable<HostConfigFailed>\n    {\n        public LocalizedMethodFault[] Failure { get; set; }\n\n        public bool Equals(HostConfigFailed hostConfigFailed)\n        {\n            return (hostConfigFailed != null && ((this.Failure == null && hostConfigFailed.Failure == null) || (this.Failure != null && hostConfigFailed.Failure != null && Enumerable.SequenceEqual(this.Failure, hostConfigFailed.Failure))));\n        }\n\n        public override bool Equals(object hostConfigFailed)\n        {\n            return Equals(hostConfigFailed as HostConfigFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Failure).GetHashCode();\n        }\n    }\n\n    public class HostConfigFault : VimFault, IEquatable<HostConfigFault>\n    {\n        public bool Equals(HostConfigFault hostConfigFault)\n        {\n            return (hostConfigFault != null && base.Equals(hostConfigFault));\n        }\n\n        public override bool Equals(object hostConfigFault)\n        {\n            return Equals(hostConfigFault as HostConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConfigInfo : DynamicData, IEquatable<HostConfigInfo>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public AboutInfo Product { get; set; }\n\n        public HostDeploymentInfo DeploymentInfo { get; set; }\n\n        public HostHyperThreadScheduleInfo HyperThread { get; set; }\n\n        public ServiceConsoleReservationInfo ConsoleReservation { get; set; }\n\n        public VirtualMachineMemoryReservationInfo VirtualMachineReservation { get; set; }\n\n        public HostStorageDeviceInfo StorageDevice { get; set; }\n\n        public HostMultipathStateInfo MultipathState { get; set; }\n\n        public HostFileSystemVolumeInfo FileSystemVolume { get; set; }\n\n        public string[] SystemFile { get; set; }\n\n        public HostNetworkInfo Network { get; set; }\n\n        public HostVMotionInfo Vmotion { get; set; }\n\n        public HostVirtualNicManagerInfo VirtualNicManagerInfo { get; set; }\n\n        public HostNetCapabilities Capabilities { get; set; }\n\n        public HostDatastoreSystemCapabilities DatastoreCapabilities { get; set; }\n\n        public HostNetOffloadCapabilities OffloadCapabilities { get; set; }\n\n        public HostServiceInfo Service { get; set; }\n\n        public HostFirewallInfo Firewall { get; set; }\n\n        public HostAutoStartManagerConfig AutoStart { get; set; }\n\n        public HostDiagnosticPartition ActiveDiagnosticPartition { get; set; }\n\n        public OptionValue[] Option { get; set; }\n\n        public OptionDef[] OptionDef { get; set; }\n\n        public string DatastorePrincipal { get; set; }\n\n        public ManagedObjectReference LocalSwapDatastore { get; set; }\n\n        public HostSystemSwapConfiguration SystemSwapConfiguration { get; set; }\n\n        public HostSystemResourceInfo SystemResources { get; set; }\n\n        public HostDateTimeInfo DateTimeInfo { get; set; }\n\n        public HostFlagInfo Flags { get; set; }\n\n        public bool? AdminDisabled { get; set; }\n\n        public HostLockdownMode? LockdownMode { get; set; }\n\n        public HostIpmiInfo Ipmi { get; set; }\n\n        public HostSslThumbprintInfo SslThumbprintInfo { get; set; }\n\n        public HostSslThumbprintInfo[] SslThumbprintData { get; set; }\n\n        public sbyte[] Certificate { get; set; }\n\n        public HostPciPassthruInfo[] PciPassthruInfo { get; set; }\n\n        public HostAuthenticationManagerInfo AuthenticationManagerInfo { get; set; }\n\n        public HostFeatureVersionInfo[] FeatureVersion { get; set; }\n\n        public PowerSystemCapability PowerSystemCapability { get; set; }\n\n        public PowerSystemInfo PowerSystemInfo { get; set; }\n\n        public HostCacheConfigurationInfo[] CacheConfigurationInfo { get; set; }\n\n        public bool? WakeOnLanCapable { get; set; }\n\n        public HostFeatureCapability[] FeatureCapability { get; set; }\n\n        public HostFeatureCapability[] MaskedFeatureCapability { get; set; }\n\n        public HostVFlashManagerVFlashConfigInfo VFlashConfigInfo { get; set; }\n\n        public VsanHostConfigInfo VsanHostConfig { get; set; }\n\n        public string[] DomainList { get; set; }\n\n        public byte[] ScriptCheckSum { get; set; }\n\n        public byte[] HostConfigCheckSum { get; set; }\n\n        public HostGraphicsInfo[] GraphicsInfo { get; set; }\n\n        public string[] SharedPassthruGpuTypes { get; set; }\n\n        public HostGraphicsConfig GraphicsConfig { get; set; }\n\n        public HostSharedGpuCapabilities[] SharedGpuCapabilities { get; set; }\n\n        public HostIoFilterInfo[] IoFilterInfo { get; set; }\n\n        public HostSriovDevicePoolInfo[] SriovDevicePool { get; set; }\n\n        public HostConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostConfigInfo hostConfigInfo)\n        {\n            return (hostConfigInfo != null && ((this.Host == null && hostConfigInfo.Host == null) || (this.Host != null && this.Host.Equals(hostConfigInfo.Host))) && ((this.Product == null && hostConfigInfo.Product == null) || (this.Product != null && this.Product.Equals(hostConfigInfo.Product))) && ((this.DeploymentInfo == null && hostConfigInfo.DeploymentInfo == null) || (this.DeploymentInfo != null && this.DeploymentInfo.Equals(hostConfigInfo.DeploymentInfo))) && ((this.HyperThread == null && hostConfigInfo.HyperThread == null) || (this.HyperThread != null && this.HyperThread.Equals(hostConfigInfo.HyperThread))) && ((this.ConsoleReservation == null && hostConfigInfo.ConsoleReservation == null) || (this.ConsoleReservation != null && this.ConsoleReservation.Equals(hostConfigInfo.ConsoleReservation))) && ((this.VirtualMachineReservation == null && hostConfigInfo.VirtualMachineReservation == null) || (this.VirtualMachineReservation != null && this.VirtualMachineReservation.Equals(hostConfigInfo.VirtualMachineReservation))) && ((this.StorageDevice == null && hostConfigInfo.StorageDevice == null) || (this.StorageDevice != null && this.StorageDevice.Equals(hostConfigInfo.StorageDevice))) && ((this.MultipathState == null && hostConfigInfo.MultipathState == null) || (this.MultipathState != null && this.MultipathState.Equals(hostConfigInfo.MultipathState))) && ((this.FileSystemVolume == null && hostConfigInfo.FileSystemVolume == null) || (this.FileSystemVolume != null && this.FileSystemVolume.Equals(hostConfigInfo.FileSystemVolume))) && ((this.SystemFile == null && hostConfigInfo.SystemFile == null) || (this.SystemFile != null && hostConfigInfo.SystemFile != null && Enumerable.SequenceEqual(this.SystemFile, hostConfigInfo.SystemFile))) && ((this.Network == null && hostConfigInfo.Network == null) || (this.Network != null && this.Network.Equals(hostConfigInfo.Network))) && ((this.Vmotion == null && hostConfigInfo.Vmotion == null) || (this.Vmotion != null && this.Vmotion.Equals(hostConfigInfo.Vmotion))) && ((this.VirtualNicManagerInfo == null && hostConfigInfo.VirtualNicManagerInfo == null) || (this.VirtualNicManagerInfo != null && this.VirtualNicManagerInfo.Equals(hostConfigInfo.VirtualNicManagerInfo))) && ((this.Capabilities == null && hostConfigInfo.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(hostConfigInfo.Capabilities))) && ((this.DatastoreCapabilities == null && hostConfigInfo.DatastoreCapabilities == null) || (this.DatastoreCapabilities != null && this.DatastoreCapabilities.Equals(hostConfigInfo.DatastoreCapabilities))) && ((this.OffloadCapabilities == null && hostConfigInfo.OffloadCapabilities == null) || (this.OffloadCapabilities != null && this.OffloadCapabilities.Equals(hostConfigInfo.OffloadCapabilities))) && ((this.Service == null && hostConfigInfo.Service == null) || (this.Service != null && this.Service.Equals(hostConfigInfo.Service))) && ((this.Firewall == null && hostConfigInfo.Firewall == null) || (this.Firewall != null && this.Firewall.Equals(hostConfigInfo.Firewall))) && ((this.AutoStart == null && hostConfigInfo.AutoStart == null) || (this.AutoStart != null && this.AutoStart.Equals(hostConfigInfo.AutoStart))) && ((this.ActiveDiagnosticPartition == null && hostConfigInfo.ActiveDiagnosticPartition == null) || (this.ActiveDiagnosticPartition != null && this.ActiveDiagnosticPartition.Equals(hostConfigInfo.ActiveDiagnosticPartition))) && ((this.Option == null && hostConfigInfo.Option == null) || (this.Option != null && hostConfigInfo.Option != null && Enumerable.SequenceEqual(this.Option, hostConfigInfo.Option))) && ((this.OptionDef == null && hostConfigInfo.OptionDef == null) || (this.OptionDef != null && hostConfigInfo.OptionDef != null && Enumerable.SequenceEqual(this.OptionDef, hostConfigInfo.OptionDef))) && this.DatastorePrincipal == hostConfigInfo.DatastorePrincipal && ((this.LocalSwapDatastore == null && hostConfigInfo.LocalSwapDatastore == null) || (this.LocalSwapDatastore != null && this.LocalSwapDatastore.Equals(hostConfigInfo.LocalSwapDatastore))) && ((this.SystemSwapConfiguration == null && hostConfigInfo.SystemSwapConfiguration == null) || (this.SystemSwapConfiguration != null && this.SystemSwapConfiguration.Equals(hostConfigInfo.SystemSwapConfiguration))) && ((this.SystemResources == null && hostConfigInfo.SystemResources == null) || (this.SystemResources != null && this.SystemResources.Equals(hostConfigInfo.SystemResources))) && ((this.DateTimeInfo == null && hostConfigInfo.DateTimeInfo == null) || (this.DateTimeInfo != null && this.DateTimeInfo.Equals(hostConfigInfo.DateTimeInfo))) && ((this.Flags == null && hostConfigInfo.Flags == null) || (this.Flags != null && this.Flags.Equals(hostConfigInfo.Flags))) && ((this.AdminDisabled == null && hostConfigInfo.AdminDisabled == null) || (this.AdminDisabled != null && this.AdminDisabled.Equals(hostConfigInfo.AdminDisabled))) && ((this.LockdownMode == null && hostConfigInfo.LockdownMode == null) || (this.LockdownMode != null && this.LockdownMode.Equals(hostConfigInfo.LockdownMode))) && ((this.Ipmi == null && hostConfigInfo.Ipmi == null) || (this.Ipmi != null && this.Ipmi.Equals(hostConfigInfo.Ipmi))) && ((this.SslThumbprintInfo == null && hostConfigInfo.SslThumbprintInfo == null) || (this.SslThumbprintInfo != null && this.SslThumbprintInfo.Equals(hostConfigInfo.SslThumbprintInfo))) && ((this.SslThumbprintData == null && hostConfigInfo.SslThumbprintData == null) || (this.SslThumbprintData != null && hostConfigInfo.SslThumbprintData != null && Enumerable.SequenceEqual(this.SslThumbprintData, hostConfigInfo.SslThumbprintData))) && ((this.Certificate == null && hostConfigInfo.Certificate == null) || (this.Certificate != null && hostConfigInfo.Certificate != null && Enumerable.SequenceEqual(this.Certificate, hostConfigInfo.Certificate))) && ((this.PciPassthruInfo == null && hostConfigInfo.PciPassthruInfo == null) || (this.PciPassthruInfo != null && hostConfigInfo.PciPassthruInfo != null && Enumerable.SequenceEqual(this.PciPassthruInfo, hostConfigInfo.PciPassthruInfo))) && ((this.AuthenticationManagerInfo == null && hostConfigInfo.AuthenticationManagerInfo == null) || (this.AuthenticationManagerInfo != null && this.AuthenticationManagerInfo.Equals(hostConfigInfo.AuthenticationManagerInfo))) && ((this.FeatureVersion == null && hostConfigInfo.FeatureVersion == null) || (this.FeatureVersion != null && hostConfigInfo.FeatureVersion != null && Enumerable.SequenceEqual(this.FeatureVersion, hostConfigInfo.FeatureVersion))) && ((this.PowerSystemCapability == null && hostConfigInfo.PowerSystemCapability == null) || (this.PowerSystemCapability != null && this.PowerSystemCapability.Equals(hostConfigInfo.PowerSystemCapability))) && ((this.PowerSystemInfo == null && hostConfigInfo.PowerSystemInfo == null) || (this.PowerSystemInfo != null && this.PowerSystemInfo.Equals(hostConfigInfo.PowerSystemInfo))) && ((this.CacheConfigurationInfo == null && hostConfigInfo.CacheConfigurationInfo == null) || (this.CacheConfigurationInfo != null && hostConfigInfo.CacheConfigurationInfo != null && Enumerable.SequenceEqual(this.CacheConfigurationInfo, hostConfigInfo.CacheConfigurationInfo))) && ((this.WakeOnLanCapable == null && hostConfigInfo.WakeOnLanCapable == null) || (this.WakeOnLanCapable != null && this.WakeOnLanCapable.Equals(hostConfigInfo.WakeOnLanCapable))) && ((this.FeatureCapability == null && hostConfigInfo.FeatureCapability == null) || (this.FeatureCapability != null && hostConfigInfo.FeatureCapability != null && Enumerable.SequenceEqual(this.FeatureCapability, hostConfigInfo.FeatureCapability))) && ((this.MaskedFeatureCapability == null && hostConfigInfo.MaskedFeatureCapability == null) || (this.MaskedFeatureCapability != null && hostConfigInfo.MaskedFeatureCapability != null && Enumerable.SequenceEqual(this.MaskedFeatureCapability, hostConfigInfo.MaskedFeatureCapability))) && ((this.VFlashConfigInfo == null && hostConfigInfo.VFlashConfigInfo == null) || (this.VFlashConfigInfo != null && this.VFlashConfigInfo.Equals(hostConfigInfo.VFlashConfigInfo))) && ((this.VsanHostConfig == null && hostConfigInfo.VsanHostConfig == null) || (this.VsanHostConfig != null && this.VsanHostConfig.Equals(hostConfigInfo.VsanHostConfig))) && ((this.DomainList == null && hostConfigInfo.DomainList == null) || (this.DomainList != null && hostConfigInfo.DomainList != null && Enumerable.SequenceEqual(this.DomainList, hostConfigInfo.DomainList))) && ((this.ScriptCheckSum == null && hostConfigInfo.ScriptCheckSum == null) || (this.ScriptCheckSum != null && hostConfigInfo.ScriptCheckSum != null && Enumerable.SequenceEqual(this.ScriptCheckSum, hostConfigInfo.ScriptCheckSum))) && ((this.HostConfigCheckSum == null && hostConfigInfo.HostConfigCheckSum == null) || (this.HostConfigCheckSum != null && hostConfigInfo.HostConfigCheckSum != null && Enumerable.SequenceEqual(this.HostConfigCheckSum, hostConfigInfo.HostConfigCheckSum))) && ((this.GraphicsInfo == null && hostConfigInfo.GraphicsInfo == null) || (this.GraphicsInfo != null && hostConfigInfo.GraphicsInfo != null && Enumerable.SequenceEqual(this.GraphicsInfo, hostConfigInfo.GraphicsInfo))) && ((this.SharedPassthruGpuTypes == null && hostConfigInfo.SharedPassthruGpuTypes == null) || (this.SharedPassthruGpuTypes != null && hostConfigInfo.SharedPassthruGpuTypes != null && Enumerable.SequenceEqual(this.SharedPassthruGpuTypes, hostConfigInfo.SharedPassthruGpuTypes))) && ((this.GraphicsConfig == null && hostConfigInfo.GraphicsConfig == null) || (this.GraphicsConfig != null && this.GraphicsConfig.Equals(hostConfigInfo.GraphicsConfig))) && ((this.SharedGpuCapabilities == null && hostConfigInfo.SharedGpuCapabilities == null) || (this.SharedGpuCapabilities != null && hostConfigInfo.SharedGpuCapabilities != null && Enumerable.SequenceEqual(this.SharedGpuCapabilities, hostConfigInfo.SharedGpuCapabilities))) && ((this.IoFilterInfo == null && hostConfigInfo.IoFilterInfo == null) || (this.IoFilterInfo != null && hostConfigInfo.IoFilterInfo != null && Enumerable.SequenceEqual(this.IoFilterInfo, hostConfigInfo.IoFilterInfo))) && ((this.SriovDevicePool == null && hostConfigInfo.SriovDevicePool == null) || (this.SriovDevicePool != null && hostConfigInfo.SriovDevicePool != null && Enumerable.SequenceEqual(this.SriovDevicePool, hostConfigInfo.SriovDevicePool))) && ((this.LinkedView == null && hostConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object hostConfigInfo)\n        {\n            return Equals(hostConfigInfo as HostConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Product + \"_\" + DeploymentInfo + \"_\" + HyperThread + \"_\" + ConsoleReservation + \"_\" + VirtualMachineReservation + \"_\" + StorageDevice + \"_\" + MultipathState + \"_\" + FileSystemVolume + \"_\" + SystemFile + \"_\" + Network + \"_\" + Vmotion + \"_\" + VirtualNicManagerInfo + \"_\" + Capabilities + \"_\" + DatastoreCapabilities + \"_\" + OffloadCapabilities + \"_\" + Service + \"_\" + Firewall + \"_\" + AutoStart + \"_\" + ActiveDiagnosticPartition + \"_\" + Option + \"_\" + OptionDef + \"_\" + DatastorePrincipal + \"_\" + LocalSwapDatastore + \"_\" + SystemSwapConfiguration + \"_\" + SystemResources + \"_\" + DateTimeInfo + \"_\" + Flags + \"_\" + AdminDisabled + \"_\" + LockdownMode + \"_\" + Ipmi + \"_\" + SslThumbprintInfo + \"_\" + SslThumbprintData + \"_\" + Certificate + \"_\" + PciPassthruInfo + \"_\" + AuthenticationManagerInfo + \"_\" + FeatureVersion + \"_\" + PowerSystemCapability + \"_\" + PowerSystemInfo + \"_\" + CacheConfigurationInfo + \"_\" + WakeOnLanCapable + \"_\" + FeatureCapability + \"_\" + MaskedFeatureCapability + \"_\" + VFlashConfigInfo + \"_\" + VsanHostConfig + \"_\" + DomainList + \"_\" + ScriptCheckSum + \"_\" + HostConfigCheckSum + \"_\" + GraphicsInfo + \"_\" + SharedPassthruGpuTypes + \"_\" + GraphicsConfig + \"_\" + SharedGpuCapabilities + \"_\" + IoFilterInfo + \"_\" + SriovDevicePool + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostConfigInfo_LinkedView : IEquatable<HostConfigInfo_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public Datastore LocalSwapDatastore { get; set; }\n\n        public bool Equals(HostConfigInfo_LinkedView hostConfigInfo_LinkedView)\n        {\n            return (hostConfigInfo_LinkedView != null && ((this.Host == null && hostConfigInfo_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostConfigInfo_LinkedView.Host))) && ((this.LocalSwapDatastore == null && hostConfigInfo_LinkedView.LocalSwapDatastore == null) || (this.LocalSwapDatastore != null && this.LocalSwapDatastore.Equals(hostConfigInfo_LinkedView.LocalSwapDatastore))));\n        }\n\n        public override bool Equals(object hostConfigInfo_LinkedView)\n        {\n            return Equals(hostConfigInfo_LinkedView as HostConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LocalSwapDatastore).GetHashCode();\n        }\n    }\n\n    public class HostConfigManager : DynamicData, IEquatable<HostConfigManager>\n    {\n        public ManagedObjectReference CpuScheduler { get; set; }\n\n        public ManagedObjectReference DatastoreSystem { get; set; }\n\n        public ManagedObjectReference MemoryManager { get; set; }\n\n        public ManagedObjectReference StorageSystem { get; set; }\n\n        public ManagedObjectReference NetworkSystem { get; set; }\n\n        public ManagedObjectReference VmotionSystem { get; set; }\n\n        public ManagedObjectReference VirtualNicManager { get; set; }\n\n        public ManagedObjectReference ServiceSystem { get; set; }\n\n        public ManagedObjectReference FirewallSystem { get; set; }\n\n        public ManagedObjectReference AdvancedOption { get; set; }\n\n        public ManagedObjectReference DiagnosticSystem { get; set; }\n\n        public ManagedObjectReference AutoStartManager { get; set; }\n\n        public ManagedObjectReference SnmpSystem { get; set; }\n\n        public ManagedObjectReference DateTimeSystem { get; set; }\n\n        public ManagedObjectReference PatchManager { get; set; }\n\n        public ManagedObjectReference ImageConfigManager { get; set; }\n\n        public ManagedObjectReference BootDeviceSystem { get; set; }\n\n        public ManagedObjectReference FirmwareSystem { get; set; }\n\n        public ManagedObjectReference HealthStatusSystem { get; set; }\n\n        public ManagedObjectReference PciPassthruSystem { get; set; }\n\n        public ManagedObjectReference LicenseManager { get; set; }\n\n        public ManagedObjectReference KernelModuleSystem { get; set; }\n\n        public ManagedObjectReference AuthenticationManager { get; set; }\n\n        public ManagedObjectReference PowerSystem { get; set; }\n\n        public ManagedObjectReference CacheConfigurationManager { get; set; }\n\n        public ManagedObjectReference EsxAgentHostManager { get; set; }\n\n        public ManagedObjectReference IscsiManager { get; set; }\n\n        public ManagedObjectReference VFlashManager { get; set; }\n\n        public ManagedObjectReference VsanSystem { get; set; }\n\n        public ManagedObjectReference MessageBusProxy { get; set; }\n\n        public ManagedObjectReference UserDirectory { get; set; }\n\n        public ManagedObjectReference AccountManager { get; set; }\n\n        public ManagedObjectReference HostAccessManager { get; set; }\n\n        public ManagedObjectReference GraphicsManager { get; set; }\n\n        public ManagedObjectReference VsanInternalSystem { get; set; }\n\n        public ManagedObjectReference CertificateManager { get; set; }\n\n        public ManagedObjectReference CryptoManager { get; set; }\n\n        public ManagedObjectReference NvdimmSystem { get; set; }\n\n        public HostConfigManager_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostConfigManager hostConfigManager)\n        {\n            return (hostConfigManager != null && ((this.CpuScheduler == null && hostConfigManager.CpuScheduler == null) || (this.CpuScheduler != null && this.CpuScheduler.Equals(hostConfigManager.CpuScheduler))) && ((this.DatastoreSystem == null && hostConfigManager.DatastoreSystem == null) || (this.DatastoreSystem != null && this.DatastoreSystem.Equals(hostConfigManager.DatastoreSystem))) && ((this.MemoryManager == null && hostConfigManager.MemoryManager == null) || (this.MemoryManager != null && this.MemoryManager.Equals(hostConfigManager.MemoryManager))) && ((this.StorageSystem == null && hostConfigManager.StorageSystem == null) || (this.StorageSystem != null && this.StorageSystem.Equals(hostConfigManager.StorageSystem))) && ((this.NetworkSystem == null && hostConfigManager.NetworkSystem == null) || (this.NetworkSystem != null && this.NetworkSystem.Equals(hostConfigManager.NetworkSystem))) && ((this.VmotionSystem == null && hostConfigManager.VmotionSystem == null) || (this.VmotionSystem != null && this.VmotionSystem.Equals(hostConfigManager.VmotionSystem))) && ((this.VirtualNicManager == null && hostConfigManager.VirtualNicManager == null) || (this.VirtualNicManager != null && this.VirtualNicManager.Equals(hostConfigManager.VirtualNicManager))) && ((this.ServiceSystem == null && hostConfigManager.ServiceSystem == null) || (this.ServiceSystem != null && this.ServiceSystem.Equals(hostConfigManager.ServiceSystem))) && ((this.FirewallSystem == null && hostConfigManager.FirewallSystem == null) || (this.FirewallSystem != null && this.FirewallSystem.Equals(hostConfigManager.FirewallSystem))) && ((this.AdvancedOption == null && hostConfigManager.AdvancedOption == null) || (this.AdvancedOption != null && this.AdvancedOption.Equals(hostConfigManager.AdvancedOption))) && ((this.DiagnosticSystem == null && hostConfigManager.DiagnosticSystem == null) || (this.DiagnosticSystem != null && this.DiagnosticSystem.Equals(hostConfigManager.DiagnosticSystem))) && ((this.AutoStartManager == null && hostConfigManager.AutoStartManager == null) || (this.AutoStartManager != null && this.AutoStartManager.Equals(hostConfigManager.AutoStartManager))) && ((this.SnmpSystem == null && hostConfigManager.SnmpSystem == null) || (this.SnmpSystem != null && this.SnmpSystem.Equals(hostConfigManager.SnmpSystem))) && ((this.DateTimeSystem == null && hostConfigManager.DateTimeSystem == null) || (this.DateTimeSystem != null && this.DateTimeSystem.Equals(hostConfigManager.DateTimeSystem))) && ((this.PatchManager == null && hostConfigManager.PatchManager == null) || (this.PatchManager != null && this.PatchManager.Equals(hostConfigManager.PatchManager))) && ((this.ImageConfigManager == null && hostConfigManager.ImageConfigManager == null) || (this.ImageConfigManager != null && this.ImageConfigManager.Equals(hostConfigManager.ImageConfigManager))) && ((this.BootDeviceSystem == null && hostConfigManager.BootDeviceSystem == null) || (this.BootDeviceSystem != null && this.BootDeviceSystem.Equals(hostConfigManager.BootDeviceSystem))) && ((this.FirmwareSystem == null && hostConfigManager.FirmwareSystem == null) || (this.FirmwareSystem != null && this.FirmwareSystem.Equals(hostConfigManager.FirmwareSystem))) && ((this.HealthStatusSystem == null && hostConfigManager.HealthStatusSystem == null) || (this.HealthStatusSystem != null && this.HealthStatusSystem.Equals(hostConfigManager.HealthStatusSystem))) && ((this.PciPassthruSystem == null && hostConfigManager.PciPassthruSystem == null) || (this.PciPassthruSystem != null && this.PciPassthruSystem.Equals(hostConfigManager.PciPassthruSystem))) && ((this.LicenseManager == null && hostConfigManager.LicenseManager == null) || (this.LicenseManager != null && this.LicenseManager.Equals(hostConfigManager.LicenseManager))) && ((this.KernelModuleSystem == null && hostConfigManager.KernelModuleSystem == null) || (this.KernelModuleSystem != null && this.KernelModuleSystem.Equals(hostConfigManager.KernelModuleSystem))) && ((this.AuthenticationManager == null && hostConfigManager.AuthenticationManager == null) || (this.AuthenticationManager != null && this.AuthenticationManager.Equals(hostConfigManager.AuthenticationManager))) && ((this.PowerSystem == null && hostConfigManager.PowerSystem == null) || (this.PowerSystem != null && this.PowerSystem.Equals(hostConfigManager.PowerSystem))) && ((this.CacheConfigurationManager == null && hostConfigManager.CacheConfigurationManager == null) || (this.CacheConfigurationManager != null && this.CacheConfigurationManager.Equals(hostConfigManager.CacheConfigurationManager))) && ((this.EsxAgentHostManager == null && hostConfigManager.EsxAgentHostManager == null) || (this.EsxAgentHostManager != null && this.EsxAgentHostManager.Equals(hostConfigManager.EsxAgentHostManager))) && ((this.IscsiManager == null && hostConfigManager.IscsiManager == null) || (this.IscsiManager != null && this.IscsiManager.Equals(hostConfigManager.IscsiManager))) && ((this.VFlashManager == null && hostConfigManager.VFlashManager == null) || (this.VFlashManager != null && this.VFlashManager.Equals(hostConfigManager.VFlashManager))) && ((this.VsanSystem == null && hostConfigManager.VsanSystem == null) || (this.VsanSystem != null && this.VsanSystem.Equals(hostConfigManager.VsanSystem))) && ((this.MessageBusProxy == null && hostConfigManager.MessageBusProxy == null) || (this.MessageBusProxy != null && this.MessageBusProxy.Equals(hostConfigManager.MessageBusProxy))) && ((this.UserDirectory == null && hostConfigManager.UserDirectory == null) || (this.UserDirectory != null && this.UserDirectory.Equals(hostConfigManager.UserDirectory))) && ((this.AccountManager == null && hostConfigManager.AccountManager == null) || (this.AccountManager != null && this.AccountManager.Equals(hostConfigManager.AccountManager))) && ((this.HostAccessManager == null && hostConfigManager.HostAccessManager == null) || (this.HostAccessManager != null && this.HostAccessManager.Equals(hostConfigManager.HostAccessManager))) && ((this.GraphicsManager == null && hostConfigManager.GraphicsManager == null) || (this.GraphicsManager != null && this.GraphicsManager.Equals(hostConfigManager.GraphicsManager))) && ((this.VsanInternalSystem == null && hostConfigManager.VsanInternalSystem == null) || (this.VsanInternalSystem != null && this.VsanInternalSystem.Equals(hostConfigManager.VsanInternalSystem))) && ((this.CertificateManager == null && hostConfigManager.CertificateManager == null) || (this.CertificateManager != null && this.CertificateManager.Equals(hostConfigManager.CertificateManager))) && ((this.CryptoManager == null && hostConfigManager.CryptoManager == null) || (this.CryptoManager != null && this.CryptoManager.Equals(hostConfigManager.CryptoManager))) && ((this.NvdimmSystem == null && hostConfigManager.NvdimmSystem == null) || (this.NvdimmSystem != null && this.NvdimmSystem.Equals(hostConfigManager.NvdimmSystem))) && ((this.LinkedView == null && hostConfigManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostConfigManager.LinkedView))));\n        }\n\n        public override bool Equals(object hostConfigManager)\n        {\n            return Equals(hostConfigManager as HostConfigManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CpuScheduler + \"_\" + DatastoreSystem + \"_\" + MemoryManager + \"_\" + StorageSystem + \"_\" + NetworkSystem + \"_\" + VmotionSystem + \"_\" + VirtualNicManager + \"_\" + ServiceSystem + \"_\" + FirewallSystem + \"_\" + AdvancedOption + \"_\" + DiagnosticSystem + \"_\" + AutoStartManager + \"_\" + SnmpSystem + \"_\" + DateTimeSystem + \"_\" + PatchManager + \"_\" + ImageConfigManager + \"_\" + BootDeviceSystem + \"_\" + FirmwareSystem + \"_\" + HealthStatusSystem + \"_\" + PciPassthruSystem + \"_\" + LicenseManager + \"_\" + KernelModuleSystem + \"_\" + AuthenticationManager + \"_\" + PowerSystem + \"_\" + CacheConfigurationManager + \"_\" + EsxAgentHostManager + \"_\" + IscsiManager + \"_\" + VFlashManager + \"_\" + VsanSystem + \"_\" + MessageBusProxy + \"_\" + UserDirectory + \"_\" + AccountManager + \"_\" + HostAccessManager + \"_\" + GraphicsManager + \"_\" + VsanInternalSystem + \"_\" + CertificateManager + \"_\" + CryptoManager + \"_\" + NvdimmSystem + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostConfigManager_LinkedView : IEquatable<HostConfigManager_LinkedView>\n    {\n        public HostCpuSchedulerSystem CpuScheduler { get; set; }\n\n        public HostDatastoreSystem DatastoreSystem { get; set; }\n\n        public HostMemorySystem MemoryManager { get; set; }\n\n        public HostStorageSystem StorageSystem { get; set; }\n\n        public HostNetworkSystem NetworkSystem { get; set; }\n\n        public HostVMotionSystem VmotionSystem { get; set; }\n\n        public HostVirtualNicManager VirtualNicManager { get; set; }\n\n        public HostServiceSystem ServiceSystem { get; set; }\n\n        public HostFirewallSystem FirewallSystem { get; set; }\n\n        public OptionManager AdvancedOption { get; set; }\n\n        public HostDiagnosticSystem DiagnosticSystem { get; set; }\n\n        public HostAutoStartManager AutoStartManager { get; set; }\n\n        public HostSnmpSystem SnmpSystem { get; set; }\n\n        public HostDateTimeSystem DateTimeSystem { get; set; }\n\n        public HostPatchManager PatchManager { get; set; }\n\n        public HostImageConfigManager ImageConfigManager { get; set; }\n\n        public HostBootDeviceSystem BootDeviceSystem { get; set; }\n\n        public HostFirmwareSystem FirmwareSystem { get; set; }\n\n        public HostHealthStatusSystem HealthStatusSystem { get; set; }\n\n        public HostPciPassthruSystem PciPassthruSystem { get; set; }\n\n        public LicenseManager LicenseManager { get; set; }\n\n        public HostKernelModuleSystem KernelModuleSystem { get; set; }\n\n        public HostAuthenticationManager AuthenticationManager { get; set; }\n\n        public HostPowerSystem PowerSystem { get; set; }\n\n        public HostCacheConfigurationManager CacheConfigurationManager { get; set; }\n\n        public HostEsxAgentHostManager EsxAgentHostManager { get; set; }\n\n        public IscsiManager IscsiManager { get; set; }\n\n        public HostVFlashManager VFlashManager { get; set; }\n\n        public HostVsanSystem VsanSystem { get; set; }\n\n        public MessageBusProxy MessageBusProxy { get; set; }\n\n        public UserDirectory UserDirectory { get; set; }\n\n        public HostLocalAccountManager AccountManager { get; set; }\n\n        public HostAccessManager HostAccessManager { get; set; }\n\n        public HostGraphicsManager GraphicsManager { get; set; }\n\n        public HostVsanInternalSystem VsanInternalSystem { get; set; }\n\n        public HostCertificateManager CertificateManager { get; set; }\n\n        public CryptoManager CryptoManager { get; set; }\n\n        public HostNvdimmSystem NvdimmSystem { get; set; }\n\n        public bool Equals(HostConfigManager_LinkedView hostConfigManager_LinkedView)\n        {\n            return (hostConfigManager_LinkedView != null && ((this.CpuScheduler == null && hostConfigManager_LinkedView.CpuScheduler == null) || (this.CpuScheduler != null && this.CpuScheduler.Equals(hostConfigManager_LinkedView.CpuScheduler))) && ((this.DatastoreSystem == null && hostConfigManager_LinkedView.DatastoreSystem == null) || (this.DatastoreSystem != null && this.DatastoreSystem.Equals(hostConfigManager_LinkedView.DatastoreSystem))) && ((this.MemoryManager == null && hostConfigManager_LinkedView.MemoryManager == null) || (this.MemoryManager != null && this.MemoryManager.Equals(hostConfigManager_LinkedView.MemoryManager))) && ((this.StorageSystem == null && hostConfigManager_LinkedView.StorageSystem == null) || (this.StorageSystem != null && this.StorageSystem.Equals(hostConfigManager_LinkedView.StorageSystem))) && ((this.NetworkSystem == null && hostConfigManager_LinkedView.NetworkSystem == null) || (this.NetworkSystem != null && this.NetworkSystem.Equals(hostConfigManager_LinkedView.NetworkSystem))) && ((this.VmotionSystem == null && hostConfigManager_LinkedView.VmotionSystem == null) || (this.VmotionSystem != null && this.VmotionSystem.Equals(hostConfigManager_LinkedView.VmotionSystem))) && ((this.VirtualNicManager == null && hostConfigManager_LinkedView.VirtualNicManager == null) || (this.VirtualNicManager != null && this.VirtualNicManager.Equals(hostConfigManager_LinkedView.VirtualNicManager))) && ((this.ServiceSystem == null && hostConfigManager_LinkedView.ServiceSystem == null) || (this.ServiceSystem != null && this.ServiceSystem.Equals(hostConfigManager_LinkedView.ServiceSystem))) && ((this.FirewallSystem == null && hostConfigManager_LinkedView.FirewallSystem == null) || (this.FirewallSystem != null && this.FirewallSystem.Equals(hostConfigManager_LinkedView.FirewallSystem))) && ((this.AdvancedOption == null && hostConfigManager_LinkedView.AdvancedOption == null) || (this.AdvancedOption != null && this.AdvancedOption.Equals(hostConfigManager_LinkedView.AdvancedOption))) && ((this.DiagnosticSystem == null && hostConfigManager_LinkedView.DiagnosticSystem == null) || (this.DiagnosticSystem != null && this.DiagnosticSystem.Equals(hostConfigManager_LinkedView.DiagnosticSystem))) && ((this.AutoStartManager == null && hostConfigManager_LinkedView.AutoStartManager == null) || (this.AutoStartManager != null && this.AutoStartManager.Equals(hostConfigManager_LinkedView.AutoStartManager))) && ((this.SnmpSystem == null && hostConfigManager_LinkedView.SnmpSystem == null) || (this.SnmpSystem != null && this.SnmpSystem.Equals(hostConfigManager_LinkedView.SnmpSystem))) && ((this.DateTimeSystem == null && hostConfigManager_LinkedView.DateTimeSystem == null) || (this.DateTimeSystem != null && this.DateTimeSystem.Equals(hostConfigManager_LinkedView.DateTimeSystem))) && ((this.PatchManager == null && hostConfigManager_LinkedView.PatchManager == null) || (this.PatchManager != null && this.PatchManager.Equals(hostConfigManager_LinkedView.PatchManager))) && ((this.ImageConfigManager == null && hostConfigManager_LinkedView.ImageConfigManager == null) || (this.ImageConfigManager != null && this.ImageConfigManager.Equals(hostConfigManager_LinkedView.ImageConfigManager))) && ((this.BootDeviceSystem == null && hostConfigManager_LinkedView.BootDeviceSystem == null) || (this.BootDeviceSystem != null && this.BootDeviceSystem.Equals(hostConfigManager_LinkedView.BootDeviceSystem))) && ((this.FirmwareSystem == null && hostConfigManager_LinkedView.FirmwareSystem == null) || (this.FirmwareSystem != null && this.FirmwareSystem.Equals(hostConfigManager_LinkedView.FirmwareSystem))) && ((this.HealthStatusSystem == null && hostConfigManager_LinkedView.HealthStatusSystem == null) || (this.HealthStatusSystem != null && this.HealthStatusSystem.Equals(hostConfigManager_LinkedView.HealthStatusSystem))) && ((this.PciPassthruSystem == null && hostConfigManager_LinkedView.PciPassthruSystem == null) || (this.PciPassthruSystem != null && this.PciPassthruSystem.Equals(hostConfigManager_LinkedView.PciPassthruSystem))) && ((this.LicenseManager == null && hostConfigManager_LinkedView.LicenseManager == null) || (this.LicenseManager != null && this.LicenseManager.Equals(hostConfigManager_LinkedView.LicenseManager))) && ((this.KernelModuleSystem == null && hostConfigManager_LinkedView.KernelModuleSystem == null) || (this.KernelModuleSystem != null && this.KernelModuleSystem.Equals(hostConfigManager_LinkedView.KernelModuleSystem))) && ((this.AuthenticationManager == null && hostConfigManager_LinkedView.AuthenticationManager == null) || (this.AuthenticationManager != null && this.AuthenticationManager.Equals(hostConfigManager_LinkedView.AuthenticationManager))) && ((this.PowerSystem == null && hostConfigManager_LinkedView.PowerSystem == null) || (this.PowerSystem != null && this.PowerSystem.Equals(hostConfigManager_LinkedView.PowerSystem))) && ((this.CacheConfigurationManager == null && hostConfigManager_LinkedView.CacheConfigurationManager == null) || (this.CacheConfigurationManager != null && this.CacheConfigurationManager.Equals(hostConfigManager_LinkedView.CacheConfigurationManager))) && ((this.EsxAgentHostManager == null && hostConfigManager_LinkedView.EsxAgentHostManager == null) || (this.EsxAgentHostManager != null && this.EsxAgentHostManager.Equals(hostConfigManager_LinkedView.EsxAgentHostManager))) && ((this.IscsiManager == null && hostConfigManager_LinkedView.IscsiManager == null) || (this.IscsiManager != null && this.IscsiManager.Equals(hostConfigManager_LinkedView.IscsiManager))) && ((this.VFlashManager == null && hostConfigManager_LinkedView.VFlashManager == null) || (this.VFlashManager != null && this.VFlashManager.Equals(hostConfigManager_LinkedView.VFlashManager))) && ((this.VsanSystem == null && hostConfigManager_LinkedView.VsanSystem == null) || (this.VsanSystem != null && this.VsanSystem.Equals(hostConfigManager_LinkedView.VsanSystem))) && ((this.MessageBusProxy == null && hostConfigManager_LinkedView.MessageBusProxy == null) || (this.MessageBusProxy != null && this.MessageBusProxy.Equals(hostConfigManager_LinkedView.MessageBusProxy))) && ((this.UserDirectory == null && hostConfigManager_LinkedView.UserDirectory == null) || (this.UserDirectory != null && this.UserDirectory.Equals(hostConfigManager_LinkedView.UserDirectory))) && ((this.AccountManager == null && hostConfigManager_LinkedView.AccountManager == null) || (this.AccountManager != null && this.AccountManager.Equals(hostConfigManager_LinkedView.AccountManager))) && ((this.HostAccessManager == null && hostConfigManager_LinkedView.HostAccessManager == null) || (this.HostAccessManager != null && this.HostAccessManager.Equals(hostConfigManager_LinkedView.HostAccessManager))) && ((this.GraphicsManager == null && hostConfigManager_LinkedView.GraphicsManager == null) || (this.GraphicsManager != null && this.GraphicsManager.Equals(hostConfigManager_LinkedView.GraphicsManager))) && ((this.VsanInternalSystem == null && hostConfigManager_LinkedView.VsanInternalSystem == null) || (this.VsanInternalSystem != null && this.VsanInternalSystem.Equals(hostConfigManager_LinkedView.VsanInternalSystem))) && ((this.CertificateManager == null && hostConfigManager_LinkedView.CertificateManager == null) || (this.CertificateManager != null && this.CertificateManager.Equals(hostConfigManager_LinkedView.CertificateManager))) && ((this.CryptoManager == null && hostConfigManager_LinkedView.CryptoManager == null) || (this.CryptoManager != null && this.CryptoManager.Equals(hostConfigManager_LinkedView.CryptoManager))) && ((this.NvdimmSystem == null && hostConfigManager_LinkedView.NvdimmSystem == null) || (this.NvdimmSystem != null && this.NvdimmSystem.Equals(hostConfigManager_LinkedView.NvdimmSystem))));\n        }\n\n        public override bool Equals(object hostConfigManager_LinkedView)\n        {\n            return Equals(hostConfigManager_LinkedView as HostConfigManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CpuScheduler + \"_\" + DatastoreSystem + \"_\" + MemoryManager + \"_\" + StorageSystem + \"_\" + NetworkSystem + \"_\" + VmotionSystem + \"_\" + VirtualNicManager + \"_\" + ServiceSystem + \"_\" + FirewallSystem + \"_\" + AdvancedOption + \"_\" + DiagnosticSystem + \"_\" + AutoStartManager + \"_\" + SnmpSystem + \"_\" + DateTimeSystem + \"_\" + PatchManager + \"_\" + ImageConfigManager + \"_\" + BootDeviceSystem + \"_\" + FirmwareSystem + \"_\" + HealthStatusSystem + \"_\" + PciPassthruSystem + \"_\" + LicenseManager + \"_\" + KernelModuleSystem + \"_\" + AuthenticationManager + \"_\" + PowerSystem + \"_\" + CacheConfigurationManager + \"_\" + EsxAgentHostManager + \"_\" + IscsiManager + \"_\" + VFlashManager + \"_\" + VsanSystem + \"_\" + MessageBusProxy + \"_\" + UserDirectory + \"_\" + AccountManager + \"_\" + HostAccessManager + \"_\" + GraphicsManager + \"_\" + VsanInternalSystem + \"_\" + CertificateManager + \"_\" + CryptoManager + \"_\" + NvdimmSystem).GetHashCode();\n        }\n    }\n\n    public class HostConfigSpec : DynamicData, IEquatable<HostConfigSpec>\n    {\n        public HostNasVolumeConfig[] NasDatastore { get; set; }\n\n        public HostNetworkConfig Network { get; set; }\n\n        public HostVirtualNicManagerNicTypeSelection[] NicTypeSelection { get; set; }\n\n        public HostServiceConfig[] Service { get; set; }\n\n        public HostFirewallConfig Firewall { get; set; }\n\n        public OptionValue[] Option { get; set; }\n\n        public string DatastorePrincipal { get; set; }\n\n        public string DatastorePrincipalPasswd { get; set; }\n\n        public HostDateTimeConfig Datetime { get; set; }\n\n        public HostStorageDeviceInfo StorageDevice { get; set; }\n\n        public HostLicenseSpec License { get; set; }\n\n        public HostSecuritySpec Security { get; set; }\n\n        public HostAccountSpec[] UserAccount { get; set; }\n\n        public HostAccountSpec[] UsergroupAccount { get; set; }\n\n        public HostMemorySpec Memory { get; set; }\n\n        public HostActiveDirectory[] ActiveDirectory { get; set; }\n\n        public KeyAnyValue[] GenericConfig { get; set; }\n\n        public HostGraphicsConfig GraphicsConfig { get; set; }\n\n        public bool Equals(HostConfigSpec hostConfigSpec)\n        {\n            return (hostConfigSpec != null && ((this.NasDatastore == null && hostConfigSpec.NasDatastore == null) || (this.NasDatastore != null && hostConfigSpec.NasDatastore != null && Enumerable.SequenceEqual(this.NasDatastore, hostConfigSpec.NasDatastore))) && ((this.Network == null && hostConfigSpec.Network == null) || (this.Network != null && this.Network.Equals(hostConfigSpec.Network))) && ((this.NicTypeSelection == null && hostConfigSpec.NicTypeSelection == null) || (this.NicTypeSelection != null && hostConfigSpec.NicTypeSelection != null && Enumerable.SequenceEqual(this.NicTypeSelection, hostConfigSpec.NicTypeSelection))) && ((this.Service == null && hostConfigSpec.Service == null) || (this.Service != null && hostConfigSpec.Service != null && Enumerable.SequenceEqual(this.Service, hostConfigSpec.Service))) && ((this.Firewall == null && hostConfigSpec.Firewall == null) || (this.Firewall != null && this.Firewall.Equals(hostConfigSpec.Firewall))) && ((this.Option == null && hostConfigSpec.Option == null) || (this.Option != null && hostConfigSpec.Option != null && Enumerable.SequenceEqual(this.Option, hostConfigSpec.Option))) && this.DatastorePrincipal == hostConfigSpec.DatastorePrincipal && this.DatastorePrincipalPasswd == hostConfigSpec.DatastorePrincipalPasswd && ((this.Datetime == null && hostConfigSpec.Datetime == null) || (this.Datetime != null && this.Datetime.Equals(hostConfigSpec.Datetime))) && ((this.StorageDevice == null && hostConfigSpec.StorageDevice == null) || (this.StorageDevice != null && this.StorageDevice.Equals(hostConfigSpec.StorageDevice))) && ((this.License == null && hostConfigSpec.License == null) || (this.License != null && this.License.Equals(hostConfigSpec.License))) && ((this.Security == null && hostConfigSpec.Security == null) || (this.Security != null && this.Security.Equals(hostConfigSpec.Security))) && ((this.UserAccount == null && hostConfigSpec.UserAccount == null) || (this.UserAccount != null && hostConfigSpec.UserAccount != null && Enumerable.SequenceEqual(this.UserAccount, hostConfigSpec.UserAccount))) && ((this.UsergroupAccount == null && hostConfigSpec.UsergroupAccount == null) || (this.UsergroupAccount != null && hostConfigSpec.UsergroupAccount != null && Enumerable.SequenceEqual(this.UsergroupAccount, hostConfigSpec.UsergroupAccount))) && ((this.Memory == null && hostConfigSpec.Memory == null) || (this.Memory != null && this.Memory.Equals(hostConfigSpec.Memory))) && ((this.ActiveDirectory == null && hostConfigSpec.ActiveDirectory == null) || (this.ActiveDirectory != null && hostConfigSpec.ActiveDirectory != null && Enumerable.SequenceEqual(this.ActiveDirectory, hostConfigSpec.ActiveDirectory))) && ((this.GenericConfig == null && hostConfigSpec.GenericConfig == null) || (this.GenericConfig != null && hostConfigSpec.GenericConfig != null && Enumerable.SequenceEqual(this.GenericConfig, hostConfigSpec.GenericConfig))) && ((this.GraphicsConfig == null && hostConfigSpec.GraphicsConfig == null) || (this.GraphicsConfig != null && this.GraphicsConfig.Equals(hostConfigSpec.GraphicsConfig))));\n        }\n\n        public override bool Equals(object hostConfigSpec)\n        {\n            return Equals(hostConfigSpec as HostConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NasDatastore + \"_\" + Network + \"_\" + NicTypeSelection + \"_\" + Service + \"_\" + Firewall + \"_\" + Option + \"_\" + DatastorePrincipal + \"_\" + DatastorePrincipalPasswd + \"_\" + Datetime + \"_\" + StorageDevice + \"_\" + License + \"_\" + Security + \"_\" + UserAccount + \"_\" + UsergroupAccount + \"_\" + Memory + \"_\" + ActiveDirectory + \"_\" + GenericConfig + \"_\" + GraphicsConfig).GetHashCode();\n        }\n    }\n\n    public class HostConfigSummary : DynamicData, IEquatable<HostConfigSummary>\n    {\n        public string Name { get; set; }\n\n        public int Port { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public AboutInfo Product { get; set; }\n\n        public bool VmotionEnabled { get; set; }\n\n        public bool FaultToleranceEnabled { get; set; }\n\n        public HostFeatureVersionInfo[] FeatureVersion { get; set; }\n\n        public ManagedObjectReference AgentVmDatastore { get; set; }\n\n        public ManagedObjectReference AgentVmNetwork { get; set; }\n\n        public HostConfigSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostConfigSummary hostConfigSummary)\n        {\n            return (hostConfigSummary != null && this.Name == hostConfigSummary.Name && this.Port == hostConfigSummary.Port && this.SslThumbprint == hostConfigSummary.SslThumbprint && ((this.Product == null && hostConfigSummary.Product == null) || (this.Product != null && this.Product.Equals(hostConfigSummary.Product))) && this.VmotionEnabled == hostConfigSummary.VmotionEnabled && this.FaultToleranceEnabled == hostConfigSummary.FaultToleranceEnabled && ((this.FeatureVersion == null && hostConfigSummary.FeatureVersion == null) || (this.FeatureVersion != null && hostConfigSummary.FeatureVersion != null && Enumerable.SequenceEqual(this.FeatureVersion, hostConfigSummary.FeatureVersion))) && ((this.AgentVmDatastore == null && hostConfigSummary.AgentVmDatastore == null) || (this.AgentVmDatastore != null && this.AgentVmDatastore.Equals(hostConfigSummary.AgentVmDatastore))) && ((this.AgentVmNetwork == null && hostConfigSummary.AgentVmNetwork == null) || (this.AgentVmNetwork != null && this.AgentVmNetwork.Equals(hostConfigSummary.AgentVmNetwork))) && ((this.LinkedView == null && hostConfigSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostConfigSummary.LinkedView))));\n        }\n\n        public override bool Equals(object hostConfigSummary)\n        {\n            return Equals(hostConfigSummary as HostConfigSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Port + \"_\" + SslThumbprint + \"_\" + Product + \"_\" + VmotionEnabled + \"_\" + FaultToleranceEnabled + \"_\" + FeatureVersion + \"_\" + AgentVmDatastore + \"_\" + AgentVmNetwork + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostConfigSummary_LinkedView : IEquatable<HostConfigSummary_LinkedView>\n    {\n        public Datastore AgentVmDatastore { get; set; }\n\n        public Network AgentVmNetwork { get; set; }\n\n        public bool Equals(HostConfigSummary_LinkedView hostConfigSummary_LinkedView)\n        {\n            return (hostConfigSummary_LinkedView != null && ((this.AgentVmDatastore == null && hostConfigSummary_LinkedView.AgentVmDatastore == null) || (this.AgentVmDatastore != null && this.AgentVmDatastore.Equals(hostConfigSummary_LinkedView.AgentVmDatastore))) && ((this.AgentVmNetwork == null && hostConfigSummary_LinkedView.AgentVmNetwork == null) || (this.AgentVmNetwork != null && this.AgentVmNetwork.Equals(hostConfigSummary_LinkedView.AgentVmNetwork))));\n        }\n\n        public override bool Equals(object hostConfigSummary_LinkedView)\n        {\n            return Equals(hostConfigSummary_LinkedView as HostConfigSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AgentVmDatastore + \"_\" + AgentVmNetwork).GetHashCode();\n        }\n    }\n\n    public class HostConnectedEvent : HostEvent, IEquatable<HostConnectedEvent>\n    {\n        public bool Equals(HostConnectedEvent hostConnectedEvent)\n        {\n            return (hostConnectedEvent != null && base.Equals(hostConnectedEvent));\n        }\n\n        public override bool Equals(object hostConnectedEvent)\n        {\n            return Equals(hostConnectedEvent as HostConnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConnectFault : VimFault, IEquatable<HostConnectFault>\n    {\n        public bool Equals(HostConnectFault hostConnectFault)\n        {\n            return (hostConnectFault != null && base.Equals(hostConnectFault));\n        }\n\n        public override bool Equals(object hostConnectFault)\n        {\n            return Equals(hostConnectFault as HostConnectFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConnectInfo : DynamicData, IEquatable<HostConnectInfo>\n    {\n        public string ServerIp { get; set; }\n\n        public bool? InDasCluster { get; set; }\n\n        public HostListSummary Host { get; set; }\n\n        public VirtualMachineSummary[] Vm { get; set; }\n\n        public bool? VimAccountNameRequired { get; set; }\n\n        public bool? ClusterSupported { get; set; }\n\n        public HostConnectInfoNetworkInfo[] Network { get; set; }\n\n        public HostDatastoreConnectInfo[] Datastore { get; set; }\n\n        public HostLicenseConnectInfo License { get; set; }\n\n        public HostCapability Capability { get; set; }\n\n        public bool Equals(HostConnectInfo hostConnectInfo)\n        {\n            return (hostConnectInfo != null && this.ServerIp == hostConnectInfo.ServerIp && ((this.InDasCluster == null && hostConnectInfo.InDasCluster == null) || (this.InDasCluster != null && this.InDasCluster.Equals(hostConnectInfo.InDasCluster))) && ((this.Host == null && hostConnectInfo.Host == null) || (this.Host != null && this.Host.Equals(hostConnectInfo.Host))) && ((this.Vm == null && hostConnectInfo.Vm == null) || (this.Vm != null && hostConnectInfo.Vm != null && Enumerable.SequenceEqual(this.Vm, hostConnectInfo.Vm))) && ((this.VimAccountNameRequired == null && hostConnectInfo.VimAccountNameRequired == null) || (this.VimAccountNameRequired != null && this.VimAccountNameRequired.Equals(hostConnectInfo.VimAccountNameRequired))) && ((this.ClusterSupported == null && hostConnectInfo.ClusterSupported == null) || (this.ClusterSupported != null && this.ClusterSupported.Equals(hostConnectInfo.ClusterSupported))) && ((this.Network == null && hostConnectInfo.Network == null) || (this.Network != null && hostConnectInfo.Network != null && Enumerable.SequenceEqual(this.Network, hostConnectInfo.Network))) && ((this.Datastore == null && hostConnectInfo.Datastore == null) || (this.Datastore != null && hostConnectInfo.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostConnectInfo.Datastore))) && ((this.License == null && hostConnectInfo.License == null) || (this.License != null && this.License.Equals(hostConnectInfo.License))) && ((this.Capability == null && hostConnectInfo.Capability == null) || (this.Capability != null && this.Capability.Equals(hostConnectInfo.Capability))));\n        }\n\n        public override bool Equals(object hostConnectInfo)\n        {\n            return Equals(hostConnectInfo as HostConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerIp + \"_\" + InDasCluster + \"_\" + Host + \"_\" + Vm + \"_\" + VimAccountNameRequired + \"_\" + ClusterSupported + \"_\" + Network + \"_\" + Datastore + \"_\" + License + \"_\" + Capability).GetHashCode();\n        }\n    }\n\n    public class HostConnectInfoNetworkInfo : DynamicData, IEquatable<HostConnectInfoNetworkInfo>\n    {\n        public NetworkSummary Summary { get; set; }\n\n        public bool Equals(HostConnectInfoNetworkInfo hostConnectInfoNetworkInfo)\n        {\n            return (hostConnectInfoNetworkInfo != null && ((this.Summary == null && hostConnectInfoNetworkInfo.Summary == null) || (this.Summary != null && this.Summary.Equals(hostConnectInfoNetworkInfo.Summary))));\n        }\n\n        public override bool Equals(object hostConnectInfoNetworkInfo)\n        {\n            return Equals(hostConnectInfoNetworkInfo as HostConnectInfoNetworkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Summary).GetHashCode();\n        }\n    }\n\n    public class HostConnectionLostEvent : HostEvent, IEquatable<HostConnectionLostEvent>\n    {\n        public bool Equals(HostConnectionLostEvent hostConnectionLostEvent)\n        {\n            return (hostConnectionLostEvent != null && base.Equals(hostConnectionLostEvent));\n        }\n\n        public override bool Equals(object hostConnectionLostEvent)\n        {\n            return Equals(hostConnectionLostEvent as HostConnectionLostEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostConnectSpec : DynamicData, IEquatable<HostConnectSpec>\n    {\n        public string HostName { get; set; }\n\n        public int? Port { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public string UserName { get; set; }\n\n        public string Password { get; set; }\n\n        public ManagedObjectReference VmFolder { get; set; }\n\n        public bool Force { get; set; }\n\n        public string VimAccountName { get; set; }\n\n        public string VimAccountPassword { get; set; }\n\n        public string ManagementIp { get; set; }\n\n        public HostLockdownMode? LockdownMode { get; set; }\n\n        public HostGatewaySpec HostGateway { get; set; }\n\n        public HostConnectSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostConnectSpec hostConnectSpec)\n        {\n            return (hostConnectSpec != null && this.HostName == hostConnectSpec.HostName && ((this.Port == null && hostConnectSpec.Port == null) || (this.Port != null && this.Port.Equals(hostConnectSpec.Port))) && this.SslThumbprint == hostConnectSpec.SslThumbprint && this.UserName == hostConnectSpec.UserName && this.Password == hostConnectSpec.Password && ((this.VmFolder == null && hostConnectSpec.VmFolder == null) || (this.VmFolder != null && this.VmFolder.Equals(hostConnectSpec.VmFolder))) && this.Force == hostConnectSpec.Force && this.VimAccountName == hostConnectSpec.VimAccountName && this.VimAccountPassword == hostConnectSpec.VimAccountPassword && this.ManagementIp == hostConnectSpec.ManagementIp && ((this.LockdownMode == null && hostConnectSpec.LockdownMode == null) || (this.LockdownMode != null && this.LockdownMode.Equals(hostConnectSpec.LockdownMode))) && ((this.HostGateway == null && hostConnectSpec.HostGateway == null) || (this.HostGateway != null && this.HostGateway.Equals(hostConnectSpec.HostGateway))) && ((this.LinkedView == null && hostConnectSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostConnectSpec.LinkedView))));\n        }\n\n        public override bool Equals(object hostConnectSpec)\n        {\n            return Equals(hostConnectSpec as HostConnectSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Port + \"_\" + SslThumbprint + \"_\" + UserName + \"_\" + Password + \"_\" + VmFolder + \"_\" + Force + \"_\" + VimAccountName + \"_\" + VimAccountPassword + \"_\" + ManagementIp + \"_\" + LockdownMode + \"_\" + HostGateway + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostConnectSpec_LinkedView : IEquatable<HostConnectSpec_LinkedView>\n    {\n        public Folder VmFolder { get; set; }\n\n        public bool Equals(HostConnectSpec_LinkedView hostConnectSpec_LinkedView)\n        {\n            return (hostConnectSpec_LinkedView != null && ((this.VmFolder == null && hostConnectSpec_LinkedView.VmFolder == null) || (this.VmFolder != null && this.VmFolder.Equals(hostConnectSpec_LinkedView.VmFolder))));\n        }\n\n        public override bool Equals(object hostConnectSpec_LinkedView)\n        {\n            return Equals(hostConnectSpec_LinkedView as HostConnectSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmFolder).GetHashCode();\n        }\n    }\n\n    public class HostCpuIdInfo : DynamicData, IEquatable<HostCpuIdInfo>\n    {\n        public int Level { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Eax { get; set; }\n\n        public string Ebx { get; set; }\n\n        public string Ecx { get; set; }\n\n        public string Edx { get; set; }\n\n        public bool Equals(HostCpuIdInfo hostCpuIdInfo)\n        {\n            return (hostCpuIdInfo != null && this.Level == hostCpuIdInfo.Level && this.Vendor == hostCpuIdInfo.Vendor && this.Eax == hostCpuIdInfo.Eax && this.Ebx == hostCpuIdInfo.Ebx && this.Ecx == hostCpuIdInfo.Ecx && this.Edx == hostCpuIdInfo.Edx);\n        }\n\n        public override bool Equals(object hostCpuIdInfo)\n        {\n            return Equals(hostCpuIdInfo as HostCpuIdInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Level + \"_\" + Vendor + \"_\" + Eax + \"_\" + Ebx + \"_\" + Ecx + \"_\" + Edx).GetHashCode();\n        }\n    }\n\n    public class HostCpuInfo : DynamicData, IEquatable<HostCpuInfo>\n    {\n        public short NumCpuPackages { get; set; }\n\n        public short NumCpuCores { get; set; }\n\n        public short NumCpuThreads { get; set; }\n\n        public long Hz { get; set; }\n\n        public bool Equals(HostCpuInfo hostCpuInfo)\n        {\n            return (hostCpuInfo != null && this.NumCpuPackages == hostCpuInfo.NumCpuPackages && this.NumCpuCores == hostCpuInfo.NumCpuCores && this.NumCpuThreads == hostCpuInfo.NumCpuThreads && this.Hz == hostCpuInfo.Hz);\n        }\n\n        public override bool Equals(object hostCpuInfo)\n        {\n            return Equals(hostCpuInfo as HostCpuInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumCpuPackages + \"_\" + NumCpuCores + \"_\" + NumCpuThreads + \"_\" + Hz).GetHashCode();\n        }\n    }\n\n    public class HostCpuPackage : DynamicData, IEquatable<HostCpuPackage>\n    {\n        public short Index { get; set; }\n\n        public string Vendor { get; set; }\n\n        public long Hz { get; set; }\n\n        public long BusHz { get; set; }\n\n        public string Description { get; set; }\n\n        public short[] ThreadId { get; set; }\n\n        public HostCpuIdInfo[] CpuFeature { get; set; }\n\n        public bool Equals(HostCpuPackage hostCpuPackage)\n        {\n            return (hostCpuPackage != null && this.Index == hostCpuPackage.Index && this.Vendor == hostCpuPackage.Vendor && this.Hz == hostCpuPackage.Hz && this.BusHz == hostCpuPackage.BusHz && this.Description == hostCpuPackage.Description && ((this.ThreadId == null && hostCpuPackage.ThreadId == null) || (this.ThreadId != null && hostCpuPackage.ThreadId != null && Enumerable.SequenceEqual(this.ThreadId, hostCpuPackage.ThreadId))) && ((this.CpuFeature == null && hostCpuPackage.CpuFeature == null) || (this.CpuFeature != null && hostCpuPackage.CpuFeature != null && Enumerable.SequenceEqual(this.CpuFeature, hostCpuPackage.CpuFeature))));\n        }\n\n        public override bool Equals(object hostCpuPackage)\n        {\n            return Equals(hostCpuPackage as HostCpuPackage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Index + \"_\" + Vendor + \"_\" + Hz + \"_\" + BusHz + \"_\" + Description + \"_\" + ThreadId + \"_\" + CpuFeature).GetHashCode();\n        }\n    }\n\n    public class HostCpuPowerManagementInfo : DynamicData, IEquatable<HostCpuPowerManagementInfo>\n    {\n        public string CurrentPolicy { get; set; }\n\n        public string HardwareSupport { get; set; }\n\n        public bool Equals(HostCpuPowerManagementInfo hostCpuPowerManagementInfo)\n        {\n            return (hostCpuPowerManagementInfo != null && this.CurrentPolicy == hostCpuPowerManagementInfo.CurrentPolicy && this.HardwareSupport == hostCpuPowerManagementInfo.HardwareSupport);\n        }\n\n        public override bool Equals(object hostCpuPowerManagementInfo)\n        {\n            return Equals(hostCpuPowerManagementInfo as HostCpuPowerManagementInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentPolicy + \"_\" + HardwareSupport).GetHashCode();\n        }\n    }\n\n    public class HostCpuSchedulerSystem : ExtensibleManagedObject, IEquatable<HostCpuSchedulerSystem>\n    {\n        public HostHyperThreadScheduleInfo HyperthreadInfo { get; set; }\n\n        public void EnableHyperThreading()\n        {\n        }\n\n        public void DisableHyperThreading()\n        {\n        }\n\n        public bool Equals(HostCpuSchedulerSystem hostCpuSchedulerSystem)\n        {\n            return (hostCpuSchedulerSystem != null && ((this.HyperthreadInfo == null && hostCpuSchedulerSystem.HyperthreadInfo == null) || (this.HyperthreadInfo != null && this.HyperthreadInfo.Equals(hostCpuSchedulerSystem.HyperthreadInfo))));\n        }\n\n        public override bool Equals(object hostCpuSchedulerSystem)\n        {\n            return Equals(hostCpuSchedulerSystem as HostCpuSchedulerSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HyperthreadInfo).GetHashCode();\n        }\n    }\n\n    public class HostDasDisabledEvent : HostEvent, IEquatable<HostDasDisabledEvent>\n    {\n        public bool Equals(HostDasDisabledEvent hostDasDisabledEvent)\n        {\n            return (hostDasDisabledEvent != null && base.Equals(hostDasDisabledEvent));\n        }\n\n        public override bool Equals(object hostDasDisabledEvent)\n        {\n            return Equals(hostDasDisabledEvent as HostDasDisabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDasDisablingEvent : HostEvent, IEquatable<HostDasDisablingEvent>\n    {\n        public bool Equals(HostDasDisablingEvent hostDasDisablingEvent)\n        {\n            return (hostDasDisablingEvent != null && base.Equals(hostDasDisablingEvent));\n        }\n\n        public override bool Equals(object hostDasDisablingEvent)\n        {\n            return Equals(hostDasDisablingEvent as HostDasDisablingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDasEnabledEvent : HostEvent, IEquatable<HostDasEnabledEvent>\n    {\n        public bool Equals(HostDasEnabledEvent hostDasEnabledEvent)\n        {\n            return (hostDasEnabledEvent != null && base.Equals(hostDasEnabledEvent));\n        }\n\n        public override bool Equals(object hostDasEnabledEvent)\n        {\n            return Equals(hostDasEnabledEvent as HostDasEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDasEnablingEvent : HostEvent, IEquatable<HostDasEnablingEvent>\n    {\n        public bool Equals(HostDasEnablingEvent hostDasEnablingEvent)\n        {\n            return (hostDasEnablingEvent != null && base.Equals(hostDasEnablingEvent));\n        }\n\n        public override bool Equals(object hostDasEnablingEvent)\n        {\n            return Equals(hostDasEnablingEvent as HostDasEnablingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDasErrorEvent : HostEvent, IEquatable<HostDasErrorEvent>\n    {\n        public string Message { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(HostDasErrorEvent hostDasErrorEvent)\n        {\n            return (hostDasErrorEvent != null && this.Message == hostDasErrorEvent.Message && this.Reason == hostDasErrorEvent.Reason);\n        }\n\n        public override bool Equals(object hostDasErrorEvent)\n        {\n            return Equals(hostDasErrorEvent as HostDasErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class HostDasEvent : HostEvent, IEquatable<HostDasEvent>\n    {\n        public bool Equals(HostDasEvent hostDasEvent)\n        {\n            return (hostDasEvent != null && base.Equals(hostDasEvent));\n        }\n\n        public override bool Equals(object hostDasEvent)\n        {\n            return Equals(hostDasEvent as HostDasEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDasOkEvent : HostEvent, IEquatable<HostDasOkEvent>\n    {\n        public bool Equals(HostDasOkEvent hostDasOkEvent)\n        {\n            return (hostDasOkEvent != null && base.Equals(hostDasOkEvent));\n        }\n\n        public override bool Equals(object hostDasOkEvent)\n        {\n            return Equals(hostDasOkEvent as HostDasOkEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDatastoreBrowser : ViewBase, IEquatable<HostDatastoreBrowser>\n    {\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public FileQuery[] SupportedType { get; set; }\n\n        public HostDatastoreBrowser_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference SearchDatastore_Task(string datastorePath, HostDatastoreBrowserSearchSpec searchSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostDatastoreBrowserSearchResults SearchDatastore(string datastorePath, HostDatastoreBrowserSearchSpec searchSpec)\n        {\n            return default(HostDatastoreBrowserSearchResults);\n        }\n\n        public ManagedObjectReference SearchDatastoreSubFolders_Task(string datastorePath, HostDatastoreBrowserSearchSpec searchSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostDatastoreBrowserSearchResults[] SearchDatastoreSubFolders(string datastorePath, HostDatastoreBrowserSearchSpec searchSpec)\n        {\n            return default(HostDatastoreBrowserSearchResults[]);\n        }\n\n        public void DeleteFile(string datastorePath)\n        {\n        }\n\n        public bool Equals(HostDatastoreBrowser hostDatastoreBrowser)\n        {\n            return (hostDatastoreBrowser != null && ((this.Datastore == null && hostDatastoreBrowser.Datastore == null) || (this.Datastore != null && hostDatastoreBrowser.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostDatastoreBrowser.Datastore))) && ((this.SupportedType == null && hostDatastoreBrowser.SupportedType == null) || (this.SupportedType != null && hostDatastoreBrowser.SupportedType != null && Enumerable.SequenceEqual(this.SupportedType, hostDatastoreBrowser.SupportedType))) && ((this.LinkedView == null && hostDatastoreBrowser.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostDatastoreBrowser.LinkedView))));\n        }\n\n        public override bool Equals(object hostDatastoreBrowser)\n        {\n            return Equals(hostDatastoreBrowser as HostDatastoreBrowser);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + SupportedType + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreBrowser_LinkedView : IEquatable<HostDatastoreBrowser_LinkedView>\n    {\n        public Datastore[] Datastore { get; set; }\n\n        public bool Equals(HostDatastoreBrowser_LinkedView hostDatastoreBrowser_LinkedView)\n        {\n            return (hostDatastoreBrowser_LinkedView != null && ((this.Datastore == null && hostDatastoreBrowser_LinkedView.Datastore == null) || (this.Datastore != null && hostDatastoreBrowser_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostDatastoreBrowser_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object hostDatastoreBrowser_LinkedView)\n        {\n            return Equals(hostDatastoreBrowser_LinkedView as HostDatastoreBrowser_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreBrowserSearchResults : DynamicData, IEquatable<HostDatastoreBrowserSearchResults>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string FolderPath { get; set; }\n\n        public FileInfo[] File { get; set; }\n\n        public HostDatastoreBrowserSearchResults_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostDatastoreBrowserSearchResults hostDatastoreBrowserSearchResults)\n        {\n            return (hostDatastoreBrowserSearchResults != null && ((this.Datastore == null && hostDatastoreBrowserSearchResults.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(hostDatastoreBrowserSearchResults.Datastore))) && this.FolderPath == hostDatastoreBrowserSearchResults.FolderPath && ((this.File == null && hostDatastoreBrowserSearchResults.File == null) || (this.File != null && hostDatastoreBrowserSearchResults.File != null && Enumerable.SequenceEqual(this.File, hostDatastoreBrowserSearchResults.File))) && ((this.LinkedView == null && hostDatastoreBrowserSearchResults.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostDatastoreBrowserSearchResults.LinkedView))));\n        }\n\n        public override bool Equals(object hostDatastoreBrowserSearchResults)\n        {\n            return Equals(hostDatastoreBrowserSearchResults as HostDatastoreBrowserSearchResults);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + FolderPath + \"_\" + File + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreBrowserSearchResults_LinkedView : IEquatable<HostDatastoreBrowserSearchResults_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(HostDatastoreBrowserSearchResults_LinkedView hostDatastoreBrowserSearchResults_LinkedView)\n        {\n            return (hostDatastoreBrowserSearchResults_LinkedView != null && ((this.Datastore == null && hostDatastoreBrowserSearchResults_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(hostDatastoreBrowserSearchResults_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object hostDatastoreBrowserSearchResults_LinkedView)\n        {\n            return Equals(hostDatastoreBrowserSearchResults_LinkedView as HostDatastoreBrowserSearchResults_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreBrowserSearchSpec : DynamicData, IEquatable<HostDatastoreBrowserSearchSpec>\n    {\n        public FileQuery[] Query { get; set; }\n\n        public FileQueryFlags Details { get; set; }\n\n        public bool? SearchCaseInsensitive { get; set; }\n\n        public string[] MatchPattern { get; set; }\n\n        public bool? SortFoldersFirst { get; set; }\n\n        public bool Equals(HostDatastoreBrowserSearchSpec hostDatastoreBrowserSearchSpec)\n        {\n            return (hostDatastoreBrowserSearchSpec != null && ((this.Query == null && hostDatastoreBrowserSearchSpec.Query == null) || (this.Query != null && hostDatastoreBrowserSearchSpec.Query != null && Enumerable.SequenceEqual(this.Query, hostDatastoreBrowserSearchSpec.Query))) && ((this.Details == null && hostDatastoreBrowserSearchSpec.Details == null) || (this.Details != null && this.Details.Equals(hostDatastoreBrowserSearchSpec.Details))) && ((this.SearchCaseInsensitive == null && hostDatastoreBrowserSearchSpec.SearchCaseInsensitive == null) || (this.SearchCaseInsensitive != null && this.SearchCaseInsensitive.Equals(hostDatastoreBrowserSearchSpec.SearchCaseInsensitive))) && ((this.MatchPattern == null && hostDatastoreBrowserSearchSpec.MatchPattern == null) || (this.MatchPattern != null && hostDatastoreBrowserSearchSpec.MatchPattern != null && Enumerable.SequenceEqual(this.MatchPattern, hostDatastoreBrowserSearchSpec.MatchPattern))) && ((this.SortFoldersFirst == null && hostDatastoreBrowserSearchSpec.SortFoldersFirst == null) || (this.SortFoldersFirst != null && this.SortFoldersFirst.Equals(hostDatastoreBrowserSearchSpec.SortFoldersFirst))));\n        }\n\n        public override bool Equals(object hostDatastoreBrowserSearchSpec)\n        {\n            return Equals(hostDatastoreBrowserSearchSpec as HostDatastoreBrowserSearchSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Query + \"_\" + Details + \"_\" + SearchCaseInsensitive + \"_\" + MatchPattern + \"_\" + SortFoldersFirst).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreConnectInfo : DynamicData, IEquatable<HostDatastoreConnectInfo>\n    {\n        public DatastoreSummary Summary { get; set; }\n\n        public bool Equals(HostDatastoreConnectInfo hostDatastoreConnectInfo)\n        {\n            return (hostDatastoreConnectInfo != null && ((this.Summary == null && hostDatastoreConnectInfo.Summary == null) || (this.Summary != null && this.Summary.Equals(hostDatastoreConnectInfo.Summary))));\n        }\n\n        public override bool Equals(object hostDatastoreConnectInfo)\n        {\n            return Equals(hostDatastoreConnectInfo as HostDatastoreConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Summary).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreExistsConnectInfo : HostDatastoreConnectInfo, IEquatable<HostDatastoreExistsConnectInfo>\n    {\n        public string NewDatastoreName { get; set; }\n\n        public bool Equals(HostDatastoreExistsConnectInfo hostDatastoreExistsConnectInfo)\n        {\n            return (hostDatastoreExistsConnectInfo != null && this.NewDatastoreName == hostDatastoreExistsConnectInfo.NewDatastoreName);\n        }\n\n        public override bool Equals(object hostDatastoreExistsConnectInfo)\n        {\n            return Equals(hostDatastoreExistsConnectInfo as HostDatastoreExistsConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NewDatastoreName).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreNameConflictConnectInfo : HostDatastoreConnectInfo, IEquatable<HostDatastoreNameConflictConnectInfo>\n    {\n        public string NewDatastoreName { get; set; }\n\n        public bool Equals(HostDatastoreNameConflictConnectInfo hostDatastoreNameConflictConnectInfo)\n        {\n            return (hostDatastoreNameConflictConnectInfo != null && this.NewDatastoreName == hostDatastoreNameConflictConnectInfo.NewDatastoreName);\n        }\n\n        public override bool Equals(object hostDatastoreNameConflictConnectInfo)\n        {\n            return Equals(hostDatastoreNameConflictConnectInfo as HostDatastoreNameConflictConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NewDatastoreName).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreSystem : ViewBase, IEquatable<HostDatastoreSystem>\n    {\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public HostDatastoreSystemCapabilities Capabilities { get; set; }\n\n        public HostDatastoreSystem_LinkedView LinkedView { get; set; }\n\n        public void UpdateLocalSwapDatastore(ManagedObjectReference datastore)\n        {\n        }\n\n        public HostScsiDisk[] QueryAvailableDisksForVmfs(ManagedObjectReference datastore)\n        {\n            return default(HostScsiDisk[]);\n        }\n\n        public VmfsDatastoreOption[] QueryVmfsDatastoreCreateOptions(string devicePath, int? vmfsMajorVersion)\n        {\n            return default(VmfsDatastoreOption[]);\n        }\n\n        public ManagedObjectReference CreateVmfsDatastore(VmfsDatastoreCreateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VmfsDatastoreOption[] QueryVmfsDatastoreExtendOptions(ManagedObjectReference datastore, string devicePath, bool? suppressExpandCandidates)\n        {\n            return default(VmfsDatastoreOption[]);\n        }\n\n        public VmfsDatastoreOption[] QueryVmfsDatastoreExpandOptions(ManagedObjectReference datastore)\n        {\n            return default(VmfsDatastoreOption[]);\n        }\n\n        public ManagedObjectReference ExtendVmfsDatastore(ManagedObjectReference datastore, VmfsDatastoreExtendSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference ExpandVmfsDatastore(ManagedObjectReference datastore, VmfsDatastoreExpandSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateNasDatastore(HostNasVolumeSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateLocalDatastore(string name, string path)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateVvolDatastore(HostDatastoreSystemVvolDatastoreSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RemoveDatastore(ManagedObjectReference datastore)\n        {\n        }\n\n        public ManagedObjectReference RemoveDatastoreEx_Task(ManagedObjectReference[] datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostDatastoreSystemDatastoreResult[] RemoveDatastoreEx(ManagedObjectReference[] datastore)\n        {\n            return default(HostDatastoreSystemDatastoreResult[]);\n        }\n\n        public void ConfigureDatastorePrincipal(string userName, string password)\n        {\n        }\n\n        public HostUnresolvedVmfsVolume[] QueryUnresolvedVmfsVolumes()\n        {\n            return default(HostUnresolvedVmfsVolume[]);\n        }\n\n        public ManagedObjectReference ResignatureUnresolvedVmfsVolume_Task(HostUnresolvedVmfsResignatureSpec resolutionSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostResignatureRescanResult ResignatureUnresolvedVmfsVolume(HostUnresolvedVmfsResignatureSpec resolutionSpec)\n        {\n            return default(HostResignatureRescanResult);\n        }\n\n        public bool Equals(HostDatastoreSystem hostDatastoreSystem)\n        {\n            return (hostDatastoreSystem != null && ((this.Datastore == null && hostDatastoreSystem.Datastore == null) || (this.Datastore != null && hostDatastoreSystem.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostDatastoreSystem.Datastore))) && ((this.Capabilities == null && hostDatastoreSystem.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(hostDatastoreSystem.Capabilities))) && ((this.LinkedView == null && hostDatastoreSystem.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostDatastoreSystem.LinkedView))));\n        }\n\n        public override bool Equals(object hostDatastoreSystem)\n        {\n            return Equals(hostDatastoreSystem as HostDatastoreSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Capabilities + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreSystem_LinkedView : IEquatable<HostDatastoreSystem_LinkedView>\n    {\n        public Datastore[] Datastore { get; set; }\n\n        public bool Equals(HostDatastoreSystem_LinkedView hostDatastoreSystem_LinkedView)\n        {\n            return (hostDatastoreSystem_LinkedView != null && ((this.Datastore == null && hostDatastoreSystem_LinkedView.Datastore == null) || (this.Datastore != null && hostDatastoreSystem_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostDatastoreSystem_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object hostDatastoreSystem_LinkedView)\n        {\n            return Equals(hostDatastoreSystem_LinkedView as HostDatastoreSystem_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreSystemCapabilities : DynamicData, IEquatable<HostDatastoreSystemCapabilities>\n    {\n        public bool NfsMountCreationRequired { get; set; }\n\n        public bool NfsMountCreationSupported { get; set; }\n\n        public bool LocalDatastoreSupported { get; set; }\n\n        public bool VmfsExtentExpansionSupported { get; set; }\n\n        public bool Equals(HostDatastoreSystemCapabilities hostDatastoreSystemCapabilities)\n        {\n            return (hostDatastoreSystemCapabilities != null && this.NfsMountCreationRequired == hostDatastoreSystemCapabilities.NfsMountCreationRequired && this.NfsMountCreationSupported == hostDatastoreSystemCapabilities.NfsMountCreationSupported && this.LocalDatastoreSupported == hostDatastoreSystemCapabilities.LocalDatastoreSupported && this.VmfsExtentExpansionSupported == hostDatastoreSystemCapabilities.VmfsExtentExpansionSupported);\n        }\n\n        public override bool Equals(object hostDatastoreSystemCapabilities)\n        {\n            return Equals(hostDatastoreSystemCapabilities as HostDatastoreSystemCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NfsMountCreationRequired + \"_\" + NfsMountCreationSupported + \"_\" + LocalDatastoreSupported + \"_\" + VmfsExtentExpansionSupported).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreSystemDatastoreResult : DynamicData, IEquatable<HostDatastoreSystemDatastoreResult>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public HostDatastoreSystemDatastoreResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostDatastoreSystemDatastoreResult hostDatastoreSystemDatastoreResult)\n        {\n            return (hostDatastoreSystemDatastoreResult != null && ((this.Key == null && hostDatastoreSystemDatastoreResult.Key == null) || (this.Key != null && this.Key.Equals(hostDatastoreSystemDatastoreResult.Key))) && ((this.Fault == null && hostDatastoreSystemDatastoreResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostDatastoreSystemDatastoreResult.Fault))) && ((this.LinkedView == null && hostDatastoreSystemDatastoreResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostDatastoreSystemDatastoreResult.LinkedView))));\n        }\n\n        public override bool Equals(object hostDatastoreSystemDatastoreResult)\n        {\n            return Equals(hostDatastoreSystemDatastoreResult as HostDatastoreSystemDatastoreResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreSystemDatastoreResult_LinkedView : IEquatable<HostDatastoreSystemDatastoreResult_LinkedView>\n    {\n        public Datastore Key { get; set; }\n\n        public bool Equals(HostDatastoreSystemDatastoreResult_LinkedView hostDatastoreSystemDatastoreResult_LinkedView)\n        {\n            return (hostDatastoreSystemDatastoreResult_LinkedView != null && ((this.Key == null && hostDatastoreSystemDatastoreResult_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(hostDatastoreSystemDatastoreResult_LinkedView.Key))));\n        }\n\n        public override bool Equals(object hostDatastoreSystemDatastoreResult_LinkedView)\n        {\n            return Equals(hostDatastoreSystemDatastoreResult_LinkedView as HostDatastoreSystemDatastoreResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class HostDatastoreSystemVvolDatastoreSpec : DynamicData, IEquatable<HostDatastoreSystemVvolDatastoreSpec>\n    {\n        public string Name { get; set; }\n\n        public string ScId { get; set; }\n\n        public bool Equals(HostDatastoreSystemVvolDatastoreSpec hostDatastoreSystemVvolDatastoreSpec)\n        {\n            return (hostDatastoreSystemVvolDatastoreSpec != null && this.Name == hostDatastoreSystemVvolDatastoreSpec.Name && this.ScId == hostDatastoreSystemVvolDatastoreSpec.ScId);\n        }\n\n        public override bool Equals(object hostDatastoreSystemVvolDatastoreSpec)\n        {\n            return Equals(hostDatastoreSystemVvolDatastoreSpec as HostDatastoreSystemVvolDatastoreSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + ScId).GetHashCode();\n        }\n    }\n\n    public class HostDateTimeConfig : DynamicData, IEquatable<HostDateTimeConfig>\n    {\n        public string TimeZone { get; set; }\n\n        public HostNtpConfig NtpConfig { get; set; }\n\n        public bool Equals(HostDateTimeConfig hostDateTimeConfig)\n        {\n            return (hostDateTimeConfig != null && this.TimeZone == hostDateTimeConfig.TimeZone && ((this.NtpConfig == null && hostDateTimeConfig.NtpConfig == null) || (this.NtpConfig != null && this.NtpConfig.Equals(hostDateTimeConfig.NtpConfig))));\n        }\n\n        public override bool Equals(object hostDateTimeConfig)\n        {\n            return Equals(hostDateTimeConfig as HostDateTimeConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TimeZone + \"_\" + NtpConfig).GetHashCode();\n        }\n    }\n\n    public class HostDateTimeInfo : DynamicData, IEquatable<HostDateTimeInfo>\n    {\n        public HostDateTimeSystemTimeZone TimeZone { get; set; }\n\n        public HostNtpConfig NtpConfig { get; set; }\n\n        public bool Equals(HostDateTimeInfo hostDateTimeInfo)\n        {\n            return (hostDateTimeInfo != null && ((this.TimeZone == null && hostDateTimeInfo.TimeZone == null) || (this.TimeZone != null && this.TimeZone.Equals(hostDateTimeInfo.TimeZone))) && ((this.NtpConfig == null && hostDateTimeInfo.NtpConfig == null) || (this.NtpConfig != null && this.NtpConfig.Equals(hostDateTimeInfo.NtpConfig))));\n        }\n\n        public override bool Equals(object hostDateTimeInfo)\n        {\n            return Equals(hostDateTimeInfo as HostDateTimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TimeZone + \"_\" + NtpConfig).GetHashCode();\n        }\n    }\n\n    public class HostDateTimeSystem : ViewBase, IEquatable<HostDateTimeSystem>\n    {\n        public HostDateTimeInfo DateTimeInfo { get; set; }\n\n        public void UpdateDateTimeConfig(HostDateTimeConfig config)\n        {\n        }\n\n        public HostDateTimeSystemTimeZone[] QueryAvailableTimeZones()\n        {\n            return default(HostDateTimeSystemTimeZone[]);\n        }\n\n        public DateTime QueryDateTime()\n        {\n            return default(DateTime);\n        }\n\n        public void UpdateDateTime(DateTime dateTime)\n        {\n        }\n\n        public void RefreshDateTimeSystem()\n        {\n        }\n\n        public bool Equals(HostDateTimeSystem hostDateTimeSystem)\n        {\n            return (hostDateTimeSystem != null && ((this.DateTimeInfo == null && hostDateTimeSystem.DateTimeInfo == null) || (this.DateTimeInfo != null && this.DateTimeInfo.Equals(hostDateTimeSystem.DateTimeInfo))));\n        }\n\n        public override bool Equals(object hostDateTimeSystem)\n        {\n            return Equals(hostDateTimeSystem as HostDateTimeSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DateTimeInfo).GetHashCode();\n        }\n    }\n\n    public class HostDateTimeSystemTimeZone : DynamicData, IEquatable<HostDateTimeSystemTimeZone>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public int GmtOffset { get; set; }\n\n        public bool Equals(HostDateTimeSystemTimeZone hostDateTimeSystemTimeZone)\n        {\n            return (hostDateTimeSystemTimeZone != null && this.Key == hostDateTimeSystemTimeZone.Key && this.Name == hostDateTimeSystemTimeZone.Name && this.Description == hostDateTimeSystemTimeZone.Description && this.GmtOffset == hostDateTimeSystemTimeZone.GmtOffset);\n        }\n\n        public override bool Equals(object hostDateTimeSystemTimeZone)\n        {\n            return Equals(hostDateTimeSystemTimeZone as HostDateTimeSystemTimeZone);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Description + \"_\" + GmtOffset).GetHashCode();\n        }\n    }\n\n    public class HostDeploymentInfo : DynamicData, IEquatable<HostDeploymentInfo>\n    {\n        public bool? BootedFromStatelessCache { get; set; }\n\n        public bool Equals(HostDeploymentInfo hostDeploymentInfo)\n        {\n            return (hostDeploymentInfo != null && ((this.BootedFromStatelessCache == null && hostDeploymentInfo.BootedFromStatelessCache == null) || (this.BootedFromStatelessCache != null && this.BootedFromStatelessCache.Equals(hostDeploymentInfo.BootedFromStatelessCache))));\n        }\n\n        public override bool Equals(object hostDeploymentInfo)\n        {\n            return Equals(hostDeploymentInfo as HostDeploymentInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BootedFromStatelessCache).GetHashCode();\n        }\n    }\n\n    public class HostDevice : DynamicData, IEquatable<HostDevice>\n    {\n        public string DeviceName { get; set; }\n\n        public string DeviceType { get; set; }\n\n        public bool Equals(HostDevice hostDevice)\n        {\n            return (hostDevice != null && this.DeviceName == hostDevice.DeviceName && this.DeviceType == hostDevice.DeviceType);\n        }\n\n        public override bool Equals(object hostDevice)\n        {\n            return Equals(hostDevice as HostDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceName + \"_\" + DeviceType).GetHashCode();\n        }\n    }\n\n    public class HostDhcpService : DynamicData, IEquatable<HostDhcpService>\n    {\n        public string Key { get; set; }\n\n        public HostDhcpServiceSpec Spec { get; set; }\n\n        public bool Equals(HostDhcpService hostDhcpService)\n        {\n            return (hostDhcpService != null && this.Key == hostDhcpService.Key && ((this.Spec == null && hostDhcpService.Spec == null) || (this.Spec != null && this.Spec.Equals(hostDhcpService.Spec))));\n        }\n\n        public override bool Equals(object hostDhcpService)\n        {\n            return Equals(hostDhcpService as HostDhcpService);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostDhcpServiceConfig : DynamicData, IEquatable<HostDhcpServiceConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public string Key { get; set; }\n\n        public HostDhcpServiceSpec Spec { get; set; }\n\n        public bool Equals(HostDhcpServiceConfig hostDhcpServiceConfig)\n        {\n            return (hostDhcpServiceConfig != null && this.ChangeOperation == hostDhcpServiceConfig.ChangeOperation && this.Key == hostDhcpServiceConfig.Key && ((this.Spec == null && hostDhcpServiceConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostDhcpServiceConfig.Spec))));\n        }\n\n        public override bool Equals(object hostDhcpServiceConfig)\n        {\n            return Equals(hostDhcpServiceConfig as HostDhcpServiceConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Key + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostDhcpServiceSpec : DynamicData, IEquatable<HostDhcpServiceSpec>\n    {\n        public string VirtualSwitch { get; set; }\n\n        public int DefaultLeaseDuration { get; set; }\n\n        public string LeaseBeginIp { get; set; }\n\n        public string LeaseEndIp { get; set; }\n\n        public int MaxLeaseDuration { get; set; }\n\n        public bool UnlimitedLease { get; set; }\n\n        public string IpSubnetAddr { get; set; }\n\n        public string IpSubnetMask { get; set; }\n\n        public bool Equals(HostDhcpServiceSpec hostDhcpServiceSpec)\n        {\n            return (hostDhcpServiceSpec != null && this.VirtualSwitch == hostDhcpServiceSpec.VirtualSwitch && this.DefaultLeaseDuration == hostDhcpServiceSpec.DefaultLeaseDuration && this.LeaseBeginIp == hostDhcpServiceSpec.LeaseBeginIp && this.LeaseEndIp == hostDhcpServiceSpec.LeaseEndIp && this.MaxLeaseDuration == hostDhcpServiceSpec.MaxLeaseDuration && this.UnlimitedLease == hostDhcpServiceSpec.UnlimitedLease && this.IpSubnetAddr == hostDhcpServiceSpec.IpSubnetAddr && this.IpSubnetMask == hostDhcpServiceSpec.IpSubnetMask);\n        }\n\n        public override bool Equals(object hostDhcpServiceSpec)\n        {\n            return Equals(hostDhcpServiceSpec as HostDhcpServiceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualSwitch + \"_\" + DefaultLeaseDuration + \"_\" + LeaseBeginIp + \"_\" + LeaseEndIp + \"_\" + MaxLeaseDuration + \"_\" + UnlimitedLease + \"_\" + IpSubnetAddr + \"_\" + IpSubnetMask).GetHashCode();\n        }\n    }\n\n    public class HostDiagnosticPartition : DynamicData, IEquatable<HostDiagnosticPartition>\n    {\n        public string StorageType { get; set; }\n\n        public string DiagnosticType { get; set; }\n\n        public int Slots { get; set; }\n\n        public HostScsiDiskPartition Id { get; set; }\n\n        public bool Equals(HostDiagnosticPartition hostDiagnosticPartition)\n        {\n            return (hostDiagnosticPartition != null && this.StorageType == hostDiagnosticPartition.StorageType && this.DiagnosticType == hostDiagnosticPartition.DiagnosticType && this.Slots == hostDiagnosticPartition.Slots && ((this.Id == null && hostDiagnosticPartition.Id == null) || (this.Id != null && this.Id.Equals(hostDiagnosticPartition.Id))));\n        }\n\n        public override bool Equals(object hostDiagnosticPartition)\n        {\n            return Equals(hostDiagnosticPartition as HostDiagnosticPartition);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StorageType + \"_\" + DiagnosticType + \"_\" + Slots + \"_\" + Id).GetHashCode();\n        }\n    }\n\n    public class HostDiagnosticPartitionCreateDescription : DynamicData, IEquatable<HostDiagnosticPartitionCreateDescription>\n    {\n        public HostDiskPartitionLayout Layout { get; set; }\n\n        public string DiskUuid { get; set; }\n\n        public HostDiagnosticPartitionCreateSpec Spec { get; set; }\n\n        public bool Equals(HostDiagnosticPartitionCreateDescription hostDiagnosticPartitionCreateDescription)\n        {\n            return (hostDiagnosticPartitionCreateDescription != null && ((this.Layout == null && hostDiagnosticPartitionCreateDescription.Layout == null) || (this.Layout != null && this.Layout.Equals(hostDiagnosticPartitionCreateDescription.Layout))) && this.DiskUuid == hostDiagnosticPartitionCreateDescription.DiskUuid && ((this.Spec == null && hostDiagnosticPartitionCreateDescription.Spec == null) || (this.Spec != null && this.Spec.Equals(hostDiagnosticPartitionCreateDescription.Spec))));\n        }\n\n        public override bool Equals(object hostDiagnosticPartitionCreateDescription)\n        {\n            return Equals(hostDiagnosticPartitionCreateDescription as HostDiagnosticPartitionCreateDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Layout + \"_\" + DiskUuid + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostDiagnosticPartitionCreateOption : DynamicData, IEquatable<HostDiagnosticPartitionCreateOption>\n    {\n        public string StorageType { get; set; }\n\n        public string DiagnosticType { get; set; }\n\n        public HostScsiDisk Disk { get; set; }\n\n        public bool Equals(HostDiagnosticPartitionCreateOption hostDiagnosticPartitionCreateOption)\n        {\n            return (hostDiagnosticPartitionCreateOption != null && this.StorageType == hostDiagnosticPartitionCreateOption.StorageType && this.DiagnosticType == hostDiagnosticPartitionCreateOption.DiagnosticType && ((this.Disk == null && hostDiagnosticPartitionCreateOption.Disk == null) || (this.Disk != null && this.Disk.Equals(hostDiagnosticPartitionCreateOption.Disk))));\n        }\n\n        public override bool Equals(object hostDiagnosticPartitionCreateOption)\n        {\n            return Equals(hostDiagnosticPartitionCreateOption as HostDiagnosticPartitionCreateOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StorageType + \"_\" + DiagnosticType + \"_\" + Disk).GetHashCode();\n        }\n    }\n\n    public class HostDiagnosticPartitionCreateSpec : DynamicData, IEquatable<HostDiagnosticPartitionCreateSpec>\n    {\n        public string StorageType { get; set; }\n\n        public string DiagnosticType { get; set; }\n\n        public HostScsiDiskPartition Id { get; set; }\n\n        public HostDiskPartitionSpec Partition { get; set; }\n\n        public bool? Active { get; set; }\n\n        public bool Equals(HostDiagnosticPartitionCreateSpec hostDiagnosticPartitionCreateSpec)\n        {\n            return (hostDiagnosticPartitionCreateSpec != null && this.StorageType == hostDiagnosticPartitionCreateSpec.StorageType && this.DiagnosticType == hostDiagnosticPartitionCreateSpec.DiagnosticType && ((this.Id == null && hostDiagnosticPartitionCreateSpec.Id == null) || (this.Id != null && this.Id.Equals(hostDiagnosticPartitionCreateSpec.Id))) && ((this.Partition == null && hostDiagnosticPartitionCreateSpec.Partition == null) || (this.Partition != null && this.Partition.Equals(hostDiagnosticPartitionCreateSpec.Partition))) && ((this.Active == null && hostDiagnosticPartitionCreateSpec.Active == null) || (this.Active != null && this.Active.Equals(hostDiagnosticPartitionCreateSpec.Active))));\n        }\n\n        public override bool Equals(object hostDiagnosticPartitionCreateSpec)\n        {\n            return Equals(hostDiagnosticPartitionCreateSpec as HostDiagnosticPartitionCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StorageType + \"_\" + DiagnosticType + \"_\" + Id + \"_\" + Partition + \"_\" + Active).GetHashCode();\n        }\n    }\n\n    public class HostDiagnosticSystem : ViewBase, IEquatable<HostDiagnosticSystem>\n    {\n        public HostDiagnosticPartition ActivePartition { get; set; }\n\n        public HostDiagnosticPartition[] QueryAvailablePartition()\n        {\n            return default(HostDiagnosticPartition[]);\n        }\n\n        public void SelectActivePartition(HostScsiDiskPartition partition)\n        {\n        }\n\n        public HostDiagnosticPartitionCreateOption[] QueryPartitionCreateOptions(string storageType, string diagnosticType)\n        {\n            return default(HostDiagnosticPartitionCreateOption[]);\n        }\n\n        public HostDiagnosticPartitionCreateDescription QueryPartitionCreateDesc(string diskUuid, string diagnosticType)\n        {\n            return default(HostDiagnosticPartitionCreateDescription);\n        }\n\n        public void CreateDiagnosticPartition(HostDiagnosticPartitionCreateSpec spec)\n        {\n        }\n\n        public bool Equals(HostDiagnosticSystem hostDiagnosticSystem)\n        {\n            return (hostDiagnosticSystem != null && ((this.ActivePartition == null && hostDiagnosticSystem.ActivePartition == null) || (this.ActivePartition != null && this.ActivePartition.Equals(hostDiagnosticSystem.ActivePartition))));\n        }\n\n        public override bool Equals(object hostDiagnosticSystem)\n        {\n            return Equals(hostDiagnosticSystem as HostDiagnosticSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActivePartition).GetHashCode();\n        }\n    }\n\n    public class HostDigestInfo : DynamicData, IEquatable<HostDigestInfo>\n    {\n        public string DigestMethod { get; set; }\n\n        public sbyte[] DigestValue { get; set; }\n\n        public string ObjectName { get; set; }\n\n        public bool Equals(HostDigestInfo hostDigestInfo)\n        {\n            return (hostDigestInfo != null && this.DigestMethod == hostDigestInfo.DigestMethod && ((this.DigestValue == null && hostDigestInfo.DigestValue == null) || (this.DigestValue != null && hostDigestInfo.DigestValue != null && Enumerable.SequenceEqual(this.DigestValue, hostDigestInfo.DigestValue))) && this.ObjectName == hostDigestInfo.ObjectName);\n        }\n\n        public override bool Equals(object hostDigestInfo)\n        {\n            return Equals(hostDigestInfo as HostDigestInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DigestMethod + \"_\" + DigestValue + \"_\" + ObjectName).GetHashCode();\n        }\n    }\n\n    public class HostDirectoryStore : HostAuthenticationStore, IEquatable<HostDirectoryStore>\n    {\n        public bool Equals(HostDirectoryStore hostDirectoryStore)\n        {\n            return (hostDirectoryStore != null && base.Equals(hostDirectoryStore));\n        }\n\n        public override bool Equals(object hostDirectoryStore)\n        {\n            return Equals(hostDirectoryStore as HostDirectoryStore);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDirectoryStoreInfo : HostAuthenticationStoreInfo, IEquatable<HostDirectoryStoreInfo>\n    {\n        public bool Equals(HostDirectoryStoreInfo hostDirectoryStoreInfo)\n        {\n            return (hostDirectoryStoreInfo != null && base.Equals(hostDirectoryStoreInfo));\n        }\n\n        public override bool Equals(object hostDirectoryStoreInfo)\n        {\n            return Equals(hostDirectoryStoreInfo as HostDirectoryStoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDisconnectedEvent : HostEvent, IEquatable<HostDisconnectedEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(HostDisconnectedEvent hostDisconnectedEvent)\n        {\n            return (hostDisconnectedEvent != null && this.Reason == hostDisconnectedEvent.Reason);\n        }\n\n        public override bool Equals(object hostDisconnectedEvent)\n        {\n            return Equals(hostDisconnectedEvent as HostDisconnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class HostDiskConfigurationResult : DynamicData, IEquatable<HostDiskConfigurationResult>\n    {\n        public string DevicePath { get; set; }\n\n        public bool? Success { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(HostDiskConfigurationResult hostDiskConfigurationResult)\n        {\n            return (hostDiskConfigurationResult != null && this.DevicePath == hostDiskConfigurationResult.DevicePath && ((this.Success == null && hostDiskConfigurationResult.Success == null) || (this.Success != null && this.Success.Equals(hostDiskConfigurationResult.Success))) && ((this.Fault == null && hostDiskConfigurationResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostDiskConfigurationResult.Fault))));\n        }\n\n        public override bool Equals(object hostDiskConfigurationResult)\n        {\n            return Equals(hostDiskConfigurationResult as HostDiskConfigurationResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DevicePath + \"_\" + Success + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class HostDiskDimensions : DynamicData, IEquatable<HostDiskDimensions>\n    {\n        public bool Equals(HostDiskDimensions hostDiskDimensions)\n        {\n            return (hostDiskDimensions != null && base.Equals(hostDiskDimensions));\n        }\n\n        public override bool Equals(object hostDiskDimensions)\n        {\n            return Equals(hostDiskDimensions as HostDiskDimensions);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostDiskDimensionsChs : DynamicData, IEquatable<HostDiskDimensionsChs>\n    {\n        public long Cylinder { get; set; }\n\n        public int Head { get; set; }\n\n        public int Sector { get; set; }\n\n        public bool Equals(HostDiskDimensionsChs hostDiskDimensionsChs)\n        {\n            return (hostDiskDimensionsChs != null && this.Cylinder == hostDiskDimensionsChs.Cylinder && this.Head == hostDiskDimensionsChs.Head && this.Sector == hostDiskDimensionsChs.Sector);\n        }\n\n        public override bool Equals(object hostDiskDimensionsChs)\n        {\n            return Equals(hostDiskDimensionsChs as HostDiskDimensionsChs);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Cylinder + \"_\" + Head + \"_\" + Sector).GetHashCode();\n        }\n    }\n\n    public class HostDiskDimensionsLba : DynamicData, IEquatable<HostDiskDimensionsLba>\n    {\n        public int BlockSize { get; set; }\n\n        public long Block { get; set; }\n\n        public bool Equals(HostDiskDimensionsLba hostDiskDimensionsLba)\n        {\n            return (hostDiskDimensionsLba != null && this.BlockSize == hostDiskDimensionsLba.BlockSize && this.Block == hostDiskDimensionsLba.Block);\n        }\n\n        public override bool Equals(object hostDiskDimensionsLba)\n        {\n            return Equals(hostDiskDimensionsLba as HostDiskDimensionsLba);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BlockSize + \"_\" + Block).GetHashCode();\n        }\n    }\n\n    public class HostDiskMappingInfo : DynamicData, IEquatable<HostDiskMappingInfo>\n    {\n        public HostDiskMappingPartitionInfo PhysicalPartition { get; set; }\n\n        public string Name { get; set; }\n\n        public bool? Exclusive { get; set; }\n\n        public bool Equals(HostDiskMappingInfo hostDiskMappingInfo)\n        {\n            return (hostDiskMappingInfo != null && ((this.PhysicalPartition == null && hostDiskMappingInfo.PhysicalPartition == null) || (this.PhysicalPartition != null && this.PhysicalPartition.Equals(hostDiskMappingInfo.PhysicalPartition))) && this.Name == hostDiskMappingInfo.Name && ((this.Exclusive == null && hostDiskMappingInfo.Exclusive == null) || (this.Exclusive != null && this.Exclusive.Equals(hostDiskMappingInfo.Exclusive))));\n        }\n\n        public override bool Equals(object hostDiskMappingInfo)\n        {\n            return Equals(hostDiskMappingInfo as HostDiskMappingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PhysicalPartition + \"_\" + Name + \"_\" + Exclusive).GetHashCode();\n        }\n    }\n\n    public class HostDiskMappingOption : DynamicData, IEquatable<HostDiskMappingOption>\n    {\n        public HostDiskMappingPartitionOption[] PhysicalPartition { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(HostDiskMappingOption hostDiskMappingOption)\n        {\n            return (hostDiskMappingOption != null && ((this.PhysicalPartition == null && hostDiskMappingOption.PhysicalPartition == null) || (this.PhysicalPartition != null && hostDiskMappingOption.PhysicalPartition != null && Enumerable.SequenceEqual(this.PhysicalPartition, hostDiskMappingOption.PhysicalPartition))) && this.Name == hostDiskMappingOption.Name);\n        }\n\n        public override bool Equals(object hostDiskMappingOption)\n        {\n            return Equals(hostDiskMappingOption as HostDiskMappingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PhysicalPartition + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class HostDiskMappingPartitionInfo : DynamicData, IEquatable<HostDiskMappingPartitionInfo>\n    {\n        public string Name { get; set; }\n\n        public string FileSystem { get; set; }\n\n        public long CapacityInKb { get; set; }\n\n        public bool Equals(HostDiskMappingPartitionInfo hostDiskMappingPartitionInfo)\n        {\n            return (hostDiskMappingPartitionInfo != null && this.Name == hostDiskMappingPartitionInfo.Name && this.FileSystem == hostDiskMappingPartitionInfo.FileSystem && this.CapacityInKb == hostDiskMappingPartitionInfo.CapacityInKb);\n        }\n\n        public override bool Equals(object hostDiskMappingPartitionInfo)\n        {\n            return Equals(hostDiskMappingPartitionInfo as HostDiskMappingPartitionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + FileSystem + \"_\" + CapacityInKb).GetHashCode();\n        }\n    }\n\n    public class HostDiskMappingPartitionOption : DynamicData, IEquatable<HostDiskMappingPartitionOption>\n    {\n        public string Name { get; set; }\n\n        public string FileSystem { get; set; }\n\n        public long CapacityInKb { get; set; }\n\n        public bool Equals(HostDiskMappingPartitionOption hostDiskMappingPartitionOption)\n        {\n            return (hostDiskMappingPartitionOption != null && this.Name == hostDiskMappingPartitionOption.Name && this.FileSystem == hostDiskMappingPartitionOption.FileSystem && this.CapacityInKb == hostDiskMappingPartitionOption.CapacityInKb);\n        }\n\n        public override bool Equals(object hostDiskMappingPartitionOption)\n        {\n            return Equals(hostDiskMappingPartitionOption as HostDiskMappingPartitionOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + FileSystem + \"_\" + CapacityInKb).GetHashCode();\n        }\n    }\n\n    public class HostDiskPartitionAttributes : DynamicData, IEquatable<HostDiskPartitionAttributes>\n    {\n        public int Partition { get; set; }\n\n        public long StartSector { get; set; }\n\n        public long EndSector { get; set; }\n\n        public string Type { get; set; }\n\n        public string Guid { get; set; }\n\n        public bool Logical { get; set; }\n\n        public sbyte Attributes { get; set; }\n\n        public long? PartitionAlignment { get; set; }\n\n        public bool Equals(HostDiskPartitionAttributes hostDiskPartitionAttributes)\n        {\n            return (hostDiskPartitionAttributes != null && this.Partition == hostDiskPartitionAttributes.Partition && this.StartSector == hostDiskPartitionAttributes.StartSector && this.EndSector == hostDiskPartitionAttributes.EndSector && this.Type == hostDiskPartitionAttributes.Type && this.Guid == hostDiskPartitionAttributes.Guid && this.Logical == hostDiskPartitionAttributes.Logical && this.Attributes == hostDiskPartitionAttributes.Attributes && ((this.PartitionAlignment == null && hostDiskPartitionAttributes.PartitionAlignment == null) || (this.PartitionAlignment != null && this.PartitionAlignment.Equals(hostDiskPartitionAttributes.PartitionAlignment))));\n        }\n\n        public override bool Equals(object hostDiskPartitionAttributes)\n        {\n            return Equals(hostDiskPartitionAttributes as HostDiskPartitionAttributes);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partition + \"_\" + StartSector + \"_\" + EndSector + \"_\" + Type + \"_\" + Guid + \"_\" + Logical + \"_\" + Attributes + \"_\" + PartitionAlignment).GetHashCode();\n        }\n    }\n\n    public class HostDiskPartitionBlockRange : DynamicData, IEquatable<HostDiskPartitionBlockRange>\n    {\n        public int? Partition { get; set; }\n\n        public string Type { get; set; }\n\n        public HostDiskDimensionsLba Start { get; set; }\n\n        public HostDiskDimensionsLba End { get; set; }\n\n        public bool Equals(HostDiskPartitionBlockRange hostDiskPartitionBlockRange)\n        {\n            return (hostDiskPartitionBlockRange != null && ((this.Partition == null && hostDiskPartitionBlockRange.Partition == null) || (this.Partition != null && this.Partition.Equals(hostDiskPartitionBlockRange.Partition))) && this.Type == hostDiskPartitionBlockRange.Type && ((this.Start == null && hostDiskPartitionBlockRange.Start == null) || (this.Start != null && this.Start.Equals(hostDiskPartitionBlockRange.Start))) && ((this.End == null && hostDiskPartitionBlockRange.End == null) || (this.End != null && this.End.Equals(hostDiskPartitionBlockRange.End))));\n        }\n\n        public override bool Equals(object hostDiskPartitionBlockRange)\n        {\n            return Equals(hostDiskPartitionBlockRange as HostDiskPartitionBlockRange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partition + \"_\" + Type + \"_\" + Start + \"_\" + End).GetHashCode();\n        }\n    }\n\n    public class HostDiskPartitionInfo : DynamicData, IEquatable<HostDiskPartitionInfo>\n    {\n        public string DeviceName { get; set; }\n\n        public HostDiskPartitionSpec Spec { get; set; }\n\n        public HostDiskPartitionLayout Layout { get; set; }\n\n        public bool Equals(HostDiskPartitionInfo hostDiskPartitionInfo)\n        {\n            return (hostDiskPartitionInfo != null && this.DeviceName == hostDiskPartitionInfo.DeviceName && ((this.Spec == null && hostDiskPartitionInfo.Spec == null) || (this.Spec != null && this.Spec.Equals(hostDiskPartitionInfo.Spec))) && ((this.Layout == null && hostDiskPartitionInfo.Layout == null) || (this.Layout != null && this.Layout.Equals(hostDiskPartitionInfo.Layout))));\n        }\n\n        public override bool Equals(object hostDiskPartitionInfo)\n        {\n            return Equals(hostDiskPartitionInfo as HostDiskPartitionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceName + \"_\" + Spec + \"_\" + Layout).GetHashCode();\n        }\n    }\n\n    public class HostDiskPartitionLayout : DynamicData, IEquatable<HostDiskPartitionLayout>\n    {\n        public HostDiskDimensionsLba Total { get; set; }\n\n        public HostDiskPartitionBlockRange[] Partition { get; set; }\n\n        public bool Equals(HostDiskPartitionLayout hostDiskPartitionLayout)\n        {\n            return (hostDiskPartitionLayout != null && ((this.Total == null && hostDiskPartitionLayout.Total == null) || (this.Total != null && this.Total.Equals(hostDiskPartitionLayout.Total))) && ((this.Partition == null && hostDiskPartitionLayout.Partition == null) || (this.Partition != null && hostDiskPartitionLayout.Partition != null && Enumerable.SequenceEqual(this.Partition, hostDiskPartitionLayout.Partition))));\n        }\n\n        public override bool Equals(object hostDiskPartitionLayout)\n        {\n            return Equals(hostDiskPartitionLayout as HostDiskPartitionLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Total + \"_\" + Partition).GetHashCode();\n        }\n    }\n\n    public class HostDiskPartitionSpec : DynamicData, IEquatable<HostDiskPartitionSpec>\n    {\n        public string PartitionFormat { get; set; }\n\n        public HostDiskDimensionsChs Chs { get; set; }\n\n        public long? TotalSectors { get; set; }\n\n        public HostDiskPartitionAttributes[] Partition { get; set; }\n\n        public bool Equals(HostDiskPartitionSpec hostDiskPartitionSpec)\n        {\n            return (hostDiskPartitionSpec != null && this.PartitionFormat == hostDiskPartitionSpec.PartitionFormat && ((this.Chs == null && hostDiskPartitionSpec.Chs == null) || (this.Chs != null && this.Chs.Equals(hostDiskPartitionSpec.Chs))) && ((this.TotalSectors == null && hostDiskPartitionSpec.TotalSectors == null) || (this.TotalSectors != null && this.TotalSectors.Equals(hostDiskPartitionSpec.TotalSectors))) && ((this.Partition == null && hostDiskPartitionSpec.Partition == null) || (this.Partition != null && hostDiskPartitionSpec.Partition != null && Enumerable.SequenceEqual(this.Partition, hostDiskPartitionSpec.Partition))));\n        }\n\n        public override bool Equals(object hostDiskPartitionSpec)\n        {\n            return Equals(hostDiskPartitionSpec as HostDiskPartitionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PartitionFormat + \"_\" + Chs + \"_\" + TotalSectors + \"_\" + Partition).GetHashCode();\n        }\n    }\n\n    public class HostDnsConfig : DynamicData, IEquatable<HostDnsConfig>\n    {\n        public bool Dhcp { get; set; }\n\n        public string VirtualNicDevice { get; set; }\n\n        public string Ipv6VirtualNicDevice { get; set; }\n\n        public string HostName { get; set; }\n\n        public string DomainName { get; set; }\n\n        public string[] Address { get; set; }\n\n        public string[] SearchDomain { get; set; }\n\n        public bool Equals(HostDnsConfig hostDnsConfig)\n        {\n            return (hostDnsConfig != null && this.Dhcp == hostDnsConfig.Dhcp && this.VirtualNicDevice == hostDnsConfig.VirtualNicDevice && this.Ipv6VirtualNicDevice == hostDnsConfig.Ipv6VirtualNicDevice && this.HostName == hostDnsConfig.HostName && this.DomainName == hostDnsConfig.DomainName && ((this.Address == null && hostDnsConfig.Address == null) || (this.Address != null && hostDnsConfig.Address != null && Enumerable.SequenceEqual(this.Address, hostDnsConfig.Address))) && ((this.SearchDomain == null && hostDnsConfig.SearchDomain == null) || (this.SearchDomain != null && hostDnsConfig.SearchDomain != null && Enumerable.SequenceEqual(this.SearchDomain, hostDnsConfig.SearchDomain))));\n        }\n\n        public override bool Equals(object hostDnsConfig)\n        {\n            return Equals(hostDnsConfig as HostDnsConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Dhcp + \"_\" + VirtualNicDevice + \"_\" + Ipv6VirtualNicDevice + \"_\" + HostName + \"_\" + DomainName + \"_\" + Address + \"_\" + SearchDomain).GetHashCode();\n        }\n    }\n\n    public class HostDnsConfigSpec : HostDnsConfig, IEquatable<HostDnsConfigSpec>\n    {\n        public HostVirtualNicConnection VirtualNicConnection { get; set; }\n\n        public HostVirtualNicConnection VirtualNicConnectionV6 { get; set; }\n\n        public bool Equals(HostDnsConfigSpec hostDnsConfigSpec)\n        {\n            return (hostDnsConfigSpec != null && ((this.VirtualNicConnection == null && hostDnsConfigSpec.VirtualNicConnection == null) || (this.VirtualNicConnection != null && this.VirtualNicConnection.Equals(hostDnsConfigSpec.VirtualNicConnection))) && ((this.VirtualNicConnectionV6 == null && hostDnsConfigSpec.VirtualNicConnectionV6 == null) || (this.VirtualNicConnectionV6 != null && this.VirtualNicConnectionV6.Equals(hostDnsConfigSpec.VirtualNicConnectionV6))));\n        }\n\n        public override bool Equals(object hostDnsConfigSpec)\n        {\n            return Equals(hostDnsConfigSpec as HostDnsConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualNicConnection + \"_\" + VirtualNicConnectionV6).GetHashCode();\n        }\n    }\n\n    public class HostEnableAdminFailedEvent : HostEvent, IEquatable<HostEnableAdminFailedEvent>\n    {\n        public Permission[] Permissions { get; set; }\n\n        public bool Equals(HostEnableAdminFailedEvent hostEnableAdminFailedEvent)\n        {\n            return (hostEnableAdminFailedEvent != null && ((this.Permissions == null && hostEnableAdminFailedEvent.Permissions == null) || (this.Permissions != null && hostEnableAdminFailedEvent.Permissions != null && Enumerable.SequenceEqual(this.Permissions, hostEnableAdminFailedEvent.Permissions))));\n        }\n\n        public override bool Equals(object hostEnableAdminFailedEvent)\n        {\n            return Equals(hostEnableAdminFailedEvent as HostEnableAdminFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Permissions).GetHashCode();\n        }\n    }\n\n    public class HostEnterMaintenanceResult : DynamicData, IEquatable<HostEnterMaintenanceResult>\n    {\n        public FaultsByVM[] VmFaults { get; set; }\n\n        public FaultsByHost[] HostFaults { get; set; }\n\n        public bool Equals(HostEnterMaintenanceResult hostEnterMaintenanceResult)\n        {\n            return (hostEnterMaintenanceResult != null && ((this.VmFaults == null && hostEnterMaintenanceResult.VmFaults == null) || (this.VmFaults != null && hostEnterMaintenanceResult.VmFaults != null && Enumerable.SequenceEqual(this.VmFaults, hostEnterMaintenanceResult.VmFaults))) && ((this.HostFaults == null && hostEnterMaintenanceResult.HostFaults == null) || (this.HostFaults != null && hostEnterMaintenanceResult.HostFaults != null && Enumerable.SequenceEqual(this.HostFaults, hostEnterMaintenanceResult.HostFaults))));\n        }\n\n        public override bool Equals(object hostEnterMaintenanceResult)\n        {\n            return Equals(hostEnterMaintenanceResult as HostEnterMaintenanceResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmFaults + \"_\" + HostFaults).GetHashCode();\n        }\n    }\n\n    public class HostEsxAgentHostManager : ViewBase, IEquatable<HostEsxAgentHostManager>\n    {\n        public HostEsxAgentHostManagerConfigInfo ConfigInfo { get; set; }\n\n        public void EsxAgentHostManagerUpdateConfig(HostEsxAgentHostManagerConfigInfo configInfo)\n        {\n        }\n\n        public bool Equals(HostEsxAgentHostManager hostEsxAgentHostManager)\n        {\n            return (hostEsxAgentHostManager != null && ((this.ConfigInfo == null && hostEsxAgentHostManager.ConfigInfo == null) || (this.ConfigInfo != null && this.ConfigInfo.Equals(hostEsxAgentHostManager.ConfigInfo))));\n        }\n\n        public override bool Equals(object hostEsxAgentHostManager)\n        {\n            return Equals(hostEsxAgentHostManager as HostEsxAgentHostManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigInfo).GetHashCode();\n        }\n    }\n\n    public class HostEsxAgentHostManagerConfigInfo : DynamicData, IEquatable<HostEsxAgentHostManagerConfigInfo>\n    {\n        public ManagedObjectReference AgentVmDatastore { get; set; }\n\n        public ManagedObjectReference AgentVmNetwork { get; set; }\n\n        public HostEsxAgentHostManagerConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostEsxAgentHostManagerConfigInfo hostEsxAgentHostManagerConfigInfo)\n        {\n            return (hostEsxAgentHostManagerConfigInfo != null && ((this.AgentVmDatastore == null && hostEsxAgentHostManagerConfigInfo.AgentVmDatastore == null) || (this.AgentVmDatastore != null && this.AgentVmDatastore.Equals(hostEsxAgentHostManagerConfigInfo.AgentVmDatastore))) && ((this.AgentVmNetwork == null && hostEsxAgentHostManagerConfigInfo.AgentVmNetwork == null) || (this.AgentVmNetwork != null && this.AgentVmNetwork.Equals(hostEsxAgentHostManagerConfigInfo.AgentVmNetwork))) && ((this.LinkedView == null && hostEsxAgentHostManagerConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostEsxAgentHostManagerConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object hostEsxAgentHostManagerConfigInfo)\n        {\n            return Equals(hostEsxAgentHostManagerConfigInfo as HostEsxAgentHostManagerConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AgentVmDatastore + \"_\" + AgentVmNetwork + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostEsxAgentHostManagerConfigInfo_LinkedView : IEquatable<HostEsxAgentHostManagerConfigInfo_LinkedView>\n    {\n        public Datastore AgentVmDatastore { get; set; }\n\n        public Network AgentVmNetwork { get; set; }\n\n        public bool Equals(HostEsxAgentHostManagerConfigInfo_LinkedView hostEsxAgentHostManagerConfigInfo_LinkedView)\n        {\n            return (hostEsxAgentHostManagerConfigInfo_LinkedView != null && ((this.AgentVmDatastore == null && hostEsxAgentHostManagerConfigInfo_LinkedView.AgentVmDatastore == null) || (this.AgentVmDatastore != null && this.AgentVmDatastore.Equals(hostEsxAgentHostManagerConfigInfo_LinkedView.AgentVmDatastore))) && ((this.AgentVmNetwork == null && hostEsxAgentHostManagerConfigInfo_LinkedView.AgentVmNetwork == null) || (this.AgentVmNetwork != null && this.AgentVmNetwork.Equals(hostEsxAgentHostManagerConfigInfo_LinkedView.AgentVmNetwork))));\n        }\n\n        public override bool Equals(object hostEsxAgentHostManagerConfigInfo_LinkedView)\n        {\n            return Equals(hostEsxAgentHostManagerConfigInfo_LinkedView as HostEsxAgentHostManagerConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AgentVmDatastore + \"_\" + AgentVmNetwork).GetHashCode();\n        }\n    }\n\n    public class HostEvent : Event, IEquatable<HostEvent>\n    {\n        public bool Equals(HostEvent hostEvent)\n        {\n            return (hostEvent != null && base.Equals(hostEvent));\n        }\n\n        public override bool Equals(object hostEvent)\n        {\n            return Equals(hostEvent as HostEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostEventArgument : EntityEventArgument, IEquatable<HostEventArgument>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public HostEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostEventArgument hostEventArgument)\n        {\n            return (hostEventArgument != null && ((this.Host == null && hostEventArgument.Host == null) || (this.Host != null && this.Host.Equals(hostEventArgument.Host))) && ((this.LinkedView == null && hostEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object hostEventArgument)\n        {\n            return Equals(hostEventArgument as HostEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostEventArgument_LinkedView : IEquatable<HostEventArgument_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostEventArgument_LinkedView hostEventArgument_LinkedView)\n        {\n            return (hostEventArgument_LinkedView != null && ((this.Host == null && hostEventArgument_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostEventArgument_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostEventArgument_LinkedView)\n        {\n            return Equals(hostEventArgument_LinkedView as HostEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostExtraNetworksEvent : HostDasEvent, IEquatable<HostExtraNetworksEvent>\n    {\n        public string Ips { get; set; }\n\n        public bool Equals(HostExtraNetworksEvent hostExtraNetworksEvent)\n        {\n            return (hostExtraNetworksEvent != null && this.Ips == hostExtraNetworksEvent.Ips);\n        }\n\n        public override bool Equals(object hostExtraNetworksEvent)\n        {\n            return Equals(hostExtraNetworksEvent as HostExtraNetworksEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ips).GetHashCode();\n        }\n    }\n\n    public class HostFaultToleranceManagerComponentHealthInfo : DynamicData, IEquatable<HostFaultToleranceManagerComponentHealthInfo>\n    {\n        public bool IsStorageHealthy { get; set; }\n\n        public bool IsNetworkHealthy { get; set; }\n\n        public bool Equals(HostFaultToleranceManagerComponentHealthInfo hostFaultToleranceManagerComponentHealthInfo)\n        {\n            return (hostFaultToleranceManagerComponentHealthInfo != null && this.IsStorageHealthy == hostFaultToleranceManagerComponentHealthInfo.IsStorageHealthy && this.IsNetworkHealthy == hostFaultToleranceManagerComponentHealthInfo.IsNetworkHealthy);\n        }\n\n        public override bool Equals(object hostFaultToleranceManagerComponentHealthInfo)\n        {\n            return Equals(hostFaultToleranceManagerComponentHealthInfo as HostFaultToleranceManagerComponentHealthInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsStorageHealthy + \"_\" + IsNetworkHealthy).GetHashCode();\n        }\n    }\n\n    public class HostFeatureCapability : DynamicData, IEquatable<HostFeatureCapability>\n    {\n        public string Key { get; set; }\n\n        public string FeatureName { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(HostFeatureCapability hostFeatureCapability)\n        {\n            return (hostFeatureCapability != null && this.Key == hostFeatureCapability.Key && this.FeatureName == hostFeatureCapability.FeatureName && this.Value == hostFeatureCapability.Value);\n        }\n\n        public override bool Equals(object hostFeatureCapability)\n        {\n            return Equals(hostFeatureCapability as HostFeatureCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + FeatureName + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class HostFeatureMask : DynamicData, IEquatable<HostFeatureMask>\n    {\n        public string Key { get; set; }\n\n        public string FeatureName { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(HostFeatureMask hostFeatureMask)\n        {\n            return (hostFeatureMask != null && this.Key == hostFeatureMask.Key && this.FeatureName == hostFeatureMask.FeatureName && this.Value == hostFeatureMask.Value);\n        }\n\n        public override bool Equals(object hostFeatureMask)\n        {\n            return Equals(hostFeatureMask as HostFeatureMask);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + FeatureName + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class HostFeatureVersionInfo : DynamicData, IEquatable<HostFeatureVersionInfo>\n    {\n        public string Key { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(HostFeatureVersionInfo hostFeatureVersionInfo)\n        {\n            return (hostFeatureVersionInfo != null && this.Key == hostFeatureVersionInfo.Key && this.Value == hostFeatureVersionInfo.Value);\n        }\n\n        public override bool Equals(object hostFeatureVersionInfo)\n        {\n            return Equals(hostFeatureVersionInfo as HostFeatureVersionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class HostFibreChannelHba : HostHostBusAdapter, IEquatable<HostFibreChannelHba>\n    {\n        public long PortWorldWideName { get; set; }\n\n        public long NodeWorldWideName { get; set; }\n\n        public FibreChannelPortType PortType { get; set; }\n\n        public long Speed { get; set; }\n\n        public bool Equals(HostFibreChannelHba hostFibreChannelHba)\n        {\n            return (hostFibreChannelHba != null && this.PortWorldWideName == hostFibreChannelHba.PortWorldWideName && this.NodeWorldWideName == hostFibreChannelHba.NodeWorldWideName && this.PortType == hostFibreChannelHba.PortType && this.Speed == hostFibreChannelHba.Speed);\n        }\n\n        public override bool Equals(object hostFibreChannelHba)\n        {\n            return Equals(hostFibreChannelHba as HostFibreChannelHba);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortWorldWideName + \"_\" + NodeWorldWideName + \"_\" + PortType + \"_\" + Speed).GetHashCode();\n        }\n    }\n\n    public class HostFibreChannelOverEthernetHba : HostFibreChannelHba, IEquatable<HostFibreChannelOverEthernetHba>\n    {\n        public string UnderlyingNic { get; set; }\n\n        public HostFibreChannelOverEthernetHbaLinkInfo LinkInfo { get; set; }\n\n        public bool IsSoftwareFcoe { get; set; }\n\n        public bool MarkedForRemoval { get; set; }\n\n        public bool Equals(HostFibreChannelOverEthernetHba hostFibreChannelOverEthernetHba)\n        {\n            return (hostFibreChannelOverEthernetHba != null && this.UnderlyingNic == hostFibreChannelOverEthernetHba.UnderlyingNic && ((this.LinkInfo == null && hostFibreChannelOverEthernetHba.LinkInfo == null) || (this.LinkInfo != null && this.LinkInfo.Equals(hostFibreChannelOverEthernetHba.LinkInfo))) && this.IsSoftwareFcoe == hostFibreChannelOverEthernetHba.IsSoftwareFcoe && this.MarkedForRemoval == hostFibreChannelOverEthernetHba.MarkedForRemoval);\n        }\n\n        public override bool Equals(object hostFibreChannelOverEthernetHba)\n        {\n            return Equals(hostFibreChannelOverEthernetHba as HostFibreChannelOverEthernetHba);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UnderlyingNic + \"_\" + LinkInfo + \"_\" + IsSoftwareFcoe + \"_\" + MarkedForRemoval).GetHashCode();\n        }\n    }\n\n    public class HostFibreChannelOverEthernetHbaLinkInfo : DynamicData, IEquatable<HostFibreChannelOverEthernetHbaLinkInfo>\n    {\n        public string VnportMac { get; set; }\n\n        public string FcfMac { get; set; }\n\n        public int VlanId { get; set; }\n\n        public bool Equals(HostFibreChannelOverEthernetHbaLinkInfo hostFibreChannelOverEthernetHbaLinkInfo)\n        {\n            return (hostFibreChannelOverEthernetHbaLinkInfo != null && this.VnportMac == hostFibreChannelOverEthernetHbaLinkInfo.VnportMac && this.FcfMac == hostFibreChannelOverEthernetHbaLinkInfo.FcfMac && this.VlanId == hostFibreChannelOverEthernetHbaLinkInfo.VlanId);\n        }\n\n        public override bool Equals(object hostFibreChannelOverEthernetHbaLinkInfo)\n        {\n            return Equals(hostFibreChannelOverEthernetHbaLinkInfo as HostFibreChannelOverEthernetHbaLinkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnportMac + \"_\" + FcfMac + \"_\" + VlanId).GetHashCode();\n        }\n    }\n\n    public class HostFibreChannelOverEthernetTargetTransport : HostFibreChannelTargetTransport, IEquatable<HostFibreChannelOverEthernetTargetTransport>\n    {\n        public string VnportMac { get; set; }\n\n        public string FcfMac { get; set; }\n\n        public int VlanId { get; set; }\n\n        public bool Equals(HostFibreChannelOverEthernetTargetTransport hostFibreChannelOverEthernetTargetTransport)\n        {\n            return (hostFibreChannelOverEthernetTargetTransport != null && this.VnportMac == hostFibreChannelOverEthernetTargetTransport.VnportMac && this.FcfMac == hostFibreChannelOverEthernetTargetTransport.FcfMac && this.VlanId == hostFibreChannelOverEthernetTargetTransport.VlanId);\n        }\n\n        public override bool Equals(object hostFibreChannelOverEthernetTargetTransport)\n        {\n            return Equals(hostFibreChannelOverEthernetTargetTransport as HostFibreChannelOverEthernetTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnportMac + \"_\" + FcfMac + \"_\" + VlanId).GetHashCode();\n        }\n    }\n\n    public class HostFibreChannelTargetTransport : HostTargetTransport, IEquatable<HostFibreChannelTargetTransport>\n    {\n        public long PortWorldWideName { get; set; }\n\n        public long NodeWorldWideName { get; set; }\n\n        public bool Equals(HostFibreChannelTargetTransport hostFibreChannelTargetTransport)\n        {\n            return (hostFibreChannelTargetTransport != null && this.PortWorldWideName == hostFibreChannelTargetTransport.PortWorldWideName && this.NodeWorldWideName == hostFibreChannelTargetTransport.NodeWorldWideName);\n        }\n\n        public override bool Equals(object hostFibreChannelTargetTransport)\n        {\n            return Equals(hostFibreChannelTargetTransport as HostFibreChannelTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortWorldWideName + \"_\" + NodeWorldWideName).GetHashCode();\n        }\n    }\n\n    public class HostFileAccess : DynamicData, IEquatable<HostFileAccess>\n    {\n        public string Who { get; set; }\n\n        public string What { get; set; }\n\n        public bool Equals(HostFileAccess hostFileAccess)\n        {\n            return (hostFileAccess != null && this.Who == hostFileAccess.Who && this.What == hostFileAccess.What);\n        }\n\n        public override bool Equals(object hostFileAccess)\n        {\n            return Equals(hostFileAccess as HostFileAccess);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Who + \"_\" + What).GetHashCode();\n        }\n    }\n\n    public class HostFileSystemMountInfo : DynamicData, IEquatable<HostFileSystemMountInfo>\n    {\n        public HostMountInfo MountInfo { get; set; }\n\n        public HostFileSystemVolume Volume { get; set; }\n\n        public string VStorageSupport { get; set; }\n\n        public bool Equals(HostFileSystemMountInfo hostFileSystemMountInfo)\n        {\n            return (hostFileSystemMountInfo != null && ((this.MountInfo == null && hostFileSystemMountInfo.MountInfo == null) || (this.MountInfo != null && this.MountInfo.Equals(hostFileSystemMountInfo.MountInfo))) && ((this.Volume == null && hostFileSystemMountInfo.Volume == null) || (this.Volume != null && this.Volume.Equals(hostFileSystemMountInfo.Volume))) && this.VStorageSupport == hostFileSystemMountInfo.VStorageSupport);\n        }\n\n        public override bool Equals(object hostFileSystemMountInfo)\n        {\n            return Equals(hostFileSystemMountInfo as HostFileSystemMountInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MountInfo + \"_\" + Volume + \"_\" + VStorageSupport).GetHashCode();\n        }\n    }\n\n    public class HostFileSystemVolume : DynamicData, IEquatable<HostFileSystemVolume>\n    {\n        public string Type { get; set; }\n\n        public string Name { get; set; }\n\n        public long Capacity { get; set; }\n\n        public bool Equals(HostFileSystemVolume hostFileSystemVolume)\n        {\n            return (hostFileSystemVolume != null && this.Type == hostFileSystemVolume.Type && this.Name == hostFileSystemVolume.Name && this.Capacity == hostFileSystemVolume.Capacity);\n        }\n\n        public override bool Equals(object hostFileSystemVolume)\n        {\n            return Equals(hostFileSystemVolume as HostFileSystemVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Name + \"_\" + Capacity).GetHashCode();\n        }\n    }\n\n    public class HostFileSystemVolumeInfo : DynamicData, IEquatable<HostFileSystemVolumeInfo>\n    {\n        public string[] VolumeTypeList { get; set; }\n\n        public HostFileSystemMountInfo[] MountInfo { get; set; }\n\n        public bool Equals(HostFileSystemVolumeInfo hostFileSystemVolumeInfo)\n        {\n            return (hostFileSystemVolumeInfo != null && ((this.VolumeTypeList == null && hostFileSystemVolumeInfo.VolumeTypeList == null) || (this.VolumeTypeList != null && hostFileSystemVolumeInfo.VolumeTypeList != null && Enumerable.SequenceEqual(this.VolumeTypeList, hostFileSystemVolumeInfo.VolumeTypeList))) && ((this.MountInfo == null && hostFileSystemVolumeInfo.MountInfo == null) || (this.MountInfo != null && hostFileSystemVolumeInfo.MountInfo != null && Enumerable.SequenceEqual(this.MountInfo, hostFileSystemVolumeInfo.MountInfo))));\n        }\n\n        public override bool Equals(object hostFileSystemVolumeInfo)\n        {\n            return Equals(hostFileSystemVolumeInfo as HostFileSystemVolumeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VolumeTypeList + \"_\" + MountInfo).GetHashCode();\n        }\n    }\n\n    public class HostFirewallConfig : DynamicData, IEquatable<HostFirewallConfig>\n    {\n        public HostFirewallConfigRuleSetConfig[] Rule { get; set; }\n\n        public HostFirewallDefaultPolicy DefaultBlockingPolicy { get; set; }\n\n        public bool Equals(HostFirewallConfig hostFirewallConfig)\n        {\n            return (hostFirewallConfig != null && ((this.Rule == null && hostFirewallConfig.Rule == null) || (this.Rule != null && hostFirewallConfig.Rule != null && Enumerable.SequenceEqual(this.Rule, hostFirewallConfig.Rule))) && ((this.DefaultBlockingPolicy == null && hostFirewallConfig.DefaultBlockingPolicy == null) || (this.DefaultBlockingPolicy != null && this.DefaultBlockingPolicy.Equals(hostFirewallConfig.DefaultBlockingPolicy))));\n        }\n\n        public override bool Equals(object hostFirewallConfig)\n        {\n            return Equals(hostFirewallConfig as HostFirewallConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Rule + \"_\" + DefaultBlockingPolicy).GetHashCode();\n        }\n    }\n\n    public class HostFirewallConfigRuleSetConfig : DynamicData, IEquatable<HostFirewallConfigRuleSetConfig>\n    {\n        public string RulesetId { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public HostFirewallRulesetIpList AllowedHosts { get; set; }\n\n        public bool Equals(HostFirewallConfigRuleSetConfig hostFirewallConfigRuleSetConfig)\n        {\n            return (hostFirewallConfigRuleSetConfig != null && this.RulesetId == hostFirewallConfigRuleSetConfig.RulesetId && this.Enabled == hostFirewallConfigRuleSetConfig.Enabled && ((this.AllowedHosts == null && hostFirewallConfigRuleSetConfig.AllowedHosts == null) || (this.AllowedHosts != null && this.AllowedHosts.Equals(hostFirewallConfigRuleSetConfig.AllowedHosts))));\n        }\n\n        public override bool Equals(object hostFirewallConfigRuleSetConfig)\n        {\n            return Equals(hostFirewallConfigRuleSetConfig as HostFirewallConfigRuleSetConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RulesetId + \"_\" + Enabled + \"_\" + AllowedHosts).GetHashCode();\n        }\n    }\n\n    public class HostFirewallDefaultPolicy : DynamicData, IEquatable<HostFirewallDefaultPolicy>\n    {\n        public bool? IncomingBlocked { get; set; }\n\n        public bool? OutgoingBlocked { get; set; }\n\n        public bool Equals(HostFirewallDefaultPolicy hostFirewallDefaultPolicy)\n        {\n            return (hostFirewallDefaultPolicy != null && ((this.IncomingBlocked == null && hostFirewallDefaultPolicy.IncomingBlocked == null) || (this.IncomingBlocked != null && this.IncomingBlocked.Equals(hostFirewallDefaultPolicy.IncomingBlocked))) && ((this.OutgoingBlocked == null && hostFirewallDefaultPolicy.OutgoingBlocked == null) || (this.OutgoingBlocked != null && this.OutgoingBlocked.Equals(hostFirewallDefaultPolicy.OutgoingBlocked))));\n        }\n\n        public override bool Equals(object hostFirewallDefaultPolicy)\n        {\n            return Equals(hostFirewallDefaultPolicy as HostFirewallDefaultPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IncomingBlocked + \"_\" + OutgoingBlocked).GetHashCode();\n        }\n    }\n\n    public class HostFirewallInfo : DynamicData, IEquatable<HostFirewallInfo>\n    {\n        public HostFirewallDefaultPolicy DefaultPolicy { get; set; }\n\n        public HostFirewallRuleset[] Ruleset { get; set; }\n\n        public bool Equals(HostFirewallInfo hostFirewallInfo)\n        {\n            return (hostFirewallInfo != null && ((this.DefaultPolicy == null && hostFirewallInfo.DefaultPolicy == null) || (this.DefaultPolicy != null && this.DefaultPolicy.Equals(hostFirewallInfo.DefaultPolicy))) && ((this.Ruleset == null && hostFirewallInfo.Ruleset == null) || (this.Ruleset != null && hostFirewallInfo.Ruleset != null && Enumerable.SequenceEqual(this.Ruleset, hostFirewallInfo.Ruleset))));\n        }\n\n        public override bool Equals(object hostFirewallInfo)\n        {\n            return Equals(hostFirewallInfo as HostFirewallInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultPolicy + \"_\" + Ruleset).GetHashCode();\n        }\n    }\n\n    public class HostFirewallRule : DynamicData, IEquatable<HostFirewallRule>\n    {\n        public int Port { get; set; }\n\n        public int? EndPort { get; set; }\n\n        public HostFirewallRuleDirection Direction { get; set; }\n\n        public HostFirewallRulePortType? PortType { get; set; }\n\n        public string Protocol { get; set; }\n\n        public bool Equals(HostFirewallRule hostFirewallRule)\n        {\n            return (hostFirewallRule != null && this.Port == hostFirewallRule.Port && ((this.EndPort == null && hostFirewallRule.EndPort == null) || (this.EndPort != null && this.EndPort.Equals(hostFirewallRule.EndPort))) && this.Direction == hostFirewallRule.Direction && ((this.PortType == null && hostFirewallRule.PortType == null) || (this.PortType != null && this.PortType.Equals(hostFirewallRule.PortType))) && this.Protocol == hostFirewallRule.Protocol);\n        }\n\n        public override bool Equals(object hostFirewallRule)\n        {\n            return Equals(hostFirewallRule as HostFirewallRule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Port + \"_\" + EndPort + \"_\" + Direction + \"_\" + PortType + \"_\" + Protocol).GetHashCode();\n        }\n    }\n\n    public class HostFirewallRuleset : DynamicData, IEquatable<HostFirewallRuleset>\n    {\n        public string Key { get; set; }\n\n        public string Label { get; set; }\n\n        public bool Required { get; set; }\n\n        public HostFirewallRule[] Rule { get; set; }\n\n        public string Service { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public HostFirewallRulesetIpList AllowedHosts { get; set; }\n\n        public bool Equals(HostFirewallRuleset hostFirewallRuleset)\n        {\n            return (hostFirewallRuleset != null && this.Key == hostFirewallRuleset.Key && this.Label == hostFirewallRuleset.Label && this.Required == hostFirewallRuleset.Required && ((this.Rule == null && hostFirewallRuleset.Rule == null) || (this.Rule != null && hostFirewallRuleset.Rule != null && Enumerable.SequenceEqual(this.Rule, hostFirewallRuleset.Rule))) && this.Service == hostFirewallRuleset.Service && this.Enabled == hostFirewallRuleset.Enabled && ((this.AllowedHosts == null && hostFirewallRuleset.AllowedHosts == null) || (this.AllowedHosts != null && this.AllowedHosts.Equals(hostFirewallRuleset.AllowedHosts))));\n        }\n\n        public override bool Equals(object hostFirewallRuleset)\n        {\n            return Equals(hostFirewallRuleset as HostFirewallRuleset);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Label + \"_\" + Required + \"_\" + Rule + \"_\" + Service + \"_\" + Enabled + \"_\" + AllowedHosts).GetHashCode();\n        }\n    }\n\n    public class HostFirewallRulesetIpList : DynamicData, IEquatable<HostFirewallRulesetIpList>\n    {\n        public string[] IpAddress { get; set; }\n\n        public HostFirewallRulesetIpNetwork[] IpNetwork { get; set; }\n\n        public bool AllIp { get; set; }\n\n        public bool Equals(HostFirewallRulesetIpList hostFirewallRulesetIpList)\n        {\n            return (hostFirewallRulesetIpList != null && ((this.IpAddress == null && hostFirewallRulesetIpList.IpAddress == null) || (this.IpAddress != null && hostFirewallRulesetIpList.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, hostFirewallRulesetIpList.IpAddress))) && ((this.IpNetwork == null && hostFirewallRulesetIpList.IpNetwork == null) || (this.IpNetwork != null && hostFirewallRulesetIpList.IpNetwork != null && Enumerable.SequenceEqual(this.IpNetwork, hostFirewallRulesetIpList.IpNetwork))) && this.AllIp == hostFirewallRulesetIpList.AllIp);\n        }\n\n        public override bool Equals(object hostFirewallRulesetIpList)\n        {\n            return Equals(hostFirewallRulesetIpList as HostFirewallRulesetIpList);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + IpNetwork + \"_\" + AllIp).GetHashCode();\n        }\n    }\n\n    public class HostFirewallRulesetIpNetwork : DynamicData, IEquatable<HostFirewallRulesetIpNetwork>\n    {\n        public string Network { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public bool Equals(HostFirewallRulesetIpNetwork hostFirewallRulesetIpNetwork)\n        {\n            return (hostFirewallRulesetIpNetwork != null && this.Network == hostFirewallRulesetIpNetwork.Network && this.PrefixLength == hostFirewallRulesetIpNetwork.PrefixLength);\n        }\n\n        public override bool Equals(object hostFirewallRulesetIpNetwork)\n        {\n            return Equals(hostFirewallRulesetIpNetwork as HostFirewallRulesetIpNetwork);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + PrefixLength).GetHashCode();\n        }\n    }\n\n    public class HostFirewallRulesetRulesetSpec : DynamicData, IEquatable<HostFirewallRulesetRulesetSpec>\n    {\n        public HostFirewallRulesetIpList AllowedHosts { get; set; }\n\n        public bool Equals(HostFirewallRulesetRulesetSpec hostFirewallRulesetRulesetSpec)\n        {\n            return (hostFirewallRulesetRulesetSpec != null && ((this.AllowedHosts == null && hostFirewallRulesetRulesetSpec.AllowedHosts == null) || (this.AllowedHosts != null && this.AllowedHosts.Equals(hostFirewallRulesetRulesetSpec.AllowedHosts))));\n        }\n\n        public override bool Equals(object hostFirewallRulesetRulesetSpec)\n        {\n            return Equals(hostFirewallRulesetRulesetSpec as HostFirewallRulesetRulesetSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowedHosts).GetHashCode();\n        }\n    }\n\n    public class HostFirewallSystem : ExtensibleManagedObject, IEquatable<HostFirewallSystem>\n    {\n        public HostFirewallInfo FirewallInfo { get; set; }\n\n        public void UpdateDefaultPolicy(HostFirewallDefaultPolicy defaultPolicy)\n        {\n        }\n\n        public void EnableRuleset(string id)\n        {\n        }\n\n        public void DisableRuleset(string id)\n        {\n        }\n\n        public void UpdateRuleset(string id, HostFirewallRulesetRulesetSpec spec)\n        {\n        }\n\n        public void RefreshFirewall()\n        {\n        }\n\n        public bool Equals(HostFirewallSystem hostFirewallSystem)\n        {\n            return (hostFirewallSystem != null && ((this.FirewallInfo == null && hostFirewallSystem.FirewallInfo == null) || (this.FirewallInfo != null && this.FirewallInfo.Equals(hostFirewallSystem.FirewallInfo))));\n        }\n\n        public override bool Equals(object hostFirewallSystem)\n        {\n            return Equals(hostFirewallSystem as HostFirewallSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FirewallInfo).GetHashCode();\n        }\n    }\n\n    public class HostFirmwareSystem : ViewBase, IEquatable<HostFirmwareSystem>\n    {\n        public void ResetFirmwareToFactoryDefaults()\n        {\n        }\n\n        public string BackupFirmwareConfiguration()\n        {\n            return default(string);\n        }\n\n        public string QueryFirmwareConfigUploadURL()\n        {\n            return default(string);\n        }\n\n        public void RestoreFirmwareConfiguration(bool force)\n        {\n        }\n\n        public bool Equals(HostFirmwareSystem hostFirmwareSystem)\n        {\n            return (hostFirmwareSystem != null && base.Equals(hostFirmwareSystem));\n        }\n\n        public override bool Equals(object hostFirmwareSystem)\n        {\n            return Equals(hostFirmwareSystem as HostFirmwareSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostFlagInfo : DynamicData, IEquatable<HostFlagInfo>\n    {\n        public bool? BackgroundSnapshotsEnabled { get; set; }\n\n        public bool Equals(HostFlagInfo hostFlagInfo)\n        {\n            return (hostFlagInfo != null && ((this.BackgroundSnapshotsEnabled == null && hostFlagInfo.BackgroundSnapshotsEnabled == null) || (this.BackgroundSnapshotsEnabled != null && this.BackgroundSnapshotsEnabled.Equals(hostFlagInfo.BackgroundSnapshotsEnabled))));\n        }\n\n        public override bool Equals(object hostFlagInfo)\n        {\n            return Equals(hostFlagInfo as HostFlagInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BackgroundSnapshotsEnabled).GetHashCode();\n        }\n    }\n\n    public class HostForceMountedInfo : DynamicData, IEquatable<HostForceMountedInfo>\n    {\n        public bool Persist { get; set; }\n\n        public bool Mounted { get; set; }\n\n        public bool Equals(HostForceMountedInfo hostForceMountedInfo)\n        {\n            return (hostForceMountedInfo != null && this.Persist == hostForceMountedInfo.Persist && this.Mounted == hostForceMountedInfo.Mounted);\n        }\n\n        public override bool Equals(object hostForceMountedInfo)\n        {\n            return Equals(hostForceMountedInfo as HostForceMountedInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Persist + \"_\" + Mounted).GetHashCode();\n        }\n    }\n\n    public class HostGatewaySpec : DynamicData, IEquatable<HostGatewaySpec>\n    {\n        public string GatewayType { get; set; }\n\n        public string GatewayId { get; set; }\n\n        public string TrustVerificationToken { get; set; }\n\n        public KeyValue[] HostAuthParams { get; set; }\n\n        public bool Equals(HostGatewaySpec hostGatewaySpec)\n        {\n            return (hostGatewaySpec != null && this.GatewayType == hostGatewaySpec.GatewayType && this.GatewayId == hostGatewaySpec.GatewayId && this.TrustVerificationToken == hostGatewaySpec.TrustVerificationToken && ((this.HostAuthParams == null && hostGatewaySpec.HostAuthParams == null) || (this.HostAuthParams != null && hostGatewaySpec.HostAuthParams != null && Enumerable.SequenceEqual(this.HostAuthParams, hostGatewaySpec.HostAuthParams))));\n        }\n\n        public override bool Equals(object hostGatewaySpec)\n        {\n            return Equals(hostGatewaySpec as HostGatewaySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GatewayType + \"_\" + GatewayId + \"_\" + TrustVerificationToken + \"_\" + HostAuthParams).GetHashCode();\n        }\n    }\n\n    public class HostGetShortNameFailedEvent : HostEvent, IEquatable<HostGetShortNameFailedEvent>\n    {\n        public bool Equals(HostGetShortNameFailedEvent hostGetShortNameFailedEvent)\n        {\n            return (hostGetShortNameFailedEvent != null && base.Equals(hostGetShortNameFailedEvent));\n        }\n\n        public override bool Equals(object hostGetShortNameFailedEvent)\n        {\n            return Equals(hostGetShortNameFailedEvent as HostGetShortNameFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostGraphicsConfig : DynamicData, IEquatable<HostGraphicsConfig>\n    {\n        public string HostDefaultGraphicsType { get; set; }\n\n        public string SharedPassthruAssignmentPolicy { get; set; }\n\n        public HostGraphicsConfigDeviceType[] DeviceType { get; set; }\n\n        public bool Equals(HostGraphicsConfig hostGraphicsConfig)\n        {\n            return (hostGraphicsConfig != null && this.HostDefaultGraphicsType == hostGraphicsConfig.HostDefaultGraphicsType && this.SharedPassthruAssignmentPolicy == hostGraphicsConfig.SharedPassthruAssignmentPolicy && ((this.DeviceType == null && hostGraphicsConfig.DeviceType == null) || (this.DeviceType != null && hostGraphicsConfig.DeviceType != null && Enumerable.SequenceEqual(this.DeviceType, hostGraphicsConfig.DeviceType))));\n        }\n\n        public override bool Equals(object hostGraphicsConfig)\n        {\n            return Equals(hostGraphicsConfig as HostGraphicsConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostDefaultGraphicsType + \"_\" + SharedPassthruAssignmentPolicy + \"_\" + DeviceType).GetHashCode();\n        }\n    }\n\n    public class HostGraphicsConfigDeviceType : DynamicData, IEquatable<HostGraphicsConfigDeviceType>\n    {\n        public string DeviceId { get; set; }\n\n        public string GraphicsType { get; set; }\n\n        public bool Equals(HostGraphicsConfigDeviceType hostGraphicsConfigDeviceType)\n        {\n            return (hostGraphicsConfigDeviceType != null && this.DeviceId == hostGraphicsConfigDeviceType.DeviceId && this.GraphicsType == hostGraphicsConfigDeviceType.GraphicsType);\n        }\n\n        public override bool Equals(object hostGraphicsConfigDeviceType)\n        {\n            return Equals(hostGraphicsConfigDeviceType as HostGraphicsConfigDeviceType);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceId + \"_\" + GraphicsType).GetHashCode();\n        }\n    }\n\n    public class HostGraphicsInfo : DynamicData, IEquatable<HostGraphicsInfo>\n    {\n        public string DeviceName { get; set; }\n\n        public string VendorName { get; set; }\n\n        public string PciId { get; set; }\n\n        public string GraphicsType { get; set; }\n\n        public long MemorySizeInKB { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public HostGraphicsInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostGraphicsInfo hostGraphicsInfo)\n        {\n            return (hostGraphicsInfo != null && this.DeviceName == hostGraphicsInfo.DeviceName && this.VendorName == hostGraphicsInfo.VendorName && this.PciId == hostGraphicsInfo.PciId && this.GraphicsType == hostGraphicsInfo.GraphicsType && this.MemorySizeInKB == hostGraphicsInfo.MemorySizeInKB && ((this.Vm == null && hostGraphicsInfo.Vm == null) || (this.Vm != null && hostGraphicsInfo.Vm != null && Enumerable.SequenceEqual(this.Vm, hostGraphicsInfo.Vm))) && ((this.LinkedView == null && hostGraphicsInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostGraphicsInfo.LinkedView))));\n        }\n\n        public override bool Equals(object hostGraphicsInfo)\n        {\n            return Equals(hostGraphicsInfo as HostGraphicsInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceName + \"_\" + VendorName + \"_\" + PciId + \"_\" + GraphicsType + \"_\" + MemorySizeInKB + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostGraphicsInfo_LinkedView : IEquatable<HostGraphicsInfo_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(HostGraphicsInfo_LinkedView hostGraphicsInfo_LinkedView)\n        {\n            return (hostGraphicsInfo_LinkedView != null && ((this.Vm == null && hostGraphicsInfo_LinkedView.Vm == null) || (this.Vm != null && hostGraphicsInfo_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, hostGraphicsInfo_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object hostGraphicsInfo_LinkedView)\n        {\n            return Equals(hostGraphicsInfo_LinkedView as HostGraphicsInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class HostGraphicsManager : ExtensibleManagedObject, IEquatable<HostGraphicsManager>\n    {\n        public HostGraphicsInfo[] GraphicsInfo { get; set; }\n\n        public HostGraphicsConfig GraphicsConfig { get; set; }\n\n        public string[] SharedPassthruGpuTypes { get; set; }\n\n        public HostSharedGpuCapabilities[] SharedGpuCapabilities { get; set; }\n\n        public void RefreshGraphicsManager()\n        {\n        }\n\n        public bool IsSharedGraphicsActive()\n        {\n            return default(bool);\n        }\n\n        public void UpdateGraphicsConfig(HostGraphicsConfig config)\n        {\n        }\n\n        public bool Equals(HostGraphicsManager hostGraphicsManager)\n        {\n            return (hostGraphicsManager != null && ((this.GraphicsInfo == null && hostGraphicsManager.GraphicsInfo == null) || (this.GraphicsInfo != null && hostGraphicsManager.GraphicsInfo != null && Enumerable.SequenceEqual(this.GraphicsInfo, hostGraphicsManager.GraphicsInfo))) && ((this.GraphicsConfig == null && hostGraphicsManager.GraphicsConfig == null) || (this.GraphicsConfig != null && this.GraphicsConfig.Equals(hostGraphicsManager.GraphicsConfig))) && ((this.SharedPassthruGpuTypes == null && hostGraphicsManager.SharedPassthruGpuTypes == null) || (this.SharedPassthruGpuTypes != null && hostGraphicsManager.SharedPassthruGpuTypes != null && Enumerable.SequenceEqual(this.SharedPassthruGpuTypes, hostGraphicsManager.SharedPassthruGpuTypes))) && ((this.SharedGpuCapabilities == null && hostGraphicsManager.SharedGpuCapabilities == null) || (this.SharedGpuCapabilities != null && hostGraphicsManager.SharedGpuCapabilities != null && Enumerable.SequenceEqual(this.SharedGpuCapabilities, hostGraphicsManager.SharedGpuCapabilities))));\n        }\n\n        public override bool Equals(object hostGraphicsManager)\n        {\n            return Equals(hostGraphicsManager as HostGraphicsManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GraphicsInfo + \"_\" + GraphicsConfig + \"_\" + SharedPassthruGpuTypes + \"_\" + SharedGpuCapabilities).GetHashCode();\n        }\n    }\n\n    public class HostHardwareElementInfo : DynamicData, IEquatable<HostHardwareElementInfo>\n    {\n        public string Name { get; set; }\n\n        public ElementDescription Status { get; set; }\n\n        public bool Equals(HostHardwareElementInfo hostHardwareElementInfo)\n        {\n            return (hostHardwareElementInfo != null && this.Name == hostHardwareElementInfo.Name && ((this.Status == null && hostHardwareElementInfo.Status == null) || (this.Status != null && this.Status.Equals(hostHardwareElementInfo.Status))));\n        }\n\n        public override bool Equals(object hostHardwareElementInfo)\n        {\n            return Equals(hostHardwareElementInfo as HostHardwareElementInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Status).GetHashCode();\n        }\n    }\n\n    public class HostHardwareInfo : DynamicData, IEquatable<HostHardwareInfo>\n    {\n        public HostSystemInfo SystemInfo { get; set; }\n\n        public HostCpuPowerManagementInfo CpuPowerManagementInfo { get; set; }\n\n        public HostCpuInfo CpuInfo { get; set; }\n\n        public HostCpuPackage[] CpuPkg { get; set; }\n\n        public long MemorySize { get; set; }\n\n        public HostNumaInfo NumaInfo { get; set; }\n\n        public bool SmcPresent { get; set; }\n\n        public HostPciDevice[] PciDevice { get; set; }\n\n        public HostCpuIdInfo[] CpuFeature { get; set; }\n\n        public HostBIOSInfo BiosInfo { get; set; }\n\n        public HostReliableMemoryInfo ReliableMemoryInfo { get; set; }\n\n        public HostPersistentMemoryInfo PersistentMemoryInfo { get; set; }\n\n        public bool Equals(HostHardwareInfo hostHardwareInfo)\n        {\n            return (hostHardwareInfo != null && ((this.SystemInfo == null && hostHardwareInfo.SystemInfo == null) || (this.SystemInfo != null && this.SystemInfo.Equals(hostHardwareInfo.SystemInfo))) && ((this.CpuPowerManagementInfo == null && hostHardwareInfo.CpuPowerManagementInfo == null) || (this.CpuPowerManagementInfo != null && this.CpuPowerManagementInfo.Equals(hostHardwareInfo.CpuPowerManagementInfo))) && ((this.CpuInfo == null && hostHardwareInfo.CpuInfo == null) || (this.CpuInfo != null && this.CpuInfo.Equals(hostHardwareInfo.CpuInfo))) && ((this.CpuPkg == null && hostHardwareInfo.CpuPkg == null) || (this.CpuPkg != null && hostHardwareInfo.CpuPkg != null && Enumerable.SequenceEqual(this.CpuPkg, hostHardwareInfo.CpuPkg))) && this.MemorySize == hostHardwareInfo.MemorySize && ((this.NumaInfo == null && hostHardwareInfo.NumaInfo == null) || (this.NumaInfo != null && this.NumaInfo.Equals(hostHardwareInfo.NumaInfo))) && this.SmcPresent == hostHardwareInfo.SmcPresent && ((this.PciDevice == null && hostHardwareInfo.PciDevice == null) || (this.PciDevice != null && hostHardwareInfo.PciDevice != null && Enumerable.SequenceEqual(this.PciDevice, hostHardwareInfo.PciDevice))) && ((this.CpuFeature == null && hostHardwareInfo.CpuFeature == null) || (this.CpuFeature != null && hostHardwareInfo.CpuFeature != null && Enumerable.SequenceEqual(this.CpuFeature, hostHardwareInfo.CpuFeature))) && ((this.BiosInfo == null && hostHardwareInfo.BiosInfo == null) || (this.BiosInfo != null && this.BiosInfo.Equals(hostHardwareInfo.BiosInfo))) && ((this.ReliableMemoryInfo == null && hostHardwareInfo.ReliableMemoryInfo == null) || (this.ReliableMemoryInfo != null && this.ReliableMemoryInfo.Equals(hostHardwareInfo.ReliableMemoryInfo))) && ((this.PersistentMemoryInfo == null && hostHardwareInfo.PersistentMemoryInfo == null) || (this.PersistentMemoryInfo != null && this.PersistentMemoryInfo.Equals(hostHardwareInfo.PersistentMemoryInfo))));\n        }\n\n        public override bool Equals(object hostHardwareInfo)\n        {\n            return Equals(hostHardwareInfo as HostHardwareInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SystemInfo + \"_\" + CpuPowerManagementInfo + \"_\" + CpuInfo + \"_\" + CpuPkg + \"_\" + MemorySize + \"_\" + NumaInfo + \"_\" + SmcPresent + \"_\" + PciDevice + \"_\" + CpuFeature + \"_\" + BiosInfo + \"_\" + ReliableMemoryInfo + \"_\" + PersistentMemoryInfo).GetHashCode();\n        }\n    }\n\n    public class HostHardwareStatusInfo : DynamicData, IEquatable<HostHardwareStatusInfo>\n    {\n        public HostHardwareElementInfo[] MemoryStatusInfo { get; set; }\n\n        public HostHardwareElementInfo[] CpuStatusInfo { get; set; }\n\n        public HostStorageElementInfo[] StorageStatusInfo { get; set; }\n\n        public bool Equals(HostHardwareStatusInfo hostHardwareStatusInfo)\n        {\n            return (hostHardwareStatusInfo != null && ((this.MemoryStatusInfo == null && hostHardwareStatusInfo.MemoryStatusInfo == null) || (this.MemoryStatusInfo != null && hostHardwareStatusInfo.MemoryStatusInfo != null && Enumerable.SequenceEqual(this.MemoryStatusInfo, hostHardwareStatusInfo.MemoryStatusInfo))) && ((this.CpuStatusInfo == null && hostHardwareStatusInfo.CpuStatusInfo == null) || (this.CpuStatusInfo != null && hostHardwareStatusInfo.CpuStatusInfo != null && Enumerable.SequenceEqual(this.CpuStatusInfo, hostHardwareStatusInfo.CpuStatusInfo))) && ((this.StorageStatusInfo == null && hostHardwareStatusInfo.StorageStatusInfo == null) || (this.StorageStatusInfo != null && hostHardwareStatusInfo.StorageStatusInfo != null && Enumerable.SequenceEqual(this.StorageStatusInfo, hostHardwareStatusInfo.StorageStatusInfo))));\n        }\n\n        public override bool Equals(object hostHardwareStatusInfo)\n        {\n            return Equals(hostHardwareStatusInfo as HostHardwareStatusInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MemoryStatusInfo + \"_\" + CpuStatusInfo + \"_\" + StorageStatusInfo).GetHashCode();\n        }\n    }\n\n    public class HostHardwareSummary : DynamicData, IEquatable<HostHardwareSummary>\n    {\n        public string Vendor { get; set; }\n\n        public string Model { get; set; }\n\n        public string Uuid { get; set; }\n\n        public HostSystemIdentificationInfo[] OtherIdentifyingInfo { get; set; }\n\n        public long MemorySize { get; set; }\n\n        public string CpuModel { get; set; }\n\n        public int CpuMhz { get; set; }\n\n        public short NumCpuPkgs { get; set; }\n\n        public short NumCpuCores { get; set; }\n\n        public short NumCpuThreads { get; set; }\n\n        public int NumNics { get; set; }\n\n        public int NumHBAs { get; set; }\n\n        public bool Equals(HostHardwareSummary hostHardwareSummary)\n        {\n            return (hostHardwareSummary != null && this.Vendor == hostHardwareSummary.Vendor && this.Model == hostHardwareSummary.Model && this.Uuid == hostHardwareSummary.Uuid && ((this.OtherIdentifyingInfo == null && hostHardwareSummary.OtherIdentifyingInfo == null) || (this.OtherIdentifyingInfo != null && hostHardwareSummary.OtherIdentifyingInfo != null && Enumerable.SequenceEqual(this.OtherIdentifyingInfo, hostHardwareSummary.OtherIdentifyingInfo))) && this.MemorySize == hostHardwareSummary.MemorySize && this.CpuModel == hostHardwareSummary.CpuModel && this.CpuMhz == hostHardwareSummary.CpuMhz && this.NumCpuPkgs == hostHardwareSummary.NumCpuPkgs && this.NumCpuCores == hostHardwareSummary.NumCpuCores && this.NumCpuThreads == hostHardwareSummary.NumCpuThreads && this.NumNics == hostHardwareSummary.NumNics && this.NumHBAs == hostHardwareSummary.NumHBAs);\n        }\n\n        public override bool Equals(object hostHardwareSummary)\n        {\n            return Equals(hostHardwareSummary as HostHardwareSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vendor + \"_\" + Model + \"_\" + Uuid + \"_\" + OtherIdentifyingInfo + \"_\" + MemorySize + \"_\" + CpuModel + \"_\" + CpuMhz + \"_\" + NumCpuPkgs + \"_\" + NumCpuCores + \"_\" + NumCpuThreads + \"_\" + NumNics + \"_\" + NumHBAs).GetHashCode();\n        }\n    }\n\n    public class HostHasComponentFailure : VimFault, IEquatable<HostHasComponentFailure>\n    {\n        public string HostName { get; set; }\n\n        public string ComponentType { get; set; }\n\n        public string ComponentName { get; set; }\n\n        public bool Equals(HostHasComponentFailure hostHasComponentFailure)\n        {\n            return (hostHasComponentFailure != null && this.HostName == hostHasComponentFailure.HostName && this.ComponentType == hostHasComponentFailure.ComponentType && this.ComponentName == hostHasComponentFailure.ComponentName);\n        }\n\n        public override bool Equals(object hostHasComponentFailure)\n        {\n            return Equals(hostHasComponentFailure as HostHasComponentFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + ComponentType + \"_\" + ComponentName).GetHashCode();\n        }\n    }\n\n    public class HostHealthStatusSystem : ViewBase, IEquatable<HostHealthStatusSystem>\n    {\n        public HealthSystemRuntime Runtime { get; set; }\n\n        public void RefreshHealthStatusSystem()\n        {\n        }\n\n        public void ResetSystemHealthInfo()\n        {\n        }\n\n        public void ClearSystemEventLog()\n        {\n        }\n\n        public SystemEventInfo[] FetchSystemEventLog()\n        {\n            return default(SystemEventInfo[]);\n        }\n\n        public bool Equals(HostHealthStatusSystem hostHealthStatusSystem)\n        {\n            return (hostHealthStatusSystem != null && ((this.Runtime == null && hostHealthStatusSystem.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(hostHealthStatusSystem.Runtime))));\n        }\n\n        public override bool Equals(object hostHealthStatusSystem)\n        {\n            return Equals(hostHealthStatusSystem as HostHealthStatusSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Runtime).GetHashCode();\n        }\n    }\n\n    public class HostHostBusAdapter : DynamicData, IEquatable<HostHostBusAdapter>\n    {\n        public string Key { get; set; }\n\n        public string Device { get; set; }\n\n        public int Bus { get; set; }\n\n        public string Status { get; set; }\n\n        public string Model { get; set; }\n\n        public string Driver { get; set; }\n\n        public string Pci { get; set; }\n\n        public bool Equals(HostHostBusAdapter hostHostBusAdapter)\n        {\n            return (hostHostBusAdapter != null && this.Key == hostHostBusAdapter.Key && this.Device == hostHostBusAdapter.Device && this.Bus == hostHostBusAdapter.Bus && this.Status == hostHostBusAdapter.Status && this.Model == hostHostBusAdapter.Model && this.Driver == hostHostBusAdapter.Driver && this.Pci == hostHostBusAdapter.Pci);\n        }\n\n        public override bool Equals(object hostHostBusAdapter)\n        {\n            return Equals(hostHostBusAdapter as HostHostBusAdapter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Device + \"_\" + Bus + \"_\" + Status + \"_\" + Model + \"_\" + Driver + \"_\" + Pci).GetHashCode();\n        }\n    }\n\n    public class HostHyperThreadScheduleInfo : DynamicData, IEquatable<HostHyperThreadScheduleInfo>\n    {\n        public bool Available { get; set; }\n\n        public bool Active { get; set; }\n\n        public bool Config { get; set; }\n\n        public bool Equals(HostHyperThreadScheduleInfo hostHyperThreadScheduleInfo)\n        {\n            return (hostHyperThreadScheduleInfo != null && this.Available == hostHyperThreadScheduleInfo.Available && this.Active == hostHyperThreadScheduleInfo.Active && this.Config == hostHyperThreadScheduleInfo.Config);\n        }\n\n        public override bool Equals(object hostHyperThreadScheduleInfo)\n        {\n            return Equals(hostHyperThreadScheduleInfo as HostHyperThreadScheduleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Available + \"_\" + Active + \"_\" + Config).GetHashCode();\n        }\n    }\n\n    public class HostImageConfigManager : ViewBase, IEquatable<HostImageConfigManager>\n    {\n        public string HostImageConfigGetAcceptance()\n        {\n            return default(string);\n        }\n\n        public HostImageProfileSummary HostImageConfigGetProfile()\n        {\n            return default(HostImageProfileSummary);\n        }\n\n        public void UpdateHostImageAcceptanceLevel(string newAcceptanceLevel)\n        {\n        }\n\n        public SoftwarePackage[] fetchSoftwarePackages()\n        {\n            return default(SoftwarePackage[]);\n        }\n\n        public DateTime installDate()\n        {\n            return default(DateTime);\n        }\n\n        public bool Equals(HostImageConfigManager hostImageConfigManager)\n        {\n            return (hostImageConfigManager != null && base.Equals(hostImageConfigManager));\n        }\n\n        public override bool Equals(object hostImageConfigManager)\n        {\n            return Equals(hostImageConfigManager as HostImageConfigManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostImageProfileSummary : DynamicData, IEquatable<HostImageProfileSummary>\n    {\n        public string Name { get; set; }\n\n        public string Vendor { get; set; }\n\n        public bool Equals(HostImageProfileSummary hostImageProfileSummary)\n        {\n            return (hostImageProfileSummary != null && this.Name == hostImageProfileSummary.Name && this.Vendor == hostImageProfileSummary.Vendor);\n        }\n\n        public override bool Equals(object hostImageProfileSummary)\n        {\n            return Equals(hostImageProfileSummary as HostImageProfileSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Vendor).GetHashCode();\n        }\n    }\n\n    public class HostInAuditModeEvent : HostEvent, IEquatable<HostInAuditModeEvent>\n    {\n        public bool Equals(HostInAuditModeEvent hostInAuditModeEvent)\n        {\n            return (hostInAuditModeEvent != null && base.Equals(hostInAuditModeEvent));\n        }\n\n        public override bool Equals(object hostInAuditModeEvent)\n        {\n            return Equals(hostInAuditModeEvent as HostInAuditModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostIncompatibleForFaultTolerance : VmFaultToleranceIssue, IEquatable<HostIncompatibleForFaultTolerance>\n    {\n        public string HostName { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(HostIncompatibleForFaultTolerance hostIncompatibleForFaultTolerance)\n        {\n            return (hostIncompatibleForFaultTolerance != null && this.HostName == hostIncompatibleForFaultTolerance.HostName && this.Reason == hostIncompatibleForFaultTolerance.Reason);\n        }\n\n        public override bool Equals(object hostIncompatibleForFaultTolerance)\n        {\n            return Equals(hostIncompatibleForFaultTolerance as HostIncompatibleForFaultTolerance);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class HostIncompatibleForRecordReplay : VimFault, IEquatable<HostIncompatibleForRecordReplay>\n    {\n        public string HostName { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(HostIncompatibleForRecordReplay hostIncompatibleForRecordReplay)\n        {\n            return (hostIncompatibleForRecordReplay != null && this.HostName == hostIncompatibleForRecordReplay.HostName && this.Reason == hostIncompatibleForRecordReplay.Reason);\n        }\n\n        public override bool Equals(object hostIncompatibleForRecordReplay)\n        {\n            return Equals(hostIncompatibleForRecordReplay as HostIncompatibleForRecordReplay);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class HostInDomain : HostConfigFault, IEquatable<HostInDomain>\n    {\n        public bool Equals(HostInDomain hostInDomain)\n        {\n            return (hostInDomain != null && base.Equals(hostInDomain));\n        }\n\n        public override bool Equals(object hostInDomain)\n        {\n            return Equals(hostInDomain as HostInDomain);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHba : HostHostBusAdapter, IEquatable<HostInternetScsiHba>\n    {\n        public bool IsSoftwareBased { get; set; }\n\n        public bool? CanBeDisabled { get; set; }\n\n        public HostInternetScsiHbaNetworkBindingSupportType? NetworkBindingSupport { get; set; }\n\n        public HostInternetScsiHbaDiscoveryCapabilities DiscoveryCapabilities { get; set; }\n\n        public HostInternetScsiHbaDiscoveryProperties DiscoveryProperties { get; set; }\n\n        public HostInternetScsiHbaAuthenticationCapabilities AuthenticationCapabilities { get; set; }\n\n        public HostInternetScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        public HostInternetScsiHbaDigestCapabilities DigestCapabilities { get; set; }\n\n        public HostInternetScsiHbaDigestProperties DigestProperties { get; set; }\n\n        public HostInternetScsiHbaIPCapabilities IpCapabilities { get; set; }\n\n        public HostInternetScsiHbaIPProperties IpProperties { get; set; }\n\n        public OptionDef[] SupportedAdvancedOptions { get; set; }\n\n        public HostInternetScsiHbaParamValue[] AdvancedOptions { get; set; }\n\n        public string IScsiName { get; set; }\n\n        public string IScsiAlias { get; set; }\n\n        public HostInternetScsiHbaSendTarget[] ConfiguredSendTarget { get; set; }\n\n        public HostInternetScsiHbaStaticTarget[] ConfiguredStaticTarget { get; set; }\n\n        public int? MaxSpeedMb { get; set; }\n\n        public int? CurrentSpeedMb { get; set; }\n\n        public bool Equals(HostInternetScsiHba hostInternetScsiHba)\n        {\n            return (hostInternetScsiHba != null && this.IsSoftwareBased == hostInternetScsiHba.IsSoftwareBased && ((this.CanBeDisabled == null && hostInternetScsiHba.CanBeDisabled == null) || (this.CanBeDisabled != null && this.CanBeDisabled.Equals(hostInternetScsiHba.CanBeDisabled))) && ((this.NetworkBindingSupport == null && hostInternetScsiHba.NetworkBindingSupport == null) || (this.NetworkBindingSupport != null && this.NetworkBindingSupport.Equals(hostInternetScsiHba.NetworkBindingSupport))) && ((this.DiscoveryCapabilities == null && hostInternetScsiHba.DiscoveryCapabilities == null) || (this.DiscoveryCapabilities != null && this.DiscoveryCapabilities.Equals(hostInternetScsiHba.DiscoveryCapabilities))) && ((this.DiscoveryProperties == null && hostInternetScsiHba.DiscoveryProperties == null) || (this.DiscoveryProperties != null && this.DiscoveryProperties.Equals(hostInternetScsiHba.DiscoveryProperties))) && ((this.AuthenticationCapabilities == null && hostInternetScsiHba.AuthenticationCapabilities == null) || (this.AuthenticationCapabilities != null && this.AuthenticationCapabilities.Equals(hostInternetScsiHba.AuthenticationCapabilities))) && ((this.AuthenticationProperties == null && hostInternetScsiHba.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(hostInternetScsiHba.AuthenticationProperties))) && ((this.DigestCapabilities == null && hostInternetScsiHba.DigestCapabilities == null) || (this.DigestCapabilities != null && this.DigestCapabilities.Equals(hostInternetScsiHba.DigestCapabilities))) && ((this.DigestProperties == null && hostInternetScsiHba.DigestProperties == null) || (this.DigestProperties != null && this.DigestProperties.Equals(hostInternetScsiHba.DigestProperties))) && ((this.IpCapabilities == null && hostInternetScsiHba.IpCapabilities == null) || (this.IpCapabilities != null && this.IpCapabilities.Equals(hostInternetScsiHba.IpCapabilities))) && ((this.IpProperties == null && hostInternetScsiHba.IpProperties == null) || (this.IpProperties != null && this.IpProperties.Equals(hostInternetScsiHba.IpProperties))) && ((this.SupportedAdvancedOptions == null && hostInternetScsiHba.SupportedAdvancedOptions == null) || (this.SupportedAdvancedOptions != null && hostInternetScsiHba.SupportedAdvancedOptions != null && Enumerable.SequenceEqual(this.SupportedAdvancedOptions, hostInternetScsiHba.SupportedAdvancedOptions))) && ((this.AdvancedOptions == null && hostInternetScsiHba.AdvancedOptions == null) || (this.AdvancedOptions != null && hostInternetScsiHba.AdvancedOptions != null && Enumerable.SequenceEqual(this.AdvancedOptions, hostInternetScsiHba.AdvancedOptions))) && this.IScsiName == hostInternetScsiHba.IScsiName && this.IScsiAlias == hostInternetScsiHba.IScsiAlias && ((this.ConfiguredSendTarget == null && hostInternetScsiHba.ConfiguredSendTarget == null) || (this.ConfiguredSendTarget != null && hostInternetScsiHba.ConfiguredSendTarget != null && Enumerable.SequenceEqual(this.ConfiguredSendTarget, hostInternetScsiHba.ConfiguredSendTarget))) && ((this.ConfiguredStaticTarget == null && hostInternetScsiHba.ConfiguredStaticTarget == null) || (this.ConfiguredStaticTarget != null && hostInternetScsiHba.ConfiguredStaticTarget != null && Enumerable.SequenceEqual(this.ConfiguredStaticTarget, hostInternetScsiHba.ConfiguredStaticTarget))) && ((this.MaxSpeedMb == null && hostInternetScsiHba.MaxSpeedMb == null) || (this.MaxSpeedMb != null && this.MaxSpeedMb.Equals(hostInternetScsiHba.MaxSpeedMb))) && ((this.CurrentSpeedMb == null && hostInternetScsiHba.CurrentSpeedMb == null) || (this.CurrentSpeedMb != null && this.CurrentSpeedMb.Equals(hostInternetScsiHba.CurrentSpeedMb))));\n        }\n\n        public override bool Equals(object hostInternetScsiHba)\n        {\n            return Equals(hostInternetScsiHba as HostInternetScsiHba);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsSoftwareBased + \"_\" + CanBeDisabled + \"_\" + NetworkBindingSupport + \"_\" + DiscoveryCapabilities + \"_\" + DiscoveryProperties + \"_\" + AuthenticationCapabilities + \"_\" + AuthenticationProperties + \"_\" + DigestCapabilities + \"_\" + DigestProperties + \"_\" + IpCapabilities + \"_\" + IpProperties + \"_\" + SupportedAdvancedOptions + \"_\" + AdvancedOptions + \"_\" + IScsiName + \"_\" + IScsiAlias + \"_\" + ConfiguredSendTarget + \"_\" + ConfiguredStaticTarget + \"_\" + MaxSpeedMb + \"_\" + CurrentSpeedMb).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaAuthenticationCapabilities : DynamicData, IEquatable<HostInternetScsiHbaAuthenticationCapabilities>\n    {\n        public bool ChapAuthSettable { get; set; }\n\n        public bool Krb5AuthSettable { get; set; }\n\n        public bool SrpAuthSettable { get; set; }\n\n        public bool SpkmAuthSettable { get; set; }\n\n        public bool? MutualChapSettable { get; set; }\n\n        public bool? TargetChapSettable { get; set; }\n\n        public bool? TargetMutualChapSettable { get; set; }\n\n        public bool Equals(HostInternetScsiHbaAuthenticationCapabilities hostInternetScsiHbaAuthenticationCapabilities)\n        {\n            return (hostInternetScsiHbaAuthenticationCapabilities != null && this.ChapAuthSettable == hostInternetScsiHbaAuthenticationCapabilities.ChapAuthSettable && this.Krb5AuthSettable == hostInternetScsiHbaAuthenticationCapabilities.Krb5AuthSettable && this.SrpAuthSettable == hostInternetScsiHbaAuthenticationCapabilities.SrpAuthSettable && this.SpkmAuthSettable == hostInternetScsiHbaAuthenticationCapabilities.SpkmAuthSettable && ((this.MutualChapSettable == null && hostInternetScsiHbaAuthenticationCapabilities.MutualChapSettable == null) || (this.MutualChapSettable != null && this.MutualChapSettable.Equals(hostInternetScsiHbaAuthenticationCapabilities.MutualChapSettable))) && ((this.TargetChapSettable == null && hostInternetScsiHbaAuthenticationCapabilities.TargetChapSettable == null) || (this.TargetChapSettable != null && this.TargetChapSettable.Equals(hostInternetScsiHbaAuthenticationCapabilities.TargetChapSettable))) && ((this.TargetMutualChapSettable == null && hostInternetScsiHbaAuthenticationCapabilities.TargetMutualChapSettable == null) || (this.TargetMutualChapSettable != null && this.TargetMutualChapSettable.Equals(hostInternetScsiHbaAuthenticationCapabilities.TargetMutualChapSettable))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaAuthenticationCapabilities)\n        {\n            return Equals(hostInternetScsiHbaAuthenticationCapabilities as HostInternetScsiHbaAuthenticationCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChapAuthSettable + \"_\" + Krb5AuthSettable + \"_\" + SrpAuthSettable + \"_\" + SpkmAuthSettable + \"_\" + MutualChapSettable + \"_\" + TargetChapSettable + \"_\" + TargetMutualChapSettable).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaAuthenticationProperties : DynamicData, IEquatable<HostInternetScsiHbaAuthenticationProperties>\n    {\n        public bool ChapAuthEnabled { get; set; }\n\n        public string ChapName { get; set; }\n\n        public string ChapSecret { get; set; }\n\n        public string ChapAuthenticationType { get; set; }\n\n        public bool? ChapInherited { get; set; }\n\n        public string MutualChapName { get; set; }\n\n        public string MutualChapSecret { get; set; }\n\n        public string MutualChapAuthenticationType { get; set; }\n\n        public bool? MutualChapInherited { get; set; }\n\n        public bool Equals(HostInternetScsiHbaAuthenticationProperties hostInternetScsiHbaAuthenticationProperties)\n        {\n            return (hostInternetScsiHbaAuthenticationProperties != null && this.ChapAuthEnabled == hostInternetScsiHbaAuthenticationProperties.ChapAuthEnabled && this.ChapName == hostInternetScsiHbaAuthenticationProperties.ChapName && this.ChapSecret == hostInternetScsiHbaAuthenticationProperties.ChapSecret && this.ChapAuthenticationType == hostInternetScsiHbaAuthenticationProperties.ChapAuthenticationType && ((this.ChapInherited == null && hostInternetScsiHbaAuthenticationProperties.ChapInherited == null) || (this.ChapInherited != null && this.ChapInherited.Equals(hostInternetScsiHbaAuthenticationProperties.ChapInherited))) && this.MutualChapName == hostInternetScsiHbaAuthenticationProperties.MutualChapName && this.MutualChapSecret == hostInternetScsiHbaAuthenticationProperties.MutualChapSecret && this.MutualChapAuthenticationType == hostInternetScsiHbaAuthenticationProperties.MutualChapAuthenticationType && ((this.MutualChapInherited == null && hostInternetScsiHbaAuthenticationProperties.MutualChapInherited == null) || (this.MutualChapInherited != null && this.MutualChapInherited.Equals(hostInternetScsiHbaAuthenticationProperties.MutualChapInherited))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaAuthenticationProperties)\n        {\n            return Equals(hostInternetScsiHbaAuthenticationProperties as HostInternetScsiHbaAuthenticationProperties);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChapAuthEnabled + \"_\" + ChapName + \"_\" + ChapSecret + \"_\" + ChapAuthenticationType + \"_\" + ChapInherited + \"_\" + MutualChapName + \"_\" + MutualChapSecret + \"_\" + MutualChapAuthenticationType + \"_\" + MutualChapInherited).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaDigestCapabilities : DynamicData, IEquatable<HostInternetScsiHbaDigestCapabilities>\n    {\n        public bool? HeaderDigestSettable { get; set; }\n\n        public bool? DataDigestSettable { get; set; }\n\n        public bool? TargetHeaderDigestSettable { get; set; }\n\n        public bool? TargetDataDigestSettable { get; set; }\n\n        public bool Equals(HostInternetScsiHbaDigestCapabilities hostInternetScsiHbaDigestCapabilities)\n        {\n            return (hostInternetScsiHbaDigestCapabilities != null && ((this.HeaderDigestSettable == null && hostInternetScsiHbaDigestCapabilities.HeaderDigestSettable == null) || (this.HeaderDigestSettable != null && this.HeaderDigestSettable.Equals(hostInternetScsiHbaDigestCapabilities.HeaderDigestSettable))) && ((this.DataDigestSettable == null && hostInternetScsiHbaDigestCapabilities.DataDigestSettable == null) || (this.DataDigestSettable != null && this.DataDigestSettable.Equals(hostInternetScsiHbaDigestCapabilities.DataDigestSettable))) && ((this.TargetHeaderDigestSettable == null && hostInternetScsiHbaDigestCapabilities.TargetHeaderDigestSettable == null) || (this.TargetHeaderDigestSettable != null && this.TargetHeaderDigestSettable.Equals(hostInternetScsiHbaDigestCapabilities.TargetHeaderDigestSettable))) && ((this.TargetDataDigestSettable == null && hostInternetScsiHbaDigestCapabilities.TargetDataDigestSettable == null) || (this.TargetDataDigestSettable != null && this.TargetDataDigestSettable.Equals(hostInternetScsiHbaDigestCapabilities.TargetDataDigestSettable))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaDigestCapabilities)\n        {\n            return Equals(hostInternetScsiHbaDigestCapabilities as HostInternetScsiHbaDigestCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HeaderDigestSettable + \"_\" + DataDigestSettable + \"_\" + TargetHeaderDigestSettable + \"_\" + TargetDataDigestSettable).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaDigestProperties : DynamicData, IEquatable<HostInternetScsiHbaDigestProperties>\n    {\n        public string HeaderDigestType { get; set; }\n\n        public bool? HeaderDigestInherited { get; set; }\n\n        public string DataDigestType { get; set; }\n\n        public bool? DataDigestInherited { get; set; }\n\n        public bool Equals(HostInternetScsiHbaDigestProperties hostInternetScsiHbaDigestProperties)\n        {\n            return (hostInternetScsiHbaDigestProperties != null && this.HeaderDigestType == hostInternetScsiHbaDigestProperties.HeaderDigestType && ((this.HeaderDigestInherited == null && hostInternetScsiHbaDigestProperties.HeaderDigestInherited == null) || (this.HeaderDigestInherited != null && this.HeaderDigestInherited.Equals(hostInternetScsiHbaDigestProperties.HeaderDigestInherited))) && this.DataDigestType == hostInternetScsiHbaDigestProperties.DataDigestType && ((this.DataDigestInherited == null && hostInternetScsiHbaDigestProperties.DataDigestInherited == null) || (this.DataDigestInherited != null && this.DataDigestInherited.Equals(hostInternetScsiHbaDigestProperties.DataDigestInherited))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaDigestProperties)\n        {\n            return Equals(hostInternetScsiHbaDigestProperties as HostInternetScsiHbaDigestProperties);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HeaderDigestType + \"_\" + HeaderDigestInherited + \"_\" + DataDigestType + \"_\" + DataDigestInherited).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaDiscoveryCapabilities : DynamicData, IEquatable<HostInternetScsiHbaDiscoveryCapabilities>\n    {\n        public bool ISnsDiscoverySettable { get; set; }\n\n        public bool SlpDiscoverySettable { get; set; }\n\n        public bool StaticTargetDiscoverySettable { get; set; }\n\n        public bool SendTargetsDiscoverySettable { get; set; }\n\n        public bool Equals(HostInternetScsiHbaDiscoveryCapabilities hostInternetScsiHbaDiscoveryCapabilities)\n        {\n            return (hostInternetScsiHbaDiscoveryCapabilities != null && this.ISnsDiscoverySettable == hostInternetScsiHbaDiscoveryCapabilities.ISnsDiscoverySettable && this.SlpDiscoverySettable == hostInternetScsiHbaDiscoveryCapabilities.SlpDiscoverySettable && this.StaticTargetDiscoverySettable == hostInternetScsiHbaDiscoveryCapabilities.StaticTargetDiscoverySettable && this.SendTargetsDiscoverySettable == hostInternetScsiHbaDiscoveryCapabilities.SendTargetsDiscoverySettable);\n        }\n\n        public override bool Equals(object hostInternetScsiHbaDiscoveryCapabilities)\n        {\n            return Equals(hostInternetScsiHbaDiscoveryCapabilities as HostInternetScsiHbaDiscoveryCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ISnsDiscoverySettable + \"_\" + SlpDiscoverySettable + \"_\" + StaticTargetDiscoverySettable + \"_\" + SendTargetsDiscoverySettable).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaDiscoveryProperties : DynamicData, IEquatable<HostInternetScsiHbaDiscoveryProperties>\n    {\n        public bool ISnsDiscoveryEnabled { get; set; }\n\n        public string ISnsDiscoveryMethod { get; set; }\n\n        public string ISnsHost { get; set; }\n\n        public bool SlpDiscoveryEnabled { get; set; }\n\n        public string SlpDiscoveryMethod { get; set; }\n\n        public string SlpHost { get; set; }\n\n        public bool StaticTargetDiscoveryEnabled { get; set; }\n\n        public bool SendTargetsDiscoveryEnabled { get; set; }\n\n        public bool Equals(HostInternetScsiHbaDiscoveryProperties hostInternetScsiHbaDiscoveryProperties)\n        {\n            return (hostInternetScsiHbaDiscoveryProperties != null && this.ISnsDiscoveryEnabled == hostInternetScsiHbaDiscoveryProperties.ISnsDiscoveryEnabled && this.ISnsDiscoveryMethod == hostInternetScsiHbaDiscoveryProperties.ISnsDiscoveryMethod && this.ISnsHost == hostInternetScsiHbaDiscoveryProperties.ISnsHost && this.SlpDiscoveryEnabled == hostInternetScsiHbaDiscoveryProperties.SlpDiscoveryEnabled && this.SlpDiscoveryMethod == hostInternetScsiHbaDiscoveryProperties.SlpDiscoveryMethod && this.SlpHost == hostInternetScsiHbaDiscoveryProperties.SlpHost && this.StaticTargetDiscoveryEnabled == hostInternetScsiHbaDiscoveryProperties.StaticTargetDiscoveryEnabled && this.SendTargetsDiscoveryEnabled == hostInternetScsiHbaDiscoveryProperties.SendTargetsDiscoveryEnabled);\n        }\n\n        public override bool Equals(object hostInternetScsiHbaDiscoveryProperties)\n        {\n            return Equals(hostInternetScsiHbaDiscoveryProperties as HostInternetScsiHbaDiscoveryProperties);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ISnsDiscoveryEnabled + \"_\" + ISnsDiscoveryMethod + \"_\" + ISnsHost + \"_\" + SlpDiscoveryEnabled + \"_\" + SlpDiscoveryMethod + \"_\" + SlpHost + \"_\" + StaticTargetDiscoveryEnabled + \"_\" + SendTargetsDiscoveryEnabled).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaIPCapabilities : DynamicData, IEquatable<HostInternetScsiHbaIPCapabilities>\n    {\n        public bool AddressSettable { get; set; }\n\n        public bool IpConfigurationMethodSettable { get; set; }\n\n        public bool SubnetMaskSettable { get; set; }\n\n        public bool DefaultGatewaySettable { get; set; }\n\n        public bool PrimaryDnsServerAddressSettable { get; set; }\n\n        public bool AlternateDnsServerAddressSettable { get; set; }\n\n        public bool? Ipv6Supported { get; set; }\n\n        public bool? ArpRedirectSettable { get; set; }\n\n        public bool? MtuSettable { get; set; }\n\n        public bool? HostNameAsTargetAddress { get; set; }\n\n        public bool? NameAliasSettable { get; set; }\n\n        public bool? Ipv4EnableSettable { get; set; }\n\n        public bool? Ipv6EnableSettable { get; set; }\n\n        public bool? Ipv6PrefixLengthSettable { get; set; }\n\n        public int? Ipv6PrefixLength { get; set; }\n\n        public bool? Ipv6DhcpConfigurationSettable { get; set; }\n\n        public bool? Ipv6LinkLocalAutoConfigurationSettable { get; set; }\n\n        public bool? Ipv6RouterAdvertisementConfigurationSettable { get; set; }\n\n        public bool? Ipv6DefaultGatewaySettable { get; set; }\n\n        public int? Ipv6MaxStaticAddressesSupported { get; set; }\n\n        public bool Equals(HostInternetScsiHbaIPCapabilities hostInternetScsiHbaIPCapabilities)\n        {\n            return (hostInternetScsiHbaIPCapabilities != null && this.AddressSettable == hostInternetScsiHbaIPCapabilities.AddressSettable && this.IpConfigurationMethodSettable == hostInternetScsiHbaIPCapabilities.IpConfigurationMethodSettable && this.SubnetMaskSettable == hostInternetScsiHbaIPCapabilities.SubnetMaskSettable && this.DefaultGatewaySettable == hostInternetScsiHbaIPCapabilities.DefaultGatewaySettable && this.PrimaryDnsServerAddressSettable == hostInternetScsiHbaIPCapabilities.PrimaryDnsServerAddressSettable && this.AlternateDnsServerAddressSettable == hostInternetScsiHbaIPCapabilities.AlternateDnsServerAddressSettable && ((this.Ipv6Supported == null && hostInternetScsiHbaIPCapabilities.Ipv6Supported == null) || (this.Ipv6Supported != null && this.Ipv6Supported.Equals(hostInternetScsiHbaIPCapabilities.Ipv6Supported))) && ((this.ArpRedirectSettable == null && hostInternetScsiHbaIPCapabilities.ArpRedirectSettable == null) || (this.ArpRedirectSettable != null && this.ArpRedirectSettable.Equals(hostInternetScsiHbaIPCapabilities.ArpRedirectSettable))) && ((this.MtuSettable == null && hostInternetScsiHbaIPCapabilities.MtuSettable == null) || (this.MtuSettable != null && this.MtuSettable.Equals(hostInternetScsiHbaIPCapabilities.MtuSettable))) && ((this.HostNameAsTargetAddress == null && hostInternetScsiHbaIPCapabilities.HostNameAsTargetAddress == null) || (this.HostNameAsTargetAddress != null && this.HostNameAsTargetAddress.Equals(hostInternetScsiHbaIPCapabilities.HostNameAsTargetAddress))) && ((this.NameAliasSettable == null && hostInternetScsiHbaIPCapabilities.NameAliasSettable == null) || (this.NameAliasSettable != null && this.NameAliasSettable.Equals(hostInternetScsiHbaIPCapabilities.NameAliasSettable))) && ((this.Ipv4EnableSettable == null && hostInternetScsiHbaIPCapabilities.Ipv4EnableSettable == null) || (this.Ipv4EnableSettable != null && this.Ipv4EnableSettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv4EnableSettable))) && ((this.Ipv6EnableSettable == null && hostInternetScsiHbaIPCapabilities.Ipv6EnableSettable == null) || (this.Ipv6EnableSettable != null && this.Ipv6EnableSettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv6EnableSettable))) && ((this.Ipv6PrefixLengthSettable == null && hostInternetScsiHbaIPCapabilities.Ipv6PrefixLengthSettable == null) || (this.Ipv6PrefixLengthSettable != null && this.Ipv6PrefixLengthSettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv6PrefixLengthSettable))) && ((this.Ipv6PrefixLength == null && hostInternetScsiHbaIPCapabilities.Ipv6PrefixLength == null) || (this.Ipv6PrefixLength != null && this.Ipv6PrefixLength.Equals(hostInternetScsiHbaIPCapabilities.Ipv6PrefixLength))) && ((this.Ipv6DhcpConfigurationSettable == null && hostInternetScsiHbaIPCapabilities.Ipv6DhcpConfigurationSettable == null) || (this.Ipv6DhcpConfigurationSettable != null && this.Ipv6DhcpConfigurationSettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv6DhcpConfigurationSettable))) && ((this.Ipv6LinkLocalAutoConfigurationSettable == null && hostInternetScsiHbaIPCapabilities.Ipv6LinkLocalAutoConfigurationSettable == null) || (this.Ipv6LinkLocalAutoConfigurationSettable != null && this.Ipv6LinkLocalAutoConfigurationSettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv6LinkLocalAutoConfigurationSettable))) && ((this.Ipv6RouterAdvertisementConfigurationSettable == null && hostInternetScsiHbaIPCapabilities.Ipv6RouterAdvertisementConfigurationSettable == null) || (this.Ipv6RouterAdvertisementConfigurationSettable != null && this.Ipv6RouterAdvertisementConfigurationSettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv6RouterAdvertisementConfigurationSettable))) && ((this.Ipv6DefaultGatewaySettable == null && hostInternetScsiHbaIPCapabilities.Ipv6DefaultGatewaySettable == null) || (this.Ipv6DefaultGatewaySettable != null && this.Ipv6DefaultGatewaySettable.Equals(hostInternetScsiHbaIPCapabilities.Ipv6DefaultGatewaySettable))) && ((this.Ipv6MaxStaticAddressesSupported == null && hostInternetScsiHbaIPCapabilities.Ipv6MaxStaticAddressesSupported == null) || (this.Ipv6MaxStaticAddressesSupported != null && this.Ipv6MaxStaticAddressesSupported.Equals(hostInternetScsiHbaIPCapabilities.Ipv6MaxStaticAddressesSupported))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaIPCapabilities)\n        {\n            return Equals(hostInternetScsiHbaIPCapabilities as HostInternetScsiHbaIPCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AddressSettable + \"_\" + IpConfigurationMethodSettable + \"_\" + SubnetMaskSettable + \"_\" + DefaultGatewaySettable + \"_\" + PrimaryDnsServerAddressSettable + \"_\" + AlternateDnsServerAddressSettable + \"_\" + Ipv6Supported + \"_\" + ArpRedirectSettable + \"_\" + MtuSettable + \"_\" + HostNameAsTargetAddress + \"_\" + NameAliasSettable + \"_\" + Ipv4EnableSettable + \"_\" + Ipv6EnableSettable + \"_\" + Ipv6PrefixLengthSettable + \"_\" + Ipv6PrefixLength + \"_\" + Ipv6DhcpConfigurationSettable + \"_\" + Ipv6LinkLocalAutoConfigurationSettable + \"_\" + Ipv6RouterAdvertisementConfigurationSettable + \"_\" + Ipv6DefaultGatewaySettable + \"_\" + Ipv6MaxStaticAddressesSupported).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaIPProperties : DynamicData, IEquatable<HostInternetScsiHbaIPProperties>\n    {\n        public string Mac { get; set; }\n\n        public string Address { get; set; }\n\n        public bool DhcpConfigurationEnabled { get; set; }\n\n        public string SubnetMask { get; set; }\n\n        public string DefaultGateway { get; set; }\n\n        public string PrimaryDnsServerAddress { get; set; }\n\n        public string AlternateDnsServerAddress { get; set; }\n\n        public string Ipv6Address { get; set; }\n\n        public string Ipv6SubnetMask { get; set; }\n\n        public string Ipv6DefaultGateway { get; set; }\n\n        public bool? ArpRedirectEnabled { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public bool? JumboFramesEnabled { get; set; }\n\n        public bool? Ipv4Enabled { get; set; }\n\n        public bool? Ipv6Enabled { get; set; }\n\n        public HostInternetScsiHbaIPv6Properties Ipv6properties { get; set; }\n\n        public bool Equals(HostInternetScsiHbaIPProperties hostInternetScsiHbaIPProperties)\n        {\n            return (hostInternetScsiHbaIPProperties != null && this.Mac == hostInternetScsiHbaIPProperties.Mac && this.Address == hostInternetScsiHbaIPProperties.Address && this.DhcpConfigurationEnabled == hostInternetScsiHbaIPProperties.DhcpConfigurationEnabled && this.SubnetMask == hostInternetScsiHbaIPProperties.SubnetMask && this.DefaultGateway == hostInternetScsiHbaIPProperties.DefaultGateway && this.PrimaryDnsServerAddress == hostInternetScsiHbaIPProperties.PrimaryDnsServerAddress && this.AlternateDnsServerAddress == hostInternetScsiHbaIPProperties.AlternateDnsServerAddress && this.Ipv6Address == hostInternetScsiHbaIPProperties.Ipv6Address && this.Ipv6SubnetMask == hostInternetScsiHbaIPProperties.Ipv6SubnetMask && this.Ipv6DefaultGateway == hostInternetScsiHbaIPProperties.Ipv6DefaultGateway && ((this.ArpRedirectEnabled == null && hostInternetScsiHbaIPProperties.ArpRedirectEnabled == null) || (this.ArpRedirectEnabled != null && this.ArpRedirectEnabled.Equals(hostInternetScsiHbaIPProperties.ArpRedirectEnabled))) && ((this.Mtu == null && hostInternetScsiHbaIPProperties.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(hostInternetScsiHbaIPProperties.Mtu))) && ((this.JumboFramesEnabled == null && hostInternetScsiHbaIPProperties.JumboFramesEnabled == null) || (this.JumboFramesEnabled != null && this.JumboFramesEnabled.Equals(hostInternetScsiHbaIPProperties.JumboFramesEnabled))) && ((this.Ipv4Enabled == null && hostInternetScsiHbaIPProperties.Ipv4Enabled == null) || (this.Ipv4Enabled != null && this.Ipv4Enabled.Equals(hostInternetScsiHbaIPProperties.Ipv4Enabled))) && ((this.Ipv6Enabled == null && hostInternetScsiHbaIPProperties.Ipv6Enabled == null) || (this.Ipv6Enabled != null && this.Ipv6Enabled.Equals(hostInternetScsiHbaIPProperties.Ipv6Enabled))) && ((this.Ipv6properties == null && hostInternetScsiHbaIPProperties.Ipv6properties == null) || (this.Ipv6properties != null && this.Ipv6properties.Equals(hostInternetScsiHbaIPProperties.Ipv6properties))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaIPProperties)\n        {\n            return Equals(hostInternetScsiHbaIPProperties as HostInternetScsiHbaIPProperties);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Mac + \"_\" + Address + \"_\" + DhcpConfigurationEnabled + \"_\" + SubnetMask + \"_\" + DefaultGateway + \"_\" + PrimaryDnsServerAddress + \"_\" + AlternateDnsServerAddress + \"_\" + Ipv6Address + \"_\" + Ipv6SubnetMask + \"_\" + Ipv6DefaultGateway + \"_\" + ArpRedirectEnabled + \"_\" + Mtu + \"_\" + JumboFramesEnabled + \"_\" + Ipv4Enabled + \"_\" + Ipv6Enabled + \"_\" + Ipv6properties).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaIPv6Properties : DynamicData, IEquatable<HostInternetScsiHbaIPv6Properties>\n    {\n        public HostInternetScsiHbaIscsiIpv6Address[] IscsiIpv6Address { get; set; }\n\n        public bool? Ipv6DhcpConfigurationEnabled { get; set; }\n\n        public bool? Ipv6LinkLocalAutoConfigurationEnabled { get; set; }\n\n        public bool? Ipv6RouterAdvertisementConfigurationEnabled { get; set; }\n\n        public string Ipv6DefaultGateway { get; set; }\n\n        public bool Equals(HostInternetScsiHbaIPv6Properties hostInternetScsiHbaIPv6Properties)\n        {\n            return (hostInternetScsiHbaIPv6Properties != null && ((this.IscsiIpv6Address == null && hostInternetScsiHbaIPv6Properties.IscsiIpv6Address == null) || (this.IscsiIpv6Address != null && hostInternetScsiHbaIPv6Properties.IscsiIpv6Address != null && Enumerable.SequenceEqual(this.IscsiIpv6Address, hostInternetScsiHbaIPv6Properties.IscsiIpv6Address))) && ((this.Ipv6DhcpConfigurationEnabled == null && hostInternetScsiHbaIPv6Properties.Ipv6DhcpConfigurationEnabled == null) || (this.Ipv6DhcpConfigurationEnabled != null && this.Ipv6DhcpConfigurationEnabled.Equals(hostInternetScsiHbaIPv6Properties.Ipv6DhcpConfigurationEnabled))) && ((this.Ipv6LinkLocalAutoConfigurationEnabled == null && hostInternetScsiHbaIPv6Properties.Ipv6LinkLocalAutoConfigurationEnabled == null) || (this.Ipv6LinkLocalAutoConfigurationEnabled != null && this.Ipv6LinkLocalAutoConfigurationEnabled.Equals(hostInternetScsiHbaIPv6Properties.Ipv6LinkLocalAutoConfigurationEnabled))) && ((this.Ipv6RouterAdvertisementConfigurationEnabled == null && hostInternetScsiHbaIPv6Properties.Ipv6RouterAdvertisementConfigurationEnabled == null) || (this.Ipv6RouterAdvertisementConfigurationEnabled != null && this.Ipv6RouterAdvertisementConfigurationEnabled.Equals(hostInternetScsiHbaIPv6Properties.Ipv6RouterAdvertisementConfigurationEnabled))) && this.Ipv6DefaultGateway == hostInternetScsiHbaIPv6Properties.Ipv6DefaultGateway);\n        }\n\n        public override bool Equals(object hostInternetScsiHbaIPv6Properties)\n        {\n            return Equals(hostInternetScsiHbaIPv6Properties as HostInternetScsiHbaIPv6Properties);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IscsiIpv6Address + \"_\" + Ipv6DhcpConfigurationEnabled + \"_\" + Ipv6LinkLocalAutoConfigurationEnabled + \"_\" + Ipv6RouterAdvertisementConfigurationEnabled + \"_\" + Ipv6DefaultGateway).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaIscsiIpv6Address : DynamicData, IEquatable<HostInternetScsiHbaIscsiIpv6Address>\n    {\n        public string Address { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public string Origin { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(HostInternetScsiHbaIscsiIpv6Address hostInternetScsiHbaIscsiIpv6Address)\n        {\n            return (hostInternetScsiHbaIscsiIpv6Address != null && this.Address == hostInternetScsiHbaIscsiIpv6Address.Address && this.PrefixLength == hostInternetScsiHbaIscsiIpv6Address.PrefixLength && this.Origin == hostInternetScsiHbaIscsiIpv6Address.Origin && this.Operation == hostInternetScsiHbaIscsiIpv6Address.Operation);\n        }\n\n        public override bool Equals(object hostInternetScsiHbaIscsiIpv6Address)\n        {\n            return Equals(hostInternetScsiHbaIscsiIpv6Address as HostInternetScsiHbaIscsiIpv6Address);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address + \"_\" + PrefixLength + \"_\" + Origin + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaParamValue : OptionValue, IEquatable<HostInternetScsiHbaParamValue>\n    {\n        public bool? IsInherited { get; set; }\n\n        public bool Equals(HostInternetScsiHbaParamValue hostInternetScsiHbaParamValue)\n        {\n            return (hostInternetScsiHbaParamValue != null && ((this.IsInherited == null && hostInternetScsiHbaParamValue.IsInherited == null) || (this.IsInherited != null && this.IsInherited.Equals(hostInternetScsiHbaParamValue.IsInherited))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaParamValue)\n        {\n            return Equals(hostInternetScsiHbaParamValue as HostInternetScsiHbaParamValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsInherited).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaSendTarget : DynamicData, IEquatable<HostInternetScsiHbaSendTarget>\n    {\n        public string Address { get; set; }\n\n        public int? Port { get; set; }\n\n        public HostInternetScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        public HostInternetScsiHbaDigestProperties DigestProperties { get; set; }\n\n        public OptionDef[] SupportedAdvancedOptions { get; set; }\n\n        public HostInternetScsiHbaParamValue[] AdvancedOptions { get; set; }\n\n        public string Parent { get; set; }\n\n        public bool Equals(HostInternetScsiHbaSendTarget hostInternetScsiHbaSendTarget)\n        {\n            return (hostInternetScsiHbaSendTarget != null && this.Address == hostInternetScsiHbaSendTarget.Address && ((this.Port == null && hostInternetScsiHbaSendTarget.Port == null) || (this.Port != null && this.Port.Equals(hostInternetScsiHbaSendTarget.Port))) && ((this.AuthenticationProperties == null && hostInternetScsiHbaSendTarget.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(hostInternetScsiHbaSendTarget.AuthenticationProperties))) && ((this.DigestProperties == null && hostInternetScsiHbaSendTarget.DigestProperties == null) || (this.DigestProperties != null && this.DigestProperties.Equals(hostInternetScsiHbaSendTarget.DigestProperties))) && ((this.SupportedAdvancedOptions == null && hostInternetScsiHbaSendTarget.SupportedAdvancedOptions == null) || (this.SupportedAdvancedOptions != null && hostInternetScsiHbaSendTarget.SupportedAdvancedOptions != null && Enumerable.SequenceEqual(this.SupportedAdvancedOptions, hostInternetScsiHbaSendTarget.SupportedAdvancedOptions))) && ((this.AdvancedOptions == null && hostInternetScsiHbaSendTarget.AdvancedOptions == null) || (this.AdvancedOptions != null && hostInternetScsiHbaSendTarget.AdvancedOptions != null && Enumerable.SequenceEqual(this.AdvancedOptions, hostInternetScsiHbaSendTarget.AdvancedOptions))) && this.Parent == hostInternetScsiHbaSendTarget.Parent);\n        }\n\n        public override bool Equals(object hostInternetScsiHbaSendTarget)\n        {\n            return Equals(hostInternetScsiHbaSendTarget as HostInternetScsiHbaSendTarget);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address + \"_\" + Port + \"_\" + AuthenticationProperties + \"_\" + DigestProperties + \"_\" + SupportedAdvancedOptions + \"_\" + AdvancedOptions + \"_\" + Parent).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaStaticTarget : DynamicData, IEquatable<HostInternetScsiHbaStaticTarget>\n    {\n        public string Address { get; set; }\n\n        public int? Port { get; set; }\n\n        public string IScsiName { get; set; }\n\n        public string DiscoveryMethod { get; set; }\n\n        public HostInternetScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        public HostInternetScsiHbaDigestProperties DigestProperties { get; set; }\n\n        public OptionDef[] SupportedAdvancedOptions { get; set; }\n\n        public HostInternetScsiHbaParamValue[] AdvancedOptions { get; set; }\n\n        public string Parent { get; set; }\n\n        public bool Equals(HostInternetScsiHbaStaticTarget hostInternetScsiHbaStaticTarget)\n        {\n            return (hostInternetScsiHbaStaticTarget != null && this.Address == hostInternetScsiHbaStaticTarget.Address && ((this.Port == null && hostInternetScsiHbaStaticTarget.Port == null) || (this.Port != null && this.Port.Equals(hostInternetScsiHbaStaticTarget.Port))) && this.IScsiName == hostInternetScsiHbaStaticTarget.IScsiName && this.DiscoveryMethod == hostInternetScsiHbaStaticTarget.DiscoveryMethod && ((this.AuthenticationProperties == null && hostInternetScsiHbaStaticTarget.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(hostInternetScsiHbaStaticTarget.AuthenticationProperties))) && ((this.DigestProperties == null && hostInternetScsiHbaStaticTarget.DigestProperties == null) || (this.DigestProperties != null && this.DigestProperties.Equals(hostInternetScsiHbaStaticTarget.DigestProperties))) && ((this.SupportedAdvancedOptions == null && hostInternetScsiHbaStaticTarget.SupportedAdvancedOptions == null) || (this.SupportedAdvancedOptions != null && hostInternetScsiHbaStaticTarget.SupportedAdvancedOptions != null && Enumerable.SequenceEqual(this.SupportedAdvancedOptions, hostInternetScsiHbaStaticTarget.SupportedAdvancedOptions))) && ((this.AdvancedOptions == null && hostInternetScsiHbaStaticTarget.AdvancedOptions == null) || (this.AdvancedOptions != null && hostInternetScsiHbaStaticTarget.AdvancedOptions != null && Enumerable.SequenceEqual(this.AdvancedOptions, hostInternetScsiHbaStaticTarget.AdvancedOptions))) && this.Parent == hostInternetScsiHbaStaticTarget.Parent);\n        }\n\n        public override bool Equals(object hostInternetScsiHbaStaticTarget)\n        {\n            return Equals(hostInternetScsiHbaStaticTarget as HostInternetScsiHbaStaticTarget);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address + \"_\" + Port + \"_\" + IScsiName + \"_\" + DiscoveryMethod + \"_\" + AuthenticationProperties + \"_\" + DigestProperties + \"_\" + SupportedAdvancedOptions + \"_\" + AdvancedOptions + \"_\" + Parent).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiHbaTargetSet : DynamicData, IEquatable<HostInternetScsiHbaTargetSet>\n    {\n        public HostInternetScsiHbaStaticTarget[] StaticTargets { get; set; }\n\n        public HostInternetScsiHbaSendTarget[] SendTargets { get; set; }\n\n        public bool Equals(HostInternetScsiHbaTargetSet hostInternetScsiHbaTargetSet)\n        {\n            return (hostInternetScsiHbaTargetSet != null && ((this.StaticTargets == null && hostInternetScsiHbaTargetSet.StaticTargets == null) || (this.StaticTargets != null && hostInternetScsiHbaTargetSet.StaticTargets != null && Enumerable.SequenceEqual(this.StaticTargets, hostInternetScsiHbaTargetSet.StaticTargets))) && ((this.SendTargets == null && hostInternetScsiHbaTargetSet.SendTargets == null) || (this.SendTargets != null && hostInternetScsiHbaTargetSet.SendTargets != null && Enumerable.SequenceEqual(this.SendTargets, hostInternetScsiHbaTargetSet.SendTargets))));\n        }\n\n        public override bool Equals(object hostInternetScsiHbaTargetSet)\n        {\n            return Equals(hostInternetScsiHbaTargetSet as HostInternetScsiHbaTargetSet);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StaticTargets + \"_\" + SendTargets).GetHashCode();\n        }\n    }\n\n    public class HostInternetScsiTargetTransport : HostTargetTransport, IEquatable<HostInternetScsiTargetTransport>\n    {\n        public string IScsiName { get; set; }\n\n        public string IScsiAlias { get; set; }\n\n        public string[] Address { get; set; }\n\n        public bool Equals(HostInternetScsiTargetTransport hostInternetScsiTargetTransport)\n        {\n            return (hostInternetScsiTargetTransport != null && this.IScsiName == hostInternetScsiTargetTransport.IScsiName && this.IScsiAlias == hostInternetScsiTargetTransport.IScsiAlias && ((this.Address == null && hostInternetScsiTargetTransport.Address == null) || (this.Address != null && hostInternetScsiTargetTransport.Address != null && Enumerable.SequenceEqual(this.Address, hostInternetScsiTargetTransport.Address))));\n        }\n\n        public override bool Equals(object hostInternetScsiTargetTransport)\n        {\n            return Equals(hostInternetScsiTargetTransport as HostInternetScsiTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IScsiName + \"_\" + IScsiAlias + \"_\" + Address).GetHashCode();\n        }\n    }\n\n    public class HostInventoryFull : NotEnoughLicenses, IEquatable<HostInventoryFull>\n    {\n        public int Capacity { get; set; }\n\n        public bool Equals(HostInventoryFull hostInventoryFull)\n        {\n            return (hostInventoryFull != null && this.Capacity == hostInventoryFull.Capacity);\n        }\n\n        public override bool Equals(object hostInventoryFull)\n        {\n            return Equals(hostInventoryFull as HostInventoryFull);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capacity).GetHashCode();\n        }\n    }\n\n    public class HostInventoryFullEvent : LicenseEvent, IEquatable<HostInventoryFullEvent>\n    {\n        public int Capacity { get; set; }\n\n        public bool Equals(HostInventoryFullEvent hostInventoryFullEvent)\n        {\n            return (hostInventoryFullEvent != null && this.Capacity == hostInventoryFullEvent.Capacity);\n        }\n\n        public override bool Equals(object hostInventoryFullEvent)\n        {\n            return Equals(hostInventoryFullEvent as HostInventoryFullEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capacity).GetHashCode();\n        }\n    }\n\n    public class HostInventoryUnreadableEvent : Event, IEquatable<HostInventoryUnreadableEvent>\n    {\n        public bool Equals(HostInventoryUnreadableEvent hostInventoryUnreadableEvent)\n        {\n            return (hostInventoryUnreadableEvent != null && base.Equals(hostInventoryUnreadableEvent));\n        }\n\n        public override bool Equals(object hostInventoryUnreadableEvent)\n        {\n            return Equals(hostInventoryUnreadableEvent as HostInventoryUnreadableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostIoFilterInfo : IoFilterInfo, IEquatable<HostIoFilterInfo>\n    {\n        public bool Available { get; set; }\n\n        public bool Equals(HostIoFilterInfo hostIoFilterInfo)\n        {\n            return (hostIoFilterInfo != null && this.Available == hostIoFilterInfo.Available);\n        }\n\n        public override bool Equals(object hostIoFilterInfo)\n        {\n            return Equals(hostIoFilterInfo as HostIoFilterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Available).GetHashCode();\n        }\n    }\n\n    public class HostIpChangedEvent : HostEvent, IEquatable<HostIpChangedEvent>\n    {\n        public string OldIP { get; set; }\n\n        public string NewIP { get; set; }\n\n        public bool Equals(HostIpChangedEvent hostIpChangedEvent)\n        {\n            return (hostIpChangedEvent != null && this.OldIP == hostIpChangedEvent.OldIP && this.NewIP == hostIpChangedEvent.NewIP);\n        }\n\n        public override bool Equals(object hostIpChangedEvent)\n        {\n            return Equals(hostIpChangedEvent as HostIpChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldIP + \"_\" + NewIP).GetHashCode();\n        }\n    }\n\n    public class HostIpConfig : DynamicData, IEquatable<HostIpConfig>\n    {\n        public bool Dhcp { get; set; }\n\n        public string IpAddress { get; set; }\n\n        public string SubnetMask { get; set; }\n\n        public HostIpConfigIpV6AddressConfiguration IpV6Config { get; set; }\n\n        public bool Equals(HostIpConfig hostIpConfig)\n        {\n            return (hostIpConfig != null && this.Dhcp == hostIpConfig.Dhcp && this.IpAddress == hostIpConfig.IpAddress && this.SubnetMask == hostIpConfig.SubnetMask && ((this.IpV6Config == null && hostIpConfig.IpV6Config == null) || (this.IpV6Config != null && this.IpV6Config.Equals(hostIpConfig.IpV6Config))));\n        }\n\n        public override bool Equals(object hostIpConfig)\n        {\n            return Equals(hostIpConfig as HostIpConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Dhcp + \"_\" + IpAddress + \"_\" + SubnetMask + \"_\" + IpV6Config).GetHashCode();\n        }\n    }\n\n    public class HostIpConfigIpV6Address : DynamicData, IEquatable<HostIpConfigIpV6Address>\n    {\n        public string IpAddress { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public string Origin { get; set; }\n\n        public string DadState { get; set; }\n\n        public DateTime? Lifetime { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(HostIpConfigIpV6Address hostIpConfigIpV6Address)\n        {\n            return (hostIpConfigIpV6Address != null && this.IpAddress == hostIpConfigIpV6Address.IpAddress && this.PrefixLength == hostIpConfigIpV6Address.PrefixLength && this.Origin == hostIpConfigIpV6Address.Origin && this.DadState == hostIpConfigIpV6Address.DadState && ((this.Lifetime == null && hostIpConfigIpV6Address.Lifetime == null) || (this.Lifetime != null && this.Lifetime.Equals(hostIpConfigIpV6Address.Lifetime))) && this.Operation == hostIpConfigIpV6Address.Operation);\n        }\n\n        public override bool Equals(object hostIpConfigIpV6Address)\n        {\n            return Equals(hostIpConfigIpV6Address as HostIpConfigIpV6Address);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + PrefixLength + \"_\" + Origin + \"_\" + DadState + \"_\" + Lifetime + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class HostIpConfigIpV6AddressConfiguration : DynamicData, IEquatable<HostIpConfigIpV6AddressConfiguration>\n    {\n        public HostIpConfigIpV6Address[] IpV6Address { get; set; }\n\n        public bool? AutoConfigurationEnabled { get; set; }\n\n        public bool? DhcpV6Enabled { get; set; }\n\n        public bool Equals(HostIpConfigIpV6AddressConfiguration hostIpConfigIpV6AddressConfiguration)\n        {\n            return (hostIpConfigIpV6AddressConfiguration != null && ((this.IpV6Address == null && hostIpConfigIpV6AddressConfiguration.IpV6Address == null) || (this.IpV6Address != null && hostIpConfigIpV6AddressConfiguration.IpV6Address != null && Enumerable.SequenceEqual(this.IpV6Address, hostIpConfigIpV6AddressConfiguration.IpV6Address))) && ((this.AutoConfigurationEnabled == null && hostIpConfigIpV6AddressConfiguration.AutoConfigurationEnabled == null) || (this.AutoConfigurationEnabled != null && this.AutoConfigurationEnabled.Equals(hostIpConfigIpV6AddressConfiguration.AutoConfigurationEnabled))) && ((this.DhcpV6Enabled == null && hostIpConfigIpV6AddressConfiguration.DhcpV6Enabled == null) || (this.DhcpV6Enabled != null && this.DhcpV6Enabled.Equals(hostIpConfigIpV6AddressConfiguration.DhcpV6Enabled))));\n        }\n\n        public override bool Equals(object hostIpConfigIpV6AddressConfiguration)\n        {\n            return Equals(hostIpConfigIpV6AddressConfiguration as HostIpConfigIpV6AddressConfiguration);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpV6Address + \"_\" + AutoConfigurationEnabled + \"_\" + DhcpV6Enabled).GetHashCode();\n        }\n    }\n\n    public class HostIpInconsistentEvent : HostEvent, IEquatable<HostIpInconsistentEvent>\n    {\n        public string IpAddress { get; set; }\n\n        public string IpAddress2 { get; set; }\n\n        public bool Equals(HostIpInconsistentEvent hostIpInconsistentEvent)\n        {\n            return (hostIpInconsistentEvent != null && this.IpAddress == hostIpInconsistentEvent.IpAddress && this.IpAddress2 == hostIpInconsistentEvent.IpAddress2);\n        }\n\n        public override bool Equals(object hostIpInconsistentEvent)\n        {\n            return Equals(hostIpInconsistentEvent as HostIpInconsistentEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + IpAddress2).GetHashCode();\n        }\n    }\n\n    public class HostIpmiInfo : DynamicData, IEquatable<HostIpmiInfo>\n    {\n        public string BmcIpAddress { get; set; }\n\n        public string BmcMacAddress { get; set; }\n\n        public string Login { get; set; }\n\n        public string Password { get; set; }\n\n        public bool Equals(HostIpmiInfo hostIpmiInfo)\n        {\n            return (hostIpmiInfo != null && this.BmcIpAddress == hostIpmiInfo.BmcIpAddress && this.BmcMacAddress == hostIpmiInfo.BmcMacAddress && this.Login == hostIpmiInfo.Login && this.Password == hostIpmiInfo.Password);\n        }\n\n        public override bool Equals(object hostIpmiInfo)\n        {\n            return Equals(hostIpmiInfo as HostIpmiInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BmcIpAddress + \"_\" + BmcMacAddress + \"_\" + Login + \"_\" + Password).GetHashCode();\n        }\n    }\n\n    public class HostIpRouteConfig : DynamicData, IEquatable<HostIpRouteConfig>\n    {\n        public string DefaultGateway { get; set; }\n\n        public string GatewayDevice { get; set; }\n\n        public string IpV6DefaultGateway { get; set; }\n\n        public string IpV6GatewayDevice { get; set; }\n\n        public bool Equals(HostIpRouteConfig hostIpRouteConfig)\n        {\n            return (hostIpRouteConfig != null && this.DefaultGateway == hostIpRouteConfig.DefaultGateway && this.GatewayDevice == hostIpRouteConfig.GatewayDevice && this.IpV6DefaultGateway == hostIpRouteConfig.IpV6DefaultGateway && this.IpV6GatewayDevice == hostIpRouteConfig.IpV6GatewayDevice);\n        }\n\n        public override bool Equals(object hostIpRouteConfig)\n        {\n            return Equals(hostIpRouteConfig as HostIpRouteConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultGateway + \"_\" + GatewayDevice + \"_\" + IpV6DefaultGateway + \"_\" + IpV6GatewayDevice).GetHashCode();\n        }\n    }\n\n    public class HostIpRouteConfigSpec : HostIpRouteConfig, IEquatable<HostIpRouteConfigSpec>\n    {\n        public HostVirtualNicConnection GatewayDeviceConnection { get; set; }\n\n        public HostVirtualNicConnection IpV6GatewayDeviceConnection { get; set; }\n\n        public bool Equals(HostIpRouteConfigSpec hostIpRouteConfigSpec)\n        {\n            return (hostIpRouteConfigSpec != null && ((this.GatewayDeviceConnection == null && hostIpRouteConfigSpec.GatewayDeviceConnection == null) || (this.GatewayDeviceConnection != null && this.GatewayDeviceConnection.Equals(hostIpRouteConfigSpec.GatewayDeviceConnection))) && ((this.IpV6GatewayDeviceConnection == null && hostIpRouteConfigSpec.IpV6GatewayDeviceConnection == null) || (this.IpV6GatewayDeviceConnection != null && this.IpV6GatewayDeviceConnection.Equals(hostIpRouteConfigSpec.IpV6GatewayDeviceConnection))));\n        }\n\n        public override bool Equals(object hostIpRouteConfigSpec)\n        {\n            return Equals(hostIpRouteConfigSpec as HostIpRouteConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GatewayDeviceConnection + \"_\" + IpV6GatewayDeviceConnection).GetHashCode();\n        }\n    }\n\n    public class HostIpRouteEntry : DynamicData, IEquatable<HostIpRouteEntry>\n    {\n        public string Network { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public string Gateway { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public bool Equals(HostIpRouteEntry hostIpRouteEntry)\n        {\n            return (hostIpRouteEntry != null && this.Network == hostIpRouteEntry.Network && this.PrefixLength == hostIpRouteEntry.PrefixLength && this.Gateway == hostIpRouteEntry.Gateway && this.DeviceName == hostIpRouteEntry.DeviceName);\n        }\n\n        public override bool Equals(object hostIpRouteEntry)\n        {\n            return Equals(hostIpRouteEntry as HostIpRouteEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + PrefixLength + \"_\" + Gateway + \"_\" + DeviceName).GetHashCode();\n        }\n    }\n\n    public class HostIpRouteOp : DynamicData, IEquatable<HostIpRouteOp>\n    {\n        public string ChangeOperation { get; set; }\n\n        public HostIpRouteEntry Route { get; set; }\n\n        public bool Equals(HostIpRouteOp hostIpRouteOp)\n        {\n            return (hostIpRouteOp != null && this.ChangeOperation == hostIpRouteOp.ChangeOperation && ((this.Route == null && hostIpRouteOp.Route == null) || (this.Route != null && this.Route.Equals(hostIpRouteOp.Route))));\n        }\n\n        public override bool Equals(object hostIpRouteOp)\n        {\n            return Equals(hostIpRouteOp as HostIpRouteOp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Route).GetHashCode();\n        }\n    }\n\n    public class HostIpRouteTableConfig : DynamicData, IEquatable<HostIpRouteTableConfig>\n    {\n        public HostIpRouteOp[] IpRoute { get; set; }\n\n        public HostIpRouteOp[] Ipv6Route { get; set; }\n\n        public bool Equals(HostIpRouteTableConfig hostIpRouteTableConfig)\n        {\n            return (hostIpRouteTableConfig != null && ((this.IpRoute == null && hostIpRouteTableConfig.IpRoute == null) || (this.IpRoute != null && hostIpRouteTableConfig.IpRoute != null && Enumerable.SequenceEqual(this.IpRoute, hostIpRouteTableConfig.IpRoute))) && ((this.Ipv6Route == null && hostIpRouteTableConfig.Ipv6Route == null) || (this.Ipv6Route != null && hostIpRouteTableConfig.Ipv6Route != null && Enumerable.SequenceEqual(this.Ipv6Route, hostIpRouteTableConfig.Ipv6Route))));\n        }\n\n        public override bool Equals(object hostIpRouteTableConfig)\n        {\n            return Equals(hostIpRouteTableConfig as HostIpRouteTableConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpRoute + \"_\" + Ipv6Route).GetHashCode();\n        }\n    }\n\n    public class HostIpRouteTableInfo : DynamicData, IEquatable<HostIpRouteTableInfo>\n    {\n        public HostIpRouteEntry[] IpRoute { get; set; }\n\n        public HostIpRouteEntry[] Ipv6Route { get; set; }\n\n        public bool Equals(HostIpRouteTableInfo hostIpRouteTableInfo)\n        {\n            return (hostIpRouteTableInfo != null && ((this.IpRoute == null && hostIpRouteTableInfo.IpRoute == null) || (this.IpRoute != null && hostIpRouteTableInfo.IpRoute != null && Enumerable.SequenceEqual(this.IpRoute, hostIpRouteTableInfo.IpRoute))) && ((this.Ipv6Route == null && hostIpRouteTableInfo.Ipv6Route == null) || (this.Ipv6Route != null && hostIpRouteTableInfo.Ipv6Route != null && Enumerable.SequenceEqual(this.Ipv6Route, hostIpRouteTableInfo.Ipv6Route))));\n        }\n\n        public override bool Equals(object hostIpRouteTableInfo)\n        {\n            return Equals(hostIpRouteTableInfo as HostIpRouteTableInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpRoute + \"_\" + Ipv6Route).GetHashCode();\n        }\n    }\n\n    public class HostIpToShortNameFailedEvent : HostEvent, IEquatable<HostIpToShortNameFailedEvent>\n    {\n        public bool Equals(HostIpToShortNameFailedEvent hostIpToShortNameFailedEvent)\n        {\n            return (hostIpToShortNameFailedEvent != null && base.Equals(hostIpToShortNameFailedEvent));\n        }\n\n        public override bool Equals(object hostIpToShortNameFailedEvent)\n        {\n            return Equals(hostIpToShortNameFailedEvent as HostIpToShortNameFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostIsolationIpPingFailedEvent : HostDasEvent, IEquatable<HostIsolationIpPingFailedEvent>\n    {\n        public string IsolationIp { get; set; }\n\n        public bool Equals(HostIsolationIpPingFailedEvent hostIsolationIpPingFailedEvent)\n        {\n            return (hostIsolationIpPingFailedEvent != null && this.IsolationIp == hostIsolationIpPingFailedEvent.IsolationIp);\n        }\n\n        public override bool Equals(object hostIsolationIpPingFailedEvent)\n        {\n            return Equals(hostIsolationIpPingFailedEvent as HostIsolationIpPingFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsolationIp).GetHashCode();\n        }\n    }\n\n    public class HostKernelModuleSystem : ViewBase, IEquatable<HostKernelModuleSystem>\n    {\n        public KernelModuleInfo[] QueryModules()\n        {\n            return default(KernelModuleInfo[]);\n        }\n\n        public void UpdateModuleOptionString(string name, string options)\n        {\n        }\n\n        public string QueryConfiguredModuleOptionString(string name)\n        {\n            return default(string);\n        }\n\n        public bool Equals(HostKernelModuleSystem hostKernelModuleSystem)\n        {\n            return (hostKernelModuleSystem != null && base.Equals(hostKernelModuleSystem));\n        }\n\n        public override bool Equals(object hostKernelModuleSystem)\n        {\n            return Equals(hostKernelModuleSystem as HostKernelModuleSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostLicensableResourceInfo : DynamicData, IEquatable<HostLicensableResourceInfo>\n    {\n        public KeyAnyValue[] Resource { get; set; }\n\n        public bool Equals(HostLicensableResourceInfo hostLicensableResourceInfo)\n        {\n            return (hostLicensableResourceInfo != null && ((this.Resource == null && hostLicensableResourceInfo.Resource == null) || (this.Resource != null && hostLicensableResourceInfo.Resource != null && Enumerable.SequenceEqual(this.Resource, hostLicensableResourceInfo.Resource))));\n        }\n\n        public override bool Equals(object hostLicensableResourceInfo)\n        {\n            return Equals(hostLicensableResourceInfo as HostLicensableResourceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Resource).GetHashCode();\n        }\n    }\n\n    public class HostLicenseConnectInfo : DynamicData, IEquatable<HostLicenseConnectInfo>\n    {\n        public LicenseManagerLicenseInfo License { get; set; }\n\n        public LicenseManagerEvaluationInfo Evaluation { get; set; }\n\n        public HostLicensableResourceInfo Resource { get; set; }\n\n        public bool Equals(HostLicenseConnectInfo hostLicenseConnectInfo)\n        {\n            return (hostLicenseConnectInfo != null && ((this.License == null && hostLicenseConnectInfo.License == null) || (this.License != null && this.License.Equals(hostLicenseConnectInfo.License))) && ((this.Evaluation == null && hostLicenseConnectInfo.Evaluation == null) || (this.Evaluation != null && this.Evaluation.Equals(hostLicenseConnectInfo.Evaluation))) && ((this.Resource == null && hostLicenseConnectInfo.Resource == null) || (this.Resource != null && this.Resource.Equals(hostLicenseConnectInfo.Resource))));\n        }\n\n        public override bool Equals(object hostLicenseConnectInfo)\n        {\n            return Equals(hostLicenseConnectInfo as HostLicenseConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (License + \"_\" + Evaluation + \"_\" + Resource).GetHashCode();\n        }\n    }\n\n    public class HostLicenseExpiredEvent : LicenseEvent, IEquatable<HostLicenseExpiredEvent>\n    {\n        public bool Equals(HostLicenseExpiredEvent hostLicenseExpiredEvent)\n        {\n            return (hostLicenseExpiredEvent != null && base.Equals(hostLicenseExpiredEvent));\n        }\n\n        public override bool Equals(object hostLicenseExpiredEvent)\n        {\n            return Equals(hostLicenseExpiredEvent as HostLicenseExpiredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostLicenseSpec : DynamicData, IEquatable<HostLicenseSpec>\n    {\n        public LicenseSource Source { get; set; }\n\n        public string EditionKey { get; set; }\n\n        public string[] DisabledFeatureKey { get; set; }\n\n        public string[] EnabledFeatureKey { get; set; }\n\n        public bool Equals(HostLicenseSpec hostLicenseSpec)\n        {\n            return (hostLicenseSpec != null && ((this.Source == null && hostLicenseSpec.Source == null) || (this.Source != null && this.Source.Equals(hostLicenseSpec.Source))) && this.EditionKey == hostLicenseSpec.EditionKey && ((this.DisabledFeatureKey == null && hostLicenseSpec.DisabledFeatureKey == null) || (this.DisabledFeatureKey != null && hostLicenseSpec.DisabledFeatureKey != null && Enumerable.SequenceEqual(this.DisabledFeatureKey, hostLicenseSpec.DisabledFeatureKey))) && ((this.EnabledFeatureKey == null && hostLicenseSpec.EnabledFeatureKey == null) || (this.EnabledFeatureKey != null && hostLicenseSpec.EnabledFeatureKey != null && Enumerable.SequenceEqual(this.EnabledFeatureKey, hostLicenseSpec.EnabledFeatureKey))));\n        }\n\n        public override bool Equals(object hostLicenseSpec)\n        {\n            return Equals(hostLicenseSpec as HostLicenseSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + EditionKey + \"_\" + DisabledFeatureKey + \"_\" + EnabledFeatureKey).GetHashCode();\n        }\n    }\n\n    public class HostListSummary : DynamicData, IEquatable<HostListSummary>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public HostHardwareSummary Hardware { get; set; }\n\n        public HostRuntimeInfo Runtime { get; set; }\n\n        public HostConfigSummary Config { get; set; }\n\n        public HostListSummaryQuickStats QuickStats { get; set; }\n\n        public ManagedEntityStatus OverallStatus { get; set; }\n\n        public bool RebootRequired { get; set; }\n\n        public CustomFieldValue[] CustomValue { get; set; }\n\n        public string ManagementServerIp { get; set; }\n\n        public string MaxEVCModeKey { get; set; }\n\n        public string CurrentEVCModeKey { get; set; }\n\n        public HostListSummaryGatewaySummary Gateway { get; set; }\n\n        public HostTpmAttestationInfo TpmAttestation { get; set; }\n\n        public HostListSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostListSummary hostListSummary)\n        {\n            return (hostListSummary != null && ((this.Host == null && hostListSummary.Host == null) || (this.Host != null && this.Host.Equals(hostListSummary.Host))) && ((this.Hardware == null && hostListSummary.Hardware == null) || (this.Hardware != null && this.Hardware.Equals(hostListSummary.Hardware))) && ((this.Runtime == null && hostListSummary.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(hostListSummary.Runtime))) && ((this.Config == null && hostListSummary.Config == null) || (this.Config != null && this.Config.Equals(hostListSummary.Config))) && ((this.QuickStats == null && hostListSummary.QuickStats == null) || (this.QuickStats != null && this.QuickStats.Equals(hostListSummary.QuickStats))) && this.OverallStatus == hostListSummary.OverallStatus && this.RebootRequired == hostListSummary.RebootRequired && ((this.CustomValue == null && hostListSummary.CustomValue == null) || (this.CustomValue != null && hostListSummary.CustomValue != null && Enumerable.SequenceEqual(this.CustomValue, hostListSummary.CustomValue))) && this.ManagementServerIp == hostListSummary.ManagementServerIp && this.MaxEVCModeKey == hostListSummary.MaxEVCModeKey && this.CurrentEVCModeKey == hostListSummary.CurrentEVCModeKey && ((this.Gateway == null && hostListSummary.Gateway == null) || (this.Gateway != null && this.Gateway.Equals(hostListSummary.Gateway))) && ((this.TpmAttestation == null && hostListSummary.TpmAttestation == null) || (this.TpmAttestation != null && this.TpmAttestation.Equals(hostListSummary.TpmAttestation))) && ((this.LinkedView == null && hostListSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostListSummary.LinkedView))));\n        }\n\n        public override bool Equals(object hostListSummary)\n        {\n            return Equals(hostListSummary as HostListSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Hardware + \"_\" + Runtime + \"_\" + Config + \"_\" + QuickStats + \"_\" + OverallStatus + \"_\" + RebootRequired + \"_\" + CustomValue + \"_\" + ManagementServerIp + \"_\" + MaxEVCModeKey + \"_\" + CurrentEVCModeKey + \"_\" + Gateway + \"_\" + TpmAttestation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostListSummary_LinkedView : IEquatable<HostListSummary_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostListSummary_LinkedView hostListSummary_LinkedView)\n        {\n            return (hostListSummary_LinkedView != null && ((this.Host == null && hostListSummary_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostListSummary_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostListSummary_LinkedView)\n        {\n            return Equals(hostListSummary_LinkedView as HostListSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostListSummaryGatewaySummary : DynamicData, IEquatable<HostListSummaryGatewaySummary>\n    {\n        public string GatewayType { get; set; }\n\n        public string GatewayId { get; set; }\n\n        public bool Equals(HostListSummaryGatewaySummary hostListSummaryGatewaySummary)\n        {\n            return (hostListSummaryGatewaySummary != null && this.GatewayType == hostListSummaryGatewaySummary.GatewayType && this.GatewayId == hostListSummaryGatewaySummary.GatewayId);\n        }\n\n        public override bool Equals(object hostListSummaryGatewaySummary)\n        {\n            return Equals(hostListSummaryGatewaySummary as HostListSummaryGatewaySummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GatewayType + \"_\" + GatewayId).GetHashCode();\n        }\n    }\n\n    public class HostListSummaryQuickStats : DynamicData, IEquatable<HostListSummaryQuickStats>\n    {\n        public int? OverallCpuUsage { get; set; }\n\n        public int? OverallMemoryUsage { get; set; }\n\n        public int? DistributedCpuFairness { get; set; }\n\n        public int? DistributedMemoryFairness { get; set; }\n\n        public int? AvailablePMemCapacity { get; set; }\n\n        public int? Uptime { get; set; }\n\n        public bool Equals(HostListSummaryQuickStats hostListSummaryQuickStats)\n        {\n            return (hostListSummaryQuickStats != null && ((this.OverallCpuUsage == null && hostListSummaryQuickStats.OverallCpuUsage == null) || (this.OverallCpuUsage != null && this.OverallCpuUsage.Equals(hostListSummaryQuickStats.OverallCpuUsage))) && ((this.OverallMemoryUsage == null && hostListSummaryQuickStats.OverallMemoryUsage == null) || (this.OverallMemoryUsage != null && this.OverallMemoryUsage.Equals(hostListSummaryQuickStats.OverallMemoryUsage))) && ((this.DistributedCpuFairness == null && hostListSummaryQuickStats.DistributedCpuFairness == null) || (this.DistributedCpuFairness != null && this.DistributedCpuFairness.Equals(hostListSummaryQuickStats.DistributedCpuFairness))) && ((this.DistributedMemoryFairness == null && hostListSummaryQuickStats.DistributedMemoryFairness == null) || (this.DistributedMemoryFairness != null && this.DistributedMemoryFairness.Equals(hostListSummaryQuickStats.DistributedMemoryFairness))) && ((this.AvailablePMemCapacity == null && hostListSummaryQuickStats.AvailablePMemCapacity == null) || (this.AvailablePMemCapacity != null && this.AvailablePMemCapacity.Equals(hostListSummaryQuickStats.AvailablePMemCapacity))) && ((this.Uptime == null && hostListSummaryQuickStats.Uptime == null) || (this.Uptime != null && this.Uptime.Equals(hostListSummaryQuickStats.Uptime))));\n        }\n\n        public override bool Equals(object hostListSummaryQuickStats)\n        {\n            return Equals(hostListSummaryQuickStats as HostListSummaryQuickStats);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OverallCpuUsage + \"_\" + OverallMemoryUsage + \"_\" + DistributedCpuFairness + \"_\" + DistributedMemoryFairness + \"_\" + AvailablePMemCapacity + \"_\" + Uptime).GetHashCode();\n        }\n    }\n\n    public class HostLocalAccountManager : ViewBase, IEquatable<HostLocalAccountManager>\n    {\n        public void CreateUser(HostAccountSpec user)\n        {\n        }\n\n        public void UpdateUser(HostAccountSpec user)\n        {\n        }\n\n        public void CreateGroup(HostAccountSpec group)\n        {\n        }\n\n        public void RemoveUser(string userName)\n        {\n        }\n\n        public void RemoveGroup(string groupName)\n        {\n        }\n\n        public void AssignUserToGroup(string user, string group)\n        {\n        }\n\n        public void UnassignUserFromGroup(string user, string group)\n        {\n        }\n\n        public bool Equals(HostLocalAccountManager hostLocalAccountManager)\n        {\n            return (hostLocalAccountManager != null && base.Equals(hostLocalAccountManager));\n        }\n\n        public override bool Equals(object hostLocalAccountManager)\n        {\n            return Equals(hostLocalAccountManager as HostLocalAccountManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostLocalAuthentication : HostAuthenticationStore, IEquatable<HostLocalAuthentication>\n    {\n        public bool Equals(HostLocalAuthentication hostLocalAuthentication)\n        {\n            return (hostLocalAuthentication != null && base.Equals(hostLocalAuthentication));\n        }\n\n        public override bool Equals(object hostLocalAuthentication)\n        {\n            return Equals(hostLocalAuthentication as HostLocalAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostLocalAuthenticationInfo : HostAuthenticationStoreInfo, IEquatable<HostLocalAuthenticationInfo>\n    {\n        public bool Equals(HostLocalAuthenticationInfo hostLocalAuthenticationInfo)\n        {\n            return (hostLocalAuthenticationInfo != null && base.Equals(hostLocalAuthenticationInfo));\n        }\n\n        public override bool Equals(object hostLocalAuthenticationInfo)\n        {\n            return Equals(hostLocalAuthenticationInfo as HostLocalAuthenticationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostLocalFileSystemVolume : HostFileSystemVolume, IEquatable<HostLocalFileSystemVolume>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(HostLocalFileSystemVolume hostLocalFileSystemVolume)\n        {\n            return (hostLocalFileSystemVolume != null && this.Device == hostLocalFileSystemVolume.Device);\n        }\n\n        public override bool Equals(object hostLocalFileSystemVolume)\n        {\n            return Equals(hostLocalFileSystemVolume as HostLocalFileSystemVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class HostLocalFileSystemVolumeSpec : DynamicData, IEquatable<HostLocalFileSystemVolumeSpec>\n    {\n        public string Device { get; set; }\n\n        public string LocalPath { get; set; }\n\n        public bool Equals(HostLocalFileSystemVolumeSpec hostLocalFileSystemVolumeSpec)\n        {\n            return (hostLocalFileSystemVolumeSpec != null && this.Device == hostLocalFileSystemVolumeSpec.Device && this.LocalPath == hostLocalFileSystemVolumeSpec.LocalPath);\n        }\n\n        public override bool Equals(object hostLocalFileSystemVolumeSpec)\n        {\n            return Equals(hostLocalFileSystemVolumeSpec as HostLocalFileSystemVolumeSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + LocalPath).GetHashCode();\n        }\n    }\n\n    public class HostLocalPortCreatedEvent : DvsEvent, IEquatable<HostLocalPortCreatedEvent>\n    {\n        public DVSHostLocalPortInfo HostLocalPort { get; set; }\n\n        public bool Equals(HostLocalPortCreatedEvent hostLocalPortCreatedEvent)\n        {\n            return (hostLocalPortCreatedEvent != null && ((this.HostLocalPort == null && hostLocalPortCreatedEvent.HostLocalPort == null) || (this.HostLocalPort != null && this.HostLocalPort.Equals(hostLocalPortCreatedEvent.HostLocalPort))));\n        }\n\n        public override bool Equals(object hostLocalPortCreatedEvent)\n        {\n            return Equals(hostLocalPortCreatedEvent as HostLocalPortCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostLocalPort).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerDiskLayoutSpec : DynamicData, IEquatable<HostLowLevelProvisioningManagerDiskLayoutSpec>\n    {\n        public string ControllerType { get; set; }\n\n        public int BusNumber { get; set; }\n\n        public int UnitNumber { get; set; }\n\n        public string SrcFilename { get; set; }\n\n        public string DstFilename { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerDiskLayoutSpec hostLowLevelProvisioningManagerDiskLayoutSpec)\n        {\n            return (hostLowLevelProvisioningManagerDiskLayoutSpec != null && this.ControllerType == hostLowLevelProvisioningManagerDiskLayoutSpec.ControllerType && this.BusNumber == hostLowLevelProvisioningManagerDiskLayoutSpec.BusNumber && this.UnitNumber == hostLowLevelProvisioningManagerDiskLayoutSpec.UnitNumber && this.SrcFilename == hostLowLevelProvisioningManagerDiskLayoutSpec.SrcFilename && this.DstFilename == hostLowLevelProvisioningManagerDiskLayoutSpec.DstFilename);\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerDiskLayoutSpec)\n        {\n            return Equals(hostLowLevelProvisioningManagerDiskLayoutSpec as HostLowLevelProvisioningManagerDiskLayoutSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ControllerType + \"_\" + BusNumber + \"_\" + UnitNumber + \"_\" + SrcFilename + \"_\" + DstFilename).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerFileDeleteResult : DynamicData, IEquatable<HostLowLevelProvisioningManagerFileDeleteResult>\n    {\n        public string FileName { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerFileDeleteResult hostLowLevelProvisioningManagerFileDeleteResult)\n        {\n            return (hostLowLevelProvisioningManagerFileDeleteResult != null && this.FileName == hostLowLevelProvisioningManagerFileDeleteResult.FileName && ((this.Fault == null && hostLowLevelProvisioningManagerFileDeleteResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostLowLevelProvisioningManagerFileDeleteResult.Fault))));\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerFileDeleteResult)\n        {\n            return Equals(hostLowLevelProvisioningManagerFileDeleteResult as HostLowLevelProvisioningManagerFileDeleteResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileName + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerFileDeleteSpec : DynamicData, IEquatable<HostLowLevelProvisioningManagerFileDeleteSpec>\n    {\n        public string FileName { get; set; }\n\n        public string FileType { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerFileDeleteSpec hostLowLevelProvisioningManagerFileDeleteSpec)\n        {\n            return (hostLowLevelProvisioningManagerFileDeleteSpec != null && this.FileName == hostLowLevelProvisioningManagerFileDeleteSpec.FileName && this.FileType == hostLowLevelProvisioningManagerFileDeleteSpec.FileType);\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerFileDeleteSpec)\n        {\n            return Equals(hostLowLevelProvisioningManagerFileDeleteSpec as HostLowLevelProvisioningManagerFileDeleteSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileName + \"_\" + FileType).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerFileReserveResult : DynamicData, IEquatable<HostLowLevelProvisioningManagerFileReserveResult>\n    {\n        public string BaseName { get; set; }\n\n        public string ParentDir { get; set; }\n\n        public string ReservedName { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerFileReserveResult hostLowLevelProvisioningManagerFileReserveResult)\n        {\n            return (hostLowLevelProvisioningManagerFileReserveResult != null && this.BaseName == hostLowLevelProvisioningManagerFileReserveResult.BaseName && this.ParentDir == hostLowLevelProvisioningManagerFileReserveResult.ParentDir && this.ReservedName == hostLowLevelProvisioningManagerFileReserveResult.ReservedName);\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerFileReserveResult)\n        {\n            return Equals(hostLowLevelProvisioningManagerFileReserveResult as HostLowLevelProvisioningManagerFileReserveResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BaseName + \"_\" + ParentDir + \"_\" + ReservedName).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerFileReserveSpec : DynamicData, IEquatable<HostLowLevelProvisioningManagerFileReserveSpec>\n    {\n        public string BaseName { get; set; }\n\n        public string ParentDir { get; set; }\n\n        public string FileType { get; set; }\n\n        public string StorageProfile { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerFileReserveSpec hostLowLevelProvisioningManagerFileReserveSpec)\n        {\n            return (hostLowLevelProvisioningManagerFileReserveSpec != null && this.BaseName == hostLowLevelProvisioningManagerFileReserveSpec.BaseName && this.ParentDir == hostLowLevelProvisioningManagerFileReserveSpec.ParentDir && this.FileType == hostLowLevelProvisioningManagerFileReserveSpec.FileType && this.StorageProfile == hostLowLevelProvisioningManagerFileReserveSpec.StorageProfile);\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerFileReserveSpec)\n        {\n            return Equals(hostLowLevelProvisioningManagerFileReserveSpec as HostLowLevelProvisioningManagerFileReserveSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BaseName + \"_\" + ParentDir + \"_\" + FileType + \"_\" + StorageProfile).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerSnapshotLayoutSpec : DynamicData, IEquatable<HostLowLevelProvisioningManagerSnapshotLayoutSpec>\n    {\n        public int Id { get; set; }\n\n        public string SrcFilename { get; set; }\n\n        public string DstFilename { get; set; }\n\n        public HostLowLevelProvisioningManagerDiskLayoutSpec[] Disk { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerSnapshotLayoutSpec hostLowLevelProvisioningManagerSnapshotLayoutSpec)\n        {\n            return (hostLowLevelProvisioningManagerSnapshotLayoutSpec != null && this.Id == hostLowLevelProvisioningManagerSnapshotLayoutSpec.Id && this.SrcFilename == hostLowLevelProvisioningManagerSnapshotLayoutSpec.SrcFilename && this.DstFilename == hostLowLevelProvisioningManagerSnapshotLayoutSpec.DstFilename && ((this.Disk == null && hostLowLevelProvisioningManagerSnapshotLayoutSpec.Disk == null) || (this.Disk != null && hostLowLevelProvisioningManagerSnapshotLayoutSpec.Disk != null && Enumerable.SequenceEqual(this.Disk, hostLowLevelProvisioningManagerSnapshotLayoutSpec.Disk))));\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerSnapshotLayoutSpec)\n        {\n            return Equals(hostLowLevelProvisioningManagerSnapshotLayoutSpec as HostLowLevelProvisioningManagerSnapshotLayoutSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + SrcFilename + \"_\" + DstFilename + \"_\" + Disk).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerVmMigrationStatus : DynamicData, IEquatable<HostLowLevelProvisioningManagerVmMigrationStatus>\n    {\n        public long MigrationId { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Source { get; set; }\n\n        public bool ConsideredSuccessful { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerVmMigrationStatus hostLowLevelProvisioningManagerVmMigrationStatus)\n        {\n            return (hostLowLevelProvisioningManagerVmMigrationStatus != null && this.MigrationId == hostLowLevelProvisioningManagerVmMigrationStatus.MigrationId && this.Type == hostLowLevelProvisioningManagerVmMigrationStatus.Type && this.Source == hostLowLevelProvisioningManagerVmMigrationStatus.Source && this.ConsideredSuccessful == hostLowLevelProvisioningManagerVmMigrationStatus.ConsideredSuccessful);\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerVmMigrationStatus)\n        {\n            return Equals(hostLowLevelProvisioningManagerVmMigrationStatus as HostLowLevelProvisioningManagerVmMigrationStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MigrationId + \"_\" + Type + \"_\" + Source + \"_\" + ConsideredSuccessful).GetHashCode();\n        }\n    }\n\n    public class HostLowLevelProvisioningManagerVmRecoveryInfo : DynamicData, IEquatable<HostLowLevelProvisioningManagerVmRecoveryInfo>\n    {\n        public string Version { get; set; }\n\n        public string BiosUUID { get; set; }\n\n        public string InstanceUUID { get; set; }\n\n        public FaultToleranceConfigInfo FtInfo { get; set; }\n\n        public bool Equals(HostLowLevelProvisioningManagerVmRecoveryInfo hostLowLevelProvisioningManagerVmRecoveryInfo)\n        {\n            return (hostLowLevelProvisioningManagerVmRecoveryInfo != null && this.Version == hostLowLevelProvisioningManagerVmRecoveryInfo.Version && this.BiosUUID == hostLowLevelProvisioningManagerVmRecoveryInfo.BiosUUID && this.InstanceUUID == hostLowLevelProvisioningManagerVmRecoveryInfo.InstanceUUID && ((this.FtInfo == null && hostLowLevelProvisioningManagerVmRecoveryInfo.FtInfo == null) || (this.FtInfo != null && this.FtInfo.Equals(hostLowLevelProvisioningManagerVmRecoveryInfo.FtInfo))));\n        }\n\n        public override bool Equals(object hostLowLevelProvisioningManagerVmRecoveryInfo)\n        {\n            return Equals(hostLowLevelProvisioningManagerVmRecoveryInfo as HostLowLevelProvisioningManagerVmRecoveryInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version + \"_\" + BiosUUID + \"_\" + InstanceUUID + \"_\" + FtInfo).GetHashCode();\n        }\n    }\n\n    public class HostMaintenanceSpec : DynamicData, IEquatable<HostMaintenanceSpec>\n    {\n        public VsanHostDecommissionMode VsanMode { get; set; }\n\n        public bool Equals(HostMaintenanceSpec hostMaintenanceSpec)\n        {\n            return (hostMaintenanceSpec != null && ((this.VsanMode == null && hostMaintenanceSpec.VsanMode == null) || (this.VsanMode != null && this.VsanMode.Equals(hostMaintenanceSpec.VsanMode))));\n        }\n\n        public override bool Equals(object hostMaintenanceSpec)\n        {\n            return Equals(hostMaintenanceSpec as HostMaintenanceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VsanMode).GetHashCode();\n        }\n    }\n\n    public class HostMemberHealthCheckResult : DynamicData, IEquatable<HostMemberHealthCheckResult>\n    {\n        public string Summary { get; set; }\n\n        public bool Equals(HostMemberHealthCheckResult hostMemberHealthCheckResult)\n        {\n            return (hostMemberHealthCheckResult != null && this.Summary == hostMemberHealthCheckResult.Summary);\n        }\n\n        public override bool Equals(object hostMemberHealthCheckResult)\n        {\n            return Equals(hostMemberHealthCheckResult as HostMemberHealthCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Summary).GetHashCode();\n        }\n    }\n\n    public class HostMemberRuntimeInfo : DynamicData, IEquatable<HostMemberRuntimeInfo>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string Status { get; set; }\n\n        public string StatusDetail { get; set; }\n\n        public HostMemberHealthCheckResult[] HealthCheckResult { get; set; }\n\n        public HostMemberRuntimeInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostMemberRuntimeInfo hostMemberRuntimeInfo)\n        {\n            return (hostMemberRuntimeInfo != null && ((this.Host == null && hostMemberRuntimeInfo.Host == null) || (this.Host != null && this.Host.Equals(hostMemberRuntimeInfo.Host))) && this.Status == hostMemberRuntimeInfo.Status && this.StatusDetail == hostMemberRuntimeInfo.StatusDetail && ((this.HealthCheckResult == null && hostMemberRuntimeInfo.HealthCheckResult == null) || (this.HealthCheckResult != null && hostMemberRuntimeInfo.HealthCheckResult != null && Enumerable.SequenceEqual(this.HealthCheckResult, hostMemberRuntimeInfo.HealthCheckResult))) && ((this.LinkedView == null && hostMemberRuntimeInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostMemberRuntimeInfo.LinkedView))));\n        }\n\n        public override bool Equals(object hostMemberRuntimeInfo)\n        {\n            return Equals(hostMemberRuntimeInfo as HostMemberRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Status + \"_\" + StatusDetail + \"_\" + HealthCheckResult + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostMemberRuntimeInfo_LinkedView : IEquatable<HostMemberRuntimeInfo_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostMemberRuntimeInfo_LinkedView hostMemberRuntimeInfo_LinkedView)\n        {\n            return (hostMemberRuntimeInfo_LinkedView != null && ((this.Host == null && hostMemberRuntimeInfo_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostMemberRuntimeInfo_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostMemberRuntimeInfo_LinkedView)\n        {\n            return Equals(hostMemberRuntimeInfo_LinkedView as HostMemberRuntimeInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostMemberUplinkHealthCheckResult : HostMemberHealthCheckResult, IEquatable<HostMemberUplinkHealthCheckResult>\n    {\n        public string UplinkPortKey { get; set; }\n\n        public bool Equals(HostMemberUplinkHealthCheckResult hostMemberUplinkHealthCheckResult)\n        {\n            return (hostMemberUplinkHealthCheckResult != null && this.UplinkPortKey == hostMemberUplinkHealthCheckResult.UplinkPortKey);\n        }\n\n        public override bool Equals(object hostMemberUplinkHealthCheckResult)\n        {\n            return Equals(hostMemberUplinkHealthCheckResult as HostMemberUplinkHealthCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UplinkPortKey).GetHashCode();\n        }\n    }\n\n    public class HostMemoryProfile : ApplyProfile, IEquatable<HostMemoryProfile>\n    {\n        public bool Equals(HostMemoryProfile hostMemoryProfile)\n        {\n            return (hostMemoryProfile != null && base.Equals(hostMemoryProfile));\n        }\n\n        public override bool Equals(object hostMemoryProfile)\n        {\n            return Equals(hostMemoryProfile as HostMemoryProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostMemorySpec : DynamicData, IEquatable<HostMemorySpec>\n    {\n        public long? ServiceConsoleReservation { get; set; }\n\n        public bool Equals(HostMemorySpec hostMemorySpec)\n        {\n            return (hostMemorySpec != null && ((this.ServiceConsoleReservation == null && hostMemorySpec.ServiceConsoleReservation == null) || (this.ServiceConsoleReservation != null && this.ServiceConsoleReservation.Equals(hostMemorySpec.ServiceConsoleReservation))));\n        }\n\n        public override bool Equals(object hostMemorySpec)\n        {\n            return Equals(hostMemorySpec as HostMemorySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceConsoleReservation).GetHashCode();\n        }\n    }\n\n    public class HostMemorySystem : ExtensibleManagedObject, IEquatable<HostMemorySystem>\n    {\n        public ServiceConsoleReservationInfo ConsoleReservationInfo { get; set; }\n\n        public VirtualMachineMemoryReservationInfo VirtualMachineReservationInfo { get; set; }\n\n        public void ReconfigureServiceConsoleReservation(long cfgBytes)\n        {\n        }\n\n        public void ReconfigureVirtualMachineReservation(VirtualMachineMemoryReservationSpec spec)\n        {\n        }\n\n        public bool Equals(HostMemorySystem hostMemorySystem)\n        {\n            return (hostMemorySystem != null && ((this.ConsoleReservationInfo == null && hostMemorySystem.ConsoleReservationInfo == null) || (this.ConsoleReservationInfo != null && this.ConsoleReservationInfo.Equals(hostMemorySystem.ConsoleReservationInfo))) && ((this.VirtualMachineReservationInfo == null && hostMemorySystem.VirtualMachineReservationInfo == null) || (this.VirtualMachineReservationInfo != null && this.VirtualMachineReservationInfo.Equals(hostMemorySystem.VirtualMachineReservationInfo))));\n        }\n\n        public override bool Equals(object hostMemorySystem)\n        {\n            return Equals(hostMemorySystem as HostMemorySystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConsoleReservationInfo + \"_\" + VirtualMachineReservationInfo).GetHashCode();\n        }\n    }\n\n    public class HostMissingNetworksEvent : HostDasEvent, IEquatable<HostMissingNetworksEvent>\n    {\n        public string Ips { get; set; }\n\n        public bool Equals(HostMissingNetworksEvent hostMissingNetworksEvent)\n        {\n            return (hostMissingNetworksEvent != null && this.Ips == hostMissingNetworksEvent.Ips);\n        }\n\n        public override bool Equals(object hostMissingNetworksEvent)\n        {\n            return Equals(hostMissingNetworksEvent as HostMissingNetworksEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ips).GetHashCode();\n        }\n    }\n\n    public class HostMonitoringStateChangedEvent : ClusterEvent, IEquatable<HostMonitoringStateChangedEvent>\n    {\n        public string State { get; set; }\n\n        public string PrevState { get; set; }\n\n        public bool Equals(HostMonitoringStateChangedEvent hostMonitoringStateChangedEvent)\n        {\n            return (hostMonitoringStateChangedEvent != null && this.State == hostMonitoringStateChangedEvent.State && this.PrevState == hostMonitoringStateChangedEvent.PrevState);\n        }\n\n        public override bool Equals(object hostMonitoringStateChangedEvent)\n        {\n            return Equals(hostMonitoringStateChangedEvent as HostMonitoringStateChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + PrevState).GetHashCode();\n        }\n    }\n\n    public class HostMountInfo : DynamicData, IEquatable<HostMountInfo>\n    {\n        public string Path { get; set; }\n\n        public string AccessMode { get; set; }\n\n        public bool? Mounted { get; set; }\n\n        public bool? Accessible { get; set; }\n\n        public string InaccessibleReason { get; set; }\n\n        public bool Equals(HostMountInfo hostMountInfo)\n        {\n            return (hostMountInfo != null && this.Path == hostMountInfo.Path && this.AccessMode == hostMountInfo.AccessMode && ((this.Mounted == null && hostMountInfo.Mounted == null) || (this.Mounted != null && this.Mounted.Equals(hostMountInfo.Mounted))) && ((this.Accessible == null && hostMountInfo.Accessible == null) || (this.Accessible != null && this.Accessible.Equals(hostMountInfo.Accessible))) && this.InaccessibleReason == hostMountInfo.InaccessibleReason);\n        }\n\n        public override bool Equals(object hostMountInfo)\n        {\n            return Equals(hostMountInfo as HostMountInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path + \"_\" + AccessMode + \"_\" + Mounted + \"_\" + Accessible + \"_\" + InaccessibleReason).GetHashCode();\n        }\n    }\n\n    public class HostMultipathInfo : DynamicData, IEquatable<HostMultipathInfo>\n    {\n        public HostMultipathInfoLogicalUnit[] Lun { get; set; }\n\n        public bool Equals(HostMultipathInfo hostMultipathInfo)\n        {\n            return (hostMultipathInfo != null && ((this.Lun == null && hostMultipathInfo.Lun == null) || (this.Lun != null && hostMultipathInfo.Lun != null && Enumerable.SequenceEqual(this.Lun, hostMultipathInfo.Lun))));\n        }\n\n        public override bool Equals(object hostMultipathInfo)\n        {\n            return Equals(hostMultipathInfo as HostMultipathInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Lun).GetHashCode();\n        }\n    }\n\n    public class HostMultipathInfoFixedLogicalUnitPolicy : HostMultipathInfoLogicalUnitPolicy, IEquatable<HostMultipathInfoFixedLogicalUnitPolicy>\n    {\n        public string Prefer { get; set; }\n\n        public bool Equals(HostMultipathInfoFixedLogicalUnitPolicy hostMultipathInfoFixedLogicalUnitPolicy)\n        {\n            return (hostMultipathInfoFixedLogicalUnitPolicy != null && this.Prefer == hostMultipathInfoFixedLogicalUnitPolicy.Prefer);\n        }\n\n        public override bool Equals(object hostMultipathInfoFixedLogicalUnitPolicy)\n        {\n            return Equals(hostMultipathInfoFixedLogicalUnitPolicy as HostMultipathInfoFixedLogicalUnitPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Prefer).GetHashCode();\n        }\n    }\n\n    public class HostMultipathInfoLogicalUnit : DynamicData, IEquatable<HostMultipathInfoLogicalUnit>\n    {\n        public string Key { get; set; }\n\n        public string Id { get; set; }\n\n        public string Lun { get; set; }\n\n        public HostMultipathInfoPath[] Path { get; set; }\n\n        public HostMultipathInfoLogicalUnitPolicy Policy { get; set; }\n\n        public HostMultipathInfoLogicalUnitStorageArrayTypePolicy StorageArrayTypePolicy { get; set; }\n\n        public bool Equals(HostMultipathInfoLogicalUnit hostMultipathInfoLogicalUnit)\n        {\n            return (hostMultipathInfoLogicalUnit != null && this.Key == hostMultipathInfoLogicalUnit.Key && this.Id == hostMultipathInfoLogicalUnit.Id && this.Lun == hostMultipathInfoLogicalUnit.Lun && ((this.Path == null && hostMultipathInfoLogicalUnit.Path == null) || (this.Path != null && hostMultipathInfoLogicalUnit.Path != null && Enumerable.SequenceEqual(this.Path, hostMultipathInfoLogicalUnit.Path))) && ((this.Policy == null && hostMultipathInfoLogicalUnit.Policy == null) || (this.Policy != null && this.Policy.Equals(hostMultipathInfoLogicalUnit.Policy))) && ((this.StorageArrayTypePolicy == null && hostMultipathInfoLogicalUnit.StorageArrayTypePolicy == null) || (this.StorageArrayTypePolicy != null && this.StorageArrayTypePolicy.Equals(hostMultipathInfoLogicalUnit.StorageArrayTypePolicy))));\n        }\n\n        public override bool Equals(object hostMultipathInfoLogicalUnit)\n        {\n            return Equals(hostMultipathInfoLogicalUnit as HostMultipathInfoLogicalUnit);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Id + \"_\" + Lun + \"_\" + Path + \"_\" + Policy + \"_\" + StorageArrayTypePolicy).GetHashCode();\n        }\n    }\n\n    public class HostMultipathInfoLogicalUnitPolicy : DynamicData, IEquatable<HostMultipathInfoLogicalUnitPolicy>\n    {\n        public string Policy { get; set; }\n\n        public bool Equals(HostMultipathInfoLogicalUnitPolicy hostMultipathInfoLogicalUnitPolicy)\n        {\n            return (hostMultipathInfoLogicalUnitPolicy != null && this.Policy == hostMultipathInfoLogicalUnitPolicy.Policy);\n        }\n\n        public override bool Equals(object hostMultipathInfoLogicalUnitPolicy)\n        {\n            return Equals(hostMultipathInfoLogicalUnitPolicy as HostMultipathInfoLogicalUnitPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy).GetHashCode();\n        }\n    }\n\n    public class HostMultipathInfoLogicalUnitStorageArrayTypePolicy : DynamicData, IEquatable<HostMultipathInfoLogicalUnitStorageArrayTypePolicy>\n    {\n        public string Policy { get; set; }\n\n        public bool Equals(HostMultipathInfoLogicalUnitStorageArrayTypePolicy hostMultipathInfoLogicalUnitStorageArrayTypePolicy)\n        {\n            return (hostMultipathInfoLogicalUnitStorageArrayTypePolicy != null && this.Policy == hostMultipathInfoLogicalUnitStorageArrayTypePolicy.Policy);\n        }\n\n        public override bool Equals(object hostMultipathInfoLogicalUnitStorageArrayTypePolicy)\n        {\n            return Equals(hostMultipathInfoLogicalUnitStorageArrayTypePolicy as HostMultipathInfoLogicalUnitStorageArrayTypePolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy).GetHashCode();\n        }\n    }\n\n    public class HostMultipathInfoPath : DynamicData, IEquatable<HostMultipathInfoPath>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string PathState { get; set; }\n\n        public string State { get; set; }\n\n        public bool? IsWorkingPath { get; set; }\n\n        public string Adapter { get; set; }\n\n        public string Lun { get; set; }\n\n        public HostTargetTransport Transport { get; set; }\n\n        public bool Equals(HostMultipathInfoPath hostMultipathInfoPath)\n        {\n            return (hostMultipathInfoPath != null && this.Key == hostMultipathInfoPath.Key && this.Name == hostMultipathInfoPath.Name && this.PathState == hostMultipathInfoPath.PathState && this.State == hostMultipathInfoPath.State && ((this.IsWorkingPath == null && hostMultipathInfoPath.IsWorkingPath == null) || (this.IsWorkingPath != null && this.IsWorkingPath.Equals(hostMultipathInfoPath.IsWorkingPath))) && this.Adapter == hostMultipathInfoPath.Adapter && this.Lun == hostMultipathInfoPath.Lun && ((this.Transport == null && hostMultipathInfoPath.Transport == null) || (this.Transport != null && this.Transport.Equals(hostMultipathInfoPath.Transport))));\n        }\n\n        public override bool Equals(object hostMultipathInfoPath)\n        {\n            return Equals(hostMultipathInfoPath as HostMultipathInfoPath);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + PathState + \"_\" + State + \"_\" + IsWorkingPath + \"_\" + Adapter + \"_\" + Lun + \"_\" + Transport).GetHashCode();\n        }\n    }\n\n    public class HostMultipathStateInfo : DynamicData, IEquatable<HostMultipathStateInfo>\n    {\n        public HostMultipathStateInfoPath[] Path { get; set; }\n\n        public bool Equals(HostMultipathStateInfo hostMultipathStateInfo)\n        {\n            return (hostMultipathStateInfo != null && ((this.Path == null && hostMultipathStateInfo.Path == null) || (this.Path != null && hostMultipathStateInfo.Path != null && Enumerable.SequenceEqual(this.Path, hostMultipathStateInfo.Path))));\n        }\n\n        public override bool Equals(object hostMultipathStateInfo)\n        {\n            return Equals(hostMultipathStateInfo as HostMultipathStateInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path).GetHashCode();\n        }\n    }\n\n    public class HostMultipathStateInfoPath : DynamicData, IEquatable<HostMultipathStateInfoPath>\n    {\n        public string Name { get; set; }\n\n        public string PathState { get; set; }\n\n        public bool Equals(HostMultipathStateInfoPath hostMultipathStateInfoPath)\n        {\n            return (hostMultipathStateInfoPath != null && this.Name == hostMultipathStateInfoPath.Name && this.PathState == hostMultipathStateInfoPath.PathState);\n        }\n\n        public override bool Equals(object hostMultipathStateInfoPath)\n        {\n            return Equals(hostMultipathStateInfoPath as HostMultipathStateInfoPath);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + PathState).GetHashCode();\n        }\n    }\n\n    public class HostNasVolume : HostFileSystemVolume, IEquatable<HostNasVolume>\n    {\n        public string RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public string UserName { get; set; }\n\n        public string[] RemoteHostNames { get; set; }\n\n        public string SecurityType { get; set; }\n\n        public bool? ProtocolEndpoint { get; set; }\n\n        public bool Equals(HostNasVolume hostNasVolume)\n        {\n            return (hostNasVolume != null && this.RemoteHost == hostNasVolume.RemoteHost && this.RemotePath == hostNasVolume.RemotePath && this.UserName == hostNasVolume.UserName && ((this.RemoteHostNames == null && hostNasVolume.RemoteHostNames == null) || (this.RemoteHostNames != null && hostNasVolume.RemoteHostNames != null && Enumerable.SequenceEqual(this.RemoteHostNames, hostNasVolume.RemoteHostNames))) && this.SecurityType == hostNasVolume.SecurityType && ((this.ProtocolEndpoint == null && hostNasVolume.ProtocolEndpoint == null) || (this.ProtocolEndpoint != null && this.ProtocolEndpoint.Equals(hostNasVolume.ProtocolEndpoint))));\n        }\n\n        public override bool Equals(object hostNasVolume)\n        {\n            return Equals(hostNasVolume as HostNasVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath + \"_\" + UserName + \"_\" + RemoteHostNames + \"_\" + SecurityType + \"_\" + ProtocolEndpoint).GetHashCode();\n        }\n    }\n\n    public class HostNasVolumeConfig : DynamicData, IEquatable<HostNasVolumeConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public HostNasVolumeSpec Spec { get; set; }\n\n        public bool Equals(HostNasVolumeConfig hostNasVolumeConfig)\n        {\n            return (hostNasVolumeConfig != null && this.ChangeOperation == hostNasVolumeConfig.ChangeOperation && ((this.Spec == null && hostNasVolumeConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostNasVolumeConfig.Spec))));\n        }\n\n        public override bool Equals(object hostNasVolumeConfig)\n        {\n            return Equals(hostNasVolumeConfig as HostNasVolumeConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostNasVolumeSpec : DynamicData, IEquatable<HostNasVolumeSpec>\n    {\n        public string RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public string LocalPath { get; set; }\n\n        public string AccessMode { get; set; }\n\n        public string Type { get; set; }\n\n        public string UserName { get; set; }\n\n        public string Password { get; set; }\n\n        public string[] RemoteHostNames { get; set; }\n\n        public string SecurityType { get; set; }\n\n        public bool Equals(HostNasVolumeSpec hostNasVolumeSpec)\n        {\n            return (hostNasVolumeSpec != null && this.RemoteHost == hostNasVolumeSpec.RemoteHost && this.RemotePath == hostNasVolumeSpec.RemotePath && this.LocalPath == hostNasVolumeSpec.LocalPath && this.AccessMode == hostNasVolumeSpec.AccessMode && this.Type == hostNasVolumeSpec.Type && this.UserName == hostNasVolumeSpec.UserName && this.Password == hostNasVolumeSpec.Password && ((this.RemoteHostNames == null && hostNasVolumeSpec.RemoteHostNames == null) || (this.RemoteHostNames != null && hostNasVolumeSpec.RemoteHostNames != null && Enumerable.SequenceEqual(this.RemoteHostNames, hostNasVolumeSpec.RemoteHostNames))) && this.SecurityType == hostNasVolumeSpec.SecurityType);\n        }\n\n        public override bool Equals(object hostNasVolumeSpec)\n        {\n            return Equals(hostNasVolumeSpec as HostNasVolumeSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath + \"_\" + LocalPath + \"_\" + AccessMode + \"_\" + Type + \"_\" + UserName + \"_\" + Password + \"_\" + RemoteHostNames + \"_\" + SecurityType).GetHashCode();\n        }\n    }\n\n    public class HostNasVolumeUserInfo : DynamicData, IEquatable<HostNasVolumeUserInfo>\n    {\n        public string User { get; set; }\n\n        public bool Equals(HostNasVolumeUserInfo hostNasVolumeUserInfo)\n        {\n            return (hostNasVolumeUserInfo != null && this.User == hostNasVolumeUserInfo.User);\n        }\n\n        public override bool Equals(object hostNasVolumeUserInfo)\n        {\n            return Equals(hostNasVolumeUserInfo as HostNasVolumeUserInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (User).GetHashCode();\n        }\n    }\n\n    public class HostNatService : DynamicData, IEquatable<HostNatService>\n    {\n        public string Key { get; set; }\n\n        public HostNatServiceSpec Spec { get; set; }\n\n        public bool Equals(HostNatService hostNatService)\n        {\n            return (hostNatService != null && this.Key == hostNatService.Key && ((this.Spec == null && hostNatService.Spec == null) || (this.Spec != null && this.Spec.Equals(hostNatService.Spec))));\n        }\n\n        public override bool Equals(object hostNatService)\n        {\n            return Equals(hostNatService as HostNatService);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostNatServiceConfig : DynamicData, IEquatable<HostNatServiceConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public string Key { get; set; }\n\n        public HostNatServiceSpec Spec { get; set; }\n\n        public bool Equals(HostNatServiceConfig hostNatServiceConfig)\n        {\n            return (hostNatServiceConfig != null && this.ChangeOperation == hostNatServiceConfig.ChangeOperation && this.Key == hostNatServiceConfig.Key && ((this.Spec == null && hostNatServiceConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostNatServiceConfig.Spec))));\n        }\n\n        public override bool Equals(object hostNatServiceConfig)\n        {\n            return Equals(hostNatServiceConfig as HostNatServiceConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Key + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostNatServiceNameServiceSpec : DynamicData, IEquatable<HostNatServiceNameServiceSpec>\n    {\n        public bool DnsAutoDetect { get; set; }\n\n        public string DnsPolicy { get; set; }\n\n        public int DnsRetries { get; set; }\n\n        public int DnsTimeout { get; set; }\n\n        public string[] DnsNameServer { get; set; }\n\n        public int NbdsTimeout { get; set; }\n\n        public int NbnsRetries { get; set; }\n\n        public int NbnsTimeout { get; set; }\n\n        public bool Equals(HostNatServiceNameServiceSpec hostNatServiceNameServiceSpec)\n        {\n            return (hostNatServiceNameServiceSpec != null && this.DnsAutoDetect == hostNatServiceNameServiceSpec.DnsAutoDetect && this.DnsPolicy == hostNatServiceNameServiceSpec.DnsPolicy && this.DnsRetries == hostNatServiceNameServiceSpec.DnsRetries && this.DnsTimeout == hostNatServiceNameServiceSpec.DnsTimeout && ((this.DnsNameServer == null && hostNatServiceNameServiceSpec.DnsNameServer == null) || (this.DnsNameServer != null && hostNatServiceNameServiceSpec.DnsNameServer != null && Enumerable.SequenceEqual(this.DnsNameServer, hostNatServiceNameServiceSpec.DnsNameServer))) && this.NbdsTimeout == hostNatServiceNameServiceSpec.NbdsTimeout && this.NbnsRetries == hostNatServiceNameServiceSpec.NbnsRetries && this.NbnsTimeout == hostNatServiceNameServiceSpec.NbnsTimeout);\n        }\n\n        public override bool Equals(object hostNatServiceNameServiceSpec)\n        {\n            return Equals(hostNatServiceNameServiceSpec as HostNatServiceNameServiceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DnsAutoDetect + \"_\" + DnsPolicy + \"_\" + DnsRetries + \"_\" + DnsTimeout + \"_\" + DnsNameServer + \"_\" + NbdsTimeout + \"_\" + NbnsRetries + \"_\" + NbnsTimeout).GetHashCode();\n        }\n    }\n\n    public class HostNatServicePortForwardSpec : DynamicData, IEquatable<HostNatServicePortForwardSpec>\n    {\n        public string Type { get; set; }\n\n        public string Name { get; set; }\n\n        public int HostPort { get; set; }\n\n        public int GuestPort { get; set; }\n\n        public string GuestIpAddress { get; set; }\n\n        public bool Equals(HostNatServicePortForwardSpec hostNatServicePortForwardSpec)\n        {\n            return (hostNatServicePortForwardSpec != null && this.Type == hostNatServicePortForwardSpec.Type && this.Name == hostNatServicePortForwardSpec.Name && this.HostPort == hostNatServicePortForwardSpec.HostPort && this.GuestPort == hostNatServicePortForwardSpec.GuestPort && this.GuestIpAddress == hostNatServicePortForwardSpec.GuestIpAddress);\n        }\n\n        public override bool Equals(object hostNatServicePortForwardSpec)\n        {\n            return Equals(hostNatServicePortForwardSpec as HostNatServicePortForwardSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Name + \"_\" + HostPort + \"_\" + GuestPort + \"_\" + GuestIpAddress).GetHashCode();\n        }\n    }\n\n    public class HostNatServiceSpec : DynamicData, IEquatable<HostNatServiceSpec>\n    {\n        public string VirtualSwitch { get; set; }\n\n        public bool ActiveFtp { get; set; }\n\n        public bool AllowAnyOui { get; set; }\n\n        public bool ConfigPort { get; set; }\n\n        public string IpGatewayAddress { get; set; }\n\n        public int UdpTimeout { get; set; }\n\n        public HostNatServicePortForwardSpec[] PortForward { get; set; }\n\n        public HostNatServiceNameServiceSpec NameService { get; set; }\n\n        public bool Equals(HostNatServiceSpec hostNatServiceSpec)\n        {\n            return (hostNatServiceSpec != null && this.VirtualSwitch == hostNatServiceSpec.VirtualSwitch && this.ActiveFtp == hostNatServiceSpec.ActiveFtp && this.AllowAnyOui == hostNatServiceSpec.AllowAnyOui && this.ConfigPort == hostNatServiceSpec.ConfigPort && this.IpGatewayAddress == hostNatServiceSpec.IpGatewayAddress && this.UdpTimeout == hostNatServiceSpec.UdpTimeout && ((this.PortForward == null && hostNatServiceSpec.PortForward == null) || (this.PortForward != null && hostNatServiceSpec.PortForward != null && Enumerable.SequenceEqual(this.PortForward, hostNatServiceSpec.PortForward))) && ((this.NameService == null && hostNatServiceSpec.NameService == null) || (this.NameService != null && this.NameService.Equals(hostNatServiceSpec.NameService))));\n        }\n\n        public override bool Equals(object hostNatServiceSpec)\n        {\n            return Equals(hostNatServiceSpec as HostNatServiceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualSwitch + \"_\" + ActiveFtp + \"_\" + AllowAnyOui + \"_\" + ConfigPort + \"_\" + IpGatewayAddress + \"_\" + UdpTimeout + \"_\" + PortForward + \"_\" + NameService).GetHashCode();\n        }\n    }\n\n    public class HostNetCapabilities : DynamicData, IEquatable<HostNetCapabilities>\n    {\n        public bool CanSetPhysicalNicLinkSpeed { get; set; }\n\n        public bool SupportsNicTeaming { get; set; }\n\n        public string[] NicTeamingPolicy { get; set; }\n\n        public bool SupportsVlan { get; set; }\n\n        public bool UsesServiceConsoleNic { get; set; }\n\n        public bool SupportsNetworkHints { get; set; }\n\n        public int? MaxPortGroupsPerVswitch { get; set; }\n\n        public bool VswitchConfigSupported { get; set; }\n\n        public bool VnicConfigSupported { get; set; }\n\n        public bool IpRouteConfigSupported { get; set; }\n\n        public bool DnsConfigSupported { get; set; }\n\n        public bool DhcpOnVnicSupported { get; set; }\n\n        public bool IpV6Supported { get; set; }\n\n        public bool Equals(HostNetCapabilities hostNetCapabilities)\n        {\n            return (hostNetCapabilities != null && this.CanSetPhysicalNicLinkSpeed == hostNetCapabilities.CanSetPhysicalNicLinkSpeed && this.SupportsNicTeaming == hostNetCapabilities.SupportsNicTeaming && ((this.NicTeamingPolicy == null && hostNetCapabilities.NicTeamingPolicy == null) || (this.NicTeamingPolicy != null && hostNetCapabilities.NicTeamingPolicy != null && Enumerable.SequenceEqual(this.NicTeamingPolicy, hostNetCapabilities.NicTeamingPolicy))) && this.SupportsVlan == hostNetCapabilities.SupportsVlan && this.UsesServiceConsoleNic == hostNetCapabilities.UsesServiceConsoleNic && this.SupportsNetworkHints == hostNetCapabilities.SupportsNetworkHints && ((this.MaxPortGroupsPerVswitch == null && hostNetCapabilities.MaxPortGroupsPerVswitch == null) || (this.MaxPortGroupsPerVswitch != null && this.MaxPortGroupsPerVswitch.Equals(hostNetCapabilities.MaxPortGroupsPerVswitch))) && this.VswitchConfigSupported == hostNetCapabilities.VswitchConfigSupported && this.VnicConfigSupported == hostNetCapabilities.VnicConfigSupported && this.IpRouteConfigSupported == hostNetCapabilities.IpRouteConfigSupported && this.DnsConfigSupported == hostNetCapabilities.DnsConfigSupported && this.DhcpOnVnicSupported == hostNetCapabilities.DhcpOnVnicSupported && this.IpV6Supported == hostNetCapabilities.IpV6Supported);\n        }\n\n        public override bool Equals(object hostNetCapabilities)\n        {\n            return Equals(hostNetCapabilities as HostNetCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CanSetPhysicalNicLinkSpeed + \"_\" + SupportsNicTeaming + \"_\" + NicTeamingPolicy + \"_\" + SupportsVlan + \"_\" + UsesServiceConsoleNic + \"_\" + SupportsNetworkHints + \"_\" + MaxPortGroupsPerVswitch + \"_\" + VswitchConfigSupported + \"_\" + VnicConfigSupported + \"_\" + IpRouteConfigSupported + \"_\" + DnsConfigSupported + \"_\" + DhcpOnVnicSupported + \"_\" + IpV6Supported).GetHashCode();\n        }\n    }\n\n    public class HostNetOffloadCapabilities : DynamicData, IEquatable<HostNetOffloadCapabilities>\n    {\n        public bool? CsumOffload { get; set; }\n\n        public bool? TcpSegmentation { get; set; }\n\n        public bool? ZeroCopyXmit { get; set; }\n\n        public bool Equals(HostNetOffloadCapabilities hostNetOffloadCapabilities)\n        {\n            return (hostNetOffloadCapabilities != null && ((this.CsumOffload == null && hostNetOffloadCapabilities.CsumOffload == null) || (this.CsumOffload != null && this.CsumOffload.Equals(hostNetOffloadCapabilities.CsumOffload))) && ((this.TcpSegmentation == null && hostNetOffloadCapabilities.TcpSegmentation == null) || (this.TcpSegmentation != null && this.TcpSegmentation.Equals(hostNetOffloadCapabilities.TcpSegmentation))) && ((this.ZeroCopyXmit == null && hostNetOffloadCapabilities.ZeroCopyXmit == null) || (this.ZeroCopyXmit != null && this.ZeroCopyXmit.Equals(hostNetOffloadCapabilities.ZeroCopyXmit))));\n        }\n\n        public override bool Equals(object hostNetOffloadCapabilities)\n        {\n            return Equals(hostNetOffloadCapabilities as HostNetOffloadCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CsumOffload + \"_\" + TcpSegmentation + \"_\" + ZeroCopyXmit).GetHashCode();\n        }\n    }\n\n    public class HostNetStackInstance : DynamicData, IEquatable<HostNetStackInstance>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public HostDnsConfig DnsConfig { get; set; }\n\n        public HostIpRouteConfig IpRouteConfig { get; set; }\n\n        public int? RequestedMaxNumberOfConnections { get; set; }\n\n        public string CongestionControlAlgorithm { get; set; }\n\n        public bool? IpV6Enabled { get; set; }\n\n        public HostIpRouteTableConfig RouteTableConfig { get; set; }\n\n        public bool Equals(HostNetStackInstance hostNetStackInstance)\n        {\n            return (hostNetStackInstance != null && this.Key == hostNetStackInstance.Key && this.Name == hostNetStackInstance.Name && ((this.DnsConfig == null && hostNetStackInstance.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(hostNetStackInstance.DnsConfig))) && ((this.IpRouteConfig == null && hostNetStackInstance.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(hostNetStackInstance.IpRouteConfig))) && ((this.RequestedMaxNumberOfConnections == null && hostNetStackInstance.RequestedMaxNumberOfConnections == null) || (this.RequestedMaxNumberOfConnections != null && this.RequestedMaxNumberOfConnections.Equals(hostNetStackInstance.RequestedMaxNumberOfConnections))) && this.CongestionControlAlgorithm == hostNetStackInstance.CongestionControlAlgorithm && ((this.IpV6Enabled == null && hostNetStackInstance.IpV6Enabled == null) || (this.IpV6Enabled != null && this.IpV6Enabled.Equals(hostNetStackInstance.IpV6Enabled))) && ((this.RouteTableConfig == null && hostNetStackInstance.RouteTableConfig == null) || (this.RouteTableConfig != null && this.RouteTableConfig.Equals(hostNetStackInstance.RouteTableConfig))));\n        }\n\n        public override bool Equals(object hostNetStackInstance)\n        {\n            return Equals(hostNetStackInstance as HostNetStackInstance);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + DnsConfig + \"_\" + IpRouteConfig + \"_\" + RequestedMaxNumberOfConnections + \"_\" + CongestionControlAlgorithm + \"_\" + IpV6Enabled + \"_\" + RouteTableConfig).GetHashCode();\n        }\n    }\n\n    public class HostNetworkConfig : DynamicData, IEquatable<HostNetworkConfig>\n    {\n        public HostVirtualSwitchConfig[] Vswitch { get; set; }\n\n        public HostProxySwitchConfig[] ProxySwitch { get; set; }\n\n        public HostPortGroupConfig[] Portgroup { get; set; }\n\n        public PhysicalNicConfig[] Pnic { get; set; }\n\n        public HostVirtualNicConfig[] Vnic { get; set; }\n\n        public HostVirtualNicConfig[] ConsoleVnic { get; set; }\n\n        public HostDnsConfig DnsConfig { get; set; }\n\n        public HostIpRouteConfig IpRouteConfig { get; set; }\n\n        public HostIpRouteConfig ConsoleIpRouteConfig { get; set; }\n\n        public HostIpRouteTableConfig RouteTableConfig { get; set; }\n\n        public HostDhcpServiceConfig[] Dhcp { get; set; }\n\n        public HostNatServiceConfig[] Nat { get; set; }\n\n        public bool? IpV6Enabled { get; set; }\n\n        public HostNetworkConfigNetStackSpec[] NetStackSpec { get; set; }\n\n        public bool Equals(HostNetworkConfig hostNetworkConfig)\n        {\n            return (hostNetworkConfig != null && ((this.Vswitch == null && hostNetworkConfig.Vswitch == null) || (this.Vswitch != null && hostNetworkConfig.Vswitch != null && Enumerable.SequenceEqual(this.Vswitch, hostNetworkConfig.Vswitch))) && ((this.ProxySwitch == null && hostNetworkConfig.ProxySwitch == null) || (this.ProxySwitch != null && hostNetworkConfig.ProxySwitch != null && Enumerable.SequenceEqual(this.ProxySwitch, hostNetworkConfig.ProxySwitch))) && ((this.Portgroup == null && hostNetworkConfig.Portgroup == null) || (this.Portgroup != null && hostNetworkConfig.Portgroup != null && Enumerable.SequenceEqual(this.Portgroup, hostNetworkConfig.Portgroup))) && ((this.Pnic == null && hostNetworkConfig.Pnic == null) || (this.Pnic != null && hostNetworkConfig.Pnic != null && Enumerable.SequenceEqual(this.Pnic, hostNetworkConfig.Pnic))) && ((this.Vnic == null && hostNetworkConfig.Vnic == null) || (this.Vnic != null && hostNetworkConfig.Vnic != null && Enumerable.SequenceEqual(this.Vnic, hostNetworkConfig.Vnic))) && ((this.ConsoleVnic == null && hostNetworkConfig.ConsoleVnic == null) || (this.ConsoleVnic != null && hostNetworkConfig.ConsoleVnic != null && Enumerable.SequenceEqual(this.ConsoleVnic, hostNetworkConfig.ConsoleVnic))) && ((this.DnsConfig == null && hostNetworkConfig.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(hostNetworkConfig.DnsConfig))) && ((this.IpRouteConfig == null && hostNetworkConfig.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(hostNetworkConfig.IpRouteConfig))) && ((this.ConsoleIpRouteConfig == null && hostNetworkConfig.ConsoleIpRouteConfig == null) || (this.ConsoleIpRouteConfig != null && this.ConsoleIpRouteConfig.Equals(hostNetworkConfig.ConsoleIpRouteConfig))) && ((this.RouteTableConfig == null && hostNetworkConfig.RouteTableConfig == null) || (this.RouteTableConfig != null && this.RouteTableConfig.Equals(hostNetworkConfig.RouteTableConfig))) && ((this.Dhcp == null && hostNetworkConfig.Dhcp == null) || (this.Dhcp != null && hostNetworkConfig.Dhcp != null && Enumerable.SequenceEqual(this.Dhcp, hostNetworkConfig.Dhcp))) && ((this.Nat == null && hostNetworkConfig.Nat == null) || (this.Nat != null && hostNetworkConfig.Nat != null && Enumerable.SequenceEqual(this.Nat, hostNetworkConfig.Nat))) && ((this.IpV6Enabled == null && hostNetworkConfig.IpV6Enabled == null) || (this.IpV6Enabled != null && this.IpV6Enabled.Equals(hostNetworkConfig.IpV6Enabled))) && ((this.NetStackSpec == null && hostNetworkConfig.NetStackSpec == null) || (this.NetStackSpec != null && hostNetworkConfig.NetStackSpec != null && Enumerable.SequenceEqual(this.NetStackSpec, hostNetworkConfig.NetStackSpec))));\n        }\n\n        public override bool Equals(object hostNetworkConfig)\n        {\n            return Equals(hostNetworkConfig as HostNetworkConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vswitch + \"_\" + ProxySwitch + \"_\" + Portgroup + \"_\" + Pnic + \"_\" + Vnic + \"_\" + ConsoleVnic + \"_\" + DnsConfig + \"_\" + IpRouteConfig + \"_\" + ConsoleIpRouteConfig + \"_\" + RouteTableConfig + \"_\" + Dhcp + \"_\" + Nat + \"_\" + IpV6Enabled + \"_\" + NetStackSpec).GetHashCode();\n        }\n    }\n\n    public class HostNetworkConfigNetStackSpec : DynamicData, IEquatable<HostNetworkConfigNetStackSpec>\n    {\n        public HostNetStackInstance NetStackInstance { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(HostNetworkConfigNetStackSpec hostNetworkConfigNetStackSpec)\n        {\n            return (hostNetworkConfigNetStackSpec != null && ((this.NetStackInstance == null && hostNetworkConfigNetStackSpec.NetStackInstance == null) || (this.NetStackInstance != null && this.NetStackInstance.Equals(hostNetworkConfigNetStackSpec.NetStackInstance))) && this.Operation == hostNetworkConfigNetStackSpec.Operation);\n        }\n\n        public override bool Equals(object hostNetworkConfigNetStackSpec)\n        {\n            return Equals(hostNetworkConfigNetStackSpec as HostNetworkConfigNetStackSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetStackInstance + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class HostNetworkConfigResult : DynamicData, IEquatable<HostNetworkConfigResult>\n    {\n        public string[] VnicDevice { get; set; }\n\n        public string[] ConsoleVnicDevice { get; set; }\n\n        public bool Equals(HostNetworkConfigResult hostNetworkConfigResult)\n        {\n            return (hostNetworkConfigResult != null && ((this.VnicDevice == null && hostNetworkConfigResult.VnicDevice == null) || (this.VnicDevice != null && hostNetworkConfigResult.VnicDevice != null && Enumerable.SequenceEqual(this.VnicDevice, hostNetworkConfigResult.VnicDevice))) && ((this.ConsoleVnicDevice == null && hostNetworkConfigResult.ConsoleVnicDevice == null) || (this.ConsoleVnicDevice != null && hostNetworkConfigResult.ConsoleVnicDevice != null && Enumerable.SequenceEqual(this.ConsoleVnicDevice, hostNetworkConfigResult.ConsoleVnicDevice))));\n        }\n\n        public override bool Equals(object hostNetworkConfigResult)\n        {\n            return Equals(hostNetworkConfigResult as HostNetworkConfigResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice + \"_\" + ConsoleVnicDevice).GetHashCode();\n        }\n    }\n\n    public class HostNetworkInfo : DynamicData, IEquatable<HostNetworkInfo>\n    {\n        public HostVirtualSwitch[] Vswitch { get; set; }\n\n        public HostProxySwitch[] ProxySwitch { get; set; }\n\n        public HostPortGroup[] Portgroup { get; set; }\n\n        public PhysicalNic[] Pnic { get; set; }\n\n        public HostVirtualNic[] Vnic { get; set; }\n\n        public HostVirtualNic[] ConsoleVnic { get; set; }\n\n        public HostDnsConfig DnsConfig { get; set; }\n\n        public HostIpRouteConfig IpRouteConfig { get; set; }\n\n        public HostIpRouteConfig ConsoleIpRouteConfig { get; set; }\n\n        public HostIpRouteTableInfo RouteTableInfo { get; set; }\n\n        public HostDhcpService[] Dhcp { get; set; }\n\n        public HostNatService[] Nat { get; set; }\n\n        public bool? IpV6Enabled { get; set; }\n\n        public bool? AtBootIpV6Enabled { get; set; }\n\n        public HostNetStackInstance[] NetStackInstance { get; set; }\n\n        public HostOpaqueSwitch[] OpaqueSwitch { get; set; }\n\n        public HostOpaqueNetworkInfo[] OpaqueNetwork { get; set; }\n\n        public bool Equals(HostNetworkInfo hostNetworkInfo)\n        {\n            return (hostNetworkInfo != null && ((this.Vswitch == null && hostNetworkInfo.Vswitch == null) || (this.Vswitch != null && hostNetworkInfo.Vswitch != null && Enumerable.SequenceEqual(this.Vswitch, hostNetworkInfo.Vswitch))) && ((this.ProxySwitch == null && hostNetworkInfo.ProxySwitch == null) || (this.ProxySwitch != null && hostNetworkInfo.ProxySwitch != null && Enumerable.SequenceEqual(this.ProxySwitch, hostNetworkInfo.ProxySwitch))) && ((this.Portgroup == null && hostNetworkInfo.Portgroup == null) || (this.Portgroup != null && hostNetworkInfo.Portgroup != null && Enumerable.SequenceEqual(this.Portgroup, hostNetworkInfo.Portgroup))) && ((this.Pnic == null && hostNetworkInfo.Pnic == null) || (this.Pnic != null && hostNetworkInfo.Pnic != null && Enumerable.SequenceEqual(this.Pnic, hostNetworkInfo.Pnic))) && ((this.Vnic == null && hostNetworkInfo.Vnic == null) || (this.Vnic != null && hostNetworkInfo.Vnic != null && Enumerable.SequenceEqual(this.Vnic, hostNetworkInfo.Vnic))) && ((this.ConsoleVnic == null && hostNetworkInfo.ConsoleVnic == null) || (this.ConsoleVnic != null && hostNetworkInfo.ConsoleVnic != null && Enumerable.SequenceEqual(this.ConsoleVnic, hostNetworkInfo.ConsoleVnic))) && ((this.DnsConfig == null && hostNetworkInfo.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(hostNetworkInfo.DnsConfig))) && ((this.IpRouteConfig == null && hostNetworkInfo.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(hostNetworkInfo.IpRouteConfig))) && ((this.ConsoleIpRouteConfig == null && hostNetworkInfo.ConsoleIpRouteConfig == null) || (this.ConsoleIpRouteConfig != null && this.ConsoleIpRouteConfig.Equals(hostNetworkInfo.ConsoleIpRouteConfig))) && ((this.RouteTableInfo == null && hostNetworkInfo.RouteTableInfo == null) || (this.RouteTableInfo != null && this.RouteTableInfo.Equals(hostNetworkInfo.RouteTableInfo))) && ((this.Dhcp == null && hostNetworkInfo.Dhcp == null) || (this.Dhcp != null && hostNetworkInfo.Dhcp != null && Enumerable.SequenceEqual(this.Dhcp, hostNetworkInfo.Dhcp))) && ((this.Nat == null && hostNetworkInfo.Nat == null) || (this.Nat != null && hostNetworkInfo.Nat != null && Enumerable.SequenceEqual(this.Nat, hostNetworkInfo.Nat))) && ((this.IpV6Enabled == null && hostNetworkInfo.IpV6Enabled == null) || (this.IpV6Enabled != null && this.IpV6Enabled.Equals(hostNetworkInfo.IpV6Enabled))) && ((this.AtBootIpV6Enabled == null && hostNetworkInfo.AtBootIpV6Enabled == null) || (this.AtBootIpV6Enabled != null && this.AtBootIpV6Enabled.Equals(hostNetworkInfo.AtBootIpV6Enabled))) && ((this.NetStackInstance == null && hostNetworkInfo.NetStackInstance == null) || (this.NetStackInstance != null && hostNetworkInfo.NetStackInstance != null && Enumerable.SequenceEqual(this.NetStackInstance, hostNetworkInfo.NetStackInstance))) && ((this.OpaqueSwitch == null && hostNetworkInfo.OpaqueSwitch == null) || (this.OpaqueSwitch != null && hostNetworkInfo.OpaqueSwitch != null && Enumerable.SequenceEqual(this.OpaqueSwitch, hostNetworkInfo.OpaqueSwitch))) && ((this.OpaqueNetwork == null && hostNetworkInfo.OpaqueNetwork == null) || (this.OpaqueNetwork != null && hostNetworkInfo.OpaqueNetwork != null && Enumerable.SequenceEqual(this.OpaqueNetwork, hostNetworkInfo.OpaqueNetwork))));\n        }\n\n        public override bool Equals(object hostNetworkInfo)\n        {\n            return Equals(hostNetworkInfo as HostNetworkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vswitch + \"_\" + ProxySwitch + \"_\" + Portgroup + \"_\" + Pnic + \"_\" + Vnic + \"_\" + ConsoleVnic + \"_\" + DnsConfig + \"_\" + IpRouteConfig + \"_\" + ConsoleIpRouteConfig + \"_\" + RouteTableInfo + \"_\" + Dhcp + \"_\" + Nat + \"_\" + IpV6Enabled + \"_\" + AtBootIpV6Enabled + \"_\" + NetStackInstance + \"_\" + OpaqueSwitch + \"_\" + OpaqueNetwork).GetHashCode();\n        }\n    }\n\n    public class HostNetworkPolicy : DynamicData, IEquatable<HostNetworkPolicy>\n    {\n        public HostNetworkSecurityPolicy Security { get; set; }\n\n        public HostNicTeamingPolicy NicTeaming { get; set; }\n\n        public HostNetOffloadCapabilities OffloadPolicy { get; set; }\n\n        public HostNetworkTrafficShapingPolicy ShapingPolicy { get; set; }\n\n        public bool Equals(HostNetworkPolicy hostNetworkPolicy)\n        {\n            return (hostNetworkPolicy != null && ((this.Security == null && hostNetworkPolicy.Security == null) || (this.Security != null && this.Security.Equals(hostNetworkPolicy.Security))) && ((this.NicTeaming == null && hostNetworkPolicy.NicTeaming == null) || (this.NicTeaming != null && this.NicTeaming.Equals(hostNetworkPolicy.NicTeaming))) && ((this.OffloadPolicy == null && hostNetworkPolicy.OffloadPolicy == null) || (this.OffloadPolicy != null && this.OffloadPolicy.Equals(hostNetworkPolicy.OffloadPolicy))) && ((this.ShapingPolicy == null && hostNetworkPolicy.ShapingPolicy == null) || (this.ShapingPolicy != null && this.ShapingPolicy.Equals(hostNetworkPolicy.ShapingPolicy))));\n        }\n\n        public override bool Equals(object hostNetworkPolicy)\n        {\n            return Equals(hostNetworkPolicy as HostNetworkPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Security + \"_\" + NicTeaming + \"_\" + OffloadPolicy + \"_\" + ShapingPolicy).GetHashCode();\n        }\n    }\n\n    public class HostNetworkResourceRuntime : DynamicData, IEquatable<HostNetworkResourceRuntime>\n    {\n        public HostPnicNetworkResourceInfo[] PnicResourceInfo { get; set; }\n\n        public bool Equals(HostNetworkResourceRuntime hostNetworkResourceRuntime)\n        {\n            return (hostNetworkResourceRuntime != null && ((this.PnicResourceInfo == null && hostNetworkResourceRuntime.PnicResourceInfo == null) || (this.PnicResourceInfo != null && hostNetworkResourceRuntime.PnicResourceInfo != null && Enumerable.SequenceEqual(this.PnicResourceInfo, hostNetworkResourceRuntime.PnicResourceInfo))));\n        }\n\n        public override bool Equals(object hostNetworkResourceRuntime)\n        {\n            return Equals(hostNetworkResourceRuntime as HostNetworkResourceRuntime);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PnicResourceInfo).GetHashCode();\n        }\n    }\n\n    public class HostNetworkSecurityPolicy : DynamicData, IEquatable<HostNetworkSecurityPolicy>\n    {\n        public bool? AllowPromiscuous { get; set; }\n\n        public bool? MacChanges { get; set; }\n\n        public bool? ForgedTransmits { get; set; }\n\n        public bool Equals(HostNetworkSecurityPolicy hostNetworkSecurityPolicy)\n        {\n            return (hostNetworkSecurityPolicy != null && ((this.AllowPromiscuous == null && hostNetworkSecurityPolicy.AllowPromiscuous == null) || (this.AllowPromiscuous != null && this.AllowPromiscuous.Equals(hostNetworkSecurityPolicy.AllowPromiscuous))) && ((this.MacChanges == null && hostNetworkSecurityPolicy.MacChanges == null) || (this.MacChanges != null && this.MacChanges.Equals(hostNetworkSecurityPolicy.MacChanges))) && ((this.ForgedTransmits == null && hostNetworkSecurityPolicy.ForgedTransmits == null) || (this.ForgedTransmits != null && this.ForgedTransmits.Equals(hostNetworkSecurityPolicy.ForgedTransmits))));\n        }\n\n        public override bool Equals(object hostNetworkSecurityPolicy)\n        {\n            return Equals(hostNetworkSecurityPolicy as HostNetworkSecurityPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowPromiscuous + \"_\" + MacChanges + \"_\" + ForgedTransmits).GetHashCode();\n        }\n    }\n\n    public class HostNetworkSystem : ExtensibleManagedObject, IEquatable<HostNetworkSystem>\n    {\n        public HostNetCapabilities Capabilities { get; set; }\n\n        public HostNetworkInfo NetworkInfo { get; set; }\n\n        public HostNetOffloadCapabilities OffloadCapabilities { get; set; }\n\n        public HostNetworkConfig NetworkConfig { get; set; }\n\n        public HostDnsConfig DnsConfig { get; set; }\n\n        public HostIpRouteConfig IpRouteConfig { get; set; }\n\n        public HostIpRouteConfig ConsoleIpRouteConfig { get; set; }\n\n        public HostNetworkConfigResult UpdateNetworkConfig(HostNetworkConfig config, string changeMode)\n        {\n            return default(HostNetworkConfigResult);\n        }\n\n        public void UpdateDnsConfig(HostDnsConfig config)\n        {\n        }\n\n        public void UpdateIpRouteConfig(HostIpRouteConfig config)\n        {\n        }\n\n        public void UpdateConsoleIpRouteConfig(HostIpRouteConfig config)\n        {\n        }\n\n        public void UpdateIpRouteTableConfig(HostIpRouteTableConfig config)\n        {\n        }\n\n        public void AddVirtualSwitch(string vswitchName, HostVirtualSwitchSpec spec)\n        {\n        }\n\n        public void RemoveVirtualSwitch(string vswitchName)\n        {\n        }\n\n        public void UpdateVirtualSwitch(string vswitchName, HostVirtualSwitchSpec spec)\n        {\n        }\n\n        public void AddPortGroup(HostPortGroupSpec portgrp)\n        {\n        }\n\n        public void RemovePortGroup(string pgName)\n        {\n        }\n\n        public void UpdatePortGroup(string pgName, HostPortGroupSpec portgrp)\n        {\n        }\n\n        public void UpdatePhysicalNicLinkSpeed(string device, PhysicalNicLinkInfo linkSpeed)\n        {\n        }\n\n        public PhysicalNicHintInfo[] QueryNetworkHint(string[] device)\n        {\n            return default(PhysicalNicHintInfo[]);\n        }\n\n        public string AddVirtualNic(string portgroup, HostVirtualNicSpec nic)\n        {\n            return default(string);\n        }\n\n        public void RemoveVirtualNic(string device)\n        {\n        }\n\n        public void UpdateVirtualNic(string device, HostVirtualNicSpec nic)\n        {\n        }\n\n        public string AddServiceConsoleVirtualNic(string portgroup, HostVirtualNicSpec nic)\n        {\n            return default(string);\n        }\n\n        public void RemoveServiceConsoleVirtualNic(string device)\n        {\n        }\n\n        public void UpdateServiceConsoleVirtualNic(string device, HostVirtualNicSpec nic)\n        {\n        }\n\n        public void RestartServiceConsoleVirtualNic(string device)\n        {\n        }\n\n        public void RefreshNetworkSystem()\n        {\n        }\n\n        public bool Equals(HostNetworkSystem hostNetworkSystem)\n        {\n            return (hostNetworkSystem != null && ((this.Capabilities == null && hostNetworkSystem.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(hostNetworkSystem.Capabilities))) && ((this.NetworkInfo == null && hostNetworkSystem.NetworkInfo == null) || (this.NetworkInfo != null && this.NetworkInfo.Equals(hostNetworkSystem.NetworkInfo))) && ((this.OffloadCapabilities == null && hostNetworkSystem.OffloadCapabilities == null) || (this.OffloadCapabilities != null && this.OffloadCapabilities.Equals(hostNetworkSystem.OffloadCapabilities))) && ((this.NetworkConfig == null && hostNetworkSystem.NetworkConfig == null) || (this.NetworkConfig != null && this.NetworkConfig.Equals(hostNetworkSystem.NetworkConfig))) && ((this.DnsConfig == null && hostNetworkSystem.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(hostNetworkSystem.DnsConfig))) && ((this.IpRouteConfig == null && hostNetworkSystem.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(hostNetworkSystem.IpRouteConfig))) && ((this.ConsoleIpRouteConfig == null && hostNetworkSystem.ConsoleIpRouteConfig == null) || (this.ConsoleIpRouteConfig != null && this.ConsoleIpRouteConfig.Equals(hostNetworkSystem.ConsoleIpRouteConfig))));\n        }\n\n        public override bool Equals(object hostNetworkSystem)\n        {\n            return Equals(hostNetworkSystem as HostNetworkSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capabilities + \"_\" + NetworkInfo + \"_\" + OffloadCapabilities + \"_\" + NetworkConfig + \"_\" + DnsConfig + \"_\" + IpRouteConfig + \"_\" + ConsoleIpRouteConfig).GetHashCode();\n        }\n    }\n\n    public class HostNetworkTrafficShapingPolicy : DynamicData, IEquatable<HostNetworkTrafficShapingPolicy>\n    {\n        public bool? Enabled { get; set; }\n\n        public long? AverageBandwidth { get; set; }\n\n        public long? PeakBandwidth { get; set; }\n\n        public long? BurstSize { get; set; }\n\n        public bool Equals(HostNetworkTrafficShapingPolicy hostNetworkTrafficShapingPolicy)\n        {\n            return (hostNetworkTrafficShapingPolicy != null && ((this.Enabled == null && hostNetworkTrafficShapingPolicy.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(hostNetworkTrafficShapingPolicy.Enabled))) && ((this.AverageBandwidth == null && hostNetworkTrafficShapingPolicy.AverageBandwidth == null) || (this.AverageBandwidth != null && this.AverageBandwidth.Equals(hostNetworkTrafficShapingPolicy.AverageBandwidth))) && ((this.PeakBandwidth == null && hostNetworkTrafficShapingPolicy.PeakBandwidth == null) || (this.PeakBandwidth != null && this.PeakBandwidth.Equals(hostNetworkTrafficShapingPolicy.PeakBandwidth))) && ((this.BurstSize == null && hostNetworkTrafficShapingPolicy.BurstSize == null) || (this.BurstSize != null && this.BurstSize.Equals(hostNetworkTrafficShapingPolicy.BurstSize))));\n        }\n\n        public override bool Equals(object hostNetworkTrafficShapingPolicy)\n        {\n            return Equals(hostNetworkTrafficShapingPolicy as HostNetworkTrafficShapingPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + AverageBandwidth + \"_\" + PeakBandwidth + \"_\" + BurstSize).GetHashCode();\n        }\n    }\n\n    public class HostNewNetworkConnectInfo : HostConnectInfoNetworkInfo, IEquatable<HostNewNetworkConnectInfo>\n    {\n        public bool Equals(HostNewNetworkConnectInfo hostNewNetworkConnectInfo)\n        {\n            return (hostNewNetworkConnectInfo != null && base.Equals(hostNewNetworkConnectInfo));\n        }\n\n        public override bool Equals(object hostNewNetworkConnectInfo)\n        {\n            return Equals(hostNewNetworkConnectInfo as HostNewNetworkConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNicFailureCriteria : DynamicData, IEquatable<HostNicFailureCriteria>\n    {\n        public string CheckSpeed { get; set; }\n\n        public int? Speed { get; set; }\n\n        public bool? CheckDuplex { get; set; }\n\n        public bool? FullDuplex { get; set; }\n\n        public bool? CheckErrorPercent { get; set; }\n\n        public int? Percentage { get; set; }\n\n        public bool? CheckBeacon { get; set; }\n\n        public bool Equals(HostNicFailureCriteria hostNicFailureCriteria)\n        {\n            return (hostNicFailureCriteria != null && this.CheckSpeed == hostNicFailureCriteria.CheckSpeed && ((this.Speed == null && hostNicFailureCriteria.Speed == null) || (this.Speed != null && this.Speed.Equals(hostNicFailureCriteria.Speed))) && ((this.CheckDuplex == null && hostNicFailureCriteria.CheckDuplex == null) || (this.CheckDuplex != null && this.CheckDuplex.Equals(hostNicFailureCriteria.CheckDuplex))) && ((this.FullDuplex == null && hostNicFailureCriteria.FullDuplex == null) || (this.FullDuplex != null && this.FullDuplex.Equals(hostNicFailureCriteria.FullDuplex))) && ((this.CheckErrorPercent == null && hostNicFailureCriteria.CheckErrorPercent == null) || (this.CheckErrorPercent != null && this.CheckErrorPercent.Equals(hostNicFailureCriteria.CheckErrorPercent))) && ((this.Percentage == null && hostNicFailureCriteria.Percentage == null) || (this.Percentage != null && this.Percentage.Equals(hostNicFailureCriteria.Percentage))) && ((this.CheckBeacon == null && hostNicFailureCriteria.CheckBeacon == null) || (this.CheckBeacon != null && this.CheckBeacon.Equals(hostNicFailureCriteria.CheckBeacon))));\n        }\n\n        public override bool Equals(object hostNicFailureCriteria)\n        {\n            return Equals(hostNicFailureCriteria as HostNicFailureCriteria);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CheckSpeed + \"_\" + Speed + \"_\" + CheckDuplex + \"_\" + FullDuplex + \"_\" + CheckErrorPercent + \"_\" + Percentage + \"_\" + CheckBeacon).GetHashCode();\n        }\n    }\n\n    public class HostNicOrderPolicy : DynamicData, IEquatable<HostNicOrderPolicy>\n    {\n        public string[] ActiveNic { get; set; }\n\n        public string[] StandbyNic { get; set; }\n\n        public bool Equals(HostNicOrderPolicy hostNicOrderPolicy)\n        {\n            return (hostNicOrderPolicy != null && ((this.ActiveNic == null && hostNicOrderPolicy.ActiveNic == null) || (this.ActiveNic != null && hostNicOrderPolicy.ActiveNic != null && Enumerable.SequenceEqual(this.ActiveNic, hostNicOrderPolicy.ActiveNic))) && ((this.StandbyNic == null && hostNicOrderPolicy.StandbyNic == null) || (this.StandbyNic != null && hostNicOrderPolicy.StandbyNic != null && Enumerable.SequenceEqual(this.StandbyNic, hostNicOrderPolicy.StandbyNic))));\n        }\n\n        public override bool Equals(object hostNicOrderPolicy)\n        {\n            return Equals(hostNicOrderPolicy as HostNicOrderPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActiveNic + \"_\" + StandbyNic).GetHashCode();\n        }\n    }\n\n    public class HostNicTeamingPolicy : DynamicData, IEquatable<HostNicTeamingPolicy>\n    {\n        public string Policy { get; set; }\n\n        public bool? ReversePolicy { get; set; }\n\n        public bool? NotifySwitches { get; set; }\n\n        public bool? RollingOrder { get; set; }\n\n        public HostNicFailureCriteria FailureCriteria { get; set; }\n\n        public HostNicOrderPolicy NicOrder { get; set; }\n\n        public bool Equals(HostNicTeamingPolicy hostNicTeamingPolicy)\n        {\n            return (hostNicTeamingPolicy != null && this.Policy == hostNicTeamingPolicy.Policy && ((this.ReversePolicy == null && hostNicTeamingPolicy.ReversePolicy == null) || (this.ReversePolicy != null && this.ReversePolicy.Equals(hostNicTeamingPolicy.ReversePolicy))) && ((this.NotifySwitches == null && hostNicTeamingPolicy.NotifySwitches == null) || (this.NotifySwitches != null && this.NotifySwitches.Equals(hostNicTeamingPolicy.NotifySwitches))) && ((this.RollingOrder == null && hostNicTeamingPolicy.RollingOrder == null) || (this.RollingOrder != null && this.RollingOrder.Equals(hostNicTeamingPolicy.RollingOrder))) && ((this.FailureCriteria == null && hostNicTeamingPolicy.FailureCriteria == null) || (this.FailureCriteria != null && this.FailureCriteria.Equals(hostNicTeamingPolicy.FailureCriteria))) && ((this.NicOrder == null && hostNicTeamingPolicy.NicOrder == null) || (this.NicOrder != null && this.NicOrder.Equals(hostNicTeamingPolicy.NicOrder))));\n        }\n\n        public override bool Equals(object hostNicTeamingPolicy)\n        {\n            return Equals(hostNicTeamingPolicy as HostNicTeamingPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy + \"_\" + ReversePolicy + \"_\" + NotifySwitches + \"_\" + RollingOrder + \"_\" + FailureCriteria + \"_\" + NicOrder).GetHashCode();\n        }\n    }\n\n    public class HostNoAvailableNetworksEvent : HostDasEvent, IEquatable<HostNoAvailableNetworksEvent>\n    {\n        public string Ips { get; set; }\n\n        public bool Equals(HostNoAvailableNetworksEvent hostNoAvailableNetworksEvent)\n        {\n            return (hostNoAvailableNetworksEvent != null && this.Ips == hostNoAvailableNetworksEvent.Ips);\n        }\n\n        public override bool Equals(object hostNoAvailableNetworksEvent)\n        {\n            return Equals(hostNoAvailableNetworksEvent as HostNoAvailableNetworksEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ips).GetHashCode();\n        }\n    }\n\n    public class HostNoHAEnabledPortGroupsEvent : HostDasEvent, IEquatable<HostNoHAEnabledPortGroupsEvent>\n    {\n        public bool Equals(HostNoHAEnabledPortGroupsEvent hostNoHAEnabledPortGroupsEvent)\n        {\n            return (hostNoHAEnabledPortGroupsEvent != null && base.Equals(hostNoHAEnabledPortGroupsEvent));\n        }\n\n        public override bool Equals(object hostNoHAEnabledPortGroupsEvent)\n        {\n            return Equals(hostNoHAEnabledPortGroupsEvent as HostNoHAEnabledPortGroupsEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNonCompliantEvent : HostEvent, IEquatable<HostNonCompliantEvent>\n    {\n        public bool Equals(HostNonCompliantEvent hostNonCompliantEvent)\n        {\n            return (hostNonCompliantEvent != null && base.Equals(hostNonCompliantEvent));\n        }\n\n        public override bool Equals(object hostNonCompliantEvent)\n        {\n            return Equals(hostNonCompliantEvent as HostNonCompliantEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNoRedundantManagementNetworkEvent : HostDasEvent, IEquatable<HostNoRedundantManagementNetworkEvent>\n    {\n        public bool Equals(HostNoRedundantManagementNetworkEvent hostNoRedundantManagementNetworkEvent)\n        {\n            return (hostNoRedundantManagementNetworkEvent != null && base.Equals(hostNoRedundantManagementNetworkEvent));\n        }\n\n        public override bool Equals(object hostNoRedundantManagementNetworkEvent)\n        {\n            return Equals(hostNoRedundantManagementNetworkEvent as HostNoRedundantManagementNetworkEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNotConnected : HostCommunication, IEquatable<HostNotConnected>\n    {\n        public bool Equals(HostNotConnected hostNotConnected)\n        {\n            return (hostNotConnected != null && base.Equals(hostNotConnected));\n        }\n\n        public override bool Equals(object hostNotConnected)\n        {\n            return Equals(hostNotConnected as HostNotConnected);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNotInClusterEvent : HostDasEvent, IEquatable<HostNotInClusterEvent>\n    {\n        public bool Equals(HostNotInClusterEvent hostNotInClusterEvent)\n        {\n            return (hostNotInClusterEvent != null && base.Equals(hostNotInClusterEvent));\n        }\n\n        public override bool Equals(object hostNotInClusterEvent)\n        {\n            return Equals(hostNotInClusterEvent as HostNotInClusterEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNotReachable : HostCommunication, IEquatable<HostNotReachable>\n    {\n        public bool Equals(HostNotReachable hostNotReachable)\n        {\n            return (hostNotReachable != null && base.Equals(hostNotReachable));\n        }\n\n        public override bool Equals(object hostNotReachable)\n        {\n            return Equals(hostNotReachable as HostNotReachable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostNtpConfig : DynamicData, IEquatable<HostNtpConfig>\n    {\n        public string[] Server { get; set; }\n\n        public string[] ConfigFile { get; set; }\n\n        public bool Equals(HostNtpConfig hostNtpConfig)\n        {\n            return (hostNtpConfig != null && ((this.Server == null && hostNtpConfig.Server == null) || (this.Server != null && hostNtpConfig.Server != null && Enumerable.SequenceEqual(this.Server, hostNtpConfig.Server))) && ((this.ConfigFile == null && hostNtpConfig.ConfigFile == null) || (this.ConfigFile != null && hostNtpConfig.ConfigFile != null && Enumerable.SequenceEqual(this.ConfigFile, hostNtpConfig.ConfigFile))));\n        }\n\n        public override bool Equals(object hostNtpConfig)\n        {\n            return Equals(hostNtpConfig as HostNtpConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Server + \"_\" + ConfigFile).GetHashCode();\n        }\n    }\n\n    public class HostNumaInfo : DynamicData, IEquatable<HostNumaInfo>\n    {\n        public string Type { get; set; }\n\n        public int NumNodes { get; set; }\n\n        public HostNumaNode[] NumaNode { get; set; }\n\n        public bool Equals(HostNumaInfo hostNumaInfo)\n        {\n            return (hostNumaInfo != null && this.Type == hostNumaInfo.Type && this.NumNodes == hostNumaInfo.NumNodes && ((this.NumaNode == null && hostNumaInfo.NumaNode == null) || (this.NumaNode != null && hostNumaInfo.NumaNode != null && Enumerable.SequenceEqual(this.NumaNode, hostNumaInfo.NumaNode))));\n        }\n\n        public override bool Equals(object hostNumaInfo)\n        {\n            return Equals(hostNumaInfo as HostNumaInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + NumNodes + \"_\" + NumaNode).GetHashCode();\n        }\n    }\n\n    public class HostNumaNode : DynamicData, IEquatable<HostNumaNode>\n    {\n        public sbyte TypeId { get; set; }\n\n        public short[] CpuID { get; set; }\n\n        public long MemoryRangeBegin { get; set; }\n\n        public long MemoryRangeLength { get; set; }\n\n        public string[] PciId { get; set; }\n\n        public bool Equals(HostNumaNode hostNumaNode)\n        {\n            return (hostNumaNode != null && this.TypeId == hostNumaNode.TypeId && ((this.CpuID == null && hostNumaNode.CpuID == null) || (this.CpuID != null && hostNumaNode.CpuID != null && Enumerable.SequenceEqual(this.CpuID, hostNumaNode.CpuID))) && this.MemoryRangeBegin == hostNumaNode.MemoryRangeBegin && this.MemoryRangeLength == hostNumaNode.MemoryRangeLength && ((this.PciId == null && hostNumaNode.PciId == null) || (this.PciId != null && hostNumaNode.PciId != null && Enumerable.SequenceEqual(this.PciId, hostNumaNode.PciId))));\n        }\n\n        public override bool Equals(object hostNumaNode)\n        {\n            return Equals(hostNumaNode as HostNumaNode);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TypeId + \"_\" + CpuID + \"_\" + MemoryRangeBegin + \"_\" + MemoryRangeLength + \"_\" + PciId).GetHashCode();\n        }\n    }\n\n    public class HostNumericSensorInfo : DynamicData, IEquatable<HostNumericSensorInfo>\n    {\n        public string Name { get; set; }\n\n        public ElementDescription HealthState { get; set; }\n\n        public long CurrentReading { get; set; }\n\n        public int UnitModifier { get; set; }\n\n        public string BaseUnits { get; set; }\n\n        public string RateUnits { get; set; }\n\n        public string SensorType { get; set; }\n\n        public string Id { get; set; }\n\n        public string TimeStamp { get; set; }\n\n        public bool Equals(HostNumericSensorInfo hostNumericSensorInfo)\n        {\n            return (hostNumericSensorInfo != null && this.Name == hostNumericSensorInfo.Name && ((this.HealthState == null && hostNumericSensorInfo.HealthState == null) || (this.HealthState != null && this.HealthState.Equals(hostNumericSensorInfo.HealthState))) && this.CurrentReading == hostNumericSensorInfo.CurrentReading && this.UnitModifier == hostNumericSensorInfo.UnitModifier && this.BaseUnits == hostNumericSensorInfo.BaseUnits && this.RateUnits == hostNumericSensorInfo.RateUnits && this.SensorType == hostNumericSensorInfo.SensorType && this.Id == hostNumericSensorInfo.Id && this.TimeStamp == hostNumericSensorInfo.TimeStamp);\n        }\n\n        public override bool Equals(object hostNumericSensorInfo)\n        {\n            return Equals(hostNumericSensorInfo as HostNumericSensorInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + HealthState + \"_\" + CurrentReading + \"_\" + UnitModifier + \"_\" + BaseUnits + \"_\" + RateUnits + \"_\" + SensorType + \"_\" + Id + \"_\" + TimeStamp).GetHashCode();\n        }\n    }\n\n    public class HostNvdimmSystem : ViewBase, IEquatable<HostNvdimmSystem>\n    {\n        public NvdimmSystemInfo NvdimmSystemInfo { get; set; }\n\n        public ManagedObjectReference CreateNvdimmNamespace_Task(NvdimmNamespaceCreateSpec createSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public NvdimmGuid CreateNvdimmNamespace(NvdimmNamespaceCreateSpec createSpec)\n        {\n            return default(NvdimmGuid);\n        }\n\n        public ManagedObjectReference CreateNvdimmPMemNamespace_Task(NvdimmPMemNamespaceCreateSpec createSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public NvdimmGuid CreateNvdimmPMemNamespace(NvdimmPMemNamespaceCreateSpec createSpec)\n        {\n            return default(NvdimmGuid);\n        }\n\n        public ManagedObjectReference DeleteNvdimmNamespace_Task(NvdimmNamespaceDeleteSpec deleteSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DeleteNvdimmNamespace(NvdimmNamespaceDeleteSpec deleteSpec)\n        {\n        }\n\n        public ManagedObjectReference DeleteNvdimmBlockNamespaces_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DeleteNvdimmBlockNamespaces()\n        {\n        }\n\n        public bool Equals(HostNvdimmSystem hostNvdimmSystem)\n        {\n            return (hostNvdimmSystem != null && ((this.NvdimmSystemInfo == null && hostNvdimmSystem.NvdimmSystemInfo == null) || (this.NvdimmSystemInfo != null && this.NvdimmSystemInfo.Equals(hostNvdimmSystem.NvdimmSystemInfo))));\n        }\n\n        public override bool Equals(object hostNvdimmSystem)\n        {\n            return Equals(hostNvdimmSystem as HostNvdimmSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NvdimmSystemInfo).GetHashCode();\n        }\n    }\n\n    public class HostOpaqueNetworkInfo : DynamicData, IEquatable<HostOpaqueNetworkInfo>\n    {\n        public string OpaqueNetworkId { get; set; }\n\n        public string OpaqueNetworkName { get; set; }\n\n        public string OpaqueNetworkType { get; set; }\n\n        public string[] PnicZone { get; set; }\n\n        public OpaqueNetworkCapability Capability { get; set; }\n\n        public OptionValue[] ExtraConfig { get; set; }\n\n        public bool Equals(HostOpaqueNetworkInfo hostOpaqueNetworkInfo)\n        {\n            return (hostOpaqueNetworkInfo != null && this.OpaqueNetworkId == hostOpaqueNetworkInfo.OpaqueNetworkId && this.OpaqueNetworkName == hostOpaqueNetworkInfo.OpaqueNetworkName && this.OpaqueNetworkType == hostOpaqueNetworkInfo.OpaqueNetworkType && ((this.PnicZone == null && hostOpaqueNetworkInfo.PnicZone == null) || (this.PnicZone != null && hostOpaqueNetworkInfo.PnicZone != null && Enumerable.SequenceEqual(this.PnicZone, hostOpaqueNetworkInfo.PnicZone))) && ((this.Capability == null && hostOpaqueNetworkInfo.Capability == null) || (this.Capability != null && this.Capability.Equals(hostOpaqueNetworkInfo.Capability))) && ((this.ExtraConfig == null && hostOpaqueNetworkInfo.ExtraConfig == null) || (this.ExtraConfig != null && hostOpaqueNetworkInfo.ExtraConfig != null && Enumerable.SequenceEqual(this.ExtraConfig, hostOpaqueNetworkInfo.ExtraConfig))));\n        }\n\n        public override bool Equals(object hostOpaqueNetworkInfo)\n        {\n            return Equals(hostOpaqueNetworkInfo as HostOpaqueNetworkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OpaqueNetworkId + \"_\" + OpaqueNetworkName + \"_\" + OpaqueNetworkType + \"_\" + PnicZone + \"_\" + Capability + \"_\" + ExtraConfig).GetHashCode();\n        }\n    }\n\n    public class HostOpaqueSwitch : DynamicData, IEquatable<HostOpaqueSwitch>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string[] Pnic { get; set; }\n\n        public HostOpaqueSwitchPhysicalNicZone[] PnicZone { get; set; }\n\n        public string Status { get; set; }\n\n        public HostVirtualNic[] Vtep { get; set; }\n\n        public OptionValue[] ExtraConfig { get; set; }\n\n        public HostFeatureCapability[] FeatureCapability { get; set; }\n\n        public bool Equals(HostOpaqueSwitch hostOpaqueSwitch)\n        {\n            return (hostOpaqueSwitch != null && this.Key == hostOpaqueSwitch.Key && this.Name == hostOpaqueSwitch.Name && ((this.Pnic == null && hostOpaqueSwitch.Pnic == null) || (this.Pnic != null && hostOpaqueSwitch.Pnic != null && Enumerable.SequenceEqual(this.Pnic, hostOpaqueSwitch.Pnic))) && ((this.PnicZone == null && hostOpaqueSwitch.PnicZone == null) || (this.PnicZone != null && hostOpaqueSwitch.PnicZone != null && Enumerable.SequenceEqual(this.PnicZone, hostOpaqueSwitch.PnicZone))) && this.Status == hostOpaqueSwitch.Status && ((this.Vtep == null && hostOpaqueSwitch.Vtep == null) || (this.Vtep != null && hostOpaqueSwitch.Vtep != null && Enumerable.SequenceEqual(this.Vtep, hostOpaqueSwitch.Vtep))) && ((this.ExtraConfig == null && hostOpaqueSwitch.ExtraConfig == null) || (this.ExtraConfig != null && hostOpaqueSwitch.ExtraConfig != null && Enumerable.SequenceEqual(this.ExtraConfig, hostOpaqueSwitch.ExtraConfig))) && ((this.FeatureCapability == null && hostOpaqueSwitch.FeatureCapability == null) || (this.FeatureCapability != null && hostOpaqueSwitch.FeatureCapability != null && Enumerable.SequenceEqual(this.FeatureCapability, hostOpaqueSwitch.FeatureCapability))));\n        }\n\n        public override bool Equals(object hostOpaqueSwitch)\n        {\n            return Equals(hostOpaqueSwitch as HostOpaqueSwitch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Pnic + \"_\" + PnicZone + \"_\" + Status + \"_\" + Vtep + \"_\" + ExtraConfig + \"_\" + FeatureCapability).GetHashCode();\n        }\n    }\n\n    public class HostOpaqueSwitchPhysicalNicZone : DynamicData, IEquatable<HostOpaqueSwitchPhysicalNicZone>\n    {\n        public string Key { get; set; }\n\n        public string[] PnicDevice { get; set; }\n\n        public bool Equals(HostOpaqueSwitchPhysicalNicZone hostOpaqueSwitchPhysicalNicZone)\n        {\n            return (hostOpaqueSwitchPhysicalNicZone != null && this.Key == hostOpaqueSwitchPhysicalNicZone.Key && ((this.PnicDevice == null && hostOpaqueSwitchPhysicalNicZone.PnicDevice == null) || (this.PnicDevice != null && hostOpaqueSwitchPhysicalNicZone.PnicDevice != null && Enumerable.SequenceEqual(this.PnicDevice, hostOpaqueSwitchPhysicalNicZone.PnicDevice))));\n        }\n\n        public override bool Equals(object hostOpaqueSwitchPhysicalNicZone)\n        {\n            return Equals(hostOpaqueSwitchPhysicalNicZone as HostOpaqueSwitchPhysicalNicZone);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + PnicDevice).GetHashCode();\n        }\n    }\n\n    public class HostOvercommittedEvent : ClusterOvercommittedEvent, IEquatable<HostOvercommittedEvent>\n    {\n        public bool Equals(HostOvercommittedEvent hostOvercommittedEvent)\n        {\n            return (hostOvercommittedEvent != null && base.Equals(hostOvercommittedEvent));\n        }\n\n        public override bool Equals(object hostOvercommittedEvent)\n        {\n            return Equals(hostOvercommittedEvent as HostOvercommittedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostParallelScsiHba : HostHostBusAdapter, IEquatable<HostParallelScsiHba>\n    {\n        public bool Equals(HostParallelScsiHba hostParallelScsiHba)\n        {\n            return (hostParallelScsiHba != null && base.Equals(hostParallelScsiHba));\n        }\n\n        public override bool Equals(object hostParallelScsiHba)\n        {\n            return Equals(hostParallelScsiHba as HostParallelScsiHba);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostParallelScsiTargetTransport : HostTargetTransport, IEquatable<HostParallelScsiTargetTransport>\n    {\n        public bool Equals(HostParallelScsiTargetTransport hostParallelScsiTargetTransport)\n        {\n            return (hostParallelScsiTargetTransport != null && base.Equals(hostParallelScsiTargetTransport));\n        }\n\n        public override bool Equals(object hostParallelScsiTargetTransport)\n        {\n            return Equals(hostParallelScsiTargetTransport as HostParallelScsiTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostPatchManager : ViewBase, IEquatable<HostPatchManager>\n    {\n        public ManagedObjectReference CheckHostPatch_Task(string[] metaUrls, string[] bundleUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerResult CheckHostPatch(string[] metaUrls, string[] bundleUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(HostPatchManagerResult);\n        }\n\n        public ManagedObjectReference ScanHostPatch_Task(HostPatchManagerLocator repository, string[] updateID)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerStatus[] ScanHostPatch(HostPatchManagerLocator repository, string[] updateID)\n        {\n            return default(HostPatchManagerStatus[]);\n        }\n\n        public ManagedObjectReference ScanHostPatchV2_Task(string[] metaUrls, string[] bundleUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerResult ScanHostPatchV2(string[] metaUrls, string[] bundleUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(HostPatchManagerResult);\n        }\n\n        public ManagedObjectReference StageHostPatch_Task(string[] metaUrls, string[] bundleUrls, string[] vibUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerResult StageHostPatch(string[] metaUrls, string[] bundleUrls, string[] vibUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(HostPatchManagerResult);\n        }\n\n        public ManagedObjectReference InstallHostPatch_Task(HostPatchManagerLocator repository, string updateID, bool? force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void InstallHostPatch(HostPatchManagerLocator repository, string updateID, bool? force)\n        {\n        }\n\n        public ManagedObjectReference InstallHostPatchV2_Task(string[] metaUrls, string[] bundleUrls, string[] vibUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerResult InstallHostPatchV2(string[] metaUrls, string[] bundleUrls, string[] vibUrls, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(HostPatchManagerResult);\n        }\n\n        public ManagedObjectReference UninstallHostPatch_Task(string[] bulletinIds, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerResult UninstallHostPatch(string[] bulletinIds, HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(HostPatchManagerResult);\n        }\n\n        public ManagedObjectReference QueryHostPatch_Task(HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostPatchManagerResult QueryHostPatch(HostPatchManagerPatchManagerOperationSpec spec)\n        {\n            return default(HostPatchManagerResult);\n        }\n\n        public bool Equals(HostPatchManager hostPatchManager)\n        {\n            return (hostPatchManager != null && base.Equals(hostPatchManager));\n        }\n\n        public override bool Equals(object hostPatchManager)\n        {\n            return Equals(hostPatchManager as HostPatchManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostPatchManagerLocator : DynamicData, IEquatable<HostPatchManagerLocator>\n    {\n        public string Url { get; set; }\n\n        public string Proxy { get; set; }\n\n        public bool Equals(HostPatchManagerLocator hostPatchManagerLocator)\n        {\n            return (hostPatchManagerLocator != null && this.Url == hostPatchManagerLocator.Url && this.Proxy == hostPatchManagerLocator.Proxy);\n        }\n\n        public override bool Equals(object hostPatchManagerLocator)\n        {\n            return Equals(hostPatchManagerLocator as HostPatchManagerLocator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Url + \"_\" + Proxy).GetHashCode();\n        }\n    }\n\n    public class HostPatchManagerPatchManagerOperationSpec : DynamicData, IEquatable<HostPatchManagerPatchManagerOperationSpec>\n    {\n        public string Proxy { get; set; }\n\n        public int? Port { get; set; }\n\n        public string UserName { get; set; }\n\n        public string Password { get; set; }\n\n        public string CmdOption { get; set; }\n\n        public bool Equals(HostPatchManagerPatchManagerOperationSpec hostPatchManagerPatchManagerOperationSpec)\n        {\n            return (hostPatchManagerPatchManagerOperationSpec != null && this.Proxy == hostPatchManagerPatchManagerOperationSpec.Proxy && ((this.Port == null && hostPatchManagerPatchManagerOperationSpec.Port == null) || (this.Port != null && this.Port.Equals(hostPatchManagerPatchManagerOperationSpec.Port))) && this.UserName == hostPatchManagerPatchManagerOperationSpec.UserName && this.Password == hostPatchManagerPatchManagerOperationSpec.Password && this.CmdOption == hostPatchManagerPatchManagerOperationSpec.CmdOption);\n        }\n\n        public override bool Equals(object hostPatchManagerPatchManagerOperationSpec)\n        {\n            return Equals(hostPatchManagerPatchManagerOperationSpec as HostPatchManagerPatchManagerOperationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Proxy + \"_\" + Port + \"_\" + UserName + \"_\" + Password + \"_\" + CmdOption).GetHashCode();\n        }\n    }\n\n    public class HostPatchManagerResult : DynamicData, IEquatable<HostPatchManagerResult>\n    {\n        public string Version { get; set; }\n\n        public HostPatchManagerStatus[] Status { get; set; }\n\n        public string XmlResult { get; set; }\n\n        public bool Equals(HostPatchManagerResult hostPatchManagerResult)\n        {\n            return (hostPatchManagerResult != null && this.Version == hostPatchManagerResult.Version && ((this.Status == null && hostPatchManagerResult.Status == null) || (this.Status != null && hostPatchManagerResult.Status != null && Enumerable.SequenceEqual(this.Status, hostPatchManagerResult.Status))) && this.XmlResult == hostPatchManagerResult.XmlResult);\n        }\n\n        public override bool Equals(object hostPatchManagerResult)\n        {\n            return Equals(hostPatchManagerResult as HostPatchManagerResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version + \"_\" + Status + \"_\" + XmlResult).GetHashCode();\n        }\n    }\n\n    public class HostPatchManagerStatus : DynamicData, IEquatable<HostPatchManagerStatus>\n    {\n        public string Id { get; set; }\n\n        public bool Applicable { get; set; }\n\n        public string[] Reason { get; set; }\n\n        public string Integrity { get; set; }\n\n        public bool Installed { get; set; }\n\n        public string[] InstallState { get; set; }\n\n        public HostPatchManagerStatusPrerequisitePatch[] PrerequisitePatch { get; set; }\n\n        public bool RestartRequired { get; set; }\n\n        public bool ReconnectRequired { get; set; }\n\n        public bool VmOffRequired { get; set; }\n\n        public string[] SupersededPatchIds { get; set; }\n\n        public bool Equals(HostPatchManagerStatus hostPatchManagerStatus)\n        {\n            return (hostPatchManagerStatus != null && this.Id == hostPatchManagerStatus.Id && this.Applicable == hostPatchManagerStatus.Applicable && ((this.Reason == null && hostPatchManagerStatus.Reason == null) || (this.Reason != null && hostPatchManagerStatus.Reason != null && Enumerable.SequenceEqual(this.Reason, hostPatchManagerStatus.Reason))) && this.Integrity == hostPatchManagerStatus.Integrity && this.Installed == hostPatchManagerStatus.Installed && ((this.InstallState == null && hostPatchManagerStatus.InstallState == null) || (this.InstallState != null && hostPatchManagerStatus.InstallState != null && Enumerable.SequenceEqual(this.InstallState, hostPatchManagerStatus.InstallState))) && ((this.PrerequisitePatch == null && hostPatchManagerStatus.PrerequisitePatch == null) || (this.PrerequisitePatch != null && hostPatchManagerStatus.PrerequisitePatch != null && Enumerable.SequenceEqual(this.PrerequisitePatch, hostPatchManagerStatus.PrerequisitePatch))) && this.RestartRequired == hostPatchManagerStatus.RestartRequired && this.ReconnectRequired == hostPatchManagerStatus.ReconnectRequired && this.VmOffRequired == hostPatchManagerStatus.VmOffRequired && ((this.SupersededPatchIds == null && hostPatchManagerStatus.SupersededPatchIds == null) || (this.SupersededPatchIds != null && hostPatchManagerStatus.SupersededPatchIds != null && Enumerable.SequenceEqual(this.SupersededPatchIds, hostPatchManagerStatus.SupersededPatchIds))));\n        }\n\n        public override bool Equals(object hostPatchManagerStatus)\n        {\n            return Equals(hostPatchManagerStatus as HostPatchManagerStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Applicable + \"_\" + Reason + \"_\" + Integrity + \"_\" + Installed + \"_\" + InstallState + \"_\" + PrerequisitePatch + \"_\" + RestartRequired + \"_\" + ReconnectRequired + \"_\" + VmOffRequired + \"_\" + SupersededPatchIds).GetHashCode();\n        }\n    }\n\n    public class HostPatchManagerStatusPrerequisitePatch : DynamicData, IEquatable<HostPatchManagerStatusPrerequisitePatch>\n    {\n        public string Id { get; set; }\n\n        public string[] InstallState { get; set; }\n\n        public bool Equals(HostPatchManagerStatusPrerequisitePatch hostPatchManagerStatusPrerequisitePatch)\n        {\n            return (hostPatchManagerStatusPrerequisitePatch != null && this.Id == hostPatchManagerStatusPrerequisitePatch.Id && ((this.InstallState == null && hostPatchManagerStatusPrerequisitePatch.InstallState == null) || (this.InstallState != null && hostPatchManagerStatusPrerequisitePatch.InstallState != null && Enumerable.SequenceEqual(this.InstallState, hostPatchManagerStatusPrerequisitePatch.InstallState))));\n        }\n\n        public override bool Equals(object hostPatchManagerStatusPrerequisitePatch)\n        {\n            return Equals(hostPatchManagerStatusPrerequisitePatch as HostPatchManagerStatusPrerequisitePatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + InstallState).GetHashCode();\n        }\n    }\n\n    public class HostPathSelectionPolicyOption : DynamicData, IEquatable<HostPathSelectionPolicyOption>\n    {\n        public ElementDescription Policy { get; set; }\n\n        public bool Equals(HostPathSelectionPolicyOption hostPathSelectionPolicyOption)\n        {\n            return (hostPathSelectionPolicyOption != null && ((this.Policy == null && hostPathSelectionPolicyOption.Policy == null) || (this.Policy != null && this.Policy.Equals(hostPathSelectionPolicyOption.Policy))));\n        }\n\n        public override bool Equals(object hostPathSelectionPolicyOption)\n        {\n            return Equals(hostPathSelectionPolicyOption as HostPathSelectionPolicyOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy).GetHashCode();\n        }\n    }\n\n    public class HostPciDevice : DynamicData, IEquatable<HostPciDevice>\n    {\n        public string Id { get; set; }\n\n        public short ClassId { get; set; }\n\n        public sbyte Bus { get; set; }\n\n        public sbyte Slot { get; set; }\n\n        public sbyte Function { get; set; }\n\n        public short VendorId { get; set; }\n\n        public short SubVendorId { get; set; }\n\n        public string VendorName { get; set; }\n\n        public short DeviceId { get; set; }\n\n        public short SubDeviceId { get; set; }\n\n        public string ParentBridge { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public bool Equals(HostPciDevice hostPciDevice)\n        {\n            return (hostPciDevice != null && this.Id == hostPciDevice.Id && this.ClassId == hostPciDevice.ClassId && this.Bus == hostPciDevice.Bus && this.Slot == hostPciDevice.Slot && this.Function == hostPciDevice.Function && this.VendorId == hostPciDevice.VendorId && this.SubVendorId == hostPciDevice.SubVendorId && this.VendorName == hostPciDevice.VendorName && this.DeviceId == hostPciDevice.DeviceId && this.SubDeviceId == hostPciDevice.SubDeviceId && this.ParentBridge == hostPciDevice.ParentBridge && this.DeviceName == hostPciDevice.DeviceName);\n        }\n\n        public override bool Equals(object hostPciDevice)\n        {\n            return Equals(hostPciDevice as HostPciDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + ClassId + \"_\" + Bus + \"_\" + Slot + \"_\" + Function + \"_\" + VendorId + \"_\" + SubVendorId + \"_\" + VendorName + \"_\" + DeviceId + \"_\" + SubDeviceId + \"_\" + ParentBridge + \"_\" + DeviceName).GetHashCode();\n        }\n    }\n\n    public class HostPciPassthruConfig : DynamicData, IEquatable<HostPciPassthruConfig>\n    {\n        public string Id { get; set; }\n\n        public bool PassthruEnabled { get; set; }\n\n        public bool Equals(HostPciPassthruConfig hostPciPassthruConfig)\n        {\n            return (hostPciPassthruConfig != null && this.Id == hostPciPassthruConfig.Id && this.PassthruEnabled == hostPciPassthruConfig.PassthruEnabled);\n        }\n\n        public override bool Equals(object hostPciPassthruConfig)\n        {\n            return Equals(hostPciPassthruConfig as HostPciPassthruConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + PassthruEnabled).GetHashCode();\n        }\n    }\n\n    public class HostPciPassthruInfo : DynamicData, IEquatable<HostPciPassthruInfo>\n    {\n        public string Id { get; set; }\n\n        public string DependentDevice { get; set; }\n\n        public bool PassthruEnabled { get; set; }\n\n        public bool PassthruCapable { get; set; }\n\n        public bool PassthruActive { get; set; }\n\n        public bool Equals(HostPciPassthruInfo hostPciPassthruInfo)\n        {\n            return (hostPciPassthruInfo != null && this.Id == hostPciPassthruInfo.Id && this.DependentDevice == hostPciPassthruInfo.DependentDevice && this.PassthruEnabled == hostPciPassthruInfo.PassthruEnabled && this.PassthruCapable == hostPciPassthruInfo.PassthruCapable && this.PassthruActive == hostPciPassthruInfo.PassthruActive);\n        }\n\n        public override bool Equals(object hostPciPassthruInfo)\n        {\n            return Equals(hostPciPassthruInfo as HostPciPassthruInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + DependentDevice + \"_\" + PassthruEnabled + \"_\" + PassthruCapable + \"_\" + PassthruActive).GetHashCode();\n        }\n    }\n\n    public class HostPciPassthruSystem : ExtensibleManagedObject, IEquatable<HostPciPassthruSystem>\n    {\n        public HostPciPassthruInfo[] PciPassthruInfo { get; set; }\n\n        public HostSriovDevicePoolInfo[] SriovDevicePoolInfo { get; set; }\n\n        public void Refresh()\n        {\n        }\n\n        public void UpdatePassthruConfig(HostPciPassthruConfig[] config)\n        {\n        }\n\n        public bool Equals(HostPciPassthruSystem hostPciPassthruSystem)\n        {\n            return (hostPciPassthruSystem != null && ((this.PciPassthruInfo == null && hostPciPassthruSystem.PciPassthruInfo == null) || (this.PciPassthruInfo != null && hostPciPassthruSystem.PciPassthruInfo != null && Enumerable.SequenceEqual(this.PciPassthruInfo, hostPciPassthruSystem.PciPassthruInfo))) && ((this.SriovDevicePoolInfo == null && hostPciPassthruSystem.SriovDevicePoolInfo == null) || (this.SriovDevicePoolInfo != null && hostPciPassthruSystem.SriovDevicePoolInfo != null && Enumerable.SequenceEqual(this.SriovDevicePoolInfo, hostPciPassthruSystem.SriovDevicePoolInfo))));\n        }\n\n        public override bool Equals(object hostPciPassthruSystem)\n        {\n            return Equals(hostPciPassthruSystem as HostPciPassthruSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PciPassthruInfo + \"_\" + SriovDevicePoolInfo).GetHashCode();\n        }\n    }\n\n    public class HostPersistentMemoryInfo : DynamicData, IEquatable<HostPersistentMemoryInfo>\n    {\n        public long? CapacityInMB { get; set; }\n\n        public string VolumeUUID { get; set; }\n\n        public bool Equals(HostPersistentMemoryInfo hostPersistentMemoryInfo)\n        {\n            return (hostPersistentMemoryInfo != null && ((this.CapacityInMB == null && hostPersistentMemoryInfo.CapacityInMB == null) || (this.CapacityInMB != null && this.CapacityInMB.Equals(hostPersistentMemoryInfo.CapacityInMB))) && this.VolumeUUID == hostPersistentMemoryInfo.VolumeUUID);\n        }\n\n        public override bool Equals(object hostPersistentMemoryInfo)\n        {\n            return Equals(hostPersistentMemoryInfo as HostPersistentMemoryInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityInMB + \"_\" + VolumeUUID).GetHashCode();\n        }\n    }\n\n    public class HostPlacedVirtualNicIdentifier : DynamicData, IEquatable<HostPlacedVirtualNicIdentifier>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VnicKey { get; set; }\n\n        public int? Reservation { get; set; }\n\n        public HostPlacedVirtualNicIdentifier_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostPlacedVirtualNicIdentifier hostPlacedVirtualNicIdentifier)\n        {\n            return (hostPlacedVirtualNicIdentifier != null && ((this.Vm == null && hostPlacedVirtualNicIdentifier.Vm == null) || (this.Vm != null && this.Vm.Equals(hostPlacedVirtualNicIdentifier.Vm))) && this.VnicKey == hostPlacedVirtualNicIdentifier.VnicKey && ((this.Reservation == null && hostPlacedVirtualNicIdentifier.Reservation == null) || (this.Reservation != null && this.Reservation.Equals(hostPlacedVirtualNicIdentifier.Reservation))) && ((this.LinkedView == null && hostPlacedVirtualNicIdentifier.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostPlacedVirtualNicIdentifier.LinkedView))));\n        }\n\n        public override bool Equals(object hostPlacedVirtualNicIdentifier)\n        {\n            return Equals(hostPlacedVirtualNicIdentifier as HostPlacedVirtualNicIdentifier);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VnicKey + \"_\" + Reservation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostPlacedVirtualNicIdentifier_LinkedView : IEquatable<HostPlacedVirtualNicIdentifier_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(HostPlacedVirtualNicIdentifier_LinkedView hostPlacedVirtualNicIdentifier_LinkedView)\n        {\n            return (hostPlacedVirtualNicIdentifier_LinkedView != null && ((this.Vm == null && hostPlacedVirtualNicIdentifier_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(hostPlacedVirtualNicIdentifier_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object hostPlacedVirtualNicIdentifier_LinkedView)\n        {\n            return Equals(hostPlacedVirtualNicIdentifier_LinkedView as HostPlacedVirtualNicIdentifier_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class HostPlugStoreTopology : DynamicData, IEquatable<HostPlugStoreTopology>\n    {\n        public HostPlugStoreTopologyAdapter[] Adapter { get; set; }\n\n        public HostPlugStoreTopologyPath[] Path { get; set; }\n\n        public HostPlugStoreTopologyTarget[] Target { get; set; }\n\n        public HostPlugStoreTopologyDevice[] Device { get; set; }\n\n        public HostPlugStoreTopologyPlugin[] Plugin { get; set; }\n\n        public bool Equals(HostPlugStoreTopology hostPlugStoreTopology)\n        {\n            return (hostPlugStoreTopology != null && ((this.Adapter == null && hostPlugStoreTopology.Adapter == null) || (this.Adapter != null && hostPlugStoreTopology.Adapter != null && Enumerable.SequenceEqual(this.Adapter, hostPlugStoreTopology.Adapter))) && ((this.Path == null && hostPlugStoreTopology.Path == null) || (this.Path != null && hostPlugStoreTopology.Path != null && Enumerable.SequenceEqual(this.Path, hostPlugStoreTopology.Path))) && ((this.Target == null && hostPlugStoreTopology.Target == null) || (this.Target != null && hostPlugStoreTopology.Target != null && Enumerable.SequenceEqual(this.Target, hostPlugStoreTopology.Target))) && ((this.Device == null && hostPlugStoreTopology.Device == null) || (this.Device != null && hostPlugStoreTopology.Device != null && Enumerable.SequenceEqual(this.Device, hostPlugStoreTopology.Device))) && ((this.Plugin == null && hostPlugStoreTopology.Plugin == null) || (this.Plugin != null && hostPlugStoreTopology.Plugin != null && Enumerable.SequenceEqual(this.Plugin, hostPlugStoreTopology.Plugin))));\n        }\n\n        public override bool Equals(object hostPlugStoreTopology)\n        {\n            return Equals(hostPlugStoreTopology as HostPlugStoreTopology);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Adapter + \"_\" + Path + \"_\" + Target + \"_\" + Device + \"_\" + Plugin).GetHashCode();\n        }\n    }\n\n    public class HostPlugStoreTopologyAdapter : DynamicData, IEquatable<HostPlugStoreTopologyAdapter>\n    {\n        public string Key { get; set; }\n\n        public string Adapter { get; set; }\n\n        public string[] Path { get; set; }\n\n        public bool Equals(HostPlugStoreTopologyAdapter hostPlugStoreTopologyAdapter)\n        {\n            return (hostPlugStoreTopologyAdapter != null && this.Key == hostPlugStoreTopologyAdapter.Key && this.Adapter == hostPlugStoreTopologyAdapter.Adapter && ((this.Path == null && hostPlugStoreTopologyAdapter.Path == null) || (this.Path != null && hostPlugStoreTopologyAdapter.Path != null && Enumerable.SequenceEqual(this.Path, hostPlugStoreTopologyAdapter.Path))));\n        }\n\n        public override bool Equals(object hostPlugStoreTopologyAdapter)\n        {\n            return Equals(hostPlugStoreTopologyAdapter as HostPlugStoreTopologyAdapter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Adapter + \"_\" + Path).GetHashCode();\n        }\n    }\n\n    public class HostPlugStoreTopologyDevice : DynamicData, IEquatable<HostPlugStoreTopologyDevice>\n    {\n        public string Key { get; set; }\n\n        public string Lun { get; set; }\n\n        public string[] Path { get; set; }\n\n        public bool Equals(HostPlugStoreTopologyDevice hostPlugStoreTopologyDevice)\n        {\n            return (hostPlugStoreTopologyDevice != null && this.Key == hostPlugStoreTopologyDevice.Key && this.Lun == hostPlugStoreTopologyDevice.Lun && ((this.Path == null && hostPlugStoreTopologyDevice.Path == null) || (this.Path != null && hostPlugStoreTopologyDevice.Path != null && Enumerable.SequenceEqual(this.Path, hostPlugStoreTopologyDevice.Path))));\n        }\n\n        public override bool Equals(object hostPlugStoreTopologyDevice)\n        {\n            return Equals(hostPlugStoreTopologyDevice as HostPlugStoreTopologyDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Lun + \"_\" + Path).GetHashCode();\n        }\n    }\n\n    public class HostPlugStoreTopologyPath : DynamicData, IEquatable<HostPlugStoreTopologyPath>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public int? ChannelNumber { get; set; }\n\n        public int? TargetNumber { get; set; }\n\n        public int? LunNumber { get; set; }\n\n        public string Adapter { get; set; }\n\n        public string Target { get; set; }\n\n        public string Device { get; set; }\n\n        public bool Equals(HostPlugStoreTopologyPath hostPlugStoreTopologyPath)\n        {\n            return (hostPlugStoreTopologyPath != null && this.Key == hostPlugStoreTopologyPath.Key && this.Name == hostPlugStoreTopologyPath.Name && ((this.ChannelNumber == null && hostPlugStoreTopologyPath.ChannelNumber == null) || (this.ChannelNumber != null && this.ChannelNumber.Equals(hostPlugStoreTopologyPath.ChannelNumber))) && ((this.TargetNumber == null && hostPlugStoreTopologyPath.TargetNumber == null) || (this.TargetNumber != null && this.TargetNumber.Equals(hostPlugStoreTopologyPath.TargetNumber))) && ((this.LunNumber == null && hostPlugStoreTopologyPath.LunNumber == null) || (this.LunNumber != null && this.LunNumber.Equals(hostPlugStoreTopologyPath.LunNumber))) && this.Adapter == hostPlugStoreTopologyPath.Adapter && this.Target == hostPlugStoreTopologyPath.Target && this.Device == hostPlugStoreTopologyPath.Device);\n        }\n\n        public override bool Equals(object hostPlugStoreTopologyPath)\n        {\n            return Equals(hostPlugStoreTopologyPath as HostPlugStoreTopologyPath);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + ChannelNumber + \"_\" + TargetNumber + \"_\" + LunNumber + \"_\" + Adapter + \"_\" + Target + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class HostPlugStoreTopologyPlugin : DynamicData, IEquatable<HostPlugStoreTopologyPlugin>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string[] Device { get; set; }\n\n        public string[] ClaimedPath { get; set; }\n\n        public bool Equals(HostPlugStoreTopologyPlugin hostPlugStoreTopologyPlugin)\n        {\n            return (hostPlugStoreTopologyPlugin != null && this.Key == hostPlugStoreTopologyPlugin.Key && this.Name == hostPlugStoreTopologyPlugin.Name && ((this.Device == null && hostPlugStoreTopologyPlugin.Device == null) || (this.Device != null && hostPlugStoreTopologyPlugin.Device != null && Enumerable.SequenceEqual(this.Device, hostPlugStoreTopologyPlugin.Device))) && ((this.ClaimedPath == null && hostPlugStoreTopologyPlugin.ClaimedPath == null) || (this.ClaimedPath != null && hostPlugStoreTopologyPlugin.ClaimedPath != null && Enumerable.SequenceEqual(this.ClaimedPath, hostPlugStoreTopologyPlugin.ClaimedPath))));\n        }\n\n        public override bool Equals(object hostPlugStoreTopologyPlugin)\n        {\n            return Equals(hostPlugStoreTopologyPlugin as HostPlugStoreTopologyPlugin);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Device + \"_\" + ClaimedPath).GetHashCode();\n        }\n    }\n\n    public class HostPlugStoreTopologyTarget : DynamicData, IEquatable<HostPlugStoreTopologyTarget>\n    {\n        public string Key { get; set; }\n\n        public HostTargetTransport Transport { get; set; }\n\n        public bool Equals(HostPlugStoreTopologyTarget hostPlugStoreTopologyTarget)\n        {\n            return (hostPlugStoreTopologyTarget != null && this.Key == hostPlugStoreTopologyTarget.Key && ((this.Transport == null && hostPlugStoreTopologyTarget.Transport == null) || (this.Transport != null && this.Transport.Equals(hostPlugStoreTopologyTarget.Transport))));\n        }\n\n        public override bool Equals(object hostPlugStoreTopologyTarget)\n        {\n            return Equals(hostPlugStoreTopologyTarget as HostPlugStoreTopologyTarget);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Transport).GetHashCode();\n        }\n    }\n\n    public class HostPMemVolume : HostFileSystemVolume, IEquatable<HostPMemVolume>\n    {\n        public string Uuid { get; set; }\n\n        public string Version { get; set; }\n\n        public bool Equals(HostPMemVolume hostPMemVolume)\n        {\n            return (hostPMemVolume != null && this.Uuid == hostPMemVolume.Uuid && this.Version == hostPMemVolume.Version);\n        }\n\n        public override bool Equals(object hostPMemVolume)\n        {\n            return Equals(hostPMemVolume as HostPMemVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + Version).GetHashCode();\n        }\n    }\n\n    public class HostPnicNetworkResourceInfo : DynamicData, IEquatable<HostPnicNetworkResourceInfo>\n    {\n        public string PnicDevice { get; set; }\n\n        public long? AvailableBandwidthForVMTraffic { get; set; }\n\n        public long? UnusedBandwidthForVMTraffic { get; set; }\n\n        public HostPlacedVirtualNicIdentifier[] PlacedVirtualNics { get; set; }\n\n        public bool Equals(HostPnicNetworkResourceInfo hostPnicNetworkResourceInfo)\n        {\n            return (hostPnicNetworkResourceInfo != null && this.PnicDevice == hostPnicNetworkResourceInfo.PnicDevice && ((this.AvailableBandwidthForVMTraffic == null && hostPnicNetworkResourceInfo.AvailableBandwidthForVMTraffic == null) || (this.AvailableBandwidthForVMTraffic != null && this.AvailableBandwidthForVMTraffic.Equals(hostPnicNetworkResourceInfo.AvailableBandwidthForVMTraffic))) && ((this.UnusedBandwidthForVMTraffic == null && hostPnicNetworkResourceInfo.UnusedBandwidthForVMTraffic == null) || (this.UnusedBandwidthForVMTraffic != null && this.UnusedBandwidthForVMTraffic.Equals(hostPnicNetworkResourceInfo.UnusedBandwidthForVMTraffic))) && ((this.PlacedVirtualNics == null && hostPnicNetworkResourceInfo.PlacedVirtualNics == null) || (this.PlacedVirtualNics != null && hostPnicNetworkResourceInfo.PlacedVirtualNics != null && Enumerable.SequenceEqual(this.PlacedVirtualNics, hostPnicNetworkResourceInfo.PlacedVirtualNics))));\n        }\n\n        public override bool Equals(object hostPnicNetworkResourceInfo)\n        {\n            return Equals(hostPnicNetworkResourceInfo as HostPnicNetworkResourceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PnicDevice + \"_\" + AvailableBandwidthForVMTraffic + \"_\" + UnusedBandwidthForVMTraffic + \"_\" + PlacedVirtualNics).GetHashCode();\n        }\n    }\n\n    public class HostPortGroup : DynamicData, IEquatable<HostPortGroup>\n    {\n        public string Key { get; set; }\n\n        public HostPortGroupPort[] Port { get; set; }\n\n        public string Vswitch { get; set; }\n\n        public HostNetworkPolicy ComputedPolicy { get; set; }\n\n        public HostPortGroupSpec Spec { get; set; }\n\n        public bool Equals(HostPortGroup hostPortGroup)\n        {\n            return (hostPortGroup != null && this.Key == hostPortGroup.Key && ((this.Port == null && hostPortGroup.Port == null) || (this.Port != null && hostPortGroup.Port != null && Enumerable.SequenceEqual(this.Port, hostPortGroup.Port))) && this.Vswitch == hostPortGroup.Vswitch && ((this.ComputedPolicy == null && hostPortGroup.ComputedPolicy == null) || (this.ComputedPolicy != null && this.ComputedPolicy.Equals(hostPortGroup.ComputedPolicy))) && ((this.Spec == null && hostPortGroup.Spec == null) || (this.Spec != null && this.Spec.Equals(hostPortGroup.Spec))));\n        }\n\n        public override bool Equals(object hostPortGroup)\n        {\n            return Equals(hostPortGroup as HostPortGroup);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Port + \"_\" + Vswitch + \"_\" + ComputedPolicy + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostPortGroupConfig : DynamicData, IEquatable<HostPortGroupConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public HostPortGroupSpec Spec { get; set; }\n\n        public bool Equals(HostPortGroupConfig hostPortGroupConfig)\n        {\n            return (hostPortGroupConfig != null && this.ChangeOperation == hostPortGroupConfig.ChangeOperation && ((this.Spec == null && hostPortGroupConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostPortGroupConfig.Spec))));\n        }\n\n        public override bool Equals(object hostPortGroupConfig)\n        {\n            return Equals(hostPortGroupConfig as HostPortGroupConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostPortGroupPort : DynamicData, IEquatable<HostPortGroupPort>\n    {\n        public string Key { get; set; }\n\n        public string[] Mac { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(HostPortGroupPort hostPortGroupPort)\n        {\n            return (hostPortGroupPort != null && this.Key == hostPortGroupPort.Key && ((this.Mac == null && hostPortGroupPort.Mac == null) || (this.Mac != null && hostPortGroupPort.Mac != null && Enumerable.SequenceEqual(this.Mac, hostPortGroupPort.Mac))) && this.Type == hostPortGroupPort.Type);\n        }\n\n        public override bool Equals(object hostPortGroupPort)\n        {\n            return Equals(hostPortGroupPort as HostPortGroupPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Mac + \"_\" + Type).GetHashCode();\n        }\n    }\n\n    public class HostPortGroupProfile : PortGroupProfile, IEquatable<HostPortGroupProfile>\n    {\n        public IpAddressProfile IpConfig { get; set; }\n\n        public bool Equals(HostPortGroupProfile hostPortGroupProfile)\n        {\n            return (hostPortGroupProfile != null && ((this.IpConfig == null && hostPortGroupProfile.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(hostPortGroupProfile.IpConfig))));\n        }\n\n        public override bool Equals(object hostPortGroupProfile)\n        {\n            return Equals(hostPortGroupProfile as HostPortGroupProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpConfig).GetHashCode();\n        }\n    }\n\n    public class HostPortGroupSpec : DynamicData, IEquatable<HostPortGroupSpec>\n    {\n        public string Name { get; set; }\n\n        public int VlanId { get; set; }\n\n        public string VswitchName { get; set; }\n\n        public HostNetworkPolicy Policy { get; set; }\n\n        public bool Equals(HostPortGroupSpec hostPortGroupSpec)\n        {\n            return (hostPortGroupSpec != null && this.Name == hostPortGroupSpec.Name && this.VlanId == hostPortGroupSpec.VlanId && this.VswitchName == hostPortGroupSpec.VswitchName && ((this.Policy == null && hostPortGroupSpec.Policy == null) || (this.Policy != null && this.Policy.Equals(hostPortGroupSpec.Policy))));\n        }\n\n        public override bool Equals(object hostPortGroupSpec)\n        {\n            return Equals(hostPortGroupSpec as HostPortGroupSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + VlanId + \"_\" + VswitchName + \"_\" + Policy).GetHashCode();\n        }\n    }\n\n    public class HostPosixAccountSpec : HostAccountSpec, IEquatable<HostPosixAccountSpec>\n    {\n        public int? PosixId { get; set; }\n\n        public bool? ShellAccess { get; set; }\n\n        public bool Equals(HostPosixAccountSpec hostPosixAccountSpec)\n        {\n            return (hostPosixAccountSpec != null && ((this.PosixId == null && hostPosixAccountSpec.PosixId == null) || (this.PosixId != null && this.PosixId.Equals(hostPosixAccountSpec.PosixId))) && ((this.ShellAccess == null && hostPosixAccountSpec.ShellAccess == null) || (this.ShellAccess != null && this.ShellAccess.Equals(hostPosixAccountSpec.ShellAccess))));\n        }\n\n        public override bool Equals(object hostPosixAccountSpec)\n        {\n            return Equals(hostPosixAccountSpec as HostPosixAccountSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PosixId + \"_\" + ShellAccess).GetHashCode();\n        }\n    }\n\n    public class HostPowerOpFailed : VimFault, IEquatable<HostPowerOpFailed>\n    {\n        public bool Equals(HostPowerOpFailed hostPowerOpFailed)\n        {\n            return (hostPowerOpFailed != null && base.Equals(hostPowerOpFailed));\n        }\n\n        public override bool Equals(object hostPowerOpFailed)\n        {\n            return Equals(hostPowerOpFailed as HostPowerOpFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostPowerPolicy : DynamicData, IEquatable<HostPowerPolicy>\n    {\n        public int Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string ShortName { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(HostPowerPolicy hostPowerPolicy)\n        {\n            return (hostPowerPolicy != null && this.Key == hostPowerPolicy.Key && this.Name == hostPowerPolicy.Name && this.ShortName == hostPowerPolicy.ShortName && this.Description == hostPowerPolicy.Description);\n        }\n\n        public override bool Equals(object hostPowerPolicy)\n        {\n            return Equals(hostPowerPolicy as HostPowerPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + ShortName + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class HostPowerSystem : ViewBase, IEquatable<HostPowerSystem>\n    {\n        public PowerSystemCapability Capability { get; set; }\n\n        public PowerSystemInfo Info { get; set; }\n\n        public void ConfigurePowerPolicy(int key)\n        {\n        }\n\n        public bool Equals(HostPowerSystem hostPowerSystem)\n        {\n            return (hostPowerSystem != null && ((this.Capability == null && hostPowerSystem.Capability == null) || (this.Capability != null && this.Capability.Equals(hostPowerSystem.Capability))) && ((this.Info == null && hostPowerSystem.Info == null) || (this.Info != null && this.Info.Equals(hostPowerSystem.Info))));\n        }\n\n        public override bool Equals(object hostPowerSystem)\n        {\n            return Equals(hostPowerSystem as HostPowerSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capability + \"_\" + Info).GetHashCode();\n        }\n    }\n\n    public class HostPrimaryAgentNotShortNameEvent : HostDasEvent, IEquatable<HostPrimaryAgentNotShortNameEvent>\n    {\n        public string PrimaryAgent { get; set; }\n\n        public bool Equals(HostPrimaryAgentNotShortNameEvent hostPrimaryAgentNotShortNameEvent)\n        {\n            return (hostPrimaryAgentNotShortNameEvent != null && this.PrimaryAgent == hostPrimaryAgentNotShortNameEvent.PrimaryAgent);\n        }\n\n        public override bool Equals(object hostPrimaryAgentNotShortNameEvent)\n        {\n            return Equals(hostPrimaryAgentNotShortNameEvent as HostPrimaryAgentNotShortNameEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrimaryAgent).GetHashCode();\n        }\n    }\n\n    public class HostProfile : Profile, IEquatable<HostProfile>\n    {\n        public string ValidationState { get; set; }\n\n        public DateTime ValidationStateUpdateTime { get; set; }\n\n        public HostProfileValidationFailureInfo ValidationFailureInfo { get; set; }\n\n        public ManagedObjectReference ReferenceHost { get; set; }\n\n        public new HostProfile_LinkedView LinkedView { get; set; }\n\n        public void HostProfileResetValidationState()\n        {\n        }\n\n        public void UpdateReferenceHost(ManagedObjectReference host)\n        {\n        }\n\n        public void UpdateHostProfile(HostProfileConfigSpec config)\n        {\n        }\n\n        public ProfileExecuteResult ExecuteHostProfile(ManagedObjectReference host, ProfileDeferredPolicyOptionParameter[] deferredParam)\n        {\n            return default(ProfileExecuteResult);\n        }\n\n        public bool Equals(HostProfile hostProfile)\n        {\n            return (hostProfile != null && this.ValidationState == hostProfile.ValidationState && this.ValidationStateUpdateTime == hostProfile.ValidationStateUpdateTime && ((this.ValidationFailureInfo == null && hostProfile.ValidationFailureInfo == null) || (this.ValidationFailureInfo != null && this.ValidationFailureInfo.Equals(hostProfile.ValidationFailureInfo))) && ((this.ReferenceHost == null && hostProfile.ReferenceHost == null) || (this.ReferenceHost != null && this.ReferenceHost.Equals(hostProfile.ReferenceHost))) && ((this.LinkedView == null && hostProfile.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfile.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfile)\n        {\n            return Equals(hostProfile as HostProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ValidationState + \"_\" + ValidationStateUpdateTime + \"_\" + ValidationFailureInfo + \"_\" + ReferenceHost + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfile_LinkedView : Profile_LinkedView, IEquatable<HostProfile_LinkedView>\n    {\n        public HostSystem ReferenceHost { get; set; }\n\n        public bool Equals(HostProfile_LinkedView hostProfile_LinkedView)\n        {\n            return (hostProfile_LinkedView != null && ((this.ReferenceHost == null && hostProfile_LinkedView.ReferenceHost == null) || (this.ReferenceHost != null && this.ReferenceHost.Equals(hostProfile_LinkedView.ReferenceHost))));\n        }\n\n        public override bool Equals(object hostProfile_LinkedView)\n        {\n            return Equals(hostProfile_LinkedView as HostProfile_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReferenceHost).GetHashCode();\n        }\n    }\n\n    public class HostProfileAppliedEvent : HostEvent, IEquatable<HostProfileAppliedEvent>\n    {\n        public ProfileEventArgument Profile { get; set; }\n\n        public bool Equals(HostProfileAppliedEvent hostProfileAppliedEvent)\n        {\n            return (hostProfileAppliedEvent != null && ((this.Profile == null && hostProfileAppliedEvent.Profile == null) || (this.Profile != null && this.Profile.Equals(hostProfileAppliedEvent.Profile))));\n        }\n\n        public override bool Equals(object hostProfileAppliedEvent)\n        {\n            return Equals(hostProfileAppliedEvent as HostProfileAppliedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile).GetHashCode();\n        }\n    }\n\n    public class HostProfileCompleteConfigSpec : HostProfileConfigSpec, IEquatable<HostProfileCompleteConfigSpec>\n    {\n        public HostApplyProfile ApplyProfile { get; set; }\n\n        public ComplianceProfile CustomComplyProfile { get; set; }\n\n        public bool DisabledExpressionListChanged { get; set; }\n\n        public string[] DisabledExpressionList { get; set; }\n\n        public ManagedObjectReference ValidatorHost { get; set; }\n\n        public bool? Validating { get; set; }\n\n        public HostProfileConfigInfo HostConfig { get; set; }\n\n        public HostProfileCompleteConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileCompleteConfigSpec hostProfileCompleteConfigSpec)\n        {\n            return (hostProfileCompleteConfigSpec != null && ((this.ApplyProfile == null && hostProfileCompleteConfigSpec.ApplyProfile == null) || (this.ApplyProfile != null && this.ApplyProfile.Equals(hostProfileCompleteConfigSpec.ApplyProfile))) && ((this.CustomComplyProfile == null && hostProfileCompleteConfigSpec.CustomComplyProfile == null) || (this.CustomComplyProfile != null && this.CustomComplyProfile.Equals(hostProfileCompleteConfigSpec.CustomComplyProfile))) && this.DisabledExpressionListChanged == hostProfileCompleteConfigSpec.DisabledExpressionListChanged && ((this.DisabledExpressionList == null && hostProfileCompleteConfigSpec.DisabledExpressionList == null) || (this.DisabledExpressionList != null && hostProfileCompleteConfigSpec.DisabledExpressionList != null && Enumerable.SequenceEqual(this.DisabledExpressionList, hostProfileCompleteConfigSpec.DisabledExpressionList))) && ((this.ValidatorHost == null && hostProfileCompleteConfigSpec.ValidatorHost == null) || (this.ValidatorHost != null && this.ValidatorHost.Equals(hostProfileCompleteConfigSpec.ValidatorHost))) && ((this.Validating == null && hostProfileCompleteConfigSpec.Validating == null) || (this.Validating != null && this.Validating.Equals(hostProfileCompleteConfigSpec.Validating))) && ((this.HostConfig == null && hostProfileCompleteConfigSpec.HostConfig == null) || (this.HostConfig != null && this.HostConfig.Equals(hostProfileCompleteConfigSpec.HostConfig))) && ((this.LinkedView == null && hostProfileCompleteConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileCompleteConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileCompleteConfigSpec)\n        {\n            return Equals(hostProfileCompleteConfigSpec as HostProfileCompleteConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ApplyProfile + \"_\" + CustomComplyProfile + \"_\" + DisabledExpressionListChanged + \"_\" + DisabledExpressionList + \"_\" + ValidatorHost + \"_\" + Validating + \"_\" + HostConfig + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileCompleteConfigSpec_LinkedView : IEquatable<HostProfileCompleteConfigSpec_LinkedView>\n    {\n        public HostSystem ValidatorHost { get; set; }\n\n        public bool Equals(HostProfileCompleteConfigSpec_LinkedView hostProfileCompleteConfigSpec_LinkedView)\n        {\n            return (hostProfileCompleteConfigSpec_LinkedView != null && ((this.ValidatorHost == null && hostProfileCompleteConfigSpec_LinkedView.ValidatorHost == null) || (this.ValidatorHost != null && this.ValidatorHost.Equals(hostProfileCompleteConfigSpec_LinkedView.ValidatorHost))));\n        }\n\n        public override bool Equals(object hostProfileCompleteConfigSpec_LinkedView)\n        {\n            return Equals(hostProfileCompleteConfigSpec_LinkedView as HostProfileCompleteConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ValidatorHost).GetHashCode();\n        }\n    }\n\n    public class HostProfileConfigInfo : ProfileConfigInfo, IEquatable<HostProfileConfigInfo>\n    {\n        public HostApplyProfile ApplyProfile { get; set; }\n\n        public ComplianceProfile DefaultComplyProfile { get; set; }\n\n        public ComplianceLocator[] DefaultComplyLocator { get; set; }\n\n        public ComplianceProfile CustomComplyProfile { get; set; }\n\n        public string[] DisabledExpressionList { get; set; }\n\n        public ProfileDescription Description { get; set; }\n\n        public bool Equals(HostProfileConfigInfo hostProfileConfigInfo)\n        {\n            return (hostProfileConfigInfo != null && ((this.ApplyProfile == null && hostProfileConfigInfo.ApplyProfile == null) || (this.ApplyProfile != null && this.ApplyProfile.Equals(hostProfileConfigInfo.ApplyProfile))) && ((this.DefaultComplyProfile == null && hostProfileConfigInfo.DefaultComplyProfile == null) || (this.DefaultComplyProfile != null && this.DefaultComplyProfile.Equals(hostProfileConfigInfo.DefaultComplyProfile))) && ((this.DefaultComplyLocator == null && hostProfileConfigInfo.DefaultComplyLocator == null) || (this.DefaultComplyLocator != null && hostProfileConfigInfo.DefaultComplyLocator != null && Enumerable.SequenceEqual(this.DefaultComplyLocator, hostProfileConfigInfo.DefaultComplyLocator))) && ((this.CustomComplyProfile == null && hostProfileConfigInfo.CustomComplyProfile == null) || (this.CustomComplyProfile != null && this.CustomComplyProfile.Equals(hostProfileConfigInfo.CustomComplyProfile))) && ((this.DisabledExpressionList == null && hostProfileConfigInfo.DisabledExpressionList == null) || (this.DisabledExpressionList != null && hostProfileConfigInfo.DisabledExpressionList != null && Enumerable.SequenceEqual(this.DisabledExpressionList, hostProfileConfigInfo.DisabledExpressionList))) && ((this.Description == null && hostProfileConfigInfo.Description == null) || (this.Description != null && this.Description.Equals(hostProfileConfigInfo.Description))));\n        }\n\n        public override bool Equals(object hostProfileConfigInfo)\n        {\n            return Equals(hostProfileConfigInfo as HostProfileConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ApplyProfile + \"_\" + DefaultComplyProfile + \"_\" + DefaultComplyLocator + \"_\" + CustomComplyProfile + \"_\" + DisabledExpressionList + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class HostProfileConfigSpec : ProfileCreateSpec, IEquatable<HostProfileConfigSpec>\n    {\n        public bool Equals(HostProfileConfigSpec hostProfileConfigSpec)\n        {\n            return (hostProfileConfigSpec != null && base.Equals(hostProfileConfigSpec));\n        }\n\n        public override bool Equals(object hostProfileConfigSpec)\n        {\n            return Equals(hostProfileConfigSpec as HostProfileConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostProfileHostBasedConfigSpec : HostProfileConfigSpec, IEquatable<HostProfileHostBasedConfigSpec>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public bool? UseHostProfileEngine { get; set; }\n\n        public HostProfileHostBasedConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileHostBasedConfigSpec hostProfileHostBasedConfigSpec)\n        {\n            return (hostProfileHostBasedConfigSpec != null && ((this.Host == null && hostProfileHostBasedConfigSpec.Host == null) || (this.Host != null && this.Host.Equals(hostProfileHostBasedConfigSpec.Host))) && ((this.UseHostProfileEngine == null && hostProfileHostBasedConfigSpec.UseHostProfileEngine == null) || (this.UseHostProfileEngine != null && this.UseHostProfileEngine.Equals(hostProfileHostBasedConfigSpec.UseHostProfileEngine))) && ((this.LinkedView == null && hostProfileHostBasedConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileHostBasedConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileHostBasedConfigSpec)\n        {\n            return Equals(hostProfileHostBasedConfigSpec as HostProfileHostBasedConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + UseHostProfileEngine + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileHostBasedConfigSpec_LinkedView : IEquatable<HostProfileHostBasedConfigSpec_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostProfileHostBasedConfigSpec_LinkedView hostProfileHostBasedConfigSpec_LinkedView)\n        {\n            return (hostProfileHostBasedConfigSpec_LinkedView != null && ((this.Host == null && hostProfileHostBasedConfigSpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostProfileHostBasedConfigSpec_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostProfileHostBasedConfigSpec_LinkedView)\n        {\n            return Equals(hostProfileHostBasedConfigSpec_LinkedView as HostProfileHostBasedConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostProfileManager : ProfileManager, IEquatable<HostProfileManager>\n    {\n        public new HostProfileManager_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference ApplyHostConfig_Task(ManagedObjectReference host, HostConfigSpec configSpec, ProfileDeferredPolicyOptionParameter[] userInput)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ApplyHostConfig(ManagedObjectReference host, HostConfigSpec configSpec, ProfileDeferredPolicyOptionParameter[] userInput)\n        {\n        }\n\n        public HostProfileManagerConfigTaskList GenerateConfigTaskList(HostConfigSpec configSpec, ManagedObjectReference host)\n        {\n            return default(HostProfileManagerConfigTaskList);\n        }\n\n        public ManagedObjectReference GenerateHostProfileTaskList_Task(HostConfigSpec configSpec, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostProfileManagerConfigTaskList GenerateHostProfileTaskList(HostConfigSpec configSpec, ManagedObjectReference host)\n        {\n            return default(HostProfileManagerConfigTaskList);\n        }\n\n        public ProfileMetadata[] QueryHostProfileMetadata(string[] profileName, ManagedObjectReference profile)\n        {\n            return default(ProfileMetadata[]);\n        }\n\n        public ProfileProfileStructure QueryProfileStructure(ManagedObjectReference profile)\n        {\n            return default(ProfileProfileStructure);\n        }\n\n        public ApplyProfile CreateDefaultProfile(string profileType, string profileTypeName, ManagedObjectReference profile)\n        {\n            return default(ApplyProfile);\n        }\n\n        public ManagedObjectReference UpdateAnswerFile_Task(ManagedObjectReference host, AnswerFileCreateSpec configSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpdateAnswerFile(ManagedObjectReference host, AnswerFileCreateSpec configSpec)\n        {\n        }\n\n        public AnswerFile RetrieveAnswerFile(ManagedObjectReference host)\n        {\n            return default(AnswerFile);\n        }\n\n        public AnswerFile RetrieveAnswerFileForProfile(ManagedObjectReference host, HostApplyProfile applyProfile)\n        {\n            return default(AnswerFile);\n        }\n\n        public ManagedObjectReference ExportAnswerFile_Task(ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public string ExportAnswerFile(ManagedObjectReference host)\n        {\n            return default(string);\n        }\n\n        public ManagedObjectReference CheckAnswerFileStatus_Task(ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public AnswerFileStatusResult[] CheckAnswerFileStatus(ManagedObjectReference[] host)\n        {\n            return default(AnswerFileStatusResult[]);\n        }\n\n        public AnswerFileStatusResult[] QueryAnswerFileStatus(ManagedObjectReference[] host)\n        {\n            return default(AnswerFileStatusResult[]);\n        }\n\n        public ManagedObjectReference UpdateHostCustomizations_Task(HostProfileManagerHostToConfigSpecMap[] hostToConfigSpecMap)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference[] UpdateHostCustomizations(HostProfileManagerHostToConfigSpecMap[] hostToConfigSpecMap)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public StructuredCustomizations[] RetrieveHostCustomizations(ManagedObjectReference[] hosts)\n        {\n            return default(StructuredCustomizations[]);\n        }\n\n        public StructuredCustomizations[] RetrieveHostCustomizationsForProfile(ManagedObjectReference[] hosts, HostApplyProfile applyProfile)\n        {\n            return default(StructuredCustomizations[]);\n        }\n\n        public ManagedObjectReference GenerateHostConfigTaskSpec_Task(StructuredCustomizations[] hostsInfo)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ApplyHostProfileConfigurationSpec[] GenerateHostConfigTaskSpec(StructuredCustomizations[] hostsInfo)\n        {\n            return default(ApplyHostProfileConfigurationSpec[]);\n        }\n\n        public ManagedObjectReference ApplyEntitiesConfig_Task(ApplyHostProfileConfigurationSpec[] applyConfigSpecs)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ApplyHostProfileConfigurationResult[] ApplyEntitiesConfig(ApplyHostProfileConfigurationSpec[] applyConfigSpecs)\n        {\n            return default(ApplyHostProfileConfigurationResult[]);\n        }\n\n        public ManagedObjectReference ValidateHostProfileComposition_Task(ManagedObjectReference source, ManagedObjectReference[] targets, HostApplyProfile toBeMerged, HostApplyProfile toReplaceWith, HostApplyProfile toBeDeleted, HostApplyProfile enableStatusToBeCopied, bool? errorOnly)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostProfileManagerCompositionValidationResult ValidateHostProfileComposition(ManagedObjectReference source, ManagedObjectReference[] targets, HostApplyProfile toBeMerged, HostApplyProfile toReplaceWith, HostApplyProfile toBeDeleted, HostApplyProfile enableStatusToBeCopied, bool? errorOnly)\n        {\n            return default(HostProfileManagerCompositionValidationResult);\n        }\n\n        public ManagedObjectReference CompositeHostProfile_Task(ManagedObjectReference source, ManagedObjectReference[] targets, HostApplyProfile toBeMerged, HostApplyProfile toBeReplacedWith, HostApplyProfile toBeDeleted, HostApplyProfile enableStatusToBeCopied)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostProfileManagerCompositionResult CompositeHostProfile(ManagedObjectReference source, ManagedObjectReference[] targets, HostApplyProfile toBeMerged, HostApplyProfile toBeReplacedWith, HostApplyProfile toBeDeleted, HostApplyProfile enableStatusToBeCopied)\n        {\n            return default(HostProfileManagerCompositionResult);\n        }\n\n        public bool Equals(HostProfileManager hostProfileManager)\n        {\n            return (hostProfileManager != null && ((this.LinkedView == null && hostProfileManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileManager.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileManager)\n        {\n            return Equals(hostProfileManager as HostProfileManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileManager_LinkedView : ProfileManager_LinkedView, IEquatable<HostProfileManager_LinkedView>\n    {\n        public bool Equals(HostProfileManager_LinkedView hostProfileManager_LinkedView)\n        {\n            return (hostProfileManager_LinkedView != null && base.Equals(hostProfileManager_LinkedView));\n        }\n\n        public override bool Equals(object hostProfileManager_LinkedView)\n        {\n            return Equals(hostProfileManager_LinkedView as HostProfileManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerCompositionResult : DynamicData, IEquatable<HostProfileManagerCompositionResult>\n    {\n        public LocalizableMessage[] Errors { get; set; }\n\n        public HostProfileManagerCompositionResultResultElement[] Results { get; set; }\n\n        public bool Equals(HostProfileManagerCompositionResult hostProfileManagerCompositionResult)\n        {\n            return (hostProfileManagerCompositionResult != null && ((this.Errors == null && hostProfileManagerCompositionResult.Errors == null) || (this.Errors != null && hostProfileManagerCompositionResult.Errors != null && Enumerable.SequenceEqual(this.Errors, hostProfileManagerCompositionResult.Errors))) && ((this.Results == null && hostProfileManagerCompositionResult.Results == null) || (this.Results != null && hostProfileManagerCompositionResult.Results != null && Enumerable.SequenceEqual(this.Results, hostProfileManagerCompositionResult.Results))));\n        }\n\n        public override bool Equals(object hostProfileManagerCompositionResult)\n        {\n            return Equals(hostProfileManagerCompositionResult as HostProfileManagerCompositionResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Errors + \"_\" + Results).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerCompositionResultResultElement : DynamicData, IEquatable<HostProfileManagerCompositionResultResultElement>\n    {\n        public ManagedObjectReference Target { get; set; }\n\n        public string Status { get; set; }\n\n        public LocalizableMessage[] Errors { get; set; }\n\n        public HostProfileManagerCompositionResultResultElement_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileManagerCompositionResultResultElement hostProfileManagerCompositionResultResultElement)\n        {\n            return (hostProfileManagerCompositionResultResultElement != null && ((this.Target == null && hostProfileManagerCompositionResultResultElement.Target == null) || (this.Target != null && this.Target.Equals(hostProfileManagerCompositionResultResultElement.Target))) && this.Status == hostProfileManagerCompositionResultResultElement.Status && ((this.Errors == null && hostProfileManagerCompositionResultResultElement.Errors == null) || (this.Errors != null && hostProfileManagerCompositionResultResultElement.Errors != null && Enumerable.SequenceEqual(this.Errors, hostProfileManagerCompositionResultResultElement.Errors))) && ((this.LinkedView == null && hostProfileManagerCompositionResultResultElement.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileManagerCompositionResultResultElement.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileManagerCompositionResultResultElement)\n        {\n            return Equals(hostProfileManagerCompositionResultResultElement as HostProfileManagerCompositionResultResultElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Target + \"_\" + Status + \"_\" + Errors + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerCompositionResultResultElement_LinkedView : IEquatable<HostProfileManagerCompositionResultResultElement_LinkedView>\n    {\n        public Profile Target { get; set; }\n\n        public bool Equals(HostProfileManagerCompositionResultResultElement_LinkedView hostProfileManagerCompositionResultResultElement_LinkedView)\n        {\n            return (hostProfileManagerCompositionResultResultElement_LinkedView != null && ((this.Target == null && hostProfileManagerCompositionResultResultElement_LinkedView.Target == null) || (this.Target != null && this.Target.Equals(hostProfileManagerCompositionResultResultElement_LinkedView.Target))));\n        }\n\n        public override bool Equals(object hostProfileManagerCompositionResultResultElement_LinkedView)\n        {\n            return Equals(hostProfileManagerCompositionResultResultElement_LinkedView as HostProfileManagerCompositionResultResultElement_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Target).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerCompositionValidationResult : DynamicData, IEquatable<HostProfileManagerCompositionValidationResult>\n    {\n        public HostProfileManagerCompositionValidationResultResultElement[] Results { get; set; }\n\n        public LocalizableMessage[] Errors { get; set; }\n\n        public bool Equals(HostProfileManagerCompositionValidationResult hostProfileManagerCompositionValidationResult)\n        {\n            return (hostProfileManagerCompositionValidationResult != null && ((this.Results == null && hostProfileManagerCompositionValidationResult.Results == null) || (this.Results != null && hostProfileManagerCompositionValidationResult.Results != null && Enumerable.SequenceEqual(this.Results, hostProfileManagerCompositionValidationResult.Results))) && ((this.Errors == null && hostProfileManagerCompositionValidationResult.Errors == null) || (this.Errors != null && hostProfileManagerCompositionValidationResult.Errors != null && Enumerable.SequenceEqual(this.Errors, hostProfileManagerCompositionValidationResult.Errors))));\n        }\n\n        public override bool Equals(object hostProfileManagerCompositionValidationResult)\n        {\n            return Equals(hostProfileManagerCompositionValidationResult as HostProfileManagerCompositionValidationResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Results + \"_\" + Errors).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerCompositionValidationResultResultElement : DynamicData, IEquatable<HostProfileManagerCompositionValidationResultResultElement>\n    {\n        public ManagedObjectReference Target { get; set; }\n\n        public string Status { get; set; }\n\n        public LocalizableMessage[] Errors { get; set; }\n\n        public HostApplyProfile SourceDiffForToBeMerged { get; set; }\n\n        public HostApplyProfile TargetDiffForToBeMerged { get; set; }\n\n        public HostApplyProfile ToBeAdded { get; set; }\n\n        public HostApplyProfile ToBeDeleted { get; set; }\n\n        public HostApplyProfile ToBeDisabled { get; set; }\n\n        public HostApplyProfile ToBeEnabled { get; set; }\n\n        public HostApplyProfile ToBeReenableCC { get; set; }\n\n        public HostProfileManagerCompositionValidationResultResultElement_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileManagerCompositionValidationResultResultElement hostProfileManagerCompositionValidationResultResultElement)\n        {\n            return (hostProfileManagerCompositionValidationResultResultElement != null && ((this.Target == null && hostProfileManagerCompositionValidationResultResultElement.Target == null) || (this.Target != null && this.Target.Equals(hostProfileManagerCompositionValidationResultResultElement.Target))) && this.Status == hostProfileManagerCompositionValidationResultResultElement.Status && ((this.Errors == null && hostProfileManagerCompositionValidationResultResultElement.Errors == null) || (this.Errors != null && hostProfileManagerCompositionValidationResultResultElement.Errors != null && Enumerable.SequenceEqual(this.Errors, hostProfileManagerCompositionValidationResultResultElement.Errors))) && ((this.SourceDiffForToBeMerged == null && hostProfileManagerCompositionValidationResultResultElement.SourceDiffForToBeMerged == null) || (this.SourceDiffForToBeMerged != null && this.SourceDiffForToBeMerged.Equals(hostProfileManagerCompositionValidationResultResultElement.SourceDiffForToBeMerged))) && ((this.TargetDiffForToBeMerged == null && hostProfileManagerCompositionValidationResultResultElement.TargetDiffForToBeMerged == null) || (this.TargetDiffForToBeMerged != null && this.TargetDiffForToBeMerged.Equals(hostProfileManagerCompositionValidationResultResultElement.TargetDiffForToBeMerged))) && ((this.ToBeAdded == null && hostProfileManagerCompositionValidationResultResultElement.ToBeAdded == null) || (this.ToBeAdded != null && this.ToBeAdded.Equals(hostProfileManagerCompositionValidationResultResultElement.ToBeAdded))) && ((this.ToBeDeleted == null && hostProfileManagerCompositionValidationResultResultElement.ToBeDeleted == null) || (this.ToBeDeleted != null && this.ToBeDeleted.Equals(hostProfileManagerCompositionValidationResultResultElement.ToBeDeleted))) && ((this.ToBeDisabled == null && hostProfileManagerCompositionValidationResultResultElement.ToBeDisabled == null) || (this.ToBeDisabled != null && this.ToBeDisabled.Equals(hostProfileManagerCompositionValidationResultResultElement.ToBeDisabled))) && ((this.ToBeEnabled == null && hostProfileManagerCompositionValidationResultResultElement.ToBeEnabled == null) || (this.ToBeEnabled != null && this.ToBeEnabled.Equals(hostProfileManagerCompositionValidationResultResultElement.ToBeEnabled))) && ((this.ToBeReenableCC == null && hostProfileManagerCompositionValidationResultResultElement.ToBeReenableCC == null) || (this.ToBeReenableCC != null && this.ToBeReenableCC.Equals(hostProfileManagerCompositionValidationResultResultElement.ToBeReenableCC))) && ((this.LinkedView == null && hostProfileManagerCompositionValidationResultResultElement.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileManagerCompositionValidationResultResultElement.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileManagerCompositionValidationResultResultElement)\n        {\n            return Equals(hostProfileManagerCompositionValidationResultResultElement as HostProfileManagerCompositionValidationResultResultElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Target + \"_\" + Status + \"_\" + Errors + \"_\" + SourceDiffForToBeMerged + \"_\" + TargetDiffForToBeMerged + \"_\" + ToBeAdded + \"_\" + ToBeDeleted + \"_\" + ToBeDisabled + \"_\" + ToBeEnabled + \"_\" + ToBeReenableCC + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerCompositionValidationResultResultElement_LinkedView : IEquatable<HostProfileManagerCompositionValidationResultResultElement_LinkedView>\n    {\n        public Profile Target { get; set; }\n\n        public bool Equals(HostProfileManagerCompositionValidationResultResultElement_LinkedView hostProfileManagerCompositionValidationResultResultElement_LinkedView)\n        {\n            return (hostProfileManagerCompositionValidationResultResultElement_LinkedView != null && ((this.Target == null && hostProfileManagerCompositionValidationResultResultElement_LinkedView.Target == null) || (this.Target != null && this.Target.Equals(hostProfileManagerCompositionValidationResultResultElement_LinkedView.Target))));\n        }\n\n        public override bool Equals(object hostProfileManagerCompositionValidationResultResultElement_LinkedView)\n        {\n            return Equals(hostProfileManagerCompositionValidationResultResultElement_LinkedView as HostProfileManagerCompositionValidationResultResultElement_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Target).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerConfigTaskList : DynamicData, IEquatable<HostProfileManagerConfigTaskList>\n    {\n        public HostConfigSpec ConfigSpec { get; set; }\n\n        public LocalizableMessage[] TaskDescription { get; set; }\n\n        public string[] TaskListRequirement { get; set; }\n\n        public bool Equals(HostProfileManagerConfigTaskList hostProfileManagerConfigTaskList)\n        {\n            return (hostProfileManagerConfigTaskList != null && ((this.ConfigSpec == null && hostProfileManagerConfigTaskList.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(hostProfileManagerConfigTaskList.ConfigSpec))) && ((this.TaskDescription == null && hostProfileManagerConfigTaskList.TaskDescription == null) || (this.TaskDescription != null && hostProfileManagerConfigTaskList.TaskDescription != null && Enumerable.SequenceEqual(this.TaskDescription, hostProfileManagerConfigTaskList.TaskDescription))) && ((this.TaskListRequirement == null && hostProfileManagerConfigTaskList.TaskListRequirement == null) || (this.TaskListRequirement != null && hostProfileManagerConfigTaskList.TaskListRequirement != null && Enumerable.SequenceEqual(this.TaskListRequirement, hostProfileManagerConfigTaskList.TaskListRequirement))));\n        }\n\n        public override bool Equals(object hostProfileManagerConfigTaskList)\n        {\n            return Equals(hostProfileManagerConfigTaskList as HostProfileManagerConfigTaskList);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec + \"_\" + TaskDescription + \"_\" + TaskListRequirement).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerHostToConfigSpecMap : DynamicData, IEquatable<HostProfileManagerHostToConfigSpecMap>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public AnswerFileCreateSpec ConfigSpec { get; set; }\n\n        public HostProfileManagerHostToConfigSpecMap_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileManagerHostToConfigSpecMap hostProfileManagerHostToConfigSpecMap)\n        {\n            return (hostProfileManagerHostToConfigSpecMap != null && ((this.Host == null && hostProfileManagerHostToConfigSpecMap.Host == null) || (this.Host != null && this.Host.Equals(hostProfileManagerHostToConfigSpecMap.Host))) && ((this.ConfigSpec == null && hostProfileManagerHostToConfigSpecMap.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(hostProfileManagerHostToConfigSpecMap.ConfigSpec))) && ((this.LinkedView == null && hostProfileManagerHostToConfigSpecMap.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileManagerHostToConfigSpecMap.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileManagerHostToConfigSpecMap)\n        {\n            return Equals(hostProfileManagerHostToConfigSpecMap as HostProfileManagerHostToConfigSpecMap);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + ConfigSpec + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileManagerHostToConfigSpecMap_LinkedView : IEquatable<HostProfileManagerHostToConfigSpecMap_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostProfileManagerHostToConfigSpecMap_LinkedView hostProfileManagerHostToConfigSpecMap_LinkedView)\n        {\n            return (hostProfileManagerHostToConfigSpecMap_LinkedView != null && ((this.Host == null && hostProfileManagerHostToConfigSpecMap_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostProfileManagerHostToConfigSpecMap_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostProfileManagerHostToConfigSpecMap_LinkedView)\n        {\n            return Equals(hostProfileManagerHostToConfigSpecMap_LinkedView as HostProfileManagerHostToConfigSpecMap_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostProfilesEntityCustomizations : DynamicData, IEquatable<HostProfilesEntityCustomizations>\n    {\n        public bool Equals(HostProfilesEntityCustomizations hostProfilesEntityCustomizations)\n        {\n            return (hostProfilesEntityCustomizations != null && base.Equals(hostProfilesEntityCustomizations));\n        }\n\n        public override bool Equals(object hostProfilesEntityCustomizations)\n        {\n            return Equals(hostProfilesEntityCustomizations as HostProfilesEntityCustomizations);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostProfileSerializedHostProfileSpec : ProfileSerializedCreateSpec, IEquatable<HostProfileSerializedHostProfileSpec>\n    {\n        public ManagedObjectReference ValidatorHost { get; set; }\n\n        public bool? Validating { get; set; }\n\n        public HostProfileSerializedHostProfileSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileSerializedHostProfileSpec hostProfileSerializedHostProfileSpec)\n        {\n            return (hostProfileSerializedHostProfileSpec != null && ((this.ValidatorHost == null && hostProfileSerializedHostProfileSpec.ValidatorHost == null) || (this.ValidatorHost != null && this.ValidatorHost.Equals(hostProfileSerializedHostProfileSpec.ValidatorHost))) && ((this.Validating == null && hostProfileSerializedHostProfileSpec.Validating == null) || (this.Validating != null && this.Validating.Equals(hostProfileSerializedHostProfileSpec.Validating))) && ((this.LinkedView == null && hostProfileSerializedHostProfileSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileSerializedHostProfileSpec.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileSerializedHostProfileSpec)\n        {\n            return Equals(hostProfileSerializedHostProfileSpec as HostProfileSerializedHostProfileSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ValidatorHost + \"_\" + Validating + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileSerializedHostProfileSpec_LinkedView : IEquatable<HostProfileSerializedHostProfileSpec_LinkedView>\n    {\n        public HostSystem ValidatorHost { get; set; }\n\n        public bool Equals(HostProfileSerializedHostProfileSpec_LinkedView hostProfileSerializedHostProfileSpec_LinkedView)\n        {\n            return (hostProfileSerializedHostProfileSpec_LinkedView != null && ((this.ValidatorHost == null && hostProfileSerializedHostProfileSpec_LinkedView.ValidatorHost == null) || (this.ValidatorHost != null && this.ValidatorHost.Equals(hostProfileSerializedHostProfileSpec_LinkedView.ValidatorHost))));\n        }\n\n        public override bool Equals(object hostProfileSerializedHostProfileSpec_LinkedView)\n        {\n            return Equals(hostProfileSerializedHostProfileSpec_LinkedView as HostProfileSerializedHostProfileSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ValidatorHost).GetHashCode();\n        }\n    }\n\n    public class HostProfileValidationFailureInfo : DynamicData, IEquatable<HostProfileValidationFailureInfo>\n    {\n        public string Name { get; set; }\n\n        public string Annotation { get; set; }\n\n        public string UpdateType { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public HostApplyProfile ApplyProfile { get; set; }\n\n        public ProfileUpdateFailedUpdateFailure[] Failures { get; set; }\n\n        public LocalizedMethodFault[] Faults { get; set; }\n\n        public HostProfileValidationFailureInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProfileValidationFailureInfo hostProfileValidationFailureInfo)\n        {\n            return (hostProfileValidationFailureInfo != null && this.Name == hostProfileValidationFailureInfo.Name && this.Annotation == hostProfileValidationFailureInfo.Annotation && this.UpdateType == hostProfileValidationFailureInfo.UpdateType && ((this.Host == null && hostProfileValidationFailureInfo.Host == null) || (this.Host != null && this.Host.Equals(hostProfileValidationFailureInfo.Host))) && ((this.ApplyProfile == null && hostProfileValidationFailureInfo.ApplyProfile == null) || (this.ApplyProfile != null && this.ApplyProfile.Equals(hostProfileValidationFailureInfo.ApplyProfile))) && ((this.Failures == null && hostProfileValidationFailureInfo.Failures == null) || (this.Failures != null && hostProfileValidationFailureInfo.Failures != null && Enumerable.SequenceEqual(this.Failures, hostProfileValidationFailureInfo.Failures))) && ((this.Faults == null && hostProfileValidationFailureInfo.Faults == null) || (this.Faults != null && hostProfileValidationFailureInfo.Faults != null && Enumerable.SequenceEqual(this.Faults, hostProfileValidationFailureInfo.Faults))) && ((this.LinkedView == null && hostProfileValidationFailureInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProfileValidationFailureInfo.LinkedView))));\n        }\n\n        public override bool Equals(object hostProfileValidationFailureInfo)\n        {\n            return Equals(hostProfileValidationFailureInfo as HostProfileValidationFailureInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Annotation + \"_\" + UpdateType + \"_\" + Host + \"_\" + ApplyProfile + \"_\" + Failures + \"_\" + Faults + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProfileValidationFailureInfo_LinkedView : IEquatable<HostProfileValidationFailureInfo_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostProfileValidationFailureInfo_LinkedView hostProfileValidationFailureInfo_LinkedView)\n        {\n            return (hostProfileValidationFailureInfo_LinkedView != null && ((this.Host == null && hostProfileValidationFailureInfo_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostProfileValidationFailureInfo_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostProfileValidationFailureInfo_LinkedView)\n        {\n            return Equals(hostProfileValidationFailureInfo_LinkedView as HostProfileValidationFailureInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostProtocolEndpoint : DynamicData, IEquatable<HostProtocolEndpoint>\n    {\n        public string PeType { get; set; }\n\n        public string Type { get; set; }\n\n        public string Uuid { get; set; }\n\n        public ManagedObjectReference[] HostKey { get; set; }\n\n        public string StorageArray { get; set; }\n\n        public string NfsServer { get; set; }\n\n        public string NfsDir { get; set; }\n\n        public string NfsServerScope { get; set; }\n\n        public string NfsServerMajor { get; set; }\n\n        public string NfsServerAuthType { get; set; }\n\n        public string NfsServerUser { get; set; }\n\n        public string DeviceId { get; set; }\n\n        public HostProtocolEndpoint_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostProtocolEndpoint hostProtocolEndpoint)\n        {\n            return (hostProtocolEndpoint != null && this.PeType == hostProtocolEndpoint.PeType && this.Type == hostProtocolEndpoint.Type && this.Uuid == hostProtocolEndpoint.Uuid && ((this.HostKey == null && hostProtocolEndpoint.HostKey == null) || (this.HostKey != null && hostProtocolEndpoint.HostKey != null && Enumerable.SequenceEqual(this.HostKey, hostProtocolEndpoint.HostKey))) && this.StorageArray == hostProtocolEndpoint.StorageArray && this.NfsServer == hostProtocolEndpoint.NfsServer && this.NfsDir == hostProtocolEndpoint.NfsDir && this.NfsServerScope == hostProtocolEndpoint.NfsServerScope && this.NfsServerMajor == hostProtocolEndpoint.NfsServerMajor && this.NfsServerAuthType == hostProtocolEndpoint.NfsServerAuthType && this.NfsServerUser == hostProtocolEndpoint.NfsServerUser && this.DeviceId == hostProtocolEndpoint.DeviceId && ((this.LinkedView == null && hostProtocolEndpoint.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostProtocolEndpoint.LinkedView))));\n        }\n\n        public override bool Equals(object hostProtocolEndpoint)\n        {\n            return Equals(hostProtocolEndpoint as HostProtocolEndpoint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PeType + \"_\" + Type + \"_\" + Uuid + \"_\" + HostKey + \"_\" + StorageArray + \"_\" + NfsServer + \"_\" + NfsDir + \"_\" + NfsServerScope + \"_\" + NfsServerMajor + \"_\" + NfsServerAuthType + \"_\" + NfsServerUser + \"_\" + DeviceId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostProtocolEndpoint_LinkedView : IEquatable<HostProtocolEndpoint_LinkedView>\n    {\n        public HostSystem[] HostKey { get; set; }\n\n        public bool Equals(HostProtocolEndpoint_LinkedView hostProtocolEndpoint_LinkedView)\n        {\n            return (hostProtocolEndpoint_LinkedView != null && ((this.HostKey == null && hostProtocolEndpoint_LinkedView.HostKey == null) || (this.HostKey != null && hostProtocolEndpoint_LinkedView.HostKey != null && Enumerable.SequenceEqual(this.HostKey, hostProtocolEndpoint_LinkedView.HostKey))));\n        }\n\n        public override bool Equals(object hostProtocolEndpoint_LinkedView)\n        {\n            return Equals(hostProtocolEndpoint_LinkedView as HostProtocolEndpoint_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostKey).GetHashCode();\n        }\n    }\n\n    public class HostProxySwitch : DynamicData, IEquatable<HostProxySwitch>\n    {\n        public string DvsUuid { get; set; }\n\n        public string DvsName { get; set; }\n\n        public string Key { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public int? ConfigNumPorts { get; set; }\n\n        public int NumPortsAvailable { get; set; }\n\n        public KeyValue[] UplinkPort { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public string[] Pnic { get; set; }\n\n        public HostProxySwitchSpec Spec { get; set; }\n\n        public HostProxySwitchHostLagConfig[] HostLag { get; set; }\n\n        public bool? NetworkReservationSupported { get; set; }\n\n        public bool Equals(HostProxySwitch hostProxySwitch)\n        {\n            return (hostProxySwitch != null && this.DvsUuid == hostProxySwitch.DvsUuid && this.DvsName == hostProxySwitch.DvsName && this.Key == hostProxySwitch.Key && this.NumPorts == hostProxySwitch.NumPorts && ((this.ConfigNumPorts == null && hostProxySwitch.ConfigNumPorts == null) || (this.ConfigNumPorts != null && this.ConfigNumPorts.Equals(hostProxySwitch.ConfigNumPorts))) && this.NumPortsAvailable == hostProxySwitch.NumPortsAvailable && ((this.UplinkPort == null && hostProxySwitch.UplinkPort == null) || (this.UplinkPort != null && hostProxySwitch.UplinkPort != null && Enumerable.SequenceEqual(this.UplinkPort, hostProxySwitch.UplinkPort))) && ((this.Mtu == null && hostProxySwitch.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(hostProxySwitch.Mtu))) && ((this.Pnic == null && hostProxySwitch.Pnic == null) || (this.Pnic != null && hostProxySwitch.Pnic != null && Enumerable.SequenceEqual(this.Pnic, hostProxySwitch.Pnic))) && ((this.Spec == null && hostProxySwitch.Spec == null) || (this.Spec != null && this.Spec.Equals(hostProxySwitch.Spec))) && ((this.HostLag == null && hostProxySwitch.HostLag == null) || (this.HostLag != null && hostProxySwitch.HostLag != null && Enumerable.SequenceEqual(this.HostLag, hostProxySwitch.HostLag))) && ((this.NetworkReservationSupported == null && hostProxySwitch.NetworkReservationSupported == null) || (this.NetworkReservationSupported != null && this.NetworkReservationSupported.Equals(hostProxySwitch.NetworkReservationSupported))));\n        }\n\n        public override bool Equals(object hostProxySwitch)\n        {\n            return Equals(hostProxySwitch as HostProxySwitch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsUuid + \"_\" + DvsName + \"_\" + Key + \"_\" + NumPorts + \"_\" + ConfigNumPorts + \"_\" + NumPortsAvailable + \"_\" + UplinkPort + \"_\" + Mtu + \"_\" + Pnic + \"_\" + Spec + \"_\" + HostLag + \"_\" + NetworkReservationSupported).GetHashCode();\n        }\n    }\n\n    public class HostProxySwitchConfig : DynamicData, IEquatable<HostProxySwitchConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public string Uuid { get; set; }\n\n        public HostProxySwitchSpec Spec { get; set; }\n\n        public bool Equals(HostProxySwitchConfig hostProxySwitchConfig)\n        {\n            return (hostProxySwitchConfig != null && this.ChangeOperation == hostProxySwitchConfig.ChangeOperation && this.Uuid == hostProxySwitchConfig.Uuid && ((this.Spec == null && hostProxySwitchConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostProxySwitchConfig.Spec))));\n        }\n\n        public override bool Equals(object hostProxySwitchConfig)\n        {\n            return Equals(hostProxySwitchConfig as HostProxySwitchConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Uuid + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostProxySwitchHostLagConfig : DynamicData, IEquatable<HostProxySwitchHostLagConfig>\n    {\n        public string LagKey { get; set; }\n\n        public string LagName { get; set; }\n\n        public KeyValue[] UplinkPort { get; set; }\n\n        public bool Equals(HostProxySwitchHostLagConfig hostProxySwitchHostLagConfig)\n        {\n            return (hostProxySwitchHostLagConfig != null && this.LagKey == hostProxySwitchHostLagConfig.LagKey && this.LagName == hostProxySwitchHostLagConfig.LagName && ((this.UplinkPort == null && hostProxySwitchHostLagConfig.UplinkPort == null) || (this.UplinkPort != null && hostProxySwitchHostLagConfig.UplinkPort != null && Enumerable.SequenceEqual(this.UplinkPort, hostProxySwitchHostLagConfig.UplinkPort))));\n        }\n\n        public override bool Equals(object hostProxySwitchHostLagConfig)\n        {\n            return Equals(hostProxySwitchHostLagConfig as HostProxySwitchHostLagConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LagKey + \"_\" + LagName + \"_\" + UplinkPort).GetHashCode();\n        }\n    }\n\n    public class HostProxySwitchSpec : DynamicData, IEquatable<HostProxySwitchSpec>\n    {\n        public DistributedVirtualSwitchHostMemberBacking Backing { get; set; }\n\n        public bool Equals(HostProxySwitchSpec hostProxySwitchSpec)\n        {\n            return (hostProxySwitchSpec != null && ((this.Backing == null && hostProxySwitchSpec.Backing == null) || (this.Backing != null && this.Backing.Equals(hostProxySwitchSpec.Backing))));\n        }\n\n        public override bool Equals(object hostProxySwitchSpec)\n        {\n            return Equals(hostProxySwitchSpec as HostProxySwitchSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Backing).GetHashCode();\n        }\n    }\n\n    public class HostReconnectionFailedEvent : HostEvent, IEquatable<HostReconnectionFailedEvent>\n    {\n        public bool Equals(HostReconnectionFailedEvent hostReconnectionFailedEvent)\n        {\n            return (hostReconnectionFailedEvent != null && base.Equals(hostReconnectionFailedEvent));\n        }\n\n        public override bool Equals(object hostReconnectionFailedEvent)\n        {\n            return Equals(hostReconnectionFailedEvent as HostReconnectionFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostReliableMemoryInfo : DynamicData, IEquatable<HostReliableMemoryInfo>\n    {\n        public long MemorySize { get; set; }\n\n        public bool Equals(HostReliableMemoryInfo hostReliableMemoryInfo)\n        {\n            return (hostReliableMemoryInfo != null && this.MemorySize == hostReliableMemoryInfo.MemorySize);\n        }\n\n        public override bool Equals(object hostReliableMemoryInfo)\n        {\n            return Equals(hostReliableMemoryInfo as HostReliableMemoryInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MemorySize).GetHashCode();\n        }\n    }\n\n    public class HostRemovedEvent : HostEvent, IEquatable<HostRemovedEvent>\n    {\n        public bool Equals(HostRemovedEvent hostRemovedEvent)\n        {\n            return (hostRemovedEvent != null && base.Equals(hostRemovedEvent));\n        }\n\n        public override bool Equals(object hostRemovedEvent)\n        {\n            return Equals(hostRemovedEvent as HostRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostResignatureRescanResult : DynamicData, IEquatable<HostResignatureRescanResult>\n    {\n        public HostVmfsRescanResult[] Rescan { get; set; }\n\n        public ManagedObjectReference Result { get; set; }\n\n        public HostResignatureRescanResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostResignatureRescanResult hostResignatureRescanResult)\n        {\n            return (hostResignatureRescanResult != null && ((this.Rescan == null && hostResignatureRescanResult.Rescan == null) || (this.Rescan != null && hostResignatureRescanResult.Rescan != null && Enumerable.SequenceEqual(this.Rescan, hostResignatureRescanResult.Rescan))) && ((this.Result == null && hostResignatureRescanResult.Result == null) || (this.Result != null && this.Result.Equals(hostResignatureRescanResult.Result))) && ((this.LinkedView == null && hostResignatureRescanResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostResignatureRescanResult.LinkedView))));\n        }\n\n        public override bool Equals(object hostResignatureRescanResult)\n        {\n            return Equals(hostResignatureRescanResult as HostResignatureRescanResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Rescan + \"_\" + Result + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostResignatureRescanResult_LinkedView : IEquatable<HostResignatureRescanResult_LinkedView>\n    {\n        public Datastore Result { get; set; }\n\n        public bool Equals(HostResignatureRescanResult_LinkedView hostResignatureRescanResult_LinkedView)\n        {\n            return (hostResignatureRescanResult_LinkedView != null && ((this.Result == null && hostResignatureRescanResult_LinkedView.Result == null) || (this.Result != null && this.Result.Equals(hostResignatureRescanResult_LinkedView.Result))));\n        }\n\n        public override bool Equals(object hostResignatureRescanResult_LinkedView)\n        {\n            return Equals(hostResignatureRescanResult_LinkedView as HostResignatureRescanResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Result).GetHashCode();\n        }\n    }\n\n    public class HostRuntimeInfo : DynamicData, IEquatable<HostRuntimeInfo>\n    {\n        public HostSystemConnectionState ConnectionState { get; set; }\n\n        public HostSystemPowerState PowerState { get; set; }\n\n        public string StandbyMode { get; set; }\n\n        public bool InMaintenanceMode { get; set; }\n\n        public bool? InQuarantineMode { get; set; }\n\n        public DateTime? BootTime { get; set; }\n\n        public HealthSystemRuntime HealthSystemRuntime { get; set; }\n\n        public ClusterDasFdmHostState DasHostState { get; set; }\n\n        public HostTpmDigestInfo[] TpmPcrValues { get; set; }\n\n        public VsanHostRuntimeInfo VsanRuntimeInfo { get; set; }\n\n        public HostRuntimeInfoNetworkRuntimeInfo NetworkRuntimeInfo { get; set; }\n\n        public HostVFlashManagerVFlashResourceRunTimeInfo VFlashResourceRuntimeInfo { get; set; }\n\n        public long? HostMaxVirtualDiskCapacity { get; set; }\n\n        public string CryptoState { get; set; }\n\n        public CryptoKeyId CryptoKeyId { get; set; }\n\n        public bool Equals(HostRuntimeInfo hostRuntimeInfo)\n        {\n            return (hostRuntimeInfo != null && this.ConnectionState == hostRuntimeInfo.ConnectionState && this.PowerState == hostRuntimeInfo.PowerState && this.StandbyMode == hostRuntimeInfo.StandbyMode && this.InMaintenanceMode == hostRuntimeInfo.InMaintenanceMode && ((this.InQuarantineMode == null && hostRuntimeInfo.InQuarantineMode == null) || (this.InQuarantineMode != null && this.InQuarantineMode.Equals(hostRuntimeInfo.InQuarantineMode))) && ((this.BootTime == null && hostRuntimeInfo.BootTime == null) || (this.BootTime != null && this.BootTime.Equals(hostRuntimeInfo.BootTime))) && ((this.HealthSystemRuntime == null && hostRuntimeInfo.HealthSystemRuntime == null) || (this.HealthSystemRuntime != null && this.HealthSystemRuntime.Equals(hostRuntimeInfo.HealthSystemRuntime))) && ((this.DasHostState == null && hostRuntimeInfo.DasHostState == null) || (this.DasHostState != null && this.DasHostState.Equals(hostRuntimeInfo.DasHostState))) && ((this.TpmPcrValues == null && hostRuntimeInfo.TpmPcrValues == null) || (this.TpmPcrValues != null && hostRuntimeInfo.TpmPcrValues != null && Enumerable.SequenceEqual(this.TpmPcrValues, hostRuntimeInfo.TpmPcrValues))) && ((this.VsanRuntimeInfo == null && hostRuntimeInfo.VsanRuntimeInfo == null) || (this.VsanRuntimeInfo != null && this.VsanRuntimeInfo.Equals(hostRuntimeInfo.VsanRuntimeInfo))) && ((this.NetworkRuntimeInfo == null && hostRuntimeInfo.NetworkRuntimeInfo == null) || (this.NetworkRuntimeInfo != null && this.NetworkRuntimeInfo.Equals(hostRuntimeInfo.NetworkRuntimeInfo))) && ((this.VFlashResourceRuntimeInfo == null && hostRuntimeInfo.VFlashResourceRuntimeInfo == null) || (this.VFlashResourceRuntimeInfo != null && this.VFlashResourceRuntimeInfo.Equals(hostRuntimeInfo.VFlashResourceRuntimeInfo))) && ((this.HostMaxVirtualDiskCapacity == null && hostRuntimeInfo.HostMaxVirtualDiskCapacity == null) || (this.HostMaxVirtualDiskCapacity != null && this.HostMaxVirtualDiskCapacity.Equals(hostRuntimeInfo.HostMaxVirtualDiskCapacity))) && this.CryptoState == hostRuntimeInfo.CryptoState && ((this.CryptoKeyId == null && hostRuntimeInfo.CryptoKeyId == null) || (this.CryptoKeyId != null && this.CryptoKeyId.Equals(hostRuntimeInfo.CryptoKeyId))));\n        }\n\n        public override bool Equals(object hostRuntimeInfo)\n        {\n            return Equals(hostRuntimeInfo as HostRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConnectionState + \"_\" + PowerState + \"_\" + StandbyMode + \"_\" + InMaintenanceMode + \"_\" + InQuarantineMode + \"_\" + BootTime + \"_\" + HealthSystemRuntime + \"_\" + DasHostState + \"_\" + TpmPcrValues + \"_\" + VsanRuntimeInfo + \"_\" + NetworkRuntimeInfo + \"_\" + VFlashResourceRuntimeInfo + \"_\" + HostMaxVirtualDiskCapacity + \"_\" + CryptoState + \"_\" + CryptoKeyId).GetHashCode();\n        }\n    }\n\n    public class HostRuntimeInfoNetStackInstanceRuntimeInfo : DynamicData, IEquatable<HostRuntimeInfoNetStackInstanceRuntimeInfo>\n    {\n        public string NetStackInstanceKey { get; set; }\n\n        public string State { get; set; }\n\n        public string[] VmknicKeys { get; set; }\n\n        public int? MaxNumberOfConnections { get; set; }\n\n        public bool? CurrentIpV6Enabled { get; set; }\n\n        public bool Equals(HostRuntimeInfoNetStackInstanceRuntimeInfo hostRuntimeInfoNetStackInstanceRuntimeInfo)\n        {\n            return (hostRuntimeInfoNetStackInstanceRuntimeInfo != null && this.NetStackInstanceKey == hostRuntimeInfoNetStackInstanceRuntimeInfo.NetStackInstanceKey && this.State == hostRuntimeInfoNetStackInstanceRuntimeInfo.State && ((this.VmknicKeys == null && hostRuntimeInfoNetStackInstanceRuntimeInfo.VmknicKeys == null) || (this.VmknicKeys != null && hostRuntimeInfoNetStackInstanceRuntimeInfo.VmknicKeys != null && Enumerable.SequenceEqual(this.VmknicKeys, hostRuntimeInfoNetStackInstanceRuntimeInfo.VmknicKeys))) && ((this.MaxNumberOfConnections == null && hostRuntimeInfoNetStackInstanceRuntimeInfo.MaxNumberOfConnections == null) || (this.MaxNumberOfConnections != null && this.MaxNumberOfConnections.Equals(hostRuntimeInfoNetStackInstanceRuntimeInfo.MaxNumberOfConnections))) && ((this.CurrentIpV6Enabled == null && hostRuntimeInfoNetStackInstanceRuntimeInfo.CurrentIpV6Enabled == null) || (this.CurrentIpV6Enabled != null && this.CurrentIpV6Enabled.Equals(hostRuntimeInfoNetStackInstanceRuntimeInfo.CurrentIpV6Enabled))));\n        }\n\n        public override bool Equals(object hostRuntimeInfoNetStackInstanceRuntimeInfo)\n        {\n            return Equals(hostRuntimeInfoNetStackInstanceRuntimeInfo as HostRuntimeInfoNetStackInstanceRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetStackInstanceKey + \"_\" + State + \"_\" + VmknicKeys + \"_\" + MaxNumberOfConnections + \"_\" + CurrentIpV6Enabled).GetHashCode();\n        }\n    }\n\n    public class HostRuntimeInfoNetworkRuntimeInfo : DynamicData, IEquatable<HostRuntimeInfoNetworkRuntimeInfo>\n    {\n        public HostRuntimeInfoNetStackInstanceRuntimeInfo[] NetStackInstanceRuntimeInfo { get; set; }\n\n        public HostNetworkResourceRuntime NetworkResourceRuntime { get; set; }\n\n        public bool Equals(HostRuntimeInfoNetworkRuntimeInfo hostRuntimeInfoNetworkRuntimeInfo)\n        {\n            return (hostRuntimeInfoNetworkRuntimeInfo != null && ((this.NetStackInstanceRuntimeInfo == null && hostRuntimeInfoNetworkRuntimeInfo.NetStackInstanceRuntimeInfo == null) || (this.NetStackInstanceRuntimeInfo != null && hostRuntimeInfoNetworkRuntimeInfo.NetStackInstanceRuntimeInfo != null && Enumerable.SequenceEqual(this.NetStackInstanceRuntimeInfo, hostRuntimeInfoNetworkRuntimeInfo.NetStackInstanceRuntimeInfo))) && ((this.NetworkResourceRuntime == null && hostRuntimeInfoNetworkRuntimeInfo.NetworkResourceRuntime == null) || (this.NetworkResourceRuntime != null && this.NetworkResourceRuntime.Equals(hostRuntimeInfoNetworkRuntimeInfo.NetworkResourceRuntime))));\n        }\n\n        public override bool Equals(object hostRuntimeInfoNetworkRuntimeInfo)\n        {\n            return Equals(hostRuntimeInfoNetworkRuntimeInfo as HostRuntimeInfoNetworkRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetStackInstanceRuntimeInfo + \"_\" + NetworkResourceRuntime).GetHashCode();\n        }\n    }\n\n    public class HostScsiDisk : ScsiLun, IEquatable<HostScsiDisk>\n    {\n        public HostDiskDimensionsLba Capacity { get; set; }\n\n        public string DevicePath { get; set; }\n\n        public bool? Ssd { get; set; }\n\n        public bool? LocalDisk { get; set; }\n\n        public string[] PhysicalLocation { get; set; }\n\n        public bool? EmulatedDIXDIFEnabled { get; set; }\n\n        public VsanHostVsanDiskInfo VsanDiskInfo { get; set; }\n\n        public string ScsiDiskType { get; set; }\n\n        public bool Equals(HostScsiDisk hostScsiDisk)\n        {\n            return (hostScsiDisk != null && ((this.Capacity == null && hostScsiDisk.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(hostScsiDisk.Capacity))) && this.DevicePath == hostScsiDisk.DevicePath && ((this.Ssd == null && hostScsiDisk.Ssd == null) || (this.Ssd != null && this.Ssd.Equals(hostScsiDisk.Ssd))) && ((this.LocalDisk == null && hostScsiDisk.LocalDisk == null) || (this.LocalDisk != null && this.LocalDisk.Equals(hostScsiDisk.LocalDisk))) && ((this.PhysicalLocation == null && hostScsiDisk.PhysicalLocation == null) || (this.PhysicalLocation != null && hostScsiDisk.PhysicalLocation != null && Enumerable.SequenceEqual(this.PhysicalLocation, hostScsiDisk.PhysicalLocation))) && ((this.EmulatedDIXDIFEnabled == null && hostScsiDisk.EmulatedDIXDIFEnabled == null) || (this.EmulatedDIXDIFEnabled != null && this.EmulatedDIXDIFEnabled.Equals(hostScsiDisk.EmulatedDIXDIFEnabled))) && ((this.VsanDiskInfo == null && hostScsiDisk.VsanDiskInfo == null) || (this.VsanDiskInfo != null && this.VsanDiskInfo.Equals(hostScsiDisk.VsanDiskInfo))) && this.ScsiDiskType == hostScsiDisk.ScsiDiskType);\n        }\n\n        public override bool Equals(object hostScsiDisk)\n        {\n            return Equals(hostScsiDisk as HostScsiDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capacity + \"_\" + DevicePath + \"_\" + Ssd + \"_\" + LocalDisk + \"_\" + PhysicalLocation + \"_\" + EmulatedDIXDIFEnabled + \"_\" + VsanDiskInfo + \"_\" + ScsiDiskType).GetHashCode();\n        }\n    }\n\n    public class HostScsiDiskPartition : DynamicData, IEquatable<HostScsiDiskPartition>\n    {\n        public string DiskName { get; set; }\n\n        public int Partition { get; set; }\n\n        public bool Equals(HostScsiDiskPartition hostScsiDiskPartition)\n        {\n            return (hostScsiDiskPartition != null && this.DiskName == hostScsiDiskPartition.DiskName && this.Partition == hostScsiDiskPartition.Partition);\n        }\n\n        public override bool Equals(object hostScsiDiskPartition)\n        {\n            return Equals(hostScsiDiskPartition as HostScsiDiskPartition);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskName + \"_\" + Partition).GetHashCode();\n        }\n    }\n\n    public class HostScsiTopology : DynamicData, IEquatable<HostScsiTopology>\n    {\n        public HostScsiTopologyInterface[] Adapter { get; set; }\n\n        public bool Equals(HostScsiTopology hostScsiTopology)\n        {\n            return (hostScsiTopology != null && ((this.Adapter == null && hostScsiTopology.Adapter == null) || (this.Adapter != null && hostScsiTopology.Adapter != null && Enumerable.SequenceEqual(this.Adapter, hostScsiTopology.Adapter))));\n        }\n\n        public override bool Equals(object hostScsiTopology)\n        {\n            return Equals(hostScsiTopology as HostScsiTopology);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Adapter).GetHashCode();\n        }\n    }\n\n    public class HostScsiTopologyInterface : DynamicData, IEquatable<HostScsiTopologyInterface>\n    {\n        public string Key { get; set; }\n\n        public string Adapter { get; set; }\n\n        public HostScsiTopologyTarget[] Target { get; set; }\n\n        public bool Equals(HostScsiTopologyInterface hostScsiTopologyInterface)\n        {\n            return (hostScsiTopologyInterface != null && this.Key == hostScsiTopologyInterface.Key && this.Adapter == hostScsiTopologyInterface.Adapter && ((this.Target == null && hostScsiTopologyInterface.Target == null) || (this.Target != null && hostScsiTopologyInterface.Target != null && Enumerable.SequenceEqual(this.Target, hostScsiTopologyInterface.Target))));\n        }\n\n        public override bool Equals(object hostScsiTopologyInterface)\n        {\n            return Equals(hostScsiTopologyInterface as HostScsiTopologyInterface);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Adapter + \"_\" + Target).GetHashCode();\n        }\n    }\n\n    public class HostScsiTopologyLun : DynamicData, IEquatable<HostScsiTopologyLun>\n    {\n        public string Key { get; set; }\n\n        public int Lun { get; set; }\n\n        public string ScsiLun { get; set; }\n\n        public bool Equals(HostScsiTopologyLun hostScsiTopologyLun)\n        {\n            return (hostScsiTopologyLun != null && this.Key == hostScsiTopologyLun.Key && this.Lun == hostScsiTopologyLun.Lun && this.ScsiLun == hostScsiTopologyLun.ScsiLun);\n        }\n\n        public override bool Equals(object hostScsiTopologyLun)\n        {\n            return Equals(hostScsiTopologyLun as HostScsiTopologyLun);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Lun + \"_\" + ScsiLun).GetHashCode();\n        }\n    }\n\n    public class HostScsiTopologyTarget : DynamicData, IEquatable<HostScsiTopologyTarget>\n    {\n        public string Key { get; set; }\n\n        public int Target { get; set; }\n\n        public HostScsiTopologyLun[] Lun { get; set; }\n\n        public HostTargetTransport Transport { get; set; }\n\n        public bool Equals(HostScsiTopologyTarget hostScsiTopologyTarget)\n        {\n            return (hostScsiTopologyTarget != null && this.Key == hostScsiTopologyTarget.Key && this.Target == hostScsiTopologyTarget.Target && ((this.Lun == null && hostScsiTopologyTarget.Lun == null) || (this.Lun != null && hostScsiTopologyTarget.Lun != null && Enumerable.SequenceEqual(this.Lun, hostScsiTopologyTarget.Lun))) && ((this.Transport == null && hostScsiTopologyTarget.Transport == null) || (this.Transport != null && this.Transport.Equals(hostScsiTopologyTarget.Transport))));\n        }\n\n        public override bool Equals(object hostScsiTopologyTarget)\n        {\n            return Equals(hostScsiTopologyTarget as HostScsiTopologyTarget);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Target + \"_\" + Lun + \"_\" + Transport).GetHashCode();\n        }\n    }\n\n    public class HostSecuritySpec : DynamicData, IEquatable<HostSecuritySpec>\n    {\n        public string AdminPassword { get; set; }\n\n        public Permission[] RemovePermission { get; set; }\n\n        public Permission[] AddPermission { get; set; }\n\n        public bool Equals(HostSecuritySpec hostSecuritySpec)\n        {\n            return (hostSecuritySpec != null && this.AdminPassword == hostSecuritySpec.AdminPassword && ((this.RemovePermission == null && hostSecuritySpec.RemovePermission == null) || (this.RemovePermission != null && hostSecuritySpec.RemovePermission != null && Enumerable.SequenceEqual(this.RemovePermission, hostSecuritySpec.RemovePermission))) && ((this.AddPermission == null && hostSecuritySpec.AddPermission == null) || (this.AddPermission != null && hostSecuritySpec.AddPermission != null && Enumerable.SequenceEqual(this.AddPermission, hostSecuritySpec.AddPermission))));\n        }\n\n        public override bool Equals(object hostSecuritySpec)\n        {\n            return Equals(hostSecuritySpec as HostSecuritySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AdminPassword + \"_\" + RemovePermission + \"_\" + AddPermission).GetHashCode();\n        }\n    }\n\n    public class HostSerialAttachedHba : HostHostBusAdapter, IEquatable<HostSerialAttachedHba>\n    {\n        public string NodeWorldWideName { get; set; }\n\n        public bool Equals(HostSerialAttachedHba hostSerialAttachedHba)\n        {\n            return (hostSerialAttachedHba != null && this.NodeWorldWideName == hostSerialAttachedHba.NodeWorldWideName);\n        }\n\n        public override bool Equals(object hostSerialAttachedHba)\n        {\n            return Equals(hostSerialAttachedHba as HostSerialAttachedHba);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NodeWorldWideName).GetHashCode();\n        }\n    }\n\n    public class HostSerialAttachedTargetTransport : HostTargetTransport, IEquatable<HostSerialAttachedTargetTransport>\n    {\n        public bool Equals(HostSerialAttachedTargetTransport hostSerialAttachedTargetTransport)\n        {\n            return (hostSerialAttachedTargetTransport != null && base.Equals(hostSerialAttachedTargetTransport));\n        }\n\n        public override bool Equals(object hostSerialAttachedTargetTransport)\n        {\n            return Equals(hostSerialAttachedTargetTransport as HostSerialAttachedTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostService : DynamicData, IEquatable<HostService>\n    {\n        public string Key { get; set; }\n\n        public string Label { get; set; }\n\n        public bool Required { get; set; }\n\n        public bool Uninstallable { get; set; }\n\n        public bool Running { get; set; }\n\n        public string[] Ruleset { get; set; }\n\n        public string Policy { get; set; }\n\n        public HostServiceSourcePackage SourcePackage { get; set; }\n\n        public bool Equals(HostService hostService)\n        {\n            return (hostService != null && this.Key == hostService.Key && this.Label == hostService.Label && this.Required == hostService.Required && this.Uninstallable == hostService.Uninstallable && this.Running == hostService.Running && ((this.Ruleset == null && hostService.Ruleset == null) || (this.Ruleset != null && hostService.Ruleset != null && Enumerable.SequenceEqual(this.Ruleset, hostService.Ruleset))) && this.Policy == hostService.Policy && ((this.SourcePackage == null && hostService.SourcePackage == null) || (this.SourcePackage != null && this.SourcePackage.Equals(hostService.SourcePackage))));\n        }\n\n        public override bool Equals(object hostService)\n        {\n            return Equals(hostService as HostService);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Label + \"_\" + Required + \"_\" + Uninstallable + \"_\" + Running + \"_\" + Ruleset + \"_\" + Policy + \"_\" + SourcePackage).GetHashCode();\n        }\n    }\n\n    public class HostServiceConfig : DynamicData, IEquatable<HostServiceConfig>\n    {\n        public string ServiceId { get; set; }\n\n        public string StartupPolicy { get; set; }\n\n        public bool Equals(HostServiceConfig hostServiceConfig)\n        {\n            return (hostServiceConfig != null && this.ServiceId == hostServiceConfig.ServiceId && this.StartupPolicy == hostServiceConfig.StartupPolicy);\n        }\n\n        public override bool Equals(object hostServiceConfig)\n        {\n            return Equals(hostServiceConfig as HostServiceConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceId + \"_\" + StartupPolicy).GetHashCode();\n        }\n    }\n\n    public class HostServiceInfo : DynamicData, IEquatable<HostServiceInfo>\n    {\n        public HostService[] Service { get; set; }\n\n        public bool Equals(HostServiceInfo hostServiceInfo)\n        {\n            return (hostServiceInfo != null && ((this.Service == null && hostServiceInfo.Service == null) || (this.Service != null && hostServiceInfo.Service != null && Enumerable.SequenceEqual(this.Service, hostServiceInfo.Service))));\n        }\n\n        public override bool Equals(object hostServiceInfo)\n        {\n            return Equals(hostServiceInfo as HostServiceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Service).GetHashCode();\n        }\n    }\n\n    public class HostServiceSourcePackage : DynamicData, IEquatable<HostServiceSourcePackage>\n    {\n        public string SourcePackageName { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(HostServiceSourcePackage hostServiceSourcePackage)\n        {\n            return (hostServiceSourcePackage != null && this.SourcePackageName == hostServiceSourcePackage.SourcePackageName && this.Description == hostServiceSourcePackage.Description);\n        }\n\n        public override bool Equals(object hostServiceSourcePackage)\n        {\n            return Equals(hostServiceSourcePackage as HostServiceSourcePackage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourcePackageName + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class HostServiceSystem : ExtensibleManagedObject, IEquatable<HostServiceSystem>\n    {\n        public HostServiceInfo ServiceInfo { get; set; }\n\n        public void UpdateServicePolicy(string id, string policy)\n        {\n        }\n\n        public void StartService(string id)\n        {\n        }\n\n        public void StopService(string id)\n        {\n        }\n\n        public void RestartService(string id)\n        {\n        }\n\n        public void UninstallService(string id)\n        {\n        }\n\n        public void RefreshServices()\n        {\n        }\n\n        public bool Equals(HostServiceSystem hostServiceSystem)\n        {\n            return (hostServiceSystem != null && ((this.ServiceInfo == null && hostServiceSystem.ServiceInfo == null) || (this.ServiceInfo != null && this.ServiceInfo.Equals(hostServiceSystem.ServiceInfo))));\n        }\n\n        public override bool Equals(object hostServiceSystem)\n        {\n            return Equals(hostServiceSystem as HostServiceSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceInfo).GetHashCode();\n        }\n    }\n\n    public class HostServiceTicket : DynamicData, IEquatable<HostServiceTicket>\n    {\n        public string Host { get; set; }\n\n        public int? Port { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public string Service { get; set; }\n\n        public string ServiceVersion { get; set; }\n\n        public string SessionId { get; set; }\n\n        public bool Equals(HostServiceTicket hostServiceTicket)\n        {\n            return (hostServiceTicket != null && this.Host == hostServiceTicket.Host && ((this.Port == null && hostServiceTicket.Port == null) || (this.Port != null && this.Port.Equals(hostServiceTicket.Port))) && this.SslThumbprint == hostServiceTicket.SslThumbprint && this.Service == hostServiceTicket.Service && this.ServiceVersion == hostServiceTicket.ServiceVersion && this.SessionId == hostServiceTicket.SessionId);\n        }\n\n        public override bool Equals(object hostServiceTicket)\n        {\n            return Equals(hostServiceTicket as HostServiceTicket);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Port + \"_\" + SslThumbprint + \"_\" + Service + \"_\" + ServiceVersion + \"_\" + SessionId).GetHashCode();\n        }\n    }\n\n    public class HostSharedGpuCapabilities : DynamicData, IEquatable<HostSharedGpuCapabilities>\n    {\n        public string Vgpu { get; set; }\n\n        public bool DiskSnapshotSupported { get; set; }\n\n        public bool MemorySnapshotSupported { get; set; }\n\n        public bool SuspendSupported { get; set; }\n\n        public bool MigrateSupported { get; set; }\n\n        public bool Equals(HostSharedGpuCapabilities hostSharedGpuCapabilities)\n        {\n            return (hostSharedGpuCapabilities != null && this.Vgpu == hostSharedGpuCapabilities.Vgpu && this.DiskSnapshotSupported == hostSharedGpuCapabilities.DiskSnapshotSupported && this.MemorySnapshotSupported == hostSharedGpuCapabilities.MemorySnapshotSupported && this.SuspendSupported == hostSharedGpuCapabilities.SuspendSupported && this.MigrateSupported == hostSharedGpuCapabilities.MigrateSupported);\n        }\n\n        public override bool Equals(object hostSharedGpuCapabilities)\n        {\n            return Equals(hostSharedGpuCapabilities as HostSharedGpuCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vgpu + \"_\" + DiskSnapshotSupported + \"_\" + MemorySnapshotSupported + \"_\" + SuspendSupported + \"_\" + MigrateSupported).GetHashCode();\n        }\n    }\n\n    public class HostShortNameInconsistentEvent : HostDasEvent, IEquatable<HostShortNameInconsistentEvent>\n    {\n        public string ShortName { get; set; }\n\n        public string ShortName2 { get; set; }\n\n        public bool Equals(HostShortNameInconsistentEvent hostShortNameInconsistentEvent)\n        {\n            return (hostShortNameInconsistentEvent != null && this.ShortName == hostShortNameInconsistentEvent.ShortName && this.ShortName2 == hostShortNameInconsistentEvent.ShortName2);\n        }\n\n        public override bool Equals(object hostShortNameInconsistentEvent)\n        {\n            return Equals(hostShortNameInconsistentEvent as HostShortNameInconsistentEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ShortName + \"_\" + ShortName2).GetHashCode();\n        }\n    }\n\n    public class HostShortNameToIpFailedEvent : HostEvent, IEquatable<HostShortNameToIpFailedEvent>\n    {\n        public string ShortName { get; set; }\n\n        public bool Equals(HostShortNameToIpFailedEvent hostShortNameToIpFailedEvent)\n        {\n            return (hostShortNameToIpFailedEvent != null && this.ShortName == hostShortNameToIpFailedEvent.ShortName);\n        }\n\n        public override bool Equals(object hostShortNameToIpFailedEvent)\n        {\n            return Equals(hostShortNameToIpFailedEvent as HostShortNameToIpFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ShortName).GetHashCode();\n        }\n    }\n\n    public class HostShutdownEvent : HostEvent, IEquatable<HostShutdownEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(HostShutdownEvent hostShutdownEvent)\n        {\n            return (hostShutdownEvent != null && this.Reason == hostShutdownEvent.Reason);\n        }\n\n        public override bool Equals(object hostShutdownEvent)\n        {\n            return Equals(hostShutdownEvent as HostShutdownEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class HostSnmpConfigSpec : DynamicData, IEquatable<HostSnmpConfigSpec>\n    {\n        public bool? Enabled { get; set; }\n\n        public int? Port { get; set; }\n\n        public string[] ReadOnlyCommunities { get; set; }\n\n        public HostSnmpDestination[] TrapTargets { get; set; }\n\n        public KeyValue[] Option { get; set; }\n\n        public bool Equals(HostSnmpConfigSpec hostSnmpConfigSpec)\n        {\n            return (hostSnmpConfigSpec != null && ((this.Enabled == null && hostSnmpConfigSpec.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(hostSnmpConfigSpec.Enabled))) && ((this.Port == null && hostSnmpConfigSpec.Port == null) || (this.Port != null && this.Port.Equals(hostSnmpConfigSpec.Port))) && ((this.ReadOnlyCommunities == null && hostSnmpConfigSpec.ReadOnlyCommunities == null) || (this.ReadOnlyCommunities != null && hostSnmpConfigSpec.ReadOnlyCommunities != null && Enumerable.SequenceEqual(this.ReadOnlyCommunities, hostSnmpConfigSpec.ReadOnlyCommunities))) && ((this.TrapTargets == null && hostSnmpConfigSpec.TrapTargets == null) || (this.TrapTargets != null && hostSnmpConfigSpec.TrapTargets != null && Enumerable.SequenceEqual(this.TrapTargets, hostSnmpConfigSpec.TrapTargets))) && ((this.Option == null && hostSnmpConfigSpec.Option == null) || (this.Option != null && hostSnmpConfigSpec.Option != null && Enumerable.SequenceEqual(this.Option, hostSnmpConfigSpec.Option))));\n        }\n\n        public override bool Equals(object hostSnmpConfigSpec)\n        {\n            return Equals(hostSnmpConfigSpec as HostSnmpConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + Port + \"_\" + ReadOnlyCommunities + \"_\" + TrapTargets + \"_\" + Option).GetHashCode();\n        }\n    }\n\n    public class HostSnmpDestination : DynamicData, IEquatable<HostSnmpDestination>\n    {\n        public string HostName { get; set; }\n\n        public int Port { get; set; }\n\n        public string Community { get; set; }\n\n        public bool Equals(HostSnmpDestination hostSnmpDestination)\n        {\n            return (hostSnmpDestination != null && this.HostName == hostSnmpDestination.HostName && this.Port == hostSnmpDestination.Port && this.Community == hostSnmpDestination.Community);\n        }\n\n        public override bool Equals(object hostSnmpDestination)\n        {\n            return Equals(hostSnmpDestination as HostSnmpDestination);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Port + \"_\" + Community).GetHashCode();\n        }\n    }\n\n    public class HostSnmpSystem : ViewBase, IEquatable<HostSnmpSystem>\n    {\n        public HostSnmpConfigSpec Configuration { get; set; }\n\n        public HostSnmpSystemAgentLimits Limits { get; set; }\n\n        public void ReconfigureSnmpAgent(HostSnmpConfigSpec spec)\n        {\n        }\n\n        public void SendTestNotification()\n        {\n        }\n\n        public bool Equals(HostSnmpSystem hostSnmpSystem)\n        {\n            return (hostSnmpSystem != null && ((this.Configuration == null && hostSnmpSystem.Configuration == null) || (this.Configuration != null && this.Configuration.Equals(hostSnmpSystem.Configuration))) && ((this.Limits == null && hostSnmpSystem.Limits == null) || (this.Limits != null && this.Limits.Equals(hostSnmpSystem.Limits))));\n        }\n\n        public override bool Equals(object hostSnmpSystem)\n        {\n            return Equals(hostSnmpSystem as HostSnmpSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Configuration + \"_\" + Limits).GetHashCode();\n        }\n    }\n\n    public class HostSnmpSystemAgentLimits : DynamicData, IEquatable<HostSnmpSystemAgentLimits>\n    {\n        public int MaxReadOnlyCommunities { get; set; }\n\n        public int MaxTrapDestinations { get; set; }\n\n        public int MaxCommunityLength { get; set; }\n\n        public int MaxBufferSize { get; set; }\n\n        public HostSnmpAgentCapability Capability { get; set; }\n\n        public bool Equals(HostSnmpSystemAgentLimits hostSnmpSystemAgentLimits)\n        {\n            return (hostSnmpSystemAgentLimits != null && this.MaxReadOnlyCommunities == hostSnmpSystemAgentLimits.MaxReadOnlyCommunities && this.MaxTrapDestinations == hostSnmpSystemAgentLimits.MaxTrapDestinations && this.MaxCommunityLength == hostSnmpSystemAgentLimits.MaxCommunityLength && this.MaxBufferSize == hostSnmpSystemAgentLimits.MaxBufferSize && this.Capability == hostSnmpSystemAgentLimits.Capability);\n        }\n\n        public override bool Equals(object hostSnmpSystemAgentLimits)\n        {\n            return Equals(hostSnmpSystemAgentLimits as HostSnmpSystemAgentLimits);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxReadOnlyCommunities + \"_\" + MaxTrapDestinations + \"_\" + MaxCommunityLength + \"_\" + MaxBufferSize + \"_\" + Capability).GetHashCode();\n        }\n    }\n\n    public class HostSpecification : DynamicData, IEquatable<HostSpecification>\n    {\n        public DateTime CreatedTime { get; set; }\n\n        public DateTime? LastModified { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public HostSubSpecification[] SubSpecs { get; set; }\n\n        public string ChangeID { get; set; }\n\n        public HostSpecification_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostSpecification hostSpecification)\n        {\n            return (hostSpecification != null && this.CreatedTime == hostSpecification.CreatedTime && ((this.LastModified == null && hostSpecification.LastModified == null) || (this.LastModified != null && this.LastModified.Equals(hostSpecification.LastModified))) && ((this.Host == null && hostSpecification.Host == null) || (this.Host != null && this.Host.Equals(hostSpecification.Host))) && ((this.SubSpecs == null && hostSpecification.SubSpecs == null) || (this.SubSpecs != null && hostSpecification.SubSpecs != null && Enumerable.SequenceEqual(this.SubSpecs, hostSpecification.SubSpecs))) && this.ChangeID == hostSpecification.ChangeID && ((this.LinkedView == null && hostSpecification.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostSpecification.LinkedView))));\n        }\n\n        public override bool Equals(object hostSpecification)\n        {\n            return Equals(hostSpecification as HostSpecification);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CreatedTime + \"_\" + LastModified + \"_\" + Host + \"_\" + SubSpecs + \"_\" + ChangeID + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostSpecification_LinkedView : IEquatable<HostSpecification_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostSpecification_LinkedView hostSpecification_LinkedView)\n        {\n            return (hostSpecification_LinkedView != null && ((this.Host == null && hostSpecification_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostSpecification_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostSpecification_LinkedView)\n        {\n            return Equals(hostSpecification_LinkedView as HostSpecification_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostSpecificationChangedEvent : HostEvent, IEquatable<HostSpecificationChangedEvent>\n    {\n        public bool Equals(HostSpecificationChangedEvent hostSpecificationChangedEvent)\n        {\n            return (hostSpecificationChangedEvent != null && base.Equals(hostSpecificationChangedEvent));\n        }\n\n        public override bool Equals(object hostSpecificationChangedEvent)\n        {\n            return Equals(hostSpecificationChangedEvent as HostSpecificationChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostSpecificationManager : ViewBase, IEquatable<HostSpecificationManager>\n    {\n        public void UpdateHostSpecification(ManagedObjectReference host, HostSpecification hostSpec)\n        {\n        }\n\n        public void UpdateHostSubSpecification(ManagedObjectReference host, HostSubSpecification hostSubSpec)\n        {\n        }\n\n        public HostSpecification RetrieveHostSpecification(ManagedObjectReference host, bool fromHost)\n        {\n            return default(HostSpecification);\n        }\n\n        public void DeleteHostSubSpecification(ManagedObjectReference host, string subSpecName)\n        {\n        }\n\n        public void DeleteHostSpecification(ManagedObjectReference host)\n        {\n        }\n\n        public ManagedObjectReference[] HostSpecGetUpdatedHosts(string startChangeID, string endChangeID)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool Equals(HostSpecificationManager hostSpecificationManager)\n        {\n            return (hostSpecificationManager != null && base.Equals(hostSpecificationManager));\n        }\n\n        public override bool Equals(object hostSpecificationManager)\n        {\n            return Equals(hostSpecificationManager as HostSpecificationManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostSpecificationOperationFailed : VimFault, IEquatable<HostSpecificationOperationFailed>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public HostSpecificationOperationFailed_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostSpecificationOperationFailed hostSpecificationOperationFailed)\n        {\n            return (hostSpecificationOperationFailed != null && ((this.Host == null && hostSpecificationOperationFailed.Host == null) || (this.Host != null && this.Host.Equals(hostSpecificationOperationFailed.Host))) && ((this.LinkedView == null && hostSpecificationOperationFailed.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostSpecificationOperationFailed.LinkedView))));\n        }\n\n        public override bool Equals(object hostSpecificationOperationFailed)\n        {\n            return Equals(hostSpecificationOperationFailed as HostSpecificationOperationFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostSpecificationOperationFailed_LinkedView : IEquatable<HostSpecificationOperationFailed_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostSpecificationOperationFailed_LinkedView hostSpecificationOperationFailed_LinkedView)\n        {\n            return (hostSpecificationOperationFailed_LinkedView != null && ((this.Host == null && hostSpecificationOperationFailed_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostSpecificationOperationFailed_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostSpecificationOperationFailed_LinkedView)\n        {\n            return Equals(hostSpecificationOperationFailed_LinkedView as HostSpecificationOperationFailed_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostSpecificationRequireEvent : HostEvent, IEquatable<HostSpecificationRequireEvent>\n    {\n        public bool Equals(HostSpecificationRequireEvent hostSpecificationRequireEvent)\n        {\n            return (hostSpecificationRequireEvent != null && base.Equals(hostSpecificationRequireEvent));\n        }\n\n        public override bool Equals(object hostSpecificationRequireEvent)\n        {\n            return Equals(hostSpecificationRequireEvent as HostSpecificationRequireEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostSpecificationUpdateEvent : HostEvent, IEquatable<HostSpecificationUpdateEvent>\n    {\n        public HostSpecification HostSpec { get; set; }\n\n        public bool Equals(HostSpecificationUpdateEvent hostSpecificationUpdateEvent)\n        {\n            return (hostSpecificationUpdateEvent != null && ((this.HostSpec == null && hostSpecificationUpdateEvent.HostSpec == null) || (this.HostSpec != null && this.HostSpec.Equals(hostSpecificationUpdateEvent.HostSpec))));\n        }\n\n        public override bool Equals(object hostSpecificationUpdateEvent)\n        {\n            return Equals(hostSpecificationUpdateEvent as HostSpecificationUpdateEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostSpec).GetHashCode();\n        }\n    }\n\n    public class HostSriovConfig : HostPciPassthruConfig, IEquatable<HostSriovConfig>\n    {\n        public bool SriovEnabled { get; set; }\n\n        public int NumVirtualFunction { get; set; }\n\n        public bool Equals(HostSriovConfig hostSriovConfig)\n        {\n            return (hostSriovConfig != null && this.SriovEnabled == hostSriovConfig.SriovEnabled && this.NumVirtualFunction == hostSriovConfig.NumVirtualFunction);\n        }\n\n        public override bool Equals(object hostSriovConfig)\n        {\n            return Equals(hostSriovConfig as HostSriovConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SriovEnabled + \"_\" + NumVirtualFunction).GetHashCode();\n        }\n    }\n\n    public class HostSriovDevicePoolInfo : DynamicData, IEquatable<HostSriovDevicePoolInfo>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(HostSriovDevicePoolInfo hostSriovDevicePoolInfo)\n        {\n            return (hostSriovDevicePoolInfo != null && this.Key == hostSriovDevicePoolInfo.Key);\n        }\n\n        public override bool Equals(object hostSriovDevicePoolInfo)\n        {\n            return Equals(hostSriovDevicePoolInfo as HostSriovDevicePoolInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class HostSriovInfo : HostPciPassthruInfo, IEquatable<HostSriovInfo>\n    {\n        public bool SriovEnabled { get; set; }\n\n        public bool SriovCapable { get; set; }\n\n        public bool SriovActive { get; set; }\n\n        public int NumVirtualFunctionRequested { get; set; }\n\n        public int NumVirtualFunction { get; set; }\n\n        public int MaxVirtualFunctionSupported { get; set; }\n\n        public bool Equals(HostSriovInfo hostSriovInfo)\n        {\n            return (hostSriovInfo != null && this.SriovEnabled == hostSriovInfo.SriovEnabled && this.SriovCapable == hostSriovInfo.SriovCapable && this.SriovActive == hostSriovInfo.SriovActive && this.NumVirtualFunctionRequested == hostSriovInfo.NumVirtualFunctionRequested && this.NumVirtualFunction == hostSriovInfo.NumVirtualFunction && this.MaxVirtualFunctionSupported == hostSriovInfo.MaxVirtualFunctionSupported);\n        }\n\n        public override bool Equals(object hostSriovInfo)\n        {\n            return Equals(hostSriovInfo as HostSriovInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SriovEnabled + \"_\" + SriovCapable + \"_\" + SriovActive + \"_\" + NumVirtualFunctionRequested + \"_\" + NumVirtualFunction + \"_\" + MaxVirtualFunctionSupported).GetHashCode();\n        }\n    }\n\n    public class HostSriovNetworkDevicePoolInfo : HostSriovDevicePoolInfo, IEquatable<HostSriovNetworkDevicePoolInfo>\n    {\n        public string SwitchKey { get; set; }\n\n        public string SwitchUuid { get; set; }\n\n        public PhysicalNic[] Pnic { get; set; }\n\n        public bool Equals(HostSriovNetworkDevicePoolInfo hostSriovNetworkDevicePoolInfo)\n        {\n            return (hostSriovNetworkDevicePoolInfo != null && this.SwitchKey == hostSriovNetworkDevicePoolInfo.SwitchKey && this.SwitchUuid == hostSriovNetworkDevicePoolInfo.SwitchUuid && ((this.Pnic == null && hostSriovNetworkDevicePoolInfo.Pnic == null) || (this.Pnic != null && hostSriovNetworkDevicePoolInfo.Pnic != null && Enumerable.SequenceEqual(this.Pnic, hostSriovNetworkDevicePoolInfo.Pnic))));\n        }\n\n        public override bool Equals(object hostSriovNetworkDevicePoolInfo)\n        {\n            return Equals(hostSriovNetworkDevicePoolInfo as HostSriovNetworkDevicePoolInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchKey + \"_\" + SwitchUuid + \"_\" + Pnic).GetHashCode();\n        }\n    }\n\n    public class HostSslThumbprintInfo : DynamicData, IEquatable<HostSslThumbprintInfo>\n    {\n        public string Principal { get; set; }\n\n        public string OwnerTag { get; set; }\n\n        public string[] SslThumbprints { get; set; }\n\n        public bool Equals(HostSslThumbprintInfo hostSslThumbprintInfo)\n        {\n            return (hostSslThumbprintInfo != null && this.Principal == hostSslThumbprintInfo.Principal && this.OwnerTag == hostSslThumbprintInfo.OwnerTag && ((this.SslThumbprints == null && hostSslThumbprintInfo.SslThumbprints == null) || (this.SslThumbprints != null && hostSslThumbprintInfo.SslThumbprints != null && Enumerable.SequenceEqual(this.SslThumbprints, hostSslThumbprintInfo.SslThumbprints))));\n        }\n\n        public override bool Equals(object hostSslThumbprintInfo)\n        {\n            return Equals(hostSslThumbprintInfo as HostSslThumbprintInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Principal + \"_\" + OwnerTag + \"_\" + SslThumbprints).GetHashCode();\n        }\n    }\n\n    public class HostStatusChangedEvent : ClusterStatusChangedEvent, IEquatable<HostStatusChangedEvent>\n    {\n        public bool Equals(HostStatusChangedEvent hostStatusChangedEvent)\n        {\n            return (hostStatusChangedEvent != null && base.Equals(hostStatusChangedEvent));\n        }\n\n        public override bool Equals(object hostStatusChangedEvent)\n        {\n            return Equals(hostStatusChangedEvent as HostStatusChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostStorageArrayTypePolicyOption : DynamicData, IEquatable<HostStorageArrayTypePolicyOption>\n    {\n        public ElementDescription Policy { get; set; }\n\n        public bool Equals(HostStorageArrayTypePolicyOption hostStorageArrayTypePolicyOption)\n        {\n            return (hostStorageArrayTypePolicyOption != null && ((this.Policy == null && hostStorageArrayTypePolicyOption.Policy == null) || (this.Policy != null && this.Policy.Equals(hostStorageArrayTypePolicyOption.Policy))));\n        }\n\n        public override bool Equals(object hostStorageArrayTypePolicyOption)\n        {\n            return Equals(hostStorageArrayTypePolicyOption as HostStorageArrayTypePolicyOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy).GetHashCode();\n        }\n    }\n\n    public class HostStorageDeviceInfo : DynamicData, IEquatable<HostStorageDeviceInfo>\n    {\n        public HostHostBusAdapter[] HostBusAdapter { get; set; }\n\n        public ScsiLun[] ScsiLun { get; set; }\n\n        public HostScsiTopology ScsiTopology { get; set; }\n\n        public HostMultipathInfo MultipathInfo { get; set; }\n\n        public HostPlugStoreTopology PlugStoreTopology { get; set; }\n\n        public bool SoftwareInternetScsiEnabled { get; set; }\n\n        public bool Equals(HostStorageDeviceInfo hostStorageDeviceInfo)\n        {\n            return (hostStorageDeviceInfo != null && ((this.HostBusAdapter == null && hostStorageDeviceInfo.HostBusAdapter == null) || (this.HostBusAdapter != null && hostStorageDeviceInfo.HostBusAdapter != null && Enumerable.SequenceEqual(this.HostBusAdapter, hostStorageDeviceInfo.HostBusAdapter))) && ((this.ScsiLun == null && hostStorageDeviceInfo.ScsiLun == null) || (this.ScsiLun != null && hostStorageDeviceInfo.ScsiLun != null && Enumerable.SequenceEqual(this.ScsiLun, hostStorageDeviceInfo.ScsiLun))) && ((this.ScsiTopology == null && hostStorageDeviceInfo.ScsiTopology == null) || (this.ScsiTopology != null && this.ScsiTopology.Equals(hostStorageDeviceInfo.ScsiTopology))) && ((this.MultipathInfo == null && hostStorageDeviceInfo.MultipathInfo == null) || (this.MultipathInfo != null && this.MultipathInfo.Equals(hostStorageDeviceInfo.MultipathInfo))) && ((this.PlugStoreTopology == null && hostStorageDeviceInfo.PlugStoreTopology == null) || (this.PlugStoreTopology != null && this.PlugStoreTopology.Equals(hostStorageDeviceInfo.PlugStoreTopology))) && this.SoftwareInternetScsiEnabled == hostStorageDeviceInfo.SoftwareInternetScsiEnabled);\n        }\n\n        public override bool Equals(object hostStorageDeviceInfo)\n        {\n            return Equals(hostStorageDeviceInfo as HostStorageDeviceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostBusAdapter + \"_\" + ScsiLun + \"_\" + ScsiTopology + \"_\" + MultipathInfo + \"_\" + PlugStoreTopology + \"_\" + SoftwareInternetScsiEnabled).GetHashCode();\n        }\n    }\n\n    public class HostStorageElementInfo : HostHardwareElementInfo, IEquatable<HostStorageElementInfo>\n    {\n        public HostStorageOperationalInfo[] OperationalInfo { get; set; }\n\n        public bool Equals(HostStorageElementInfo hostStorageElementInfo)\n        {\n            return (hostStorageElementInfo != null && ((this.OperationalInfo == null && hostStorageElementInfo.OperationalInfo == null) || (this.OperationalInfo != null && hostStorageElementInfo.OperationalInfo != null && Enumerable.SequenceEqual(this.OperationalInfo, hostStorageElementInfo.OperationalInfo))));\n        }\n\n        public override bool Equals(object hostStorageElementInfo)\n        {\n            return Equals(hostStorageElementInfo as HostStorageElementInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OperationalInfo).GetHashCode();\n        }\n    }\n\n    public class HostStorageOperationalInfo : DynamicData, IEquatable<HostStorageOperationalInfo>\n    {\n        public string Property { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(HostStorageOperationalInfo hostStorageOperationalInfo)\n        {\n            return (hostStorageOperationalInfo != null && this.Property == hostStorageOperationalInfo.Property && this.Value == hostStorageOperationalInfo.Value);\n        }\n\n        public override bool Equals(object hostStorageOperationalInfo)\n        {\n            return Equals(hostStorageOperationalInfo as HostStorageOperationalInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Property + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class HostStorageSystem : ExtensibleManagedObject, IEquatable<HostStorageSystem>\n    {\n        public HostStorageDeviceInfo StorageDeviceInfo { get; set; }\n\n        public HostFileSystemVolumeInfo FileSystemVolumeInfo { get; set; }\n\n        public string[] SystemFile { get; set; }\n\n        public HostMultipathStateInfo MultipathStateInfo { get; set; }\n\n        public HostDiskPartitionInfo[] RetrieveDiskPartitionInfo(string[] devicePath)\n        {\n            return default(HostDiskPartitionInfo[]);\n        }\n\n        public HostDiskPartitionInfo ComputeDiskPartitionInfo(string devicePath, HostDiskPartitionLayout layout, string partitionFormat)\n        {\n            return default(HostDiskPartitionInfo);\n        }\n\n        public HostDiskPartitionInfo ComputeDiskPartitionInfoForResize(HostScsiDiskPartition partition, HostDiskPartitionBlockRange blockRange, string partitionFormat)\n        {\n            return default(HostDiskPartitionInfo);\n        }\n\n        public void UpdateDiskPartitions(string devicePath, HostDiskPartitionSpec spec)\n        {\n        }\n\n        public HostVmfsVolume FormatVmfs(HostVmfsSpec createSpec)\n        {\n            return default(HostVmfsVolume);\n        }\n\n        public void MountVmfsVolume(string vmfsUuid)\n        {\n        }\n\n        public void UnmountVmfsVolume(string vmfsUuid)\n        {\n        }\n\n        public ManagedObjectReference UnmountVmfsVolumeEx_Task(string[] vmfsUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemVmfsVolumeResult[] UnmountVmfsVolumeEx(string[] vmfsUuid)\n        {\n            return default(HostStorageSystemVmfsVolumeResult[]);\n        }\n\n        public ManagedObjectReference MountVmfsVolumeEx_Task(string[] vmfsUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemVmfsVolumeResult[] MountVmfsVolumeEx(string[] vmfsUuid)\n        {\n            return default(HostStorageSystemVmfsVolumeResult[]);\n        }\n\n        public ManagedObjectReference UnmapVmfsVolumeEx_Task(string[] vmfsUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemVmfsVolumeResult[] UnmapVmfsVolumeEx(string[] vmfsUuid)\n        {\n            return default(HostStorageSystemVmfsVolumeResult[]);\n        }\n\n        public void DeleteVmfsVolumeState(string vmfsUuid)\n        {\n        }\n\n        public void RescanVmfs()\n        {\n        }\n\n        public void AttachVmfsExtent(string vmfsPath, HostScsiDiskPartition extent)\n        {\n        }\n\n        public void ExpandVmfsExtent(string vmfsPath, HostScsiDiskPartition extent)\n        {\n        }\n\n        public void UpgradeVmfs(string vmfsPath)\n        {\n        }\n\n        public void UpgradeVmLayout()\n        {\n        }\n\n        public HostUnresolvedVmfsVolume[] QueryUnresolvedVmfsVolume()\n        {\n            return default(HostUnresolvedVmfsVolume[]);\n        }\n\n        public HostUnresolvedVmfsResolutionResult[] ResolveMultipleUnresolvedVmfsVolumes(HostUnresolvedVmfsResolutionSpec[] resolutionSpec)\n        {\n            return default(HostUnresolvedVmfsResolutionResult[]);\n        }\n\n        public ManagedObjectReference ResolveMultipleUnresolvedVmfsVolumesEx_Task(HostUnresolvedVmfsResolutionSpec[] resolutionSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostUnresolvedVmfsResolutionResult[] ResolveMultipleUnresolvedVmfsVolumesEx(HostUnresolvedVmfsResolutionSpec[] resolutionSpec)\n        {\n            return default(HostUnresolvedVmfsResolutionResult[]);\n        }\n\n        public void UnmountForceMountedVmfsVolume(string vmfsUuid)\n        {\n        }\n\n        public void RescanHba(string hbaDevice)\n        {\n        }\n\n        public void RescanAllHba()\n        {\n        }\n\n        public void UpdateSoftwareInternetScsiEnabled(bool enabled)\n        {\n        }\n\n        public void UpdateInternetScsiDiscoveryProperties(string iScsiHbaDevice, HostInternetScsiHbaDiscoveryProperties discoveryProperties)\n        {\n        }\n\n        public void UpdateInternetScsiAuthenticationProperties(string iScsiHbaDevice, HostInternetScsiHbaAuthenticationProperties authenticationProperties, HostInternetScsiHbaTargetSet targetSet)\n        {\n        }\n\n        public void UpdateInternetScsiDigestProperties(string iScsiHbaDevice, HostInternetScsiHbaTargetSet targetSet, HostInternetScsiHbaDigestProperties digestProperties)\n        {\n        }\n\n        public void UpdateInternetScsiAdvancedOptions(string iScsiHbaDevice, HostInternetScsiHbaTargetSet targetSet, HostInternetScsiHbaParamValue[] options)\n        {\n        }\n\n        public void UpdateInternetScsiIPProperties(string iScsiHbaDevice, HostInternetScsiHbaIPProperties ipProperties)\n        {\n        }\n\n        public void UpdateInternetScsiName(string iScsiHbaDevice, string iScsiName)\n        {\n        }\n\n        public void UpdateInternetScsiAlias(string iScsiHbaDevice, string iScsiAlias)\n        {\n        }\n\n        public void AddInternetScsiSendTargets(string iScsiHbaDevice, HostInternetScsiHbaSendTarget[] targets)\n        {\n        }\n\n        public void RemoveInternetScsiSendTargets(string iScsiHbaDevice, HostInternetScsiHbaSendTarget[] targets)\n        {\n        }\n\n        public void AddInternetScsiStaticTargets(string iScsiHbaDevice, HostInternetScsiHbaStaticTarget[] targets)\n        {\n        }\n\n        public void RemoveInternetScsiStaticTargets(string iScsiHbaDevice, HostInternetScsiHbaStaticTarget[] targets)\n        {\n        }\n\n        public void EnableMultipathPath(string pathName)\n        {\n        }\n\n        public void DisableMultipathPath(string pathName)\n        {\n        }\n\n        public void SetMultipathLunPolicy(string lunId, HostMultipathInfoLogicalUnitPolicy policy)\n        {\n        }\n\n        public HostPathSelectionPolicyOption[] QueryPathSelectionPolicyOptions()\n        {\n            return default(HostPathSelectionPolicyOption[]);\n        }\n\n        public HostStorageArrayTypePolicyOption[] QueryStorageArrayTypePolicyOptions()\n        {\n            return default(HostStorageArrayTypePolicyOption[]);\n        }\n\n        public void UpdateScsiLunDisplayName(string lunUuid, string displayName)\n        {\n        }\n\n        public void DetachScsiLun(string lunUuid)\n        {\n        }\n\n        public ManagedObjectReference DetachScsiLunEx_Task(string[] lunUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemScsiLunResult[] DetachScsiLunEx(string[] lunUuid)\n        {\n            return default(HostStorageSystemScsiLunResult[]);\n        }\n\n        public void DeleteScsiLunState(string lunCanonicalName)\n        {\n        }\n\n        public void AttachScsiLun(string lunUuid)\n        {\n        }\n\n        public ManagedObjectReference AttachScsiLunEx_Task(string[] lunUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemScsiLunResult[] AttachScsiLunEx(string[] lunUuid)\n        {\n            return default(HostStorageSystemScsiLunResult[]);\n        }\n\n        public void RefreshStorageSystem()\n        {\n        }\n\n        public void DiscoverFcoeHbas(FcoeConfigFcoeSpecification fcoeSpec)\n        {\n        }\n\n        public void MarkForRemoval(string hbaName, bool remove)\n        {\n        }\n\n        public HostVffsVolume FormatVffs(HostVffsSpec createSpec)\n        {\n            return default(HostVffsVolume);\n        }\n\n        public void ExtendVffs(string vffsPath, string devicePath, HostDiskPartitionSpec spec)\n        {\n        }\n\n        public void DestroyVffs(string vffsPath)\n        {\n        }\n\n        public void MountVffsVolume(string vffsUuid)\n        {\n        }\n\n        public void UnmountVffsVolume(string vffsUuid)\n        {\n        }\n\n        public void DeleteVffsVolumeState(string vffsUuid)\n        {\n        }\n\n        public void RescanVffs()\n        {\n        }\n\n        public HostScsiDisk[] QueryAvailableSsds(string vffsPath)\n        {\n            return default(HostScsiDisk[]);\n        }\n\n        public void SetNFSUser(string user, string password)\n        {\n        }\n\n        public void ChangeNFSUserPassword(string password)\n        {\n        }\n\n        public HostNasVolumeUserInfo QueryNFSUser()\n        {\n            return default(HostNasVolumeUserInfo);\n        }\n\n        public void ClearNFSUser()\n        {\n        }\n\n        public ManagedObjectReference TurnDiskLocatorLedOn_Task(string[] scsiDiskUuids)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemDiskLocatorLedResult[] TurnDiskLocatorLedOn(string[] scsiDiskUuids)\n        {\n            return default(HostStorageSystemDiskLocatorLedResult[]);\n        }\n\n        public ManagedObjectReference TurnDiskLocatorLedOff_Task(string[] scsiDiskUuids)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostStorageSystemDiskLocatorLedResult[] TurnDiskLocatorLedOff(string[] scsiDiskUuids)\n        {\n            return default(HostStorageSystemDiskLocatorLedResult[]);\n        }\n\n        public ManagedObjectReference MarkAsSsd_Task(string scsiDiskUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MarkAsSsd(string scsiDiskUuid)\n        {\n        }\n\n        public ManagedObjectReference MarkAsNonSsd_Task(string scsiDiskUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MarkAsNonSsd(string scsiDiskUuid)\n        {\n        }\n\n        public ManagedObjectReference MarkAsLocal_Task(string scsiDiskUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MarkAsLocal(string scsiDiskUuid)\n        {\n        }\n\n        public ManagedObjectReference MarkAsNonLocal_Task(string scsiDiskUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MarkAsNonLocal(string scsiDiskUuid)\n        {\n        }\n\n        public void UpdateVmfsUnmapPriority(string vmfsUuid, string unmapPriority)\n        {\n        }\n\n        public void UpdateVmfsUnmapBandwidth(string vmfsUuid, VmfsUnmapBandwidthSpec unmapBandwidthSpec)\n        {\n        }\n\n        public VmfsConfigOption[] QueryVmfsConfigOption()\n        {\n            return default(VmfsConfigOption[]);\n        }\n\n        public bool Equals(HostStorageSystem hostStorageSystem)\n        {\n            return (hostStorageSystem != null && ((this.StorageDeviceInfo == null && hostStorageSystem.StorageDeviceInfo == null) || (this.StorageDeviceInfo != null && this.StorageDeviceInfo.Equals(hostStorageSystem.StorageDeviceInfo))) && ((this.FileSystemVolumeInfo == null && hostStorageSystem.FileSystemVolumeInfo == null) || (this.FileSystemVolumeInfo != null && this.FileSystemVolumeInfo.Equals(hostStorageSystem.FileSystemVolumeInfo))) && ((this.SystemFile == null && hostStorageSystem.SystemFile == null) || (this.SystemFile != null && hostStorageSystem.SystemFile != null && Enumerable.SequenceEqual(this.SystemFile, hostStorageSystem.SystemFile))) && ((this.MultipathStateInfo == null && hostStorageSystem.MultipathStateInfo == null) || (this.MultipathStateInfo != null && this.MultipathStateInfo.Equals(hostStorageSystem.MultipathStateInfo))));\n        }\n\n        public override bool Equals(object hostStorageSystem)\n        {\n            return Equals(hostStorageSystem as HostStorageSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StorageDeviceInfo + \"_\" + FileSystemVolumeInfo + \"_\" + SystemFile + \"_\" + MultipathStateInfo).GetHashCode();\n        }\n    }\n\n    public class HostStorageSystemDiskLocatorLedResult : DynamicData, IEquatable<HostStorageSystemDiskLocatorLedResult>\n    {\n        public string Key { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(HostStorageSystemDiskLocatorLedResult hostStorageSystemDiskLocatorLedResult)\n        {\n            return (hostStorageSystemDiskLocatorLedResult != null && this.Key == hostStorageSystemDiskLocatorLedResult.Key && ((this.Fault == null && hostStorageSystemDiskLocatorLedResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostStorageSystemDiskLocatorLedResult.Fault))));\n        }\n\n        public override bool Equals(object hostStorageSystemDiskLocatorLedResult)\n        {\n            return Equals(hostStorageSystemDiskLocatorLedResult as HostStorageSystemDiskLocatorLedResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class HostStorageSystemScsiLunResult : DynamicData, IEquatable<HostStorageSystemScsiLunResult>\n    {\n        public string Key { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(HostStorageSystemScsiLunResult hostStorageSystemScsiLunResult)\n        {\n            return (hostStorageSystemScsiLunResult != null && this.Key == hostStorageSystemScsiLunResult.Key && ((this.Fault == null && hostStorageSystemScsiLunResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostStorageSystemScsiLunResult.Fault))));\n        }\n\n        public override bool Equals(object hostStorageSystemScsiLunResult)\n        {\n            return Equals(hostStorageSystemScsiLunResult as HostStorageSystemScsiLunResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class HostStorageSystemVmfsVolumeResult : DynamicData, IEquatable<HostStorageSystemVmfsVolumeResult>\n    {\n        public string Key { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(HostStorageSystemVmfsVolumeResult hostStorageSystemVmfsVolumeResult)\n        {\n            return (hostStorageSystemVmfsVolumeResult != null && this.Key == hostStorageSystemVmfsVolumeResult.Key && ((this.Fault == null && hostStorageSystemVmfsVolumeResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostStorageSystemVmfsVolumeResult.Fault))));\n        }\n\n        public override bool Equals(object hostStorageSystemVmfsVolumeResult)\n        {\n            return Equals(hostStorageSystemVmfsVolumeResult as HostStorageSystemVmfsVolumeResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class HostSubSpecification : DynamicData, IEquatable<HostSubSpecification>\n    {\n        public string Name { get; set; }\n\n        public DateTime CreatedTime { get; set; }\n\n        public sbyte[] Data { get; set; }\n\n        public byte[] BinaryData { get; set; }\n\n        public bool Equals(HostSubSpecification hostSubSpecification)\n        {\n            return (hostSubSpecification != null && this.Name == hostSubSpecification.Name && this.CreatedTime == hostSubSpecification.CreatedTime && ((this.Data == null && hostSubSpecification.Data == null) || (this.Data != null && hostSubSpecification.Data != null && Enumerable.SequenceEqual(this.Data, hostSubSpecification.Data))) && ((this.BinaryData == null && hostSubSpecification.BinaryData == null) || (this.BinaryData != null && hostSubSpecification.BinaryData != null && Enumerable.SequenceEqual(this.BinaryData, hostSubSpecification.BinaryData))));\n        }\n\n        public override bool Equals(object hostSubSpecification)\n        {\n            return Equals(hostSubSpecification as HostSubSpecification);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + CreatedTime + \"_\" + Data + \"_\" + BinaryData).GetHashCode();\n        }\n    }\n\n    public class HostSubSpecificationDeleteEvent : HostEvent, IEquatable<HostSubSpecificationDeleteEvent>\n    {\n        public string SubSpecName { get; set; }\n\n        public bool Equals(HostSubSpecificationDeleteEvent hostSubSpecificationDeleteEvent)\n        {\n            return (hostSubSpecificationDeleteEvent != null && this.SubSpecName == hostSubSpecificationDeleteEvent.SubSpecName);\n        }\n\n        public override bool Equals(object hostSubSpecificationDeleteEvent)\n        {\n            return Equals(hostSubSpecificationDeleteEvent as HostSubSpecificationDeleteEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SubSpecName).GetHashCode();\n        }\n    }\n\n    public class HostSubSpecificationUpdateEvent : HostEvent, IEquatable<HostSubSpecificationUpdateEvent>\n    {\n        public HostSubSpecification HostSubSpec { get; set; }\n\n        public bool Equals(HostSubSpecificationUpdateEvent hostSubSpecificationUpdateEvent)\n        {\n            return (hostSubSpecificationUpdateEvent != null && ((this.HostSubSpec == null && hostSubSpecificationUpdateEvent.HostSubSpec == null) || (this.HostSubSpec != null && this.HostSubSpec.Equals(hostSubSpecificationUpdateEvent.HostSubSpec))));\n        }\n\n        public override bool Equals(object hostSubSpecificationUpdateEvent)\n        {\n            return Equals(hostSubSpecificationUpdateEvent as HostSubSpecificationUpdateEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostSubSpec).GetHashCode();\n        }\n    }\n\n    public class HostSyncFailedEvent : HostEvent, IEquatable<HostSyncFailedEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(HostSyncFailedEvent hostSyncFailedEvent)\n        {\n            return (hostSyncFailedEvent != null && ((this.Reason == null && hostSyncFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(hostSyncFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object hostSyncFailedEvent)\n        {\n            return Equals(hostSyncFailedEvent as HostSyncFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class HostSystem : ManagedEntity, IEquatable<HostSystem>\n    {\n        public HostRuntimeInfo Runtime { get; set; }\n\n        public HostListSummary Summary { get; set; }\n\n        public HostHardwareInfo Hardware { get; set; }\n\n        public HostCapability Capability { get; set; }\n\n        public HostLicensableResourceInfo LicensableResource { get; set; }\n\n        public HostSystemRemediationState RemediationState { get; set; }\n\n        public ApplyHostProfileConfigurationSpec PrecheckRemediationResult { get; set; }\n\n        public ApplyHostProfileConfigurationResult RemediationResult { get; set; }\n\n        public HostSystemComplianceCheckState ComplianceCheckState { get; set; }\n\n        public ComplianceResult ComplianceCheckResult { get; set; }\n\n        public HostConfigManager ConfigManager { get; set; }\n\n        public HostConfigInfo Config { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public ManagedObjectReference[] Network { get; set; }\n\n        public ManagedObjectReference DatastoreBrowser { get; set; }\n\n        public HostSystemResourceInfo SystemResources { get; set; }\n\n        public AnswerFileStatusResult AnswerFileValidationState { get; set; }\n\n        public AnswerFileStatusResult AnswerFileValidationResult { get; set; }\n\n        public new HostSystem_LinkedView LinkedView { get; set; }\n\n        public HostTpmAttestationReport QueryTpmAttestationReport()\n        {\n            return default(HostTpmAttestationReport);\n        }\n\n        public HostConnectInfo QueryHostConnectionInfo()\n        {\n            return default(HostConnectInfo);\n        }\n\n        public void UpdateSystemResources(HostSystemResourceInfo resourceInfo)\n        {\n        }\n\n        public void UpdateSystemSwapConfiguration(HostSystemSwapConfiguration sysSwapConfig)\n        {\n        }\n\n        public ManagedObjectReference ReconnectHost_Task(HostConnectSpec cnxSpec, HostSystemReconnectSpec reconnectSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconnectHost(HostConnectSpec cnxSpec, HostSystemReconnectSpec reconnectSpec)\n        {\n        }\n\n        public ManagedObjectReference DisconnectHost_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DisconnectHost()\n        {\n        }\n\n        public ManagedObjectReference EnterMaintenanceMode_Task(int timeout, bool? evacuatePoweredOffVms, HostMaintenanceSpec maintenanceSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void EnterMaintenanceMode(int timeout, bool? evacuatePoweredOffVms, HostMaintenanceSpec maintenanceSpec)\n        {\n        }\n\n        public ManagedObjectReference ExitMaintenanceMode_Task(int timeout)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ExitMaintenanceMode(int timeout)\n        {\n        }\n\n        public ManagedObjectReference RebootHost_Task(bool force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RebootHost(bool force)\n        {\n        }\n\n        public ManagedObjectReference ShutdownHost_Task(bool force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ShutdownHost(bool force)\n        {\n        }\n\n        public ManagedObjectReference PowerDownHostToStandBy_Task(int timeoutSec, bool? evacuatePoweredOffVms)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PowerDownHostToStandBy(int timeoutSec, bool? evacuatePoweredOffVms)\n        {\n        }\n\n        public ManagedObjectReference PowerUpHostFromStandBy_Task(int timeoutSec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PowerUpHostFromStandBy(int timeoutSec)\n        {\n        }\n\n        public long QueryMemoryOverhead(long memorySize, int? videoRamSize, int numVcpus)\n        {\n            return default(long);\n        }\n\n        public long QueryMemoryOverheadEx(VirtualMachineConfigInfo vmConfigInfo)\n        {\n            return default(long);\n        }\n\n        public ManagedObjectReference ReconfigureHostForDAS_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigureHostForDAS()\n        {\n        }\n\n        public void UpdateFlags(HostFlagInfo flagInfo)\n        {\n        }\n\n        public void EnterLockdownMode()\n        {\n        }\n\n        public void ExitLockdownMode()\n        {\n        }\n\n        public HostServiceTicket AcquireCimServicesTicket()\n        {\n            return default(HostServiceTicket);\n        }\n\n        public void UpdateIpmi(HostIpmiInfo ipmiInfo)\n        {\n        }\n\n        public long RetrieveHardwareUptime()\n        {\n            return default(long);\n        }\n\n        public void PrepareCrypto()\n        {\n        }\n\n        public void EnableCrypto(CryptoKeyPlain keyPlain)\n        {\n        }\n\n        public void ConfigureCryptoKey(CryptoKeyId keyId)\n        {\n        }\n\n        public string QueryProductLockerLocation()\n        {\n            return default(string);\n        }\n\n        public ManagedObjectReference UpdateProductLockerLocation_Task(string path)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public string UpdateProductLockerLocation(string path)\n        {\n            return default(string);\n        }\n\n        public bool Equals(HostSystem hostSystem)\n        {\n            return (hostSystem != null && ((this.Runtime == null && hostSystem.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(hostSystem.Runtime))) && ((this.Summary == null && hostSystem.Summary == null) || (this.Summary != null && this.Summary.Equals(hostSystem.Summary))) && ((this.Hardware == null && hostSystem.Hardware == null) || (this.Hardware != null && this.Hardware.Equals(hostSystem.Hardware))) && ((this.Capability == null && hostSystem.Capability == null) || (this.Capability != null && this.Capability.Equals(hostSystem.Capability))) && ((this.LicensableResource == null && hostSystem.LicensableResource == null) || (this.LicensableResource != null && this.LicensableResource.Equals(hostSystem.LicensableResource))) && ((this.RemediationState == null && hostSystem.RemediationState == null) || (this.RemediationState != null && this.RemediationState.Equals(hostSystem.RemediationState))) && ((this.PrecheckRemediationResult == null && hostSystem.PrecheckRemediationResult == null) || (this.PrecheckRemediationResult != null && this.PrecheckRemediationResult.Equals(hostSystem.PrecheckRemediationResult))) && ((this.RemediationResult == null && hostSystem.RemediationResult == null) || (this.RemediationResult != null && this.RemediationResult.Equals(hostSystem.RemediationResult))) && ((this.ComplianceCheckState == null && hostSystem.ComplianceCheckState == null) || (this.ComplianceCheckState != null && this.ComplianceCheckState.Equals(hostSystem.ComplianceCheckState))) && ((this.ComplianceCheckResult == null && hostSystem.ComplianceCheckResult == null) || (this.ComplianceCheckResult != null && this.ComplianceCheckResult.Equals(hostSystem.ComplianceCheckResult))) && ((this.ConfigManager == null && hostSystem.ConfigManager == null) || (this.ConfigManager != null && this.ConfigManager.Equals(hostSystem.ConfigManager))) && ((this.Config == null && hostSystem.Config == null) || (this.Config != null && this.Config.Equals(hostSystem.Config))) && ((this.Vm == null && hostSystem.Vm == null) || (this.Vm != null && hostSystem.Vm != null && Enumerable.SequenceEqual(this.Vm, hostSystem.Vm))) && ((this.Datastore == null && hostSystem.Datastore == null) || (this.Datastore != null && hostSystem.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostSystem.Datastore))) && ((this.Network == null && hostSystem.Network == null) || (this.Network != null && hostSystem.Network != null && Enumerable.SequenceEqual(this.Network, hostSystem.Network))) && ((this.DatastoreBrowser == null && hostSystem.DatastoreBrowser == null) || (this.DatastoreBrowser != null && this.DatastoreBrowser.Equals(hostSystem.DatastoreBrowser))) && ((this.SystemResources == null && hostSystem.SystemResources == null) || (this.SystemResources != null && this.SystemResources.Equals(hostSystem.SystemResources))) && ((this.AnswerFileValidationState == null && hostSystem.AnswerFileValidationState == null) || (this.AnswerFileValidationState != null && this.AnswerFileValidationState.Equals(hostSystem.AnswerFileValidationState))) && ((this.AnswerFileValidationResult == null && hostSystem.AnswerFileValidationResult == null) || (this.AnswerFileValidationResult != null && this.AnswerFileValidationResult.Equals(hostSystem.AnswerFileValidationResult))) && ((this.LinkedView == null && hostSystem.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostSystem.LinkedView))));\n        }\n\n        public override bool Equals(object hostSystem)\n        {\n            return Equals(hostSystem as HostSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Runtime + \"_\" + Summary + \"_\" + Hardware + \"_\" + Capability + \"_\" + LicensableResource + \"_\" + RemediationState + \"_\" + PrecheckRemediationResult + \"_\" + RemediationResult + \"_\" + ComplianceCheckState + \"_\" + ComplianceCheckResult + \"_\" + ConfigManager + \"_\" + Config + \"_\" + Vm + \"_\" + Datastore + \"_\" + Network + \"_\" + DatastoreBrowser + \"_\" + SystemResources + \"_\" + AnswerFileValidationState + \"_\" + AnswerFileValidationResult + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostSystem_LinkedView : ManagedEntity_LinkedView, IEquatable<HostSystem_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public Datastore[] Datastore { get; set; }\n\n        public Network[] Network { get; set; }\n\n        public HostDatastoreBrowser DatastoreBrowser { get; set; }\n\n        public bool Equals(HostSystem_LinkedView hostSystem_LinkedView)\n        {\n            return (hostSystem_LinkedView != null && ((this.Vm == null && hostSystem_LinkedView.Vm == null) || (this.Vm != null && hostSystem_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, hostSystem_LinkedView.Vm))) && ((this.Datastore == null && hostSystem_LinkedView.Datastore == null) || (this.Datastore != null && hostSystem_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, hostSystem_LinkedView.Datastore))) && ((this.Network == null && hostSystem_LinkedView.Network == null) || (this.Network != null && hostSystem_LinkedView.Network != null && Enumerable.SequenceEqual(this.Network, hostSystem_LinkedView.Network))) && ((this.DatastoreBrowser == null && hostSystem_LinkedView.DatastoreBrowser == null) || (this.DatastoreBrowser != null && this.DatastoreBrowser.Equals(hostSystem_LinkedView.DatastoreBrowser))));\n        }\n\n        public override bool Equals(object hostSystem_LinkedView)\n        {\n            return Equals(hostSystem_LinkedView as HostSystem_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Datastore + \"_\" + Network + \"_\" + DatastoreBrowser).GetHashCode();\n        }\n    }\n\n    public class HostSystemComplianceCheckState : DynamicData, IEquatable<HostSystemComplianceCheckState>\n    {\n        public string State { get; set; }\n\n        public DateTime CheckTime { get; set; }\n\n        public bool Equals(HostSystemComplianceCheckState hostSystemComplianceCheckState)\n        {\n            return (hostSystemComplianceCheckState != null && this.State == hostSystemComplianceCheckState.State && this.CheckTime == hostSystemComplianceCheckState.CheckTime);\n        }\n\n        public override bool Equals(object hostSystemComplianceCheckState)\n        {\n            return Equals(hostSystemComplianceCheckState as HostSystemComplianceCheckState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + CheckTime).GetHashCode();\n        }\n    }\n\n    public class HostSystemHealthInfo : DynamicData, IEquatable<HostSystemHealthInfo>\n    {\n        public HostNumericSensorInfo[] NumericSensorInfo { get; set; }\n\n        public bool Equals(HostSystemHealthInfo hostSystemHealthInfo)\n        {\n            return (hostSystemHealthInfo != null && ((this.NumericSensorInfo == null && hostSystemHealthInfo.NumericSensorInfo == null) || (this.NumericSensorInfo != null && hostSystemHealthInfo.NumericSensorInfo != null && Enumerable.SequenceEqual(this.NumericSensorInfo, hostSystemHealthInfo.NumericSensorInfo))));\n        }\n\n        public override bool Equals(object hostSystemHealthInfo)\n        {\n            return Equals(hostSystemHealthInfo as HostSystemHealthInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumericSensorInfo).GetHashCode();\n        }\n    }\n\n    public class HostSystemIdentificationInfo : DynamicData, IEquatable<HostSystemIdentificationInfo>\n    {\n        public string IdentifierValue { get; set; }\n\n        public ElementDescription IdentifierType { get; set; }\n\n        public bool Equals(HostSystemIdentificationInfo hostSystemIdentificationInfo)\n        {\n            return (hostSystemIdentificationInfo != null && this.IdentifierValue == hostSystemIdentificationInfo.IdentifierValue && ((this.IdentifierType == null && hostSystemIdentificationInfo.IdentifierType == null) || (this.IdentifierType != null && this.IdentifierType.Equals(hostSystemIdentificationInfo.IdentifierType))));\n        }\n\n        public override bool Equals(object hostSystemIdentificationInfo)\n        {\n            return Equals(hostSystemIdentificationInfo as HostSystemIdentificationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IdentifierValue + \"_\" + IdentifierType).GetHashCode();\n        }\n    }\n\n    public class HostSystemInfo : DynamicData, IEquatable<HostSystemInfo>\n    {\n        public string Vendor { get; set; }\n\n        public string Model { get; set; }\n\n        public string Uuid { get; set; }\n\n        public HostSystemIdentificationInfo[] OtherIdentifyingInfo { get; set; }\n\n        public string SerialNumber { get; set; }\n\n        public bool Equals(HostSystemInfo hostSystemInfo)\n        {\n            return (hostSystemInfo != null && this.Vendor == hostSystemInfo.Vendor && this.Model == hostSystemInfo.Model && this.Uuid == hostSystemInfo.Uuid && ((this.OtherIdentifyingInfo == null && hostSystemInfo.OtherIdentifyingInfo == null) || (this.OtherIdentifyingInfo != null && hostSystemInfo.OtherIdentifyingInfo != null && Enumerable.SequenceEqual(this.OtherIdentifyingInfo, hostSystemInfo.OtherIdentifyingInfo))) && this.SerialNumber == hostSystemInfo.SerialNumber);\n        }\n\n        public override bool Equals(object hostSystemInfo)\n        {\n            return Equals(hostSystemInfo as HostSystemInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vendor + \"_\" + Model + \"_\" + Uuid + \"_\" + OtherIdentifyingInfo + \"_\" + SerialNumber).GetHashCode();\n        }\n    }\n\n    public class HostSystemReconnectSpec : DynamicData, IEquatable<HostSystemReconnectSpec>\n    {\n        public bool? SyncState { get; set; }\n\n        public bool Equals(HostSystemReconnectSpec hostSystemReconnectSpec)\n        {\n            return (hostSystemReconnectSpec != null && ((this.SyncState == null && hostSystemReconnectSpec.SyncState == null) || (this.SyncState != null && this.SyncState.Equals(hostSystemReconnectSpec.SyncState))));\n        }\n\n        public override bool Equals(object hostSystemReconnectSpec)\n        {\n            return Equals(hostSystemReconnectSpec as HostSystemReconnectSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SyncState).GetHashCode();\n        }\n    }\n\n    public class HostSystemRemediationState : DynamicData, IEquatable<HostSystemRemediationState>\n    {\n        public string State { get; set; }\n\n        public DateTime OperationTime { get; set; }\n\n        public bool Equals(HostSystemRemediationState hostSystemRemediationState)\n        {\n            return (hostSystemRemediationState != null && this.State == hostSystemRemediationState.State && this.OperationTime == hostSystemRemediationState.OperationTime);\n        }\n\n        public override bool Equals(object hostSystemRemediationState)\n        {\n            return Equals(hostSystemRemediationState as HostSystemRemediationState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + OperationTime).GetHashCode();\n        }\n    }\n\n    public class HostSystemResourceInfo : DynamicData, IEquatable<HostSystemResourceInfo>\n    {\n        public string Key { get; set; }\n\n        public ResourceConfigSpec Config { get; set; }\n\n        public HostSystemResourceInfo[] Child { get; set; }\n\n        public bool Equals(HostSystemResourceInfo hostSystemResourceInfo)\n        {\n            return (hostSystemResourceInfo != null && this.Key == hostSystemResourceInfo.Key && ((this.Config == null && hostSystemResourceInfo.Config == null) || (this.Config != null && this.Config.Equals(hostSystemResourceInfo.Config))) && ((this.Child == null && hostSystemResourceInfo.Child == null) || (this.Child != null && hostSystemResourceInfo.Child != null && Enumerable.SequenceEqual(this.Child, hostSystemResourceInfo.Child))));\n        }\n\n        public override bool Equals(object hostSystemResourceInfo)\n        {\n            return Equals(hostSystemResourceInfo as HostSystemResourceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Config + \"_\" + Child).GetHashCode();\n        }\n    }\n\n    public class HostSystemSwapConfiguration : DynamicData, IEquatable<HostSystemSwapConfiguration>\n    {\n        public HostSystemSwapConfigurationSystemSwapOption[] Option { get; set; }\n\n        public bool Equals(HostSystemSwapConfiguration hostSystemSwapConfiguration)\n        {\n            return (hostSystemSwapConfiguration != null && ((this.Option == null && hostSystemSwapConfiguration.Option == null) || (this.Option != null && hostSystemSwapConfiguration.Option != null && Enumerable.SequenceEqual(this.Option, hostSystemSwapConfiguration.Option))));\n        }\n\n        public override bool Equals(object hostSystemSwapConfiguration)\n        {\n            return Equals(hostSystemSwapConfiguration as HostSystemSwapConfiguration);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Option).GetHashCode();\n        }\n    }\n\n    public class HostSystemSwapConfigurationDatastoreOption : HostSystemSwapConfigurationSystemSwapOption, IEquatable<HostSystemSwapConfigurationDatastoreOption>\n    {\n        public string Datastore { get; set; }\n\n        public bool Equals(HostSystemSwapConfigurationDatastoreOption hostSystemSwapConfigurationDatastoreOption)\n        {\n            return (hostSystemSwapConfigurationDatastoreOption != null && this.Datastore == hostSystemSwapConfigurationDatastoreOption.Datastore);\n        }\n\n        public override bool Equals(object hostSystemSwapConfigurationDatastoreOption)\n        {\n            return Equals(hostSystemSwapConfigurationDatastoreOption as HostSystemSwapConfigurationDatastoreOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class HostSystemSwapConfigurationDisabledOption : HostSystemSwapConfigurationSystemSwapOption, IEquatable<HostSystemSwapConfigurationDisabledOption>\n    {\n        public bool Equals(HostSystemSwapConfigurationDisabledOption hostSystemSwapConfigurationDisabledOption)\n        {\n            return (hostSystemSwapConfigurationDisabledOption != null && base.Equals(hostSystemSwapConfigurationDisabledOption));\n        }\n\n        public override bool Equals(object hostSystemSwapConfigurationDisabledOption)\n        {\n            return Equals(hostSystemSwapConfigurationDisabledOption as HostSystemSwapConfigurationDisabledOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostSystemSwapConfigurationHostCacheOption : HostSystemSwapConfigurationSystemSwapOption, IEquatable<HostSystemSwapConfigurationHostCacheOption>\n    {\n        public bool Equals(HostSystemSwapConfigurationHostCacheOption hostSystemSwapConfigurationHostCacheOption)\n        {\n            return (hostSystemSwapConfigurationHostCacheOption != null && base.Equals(hostSystemSwapConfigurationHostCacheOption));\n        }\n\n        public override bool Equals(object hostSystemSwapConfigurationHostCacheOption)\n        {\n            return Equals(hostSystemSwapConfigurationHostCacheOption as HostSystemSwapConfigurationHostCacheOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostSystemSwapConfigurationHostLocalSwapOption : HostSystemSwapConfigurationSystemSwapOption, IEquatable<HostSystemSwapConfigurationHostLocalSwapOption>\n    {\n        public bool Equals(HostSystemSwapConfigurationHostLocalSwapOption hostSystemSwapConfigurationHostLocalSwapOption)\n        {\n            return (hostSystemSwapConfigurationHostLocalSwapOption != null && base.Equals(hostSystemSwapConfigurationHostLocalSwapOption));\n        }\n\n        public override bool Equals(object hostSystemSwapConfigurationHostLocalSwapOption)\n        {\n            return Equals(hostSystemSwapConfigurationHostLocalSwapOption as HostSystemSwapConfigurationHostLocalSwapOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostSystemSwapConfigurationSystemSwapOption : DynamicData, IEquatable<HostSystemSwapConfigurationSystemSwapOption>\n    {\n        public int Key { get; set; }\n\n        public bool Equals(HostSystemSwapConfigurationSystemSwapOption hostSystemSwapConfigurationSystemSwapOption)\n        {\n            return (hostSystemSwapConfigurationSystemSwapOption != null && this.Key == hostSystemSwapConfigurationSystemSwapOption.Key);\n        }\n\n        public override bool Equals(object hostSystemSwapConfigurationSystemSwapOption)\n        {\n            return Equals(hostSystemSwapConfigurationSystemSwapOption as HostSystemSwapConfigurationSystemSwapOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class HostTargetTransport : DynamicData, IEquatable<HostTargetTransport>\n    {\n        public bool Equals(HostTargetTransport hostTargetTransport)\n        {\n            return (hostTargetTransport != null && base.Equals(hostTargetTransport));\n        }\n\n        public override bool Equals(object hostTargetTransport)\n        {\n            return Equals(hostTargetTransport as HostTargetTransport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostTpmAttestationInfo : DynamicData, IEquatable<HostTpmAttestationInfo>\n    {\n        public DateTime Time { get; set; }\n\n        public HostTpmAttestationInfoAcceptanceStatus Status { get; set; }\n\n        public LocalizableMessage Message { get; set; }\n\n        public bool Equals(HostTpmAttestationInfo hostTpmAttestationInfo)\n        {\n            return (hostTpmAttestationInfo != null && this.Time == hostTpmAttestationInfo.Time && this.Status == hostTpmAttestationInfo.Status && ((this.Message == null && hostTpmAttestationInfo.Message == null) || (this.Message != null && this.Message.Equals(hostTpmAttestationInfo.Message))));\n        }\n\n        public override bool Equals(object hostTpmAttestationInfo)\n        {\n            return Equals(hostTpmAttestationInfo as HostTpmAttestationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Time + \"_\" + Status + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class HostTpmAttestationReport : DynamicData, IEquatable<HostTpmAttestationReport>\n    {\n        public HostTpmDigestInfo[] TpmPcrValues { get; set; }\n\n        public HostTpmEventLogEntry[] TpmEvents { get; set; }\n\n        public bool TpmLogReliable { get; set; }\n\n        public bool Equals(HostTpmAttestationReport hostTpmAttestationReport)\n        {\n            return (hostTpmAttestationReport != null && ((this.TpmPcrValues == null && hostTpmAttestationReport.TpmPcrValues == null) || (this.TpmPcrValues != null && hostTpmAttestationReport.TpmPcrValues != null && Enumerable.SequenceEqual(this.TpmPcrValues, hostTpmAttestationReport.TpmPcrValues))) && ((this.TpmEvents == null && hostTpmAttestationReport.TpmEvents == null) || (this.TpmEvents != null && hostTpmAttestationReport.TpmEvents != null && Enumerable.SequenceEqual(this.TpmEvents, hostTpmAttestationReport.TpmEvents))) && this.TpmLogReliable == hostTpmAttestationReport.TpmLogReliable);\n        }\n\n        public override bool Equals(object hostTpmAttestationReport)\n        {\n            return Equals(hostTpmAttestationReport as HostTpmAttestationReport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TpmPcrValues + \"_\" + TpmEvents + \"_\" + TpmLogReliable).GetHashCode();\n        }\n    }\n\n    public class HostTpmBootSecurityOptionEventDetails : HostTpmEventDetails, IEquatable<HostTpmBootSecurityOptionEventDetails>\n    {\n        public string BootSecurityOption { get; set; }\n\n        public bool Equals(HostTpmBootSecurityOptionEventDetails hostTpmBootSecurityOptionEventDetails)\n        {\n            return (hostTpmBootSecurityOptionEventDetails != null && this.BootSecurityOption == hostTpmBootSecurityOptionEventDetails.BootSecurityOption);\n        }\n\n        public override bool Equals(object hostTpmBootSecurityOptionEventDetails)\n        {\n            return Equals(hostTpmBootSecurityOptionEventDetails as HostTpmBootSecurityOptionEventDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BootSecurityOption).GetHashCode();\n        }\n    }\n\n    public class HostTpmCommandEventDetails : HostTpmEventDetails, IEquatable<HostTpmCommandEventDetails>\n    {\n        public string CommandLine { get; set; }\n\n        public bool Equals(HostTpmCommandEventDetails hostTpmCommandEventDetails)\n        {\n            return (hostTpmCommandEventDetails != null && this.CommandLine == hostTpmCommandEventDetails.CommandLine);\n        }\n\n        public override bool Equals(object hostTpmCommandEventDetails)\n        {\n            return Equals(hostTpmCommandEventDetails as HostTpmCommandEventDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CommandLine).GetHashCode();\n        }\n    }\n\n    public class HostTpmDigestInfo : HostDigestInfo, IEquatable<HostTpmDigestInfo>\n    {\n        public int PcrNumber { get; set; }\n\n        public bool Equals(HostTpmDigestInfo hostTpmDigestInfo)\n        {\n            return (hostTpmDigestInfo != null && this.PcrNumber == hostTpmDigestInfo.PcrNumber);\n        }\n\n        public override bool Equals(object hostTpmDigestInfo)\n        {\n            return Equals(hostTpmDigestInfo as HostTpmDigestInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PcrNumber).GetHashCode();\n        }\n    }\n\n    public class HostTpmEventDetails : DynamicData, IEquatable<HostTpmEventDetails>\n    {\n        public sbyte[] DataHash { get; set; }\n\n        public string DataHashMethod { get; set; }\n\n        public bool Equals(HostTpmEventDetails hostTpmEventDetails)\n        {\n            return (hostTpmEventDetails != null && ((this.DataHash == null && hostTpmEventDetails.DataHash == null) || (this.DataHash != null && hostTpmEventDetails.DataHash != null && Enumerable.SequenceEqual(this.DataHash, hostTpmEventDetails.DataHash))) && this.DataHashMethod == hostTpmEventDetails.DataHashMethod);\n        }\n\n        public override bool Equals(object hostTpmEventDetails)\n        {\n            return Equals(hostTpmEventDetails as HostTpmEventDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DataHash + \"_\" + DataHashMethod).GetHashCode();\n        }\n    }\n\n    public class HostTpmEventLogEntry : DynamicData, IEquatable<HostTpmEventLogEntry>\n    {\n        public int PcrIndex { get; set; }\n\n        public HostTpmEventDetails EventDetails { get; set; }\n\n        public bool Equals(HostTpmEventLogEntry hostTpmEventLogEntry)\n        {\n            return (hostTpmEventLogEntry != null && this.PcrIndex == hostTpmEventLogEntry.PcrIndex && ((this.EventDetails == null && hostTpmEventLogEntry.EventDetails == null) || (this.EventDetails != null && this.EventDetails.Equals(hostTpmEventLogEntry.EventDetails))));\n        }\n\n        public override bool Equals(object hostTpmEventLogEntry)\n        {\n            return Equals(hostTpmEventLogEntry as HostTpmEventLogEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PcrIndex + \"_\" + EventDetails).GetHashCode();\n        }\n    }\n\n    public class HostTpmOptionEventDetails : HostTpmEventDetails, IEquatable<HostTpmOptionEventDetails>\n    {\n        public string OptionsFileName { get; set; }\n\n        public sbyte[] BootOptions { get; set; }\n\n        public bool Equals(HostTpmOptionEventDetails hostTpmOptionEventDetails)\n        {\n            return (hostTpmOptionEventDetails != null && this.OptionsFileName == hostTpmOptionEventDetails.OptionsFileName && ((this.BootOptions == null && hostTpmOptionEventDetails.BootOptions == null) || (this.BootOptions != null && hostTpmOptionEventDetails.BootOptions != null && Enumerable.SequenceEqual(this.BootOptions, hostTpmOptionEventDetails.BootOptions))));\n        }\n\n        public override bool Equals(object hostTpmOptionEventDetails)\n        {\n            return Equals(hostTpmOptionEventDetails as HostTpmOptionEventDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OptionsFileName + \"_\" + BootOptions).GetHashCode();\n        }\n    }\n\n    public class HostTpmSoftwareComponentEventDetails : HostTpmEventDetails, IEquatable<HostTpmSoftwareComponentEventDetails>\n    {\n        public string ComponentName { get; set; }\n\n        public string VibName { get; set; }\n\n        public string VibVersion { get; set; }\n\n        public string VibVendor { get; set; }\n\n        public bool Equals(HostTpmSoftwareComponentEventDetails hostTpmSoftwareComponentEventDetails)\n        {\n            return (hostTpmSoftwareComponentEventDetails != null && this.ComponentName == hostTpmSoftwareComponentEventDetails.ComponentName && this.VibName == hostTpmSoftwareComponentEventDetails.VibName && this.VibVersion == hostTpmSoftwareComponentEventDetails.VibVersion && this.VibVendor == hostTpmSoftwareComponentEventDetails.VibVendor);\n        }\n\n        public override bool Equals(object hostTpmSoftwareComponentEventDetails)\n        {\n            return Equals(hostTpmSoftwareComponentEventDetails as HostTpmSoftwareComponentEventDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComponentName + \"_\" + VibName + \"_\" + VibVersion + \"_\" + VibVendor).GetHashCode();\n        }\n    }\n\n    public class HostUnresolvedVmfsExtent : DynamicData, IEquatable<HostUnresolvedVmfsExtent>\n    {\n        public HostScsiDiskPartition Device { get; set; }\n\n        public string DevicePath { get; set; }\n\n        public string VmfsUuid { get; set; }\n\n        public bool IsHeadExtent { get; set; }\n\n        public int Ordinal { get; set; }\n\n        public int StartBlock { get; set; }\n\n        public int EndBlock { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(HostUnresolvedVmfsExtent hostUnresolvedVmfsExtent)\n        {\n            return (hostUnresolvedVmfsExtent != null && ((this.Device == null && hostUnresolvedVmfsExtent.Device == null) || (this.Device != null && this.Device.Equals(hostUnresolvedVmfsExtent.Device))) && this.DevicePath == hostUnresolvedVmfsExtent.DevicePath && this.VmfsUuid == hostUnresolvedVmfsExtent.VmfsUuid && this.IsHeadExtent == hostUnresolvedVmfsExtent.IsHeadExtent && this.Ordinal == hostUnresolvedVmfsExtent.Ordinal && this.StartBlock == hostUnresolvedVmfsExtent.StartBlock && this.EndBlock == hostUnresolvedVmfsExtent.EndBlock && this.Reason == hostUnresolvedVmfsExtent.Reason);\n        }\n\n        public override bool Equals(object hostUnresolvedVmfsExtent)\n        {\n            return Equals(hostUnresolvedVmfsExtent as HostUnresolvedVmfsExtent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + DevicePath + \"_\" + VmfsUuid + \"_\" + IsHeadExtent + \"_\" + Ordinal + \"_\" + StartBlock + \"_\" + EndBlock + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class HostUnresolvedVmfsResignatureSpec : DynamicData, IEquatable<HostUnresolvedVmfsResignatureSpec>\n    {\n        public string[] ExtentDevicePath { get; set; }\n\n        public bool Equals(HostUnresolvedVmfsResignatureSpec hostUnresolvedVmfsResignatureSpec)\n        {\n            return (hostUnresolvedVmfsResignatureSpec != null && ((this.ExtentDevicePath == null && hostUnresolvedVmfsResignatureSpec.ExtentDevicePath == null) || (this.ExtentDevicePath != null && hostUnresolvedVmfsResignatureSpec.ExtentDevicePath != null && Enumerable.SequenceEqual(this.ExtentDevicePath, hostUnresolvedVmfsResignatureSpec.ExtentDevicePath))));\n        }\n\n        public override bool Equals(object hostUnresolvedVmfsResignatureSpec)\n        {\n            return Equals(hostUnresolvedVmfsResignatureSpec as HostUnresolvedVmfsResignatureSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtentDevicePath).GetHashCode();\n        }\n    }\n\n    public class HostUnresolvedVmfsResolutionResult : DynamicData, IEquatable<HostUnresolvedVmfsResolutionResult>\n    {\n        public HostUnresolvedVmfsResolutionSpec Spec { get; set; }\n\n        public HostVmfsVolume Vmfs { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(HostUnresolvedVmfsResolutionResult hostUnresolvedVmfsResolutionResult)\n        {\n            return (hostUnresolvedVmfsResolutionResult != null && ((this.Spec == null && hostUnresolvedVmfsResolutionResult.Spec == null) || (this.Spec != null && this.Spec.Equals(hostUnresolvedVmfsResolutionResult.Spec))) && ((this.Vmfs == null && hostUnresolvedVmfsResolutionResult.Vmfs == null) || (this.Vmfs != null && this.Vmfs.Equals(hostUnresolvedVmfsResolutionResult.Vmfs))) && ((this.Fault == null && hostUnresolvedVmfsResolutionResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostUnresolvedVmfsResolutionResult.Fault))));\n        }\n\n        public override bool Equals(object hostUnresolvedVmfsResolutionResult)\n        {\n            return Equals(hostUnresolvedVmfsResolutionResult as HostUnresolvedVmfsResolutionResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Spec + \"_\" + Vmfs + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class HostUnresolvedVmfsResolutionSpec : DynamicData, IEquatable<HostUnresolvedVmfsResolutionSpec>\n    {\n        public string[] ExtentDevicePath { get; set; }\n\n        public string UuidResolution { get; set; }\n\n        public bool Equals(HostUnresolvedVmfsResolutionSpec hostUnresolvedVmfsResolutionSpec)\n        {\n            return (hostUnresolvedVmfsResolutionSpec != null && ((this.ExtentDevicePath == null && hostUnresolvedVmfsResolutionSpec.ExtentDevicePath == null) || (this.ExtentDevicePath != null && hostUnresolvedVmfsResolutionSpec.ExtentDevicePath != null && Enumerable.SequenceEqual(this.ExtentDevicePath, hostUnresolvedVmfsResolutionSpec.ExtentDevicePath))) && this.UuidResolution == hostUnresolvedVmfsResolutionSpec.UuidResolution);\n        }\n\n        public override bool Equals(object hostUnresolvedVmfsResolutionSpec)\n        {\n            return Equals(hostUnresolvedVmfsResolutionSpec as HostUnresolvedVmfsResolutionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtentDevicePath + \"_\" + UuidResolution).GetHashCode();\n        }\n    }\n\n    public class HostUnresolvedVmfsVolume : DynamicData, IEquatable<HostUnresolvedVmfsVolume>\n    {\n        public HostUnresolvedVmfsExtent[] Extent { get; set; }\n\n        public string VmfsLabel { get; set; }\n\n        public string VmfsUuid { get; set; }\n\n        public int TotalBlocks { get; set; }\n\n        public HostUnresolvedVmfsVolumeResolveStatus ResolveStatus { get; set; }\n\n        public bool Equals(HostUnresolvedVmfsVolume hostUnresolvedVmfsVolume)\n        {\n            return (hostUnresolvedVmfsVolume != null && ((this.Extent == null && hostUnresolvedVmfsVolume.Extent == null) || (this.Extent != null && hostUnresolvedVmfsVolume.Extent != null && Enumerable.SequenceEqual(this.Extent, hostUnresolvedVmfsVolume.Extent))) && this.VmfsLabel == hostUnresolvedVmfsVolume.VmfsLabel && this.VmfsUuid == hostUnresolvedVmfsVolume.VmfsUuid && this.TotalBlocks == hostUnresolvedVmfsVolume.TotalBlocks && ((this.ResolveStatus == null && hostUnresolvedVmfsVolume.ResolveStatus == null) || (this.ResolveStatus != null && this.ResolveStatus.Equals(hostUnresolvedVmfsVolume.ResolveStatus))));\n        }\n\n        public override bool Equals(object hostUnresolvedVmfsVolume)\n        {\n            return Equals(hostUnresolvedVmfsVolume as HostUnresolvedVmfsVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Extent + \"_\" + VmfsLabel + \"_\" + VmfsUuid + \"_\" + TotalBlocks + \"_\" + ResolveStatus).GetHashCode();\n        }\n    }\n\n    public class HostUnresolvedVmfsVolumeResolveStatus : DynamicData, IEquatable<HostUnresolvedVmfsVolumeResolveStatus>\n    {\n        public bool Resolvable { get; set; }\n\n        public bool? IncompleteExtents { get; set; }\n\n        public bool? MultipleCopies { get; set; }\n\n        public bool Equals(HostUnresolvedVmfsVolumeResolveStatus hostUnresolvedVmfsVolumeResolveStatus)\n        {\n            return (hostUnresolvedVmfsVolumeResolveStatus != null && this.Resolvable == hostUnresolvedVmfsVolumeResolveStatus.Resolvable && ((this.IncompleteExtents == null && hostUnresolvedVmfsVolumeResolveStatus.IncompleteExtents == null) || (this.IncompleteExtents != null && this.IncompleteExtents.Equals(hostUnresolvedVmfsVolumeResolveStatus.IncompleteExtents))) && ((this.MultipleCopies == null && hostUnresolvedVmfsVolumeResolveStatus.MultipleCopies == null) || (this.MultipleCopies != null && this.MultipleCopies.Equals(hostUnresolvedVmfsVolumeResolveStatus.MultipleCopies))));\n        }\n\n        public override bool Equals(object hostUnresolvedVmfsVolumeResolveStatus)\n        {\n            return Equals(hostUnresolvedVmfsVolumeResolveStatus as HostUnresolvedVmfsVolumeResolveStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Resolvable + \"_\" + IncompleteExtents + \"_\" + MultipleCopies).GetHashCode();\n        }\n    }\n\n    public class HostUpgradeFailedEvent : HostEvent, IEquatable<HostUpgradeFailedEvent>\n    {\n        public bool Equals(HostUpgradeFailedEvent hostUpgradeFailedEvent)\n        {\n            return (hostUpgradeFailedEvent != null && base.Equals(hostUpgradeFailedEvent));\n        }\n\n        public override bool Equals(object hostUpgradeFailedEvent)\n        {\n            return Equals(hostUpgradeFailedEvent as HostUpgradeFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostUserWorldSwapNotEnabledEvent : HostEvent, IEquatable<HostUserWorldSwapNotEnabledEvent>\n    {\n        public bool Equals(HostUserWorldSwapNotEnabledEvent hostUserWorldSwapNotEnabledEvent)\n        {\n            return (hostUserWorldSwapNotEnabledEvent != null && base.Equals(hostUserWorldSwapNotEnabledEvent));\n        }\n\n        public override bool Equals(object hostUserWorldSwapNotEnabledEvent)\n        {\n            return Equals(hostUserWorldSwapNotEnabledEvent as HostUserWorldSwapNotEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostVfatVolume : HostFileSystemVolume, IEquatable<HostVfatVolume>\n    {\n        public bool Equals(HostVfatVolume hostVfatVolume)\n        {\n            return (hostVfatVolume != null && base.Equals(hostVfatVolume));\n        }\n\n        public override bool Equals(object hostVfatVolume)\n        {\n            return Equals(hostVfatVolume as HostVfatVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostVffsSpec : DynamicData, IEquatable<HostVffsSpec>\n    {\n        public string DevicePath { get; set; }\n\n        public HostDiskPartitionSpec Partition { get; set; }\n\n        public int MajorVersion { get; set; }\n\n        public string VolumeName { get; set; }\n\n        public bool Equals(HostVffsSpec hostVffsSpec)\n        {\n            return (hostVffsSpec != null && this.DevicePath == hostVffsSpec.DevicePath && ((this.Partition == null && hostVffsSpec.Partition == null) || (this.Partition != null && this.Partition.Equals(hostVffsSpec.Partition))) && this.MajorVersion == hostVffsSpec.MajorVersion && this.VolumeName == hostVffsSpec.VolumeName);\n        }\n\n        public override bool Equals(object hostVffsSpec)\n        {\n            return Equals(hostVffsSpec as HostVffsSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DevicePath + \"_\" + Partition + \"_\" + MajorVersion + \"_\" + VolumeName).GetHashCode();\n        }\n    }\n\n    public class HostVffsVolume : HostFileSystemVolume, IEquatable<HostVffsVolume>\n    {\n        public int MajorVersion { get; set; }\n\n        public string Version { get; set; }\n\n        public string Uuid { get; set; }\n\n        public HostScsiDiskPartition[] Extent { get; set; }\n\n        public bool Equals(HostVffsVolume hostVffsVolume)\n        {\n            return (hostVffsVolume != null && this.MajorVersion == hostVffsVolume.MajorVersion && this.Version == hostVffsVolume.Version && this.Uuid == hostVffsVolume.Uuid && ((this.Extent == null && hostVffsVolume.Extent == null) || (this.Extent != null && hostVffsVolume.Extent != null && Enumerable.SequenceEqual(this.Extent, hostVffsVolume.Extent))));\n        }\n\n        public override bool Equals(object hostVffsVolume)\n        {\n            return Equals(hostVffsVolume as HostVffsVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MajorVersion + \"_\" + Version + \"_\" + Uuid + \"_\" + Extent).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManager : ViewBase, IEquatable<HostVFlashManager>\n    {\n        public HostVFlashManagerVFlashConfigInfo VFlashConfigInfo { get; set; }\n\n        public ManagedObjectReference ConfigureVFlashResourceEx_Task(string[] devicePath)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public HostVFlashResourceConfigurationResult ConfigureVFlashResourceEx(string[] devicePath)\n        {\n            return default(HostVFlashResourceConfigurationResult);\n        }\n\n        public void HostConfigureVFlashResource(HostVFlashManagerVFlashResourceConfigSpec spec)\n        {\n        }\n\n        public void HostRemoveVFlashResource()\n        {\n        }\n\n        public void HostConfigVFlashCache(HostVFlashManagerVFlashCacheConfigSpec spec)\n        {\n        }\n\n        public VirtualDiskVFlashCacheConfigInfo HostGetVFlashModuleDefaultConfig(string vFlashModule)\n        {\n            return default(VirtualDiskVFlashCacheConfigInfo);\n        }\n\n        public bool Equals(HostVFlashManager hostVFlashManager)\n        {\n            return (hostVFlashManager != null && ((this.VFlashConfigInfo == null && hostVFlashManager.VFlashConfigInfo == null) || (this.VFlashConfigInfo != null && this.VFlashConfigInfo.Equals(hostVFlashManager.VFlashConfigInfo))));\n        }\n\n        public override bool Equals(object hostVFlashManager)\n        {\n            return Equals(hostVFlashManager as HostVFlashManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VFlashConfigInfo).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashCacheConfigInfo : DynamicData, IEquatable<HostVFlashManagerVFlashCacheConfigInfo>\n    {\n        public HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption[] VFlashModuleConfigOption { get; set; }\n\n        public string DefaultVFlashModule { get; set; }\n\n        public long? SwapCacheReservationInGB { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashCacheConfigInfo hostVFlashManagerVFlashCacheConfigInfo)\n        {\n            return (hostVFlashManagerVFlashCacheConfigInfo != null && ((this.VFlashModuleConfigOption == null && hostVFlashManagerVFlashCacheConfigInfo.VFlashModuleConfigOption == null) || (this.VFlashModuleConfigOption != null && hostVFlashManagerVFlashCacheConfigInfo.VFlashModuleConfigOption != null && Enumerable.SequenceEqual(this.VFlashModuleConfigOption, hostVFlashManagerVFlashCacheConfigInfo.VFlashModuleConfigOption))) && this.DefaultVFlashModule == hostVFlashManagerVFlashCacheConfigInfo.DefaultVFlashModule && ((this.SwapCacheReservationInGB == null && hostVFlashManagerVFlashCacheConfigInfo.SwapCacheReservationInGB == null) || (this.SwapCacheReservationInGB != null && this.SwapCacheReservationInGB.Equals(hostVFlashManagerVFlashCacheConfigInfo.SwapCacheReservationInGB))));\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashCacheConfigInfo)\n        {\n            return Equals(hostVFlashManagerVFlashCacheConfigInfo as HostVFlashManagerVFlashCacheConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VFlashModuleConfigOption + \"_\" + DefaultVFlashModule + \"_\" + SwapCacheReservationInGB).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption : DynamicData, IEquatable<HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption>\n    {\n        public string VFlashModule { get; set; }\n\n        public string VFlashModuleVersion { get; set; }\n\n        public string MinSupportedModuleVersion { get; set; }\n\n        public ChoiceOption CacheConsistencyType { get; set; }\n\n        public ChoiceOption CacheMode { get; set; }\n\n        public LongOption BlockSizeInKBOption { get; set; }\n\n        public LongOption ReservationInMBOption { get; set; }\n\n        public long MaxDiskSizeInKB { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption)\n        {\n            return (hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption != null && this.VFlashModule == hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.VFlashModule && this.VFlashModuleVersion == hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.VFlashModuleVersion && this.MinSupportedModuleVersion == hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.MinSupportedModuleVersion && ((this.CacheConsistencyType == null && hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.CacheConsistencyType == null) || (this.CacheConsistencyType != null && this.CacheConsistencyType.Equals(hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.CacheConsistencyType))) && ((this.CacheMode == null && hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.CacheMode == null) || (this.CacheMode != null && this.CacheMode.Equals(hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.CacheMode))) && ((this.BlockSizeInKBOption == null && hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.BlockSizeInKBOption == null) || (this.BlockSizeInKBOption != null && this.BlockSizeInKBOption.Equals(hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.BlockSizeInKBOption))) && ((this.ReservationInMBOption == null && hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.ReservationInMBOption == null) || (this.ReservationInMBOption != null && this.ReservationInMBOption.Equals(hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.ReservationInMBOption))) && this.MaxDiskSizeInKB == hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption.MaxDiskSizeInKB);\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption)\n        {\n            return Equals(hostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption as HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VFlashModule + \"_\" + VFlashModuleVersion + \"_\" + MinSupportedModuleVersion + \"_\" + CacheConsistencyType + \"_\" + CacheMode + \"_\" + BlockSizeInKBOption + \"_\" + ReservationInMBOption + \"_\" + MaxDiskSizeInKB).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashCacheConfigSpec : DynamicData, IEquatable<HostVFlashManagerVFlashCacheConfigSpec>\n    {\n        public string DefaultVFlashModule { get; set; }\n\n        public long SwapCacheReservationInGB { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashCacheConfigSpec hostVFlashManagerVFlashCacheConfigSpec)\n        {\n            return (hostVFlashManagerVFlashCacheConfigSpec != null && this.DefaultVFlashModule == hostVFlashManagerVFlashCacheConfigSpec.DefaultVFlashModule && this.SwapCacheReservationInGB == hostVFlashManagerVFlashCacheConfigSpec.SwapCacheReservationInGB);\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashCacheConfigSpec)\n        {\n            return Equals(hostVFlashManagerVFlashCacheConfigSpec as HostVFlashManagerVFlashCacheConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultVFlashModule + \"_\" + SwapCacheReservationInGB).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashConfigInfo : DynamicData, IEquatable<HostVFlashManagerVFlashConfigInfo>\n    {\n        public HostVFlashManagerVFlashResourceConfigInfo VFlashResourceConfigInfo { get; set; }\n\n        public HostVFlashManagerVFlashCacheConfigInfo VFlashCacheConfigInfo { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashConfigInfo hostVFlashManagerVFlashConfigInfo)\n        {\n            return (hostVFlashManagerVFlashConfigInfo != null && ((this.VFlashResourceConfigInfo == null && hostVFlashManagerVFlashConfigInfo.VFlashResourceConfigInfo == null) || (this.VFlashResourceConfigInfo != null && this.VFlashResourceConfigInfo.Equals(hostVFlashManagerVFlashConfigInfo.VFlashResourceConfigInfo))) && ((this.VFlashCacheConfigInfo == null && hostVFlashManagerVFlashConfigInfo.VFlashCacheConfigInfo == null) || (this.VFlashCacheConfigInfo != null && this.VFlashCacheConfigInfo.Equals(hostVFlashManagerVFlashConfigInfo.VFlashCacheConfigInfo))));\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashConfigInfo)\n        {\n            return Equals(hostVFlashManagerVFlashConfigInfo as HostVFlashManagerVFlashConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VFlashResourceConfigInfo + \"_\" + VFlashCacheConfigInfo).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashResourceConfigInfo : DynamicData, IEquatable<HostVFlashManagerVFlashResourceConfigInfo>\n    {\n        public HostVffsVolume Vffs { get; set; }\n\n        public long Capacity { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashResourceConfigInfo hostVFlashManagerVFlashResourceConfigInfo)\n        {\n            return (hostVFlashManagerVFlashResourceConfigInfo != null && ((this.Vffs == null && hostVFlashManagerVFlashResourceConfigInfo.Vffs == null) || (this.Vffs != null && this.Vffs.Equals(hostVFlashManagerVFlashResourceConfigInfo.Vffs))) && this.Capacity == hostVFlashManagerVFlashResourceConfigInfo.Capacity);\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashResourceConfigInfo)\n        {\n            return Equals(hostVFlashManagerVFlashResourceConfigInfo as HostVFlashManagerVFlashResourceConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vffs + \"_\" + Capacity).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashResourceConfigSpec : DynamicData, IEquatable<HostVFlashManagerVFlashResourceConfigSpec>\n    {\n        public string VffsUuid { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashResourceConfigSpec hostVFlashManagerVFlashResourceConfigSpec)\n        {\n            return (hostVFlashManagerVFlashResourceConfigSpec != null && this.VffsUuid == hostVFlashManagerVFlashResourceConfigSpec.VffsUuid);\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashResourceConfigSpec)\n        {\n            return Equals(hostVFlashManagerVFlashResourceConfigSpec as HostVFlashManagerVFlashResourceConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VffsUuid).GetHashCode();\n        }\n    }\n\n    public class HostVFlashManagerVFlashResourceRunTimeInfo : DynamicData, IEquatable<HostVFlashManagerVFlashResourceRunTimeInfo>\n    {\n        public long Usage { get; set; }\n\n        public long Capacity { get; set; }\n\n        public bool Accessible { get; set; }\n\n        public long CapacityForVmCache { get; set; }\n\n        public long FreeForVmCache { get; set; }\n\n        public bool Equals(HostVFlashManagerVFlashResourceRunTimeInfo hostVFlashManagerVFlashResourceRunTimeInfo)\n        {\n            return (hostVFlashManagerVFlashResourceRunTimeInfo != null && this.Usage == hostVFlashManagerVFlashResourceRunTimeInfo.Usage && this.Capacity == hostVFlashManagerVFlashResourceRunTimeInfo.Capacity && this.Accessible == hostVFlashManagerVFlashResourceRunTimeInfo.Accessible && this.CapacityForVmCache == hostVFlashManagerVFlashResourceRunTimeInfo.CapacityForVmCache && this.FreeForVmCache == hostVFlashManagerVFlashResourceRunTimeInfo.FreeForVmCache);\n        }\n\n        public override bool Equals(object hostVFlashManagerVFlashResourceRunTimeInfo)\n        {\n            return Equals(hostVFlashManagerVFlashResourceRunTimeInfo as HostVFlashManagerVFlashResourceRunTimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Usage + \"_\" + Capacity + \"_\" + Accessible + \"_\" + CapacityForVmCache + \"_\" + FreeForVmCache).GetHashCode();\n        }\n    }\n\n    public class HostVFlashResourceConfigurationResult : DynamicData, IEquatable<HostVFlashResourceConfigurationResult>\n    {\n        public string[] DevicePath { get; set; }\n\n        public HostVffsVolume Vffs { get; set; }\n\n        public HostDiskConfigurationResult[] DiskConfigurationResult { get; set; }\n\n        public bool Equals(HostVFlashResourceConfigurationResult hostVFlashResourceConfigurationResult)\n        {\n            return (hostVFlashResourceConfigurationResult != null && ((this.DevicePath == null && hostVFlashResourceConfigurationResult.DevicePath == null) || (this.DevicePath != null && hostVFlashResourceConfigurationResult.DevicePath != null && Enumerable.SequenceEqual(this.DevicePath, hostVFlashResourceConfigurationResult.DevicePath))) && ((this.Vffs == null && hostVFlashResourceConfigurationResult.Vffs == null) || (this.Vffs != null && this.Vffs.Equals(hostVFlashResourceConfigurationResult.Vffs))) && ((this.DiskConfigurationResult == null && hostVFlashResourceConfigurationResult.DiskConfigurationResult == null) || (this.DiskConfigurationResult != null && hostVFlashResourceConfigurationResult.DiskConfigurationResult != null && Enumerable.SequenceEqual(this.DiskConfigurationResult, hostVFlashResourceConfigurationResult.DiskConfigurationResult))));\n        }\n\n        public override bool Equals(object hostVFlashResourceConfigurationResult)\n        {\n            return Equals(hostVFlashResourceConfigurationResult as HostVFlashResourceConfigurationResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DevicePath + \"_\" + Vffs + \"_\" + DiskConfigurationResult).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNic : DynamicData, IEquatable<HostVirtualNic>\n    {\n        public string Device { get; set; }\n\n        public string Key { get; set; }\n\n        public string Portgroup { get; set; }\n\n        public HostVirtualNicSpec Spec { get; set; }\n\n        public string Port { get; set; }\n\n        public bool Equals(HostVirtualNic hostVirtualNic)\n        {\n            return (hostVirtualNic != null && this.Device == hostVirtualNic.Device && this.Key == hostVirtualNic.Key && this.Portgroup == hostVirtualNic.Portgroup && ((this.Spec == null && hostVirtualNic.Spec == null) || (this.Spec != null && this.Spec.Equals(hostVirtualNic.Spec))) && this.Port == hostVirtualNic.Port);\n        }\n\n        public override bool Equals(object hostVirtualNic)\n        {\n            return Equals(hostVirtualNic as HostVirtualNic);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Key + \"_\" + Portgroup + \"_\" + Spec + \"_\" + Port).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicConfig : DynamicData, IEquatable<HostVirtualNicConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public string Device { get; set; }\n\n        public string Portgroup { get; set; }\n\n        public HostVirtualNicSpec Spec { get; set; }\n\n        public bool Equals(HostVirtualNicConfig hostVirtualNicConfig)\n        {\n            return (hostVirtualNicConfig != null && this.ChangeOperation == hostVirtualNicConfig.ChangeOperation && this.Device == hostVirtualNicConfig.Device && this.Portgroup == hostVirtualNicConfig.Portgroup && ((this.Spec == null && hostVirtualNicConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostVirtualNicConfig.Spec))));\n        }\n\n        public override bool Equals(object hostVirtualNicConfig)\n        {\n            return Equals(hostVirtualNicConfig as HostVirtualNicConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Device + \"_\" + Portgroup + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicConnection : DynamicData, IEquatable<HostVirtualNicConnection>\n    {\n        public string Portgroup { get; set; }\n\n        public DistributedVirtualSwitchPortConnection DvPort { get; set; }\n\n        public HostVirtualNicOpaqueNetworkSpec OpNetwork { get; set; }\n\n        public bool Equals(HostVirtualNicConnection hostVirtualNicConnection)\n        {\n            return (hostVirtualNicConnection != null && this.Portgroup == hostVirtualNicConnection.Portgroup && ((this.DvPort == null && hostVirtualNicConnection.DvPort == null) || (this.DvPort != null && this.DvPort.Equals(hostVirtualNicConnection.DvPort))) && ((this.OpNetwork == null && hostVirtualNicConnection.OpNetwork == null) || (this.OpNetwork != null && this.OpNetwork.Equals(hostVirtualNicConnection.OpNetwork))));\n        }\n\n        public override bool Equals(object hostVirtualNicConnection)\n        {\n            return Equals(hostVirtualNicConnection as HostVirtualNicConnection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Portgroup + \"_\" + DvPort + \"_\" + OpNetwork).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicIpRouteSpec : DynamicData, IEquatable<HostVirtualNicIpRouteSpec>\n    {\n        public HostIpRouteConfig IpRouteConfig { get; set; }\n\n        public bool Equals(HostVirtualNicIpRouteSpec hostVirtualNicIpRouteSpec)\n        {\n            return (hostVirtualNicIpRouteSpec != null && ((this.IpRouteConfig == null && hostVirtualNicIpRouteSpec.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(hostVirtualNicIpRouteSpec.IpRouteConfig))));\n        }\n\n        public override bool Equals(object hostVirtualNicIpRouteSpec)\n        {\n            return Equals(hostVirtualNicIpRouteSpec as HostVirtualNicIpRouteSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpRouteConfig).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicManager : ExtensibleManagedObject, IEquatable<HostVirtualNicManager>\n    {\n        public HostVirtualNicManagerInfo Info { get; set; }\n\n        public VirtualNicManagerNetConfig QueryNetConfig(string nicType)\n        {\n            return default(VirtualNicManagerNetConfig);\n        }\n\n        public void SelectVnicForNicType(string nicType, string device)\n        {\n        }\n\n        public void DeselectVnicForNicType(string nicType, string device)\n        {\n        }\n\n        public bool Equals(HostVirtualNicManager hostVirtualNicManager)\n        {\n            return (hostVirtualNicManager != null && ((this.Info == null && hostVirtualNicManager.Info == null) || (this.Info != null && this.Info.Equals(hostVirtualNicManager.Info))));\n        }\n\n        public override bool Equals(object hostVirtualNicManager)\n        {\n            return Equals(hostVirtualNicManager as HostVirtualNicManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicManagerInfo : DynamicData, IEquatable<HostVirtualNicManagerInfo>\n    {\n        public VirtualNicManagerNetConfig[] NetConfig { get; set; }\n\n        public bool Equals(HostVirtualNicManagerInfo hostVirtualNicManagerInfo)\n        {\n            return (hostVirtualNicManagerInfo != null && ((this.NetConfig == null && hostVirtualNicManagerInfo.NetConfig == null) || (this.NetConfig != null && hostVirtualNicManagerInfo.NetConfig != null && Enumerable.SequenceEqual(this.NetConfig, hostVirtualNicManagerInfo.NetConfig))));\n        }\n\n        public override bool Equals(object hostVirtualNicManagerInfo)\n        {\n            return Equals(hostVirtualNicManagerInfo as HostVirtualNicManagerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetConfig).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicManagerNicTypeSelection : DynamicData, IEquatable<HostVirtualNicManagerNicTypeSelection>\n    {\n        public HostVirtualNicConnection Vnic { get; set; }\n\n        public string[] NicType { get; set; }\n\n        public bool Equals(HostVirtualNicManagerNicTypeSelection hostVirtualNicManagerNicTypeSelection)\n        {\n            return (hostVirtualNicManagerNicTypeSelection != null && ((this.Vnic == null && hostVirtualNicManagerNicTypeSelection.Vnic == null) || (this.Vnic != null && this.Vnic.Equals(hostVirtualNicManagerNicTypeSelection.Vnic))) && ((this.NicType == null && hostVirtualNicManagerNicTypeSelection.NicType == null) || (this.NicType != null && hostVirtualNicManagerNicTypeSelection.NicType != null && Enumerable.SequenceEqual(this.NicType, hostVirtualNicManagerNicTypeSelection.NicType))));\n        }\n\n        public override bool Equals(object hostVirtualNicManagerNicTypeSelection)\n        {\n            return Equals(hostVirtualNicManagerNicTypeSelection as HostVirtualNicManagerNicTypeSelection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vnic + \"_\" + NicType).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicOpaqueNetworkSpec : DynamicData, IEquatable<HostVirtualNicOpaqueNetworkSpec>\n    {\n        public string OpaqueNetworkId { get; set; }\n\n        public string OpaqueNetworkType { get; set; }\n\n        public bool Equals(HostVirtualNicOpaqueNetworkSpec hostVirtualNicOpaqueNetworkSpec)\n        {\n            return (hostVirtualNicOpaqueNetworkSpec != null && this.OpaqueNetworkId == hostVirtualNicOpaqueNetworkSpec.OpaqueNetworkId && this.OpaqueNetworkType == hostVirtualNicOpaqueNetworkSpec.OpaqueNetworkType);\n        }\n\n        public override bool Equals(object hostVirtualNicOpaqueNetworkSpec)\n        {\n            return Equals(hostVirtualNicOpaqueNetworkSpec as HostVirtualNicOpaqueNetworkSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OpaqueNetworkId + \"_\" + OpaqueNetworkType).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicSpec : DynamicData, IEquatable<HostVirtualNicSpec>\n    {\n        public HostIpConfig Ip { get; set; }\n\n        public string Mac { get; set; }\n\n        public DistributedVirtualSwitchPortConnection DistributedVirtualPort { get; set; }\n\n        public string Portgroup { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public bool? TsoEnabled { get; set; }\n\n        public string NetStackInstanceKey { get; set; }\n\n        public HostVirtualNicOpaqueNetworkSpec OpaqueNetwork { get; set; }\n\n        public string ExternalId { get; set; }\n\n        public string PinnedPnic { get; set; }\n\n        public HostVirtualNicIpRouteSpec IpRouteSpec { get; set; }\n\n        public bool Equals(HostVirtualNicSpec hostVirtualNicSpec)\n        {\n            return (hostVirtualNicSpec != null && ((this.Ip == null && hostVirtualNicSpec.Ip == null) || (this.Ip != null && this.Ip.Equals(hostVirtualNicSpec.Ip))) && this.Mac == hostVirtualNicSpec.Mac && ((this.DistributedVirtualPort == null && hostVirtualNicSpec.DistributedVirtualPort == null) || (this.DistributedVirtualPort != null && this.DistributedVirtualPort.Equals(hostVirtualNicSpec.DistributedVirtualPort))) && this.Portgroup == hostVirtualNicSpec.Portgroup && ((this.Mtu == null && hostVirtualNicSpec.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(hostVirtualNicSpec.Mtu))) && ((this.TsoEnabled == null && hostVirtualNicSpec.TsoEnabled == null) || (this.TsoEnabled != null && this.TsoEnabled.Equals(hostVirtualNicSpec.TsoEnabled))) && this.NetStackInstanceKey == hostVirtualNicSpec.NetStackInstanceKey && ((this.OpaqueNetwork == null && hostVirtualNicSpec.OpaqueNetwork == null) || (this.OpaqueNetwork != null && this.OpaqueNetwork.Equals(hostVirtualNicSpec.OpaqueNetwork))) && this.ExternalId == hostVirtualNicSpec.ExternalId && this.PinnedPnic == hostVirtualNicSpec.PinnedPnic && ((this.IpRouteSpec == null && hostVirtualNicSpec.IpRouteSpec == null) || (this.IpRouteSpec != null && this.IpRouteSpec.Equals(hostVirtualNicSpec.IpRouteSpec))));\n        }\n\n        public override bool Equals(object hostVirtualNicSpec)\n        {\n            return Equals(hostVirtualNicSpec as HostVirtualNicSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ip + \"_\" + Mac + \"_\" + DistributedVirtualPort + \"_\" + Portgroup + \"_\" + Mtu + \"_\" + TsoEnabled + \"_\" + NetStackInstanceKey + \"_\" + OpaqueNetwork + \"_\" + ExternalId + \"_\" + PinnedPnic + \"_\" + IpRouteSpec).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitch : DynamicData, IEquatable<HostVirtualSwitch>\n    {\n        public string Name { get; set; }\n\n        public string Key { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public int NumPortsAvailable { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public string[] Portgroup { get; set; }\n\n        public string[] Pnic { get; set; }\n\n        public HostVirtualSwitchSpec Spec { get; set; }\n\n        public bool Equals(HostVirtualSwitch hostVirtualSwitch)\n        {\n            return (hostVirtualSwitch != null && this.Name == hostVirtualSwitch.Name && this.Key == hostVirtualSwitch.Key && this.NumPorts == hostVirtualSwitch.NumPorts && this.NumPortsAvailable == hostVirtualSwitch.NumPortsAvailable && ((this.Mtu == null && hostVirtualSwitch.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(hostVirtualSwitch.Mtu))) && ((this.Portgroup == null && hostVirtualSwitch.Portgroup == null) || (this.Portgroup != null && hostVirtualSwitch.Portgroup != null && Enumerable.SequenceEqual(this.Portgroup, hostVirtualSwitch.Portgroup))) && ((this.Pnic == null && hostVirtualSwitch.Pnic == null) || (this.Pnic != null && hostVirtualSwitch.Pnic != null && Enumerable.SequenceEqual(this.Pnic, hostVirtualSwitch.Pnic))) && ((this.Spec == null && hostVirtualSwitch.Spec == null) || (this.Spec != null && this.Spec.Equals(hostVirtualSwitch.Spec))));\n        }\n\n        public override bool Equals(object hostVirtualSwitch)\n        {\n            return Equals(hostVirtualSwitch as HostVirtualSwitch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Key + \"_\" + NumPorts + \"_\" + NumPortsAvailable + \"_\" + Mtu + \"_\" + Portgroup + \"_\" + Pnic + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchAutoBridge : HostVirtualSwitchBridge, IEquatable<HostVirtualSwitchAutoBridge>\n    {\n        public string[] ExcludedNicDevice { get; set; }\n\n        public bool Equals(HostVirtualSwitchAutoBridge hostVirtualSwitchAutoBridge)\n        {\n            return (hostVirtualSwitchAutoBridge != null && ((this.ExcludedNicDevice == null && hostVirtualSwitchAutoBridge.ExcludedNicDevice == null) || (this.ExcludedNicDevice != null && hostVirtualSwitchAutoBridge.ExcludedNicDevice != null && Enumerable.SequenceEqual(this.ExcludedNicDevice, hostVirtualSwitchAutoBridge.ExcludedNicDevice))));\n        }\n\n        public override bool Equals(object hostVirtualSwitchAutoBridge)\n        {\n            return Equals(hostVirtualSwitchAutoBridge as HostVirtualSwitchAutoBridge);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExcludedNicDevice).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchBeaconConfig : DynamicData, IEquatable<HostVirtualSwitchBeaconConfig>\n    {\n        public int Interval { get; set; }\n\n        public bool Equals(HostVirtualSwitchBeaconConfig hostVirtualSwitchBeaconConfig)\n        {\n            return (hostVirtualSwitchBeaconConfig != null && this.Interval == hostVirtualSwitchBeaconConfig.Interval);\n        }\n\n        public override bool Equals(object hostVirtualSwitchBeaconConfig)\n        {\n            return Equals(hostVirtualSwitchBeaconConfig as HostVirtualSwitchBeaconConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Interval).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchBondBridge : HostVirtualSwitchBridge, IEquatable<HostVirtualSwitchBondBridge>\n    {\n        public string[] NicDevice { get; set; }\n\n        public HostVirtualSwitchBeaconConfig Beacon { get; set; }\n\n        public LinkDiscoveryProtocolConfig LinkDiscoveryProtocolConfig { get; set; }\n\n        public bool Equals(HostVirtualSwitchBondBridge hostVirtualSwitchBondBridge)\n        {\n            return (hostVirtualSwitchBondBridge != null && ((this.NicDevice == null && hostVirtualSwitchBondBridge.NicDevice == null) || (this.NicDevice != null && hostVirtualSwitchBondBridge.NicDevice != null && Enumerable.SequenceEqual(this.NicDevice, hostVirtualSwitchBondBridge.NicDevice))) && ((this.Beacon == null && hostVirtualSwitchBondBridge.Beacon == null) || (this.Beacon != null && this.Beacon.Equals(hostVirtualSwitchBondBridge.Beacon))) && ((this.LinkDiscoveryProtocolConfig == null && hostVirtualSwitchBondBridge.LinkDiscoveryProtocolConfig == null) || (this.LinkDiscoveryProtocolConfig != null && this.LinkDiscoveryProtocolConfig.Equals(hostVirtualSwitchBondBridge.LinkDiscoveryProtocolConfig))));\n        }\n\n        public override bool Equals(object hostVirtualSwitchBondBridge)\n        {\n            return Equals(hostVirtualSwitchBondBridge as HostVirtualSwitchBondBridge);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NicDevice + \"_\" + Beacon + \"_\" + LinkDiscoveryProtocolConfig).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchBridge : DynamicData, IEquatable<HostVirtualSwitchBridge>\n    {\n        public bool Equals(HostVirtualSwitchBridge hostVirtualSwitchBridge)\n        {\n            return (hostVirtualSwitchBridge != null && base.Equals(hostVirtualSwitchBridge));\n        }\n\n        public override bool Equals(object hostVirtualSwitchBridge)\n        {\n            return Equals(hostVirtualSwitchBridge as HostVirtualSwitchBridge);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchConfig : DynamicData, IEquatable<HostVirtualSwitchConfig>\n    {\n        public string ChangeOperation { get; set; }\n\n        public string Name { get; set; }\n\n        public HostVirtualSwitchSpec Spec { get; set; }\n\n        public bool Equals(HostVirtualSwitchConfig hostVirtualSwitchConfig)\n        {\n            return (hostVirtualSwitchConfig != null && this.ChangeOperation == hostVirtualSwitchConfig.ChangeOperation && this.Name == hostVirtualSwitchConfig.Name && ((this.Spec == null && hostVirtualSwitchConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(hostVirtualSwitchConfig.Spec))));\n        }\n\n        public override bool Equals(object hostVirtualSwitchConfig)\n        {\n            return Equals(hostVirtualSwitchConfig as HostVirtualSwitchConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeOperation + \"_\" + Name + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchSimpleBridge : HostVirtualSwitchBridge, IEquatable<HostVirtualSwitchSimpleBridge>\n    {\n        public string NicDevice { get; set; }\n\n        public bool Equals(HostVirtualSwitchSimpleBridge hostVirtualSwitchSimpleBridge)\n        {\n            return (hostVirtualSwitchSimpleBridge != null && this.NicDevice == hostVirtualSwitchSimpleBridge.NicDevice);\n        }\n\n        public override bool Equals(object hostVirtualSwitchSimpleBridge)\n        {\n            return Equals(hostVirtualSwitchSimpleBridge as HostVirtualSwitchSimpleBridge);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NicDevice).GetHashCode();\n        }\n    }\n\n    public class HostVirtualSwitchSpec : DynamicData, IEquatable<HostVirtualSwitchSpec>\n    {\n        public int NumPorts { get; set; }\n\n        public HostVirtualSwitchBridge Bridge { get; set; }\n\n        public HostNetworkPolicy Policy { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public bool Equals(HostVirtualSwitchSpec hostVirtualSwitchSpec)\n        {\n            return (hostVirtualSwitchSpec != null && this.NumPorts == hostVirtualSwitchSpec.NumPorts && ((this.Bridge == null && hostVirtualSwitchSpec.Bridge == null) || (this.Bridge != null && this.Bridge.Equals(hostVirtualSwitchSpec.Bridge))) && ((this.Policy == null && hostVirtualSwitchSpec.Policy == null) || (this.Policy != null && this.Policy.Equals(hostVirtualSwitchSpec.Policy))) && ((this.Mtu == null && hostVirtualSwitchSpec.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(hostVirtualSwitchSpec.Mtu))));\n        }\n\n        public override bool Equals(object hostVirtualSwitchSpec)\n        {\n            return Equals(hostVirtualSwitchSpec as HostVirtualSwitchSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumPorts + \"_\" + Bridge + \"_\" + Policy + \"_\" + Mtu).GetHashCode();\n        }\n    }\n\n    public class HostVmciAccessManagerAccessSpec : DynamicData, IEquatable<HostVmciAccessManagerAccessSpec>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string[] Services { get; set; }\n\n        public string Mode { get; set; }\n\n        public HostVmciAccessManagerAccessSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostVmciAccessManagerAccessSpec hostVmciAccessManagerAccessSpec)\n        {\n            return (hostVmciAccessManagerAccessSpec != null && ((this.Vm == null && hostVmciAccessManagerAccessSpec.Vm == null) || (this.Vm != null && this.Vm.Equals(hostVmciAccessManagerAccessSpec.Vm))) && ((this.Services == null && hostVmciAccessManagerAccessSpec.Services == null) || (this.Services != null && hostVmciAccessManagerAccessSpec.Services != null && Enumerable.SequenceEqual(this.Services, hostVmciAccessManagerAccessSpec.Services))) && this.Mode == hostVmciAccessManagerAccessSpec.Mode && ((this.LinkedView == null && hostVmciAccessManagerAccessSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostVmciAccessManagerAccessSpec.LinkedView))));\n        }\n\n        public override bool Equals(object hostVmciAccessManagerAccessSpec)\n        {\n            return Equals(hostVmciAccessManagerAccessSpec as HostVmciAccessManagerAccessSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Services + \"_\" + Mode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostVmciAccessManagerAccessSpec_LinkedView : IEquatable<HostVmciAccessManagerAccessSpec_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(HostVmciAccessManagerAccessSpec_LinkedView hostVmciAccessManagerAccessSpec_LinkedView)\n        {\n            return (hostVmciAccessManagerAccessSpec_LinkedView != null && ((this.Vm == null && hostVmciAccessManagerAccessSpec_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(hostVmciAccessManagerAccessSpec_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object hostVmciAccessManagerAccessSpec_LinkedView)\n        {\n            return Equals(hostVmciAccessManagerAccessSpec_LinkedView as HostVmciAccessManagerAccessSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class HostVmfsRescanResult : DynamicData, IEquatable<HostVmfsRescanResult>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public HostVmfsRescanResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostVmfsRescanResult hostVmfsRescanResult)\n        {\n            return (hostVmfsRescanResult != null && ((this.Host == null && hostVmfsRescanResult.Host == null) || (this.Host != null && this.Host.Equals(hostVmfsRescanResult.Host))) && ((this.Fault == null && hostVmfsRescanResult.Fault == null) || (this.Fault != null && this.Fault.Equals(hostVmfsRescanResult.Fault))) && ((this.LinkedView == null && hostVmfsRescanResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostVmfsRescanResult.LinkedView))));\n        }\n\n        public override bool Equals(object hostVmfsRescanResult)\n        {\n            return Equals(hostVmfsRescanResult as HostVmfsRescanResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Fault + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostVmfsRescanResult_LinkedView : IEquatable<HostVmfsRescanResult_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostVmfsRescanResult_LinkedView hostVmfsRescanResult_LinkedView)\n        {\n            return (hostVmfsRescanResult_LinkedView != null && ((this.Host == null && hostVmfsRescanResult_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostVmfsRescanResult_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostVmfsRescanResult_LinkedView)\n        {\n            return Equals(hostVmfsRescanResult_LinkedView as HostVmfsRescanResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostVmfsSpec : DynamicData, IEquatable<HostVmfsSpec>\n    {\n        public HostScsiDiskPartition Extent { get; set; }\n\n        public int? BlockSizeMb { get; set; }\n\n        public int MajorVersion { get; set; }\n\n        public string VolumeName { get; set; }\n\n        public int? BlockSize { get; set; }\n\n        public int? UnmapGranularity { get; set; }\n\n        public string UnmapPriority { get; set; }\n\n        public VmfsUnmapBandwidthSpec UnmapBandwidthSpec { get; set; }\n\n        public bool Equals(HostVmfsSpec hostVmfsSpec)\n        {\n            return (hostVmfsSpec != null && ((this.Extent == null && hostVmfsSpec.Extent == null) || (this.Extent != null && this.Extent.Equals(hostVmfsSpec.Extent))) && ((this.BlockSizeMb == null && hostVmfsSpec.BlockSizeMb == null) || (this.BlockSizeMb != null && this.BlockSizeMb.Equals(hostVmfsSpec.BlockSizeMb))) && this.MajorVersion == hostVmfsSpec.MajorVersion && this.VolumeName == hostVmfsSpec.VolumeName && ((this.BlockSize == null && hostVmfsSpec.BlockSize == null) || (this.BlockSize != null && this.BlockSize.Equals(hostVmfsSpec.BlockSize))) && ((this.UnmapGranularity == null && hostVmfsSpec.UnmapGranularity == null) || (this.UnmapGranularity != null && this.UnmapGranularity.Equals(hostVmfsSpec.UnmapGranularity))) && this.UnmapPriority == hostVmfsSpec.UnmapPriority && ((this.UnmapBandwidthSpec == null && hostVmfsSpec.UnmapBandwidthSpec == null) || (this.UnmapBandwidthSpec != null && this.UnmapBandwidthSpec.Equals(hostVmfsSpec.UnmapBandwidthSpec))));\n        }\n\n        public override bool Equals(object hostVmfsSpec)\n        {\n            return Equals(hostVmfsSpec as HostVmfsSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Extent + \"_\" + BlockSizeMb + \"_\" + MajorVersion + \"_\" + VolumeName + \"_\" + BlockSize + \"_\" + UnmapGranularity + \"_\" + UnmapPriority + \"_\" + UnmapBandwidthSpec).GetHashCode();\n        }\n    }\n\n    public class HostVmfsVolume : HostFileSystemVolume, IEquatable<HostVmfsVolume>\n    {\n        public int BlockSizeMb { get; set; }\n\n        public int? BlockSize { get; set; }\n\n        public int? UnmapGranularity { get; set; }\n\n        public string UnmapPriority { get; set; }\n\n        public VmfsUnmapBandwidthSpec UnmapBandwidthSpec { get; set; }\n\n        public int MaxBlocks { get; set; }\n\n        public int MajorVersion { get; set; }\n\n        public string Version { get; set; }\n\n        public string Uuid { get; set; }\n\n        public HostScsiDiskPartition[] Extent { get; set; }\n\n        public bool VmfsUpgradable { get; set; }\n\n        public HostForceMountedInfo ForceMountedInfo { get; set; }\n\n        public bool? Ssd { get; set; }\n\n        public bool? Local { get; set; }\n\n        public string ScsiDiskType { get; set; }\n\n        public bool Equals(HostVmfsVolume hostVmfsVolume)\n        {\n            return (hostVmfsVolume != null && this.BlockSizeMb == hostVmfsVolume.BlockSizeMb && ((this.BlockSize == null && hostVmfsVolume.BlockSize == null) || (this.BlockSize != null && this.BlockSize.Equals(hostVmfsVolume.BlockSize))) && ((this.UnmapGranularity == null && hostVmfsVolume.UnmapGranularity == null) || (this.UnmapGranularity != null && this.UnmapGranularity.Equals(hostVmfsVolume.UnmapGranularity))) && this.UnmapPriority == hostVmfsVolume.UnmapPriority && ((this.UnmapBandwidthSpec == null && hostVmfsVolume.UnmapBandwidthSpec == null) || (this.UnmapBandwidthSpec != null && this.UnmapBandwidthSpec.Equals(hostVmfsVolume.UnmapBandwidthSpec))) && this.MaxBlocks == hostVmfsVolume.MaxBlocks && this.MajorVersion == hostVmfsVolume.MajorVersion && this.Version == hostVmfsVolume.Version && this.Uuid == hostVmfsVolume.Uuid && ((this.Extent == null && hostVmfsVolume.Extent == null) || (this.Extent != null && hostVmfsVolume.Extent != null && Enumerable.SequenceEqual(this.Extent, hostVmfsVolume.Extent))) && this.VmfsUpgradable == hostVmfsVolume.VmfsUpgradable && ((this.ForceMountedInfo == null && hostVmfsVolume.ForceMountedInfo == null) || (this.ForceMountedInfo != null && this.ForceMountedInfo.Equals(hostVmfsVolume.ForceMountedInfo))) && ((this.Ssd == null && hostVmfsVolume.Ssd == null) || (this.Ssd != null && this.Ssd.Equals(hostVmfsVolume.Ssd))) && ((this.Local == null && hostVmfsVolume.Local == null) || (this.Local != null && this.Local.Equals(hostVmfsVolume.Local))) && this.ScsiDiskType == hostVmfsVolume.ScsiDiskType);\n        }\n\n        public override bool Equals(object hostVmfsVolume)\n        {\n            return Equals(hostVmfsVolume as HostVmfsVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BlockSizeMb + \"_\" + BlockSize + \"_\" + UnmapGranularity + \"_\" + UnmapPriority + \"_\" + UnmapBandwidthSpec + \"_\" + MaxBlocks + \"_\" + MajorVersion + \"_\" + Version + \"_\" + Uuid + \"_\" + Extent + \"_\" + VmfsUpgradable + \"_\" + ForceMountedInfo + \"_\" + Ssd + \"_\" + Local + \"_\" + ScsiDiskType).GetHashCode();\n        }\n    }\n\n    public class HostVMotionCompatibility : DynamicData, IEquatable<HostVMotionCompatibility>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string[] Compatibility { get; set; }\n\n        public HostVMotionCompatibility_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HostVMotionCompatibility hostVMotionCompatibility)\n        {\n            return (hostVMotionCompatibility != null && ((this.Host == null && hostVMotionCompatibility.Host == null) || (this.Host != null && this.Host.Equals(hostVMotionCompatibility.Host))) && ((this.Compatibility == null && hostVMotionCompatibility.Compatibility == null) || (this.Compatibility != null && hostVMotionCompatibility.Compatibility != null && Enumerable.SequenceEqual(this.Compatibility, hostVMotionCompatibility.Compatibility))) && ((this.LinkedView == null && hostVMotionCompatibility.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(hostVMotionCompatibility.LinkedView))));\n        }\n\n        public override bool Equals(object hostVMotionCompatibility)\n        {\n            return Equals(hostVMotionCompatibility as HostVMotionCompatibility);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Compatibility + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HostVMotionCompatibility_LinkedView : IEquatable<HostVMotionCompatibility_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(HostVMotionCompatibility_LinkedView hostVMotionCompatibility_LinkedView)\n        {\n            return (hostVMotionCompatibility_LinkedView != null && ((this.Host == null && hostVMotionCompatibility_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(hostVMotionCompatibility_LinkedView.Host))));\n        }\n\n        public override bool Equals(object hostVMotionCompatibility_LinkedView)\n        {\n            return Equals(hostVMotionCompatibility_LinkedView as HostVMotionCompatibility_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class HostVMotionConfig : DynamicData, IEquatable<HostVMotionConfig>\n    {\n        public string VmotionNicKey { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public bool Equals(HostVMotionConfig hostVMotionConfig)\n        {\n            return (hostVMotionConfig != null && this.VmotionNicKey == hostVMotionConfig.VmotionNicKey && this.Enabled == hostVMotionConfig.Enabled);\n        }\n\n        public override bool Equals(object hostVMotionConfig)\n        {\n            return Equals(hostVMotionConfig as HostVMotionConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmotionNicKey + \"_\" + Enabled).GetHashCode();\n        }\n    }\n\n    public class HostVMotionInfo : DynamicData, IEquatable<HostVMotionInfo>\n    {\n        public HostVMotionNetConfig NetConfig { get; set; }\n\n        public HostIpConfig IpConfig { get; set; }\n\n        public bool Equals(HostVMotionInfo hostVMotionInfo)\n        {\n            return (hostVMotionInfo != null && ((this.NetConfig == null && hostVMotionInfo.NetConfig == null) || (this.NetConfig != null && this.NetConfig.Equals(hostVMotionInfo.NetConfig))) && ((this.IpConfig == null && hostVMotionInfo.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(hostVMotionInfo.IpConfig))));\n        }\n\n        public override bool Equals(object hostVMotionInfo)\n        {\n            return Equals(hostVMotionInfo as HostVMotionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetConfig + \"_\" + IpConfig).GetHashCode();\n        }\n    }\n\n    public class HostVMotionNetConfig : DynamicData, IEquatable<HostVMotionNetConfig>\n    {\n        public HostVirtualNic[] CandidateVnic { get; set; }\n\n        public string SelectedVnic { get; set; }\n\n        public bool Equals(HostVMotionNetConfig hostVMotionNetConfig)\n        {\n            return (hostVMotionNetConfig != null && ((this.CandidateVnic == null && hostVMotionNetConfig.CandidateVnic == null) || (this.CandidateVnic != null && hostVMotionNetConfig.CandidateVnic != null && Enumerable.SequenceEqual(this.CandidateVnic, hostVMotionNetConfig.CandidateVnic))) && this.SelectedVnic == hostVMotionNetConfig.SelectedVnic);\n        }\n\n        public override bool Equals(object hostVMotionNetConfig)\n        {\n            return Equals(hostVMotionNetConfig as HostVMotionNetConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CandidateVnic + \"_\" + SelectedVnic).GetHashCode();\n        }\n    }\n\n    public class HostVMotionSystem : ExtensibleManagedObject, IEquatable<HostVMotionSystem>\n    {\n        public HostVMotionNetConfig NetConfig { get; set; }\n\n        public HostIpConfig IpConfig { get; set; }\n\n        public void UpdateIpConfig(HostIpConfig ipConfig)\n        {\n        }\n\n        public void SelectVnic(string device)\n        {\n        }\n\n        public void DeselectVnic()\n        {\n        }\n\n        public bool Equals(HostVMotionSystem hostVMotionSystem)\n        {\n            return (hostVMotionSystem != null && ((this.NetConfig == null && hostVMotionSystem.NetConfig == null) || (this.NetConfig != null && this.NetConfig.Equals(hostVMotionSystem.NetConfig))) && ((this.IpConfig == null && hostVMotionSystem.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(hostVMotionSystem.IpConfig))));\n        }\n\n        public override bool Equals(object hostVMotionSystem)\n        {\n            return Equals(hostVMotionSystem as HostVMotionSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetConfig + \"_\" + IpConfig).GetHashCode();\n        }\n    }\n\n    public class HostVnicConnectedToCustomizedDVPortEvent : HostEvent, IEquatable<HostVnicConnectedToCustomizedDVPortEvent>\n    {\n        public VnicPortArgument Vnic { get; set; }\n\n        public string PrevPortKey { get; set; }\n\n        public bool Equals(HostVnicConnectedToCustomizedDVPortEvent hostVnicConnectedToCustomizedDVPortEvent)\n        {\n            return (hostVnicConnectedToCustomizedDVPortEvent != null && ((this.Vnic == null && hostVnicConnectedToCustomizedDVPortEvent.Vnic == null) || (this.Vnic != null && this.Vnic.Equals(hostVnicConnectedToCustomizedDVPortEvent.Vnic))) && this.PrevPortKey == hostVnicConnectedToCustomizedDVPortEvent.PrevPortKey);\n        }\n\n        public override bool Equals(object hostVnicConnectedToCustomizedDVPortEvent)\n        {\n            return Equals(hostVnicConnectedToCustomizedDVPortEvent as HostVnicConnectedToCustomizedDVPortEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vnic + \"_\" + PrevPortKey).GetHashCode();\n        }\n    }\n\n    public class HostVsanInternalSystem : ViewBase, IEquatable<HostVsanInternalSystem>\n    {\n        public string QueryCmmds(HostVsanInternalSystemCmmdsQuery[] queries)\n        {\n            return default(string);\n        }\n\n        public string QueryPhysicalVsanDisks(string[] props)\n        {\n            return default(string);\n        }\n\n        public string QueryVsanObjects(string[] uuids)\n        {\n            return default(string);\n        }\n\n        public string QueryObjectsOnPhysicalVsanDisk(string[] disks)\n        {\n            return default(string);\n        }\n\n        public string[] AbdicateDomOwnership(string[] uuids)\n        {\n            return default(string[]);\n        }\n\n        public string QueryVsanStatistics(string[] labels)\n        {\n            return default(string);\n        }\n\n        public void ReconfigureDomObject(string uuid, string policy)\n        {\n        }\n\n        public string QuerySyncingVsanObjects(string[] uuids)\n        {\n            return default(string);\n        }\n\n        public HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult[] RunVsanPhysicalDiskDiagnostics(string[] disks)\n        {\n            return default(HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult[]);\n        }\n\n        public string GetVsanObjExtAttrs(string[] uuids)\n        {\n            return default(string);\n        }\n\n        public VsanPolicySatisfiability[] ReconfigurationSatisfiable(VsanPolicyChangeBatch[] pcbs, bool? ignoreSatisfiability)\n        {\n            return default(VsanPolicySatisfiability[]);\n        }\n\n        public VsanPolicySatisfiability[] CanProvisionObjects(VsanNewPolicyBatch[] npbs, bool? ignoreSatisfiability)\n        {\n            return default(VsanPolicySatisfiability[]);\n        }\n\n        public HostVsanInternalSystemDeleteVsanObjectsResult[] DeleteVsanObjects(string[] uuids, bool? force)\n        {\n            return default(HostVsanInternalSystemDeleteVsanObjectsResult[]);\n        }\n\n        public HostVsanInternalSystemVsanObjectOperationResult[] UpgradeVsanObjects(string[] uuids, int newVersion)\n        {\n            return default(HostVsanInternalSystemVsanObjectOperationResult[]);\n        }\n\n        public string[] QueryVsanObjectUuidsByFilter(string[] uuids, int? limit, int? version)\n        {\n            return default(string[]);\n        }\n\n        public bool Equals(HostVsanInternalSystem hostVsanInternalSystem)\n        {\n            return (hostVsanInternalSystem != null && base.Equals(hostVsanInternalSystem));\n        }\n\n        public override bool Equals(object hostVsanInternalSystem)\n        {\n            return Equals(hostVsanInternalSystem as HostVsanInternalSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostVsanInternalSystemCmmdsQuery : DynamicData, IEquatable<HostVsanInternalSystemCmmdsQuery>\n    {\n        public string Type { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string Owner { get; set; }\n\n        public bool Equals(HostVsanInternalSystemCmmdsQuery hostVsanInternalSystemCmmdsQuery)\n        {\n            return (hostVsanInternalSystemCmmdsQuery != null && this.Type == hostVsanInternalSystemCmmdsQuery.Type && this.Uuid == hostVsanInternalSystemCmmdsQuery.Uuid && this.Owner == hostVsanInternalSystemCmmdsQuery.Owner);\n        }\n\n        public override bool Equals(object hostVsanInternalSystemCmmdsQuery)\n        {\n            return Equals(hostVsanInternalSystemCmmdsQuery as HostVsanInternalSystemCmmdsQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Uuid + \"_\" + Owner).GetHashCode();\n        }\n    }\n\n    public class HostVsanInternalSystemDeleteVsanObjectsResult : DynamicData, IEquatable<HostVsanInternalSystemDeleteVsanObjectsResult>\n    {\n        public string Uuid { get; set; }\n\n        public bool Success { get; set; }\n\n        public LocalizableMessage[] FailureReason { get; set; }\n\n        public bool Equals(HostVsanInternalSystemDeleteVsanObjectsResult hostVsanInternalSystemDeleteVsanObjectsResult)\n        {\n            return (hostVsanInternalSystemDeleteVsanObjectsResult != null && this.Uuid == hostVsanInternalSystemDeleteVsanObjectsResult.Uuid && this.Success == hostVsanInternalSystemDeleteVsanObjectsResult.Success && ((this.FailureReason == null && hostVsanInternalSystemDeleteVsanObjectsResult.FailureReason == null) || (this.FailureReason != null && hostVsanInternalSystemDeleteVsanObjectsResult.FailureReason != null && Enumerable.SequenceEqual(this.FailureReason, hostVsanInternalSystemDeleteVsanObjectsResult.FailureReason))));\n        }\n\n        public override bool Equals(object hostVsanInternalSystemDeleteVsanObjectsResult)\n        {\n            return Equals(hostVsanInternalSystemDeleteVsanObjectsResult as HostVsanInternalSystemDeleteVsanObjectsResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + Success + \"_\" + FailureReason).GetHashCode();\n        }\n    }\n\n    public class HostVsanInternalSystemVsanObjectOperationResult : DynamicData, IEquatable<HostVsanInternalSystemVsanObjectOperationResult>\n    {\n        public string Uuid { get; set; }\n\n        public LocalizableMessage[] FailureReason { get; set; }\n\n        public bool Equals(HostVsanInternalSystemVsanObjectOperationResult hostVsanInternalSystemVsanObjectOperationResult)\n        {\n            return (hostVsanInternalSystemVsanObjectOperationResult != null && this.Uuid == hostVsanInternalSystemVsanObjectOperationResult.Uuid && ((this.FailureReason == null && hostVsanInternalSystemVsanObjectOperationResult.FailureReason == null) || (this.FailureReason != null && hostVsanInternalSystemVsanObjectOperationResult.FailureReason != null && Enumerable.SequenceEqual(this.FailureReason, hostVsanInternalSystemVsanObjectOperationResult.FailureReason))));\n        }\n\n        public override bool Equals(object hostVsanInternalSystemVsanObjectOperationResult)\n        {\n            return Equals(hostVsanInternalSystemVsanObjectOperationResult as HostVsanInternalSystemVsanObjectOperationResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + FailureReason).GetHashCode();\n        }\n    }\n\n    public class HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult : DynamicData, IEquatable<HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult>\n    {\n        public string DiskUuid { get; set; }\n\n        public bool Success { get; set; }\n\n        public string FailureReason { get; set; }\n\n        public bool Equals(HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult)\n        {\n            return (hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult != null && this.DiskUuid == hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult.DiskUuid && this.Success == hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult.Success && this.FailureReason == hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult.FailureReason);\n        }\n\n        public override bool Equals(object hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult)\n        {\n            return Equals(hostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult as HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskUuid + \"_\" + Success + \"_\" + FailureReason).GetHashCode();\n        }\n    }\n\n    public class HostVsanSystem : ViewBase, IEquatable<HostVsanSystem>\n    {\n        public VsanHostConfigInfo Config { get; set; }\n\n        public VsanHostDiskResult[] QueryDisksForVsan(string[] canonicalName)\n        {\n            return default(VsanHostDiskResult[]);\n        }\n\n        public ManagedObjectReference AddDisks_Task(HostScsiDisk[] disk)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VsanHostDiskMapResult[] AddDisks(HostScsiDisk[] disk)\n        {\n            return default(VsanHostDiskMapResult[]);\n        }\n\n        public ManagedObjectReference InitializeDisks_Task(VsanHostDiskMapping[] mapping)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VsanHostDiskMapResult[] InitializeDisks(VsanHostDiskMapping[] mapping)\n        {\n            return default(VsanHostDiskMapResult[]);\n        }\n\n        public ManagedObjectReference RemoveDisk_Task(HostScsiDisk[] disk, HostMaintenanceSpec maintenanceSpec, int? timeout)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VsanHostDiskResult[] RemoveDisk(HostScsiDisk[] disk, HostMaintenanceSpec maintenanceSpec, int? timeout)\n        {\n            return default(VsanHostDiskResult[]);\n        }\n\n        public ManagedObjectReference RemoveDiskMapping_Task(VsanHostDiskMapping[] mapping, HostMaintenanceSpec maintenanceSpec, int? timeout)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VsanHostDiskMapResult[] RemoveDiskMapping(VsanHostDiskMapping[] mapping, HostMaintenanceSpec maintenanceSpec, int? timeout)\n        {\n            return default(VsanHostDiskMapResult[]);\n        }\n\n        public ManagedObjectReference UnmountDiskMapping_Task(VsanHostDiskMapping[] mapping)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VsanHostDiskMapResult[] UnmountDiskMapping(VsanHostDiskMapping[] mapping)\n        {\n            return default(VsanHostDiskMapResult[]);\n        }\n\n        public ManagedObjectReference UpdateVsan_Task(VsanHostConfigInfo config)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpdateVsan(VsanHostConfigInfo config)\n        {\n        }\n\n        public VsanHostClusterStatus QueryHostStatus()\n        {\n            return default(VsanHostClusterStatus);\n        }\n\n        public ManagedObjectReference EvacuateVsanNode_Task(HostMaintenanceSpec maintenanceSpec, int timeout)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void EvacuateVsanNode(HostMaintenanceSpec maintenanceSpec, int timeout)\n        {\n        }\n\n        public ManagedObjectReference RecommissionVsanNode_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RecommissionVsanNode()\n        {\n        }\n\n        public bool Equals(HostVsanSystem hostVsanSystem)\n        {\n            return (hostVsanSystem != null && ((this.Config == null && hostVsanSystem.Config == null) || (this.Config != null && this.Config.Equals(hostVsanSystem.Config))));\n        }\n\n        public override bool Equals(object hostVsanSystem)\n        {\n            return Equals(hostVsanSystem as HostVsanSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Config).GetHashCode();\n        }\n    }\n\n    public class HostVStorageObjectManager : VStorageObjectManagerBase, IEquatable<HostVStorageObjectManager>\n    {\n        public ManagedObjectReference HostCreateDisk_Task(VslmCreateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject HostCreateDisk(VslmCreateSpec spec)\n        {\n            return default(VStorageObject);\n        }\n\n        public VStorageObject HostRegisterDisk(string path, string name)\n        {\n            return default(VStorageObject);\n        }\n\n        public ManagedObjectReference HostExtendDisk_Task(ID id, ManagedObjectReference datastore, long newCapacityInMB)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HostExtendDisk(ID id, ManagedObjectReference datastore, long newCapacityInMB)\n        {\n        }\n\n        public ManagedObjectReference HostInflateDisk_Task(ID id, ManagedObjectReference datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HostInflateDisk(ID id, ManagedObjectReference datastore)\n        {\n        }\n\n        public void HostRenameVStorageObject(ID id, ManagedObjectReference datastore, string name)\n        {\n        }\n\n        public vslmInfrastructureObjectPolicy[] HostRetrieveVStorageInfrastructureObjectPolicy(ManagedObjectReference datastore)\n        {\n            return default(vslmInfrastructureObjectPolicy[]);\n        }\n\n        public ManagedObjectReference HostDeleteVStorageObject_Task(ID id, ManagedObjectReference datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HostDeleteVStorageObject(ID id, ManagedObjectReference datastore)\n        {\n        }\n\n        public VStorageObject HostRetrieveVStorageObject(ID id, ManagedObjectReference datastore)\n        {\n            return default(VStorageObject);\n        }\n\n        public VStorageObjectStateInfo HostRetrieveVStorageObjectState(ID id, ManagedObjectReference datastore)\n        {\n            return default(VStorageObjectStateInfo);\n        }\n\n        public ID[] HostListVStorageObject(ManagedObjectReference datastore)\n        {\n            return default(ID[]);\n        }\n\n        public ManagedObjectReference HostCloneVStorageObject_Task(ID id, ManagedObjectReference datastore, VslmCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject HostCloneVStorageObject(ID id, ManagedObjectReference datastore, VslmCloneSpec spec)\n        {\n            return default(VStorageObject);\n        }\n\n        public ManagedObjectReference HostRelocateVStorageObject_Task(ID id, ManagedObjectReference datastore, VslmRelocateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject HostRelocateVStorageObject(ID id, ManagedObjectReference datastore, VslmRelocateSpec spec)\n        {\n            return default(VStorageObject);\n        }\n\n        public void HostSetVStorageObjectControlFlags(ID id, ManagedObjectReference datastore, string[] controlFlags)\n        {\n        }\n\n        public void HostClearVStorageObjectControlFlags(ID id, ManagedObjectReference datastore, string[] controlFlags)\n        {\n        }\n\n        public ManagedObjectReference HostReconcileDatastoreInventory_Task(ManagedObjectReference datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HostReconcileDatastoreInventory(ManagedObjectReference datastore)\n        {\n        }\n\n        public void HostScheduleReconcileDatastoreInventory(ManagedObjectReference datastore)\n        {\n        }\n\n        public ManagedObjectReference HostVStorageObjectCreateSnapshot_Task(ID id, ManagedObjectReference datastore, string description)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ID HostVStorageObjectCreateSnapshot(ID id, ManagedObjectReference datastore, string description)\n        {\n            return default(ID);\n        }\n\n        public ManagedObjectReference HostVStorageObjectDeleteSnapshot_Task(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HostVStorageObjectDeleteSnapshot(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n        }\n\n        public VStorageObjectSnapshotInfo HostVStorageObjectRetrieveSnapshotInfo(ID id, ManagedObjectReference datastore)\n        {\n            return default(VStorageObjectSnapshotInfo);\n        }\n\n        public ManagedObjectReference HostVStorageObjectCreateDiskFromSnapshot_Task(ID id, ManagedObjectReference datastore, ID snapshotId, string name, VirtualMachineProfileSpec[] profile, CryptoSpec crypto, string path)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject HostVStorageObjectCreateDiskFromSnapshot(ID id, ManagedObjectReference datastore, ID snapshotId, string name, VirtualMachineProfileSpec[] profile, CryptoSpec crypto, string path)\n        {\n            return default(VStorageObject);\n        }\n\n        public ManagedObjectReference HostVStorageObjectRevert_Task(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HostVStorageObjectRevert(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n        }\n\n        public bool Equals(HostVStorageObjectManager hostVStorageObjectManager)\n        {\n            return (hostVStorageObjectManager != null && base.Equals(hostVStorageObjectManager));\n        }\n\n        public override bool Equals(object hostVStorageObjectManager)\n        {\n            return Equals(hostVStorageObjectManager as HostVStorageObjectManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HostVvolVolume : HostFileSystemVolume, IEquatable<HostVvolVolume>\n    {\n        public string ScId { get; set; }\n\n        public VVolHostPE[] HostPE { get; set; }\n\n        public VimVasaProviderInfo[] VasaProviderInfo { get; set; }\n\n        public VASAStorageArray[] StorageArray { get; set; }\n\n        public bool Equals(HostVvolVolume hostVvolVolume)\n        {\n            return (hostVvolVolume != null && this.ScId == hostVvolVolume.ScId && ((this.HostPE == null && hostVvolVolume.HostPE == null) || (this.HostPE != null && hostVvolVolume.HostPE != null && Enumerable.SequenceEqual(this.HostPE, hostVvolVolume.HostPE))) && ((this.VasaProviderInfo == null && hostVvolVolume.VasaProviderInfo == null) || (this.VasaProviderInfo != null && hostVvolVolume.VasaProviderInfo != null && Enumerable.SequenceEqual(this.VasaProviderInfo, hostVvolVolume.VasaProviderInfo))) && ((this.StorageArray == null && hostVvolVolume.StorageArray == null) || (this.StorageArray != null && hostVvolVolume.StorageArray != null && Enumerable.SequenceEqual(this.StorageArray, hostVvolVolume.StorageArray))));\n        }\n\n        public override bool Equals(object hostVvolVolume)\n        {\n            return Equals(hostVvolVolume as HostVvolVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScId + \"_\" + HostPE + \"_\" + VasaProviderInfo + \"_\" + StorageArray).GetHashCode();\n        }\n    }\n\n    public class HostVvolVolumeSpecification : DynamicData, IEquatable<HostVvolVolumeSpecification>\n    {\n        public long MaxSizeInMB { get; set; }\n\n        public string VolumeName { get; set; }\n\n        public VimVasaProviderInfo[] VasaProviderInfo { get; set; }\n\n        public VASAStorageArray[] StorageArray { get; set; }\n\n        public string Uuid { get; set; }\n\n        public bool Equals(HostVvolVolumeSpecification hostVvolVolumeSpecification)\n        {\n            return (hostVvolVolumeSpecification != null && this.MaxSizeInMB == hostVvolVolumeSpecification.MaxSizeInMB && this.VolumeName == hostVvolVolumeSpecification.VolumeName && ((this.VasaProviderInfo == null && hostVvolVolumeSpecification.VasaProviderInfo == null) || (this.VasaProviderInfo != null && hostVvolVolumeSpecification.VasaProviderInfo != null && Enumerable.SequenceEqual(this.VasaProviderInfo, hostVvolVolumeSpecification.VasaProviderInfo))) && ((this.StorageArray == null && hostVvolVolumeSpecification.StorageArray == null) || (this.StorageArray != null && hostVvolVolumeSpecification.StorageArray != null && Enumerable.SequenceEqual(this.StorageArray, hostVvolVolumeSpecification.StorageArray))) && this.Uuid == hostVvolVolumeSpecification.Uuid);\n        }\n\n        public override bool Equals(object hostVvolVolumeSpecification)\n        {\n            return Equals(hostVvolVolumeSpecification as HostVvolVolumeSpecification);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxSizeInMB + \"_\" + VolumeName + \"_\" + VasaProviderInfo + \"_\" + StorageArray + \"_\" + Uuid).GetHashCode();\n        }\n    }\n\n    public class HostWwnChangedEvent : HostEvent, IEquatable<HostWwnChangedEvent>\n    {\n        public long[] OldNodeWwns { get; set; }\n\n        public long[] OldPortWwns { get; set; }\n\n        public long[] NewNodeWwns { get; set; }\n\n        public long[] NewPortWwns { get; set; }\n\n        public bool Equals(HostWwnChangedEvent hostWwnChangedEvent)\n        {\n            return (hostWwnChangedEvent != null && ((this.OldNodeWwns == null && hostWwnChangedEvent.OldNodeWwns == null) || (this.OldNodeWwns != null && hostWwnChangedEvent.OldNodeWwns != null && Enumerable.SequenceEqual(this.OldNodeWwns, hostWwnChangedEvent.OldNodeWwns))) && ((this.OldPortWwns == null && hostWwnChangedEvent.OldPortWwns == null) || (this.OldPortWwns != null && hostWwnChangedEvent.OldPortWwns != null && Enumerable.SequenceEqual(this.OldPortWwns, hostWwnChangedEvent.OldPortWwns))) && ((this.NewNodeWwns == null && hostWwnChangedEvent.NewNodeWwns == null) || (this.NewNodeWwns != null && hostWwnChangedEvent.NewNodeWwns != null && Enumerable.SequenceEqual(this.NewNodeWwns, hostWwnChangedEvent.NewNodeWwns))) && ((this.NewPortWwns == null && hostWwnChangedEvent.NewPortWwns == null) || (this.NewPortWwns != null && hostWwnChangedEvent.NewPortWwns != null && Enumerable.SequenceEqual(this.NewPortWwns, hostWwnChangedEvent.NewPortWwns))));\n        }\n\n        public override bool Equals(object hostWwnChangedEvent)\n        {\n            return Equals(hostWwnChangedEvent as HostWwnChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldNodeWwns + \"_\" + OldPortWwns + \"_\" + NewNodeWwns + \"_\" + NewPortWwns).GetHashCode();\n        }\n    }\n\n    public class HostWwnConflictEvent : HostEvent, IEquatable<HostWwnConflictEvent>\n    {\n        public VmEventArgument[] ConflictedVms { get; set; }\n\n        public HostEventArgument[] ConflictedHosts { get; set; }\n\n        public long Wwn { get; set; }\n\n        public bool Equals(HostWwnConflictEvent hostWwnConflictEvent)\n        {\n            return (hostWwnConflictEvent != null && ((this.ConflictedVms == null && hostWwnConflictEvent.ConflictedVms == null) || (this.ConflictedVms != null && hostWwnConflictEvent.ConflictedVms != null && Enumerable.SequenceEqual(this.ConflictedVms, hostWwnConflictEvent.ConflictedVms))) && ((this.ConflictedHosts == null && hostWwnConflictEvent.ConflictedHosts == null) || (this.ConflictedHosts != null && hostWwnConflictEvent.ConflictedHosts != null && Enumerable.SequenceEqual(this.ConflictedHosts, hostWwnConflictEvent.ConflictedHosts))) && this.Wwn == hostWwnConflictEvent.Wwn);\n        }\n\n        public override bool Equals(object hostWwnConflictEvent)\n        {\n            return Equals(hostWwnConflictEvent as HostWwnConflictEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictedVms + \"_\" + ConflictedHosts + \"_\" + Wwn).GetHashCode();\n        }\n    }\n\n    public class HotSnapshotMoveNotSupported : SnapshotCopyNotSupported, IEquatable<HotSnapshotMoveNotSupported>\n    {\n        public bool Equals(HotSnapshotMoveNotSupported hotSnapshotMoveNotSupported)\n        {\n            return (hotSnapshotMoveNotSupported != null && base.Equals(hotSnapshotMoveNotSupported));\n        }\n\n        public override bool Equals(object hotSnapshotMoveNotSupported)\n        {\n            return Equals(hotSnapshotMoveNotSupported as HotSnapshotMoveNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class HourlyTaskScheduler : RecurrentTaskScheduler, IEquatable<HourlyTaskScheduler>\n    {\n        public int Minute { get; set; }\n\n        public bool Equals(HourlyTaskScheduler hourlyTaskScheduler)\n        {\n            return (hourlyTaskScheduler != null && this.Minute == hourlyTaskScheduler.Minute);\n        }\n\n        public override bool Equals(object hourlyTaskScheduler)\n        {\n            return Equals(hourlyTaskScheduler as HourlyTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Minute).GetHashCode();\n        }\n    }\n\n    public class HttpFault : VimFault, IEquatable<HttpFault>\n    {\n        public int StatusCode { get; set; }\n\n        public string StatusMessage { get; set; }\n\n        public bool Equals(HttpFault httpFault)\n        {\n            return (httpFault != null && this.StatusCode == httpFault.StatusCode && this.StatusMessage == httpFault.StatusMessage);\n        }\n\n        public override bool Equals(object httpFault)\n        {\n            return Equals(httpFault as HttpFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StatusCode + \"_\" + StatusMessage).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLease : ViewBase, IEquatable<HttpNfcLease>\n    {\n        public int InitializeProgress { get; set; }\n\n        public int TransferProgress { get; set; }\n\n        public string Mode { get; set; }\n\n        public HttpNfcLeaseCapabilities Capabilities { get; set; }\n\n        public HttpNfcLeaseInfo Info { get; set; }\n\n        public HttpNfcLeaseState State { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public HttpNfcLeaseManifestEntry[] HttpNfcLeaseGetManifest()\n        {\n            return default(HttpNfcLeaseManifestEntry[]);\n        }\n\n        public void HttpNfcLeaseSetManifestChecksumType(KeyValue[] deviceUrlsToChecksumTypes)\n        {\n        }\n\n        public void HttpNfcLeaseComplete()\n        {\n        }\n\n        public void HttpNfcLeaseAbort(LocalizedMethodFault fault)\n        {\n        }\n\n        public void HttpNfcLeaseProgress(int percent)\n        {\n        }\n\n        public ManagedObjectReference HttpNfcLeasePullFromUrls_Task(HttpNfcLeaseSourceFile[] files)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void HttpNfcLeasePullFromUrls(HttpNfcLeaseSourceFile[] files)\n        {\n        }\n\n        public bool Equals(HttpNfcLease httpNfcLease)\n        {\n            return (httpNfcLease != null && this.InitializeProgress == httpNfcLease.InitializeProgress && this.TransferProgress == httpNfcLease.TransferProgress && this.Mode == httpNfcLease.Mode && ((this.Capabilities == null && httpNfcLease.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(httpNfcLease.Capabilities))) && ((this.Info == null && httpNfcLease.Info == null) || (this.Info != null && this.Info.Equals(httpNfcLease.Info))) && this.State == httpNfcLease.State && ((this.Error == null && httpNfcLease.Error == null) || (this.Error != null && this.Error.Equals(httpNfcLease.Error))));\n        }\n\n        public override bool Equals(object httpNfcLease)\n        {\n            return Equals(httpNfcLease as HttpNfcLease);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InitializeProgress + \"_\" + TransferProgress + \"_\" + Mode + \"_\" + Capabilities + \"_\" + Info + \"_\" + State + \"_\" + Error).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseCapabilities : DynamicData, IEquatable<HttpNfcLeaseCapabilities>\n    {\n        public bool PullModeSupported { get; set; }\n\n        public bool CorsSupported { get; set; }\n\n        public bool Equals(HttpNfcLeaseCapabilities httpNfcLeaseCapabilities)\n        {\n            return (httpNfcLeaseCapabilities != null && this.PullModeSupported == httpNfcLeaseCapabilities.PullModeSupported && this.CorsSupported == httpNfcLeaseCapabilities.CorsSupported);\n        }\n\n        public override bool Equals(object httpNfcLeaseCapabilities)\n        {\n            return Equals(httpNfcLeaseCapabilities as HttpNfcLeaseCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PullModeSupported + \"_\" + CorsSupported).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseDatastoreLeaseInfo : DynamicData, IEquatable<HttpNfcLeaseDatastoreLeaseInfo>\n    {\n        public string DatastoreKey { get; set; }\n\n        public HttpNfcLeaseHostInfo[] Hosts { get; set; }\n\n        public bool Equals(HttpNfcLeaseDatastoreLeaseInfo httpNfcLeaseDatastoreLeaseInfo)\n        {\n            return (httpNfcLeaseDatastoreLeaseInfo != null && this.DatastoreKey == httpNfcLeaseDatastoreLeaseInfo.DatastoreKey && ((this.Hosts == null && httpNfcLeaseDatastoreLeaseInfo.Hosts == null) || (this.Hosts != null && httpNfcLeaseDatastoreLeaseInfo.Hosts != null && Enumerable.SequenceEqual(this.Hosts, httpNfcLeaseDatastoreLeaseInfo.Hosts))));\n        }\n\n        public override bool Equals(object httpNfcLeaseDatastoreLeaseInfo)\n        {\n            return Equals(httpNfcLeaseDatastoreLeaseInfo as HttpNfcLeaseDatastoreLeaseInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreKey + \"_\" + Hosts).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseDeviceUrl : DynamicData, IEquatable<HttpNfcLeaseDeviceUrl>\n    {\n        public string Key { get; set; }\n\n        public string ImportKey { get; set; }\n\n        public string Url { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public bool? Disk { get; set; }\n\n        public string TargetId { get; set; }\n\n        public string DatastoreKey { get; set; }\n\n        public long? FileSize { get; set; }\n\n        public bool Equals(HttpNfcLeaseDeviceUrl httpNfcLeaseDeviceUrl)\n        {\n            return (httpNfcLeaseDeviceUrl != null && this.Key == httpNfcLeaseDeviceUrl.Key && this.ImportKey == httpNfcLeaseDeviceUrl.ImportKey && this.Url == httpNfcLeaseDeviceUrl.Url && this.SslThumbprint == httpNfcLeaseDeviceUrl.SslThumbprint && ((this.Disk == null && httpNfcLeaseDeviceUrl.Disk == null) || (this.Disk != null && this.Disk.Equals(httpNfcLeaseDeviceUrl.Disk))) && this.TargetId == httpNfcLeaseDeviceUrl.TargetId && this.DatastoreKey == httpNfcLeaseDeviceUrl.DatastoreKey && ((this.FileSize == null && httpNfcLeaseDeviceUrl.FileSize == null) || (this.FileSize != null && this.FileSize.Equals(httpNfcLeaseDeviceUrl.FileSize))));\n        }\n\n        public override bool Equals(object httpNfcLeaseDeviceUrl)\n        {\n            return Equals(httpNfcLeaseDeviceUrl as HttpNfcLeaseDeviceUrl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ImportKey + \"_\" + Url + \"_\" + SslThumbprint + \"_\" + Disk + \"_\" + TargetId + \"_\" + DatastoreKey + \"_\" + FileSize).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseHostInfo : DynamicData, IEquatable<HttpNfcLeaseHostInfo>\n    {\n        public string Url { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public bool Equals(HttpNfcLeaseHostInfo httpNfcLeaseHostInfo)\n        {\n            return (httpNfcLeaseHostInfo != null && this.Url == httpNfcLeaseHostInfo.Url && this.SslThumbprint == httpNfcLeaseHostInfo.SslThumbprint);\n        }\n\n        public override bool Equals(object httpNfcLeaseHostInfo)\n        {\n            return Equals(httpNfcLeaseHostInfo as HttpNfcLeaseHostInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Url + \"_\" + SslThumbprint).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseInfo : DynamicData, IEquatable<HttpNfcLeaseInfo>\n    {\n        public ManagedObjectReference Lease { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public HttpNfcLeaseDeviceUrl[] DeviceUrl { get; set; }\n\n        public long TotalDiskCapacityInKB { get; set; }\n\n        public int LeaseTimeout { get; set; }\n\n        public HttpNfcLeaseDatastoreLeaseInfo[] HostMap { get; set; }\n\n        public HttpNfcLeaseInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(HttpNfcLeaseInfo httpNfcLeaseInfo)\n        {\n            return (httpNfcLeaseInfo != null && ((this.Lease == null && httpNfcLeaseInfo.Lease == null) || (this.Lease != null && this.Lease.Equals(httpNfcLeaseInfo.Lease))) && ((this.Entity == null && httpNfcLeaseInfo.Entity == null) || (this.Entity != null && this.Entity.Equals(httpNfcLeaseInfo.Entity))) && ((this.DeviceUrl == null && httpNfcLeaseInfo.DeviceUrl == null) || (this.DeviceUrl != null && httpNfcLeaseInfo.DeviceUrl != null && Enumerable.SequenceEqual(this.DeviceUrl, httpNfcLeaseInfo.DeviceUrl))) && this.TotalDiskCapacityInKB == httpNfcLeaseInfo.TotalDiskCapacityInKB && this.LeaseTimeout == httpNfcLeaseInfo.LeaseTimeout && ((this.HostMap == null && httpNfcLeaseInfo.HostMap == null) || (this.HostMap != null && httpNfcLeaseInfo.HostMap != null && Enumerable.SequenceEqual(this.HostMap, httpNfcLeaseInfo.HostMap))) && ((this.LinkedView == null && httpNfcLeaseInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(httpNfcLeaseInfo.LinkedView))));\n        }\n\n        public override bool Equals(object httpNfcLeaseInfo)\n        {\n            return Equals(httpNfcLeaseInfo as HttpNfcLeaseInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Lease + \"_\" + Entity + \"_\" + DeviceUrl + \"_\" + TotalDiskCapacityInKB + \"_\" + LeaseTimeout + \"_\" + HostMap + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseInfo_LinkedView : IEquatable<HttpNfcLeaseInfo_LinkedView>\n    {\n        public HttpNfcLease Lease { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(HttpNfcLeaseInfo_LinkedView httpNfcLeaseInfo_LinkedView)\n        {\n            return (httpNfcLeaseInfo_LinkedView != null && ((this.Lease == null && httpNfcLeaseInfo_LinkedView.Lease == null) || (this.Lease != null && this.Lease.Equals(httpNfcLeaseInfo_LinkedView.Lease))) && ((this.Entity == null && httpNfcLeaseInfo_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(httpNfcLeaseInfo_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object httpNfcLeaseInfo_LinkedView)\n        {\n            return Equals(httpNfcLeaseInfo_LinkedView as HttpNfcLeaseInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Lease + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseManifestEntry : DynamicData, IEquatable<HttpNfcLeaseManifestEntry>\n    {\n        public string Key { get; set; }\n\n        public string Sha1 { get; set; }\n\n        public string Checksum { get; set; }\n\n        public string ChecksumType { get; set; }\n\n        public long Size { get; set; }\n\n        public bool Disk { get; set; }\n\n        public long? Capacity { get; set; }\n\n        public long? PopulatedSize { get; set; }\n\n        public bool Equals(HttpNfcLeaseManifestEntry httpNfcLeaseManifestEntry)\n        {\n            return (httpNfcLeaseManifestEntry != null && this.Key == httpNfcLeaseManifestEntry.Key && this.Sha1 == httpNfcLeaseManifestEntry.Sha1 && this.Checksum == httpNfcLeaseManifestEntry.Checksum && this.ChecksumType == httpNfcLeaseManifestEntry.ChecksumType && this.Size == httpNfcLeaseManifestEntry.Size && this.Disk == httpNfcLeaseManifestEntry.Disk && ((this.Capacity == null && httpNfcLeaseManifestEntry.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(httpNfcLeaseManifestEntry.Capacity))) && ((this.PopulatedSize == null && httpNfcLeaseManifestEntry.PopulatedSize == null) || (this.PopulatedSize != null && this.PopulatedSize.Equals(httpNfcLeaseManifestEntry.PopulatedSize))));\n        }\n\n        public override bool Equals(object httpNfcLeaseManifestEntry)\n        {\n            return Equals(httpNfcLeaseManifestEntry as HttpNfcLeaseManifestEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Sha1 + \"_\" + Checksum + \"_\" + ChecksumType + \"_\" + Size + \"_\" + Disk + \"_\" + Capacity + \"_\" + PopulatedSize).GetHashCode();\n        }\n    }\n\n    public class HttpNfcLeaseSourceFile : DynamicData, IEquatable<HttpNfcLeaseSourceFile>\n    {\n        public string TargetDeviceId { get; set; }\n\n        public string Url { get; set; }\n\n        public string MemberName { get; set; }\n\n        public bool Create { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public KeyValue[] HttpHeaders { get; set; }\n\n        public long? Size { get; set; }\n\n        public bool Equals(HttpNfcLeaseSourceFile httpNfcLeaseSourceFile)\n        {\n            return (httpNfcLeaseSourceFile != null && this.TargetDeviceId == httpNfcLeaseSourceFile.TargetDeviceId && this.Url == httpNfcLeaseSourceFile.Url && this.MemberName == httpNfcLeaseSourceFile.MemberName && this.Create == httpNfcLeaseSourceFile.Create && this.SslThumbprint == httpNfcLeaseSourceFile.SslThumbprint && ((this.HttpHeaders == null && httpNfcLeaseSourceFile.HttpHeaders == null) || (this.HttpHeaders != null && httpNfcLeaseSourceFile.HttpHeaders != null && Enumerable.SequenceEqual(this.HttpHeaders, httpNfcLeaseSourceFile.HttpHeaders))) && ((this.Size == null && httpNfcLeaseSourceFile.Size == null) || (this.Size != null && this.Size.Equals(httpNfcLeaseSourceFile.Size))));\n        }\n\n        public override bool Equals(object httpNfcLeaseSourceFile)\n        {\n            return Equals(httpNfcLeaseSourceFile as HttpNfcLeaseSourceFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TargetDeviceId + \"_\" + Url + \"_\" + MemberName + \"_\" + Create + \"_\" + SslThumbprint + \"_\" + HttpHeaders + \"_\" + Size).GetHashCode();\n        }\n    }\n\n    public class ID : DynamicData, IEquatable<ID>\n    {\n        public string Id { get; set; }\n\n        public bool Equals(ID iD)\n        {\n            return (iD != null && this.Id == iD.Id);\n        }\n\n        public override bool Equals(object iD)\n        {\n            return Equals(iD as ID);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id).GetHashCode();\n        }\n    }\n\n    public class IDEDiskNotSupported : DiskNotSupported, IEquatable<IDEDiskNotSupported>\n    {\n        public bool Equals(IDEDiskNotSupported iDEDiskNotSupported)\n        {\n            return (iDEDiskNotSupported != null && base.Equals(iDEDiskNotSupported));\n        }\n\n        public override bool Equals(object iDEDiskNotSupported)\n        {\n            return Equals(iDEDiskNotSupported as IDEDiskNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ImportHostAddFailure : DvsFault, IEquatable<ImportHostAddFailure>\n    {\n        public string[] HostIp { get; set; }\n\n        public bool Equals(ImportHostAddFailure importHostAddFailure)\n        {\n            return (importHostAddFailure != null && ((this.HostIp == null && importHostAddFailure.HostIp == null) || (this.HostIp != null && importHostAddFailure.HostIp != null && Enumerable.SequenceEqual(this.HostIp, importHostAddFailure.HostIp))));\n        }\n\n        public override bool Equals(object importHostAddFailure)\n        {\n            return Equals(importHostAddFailure as ImportHostAddFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostIp).GetHashCode();\n        }\n    }\n\n    public class ImportOperationBulkFault : DvsFault, IEquatable<ImportOperationBulkFault>\n    {\n        public ImportOperationBulkFaultFaultOnImport[] ImportFaults { get; set; }\n\n        public bool Equals(ImportOperationBulkFault importOperationBulkFault)\n        {\n            return (importOperationBulkFault != null && ((this.ImportFaults == null && importOperationBulkFault.ImportFaults == null) || (this.ImportFaults != null && importOperationBulkFault.ImportFaults != null && Enumerable.SequenceEqual(this.ImportFaults, importOperationBulkFault.ImportFaults))));\n        }\n\n        public override bool Equals(object importOperationBulkFault)\n        {\n            return Equals(importOperationBulkFault as ImportOperationBulkFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ImportFaults).GetHashCode();\n        }\n    }\n\n    public class ImportOperationBulkFaultFaultOnImport : DynamicData, IEquatable<ImportOperationBulkFaultFaultOnImport>\n    {\n        public string EntityType { get; set; }\n\n        public string Key { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(ImportOperationBulkFaultFaultOnImport importOperationBulkFaultFaultOnImport)\n        {\n            return (importOperationBulkFaultFaultOnImport != null && this.EntityType == importOperationBulkFaultFaultOnImport.EntityType && this.Key == importOperationBulkFaultFaultOnImport.Key && ((this.Fault == null && importOperationBulkFaultFaultOnImport.Fault == null) || (this.Fault != null && this.Fault.Equals(importOperationBulkFaultFaultOnImport.Fault))));\n        }\n\n        public override bool Equals(object importOperationBulkFaultFaultOnImport)\n        {\n            return Equals(importOperationBulkFaultFaultOnImport as ImportOperationBulkFaultFaultOnImport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityType + \"_\" + Key + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class ImportSpec : DynamicData, IEquatable<ImportSpec>\n    {\n        public VAppEntityConfigInfo EntityConfig { get; set; }\n\n        public OvfConsumerOstNode InstantiationOst { get; set; }\n\n        public bool Equals(ImportSpec importSpec)\n        {\n            return (importSpec != null && ((this.EntityConfig == null && importSpec.EntityConfig == null) || (this.EntityConfig != null && this.EntityConfig.Equals(importSpec.EntityConfig))) && ((this.InstantiationOst == null && importSpec.InstantiationOst == null) || (this.InstantiationOst != null && this.InstantiationOst.Equals(importSpec.InstantiationOst))));\n        }\n\n        public override bool Equals(object importSpec)\n        {\n            return Equals(importSpec as ImportSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityConfig + \"_\" + InstantiationOst).GetHashCode();\n        }\n    }\n\n    public class InaccessibleDatastore : InvalidDatastore, IEquatable<InaccessibleDatastore>\n    {\n        public string Detail { get; set; }\n\n        public new InaccessibleDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InaccessibleDatastore inaccessibleDatastore)\n        {\n            return (inaccessibleDatastore != null && this.Detail == inaccessibleDatastore.Detail && ((this.LinkedView == null && inaccessibleDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(inaccessibleDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object inaccessibleDatastore)\n        {\n            return Equals(inaccessibleDatastore as InaccessibleDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Detail + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InaccessibleDatastore_LinkedView : InvalidDatastore_LinkedView, IEquatable<InaccessibleDatastore_LinkedView>\n    {\n        public bool Equals(InaccessibleDatastore_LinkedView inaccessibleDatastore_LinkedView)\n        {\n            return (inaccessibleDatastore_LinkedView != null && base.Equals(inaccessibleDatastore_LinkedView));\n        }\n\n        public override bool Equals(object inaccessibleDatastore_LinkedView)\n        {\n            return Equals(inaccessibleDatastore_LinkedView as InaccessibleDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InaccessibleFTMetadataDatastore : InaccessibleDatastore, IEquatable<InaccessibleFTMetadataDatastore>\n    {\n        public new InaccessibleFTMetadataDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InaccessibleFTMetadataDatastore inaccessibleFTMetadataDatastore)\n        {\n            return (inaccessibleFTMetadataDatastore != null && ((this.LinkedView == null && inaccessibleFTMetadataDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(inaccessibleFTMetadataDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object inaccessibleFTMetadataDatastore)\n        {\n            return Equals(inaccessibleFTMetadataDatastore as InaccessibleFTMetadataDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class InaccessibleFTMetadataDatastore_LinkedView : InaccessibleDatastore_LinkedView, IEquatable<InaccessibleFTMetadataDatastore_LinkedView>\n    {\n        public bool Equals(InaccessibleFTMetadataDatastore_LinkedView inaccessibleFTMetadataDatastore_LinkedView)\n        {\n            return (inaccessibleFTMetadataDatastore_LinkedView != null && base.Equals(inaccessibleFTMetadataDatastore_LinkedView));\n        }\n\n        public override bool Equals(object inaccessibleFTMetadataDatastore_LinkedView)\n        {\n            return Equals(inaccessibleFTMetadataDatastore_LinkedView as InaccessibleFTMetadataDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InaccessibleVFlashSource : VimFault, IEquatable<InaccessibleVFlashSource>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(InaccessibleVFlashSource inaccessibleVFlashSource)\n        {\n            return (inaccessibleVFlashSource != null && this.HostName == inaccessibleVFlashSource.HostName);\n        }\n\n        public override bool Equals(object inaccessibleVFlashSource)\n        {\n            return Equals(inaccessibleVFlashSource as InaccessibleVFlashSource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class IncompatibleDefaultDevice : MigrationFault, IEquatable<IncompatibleDefaultDevice>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(IncompatibleDefaultDevice incompatibleDefaultDevice)\n        {\n            return (incompatibleDefaultDevice != null && this.Device == incompatibleDefaultDevice.Device);\n        }\n\n        public override bool Equals(object incompatibleDefaultDevice)\n        {\n            return Equals(incompatibleDefaultDevice as IncompatibleDefaultDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class IncompatibleHostForFtSecondary : VmFaultToleranceIssue, IEquatable<IncompatibleHostForFtSecondary>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public IncompatibleHostForFtSecondary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(IncompatibleHostForFtSecondary incompatibleHostForFtSecondary)\n        {\n            return (incompatibleHostForFtSecondary != null && ((this.Host == null && incompatibleHostForFtSecondary.Host == null) || (this.Host != null && this.Host.Equals(incompatibleHostForFtSecondary.Host))) && ((this.Error == null && incompatibleHostForFtSecondary.Error == null) || (this.Error != null && incompatibleHostForFtSecondary.Error != null && Enumerable.SequenceEqual(this.Error, incompatibleHostForFtSecondary.Error))) && ((this.LinkedView == null && incompatibleHostForFtSecondary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(incompatibleHostForFtSecondary.LinkedView))));\n        }\n\n        public override bool Equals(object incompatibleHostForFtSecondary)\n        {\n            return Equals(incompatibleHostForFtSecondary as IncompatibleHostForFtSecondary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Error + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class IncompatibleHostForFtSecondary_LinkedView : IEquatable<IncompatibleHostForFtSecondary_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(IncompatibleHostForFtSecondary_LinkedView incompatibleHostForFtSecondary_LinkedView)\n        {\n            return (incompatibleHostForFtSecondary_LinkedView != null && ((this.Host == null && incompatibleHostForFtSecondary_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(incompatibleHostForFtSecondary_LinkedView.Host))));\n        }\n\n        public override bool Equals(object incompatibleHostForFtSecondary_LinkedView)\n        {\n            return Equals(incompatibleHostForFtSecondary_LinkedView as IncompatibleHostForFtSecondary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class IncompatibleHostForVmReplication : ReplicationFault, IEquatable<IncompatibleHostForVmReplication>\n    {\n        public string VmName { get; set; }\n\n        public string HostName { get; set; }\n\n        public string Reason { get; set; }\n\n        public bool Equals(IncompatibleHostForVmReplication incompatibleHostForVmReplication)\n        {\n            return (incompatibleHostForVmReplication != null && this.VmName == incompatibleHostForVmReplication.VmName && this.HostName == incompatibleHostForVmReplication.HostName && this.Reason == incompatibleHostForVmReplication.Reason);\n        }\n\n        public override bool Equals(object incompatibleHostForVmReplication)\n        {\n            return Equals(incompatibleHostForVmReplication as IncompatibleHostForVmReplication);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName + \"_\" + HostName + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class IncompatibleSetting : InvalidArgument, IEquatable<IncompatibleSetting>\n    {\n        public string ConflictingProperty { get; set; }\n\n        public bool Equals(IncompatibleSetting incompatibleSetting)\n        {\n            return (incompatibleSetting != null && this.ConflictingProperty == incompatibleSetting.ConflictingProperty);\n        }\n\n        public override bool Equals(object incompatibleSetting)\n        {\n            return Equals(incompatibleSetting as IncompatibleSetting);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictingProperty).GetHashCode();\n        }\n    }\n\n    public class IncorrectFileType : FileFault, IEquatable<IncorrectFileType>\n    {\n        public bool Equals(IncorrectFileType incorrectFileType)\n        {\n            return (incorrectFileType != null && base.Equals(incorrectFileType));\n        }\n\n        public override bool Equals(object incorrectFileType)\n        {\n            return Equals(incorrectFileType as IncorrectFileType);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IncorrectHostInformation : NotEnoughLicenses, IEquatable<IncorrectHostInformation>\n    {\n        public bool Equals(IncorrectHostInformation incorrectHostInformation)\n        {\n            return (incorrectHostInformation != null && base.Equals(incorrectHostInformation));\n        }\n\n        public override bool Equals(object incorrectHostInformation)\n        {\n            return Equals(incorrectHostInformation as IncorrectHostInformation);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IncorrectHostInformationEvent : LicenseEvent, IEquatable<IncorrectHostInformationEvent>\n    {\n        public bool Equals(IncorrectHostInformationEvent incorrectHostInformationEvent)\n        {\n            return (incorrectHostInformationEvent != null && base.Equals(incorrectHostInformationEvent));\n        }\n\n        public override bool Equals(object incorrectHostInformationEvent)\n        {\n            return Equals(incorrectHostInformationEvent as IncorrectHostInformationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IndependentDiskVMotionNotSupported : MigrationFeatureNotSupported, IEquatable<IndependentDiskVMotionNotSupported>\n    {\n        public new IndependentDiskVMotionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(IndependentDiskVMotionNotSupported independentDiskVMotionNotSupported)\n        {\n            return (independentDiskVMotionNotSupported != null && ((this.LinkedView == null && independentDiskVMotionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(independentDiskVMotionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object independentDiskVMotionNotSupported)\n        {\n            return Equals(independentDiskVMotionNotSupported as IndependentDiskVMotionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class IndependentDiskVMotionNotSupported_LinkedView : MigrationFeatureNotSupported_LinkedView, IEquatable<IndependentDiskVMotionNotSupported_LinkedView>\n    {\n        public bool Equals(IndependentDiskVMotionNotSupported_LinkedView independentDiskVMotionNotSupported_LinkedView)\n        {\n            return (independentDiskVMotionNotSupported_LinkedView != null && base.Equals(independentDiskVMotionNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object independentDiskVMotionNotSupported_LinkedView)\n        {\n            return Equals(independentDiskVMotionNotSupported_LinkedView as IndependentDiskVMotionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InfoUpgradeEvent : UpgradeEvent, IEquatable<InfoUpgradeEvent>\n    {\n        public bool Equals(InfoUpgradeEvent infoUpgradeEvent)\n        {\n            return (infoUpgradeEvent != null && base.Equals(infoUpgradeEvent));\n        }\n\n        public override bool Equals(object infoUpgradeEvent)\n        {\n            return Equals(infoUpgradeEvent as InfoUpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InheritablePolicy : DynamicData, IEquatable<InheritablePolicy>\n    {\n        public bool Inherited { get; set; }\n\n        public bool Equals(InheritablePolicy inheritablePolicy)\n        {\n            return (inheritablePolicy != null && this.Inherited == inheritablePolicy.Inherited);\n        }\n\n        public override bool Equals(object inheritablePolicy)\n        {\n            return Equals(inheritablePolicy as InheritablePolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Inherited).GetHashCode();\n        }\n    }\n\n    public class InsufficientAgentVmsDeployed : InsufficientResourcesFault, IEquatable<InsufficientAgentVmsDeployed>\n    {\n        public string HostName { get; set; }\n\n        public int RequiredNumAgentVms { get; set; }\n\n        public int CurrentNumAgentVms { get; set; }\n\n        public bool Equals(InsufficientAgentVmsDeployed insufficientAgentVmsDeployed)\n        {\n            return (insufficientAgentVmsDeployed != null && this.HostName == insufficientAgentVmsDeployed.HostName && this.RequiredNumAgentVms == insufficientAgentVmsDeployed.RequiredNumAgentVms && this.CurrentNumAgentVms == insufficientAgentVmsDeployed.CurrentNumAgentVms);\n        }\n\n        public override bool Equals(object insufficientAgentVmsDeployed)\n        {\n            return Equals(insufficientAgentVmsDeployed as InsufficientAgentVmsDeployed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + RequiredNumAgentVms + \"_\" + CurrentNumAgentVms).GetHashCode();\n        }\n    }\n\n    public class InsufficientCpuResourcesFault : InsufficientResourcesFault, IEquatable<InsufficientCpuResourcesFault>\n    {\n        public long Unreserved { get; set; }\n\n        public long Requested { get; set; }\n\n        public bool Equals(InsufficientCpuResourcesFault insufficientCpuResourcesFault)\n        {\n            return (insufficientCpuResourcesFault != null && this.Unreserved == insufficientCpuResourcesFault.Unreserved && this.Requested == insufficientCpuResourcesFault.Requested);\n        }\n\n        public override bool Equals(object insufficientCpuResourcesFault)\n        {\n            return Equals(insufficientCpuResourcesFault as InsufficientCpuResourcesFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Unreserved + \"_\" + Requested).GetHashCode();\n        }\n    }\n\n    public class InsufficientDisks : VsanDiskFault, IEquatable<InsufficientDisks>\n    {\n        public bool Equals(InsufficientDisks insufficientDisks)\n        {\n            return (insufficientDisks != null && base.Equals(insufficientDisks));\n        }\n\n        public override bool Equals(object insufficientDisks)\n        {\n            return Equals(insufficientDisks as InsufficientDisks);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientFailoverResourcesEvent : ClusterEvent, IEquatable<InsufficientFailoverResourcesEvent>\n    {\n        public bool Equals(InsufficientFailoverResourcesEvent insufficientFailoverResourcesEvent)\n        {\n            return (insufficientFailoverResourcesEvent != null && base.Equals(insufficientFailoverResourcesEvent));\n        }\n\n        public override bool Equals(object insufficientFailoverResourcesEvent)\n        {\n            return Equals(insufficientFailoverResourcesEvent as InsufficientFailoverResourcesEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientFailoverResourcesFault : InsufficientResourcesFault, IEquatable<InsufficientFailoverResourcesFault>\n    {\n        public bool Equals(InsufficientFailoverResourcesFault insufficientFailoverResourcesFault)\n        {\n            return (insufficientFailoverResourcesFault != null && base.Equals(insufficientFailoverResourcesFault));\n        }\n\n        public override bool Equals(object insufficientFailoverResourcesFault)\n        {\n            return Equals(insufficientFailoverResourcesFault as InsufficientFailoverResourcesFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientGraphicsResourcesFault : InsufficientResourcesFault, IEquatable<InsufficientGraphicsResourcesFault>\n    {\n        public bool Equals(InsufficientGraphicsResourcesFault insufficientGraphicsResourcesFault)\n        {\n            return (insufficientGraphicsResourcesFault != null && base.Equals(insufficientGraphicsResourcesFault));\n        }\n\n        public override bool Equals(object insufficientGraphicsResourcesFault)\n        {\n            return Equals(insufficientGraphicsResourcesFault as InsufficientGraphicsResourcesFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientHostCapacityFault : InsufficientResourcesFault, IEquatable<InsufficientHostCapacityFault>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public InsufficientHostCapacityFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InsufficientHostCapacityFault insufficientHostCapacityFault)\n        {\n            return (insufficientHostCapacityFault != null && ((this.Host == null && insufficientHostCapacityFault.Host == null) || (this.Host != null && this.Host.Equals(insufficientHostCapacityFault.Host))) && ((this.LinkedView == null && insufficientHostCapacityFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(insufficientHostCapacityFault.LinkedView))));\n        }\n\n        public override bool Equals(object insufficientHostCapacityFault)\n        {\n            return Equals(insufficientHostCapacityFault as InsufficientHostCapacityFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InsufficientHostCapacityFault_LinkedView : IEquatable<InsufficientHostCapacityFault_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(InsufficientHostCapacityFault_LinkedView insufficientHostCapacityFault_LinkedView)\n        {\n            return (insufficientHostCapacityFault_LinkedView != null && ((this.Host == null && insufficientHostCapacityFault_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(insufficientHostCapacityFault_LinkedView.Host))));\n        }\n\n        public override bool Equals(object insufficientHostCapacityFault_LinkedView)\n        {\n            return Equals(insufficientHostCapacityFault_LinkedView as InsufficientHostCapacityFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class InsufficientHostCpuCapacityFault : InsufficientHostCapacityFault, IEquatable<InsufficientHostCpuCapacityFault>\n    {\n        public long Unreserved { get; set; }\n\n        public long Requested { get; set; }\n\n        public new InsufficientHostCpuCapacityFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InsufficientHostCpuCapacityFault insufficientHostCpuCapacityFault)\n        {\n            return (insufficientHostCpuCapacityFault != null && this.Unreserved == insufficientHostCpuCapacityFault.Unreserved && this.Requested == insufficientHostCpuCapacityFault.Requested && ((this.LinkedView == null && insufficientHostCpuCapacityFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(insufficientHostCpuCapacityFault.LinkedView))));\n        }\n\n        public override bool Equals(object insufficientHostCpuCapacityFault)\n        {\n            return Equals(insufficientHostCpuCapacityFault as InsufficientHostCpuCapacityFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Unreserved + \"_\" + Requested + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InsufficientHostCpuCapacityFault_LinkedView : InsufficientHostCapacityFault_LinkedView, IEquatable<InsufficientHostCpuCapacityFault_LinkedView>\n    {\n        public bool Equals(InsufficientHostCpuCapacityFault_LinkedView insufficientHostCpuCapacityFault_LinkedView)\n        {\n            return (insufficientHostCpuCapacityFault_LinkedView != null && base.Equals(insufficientHostCpuCapacityFault_LinkedView));\n        }\n\n        public override bool Equals(object insufficientHostCpuCapacityFault_LinkedView)\n        {\n            return Equals(insufficientHostCpuCapacityFault_LinkedView as InsufficientHostCpuCapacityFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientHostMemoryCapacityFault : InsufficientHostCapacityFault, IEquatable<InsufficientHostMemoryCapacityFault>\n    {\n        public long Unreserved { get; set; }\n\n        public long Requested { get; set; }\n\n        public new InsufficientHostMemoryCapacityFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InsufficientHostMemoryCapacityFault insufficientHostMemoryCapacityFault)\n        {\n            return (insufficientHostMemoryCapacityFault != null && this.Unreserved == insufficientHostMemoryCapacityFault.Unreserved && this.Requested == insufficientHostMemoryCapacityFault.Requested && ((this.LinkedView == null && insufficientHostMemoryCapacityFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(insufficientHostMemoryCapacityFault.LinkedView))));\n        }\n\n        public override bool Equals(object insufficientHostMemoryCapacityFault)\n        {\n            return Equals(insufficientHostMemoryCapacityFault as InsufficientHostMemoryCapacityFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Unreserved + \"_\" + Requested + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InsufficientHostMemoryCapacityFault_LinkedView : InsufficientHostCapacityFault_LinkedView, IEquatable<InsufficientHostMemoryCapacityFault_LinkedView>\n    {\n        public bool Equals(InsufficientHostMemoryCapacityFault_LinkedView insufficientHostMemoryCapacityFault_LinkedView)\n        {\n            return (insufficientHostMemoryCapacityFault_LinkedView != null && base.Equals(insufficientHostMemoryCapacityFault_LinkedView));\n        }\n\n        public override bool Equals(object insufficientHostMemoryCapacityFault_LinkedView)\n        {\n            return Equals(insufficientHostMemoryCapacityFault_LinkedView as InsufficientHostMemoryCapacityFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientMemoryResourcesFault : InsufficientResourcesFault, IEquatable<InsufficientMemoryResourcesFault>\n    {\n        public long Unreserved { get; set; }\n\n        public long Requested { get; set; }\n\n        public bool Equals(InsufficientMemoryResourcesFault insufficientMemoryResourcesFault)\n        {\n            return (insufficientMemoryResourcesFault != null && this.Unreserved == insufficientMemoryResourcesFault.Unreserved && this.Requested == insufficientMemoryResourcesFault.Requested);\n        }\n\n        public override bool Equals(object insufficientMemoryResourcesFault)\n        {\n            return Equals(insufficientMemoryResourcesFault as InsufficientMemoryResourcesFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Unreserved + \"_\" + Requested).GetHashCode();\n        }\n    }\n\n    public class InsufficientNetworkCapacity : InsufficientResourcesFault, IEquatable<InsufficientNetworkCapacity>\n    {\n        public bool Equals(InsufficientNetworkCapacity insufficientNetworkCapacity)\n        {\n            return (insufficientNetworkCapacity != null && base.Equals(insufficientNetworkCapacity));\n        }\n\n        public override bool Equals(object insufficientNetworkCapacity)\n        {\n            return Equals(insufficientNetworkCapacity as InsufficientNetworkCapacity);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientNetworkResourcePoolCapacity : InsufficientResourcesFault, IEquatable<InsufficientNetworkResourcePoolCapacity>\n    {\n        public string DvsName { get; set; }\n\n        public string DvsUuid { get; set; }\n\n        public string ResourcePoolKey { get; set; }\n\n        public long Available { get; set; }\n\n        public long Requested { get; set; }\n\n        public string[] Device { get; set; }\n\n        public bool Equals(InsufficientNetworkResourcePoolCapacity insufficientNetworkResourcePoolCapacity)\n        {\n            return (insufficientNetworkResourcePoolCapacity != null && this.DvsName == insufficientNetworkResourcePoolCapacity.DvsName && this.DvsUuid == insufficientNetworkResourcePoolCapacity.DvsUuid && this.ResourcePoolKey == insufficientNetworkResourcePoolCapacity.ResourcePoolKey && this.Available == insufficientNetworkResourcePoolCapacity.Available && this.Requested == insufficientNetworkResourcePoolCapacity.Requested && ((this.Device == null && insufficientNetworkResourcePoolCapacity.Device == null) || (this.Device != null && insufficientNetworkResourcePoolCapacity.Device != null && Enumerable.SequenceEqual(this.Device, insufficientNetworkResourcePoolCapacity.Device))));\n        }\n\n        public override bool Equals(object insufficientNetworkResourcePoolCapacity)\n        {\n            return Equals(insufficientNetworkResourcePoolCapacity as InsufficientNetworkResourcePoolCapacity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DvsName + \"_\" + DvsUuid + \"_\" + ResourcePoolKey + \"_\" + Available + \"_\" + Requested + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class InsufficientPerCpuCapacity : InsufficientHostCapacityFault, IEquatable<InsufficientPerCpuCapacity>\n    {\n        public new InsufficientPerCpuCapacity_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InsufficientPerCpuCapacity insufficientPerCpuCapacity)\n        {\n            return (insufficientPerCpuCapacity != null && ((this.LinkedView == null && insufficientPerCpuCapacity.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(insufficientPerCpuCapacity.LinkedView))));\n        }\n\n        public override bool Equals(object insufficientPerCpuCapacity)\n        {\n            return Equals(insufficientPerCpuCapacity as InsufficientPerCpuCapacity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class InsufficientPerCpuCapacity_LinkedView : InsufficientHostCapacityFault_LinkedView, IEquatable<InsufficientPerCpuCapacity_LinkedView>\n    {\n        public bool Equals(InsufficientPerCpuCapacity_LinkedView insufficientPerCpuCapacity_LinkedView)\n        {\n            return (insufficientPerCpuCapacity_LinkedView != null && base.Equals(insufficientPerCpuCapacity_LinkedView));\n        }\n\n        public override bool Equals(object insufficientPerCpuCapacity_LinkedView)\n        {\n            return Equals(insufficientPerCpuCapacity_LinkedView as InsufficientPerCpuCapacity_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientResourcesFault : VimFault, IEquatable<InsufficientResourcesFault>\n    {\n        public bool Equals(InsufficientResourcesFault insufficientResourcesFault)\n        {\n            return (insufficientResourcesFault != null && base.Equals(insufficientResourcesFault));\n        }\n\n        public override bool Equals(object insufficientResourcesFault)\n        {\n            return Equals(insufficientResourcesFault as InsufficientResourcesFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientStandbyCpuResource : InsufficientStandbyResource, IEquatable<InsufficientStandbyCpuResource>\n    {\n        public long Available { get; set; }\n\n        public long Requested { get; set; }\n\n        public bool Equals(InsufficientStandbyCpuResource insufficientStandbyCpuResource)\n        {\n            return (insufficientStandbyCpuResource != null && this.Available == insufficientStandbyCpuResource.Available && this.Requested == insufficientStandbyCpuResource.Requested);\n        }\n\n        public override bool Equals(object insufficientStandbyCpuResource)\n        {\n            return Equals(insufficientStandbyCpuResource as InsufficientStandbyCpuResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Available + \"_\" + Requested).GetHashCode();\n        }\n    }\n\n    public class InsufficientStandbyMemoryResource : InsufficientStandbyResource, IEquatable<InsufficientStandbyMemoryResource>\n    {\n        public long Available { get; set; }\n\n        public long Requested { get; set; }\n\n        public bool Equals(InsufficientStandbyMemoryResource insufficientStandbyMemoryResource)\n        {\n            return (insufficientStandbyMemoryResource != null && this.Available == insufficientStandbyMemoryResource.Available && this.Requested == insufficientStandbyMemoryResource.Requested);\n        }\n\n        public override bool Equals(object insufficientStandbyMemoryResource)\n        {\n            return Equals(insufficientStandbyMemoryResource as InsufficientStandbyMemoryResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Available + \"_\" + Requested).GetHashCode();\n        }\n    }\n\n    public class InsufficientStandbyResource : InsufficientResourcesFault, IEquatable<InsufficientStandbyResource>\n    {\n        public bool Equals(InsufficientStandbyResource insufficientStandbyResource)\n        {\n            return (insufficientStandbyResource != null && base.Equals(insufficientStandbyResource));\n        }\n\n        public override bool Equals(object insufficientStandbyResource)\n        {\n            return Equals(insufficientStandbyResource as InsufficientStandbyResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientStorageIops : VimFault, IEquatable<InsufficientStorageIops>\n    {\n        public long UnreservedIops { get; set; }\n\n        public long RequestedIops { get; set; }\n\n        public string DatastoreName { get; set; }\n\n        public bool Equals(InsufficientStorageIops insufficientStorageIops)\n        {\n            return (insufficientStorageIops != null && this.UnreservedIops == insufficientStorageIops.UnreservedIops && this.RequestedIops == insufficientStorageIops.RequestedIops && this.DatastoreName == insufficientStorageIops.DatastoreName);\n        }\n\n        public override bool Equals(object insufficientStorageIops)\n        {\n            return Equals(insufficientStorageIops as InsufficientStorageIops);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UnreservedIops + \"_\" + RequestedIops + \"_\" + DatastoreName).GetHashCode();\n        }\n    }\n\n    public class InsufficientStorageSpace : InsufficientResourcesFault, IEquatable<InsufficientStorageSpace>\n    {\n        public bool Equals(InsufficientStorageSpace insufficientStorageSpace)\n        {\n            return (insufficientStorageSpace != null && base.Equals(insufficientStorageSpace));\n        }\n\n        public override bool Equals(object insufficientStorageSpace)\n        {\n            return Equals(insufficientStorageSpace as InsufficientStorageSpace);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InsufficientVFlashResourcesFault : InsufficientResourcesFault, IEquatable<InsufficientVFlashResourcesFault>\n    {\n        public long? FreeSpaceInMB { get; set; }\n\n        public long FreeSpace { get; set; }\n\n        public long? RequestedSpaceInMB { get; set; }\n\n        public long RequestedSpace { get; set; }\n\n        public bool Equals(InsufficientVFlashResourcesFault insufficientVFlashResourcesFault)\n        {\n            return (insufficientVFlashResourcesFault != null && ((this.FreeSpaceInMB == null && insufficientVFlashResourcesFault.FreeSpaceInMB == null) || (this.FreeSpaceInMB != null && this.FreeSpaceInMB.Equals(insufficientVFlashResourcesFault.FreeSpaceInMB))) && this.FreeSpace == insufficientVFlashResourcesFault.FreeSpace && ((this.RequestedSpaceInMB == null && insufficientVFlashResourcesFault.RequestedSpaceInMB == null) || (this.RequestedSpaceInMB != null && this.RequestedSpaceInMB.Equals(insufficientVFlashResourcesFault.RequestedSpaceInMB))) && this.RequestedSpace == insufficientVFlashResourcesFault.RequestedSpace);\n        }\n\n        public override bool Equals(object insufficientVFlashResourcesFault)\n        {\n            return Equals(insufficientVFlashResourcesFault as InsufficientVFlashResourcesFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FreeSpaceInMB + \"_\" + FreeSpace + \"_\" + RequestedSpaceInMB + \"_\" + RequestedSpace).GetHashCode();\n        }\n    }\n\n    public class IntExpression : NegatableExpression, IEquatable<IntExpression>\n    {\n        public int? Value { get; set; }\n\n        public bool Equals(IntExpression intExpression)\n        {\n            return (intExpression != null && ((this.Value == null && intExpression.Value == null) || (this.Value != null && this.Value.Equals(intExpression.Value))));\n        }\n\n        public override bool Equals(object intExpression)\n        {\n            return Equals(intExpression as IntExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class IntOption : OptionType, IEquatable<IntOption>\n    {\n        public int Min { get; set; }\n\n        public int Max { get; set; }\n\n        public int DefaultValue { get; set; }\n\n        public bool Equals(IntOption intOption)\n        {\n            return (intOption != null && this.Min == intOption.Min && this.Max == intOption.Max && this.DefaultValue == intOption.DefaultValue);\n        }\n\n        public override bool Equals(object intOption)\n        {\n            return Equals(intOption as IntOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Min + \"_\" + Max + \"_\" + DefaultValue).GetHashCode();\n        }\n    }\n\n    public class IntPolicy : InheritablePolicy, IEquatable<IntPolicy>\n    {\n        public int? Value { get; set; }\n\n        public bool Equals(IntPolicy intPolicy)\n        {\n            return (intPolicy != null && ((this.Value == null && intPolicy.Value == null) || (this.Value != null && this.Value.Equals(intPolicy.Value))));\n        }\n\n        public override bool Equals(object intPolicy)\n        {\n            return Equals(intPolicy as IntPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class InUseFeatureManipulationDisallowed : NotEnoughLicenses, IEquatable<InUseFeatureManipulationDisallowed>\n    {\n        public bool Equals(InUseFeatureManipulationDisallowed inUseFeatureManipulationDisallowed)\n        {\n            return (inUseFeatureManipulationDisallowed != null && base.Equals(inUseFeatureManipulationDisallowed));\n        }\n\n        public override bool Equals(object inUseFeatureManipulationDisallowed)\n        {\n            return Equals(inUseFeatureManipulationDisallowed as InUseFeatureManipulationDisallowed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidAffinitySettingFault : VimFault, IEquatable<InvalidAffinitySettingFault>\n    {\n        public bool Equals(InvalidAffinitySettingFault invalidAffinitySettingFault)\n        {\n            return (invalidAffinitySettingFault != null && base.Equals(invalidAffinitySettingFault));\n        }\n\n        public override bool Equals(object invalidAffinitySettingFault)\n        {\n            return Equals(invalidAffinitySettingFault as InvalidAffinitySettingFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidArgument : RuntimeFault, IEquatable<InvalidArgument>\n    {\n        public string InvalidProperty { get; set; }\n\n        public bool Equals(InvalidArgument invalidArgument)\n        {\n            return (invalidArgument != null && this.InvalidProperty == invalidArgument.InvalidProperty);\n        }\n\n        public override bool Equals(object invalidArgument)\n        {\n            return Equals(invalidArgument as InvalidArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InvalidProperty).GetHashCode();\n        }\n    }\n\n    public class InvalidBmcRole : VimFault, IEquatable<InvalidBmcRole>\n    {\n        public bool Equals(InvalidBmcRole invalidBmcRole)\n        {\n            return (invalidBmcRole != null && base.Equals(invalidBmcRole));\n        }\n\n        public override bool Equals(object invalidBmcRole)\n        {\n            return Equals(invalidBmcRole as InvalidBmcRole);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidBundle : PlatformConfigFault, IEquatable<InvalidBundle>\n    {\n        public bool Equals(InvalidBundle invalidBundle)\n        {\n            return (invalidBundle != null && base.Equals(invalidBundle));\n        }\n\n        public override bool Equals(object invalidBundle)\n        {\n            return Equals(invalidBundle as InvalidBundle);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidCAMCertificate : InvalidCAMServer, IEquatable<InvalidCAMCertificate>\n    {\n        public bool Equals(InvalidCAMCertificate invalidCAMCertificate)\n        {\n            return (invalidCAMCertificate != null && base.Equals(invalidCAMCertificate));\n        }\n\n        public override bool Equals(object invalidCAMCertificate)\n        {\n            return Equals(invalidCAMCertificate as InvalidCAMCertificate);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidCAMServer : ActiveDirectoryFault, IEquatable<InvalidCAMServer>\n    {\n        public string CamServer { get; set; }\n\n        public bool Equals(InvalidCAMServer invalidCAMServer)\n        {\n            return (invalidCAMServer != null && this.CamServer == invalidCAMServer.CamServer);\n        }\n\n        public override bool Equals(object invalidCAMServer)\n        {\n            return Equals(invalidCAMServer as InvalidCAMServer);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CamServer).GetHashCode();\n        }\n    }\n\n    public class InvalidClientCertificate : InvalidLogin, IEquatable<InvalidClientCertificate>\n    {\n        public bool Equals(InvalidClientCertificate invalidClientCertificate)\n        {\n            return (invalidClientCertificate != null && base.Equals(invalidClientCertificate));\n        }\n\n        public override bool Equals(object invalidClientCertificate)\n        {\n            return Equals(invalidClientCertificate as InvalidClientCertificate);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidCollectorVersion : MethodFault, IEquatable<InvalidCollectorVersion>\n    {\n        public bool Equals(InvalidCollectorVersion invalidCollectorVersion)\n        {\n            return (invalidCollectorVersion != null && base.Equals(invalidCollectorVersion));\n        }\n\n        public override bool Equals(object invalidCollectorVersion)\n        {\n            return Equals(invalidCollectorVersion as InvalidCollectorVersion);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidController : InvalidDeviceSpec, IEquatable<InvalidController>\n    {\n        public int ControllerKey { get; set; }\n\n        public bool Equals(InvalidController invalidController)\n        {\n            return (invalidController != null && this.ControllerKey == invalidController.ControllerKey);\n        }\n\n        public override bool Equals(object invalidController)\n        {\n            return Equals(invalidController as InvalidController);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ControllerKey).GetHashCode();\n        }\n    }\n\n    public class InvalidDasConfigArgument : InvalidArgument, IEquatable<InvalidDasConfigArgument>\n    {\n        public string Entry { get; set; }\n\n        public string ClusterName { get; set; }\n\n        public bool Equals(InvalidDasConfigArgument invalidDasConfigArgument)\n        {\n            return (invalidDasConfigArgument != null && this.Entry == invalidDasConfigArgument.Entry && this.ClusterName == invalidDasConfigArgument.ClusterName);\n        }\n\n        public override bool Equals(object invalidDasConfigArgument)\n        {\n            return Equals(invalidDasConfigArgument as InvalidDasConfigArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entry + \"_\" + ClusterName).GetHashCode();\n        }\n    }\n\n    public class InvalidDasRestartPriorityForFtVm : InvalidArgument, IEquatable<InvalidDasRestartPriorityForFtVm>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public InvalidDasRestartPriorityForFtVm_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidDasRestartPriorityForFtVm invalidDasRestartPriorityForFtVm)\n        {\n            return (invalidDasRestartPriorityForFtVm != null && ((this.Vm == null && invalidDasRestartPriorityForFtVm.Vm == null) || (this.Vm != null && this.Vm.Equals(invalidDasRestartPriorityForFtVm.Vm))) && this.VmName == invalidDasRestartPriorityForFtVm.VmName && ((this.LinkedView == null && invalidDasRestartPriorityForFtVm.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidDasRestartPriorityForFtVm.LinkedView))));\n        }\n\n        public override bool Equals(object invalidDasRestartPriorityForFtVm)\n        {\n            return Equals(invalidDasRestartPriorityForFtVm as InvalidDasRestartPriorityForFtVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidDasRestartPriorityForFtVm_LinkedView : IEquatable<InvalidDasRestartPriorityForFtVm_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(InvalidDasRestartPriorityForFtVm_LinkedView invalidDasRestartPriorityForFtVm_LinkedView)\n        {\n            return (invalidDasRestartPriorityForFtVm_LinkedView != null && ((this.Vm == null && invalidDasRestartPriorityForFtVm_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(invalidDasRestartPriorityForFtVm_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object invalidDasRestartPriorityForFtVm_LinkedView)\n        {\n            return Equals(invalidDasRestartPriorityForFtVm_LinkedView as InvalidDasRestartPriorityForFtVm_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class InvalidDatastore : VimFault, IEquatable<InvalidDatastore>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string Name { get; set; }\n\n        public InvalidDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidDatastore invalidDatastore)\n        {\n            return (invalidDatastore != null && ((this.Datastore == null && invalidDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(invalidDatastore.Datastore))) && this.Name == invalidDatastore.Name && ((this.LinkedView == null && invalidDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object invalidDatastore)\n        {\n            return Equals(invalidDatastore as InvalidDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Name + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidDatastore_LinkedView : IEquatable<InvalidDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(InvalidDatastore_LinkedView invalidDatastore_LinkedView)\n        {\n            return (invalidDatastore_LinkedView != null && ((this.Datastore == null && invalidDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(invalidDatastore_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object invalidDatastore_LinkedView)\n        {\n            return Equals(invalidDatastore_LinkedView as InvalidDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class InvalidDatastorePath : InvalidDatastore, IEquatable<InvalidDatastorePath>\n    {\n        public string DatastorePath { get; set; }\n\n        public new InvalidDatastorePath_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidDatastorePath invalidDatastorePath)\n        {\n            return (invalidDatastorePath != null && this.DatastorePath == invalidDatastorePath.DatastorePath && ((this.LinkedView == null && invalidDatastorePath.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidDatastorePath.LinkedView))));\n        }\n\n        public override bool Equals(object invalidDatastorePath)\n        {\n            return Equals(invalidDatastorePath as InvalidDatastorePath);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastorePath + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidDatastorePath_LinkedView : InvalidDatastore_LinkedView, IEquatable<InvalidDatastorePath_LinkedView>\n    {\n        public bool Equals(InvalidDatastorePath_LinkedView invalidDatastorePath_LinkedView)\n        {\n            return (invalidDatastorePath_LinkedView != null && base.Equals(invalidDatastorePath_LinkedView));\n        }\n\n        public override bool Equals(object invalidDatastorePath_LinkedView)\n        {\n            return Equals(invalidDatastorePath_LinkedView as InvalidDatastorePath_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidDatastoreState : InvalidState, IEquatable<InvalidDatastoreState>\n    {\n        public string DatastoreName { get; set; }\n\n        public bool Equals(InvalidDatastoreState invalidDatastoreState)\n        {\n            return (invalidDatastoreState != null && this.DatastoreName == invalidDatastoreState.DatastoreName);\n        }\n\n        public override bool Equals(object invalidDatastoreState)\n        {\n            return Equals(invalidDatastoreState as InvalidDatastoreState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreName).GetHashCode();\n        }\n    }\n\n    public class InvalidDeviceBacking : InvalidDeviceSpec, IEquatable<InvalidDeviceBacking>\n    {\n        public bool Equals(InvalidDeviceBacking invalidDeviceBacking)\n        {\n            return (invalidDeviceBacking != null && base.Equals(invalidDeviceBacking));\n        }\n\n        public override bool Equals(object invalidDeviceBacking)\n        {\n            return Equals(invalidDeviceBacking as InvalidDeviceBacking);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidDeviceOperation : InvalidDeviceSpec, IEquatable<InvalidDeviceOperation>\n    {\n        public VirtualDeviceConfigSpecOperation? BadOp { get; set; }\n\n        public VirtualDeviceConfigSpecFileOperation? BadFileOp { get; set; }\n\n        public bool Equals(InvalidDeviceOperation invalidDeviceOperation)\n        {\n            return (invalidDeviceOperation != null && ((this.BadOp == null && invalidDeviceOperation.BadOp == null) || (this.BadOp != null && this.BadOp.Equals(invalidDeviceOperation.BadOp))) && ((this.BadFileOp == null && invalidDeviceOperation.BadFileOp == null) || (this.BadFileOp != null && this.BadFileOp.Equals(invalidDeviceOperation.BadFileOp))));\n        }\n\n        public override bool Equals(object invalidDeviceOperation)\n        {\n            return Equals(invalidDeviceOperation as InvalidDeviceOperation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BadOp + \"_\" + BadFileOp).GetHashCode();\n        }\n    }\n\n    public class InvalidDeviceSpec : InvalidVmConfig, IEquatable<InvalidDeviceSpec>\n    {\n        public int DeviceIndex { get; set; }\n\n        public bool Equals(InvalidDeviceSpec invalidDeviceSpec)\n        {\n            return (invalidDeviceSpec != null && this.DeviceIndex == invalidDeviceSpec.DeviceIndex);\n        }\n\n        public override bool Equals(object invalidDeviceSpec)\n        {\n            return Equals(invalidDeviceSpec as InvalidDeviceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceIndex).GetHashCode();\n        }\n    }\n\n    public class InvalidDiskFormat : InvalidFormat, IEquatable<InvalidDiskFormat>\n    {\n        public bool Equals(InvalidDiskFormat invalidDiskFormat)\n        {\n            return (invalidDiskFormat != null && base.Equals(invalidDiskFormat));\n        }\n\n        public override bool Equals(object invalidDiskFormat)\n        {\n            return Equals(invalidDiskFormat as InvalidDiskFormat);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidDrsBehaviorForFtVm : InvalidArgument, IEquatable<InvalidDrsBehaviorForFtVm>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public InvalidDrsBehaviorForFtVm_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidDrsBehaviorForFtVm invalidDrsBehaviorForFtVm)\n        {\n            return (invalidDrsBehaviorForFtVm != null && ((this.Vm == null && invalidDrsBehaviorForFtVm.Vm == null) || (this.Vm != null && this.Vm.Equals(invalidDrsBehaviorForFtVm.Vm))) && this.VmName == invalidDrsBehaviorForFtVm.VmName && ((this.LinkedView == null && invalidDrsBehaviorForFtVm.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidDrsBehaviorForFtVm.LinkedView))));\n        }\n\n        public override bool Equals(object invalidDrsBehaviorForFtVm)\n        {\n            return Equals(invalidDrsBehaviorForFtVm as InvalidDrsBehaviorForFtVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidDrsBehaviorForFtVm_LinkedView : IEquatable<InvalidDrsBehaviorForFtVm_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(InvalidDrsBehaviorForFtVm_LinkedView invalidDrsBehaviorForFtVm_LinkedView)\n        {\n            return (invalidDrsBehaviorForFtVm_LinkedView != null && ((this.Vm == null && invalidDrsBehaviorForFtVm_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(invalidDrsBehaviorForFtVm_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object invalidDrsBehaviorForFtVm_LinkedView)\n        {\n            return Equals(invalidDrsBehaviorForFtVm_LinkedView as InvalidDrsBehaviorForFtVm_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class InvalidEditionEvent : LicenseEvent, IEquatable<InvalidEditionEvent>\n    {\n        public string Feature { get; set; }\n\n        public bool Equals(InvalidEditionEvent invalidEditionEvent)\n        {\n            return (invalidEditionEvent != null && this.Feature == invalidEditionEvent.Feature);\n        }\n\n        public override bool Equals(object invalidEditionEvent)\n        {\n            return Equals(invalidEditionEvent as InvalidEditionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Feature).GetHashCode();\n        }\n    }\n\n    public class InvalidEditionLicense : NotEnoughLicenses, IEquatable<InvalidEditionLicense>\n    {\n        public string Feature { get; set; }\n\n        public bool Equals(InvalidEditionLicense invalidEditionLicense)\n        {\n            return (invalidEditionLicense != null && this.Feature == invalidEditionLicense.Feature);\n        }\n\n        public override bool Equals(object invalidEditionLicense)\n        {\n            return Equals(invalidEditionLicense as InvalidEditionLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Feature).GetHashCode();\n        }\n    }\n\n    public class InvalidEvent : VimFault, IEquatable<InvalidEvent>\n    {\n        public bool Equals(InvalidEvent invalidEvent)\n        {\n            return (invalidEvent != null && base.Equals(invalidEvent));\n        }\n\n        public override bool Equals(object invalidEvent)\n        {\n            return Equals(invalidEvent as InvalidEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidFolder : VimFault, IEquatable<InvalidFolder>\n    {\n        public ManagedObjectReference Target { get; set; }\n\n        public InvalidFolder_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidFolder invalidFolder)\n        {\n            return (invalidFolder != null && ((this.Target == null && invalidFolder.Target == null) || (this.Target != null && this.Target.Equals(invalidFolder.Target))) && ((this.LinkedView == null && invalidFolder.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidFolder.LinkedView))));\n        }\n\n        public override bool Equals(object invalidFolder)\n        {\n            return Equals(invalidFolder as InvalidFolder);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Target + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidFolder_LinkedView : IEquatable<InvalidFolder_LinkedView>\n    {\n        public ManagedEntity Target { get; set; }\n\n        public bool Equals(InvalidFolder_LinkedView invalidFolder_LinkedView)\n        {\n            return (invalidFolder_LinkedView != null && ((this.Target == null && invalidFolder_LinkedView.Target == null) || (this.Target != null && this.Target.Equals(invalidFolder_LinkedView.Target))));\n        }\n\n        public override bool Equals(object invalidFolder_LinkedView)\n        {\n            return Equals(invalidFolder_LinkedView as InvalidFolder_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Target).GetHashCode();\n        }\n    }\n\n    public class InvalidFormat : VmConfigFault, IEquatable<InvalidFormat>\n    {\n        public bool Equals(InvalidFormat invalidFormat)\n        {\n            return (invalidFormat != null && base.Equals(invalidFormat));\n        }\n\n        public override bool Equals(object invalidFormat)\n        {\n            return Equals(invalidFormat as InvalidFormat);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidGuestLogin : GuestOperationsFault, IEquatable<InvalidGuestLogin>\n    {\n        public bool Equals(InvalidGuestLogin invalidGuestLogin)\n        {\n            return (invalidGuestLogin != null && base.Equals(invalidGuestLogin));\n        }\n\n        public override bool Equals(object invalidGuestLogin)\n        {\n            return Equals(invalidGuestLogin as InvalidGuestLogin);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidHostConnectionState : InvalidHostState, IEquatable<InvalidHostConnectionState>\n    {\n        public new InvalidHostConnectionState_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidHostConnectionState invalidHostConnectionState)\n        {\n            return (invalidHostConnectionState != null && ((this.LinkedView == null && invalidHostConnectionState.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidHostConnectionState.LinkedView))));\n        }\n\n        public override bool Equals(object invalidHostConnectionState)\n        {\n            return Equals(invalidHostConnectionState as InvalidHostConnectionState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidHostConnectionState_LinkedView : InvalidHostState_LinkedView, IEquatable<InvalidHostConnectionState_LinkedView>\n    {\n        public bool Equals(InvalidHostConnectionState_LinkedView invalidHostConnectionState_LinkedView)\n        {\n            return (invalidHostConnectionState_LinkedView != null && base.Equals(invalidHostConnectionState_LinkedView));\n        }\n\n        public override bool Equals(object invalidHostConnectionState_LinkedView)\n        {\n            return Equals(invalidHostConnectionState_LinkedView as InvalidHostConnectionState_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidHostName : HostConfigFault, IEquatable<InvalidHostName>\n    {\n        public bool Equals(InvalidHostName invalidHostName)\n        {\n            return (invalidHostName != null && base.Equals(invalidHostName));\n        }\n\n        public override bool Equals(object invalidHostName)\n        {\n            return Equals(invalidHostName as InvalidHostName);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidHostState : InvalidState, IEquatable<InvalidHostState>\n    {\n        public InvalidHostState_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public bool Equals(InvalidHostState invalidHostState)\n        {\n            return (invalidHostState != null && ((this.LinkedView == null && invalidHostState.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidHostState.LinkedView))) && ((this.Host == null && invalidHostState.Host == null) || (this.Host != null && this.Host.Equals(invalidHostState.Host))));\n        }\n\n        public override bool Equals(object invalidHostState)\n        {\n            return Equals(invalidHostState as InvalidHostState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class InvalidHostState_LinkedView : IEquatable<InvalidHostState_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(InvalidHostState_LinkedView invalidHostState_LinkedView)\n        {\n            return (invalidHostState_LinkedView != null && ((this.Host == null && invalidHostState_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(invalidHostState_LinkedView.Host))));\n        }\n\n        public override bool Equals(object invalidHostState_LinkedView)\n        {\n            return Equals(invalidHostState_LinkedView as InvalidHostState_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class InvalidIndexArgument : InvalidArgument, IEquatable<InvalidIndexArgument>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(InvalidIndexArgument invalidIndexArgument)\n        {\n            return (invalidIndexArgument != null && this.Key == invalidIndexArgument.Key);\n        }\n\n        public override bool Equals(object invalidIndexArgument)\n        {\n            return Equals(invalidIndexArgument as InvalidIndexArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class InvalidIpfixConfig : DvsFault, IEquatable<InvalidIpfixConfig>\n    {\n        public string Property { get; set; }\n\n        public bool Equals(InvalidIpfixConfig invalidIpfixConfig)\n        {\n            return (invalidIpfixConfig != null && this.Property == invalidIpfixConfig.Property);\n        }\n\n        public override bool Equals(object invalidIpfixConfig)\n        {\n            return Equals(invalidIpfixConfig as InvalidIpfixConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Property).GetHashCode();\n        }\n    }\n\n    public class InvalidIpmiLoginInfo : VimFault, IEquatable<InvalidIpmiLoginInfo>\n    {\n        public bool Equals(InvalidIpmiLoginInfo invalidIpmiLoginInfo)\n        {\n            return (invalidIpmiLoginInfo != null && base.Equals(invalidIpmiLoginInfo));\n        }\n\n        public override bool Equals(object invalidIpmiLoginInfo)\n        {\n            return Equals(invalidIpmiLoginInfo as InvalidIpmiLoginInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidIpmiMacAddress : VimFault, IEquatable<InvalidIpmiMacAddress>\n    {\n        public string UserProvidedMacAddress { get; set; }\n\n        public string ObservedMacAddress { get; set; }\n\n        public bool Equals(InvalidIpmiMacAddress invalidIpmiMacAddress)\n        {\n            return (invalidIpmiMacAddress != null && this.UserProvidedMacAddress == invalidIpmiMacAddress.UserProvidedMacAddress && this.ObservedMacAddress == invalidIpmiMacAddress.ObservedMacAddress);\n        }\n\n        public override bool Equals(object invalidIpmiMacAddress)\n        {\n            return Equals(invalidIpmiMacAddress as InvalidIpmiMacAddress);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserProvidedMacAddress + \"_\" + ObservedMacAddress).GetHashCode();\n        }\n    }\n\n    public class InvalidLicense : VimFault, IEquatable<InvalidLicense>\n    {\n        public string LicenseContent { get; set; }\n\n        public bool Equals(InvalidLicense invalidLicense)\n        {\n            return (invalidLicense != null && this.LicenseContent == invalidLicense.LicenseContent);\n        }\n\n        public override bool Equals(object invalidLicense)\n        {\n            return Equals(invalidLicense as InvalidLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseContent).GetHashCode();\n        }\n    }\n\n    public class InvalidLocale : VimFault, IEquatable<InvalidLocale>\n    {\n        public bool Equals(InvalidLocale invalidLocale)\n        {\n            return (invalidLocale != null && base.Equals(invalidLocale));\n        }\n\n        public override bool Equals(object invalidLocale)\n        {\n            return Equals(invalidLocale as InvalidLocale);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidLogin : VimFault, IEquatable<InvalidLogin>\n    {\n        public bool Equals(InvalidLogin invalidLogin)\n        {\n            return (invalidLogin != null && base.Equals(invalidLogin));\n        }\n\n        public override bool Equals(object invalidLogin)\n        {\n            return Equals(invalidLogin as InvalidLogin);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidName : VimFault, IEquatable<InvalidName>\n    {\n        public string Name { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public InvalidName_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidName invalidName)\n        {\n            return (invalidName != null && this.Name == invalidName.Name && ((this.Entity == null && invalidName.Entity == null) || (this.Entity != null && this.Entity.Equals(invalidName.Entity))) && ((this.LinkedView == null && invalidName.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidName.LinkedView))));\n        }\n\n        public override bool Equals(object invalidName)\n        {\n            return Equals(invalidName as InvalidName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidName_LinkedView : IEquatable<InvalidName_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(InvalidName_LinkedView invalidName_LinkedView)\n        {\n            return (invalidName_LinkedView != null && ((this.Entity == null && invalidName_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(invalidName_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object invalidName_LinkedView)\n        {\n            return Equals(invalidName_LinkedView as InvalidName_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class InvalidNasCredentials : NasConfigFault, IEquatable<InvalidNasCredentials>\n    {\n        public string UserName { get; set; }\n\n        public bool Equals(InvalidNasCredentials invalidNasCredentials)\n        {\n            return (invalidNasCredentials != null && this.UserName == invalidNasCredentials.UserName);\n        }\n\n        public override bool Equals(object invalidNasCredentials)\n        {\n            return Equals(invalidNasCredentials as InvalidNasCredentials);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserName).GetHashCode();\n        }\n    }\n\n    public class InvalidNetworkInType : VAppPropertyFault, IEquatable<InvalidNetworkInType>\n    {\n        public bool Equals(InvalidNetworkInType invalidNetworkInType)\n        {\n            return (invalidNetworkInType != null && base.Equals(invalidNetworkInType));\n        }\n\n        public override bool Equals(object invalidNetworkInType)\n        {\n            return Equals(invalidNetworkInType as InvalidNetworkInType);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidNetworkResource : NasConfigFault, IEquatable<InvalidNetworkResource>\n    {\n        public string RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public bool Equals(InvalidNetworkResource invalidNetworkResource)\n        {\n            return (invalidNetworkResource != null && this.RemoteHost == invalidNetworkResource.RemoteHost && this.RemotePath == invalidNetworkResource.RemotePath);\n        }\n\n        public override bool Equals(object invalidNetworkResource)\n        {\n            return Equals(invalidNetworkResource as InvalidNetworkResource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath).GetHashCode();\n        }\n    }\n\n    public class InvalidOperationOnSecondaryVm : VmFaultToleranceIssue, IEquatable<InvalidOperationOnSecondaryVm>\n    {\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(InvalidOperationOnSecondaryVm invalidOperationOnSecondaryVm)\n        {\n            return (invalidOperationOnSecondaryVm != null && this.InstanceUuid == invalidOperationOnSecondaryVm.InstanceUuid);\n        }\n\n        public override bool Equals(object invalidOperationOnSecondaryVm)\n        {\n            return Equals(invalidOperationOnSecondaryVm as InvalidOperationOnSecondaryVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class InvalidPowerState : InvalidState, IEquatable<InvalidPowerState>\n    {\n        public VirtualMachinePowerState? RequestedState { get; set; }\n\n        public VirtualMachinePowerState ExistingState { get; set; }\n\n        public bool Equals(InvalidPowerState invalidPowerState)\n        {\n            return (invalidPowerState != null && ((this.RequestedState == null && invalidPowerState.RequestedState == null) || (this.RequestedState != null && this.RequestedState.Equals(invalidPowerState.RequestedState))) && this.ExistingState == invalidPowerState.ExistingState);\n        }\n\n        public override bool Equals(object invalidPowerState)\n        {\n            return Equals(invalidPowerState as InvalidPowerState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RequestedState + \"_\" + ExistingState).GetHashCode();\n        }\n    }\n\n    public class InvalidPrivilege : VimFault, IEquatable<InvalidPrivilege>\n    {\n        public string Privilege { get; set; }\n\n        public bool Equals(InvalidPrivilege invalidPrivilege)\n        {\n            return (invalidPrivilege != null && this.Privilege == invalidPrivilege.Privilege);\n        }\n\n        public override bool Equals(object invalidPrivilege)\n        {\n            return Equals(invalidPrivilege as InvalidPrivilege);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Privilege).GetHashCode();\n        }\n    }\n\n    public class InvalidProfileReferenceHost : RuntimeFault, IEquatable<InvalidProfileReferenceHost>\n    {\n        public string Reason { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public ManagedObjectReference Profile { get; set; }\n\n        public string ProfileName { get; set; }\n\n        public InvalidProfileReferenceHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidProfileReferenceHost invalidProfileReferenceHost)\n        {\n            return (invalidProfileReferenceHost != null && this.Reason == invalidProfileReferenceHost.Reason && ((this.Host == null && invalidProfileReferenceHost.Host == null) || (this.Host != null && this.Host.Equals(invalidProfileReferenceHost.Host))) && ((this.Profile == null && invalidProfileReferenceHost.Profile == null) || (this.Profile != null && this.Profile.Equals(invalidProfileReferenceHost.Profile))) && this.ProfileName == invalidProfileReferenceHost.ProfileName && ((this.LinkedView == null && invalidProfileReferenceHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidProfileReferenceHost.LinkedView))));\n        }\n\n        public override bool Equals(object invalidProfileReferenceHost)\n        {\n            return Equals(invalidProfileReferenceHost as InvalidProfileReferenceHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + Host + \"_\" + Profile + \"_\" + ProfileName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidProfileReferenceHost_LinkedView : IEquatable<InvalidProfileReferenceHost_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public Profile Profile { get; set; }\n\n        public bool Equals(InvalidProfileReferenceHost_LinkedView invalidProfileReferenceHost_LinkedView)\n        {\n            return (invalidProfileReferenceHost_LinkedView != null && ((this.Host == null && invalidProfileReferenceHost_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(invalidProfileReferenceHost_LinkedView.Host))) && ((this.Profile == null && invalidProfileReferenceHost_LinkedView.Profile == null) || (this.Profile != null && this.Profile.Equals(invalidProfileReferenceHost_LinkedView.Profile))));\n        }\n\n        public override bool Equals(object invalidProfileReferenceHost_LinkedView)\n        {\n            return Equals(invalidProfileReferenceHost_LinkedView as InvalidProfileReferenceHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Profile).GetHashCode();\n        }\n    }\n\n    public class InvalidProperty : MethodFault, IEquatable<InvalidProperty>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(InvalidProperty invalidProperty)\n        {\n            return (invalidProperty != null && this.Name == invalidProperty.Name);\n        }\n\n        public override bool Equals(object invalidProperty)\n        {\n            return Equals(invalidProperty as InvalidProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class InvalidPropertyType : VAppPropertyFault, IEquatable<InvalidPropertyType>\n    {\n        public bool Equals(InvalidPropertyType invalidPropertyType)\n        {\n            return (invalidPropertyType != null && base.Equals(invalidPropertyType));\n        }\n\n        public override bool Equals(object invalidPropertyType)\n        {\n            return Equals(invalidPropertyType as InvalidPropertyType);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidPropertyValue : VAppPropertyFault, IEquatable<InvalidPropertyValue>\n    {\n        public bool Equals(InvalidPropertyValue invalidPropertyValue)\n        {\n            return (invalidPropertyValue != null && base.Equals(invalidPropertyValue));\n        }\n\n        public override bool Equals(object invalidPropertyValue)\n        {\n            return Equals(invalidPropertyValue as InvalidPropertyValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidRequest : RuntimeFault, IEquatable<InvalidRequest>\n    {\n        public bool Equals(InvalidRequest invalidRequest)\n        {\n            return (invalidRequest != null && base.Equals(invalidRequest));\n        }\n\n        public override bool Equals(object invalidRequest)\n        {\n            return Equals(invalidRequest as InvalidRequest);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidResourcePoolStructureFault : InsufficientResourcesFault, IEquatable<InvalidResourcePoolStructureFault>\n    {\n        public bool Equals(InvalidResourcePoolStructureFault invalidResourcePoolStructureFault)\n        {\n            return (invalidResourcePoolStructureFault != null && base.Equals(invalidResourcePoolStructureFault));\n        }\n\n        public override bool Equals(object invalidResourcePoolStructureFault)\n        {\n            return Equals(invalidResourcePoolStructureFault as InvalidResourcePoolStructureFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidSnapshotFormat : InvalidFormat, IEquatable<InvalidSnapshotFormat>\n    {\n        public bool Equals(InvalidSnapshotFormat invalidSnapshotFormat)\n        {\n            return (invalidSnapshotFormat != null && base.Equals(invalidSnapshotFormat));\n        }\n\n        public override bool Equals(object invalidSnapshotFormat)\n        {\n            return Equals(invalidSnapshotFormat as InvalidSnapshotFormat);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidState : VimFault, IEquatable<InvalidState>\n    {\n        public bool Equals(InvalidState invalidState)\n        {\n            return (invalidState != null && base.Equals(invalidState));\n        }\n\n        public override bool Equals(object invalidState)\n        {\n            return Equals(invalidState as InvalidState);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class InvalidType : InvalidRequest, IEquatable<InvalidType>\n    {\n        public string Argument { get; set; }\n\n        public bool Equals(InvalidType invalidType)\n        {\n            return (invalidType != null && this.Argument == invalidType.Argument);\n        }\n\n        public override bool Equals(object invalidType)\n        {\n            return Equals(invalidType as InvalidType);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Argument).GetHashCode();\n        }\n    }\n\n    public class InvalidVmConfig : VmConfigFault, IEquatable<InvalidVmConfig>\n    {\n        public string Property { get; set; }\n\n        public bool Equals(InvalidVmConfig invalidVmConfig)\n        {\n            return (invalidVmConfig != null && this.Property == invalidVmConfig.Property);\n        }\n\n        public override bool Equals(object invalidVmConfig)\n        {\n            return Equals(invalidVmConfig as InvalidVmConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Property).GetHashCode();\n        }\n    }\n\n    public class InvalidVmState : InvalidState, IEquatable<InvalidVmState>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public InvalidVmState_LinkedView LinkedView { get; set; }\n\n        public bool Equals(InvalidVmState invalidVmState)\n        {\n            return (invalidVmState != null && ((this.Vm == null && invalidVmState.Vm == null) || (this.Vm != null && this.Vm.Equals(invalidVmState.Vm))) && ((this.LinkedView == null && invalidVmState.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(invalidVmState.LinkedView))));\n        }\n\n        public override bool Equals(object invalidVmState)\n        {\n            return Equals(invalidVmState as InvalidVmState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class InvalidVmState_LinkedView : IEquatable<InvalidVmState_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(InvalidVmState_LinkedView invalidVmState_LinkedView)\n        {\n            return (invalidVmState_LinkedView != null && ((this.Vm == null && invalidVmState_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(invalidVmState_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object invalidVmState_LinkedView)\n        {\n            return Equals(invalidVmState_LinkedView as InvalidVmState_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class InventoryDescription : DynamicData, IEquatable<InventoryDescription>\n    {\n        public int NumHosts { get; set; }\n\n        public int NumVirtualMachines { get; set; }\n\n        public int? NumResourcePools { get; set; }\n\n        public int? NumClusters { get; set; }\n\n        public int? NumCpuDev { get; set; }\n\n        public int? NumNetDev { get; set; }\n\n        public int? NumDiskDev { get; set; }\n\n        public int? NumvCpuDev { get; set; }\n\n        public int? NumvNetDev { get; set; }\n\n        public int? NumvDiskDev { get; set; }\n\n        public bool Equals(InventoryDescription inventoryDescription)\n        {\n            return (inventoryDescription != null && this.NumHosts == inventoryDescription.NumHosts && this.NumVirtualMachines == inventoryDescription.NumVirtualMachines && ((this.NumResourcePools == null && inventoryDescription.NumResourcePools == null) || (this.NumResourcePools != null && this.NumResourcePools.Equals(inventoryDescription.NumResourcePools))) && ((this.NumClusters == null && inventoryDescription.NumClusters == null) || (this.NumClusters != null && this.NumClusters.Equals(inventoryDescription.NumClusters))) && ((this.NumCpuDev == null && inventoryDescription.NumCpuDev == null) || (this.NumCpuDev != null && this.NumCpuDev.Equals(inventoryDescription.NumCpuDev))) && ((this.NumNetDev == null && inventoryDescription.NumNetDev == null) || (this.NumNetDev != null && this.NumNetDev.Equals(inventoryDescription.NumNetDev))) && ((this.NumDiskDev == null && inventoryDescription.NumDiskDev == null) || (this.NumDiskDev != null && this.NumDiskDev.Equals(inventoryDescription.NumDiskDev))) && ((this.NumvCpuDev == null && inventoryDescription.NumvCpuDev == null) || (this.NumvCpuDev != null && this.NumvCpuDev.Equals(inventoryDescription.NumvCpuDev))) && ((this.NumvNetDev == null && inventoryDescription.NumvNetDev == null) || (this.NumvNetDev != null && this.NumvNetDev.Equals(inventoryDescription.NumvNetDev))) && ((this.NumvDiskDev == null && inventoryDescription.NumvDiskDev == null) || (this.NumvDiskDev != null && this.NumvDiskDev.Equals(inventoryDescription.NumvDiskDev))));\n        }\n\n        public override bool Equals(object inventoryDescription)\n        {\n            return Equals(inventoryDescription as InventoryDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumHosts + \"_\" + NumVirtualMachines + \"_\" + NumResourcePools + \"_\" + NumClusters + \"_\" + NumCpuDev + \"_\" + NumNetDev + \"_\" + NumDiskDev + \"_\" + NumvCpuDev + \"_\" + NumvNetDev + \"_\" + NumvDiskDev).GetHashCode();\n        }\n    }\n\n    public class InventoryHasStandardAloneHosts : NotEnoughLicenses, IEquatable<InventoryHasStandardAloneHosts>\n    {\n        public string[] Hosts { get; set; }\n\n        public bool Equals(InventoryHasStandardAloneHosts inventoryHasStandardAloneHosts)\n        {\n            return (inventoryHasStandardAloneHosts != null && ((this.Hosts == null && inventoryHasStandardAloneHosts.Hosts == null) || (this.Hosts != null && inventoryHasStandardAloneHosts.Hosts != null && Enumerable.SequenceEqual(this.Hosts, inventoryHasStandardAloneHosts.Hosts))));\n        }\n\n        public override bool Equals(object inventoryHasStandardAloneHosts)\n        {\n            return Equals(inventoryHasStandardAloneHosts as InventoryHasStandardAloneHosts);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class InventoryView : ManagedObjectView, IEquatable<InventoryView>\n    {\n        public ManagedObjectReference[] OpenInventoryViewFolder(ManagedObjectReference[] entity)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ManagedObjectReference[] CloseInventoryViewFolder(ManagedObjectReference[] entity)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool Equals(InventoryView inventoryView)\n        {\n            return (inventoryView != null && base.Equals(inventoryView));\n        }\n\n        public override bool Equals(object inventoryView)\n        {\n            return Equals(inventoryView as InventoryView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IoFilterHostIssue : DynamicData, IEquatable<IoFilterHostIssue>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public LocalizedMethodFault[] Issue { get; set; }\n\n        public IoFilterHostIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(IoFilterHostIssue ioFilterHostIssue)\n        {\n            return (ioFilterHostIssue != null && ((this.Host == null && ioFilterHostIssue.Host == null) || (this.Host != null && this.Host.Equals(ioFilterHostIssue.Host))) && ((this.Issue == null && ioFilterHostIssue.Issue == null) || (this.Issue != null && ioFilterHostIssue.Issue != null && Enumerable.SequenceEqual(this.Issue, ioFilterHostIssue.Issue))) && ((this.LinkedView == null && ioFilterHostIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ioFilterHostIssue.LinkedView))));\n        }\n\n        public override bool Equals(object ioFilterHostIssue)\n        {\n            return Equals(ioFilterHostIssue as IoFilterHostIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Issue + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class IoFilterHostIssue_LinkedView : IEquatable<IoFilterHostIssue_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(IoFilterHostIssue_LinkedView ioFilterHostIssue_LinkedView)\n        {\n            return (ioFilterHostIssue_LinkedView != null && ((this.Host == null && ioFilterHostIssue_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(ioFilterHostIssue_LinkedView.Host))));\n        }\n\n        public override bool Equals(object ioFilterHostIssue_LinkedView)\n        {\n            return Equals(ioFilterHostIssue_LinkedView as IoFilterHostIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class IoFilterInfo : DynamicData, IEquatable<IoFilterInfo>\n    {\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Version { get; set; }\n\n        public string Type { get; set; }\n\n        public string Summary { get; set; }\n\n        public string ReleaseDate { get; set; }\n\n        public bool Equals(IoFilterInfo ioFilterInfo)\n        {\n            return (ioFilterInfo != null && this.Id == ioFilterInfo.Id && this.Name == ioFilterInfo.Name && this.Vendor == ioFilterInfo.Vendor && this.Version == ioFilterInfo.Version && this.Type == ioFilterInfo.Type && this.Summary == ioFilterInfo.Summary && this.ReleaseDate == ioFilterInfo.ReleaseDate);\n        }\n\n        public override bool Equals(object ioFilterInfo)\n        {\n            return Equals(ioFilterInfo as IoFilterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + Vendor + \"_\" + Version + \"_\" + Type + \"_\" + Summary + \"_\" + ReleaseDate).GetHashCode();\n        }\n    }\n\n    public class IoFilterManager : ViewBase, IEquatable<IoFilterManager>\n    {\n        public ManagedObjectReference InstallIoFilter_Task(string vibUrl, ManagedObjectReference compRes)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterIoFilterInfo InstallIoFilter(string vibUrl, ManagedObjectReference compRes)\n        {\n            return default(ClusterIoFilterInfo);\n        }\n\n        public ManagedObjectReference UninstallIoFilter_Task(string filterId, ManagedObjectReference compRes)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UninstallIoFilter(string filterId, ManagedObjectReference compRes)\n        {\n        }\n\n        public ManagedObjectReference UpgradeIoFilter_Task(string filterId, ManagedObjectReference compRes, string vibUrl)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ClusterIoFilterInfo UpgradeIoFilter(string filterId, ManagedObjectReference compRes, string vibUrl)\n        {\n            return default(ClusterIoFilterInfo);\n        }\n\n        public IoFilterQueryIssueResult QueryIoFilterIssues(string filterId, ManagedObjectReference compRes)\n        {\n            return default(IoFilterQueryIssueResult);\n        }\n\n        public ClusterIoFilterInfo[] QueryIoFilterInfo(ManagedObjectReference compRes)\n        {\n            return default(ClusterIoFilterInfo[]);\n        }\n\n        public ManagedObjectReference ResolveInstallationErrorsOnHost_Task(string filterId, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ResolveInstallationErrorsOnHost(string filterId, ManagedObjectReference host)\n        {\n        }\n\n        public ManagedObjectReference ResolveInstallationErrorsOnCluster_Task(string filterId, ManagedObjectReference cluster)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ResolveInstallationErrorsOnCluster(string filterId, ManagedObjectReference cluster)\n        {\n        }\n\n        public VirtualDiskId[] QueryDisksUsingFilter(string filterId, ManagedObjectReference compRes)\n        {\n            return default(VirtualDiskId[]);\n        }\n\n        public bool Equals(IoFilterManager ioFilterManager)\n        {\n            return (ioFilterManager != null && base.Equals(ioFilterManager));\n        }\n\n        public override bool Equals(object ioFilterManager)\n        {\n            return Equals(ioFilterManager as IoFilterManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IoFilterQueryIssueResult : DynamicData, IEquatable<IoFilterQueryIssueResult>\n    {\n        public string OpType { get; set; }\n\n        public IoFilterHostIssue[] HostIssue { get; set; }\n\n        public bool Equals(IoFilterQueryIssueResult ioFilterQueryIssueResult)\n        {\n            return (ioFilterQueryIssueResult != null && this.OpType == ioFilterQueryIssueResult.OpType && ((this.HostIssue == null && ioFilterQueryIssueResult.HostIssue == null) || (this.HostIssue != null && ioFilterQueryIssueResult.HostIssue != null && Enumerable.SequenceEqual(this.HostIssue, ioFilterQueryIssueResult.HostIssue))));\n        }\n\n        public override bool Equals(object ioFilterQueryIssueResult)\n        {\n            return Equals(ioFilterQueryIssueResult as IoFilterQueryIssueResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OpType + \"_\" + HostIssue).GetHashCode();\n        }\n    }\n\n    public class IORMNotSupportedHostOnDatastore : VimFault, IEquatable<IORMNotSupportedHostOnDatastore>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string DatastoreName { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public IORMNotSupportedHostOnDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(IORMNotSupportedHostOnDatastore iORMNotSupportedHostOnDatastore)\n        {\n            return (iORMNotSupportedHostOnDatastore != null && ((this.Datastore == null && iORMNotSupportedHostOnDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(iORMNotSupportedHostOnDatastore.Datastore))) && this.DatastoreName == iORMNotSupportedHostOnDatastore.DatastoreName && ((this.Host == null && iORMNotSupportedHostOnDatastore.Host == null) || (this.Host != null && iORMNotSupportedHostOnDatastore.Host != null && Enumerable.SequenceEqual(this.Host, iORMNotSupportedHostOnDatastore.Host))) && ((this.LinkedView == null && iORMNotSupportedHostOnDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(iORMNotSupportedHostOnDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object iORMNotSupportedHostOnDatastore)\n        {\n            return Equals(iORMNotSupportedHostOnDatastore as IORMNotSupportedHostOnDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + DatastoreName + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class IORMNotSupportedHostOnDatastore_LinkedView : IEquatable<IORMNotSupportedHostOnDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(IORMNotSupportedHostOnDatastore_LinkedView iORMNotSupportedHostOnDatastore_LinkedView)\n        {\n            return (iORMNotSupportedHostOnDatastore_LinkedView != null && ((this.Datastore == null && iORMNotSupportedHostOnDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(iORMNotSupportedHostOnDatastore_LinkedView.Datastore))) && ((this.Host == null && iORMNotSupportedHostOnDatastore_LinkedView.Host == null) || (this.Host != null && iORMNotSupportedHostOnDatastore_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, iORMNotSupportedHostOnDatastore_LinkedView.Host))));\n        }\n\n        public override bool Equals(object iORMNotSupportedHostOnDatastore_LinkedView)\n        {\n            return Equals(iORMNotSupportedHostOnDatastore_LinkedView as IORMNotSupportedHostOnDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class IpAddress : NegatableExpression, IEquatable<IpAddress>\n    {\n        public bool Equals(IpAddress ipAddress)\n        {\n            return (ipAddress != null && base.Equals(ipAddress));\n        }\n\n        public override bool Equals(object ipAddress)\n        {\n            return Equals(ipAddress as IpAddress);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IpAddressProfile : ApplyProfile, IEquatable<IpAddressProfile>\n    {\n        public bool Equals(IpAddressProfile ipAddressProfile)\n        {\n            return (ipAddressProfile != null && base.Equals(ipAddressProfile));\n        }\n\n        public override bool Equals(object ipAddressProfile)\n        {\n            return Equals(ipAddressProfile as IpAddressProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IpHostnameGeneratorError : CustomizationFault, IEquatable<IpHostnameGeneratorError>\n    {\n        public bool Equals(IpHostnameGeneratorError ipHostnameGeneratorError)\n        {\n            return (ipHostnameGeneratorError != null && base.Equals(ipHostnameGeneratorError));\n        }\n\n        public override bool Equals(object ipHostnameGeneratorError)\n        {\n            return Equals(ipHostnameGeneratorError as IpHostnameGeneratorError);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IpPool : DynamicData, IEquatable<IpPool>\n    {\n        public int? Id { get; set; }\n\n        public string Name { get; set; }\n\n        public IpPoolIpPoolConfigInfo Ipv4Config { get; set; }\n\n        public IpPoolIpPoolConfigInfo Ipv6Config { get; set; }\n\n        public string DnsDomain { get; set; }\n\n        public string DnsSearchPath { get; set; }\n\n        public string HostPrefix { get; set; }\n\n        public string HttpProxy { get; set; }\n\n        public IpPoolAssociation[] NetworkAssociation { get; set; }\n\n        public int? AvailableIpv4Addresses { get; set; }\n\n        public int? AvailableIpv6Addresses { get; set; }\n\n        public int? AllocatedIpv4Addresses { get; set; }\n\n        public int? AllocatedIpv6Addresses { get; set; }\n\n        public bool Equals(IpPool ipPool)\n        {\n            return (ipPool != null && ((this.Id == null && ipPool.Id == null) || (this.Id != null && this.Id.Equals(ipPool.Id))) && this.Name == ipPool.Name && ((this.Ipv4Config == null && ipPool.Ipv4Config == null) || (this.Ipv4Config != null && this.Ipv4Config.Equals(ipPool.Ipv4Config))) && ((this.Ipv6Config == null && ipPool.Ipv6Config == null) || (this.Ipv6Config != null && this.Ipv6Config.Equals(ipPool.Ipv6Config))) && this.DnsDomain == ipPool.DnsDomain && this.DnsSearchPath == ipPool.DnsSearchPath && this.HostPrefix == ipPool.HostPrefix && this.HttpProxy == ipPool.HttpProxy && ((this.NetworkAssociation == null && ipPool.NetworkAssociation == null) || (this.NetworkAssociation != null && ipPool.NetworkAssociation != null && Enumerable.SequenceEqual(this.NetworkAssociation, ipPool.NetworkAssociation))) && ((this.AvailableIpv4Addresses == null && ipPool.AvailableIpv4Addresses == null) || (this.AvailableIpv4Addresses != null && this.AvailableIpv4Addresses.Equals(ipPool.AvailableIpv4Addresses))) && ((this.AvailableIpv6Addresses == null && ipPool.AvailableIpv6Addresses == null) || (this.AvailableIpv6Addresses != null && this.AvailableIpv6Addresses.Equals(ipPool.AvailableIpv6Addresses))) && ((this.AllocatedIpv4Addresses == null && ipPool.AllocatedIpv4Addresses == null) || (this.AllocatedIpv4Addresses != null && this.AllocatedIpv4Addresses.Equals(ipPool.AllocatedIpv4Addresses))) && ((this.AllocatedIpv6Addresses == null && ipPool.AllocatedIpv6Addresses == null) || (this.AllocatedIpv6Addresses != null && this.AllocatedIpv6Addresses.Equals(ipPool.AllocatedIpv6Addresses))));\n        }\n\n        public override bool Equals(object ipPool)\n        {\n            return Equals(ipPool as IpPool);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + Ipv4Config + \"_\" + Ipv6Config + \"_\" + DnsDomain + \"_\" + DnsSearchPath + \"_\" + HostPrefix + \"_\" + HttpProxy + \"_\" + NetworkAssociation + \"_\" + AvailableIpv4Addresses + \"_\" + AvailableIpv6Addresses + \"_\" + AllocatedIpv4Addresses + \"_\" + AllocatedIpv6Addresses).GetHashCode();\n        }\n    }\n\n    public class IpPoolAssociation : DynamicData, IEquatable<IpPoolAssociation>\n    {\n        public ManagedObjectReference Network { get; set; }\n\n        public string NetworkName { get; set; }\n\n        public IpPoolAssociation_LinkedView LinkedView { get; set; }\n\n        public bool Equals(IpPoolAssociation ipPoolAssociation)\n        {\n            return (ipPoolAssociation != null && ((this.Network == null && ipPoolAssociation.Network == null) || (this.Network != null && this.Network.Equals(ipPoolAssociation.Network))) && this.NetworkName == ipPoolAssociation.NetworkName && ((this.LinkedView == null && ipPoolAssociation.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ipPoolAssociation.LinkedView))));\n        }\n\n        public override bool Equals(object ipPoolAssociation)\n        {\n            return Equals(ipPoolAssociation as IpPoolAssociation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + NetworkName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class IpPoolAssociation_LinkedView : IEquatable<IpPoolAssociation_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(IpPoolAssociation_LinkedView ipPoolAssociation_LinkedView)\n        {\n            return (ipPoolAssociation_LinkedView != null && ((this.Network == null && ipPoolAssociation_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(ipPoolAssociation_LinkedView.Network))));\n        }\n\n        public override bool Equals(object ipPoolAssociation_LinkedView)\n        {\n            return Equals(ipPoolAssociation_LinkedView as IpPoolAssociation_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class IpPoolIpPoolConfigInfo : DynamicData, IEquatable<IpPoolIpPoolConfigInfo>\n    {\n        public string SubnetAddress { get; set; }\n\n        public string Netmask { get; set; }\n\n        public string Gateway { get; set; }\n\n        public string Range { get; set; }\n\n        public string[] Dns { get; set; }\n\n        public bool? DhcpServerAvailable { get; set; }\n\n        public bool? IpPoolEnabled { get; set; }\n\n        public bool Equals(IpPoolIpPoolConfigInfo ipPoolIpPoolConfigInfo)\n        {\n            return (ipPoolIpPoolConfigInfo != null && this.SubnetAddress == ipPoolIpPoolConfigInfo.SubnetAddress && this.Netmask == ipPoolIpPoolConfigInfo.Netmask && this.Gateway == ipPoolIpPoolConfigInfo.Gateway && this.Range == ipPoolIpPoolConfigInfo.Range && ((this.Dns == null && ipPoolIpPoolConfigInfo.Dns == null) || (this.Dns != null && ipPoolIpPoolConfigInfo.Dns != null && Enumerable.SequenceEqual(this.Dns, ipPoolIpPoolConfigInfo.Dns))) && ((this.DhcpServerAvailable == null && ipPoolIpPoolConfigInfo.DhcpServerAvailable == null) || (this.DhcpServerAvailable != null && this.DhcpServerAvailable.Equals(ipPoolIpPoolConfigInfo.DhcpServerAvailable))) && ((this.IpPoolEnabled == null && ipPoolIpPoolConfigInfo.IpPoolEnabled == null) || (this.IpPoolEnabled != null && this.IpPoolEnabled.Equals(ipPoolIpPoolConfigInfo.IpPoolEnabled))));\n        }\n\n        public override bool Equals(object ipPoolIpPoolConfigInfo)\n        {\n            return Equals(ipPoolIpPoolConfigInfo as IpPoolIpPoolConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SubnetAddress + \"_\" + Netmask + \"_\" + Gateway + \"_\" + Range + \"_\" + Dns + \"_\" + DhcpServerAvailable + \"_\" + IpPoolEnabled).GetHashCode();\n        }\n    }\n\n    public class IpPoolManager : ViewBase, IEquatable<IpPoolManager>\n    {\n        public IpPool[] QueryIpPools(ManagedObjectReference dc)\n        {\n            return default(IpPool[]);\n        }\n\n        public int CreateIpPool(ManagedObjectReference dc, IpPool pool)\n        {\n            return default(int);\n        }\n\n        public void UpdateIpPool(ManagedObjectReference dc, IpPool pool)\n        {\n        }\n\n        public void DestroyIpPool(ManagedObjectReference dc, int id, bool force)\n        {\n        }\n\n        public string AllocateIpv4Address(ManagedObjectReference dc, int poolId, string allocationId)\n        {\n            return default(string);\n        }\n\n        public string AllocateIpv6Address(ManagedObjectReference dc, int poolId, string allocationId)\n        {\n            return default(string);\n        }\n\n        public void ReleaseIpAllocation(ManagedObjectReference dc, int poolId, string allocationId)\n        {\n        }\n\n        public IpPoolManagerIpAllocation[] QueryIPAllocations(ManagedObjectReference dc, int poolId, string extensionKey)\n        {\n            return default(IpPoolManagerIpAllocation[]);\n        }\n\n        public bool Equals(IpPoolManager ipPoolManager)\n        {\n            return (ipPoolManager != null && base.Equals(ipPoolManager));\n        }\n\n        public override bool Equals(object ipPoolManager)\n        {\n            return Equals(ipPoolManager as IpPoolManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IpPoolManagerIpAllocation : DynamicData, IEquatable<IpPoolManagerIpAllocation>\n    {\n        public string IpAddress { get; set; }\n\n        public string AllocationId { get; set; }\n\n        public bool Equals(IpPoolManagerIpAllocation ipPoolManagerIpAllocation)\n        {\n            return (ipPoolManagerIpAllocation != null && this.IpAddress == ipPoolManagerIpAllocation.IpAddress && this.AllocationId == ipPoolManagerIpAllocation.AllocationId);\n        }\n\n        public override bool Equals(object ipPoolManagerIpAllocation)\n        {\n            return Equals(ipPoolManagerIpAllocation as IpPoolManagerIpAllocation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + AllocationId).GetHashCode();\n        }\n    }\n\n    public class IpRange : IpAddress, IEquatable<IpRange>\n    {\n        public string AddressPrefix { get; set; }\n\n        public int? PrefixLength { get; set; }\n\n        public bool Equals(IpRange ipRange)\n        {\n            return (ipRange != null && this.AddressPrefix == ipRange.AddressPrefix && ((this.PrefixLength == null && ipRange.PrefixLength == null) || (this.PrefixLength != null && this.PrefixLength.Equals(ipRange.PrefixLength))));\n        }\n\n        public override bool Equals(object ipRange)\n        {\n            return Equals(ipRange as IpRange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AddressPrefix + \"_\" + PrefixLength).GetHashCode();\n        }\n    }\n\n    public class IpRouteProfile : ApplyProfile, IEquatable<IpRouteProfile>\n    {\n        public StaticRouteProfile[] StaticRoute { get; set; }\n\n        public bool Equals(IpRouteProfile ipRouteProfile)\n        {\n            return (ipRouteProfile != null && ((this.StaticRoute == null && ipRouteProfile.StaticRoute == null) || (this.StaticRoute != null && ipRouteProfile.StaticRoute != null && Enumerable.SequenceEqual(this.StaticRoute, ipRouteProfile.StaticRoute))));\n        }\n\n        public override bool Equals(object ipRouteProfile)\n        {\n            return Equals(ipRouteProfile as IpRouteProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StaticRoute).GetHashCode();\n        }\n    }\n\n    public class IScsiBootFailureEvent : HostEvent, IEquatable<IScsiBootFailureEvent>\n    {\n        public bool Equals(IScsiBootFailureEvent iScsiBootFailureEvent)\n        {\n            return (iScsiBootFailureEvent != null && base.Equals(iScsiBootFailureEvent));\n        }\n\n        public override bool Equals(object iScsiBootFailureEvent)\n        {\n            return Equals(iScsiBootFailureEvent as IScsiBootFailureEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IscsiDependencyEntity : DynamicData, IEquatable<IscsiDependencyEntity>\n    {\n        public string PnicDevice { get; set; }\n\n        public string VnicDevice { get; set; }\n\n        public string VmhbaName { get; set; }\n\n        public bool Equals(IscsiDependencyEntity iscsiDependencyEntity)\n        {\n            return (iscsiDependencyEntity != null && this.PnicDevice == iscsiDependencyEntity.PnicDevice && this.VnicDevice == iscsiDependencyEntity.VnicDevice && this.VmhbaName == iscsiDependencyEntity.VmhbaName);\n        }\n\n        public override bool Equals(object iscsiDependencyEntity)\n        {\n            return Equals(iscsiDependencyEntity as IscsiDependencyEntity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PnicDevice + \"_\" + VnicDevice + \"_\" + VmhbaName).GetHashCode();\n        }\n    }\n\n    public class IscsiFault : VimFault, IEquatable<IscsiFault>\n    {\n        public bool Equals(IscsiFault iscsiFault)\n        {\n            return (iscsiFault != null && base.Equals(iscsiFault));\n        }\n\n        public override bool Equals(object iscsiFault)\n        {\n            return Equals(iscsiFault as IscsiFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IscsiFaultInvalidVnic : IscsiFault, IEquatable<IscsiFaultInvalidVnic>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultInvalidVnic iscsiFaultInvalidVnic)\n        {\n            return (iscsiFaultInvalidVnic != null && this.VnicDevice == iscsiFaultInvalidVnic.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultInvalidVnic)\n        {\n            return Equals(iscsiFaultInvalidVnic as IscsiFaultInvalidVnic);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultPnicInUse : IscsiFault, IEquatable<IscsiFaultPnicInUse>\n    {\n        public string PnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultPnicInUse iscsiFaultPnicInUse)\n        {\n            return (iscsiFaultPnicInUse != null && this.PnicDevice == iscsiFaultPnicInUse.PnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultPnicInUse)\n        {\n            return Equals(iscsiFaultPnicInUse as IscsiFaultPnicInUse);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicAlreadyBound : IscsiFault, IEquatable<IscsiFaultVnicAlreadyBound>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicAlreadyBound iscsiFaultVnicAlreadyBound)\n        {\n            return (iscsiFaultVnicAlreadyBound != null && this.VnicDevice == iscsiFaultVnicAlreadyBound.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicAlreadyBound)\n        {\n            return Equals(iscsiFaultVnicAlreadyBound as IscsiFaultVnicAlreadyBound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicHasActivePaths : IscsiFault, IEquatable<IscsiFaultVnicHasActivePaths>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicHasActivePaths iscsiFaultVnicHasActivePaths)\n        {\n            return (iscsiFaultVnicHasActivePaths != null && this.VnicDevice == iscsiFaultVnicHasActivePaths.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicHasActivePaths)\n        {\n            return Equals(iscsiFaultVnicHasActivePaths as IscsiFaultVnicHasActivePaths);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicHasMultipleUplinks : IscsiFault, IEquatable<IscsiFaultVnicHasMultipleUplinks>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicHasMultipleUplinks iscsiFaultVnicHasMultipleUplinks)\n        {\n            return (iscsiFaultVnicHasMultipleUplinks != null && this.VnicDevice == iscsiFaultVnicHasMultipleUplinks.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicHasMultipleUplinks)\n        {\n            return Equals(iscsiFaultVnicHasMultipleUplinks as IscsiFaultVnicHasMultipleUplinks);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicHasNoUplinks : IscsiFault, IEquatable<IscsiFaultVnicHasNoUplinks>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicHasNoUplinks iscsiFaultVnicHasNoUplinks)\n        {\n            return (iscsiFaultVnicHasNoUplinks != null && this.VnicDevice == iscsiFaultVnicHasNoUplinks.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicHasNoUplinks)\n        {\n            return Equals(iscsiFaultVnicHasNoUplinks as IscsiFaultVnicHasNoUplinks);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicHasWrongUplink : IscsiFault, IEquatable<IscsiFaultVnicHasWrongUplink>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicHasWrongUplink iscsiFaultVnicHasWrongUplink)\n        {\n            return (iscsiFaultVnicHasWrongUplink != null && this.VnicDevice == iscsiFaultVnicHasWrongUplink.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicHasWrongUplink)\n        {\n            return Equals(iscsiFaultVnicHasWrongUplink as IscsiFaultVnicHasWrongUplink);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicInUse : IscsiFault, IEquatable<IscsiFaultVnicInUse>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicInUse iscsiFaultVnicInUse)\n        {\n            return (iscsiFaultVnicInUse != null && this.VnicDevice == iscsiFaultVnicInUse.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicInUse)\n        {\n            return Equals(iscsiFaultVnicInUse as IscsiFaultVnicInUse);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicIsLastPath : IscsiFault, IEquatable<IscsiFaultVnicIsLastPath>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicIsLastPath iscsiFaultVnicIsLastPath)\n        {\n            return (iscsiFaultVnicIsLastPath != null && this.VnicDevice == iscsiFaultVnicIsLastPath.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicIsLastPath)\n        {\n            return Equals(iscsiFaultVnicIsLastPath as IscsiFaultVnicIsLastPath);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicNotBound : IscsiFault, IEquatable<IscsiFaultVnicNotBound>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicNotBound iscsiFaultVnicNotBound)\n        {\n            return (iscsiFaultVnicNotBound != null && this.VnicDevice == iscsiFaultVnicNotBound.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicNotBound)\n        {\n            return Equals(iscsiFaultVnicNotBound as IscsiFaultVnicNotBound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiFaultVnicNotFound : IscsiFault, IEquatable<IscsiFaultVnicNotFound>\n    {\n        public string VnicDevice { get; set; }\n\n        public bool Equals(IscsiFaultVnicNotFound iscsiFaultVnicNotFound)\n        {\n            return (iscsiFaultVnicNotFound != null && this.VnicDevice == iscsiFaultVnicNotFound.VnicDevice);\n        }\n\n        public override bool Equals(object iscsiFaultVnicNotFound)\n        {\n            return Equals(iscsiFaultVnicNotFound as IscsiFaultVnicNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice).GetHashCode();\n        }\n    }\n\n    public class IscsiManager : ViewBase, IEquatable<IscsiManager>\n    {\n        public IscsiStatus QueryVnicStatus(string vnicDevice)\n        {\n            return default(IscsiStatus);\n        }\n\n        public IscsiStatus QueryPnicStatus(string pnicDevice)\n        {\n            return default(IscsiStatus);\n        }\n\n        public IscsiPortInfo[] QueryBoundVnics(string iScsiHbaName)\n        {\n            return default(IscsiPortInfo[]);\n        }\n\n        public IscsiPortInfo[] QueryCandidateNics(string iScsiHbaName)\n        {\n            return default(IscsiPortInfo[]);\n        }\n\n        public void BindVnic(string iScsiHbaName, string vnicDevice)\n        {\n        }\n\n        public void UnbindVnic(string iScsiHbaName, string vnicDevice, bool force)\n        {\n        }\n\n        public IscsiMigrationDependency QueryMigrationDependencies(string[] pnicDevice)\n        {\n            return default(IscsiMigrationDependency);\n        }\n\n        public bool Equals(IscsiManager iscsiManager)\n        {\n            return (iscsiManager != null && base.Equals(iscsiManager));\n        }\n\n        public override bool Equals(object iscsiManager)\n        {\n            return Equals(iscsiManager as IscsiManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IscsiMigrationDependency : DynamicData, IEquatable<IscsiMigrationDependency>\n    {\n        public bool MigrationAllowed { get; set; }\n\n        public IscsiStatus DisallowReason { get; set; }\n\n        public IscsiDependencyEntity[] Dependency { get; set; }\n\n        public bool Equals(IscsiMigrationDependency iscsiMigrationDependency)\n        {\n            return (iscsiMigrationDependency != null && this.MigrationAllowed == iscsiMigrationDependency.MigrationAllowed && ((this.DisallowReason == null && iscsiMigrationDependency.DisallowReason == null) || (this.DisallowReason != null && this.DisallowReason.Equals(iscsiMigrationDependency.DisallowReason))) && ((this.Dependency == null && iscsiMigrationDependency.Dependency == null) || (this.Dependency != null && iscsiMigrationDependency.Dependency != null && Enumerable.SequenceEqual(this.Dependency, iscsiMigrationDependency.Dependency))));\n        }\n\n        public override bool Equals(object iscsiMigrationDependency)\n        {\n            return Equals(iscsiMigrationDependency as IscsiMigrationDependency);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MigrationAllowed + \"_\" + DisallowReason + \"_\" + Dependency).GetHashCode();\n        }\n    }\n\n    public class IscsiPortInfo : DynamicData, IEquatable<IscsiPortInfo>\n    {\n        public string VnicDevice { get; set; }\n\n        public HostVirtualNic Vnic { get; set; }\n\n        public string PnicDevice { get; set; }\n\n        public PhysicalNic Pnic { get; set; }\n\n        public string SwitchName { get; set; }\n\n        public string SwitchUuid { get; set; }\n\n        public string PortgroupName { get; set; }\n\n        public string PortgroupKey { get; set; }\n\n        public string PortKey { get; set; }\n\n        public string OpaqueNetworkId { get; set; }\n\n        public string OpaqueNetworkType { get; set; }\n\n        public string OpaqueNetworkName { get; set; }\n\n        public string ExternalId { get; set; }\n\n        public IscsiStatus ComplianceStatus { get; set; }\n\n        public string PathStatus { get; set; }\n\n        public bool Equals(IscsiPortInfo iscsiPortInfo)\n        {\n            return (iscsiPortInfo != null && this.VnicDevice == iscsiPortInfo.VnicDevice && ((this.Vnic == null && iscsiPortInfo.Vnic == null) || (this.Vnic != null && this.Vnic.Equals(iscsiPortInfo.Vnic))) && this.PnicDevice == iscsiPortInfo.PnicDevice && ((this.Pnic == null && iscsiPortInfo.Pnic == null) || (this.Pnic != null && this.Pnic.Equals(iscsiPortInfo.Pnic))) && this.SwitchName == iscsiPortInfo.SwitchName && this.SwitchUuid == iscsiPortInfo.SwitchUuid && this.PortgroupName == iscsiPortInfo.PortgroupName && this.PortgroupKey == iscsiPortInfo.PortgroupKey && this.PortKey == iscsiPortInfo.PortKey && this.OpaqueNetworkId == iscsiPortInfo.OpaqueNetworkId && this.OpaqueNetworkType == iscsiPortInfo.OpaqueNetworkType && this.OpaqueNetworkName == iscsiPortInfo.OpaqueNetworkName && this.ExternalId == iscsiPortInfo.ExternalId && ((this.ComplianceStatus == null && iscsiPortInfo.ComplianceStatus == null) || (this.ComplianceStatus != null && this.ComplianceStatus.Equals(iscsiPortInfo.ComplianceStatus))) && this.PathStatus == iscsiPortInfo.PathStatus);\n        }\n\n        public override bool Equals(object iscsiPortInfo)\n        {\n            return Equals(iscsiPortInfo as IscsiPortInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VnicDevice + \"_\" + Vnic + \"_\" + PnicDevice + \"_\" + Pnic + \"_\" + SwitchName + \"_\" + SwitchUuid + \"_\" + PortgroupName + \"_\" + PortgroupKey + \"_\" + PortKey + \"_\" + OpaqueNetworkId + \"_\" + OpaqueNetworkType + \"_\" + OpaqueNetworkName + \"_\" + ExternalId + \"_\" + ComplianceStatus + \"_\" + PathStatus).GetHashCode();\n        }\n    }\n\n    public class IscsiStatus : DynamicData, IEquatable<IscsiStatus>\n    {\n        public LocalizedMethodFault[] Reason { get; set; }\n\n        public bool Equals(IscsiStatus iscsiStatus)\n        {\n            return (iscsiStatus != null && ((this.Reason == null && iscsiStatus.Reason == null) || (this.Reason != null && iscsiStatus.Reason != null && Enumerable.SequenceEqual(this.Reason, iscsiStatus.Reason))));\n        }\n\n        public override bool Equals(object iscsiStatus)\n        {\n            return Equals(iscsiStatus as IscsiStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class IsoImageFileInfo : FileInfo, IEquatable<IsoImageFileInfo>\n    {\n        public bool Equals(IsoImageFileInfo isoImageFileInfo)\n        {\n            return (isoImageFileInfo != null && base.Equals(isoImageFileInfo));\n        }\n\n        public override bool Equals(object isoImageFileInfo)\n        {\n            return Equals(isoImageFileInfo as IsoImageFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class IsoImageFileQuery : FileQuery, IEquatable<IsoImageFileQuery>\n    {\n        public bool Equals(IsoImageFileQuery isoImageFileQuery)\n        {\n            return (isoImageFileQuery != null && base.Equals(isoImageFileQuery));\n        }\n\n        public override bool Equals(object isoImageFileQuery)\n        {\n            return Equals(isoImageFileQuery as IsoImageFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class KernelModuleInfo : DynamicData, IEquatable<KernelModuleInfo>\n    {\n        public int Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Version { get; set; }\n\n        public string Filename { get; set; }\n\n        public string OptionString { get; set; }\n\n        public bool Loaded { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public int UseCount { get; set; }\n\n        public KernelModuleSectionInfo ReadOnlySection { get; set; }\n\n        public KernelModuleSectionInfo WritableSection { get; set; }\n\n        public KernelModuleSectionInfo TextSection { get; set; }\n\n        public KernelModuleSectionInfo DataSection { get; set; }\n\n        public KernelModuleSectionInfo BssSection { get; set; }\n\n        public bool Equals(KernelModuleInfo kernelModuleInfo)\n        {\n            return (kernelModuleInfo != null && this.Id == kernelModuleInfo.Id && this.Name == kernelModuleInfo.Name && this.Version == kernelModuleInfo.Version && this.Filename == kernelModuleInfo.Filename && this.OptionString == kernelModuleInfo.OptionString && this.Loaded == kernelModuleInfo.Loaded && this.Enabled == kernelModuleInfo.Enabled && this.UseCount == kernelModuleInfo.UseCount && ((this.ReadOnlySection == null && kernelModuleInfo.ReadOnlySection == null) || (this.ReadOnlySection != null && this.ReadOnlySection.Equals(kernelModuleInfo.ReadOnlySection))) && ((this.WritableSection == null && kernelModuleInfo.WritableSection == null) || (this.WritableSection != null && this.WritableSection.Equals(kernelModuleInfo.WritableSection))) && ((this.TextSection == null && kernelModuleInfo.TextSection == null) || (this.TextSection != null && this.TextSection.Equals(kernelModuleInfo.TextSection))) && ((this.DataSection == null && kernelModuleInfo.DataSection == null) || (this.DataSection != null && this.DataSection.Equals(kernelModuleInfo.DataSection))) && ((this.BssSection == null && kernelModuleInfo.BssSection == null) || (this.BssSection != null && this.BssSection.Equals(kernelModuleInfo.BssSection))));\n        }\n\n        public override bool Equals(object kernelModuleInfo)\n        {\n            return Equals(kernelModuleInfo as KernelModuleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + Version + \"_\" + Filename + \"_\" + OptionString + \"_\" + Loaded + \"_\" + Enabled + \"_\" + UseCount + \"_\" + ReadOnlySection + \"_\" + WritableSection + \"_\" + TextSection + \"_\" + DataSection + \"_\" + BssSection).GetHashCode();\n        }\n    }\n\n    public class KernelModuleSectionInfo : DynamicData, IEquatable<KernelModuleSectionInfo>\n    {\n        public long Address { get; set; }\n\n        public int? Length { get; set; }\n\n        public bool Equals(KernelModuleSectionInfo kernelModuleSectionInfo)\n        {\n            return (kernelModuleSectionInfo != null && this.Address == kernelModuleSectionInfo.Address && ((this.Length == null && kernelModuleSectionInfo.Length == null) || (this.Length != null && this.Length.Equals(kernelModuleSectionInfo.Length))));\n        }\n\n        public override bool Equals(object kernelModuleSectionInfo)\n        {\n            return Equals(kernelModuleSectionInfo as KernelModuleSectionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address + \"_\" + Length).GetHashCode();\n        }\n    }\n\n    public class KeyAnyValue : DynamicData, IEquatable<KeyAnyValue>\n    {\n        public string Key { get; set; }\n\n        public object Value { get; set; }\n\n        public bool Equals(KeyAnyValue keyAnyValue)\n        {\n            return (keyAnyValue != null && this.Key == keyAnyValue.Key && ((this.Value == null && keyAnyValue.Value == null) || (this.Value != null && this.Value.Equals(keyAnyValue.Value))));\n        }\n\n        public override bool Equals(object keyAnyValue)\n        {\n            return Equals(keyAnyValue as KeyAnyValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class KeyProviderId : DynamicData, IEquatable<KeyProviderId>\n    {\n        public string Id { get; set; }\n\n        public bool Equals(KeyProviderId keyProviderId)\n        {\n            return (keyProviderId != null && this.Id == keyProviderId.Id);\n        }\n\n        public override bool Equals(object keyProviderId)\n        {\n            return Equals(keyProviderId as KeyProviderId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id).GetHashCode();\n        }\n    }\n\n    public class KeyValue : DynamicData, IEquatable<KeyValue>\n    {\n        public string Key { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(KeyValue keyValue)\n        {\n            return (keyValue != null && this.Key == keyValue.Key && this.Value == keyValue.Value);\n        }\n\n        public override bool Equals(object keyValue)\n        {\n            return Equals(keyValue as KeyValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class KmipClusterInfo : DynamicData, IEquatable<KmipClusterInfo>\n    {\n        public KeyProviderId ClusterId { get; set; }\n\n        public KmipServerInfo[] Servers { get; set; }\n\n        public bool UseAsDefault { get; set; }\n\n        public bool Equals(KmipClusterInfo kmipClusterInfo)\n        {\n            return (kmipClusterInfo != null && ((this.ClusterId == null && kmipClusterInfo.ClusterId == null) || (this.ClusterId != null && this.ClusterId.Equals(kmipClusterInfo.ClusterId))) && ((this.Servers == null && kmipClusterInfo.Servers == null) || (this.Servers != null && kmipClusterInfo.Servers != null && Enumerable.SequenceEqual(this.Servers, kmipClusterInfo.Servers))) && this.UseAsDefault == kmipClusterInfo.UseAsDefault);\n        }\n\n        public override bool Equals(object kmipClusterInfo)\n        {\n            return Equals(kmipClusterInfo as KmipClusterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterId + \"_\" + Servers + \"_\" + UseAsDefault).GetHashCode();\n        }\n    }\n\n    public class KmipServerInfo : DynamicData, IEquatable<KmipServerInfo>\n    {\n        public string Name { get; set; }\n\n        public string Address { get; set; }\n\n        public int Port { get; set; }\n\n        public string ProxyAddress { get; set; }\n\n        public int? ProxyPort { get; set; }\n\n        public int? Reconnect { get; set; }\n\n        public string Protocol { get; set; }\n\n        public int? Nbio { get; set; }\n\n        public int? Timeout { get; set; }\n\n        public string UserName { get; set; }\n\n        public bool Equals(KmipServerInfo kmipServerInfo)\n        {\n            return (kmipServerInfo != null && this.Name == kmipServerInfo.Name && this.Address == kmipServerInfo.Address && this.Port == kmipServerInfo.Port && this.ProxyAddress == kmipServerInfo.ProxyAddress && ((this.ProxyPort == null && kmipServerInfo.ProxyPort == null) || (this.ProxyPort != null && this.ProxyPort.Equals(kmipServerInfo.ProxyPort))) && ((this.Reconnect == null && kmipServerInfo.Reconnect == null) || (this.Reconnect != null && this.Reconnect.Equals(kmipServerInfo.Reconnect))) && this.Protocol == kmipServerInfo.Protocol && ((this.Nbio == null && kmipServerInfo.Nbio == null) || (this.Nbio != null && this.Nbio.Equals(kmipServerInfo.Nbio))) && ((this.Timeout == null && kmipServerInfo.Timeout == null) || (this.Timeout != null && this.Timeout.Equals(kmipServerInfo.Timeout))) && this.UserName == kmipServerInfo.UserName);\n        }\n\n        public override bool Equals(object kmipServerInfo)\n        {\n            return Equals(kmipServerInfo as KmipServerInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Address + \"_\" + Port + \"_\" + ProxyAddress + \"_\" + ProxyPort + \"_\" + Reconnect + \"_\" + Protocol + \"_\" + Nbio + \"_\" + Timeout + \"_\" + UserName).GetHashCode();\n        }\n    }\n\n    public class KmipServerSpec : DynamicData, IEquatable<KmipServerSpec>\n    {\n        public KeyProviderId ClusterId { get; set; }\n\n        public KmipServerInfo Info { get; set; }\n\n        public string Password { get; set; }\n\n        public bool Equals(KmipServerSpec kmipServerSpec)\n        {\n            return (kmipServerSpec != null && ((this.ClusterId == null && kmipServerSpec.ClusterId == null) || (this.ClusterId != null && this.ClusterId.Equals(kmipServerSpec.ClusterId))) && ((this.Info == null && kmipServerSpec.Info == null) || (this.Info != null && this.Info.Equals(kmipServerSpec.Info))) && this.Password == kmipServerSpec.Password);\n        }\n\n        public override bool Equals(object kmipServerSpec)\n        {\n            return Equals(kmipServerSpec as KmipServerSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterId + \"_\" + Info + \"_\" + Password).GetHashCode();\n        }\n    }\n\n    public class KmipServerStatus : DynamicData, IEquatable<KmipServerStatus>\n    {\n        public KeyProviderId ClusterId { get; set; }\n\n        public string Name { get; set; }\n\n        public ManagedEntityStatus Status { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(KmipServerStatus kmipServerStatus)\n        {\n            return (kmipServerStatus != null && ((this.ClusterId == null && kmipServerStatus.ClusterId == null) || (this.ClusterId != null && this.ClusterId.Equals(kmipServerStatus.ClusterId))) && this.Name == kmipServerStatus.Name && this.Status == kmipServerStatus.Status && this.Description == kmipServerStatus.Description);\n        }\n\n        public override bool Equals(object kmipServerStatus)\n        {\n            return Equals(kmipServerStatus as KmipServerStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterId + \"_\" + Name + \"_\" + Status + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class LargeRDMConversionNotSupported : MigrationFault, IEquatable<LargeRDMConversionNotSupported>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(LargeRDMConversionNotSupported largeRDMConversionNotSupported)\n        {\n            return (largeRDMConversionNotSupported != null && this.Device == largeRDMConversionNotSupported.Device);\n        }\n\n        public override bool Equals(object largeRDMConversionNotSupported)\n        {\n            return Equals(largeRDMConversionNotSupported as LargeRDMConversionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class LargeRDMNotSupportedOnDatastore : VmConfigFault, IEquatable<LargeRDMNotSupportedOnDatastore>\n    {\n        public string Device { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string DatastoreName { get; set; }\n\n        public LargeRDMNotSupportedOnDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(LargeRDMNotSupportedOnDatastore largeRDMNotSupportedOnDatastore)\n        {\n            return (largeRDMNotSupportedOnDatastore != null && this.Device == largeRDMNotSupportedOnDatastore.Device && ((this.Datastore == null && largeRDMNotSupportedOnDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(largeRDMNotSupportedOnDatastore.Datastore))) && this.DatastoreName == largeRDMNotSupportedOnDatastore.DatastoreName && ((this.LinkedView == null && largeRDMNotSupportedOnDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(largeRDMNotSupportedOnDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object largeRDMNotSupportedOnDatastore)\n        {\n            return Equals(largeRDMNotSupportedOnDatastore as LargeRDMNotSupportedOnDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Datastore + \"_\" + DatastoreName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class LargeRDMNotSupportedOnDatastore_LinkedView : IEquatable<LargeRDMNotSupportedOnDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(LargeRDMNotSupportedOnDatastore_LinkedView largeRDMNotSupportedOnDatastore_LinkedView)\n        {\n            return (largeRDMNotSupportedOnDatastore_LinkedView != null && ((this.Datastore == null && largeRDMNotSupportedOnDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(largeRDMNotSupportedOnDatastore_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object largeRDMNotSupportedOnDatastore_LinkedView)\n        {\n            return Equals(largeRDMNotSupportedOnDatastore_LinkedView as LargeRDMNotSupportedOnDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class LatencySensitivity : DynamicData, IEquatable<LatencySensitivity>\n    {\n        public LatencySensitivitySensitivityLevel Level { get; set; }\n\n        public int? Sensitivity { get; set; }\n\n        public bool Equals(LatencySensitivity latencySensitivity)\n        {\n            return (latencySensitivity != null && this.Level == latencySensitivity.Level && ((this.Sensitivity == null && latencySensitivity.Sensitivity == null) || (this.Sensitivity != null && this.Sensitivity.Equals(latencySensitivity.Sensitivity))));\n        }\n\n        public override bool Equals(object latencySensitivity)\n        {\n            return Equals(latencySensitivity as LatencySensitivity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Level + \"_\" + Sensitivity).GetHashCode();\n        }\n    }\n\n    public class LegacyNetworkInterfaceInUse : CannotAccessNetwork, IEquatable<LegacyNetworkInterfaceInUse>\n    {\n        public new LegacyNetworkInterfaceInUse_LinkedView LinkedView { get; set; }\n\n        public bool Equals(LegacyNetworkInterfaceInUse legacyNetworkInterfaceInUse)\n        {\n            return (legacyNetworkInterfaceInUse != null && ((this.LinkedView == null && legacyNetworkInterfaceInUse.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(legacyNetworkInterfaceInUse.LinkedView))));\n        }\n\n        public override bool Equals(object legacyNetworkInterfaceInUse)\n        {\n            return Equals(legacyNetworkInterfaceInUse as LegacyNetworkInterfaceInUse);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class LegacyNetworkInterfaceInUse_LinkedView : CannotAccessNetwork_LinkedView, IEquatable<LegacyNetworkInterfaceInUse_LinkedView>\n    {\n        public bool Equals(LegacyNetworkInterfaceInUse_LinkedView legacyNetworkInterfaceInUse_LinkedView)\n        {\n            return (legacyNetworkInterfaceInUse_LinkedView != null && base.Equals(legacyNetworkInterfaceInUse_LinkedView));\n        }\n\n        public override bool Equals(object legacyNetworkInterfaceInUse_LinkedView)\n        {\n            return Equals(legacyNetworkInterfaceInUse_LinkedView as LegacyNetworkInterfaceInUse_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseAssignmentFailed : RuntimeFault, IEquatable<LicenseAssignmentFailed>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(LicenseAssignmentFailed licenseAssignmentFailed)\n        {\n            return (licenseAssignmentFailed != null && this.Reason == licenseAssignmentFailed.Reason);\n        }\n\n        public override bool Equals(object licenseAssignmentFailed)\n        {\n            return Equals(licenseAssignmentFailed as LicenseAssignmentFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class LicenseAssignmentManager : ViewBase, IEquatable<LicenseAssignmentManager>\n    {\n        public LicenseManagerLicenseInfo UpdateAssignedLicense(string entity, string licenseKey, string entityDisplayName)\n        {\n            return default(LicenseManagerLicenseInfo);\n        }\n\n        public void RemoveAssignedLicense(string entityId)\n        {\n        }\n\n        public LicenseAssignmentManagerLicenseAssignment[] QueryAssignedLicenses(string entityId)\n        {\n            return default(LicenseAssignmentManagerLicenseAssignment[]);\n        }\n\n        public bool Equals(LicenseAssignmentManager licenseAssignmentManager)\n        {\n            return (licenseAssignmentManager != null && base.Equals(licenseAssignmentManager));\n        }\n\n        public override bool Equals(object licenseAssignmentManager)\n        {\n            return Equals(licenseAssignmentManager as LicenseAssignmentManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseAssignmentManagerLicenseAssignment : DynamicData, IEquatable<LicenseAssignmentManagerLicenseAssignment>\n    {\n        public string EntityId { get; set; }\n\n        public string Scope { get; set; }\n\n        public string EntityDisplayName { get; set; }\n\n        public LicenseManagerLicenseInfo AssignedLicense { get; set; }\n\n        public KeyAnyValue[] Properties { get; set; }\n\n        public bool Equals(LicenseAssignmentManagerLicenseAssignment licenseAssignmentManagerLicenseAssignment)\n        {\n            return (licenseAssignmentManagerLicenseAssignment != null && this.EntityId == licenseAssignmentManagerLicenseAssignment.EntityId && this.Scope == licenseAssignmentManagerLicenseAssignment.Scope && this.EntityDisplayName == licenseAssignmentManagerLicenseAssignment.EntityDisplayName && ((this.AssignedLicense == null && licenseAssignmentManagerLicenseAssignment.AssignedLicense == null) || (this.AssignedLicense != null && this.AssignedLicense.Equals(licenseAssignmentManagerLicenseAssignment.AssignedLicense))) && ((this.Properties == null && licenseAssignmentManagerLicenseAssignment.Properties == null) || (this.Properties != null && licenseAssignmentManagerLicenseAssignment.Properties != null && Enumerable.SequenceEqual(this.Properties, licenseAssignmentManagerLicenseAssignment.Properties))));\n        }\n\n        public override bool Equals(object licenseAssignmentManagerLicenseAssignment)\n        {\n            return Equals(licenseAssignmentManagerLicenseAssignment as LicenseAssignmentManagerLicenseAssignment);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityId + \"_\" + Scope + \"_\" + EntityDisplayName + \"_\" + AssignedLicense + \"_\" + Properties).GetHashCode();\n        }\n    }\n\n    public class LicenseAvailabilityInfo : DynamicData, IEquatable<LicenseAvailabilityInfo>\n    {\n        public LicenseFeatureInfo Feature { get; set; }\n\n        public int Total { get; set; }\n\n        public int Available { get; set; }\n\n        public bool Equals(LicenseAvailabilityInfo licenseAvailabilityInfo)\n        {\n            return (licenseAvailabilityInfo != null && ((this.Feature == null && licenseAvailabilityInfo.Feature == null) || (this.Feature != null && this.Feature.Equals(licenseAvailabilityInfo.Feature))) && this.Total == licenseAvailabilityInfo.Total && this.Available == licenseAvailabilityInfo.Available);\n        }\n\n        public override bool Equals(object licenseAvailabilityInfo)\n        {\n            return Equals(licenseAvailabilityInfo as LicenseAvailabilityInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Feature + \"_\" + Total + \"_\" + Available).GetHashCode();\n        }\n    }\n\n    public class LicenseDiagnostics : DynamicData, IEquatable<LicenseDiagnostics>\n    {\n        public DateTime SourceLastChanged { get; set; }\n\n        public string SourceLost { get; set; }\n\n        public float SourceLatency { get; set; }\n\n        public string LicenseRequests { get; set; }\n\n        public string LicenseRequestFailures { get; set; }\n\n        public string LicenseFeatureUnknowns { get; set; }\n\n        public LicenseManagerState OpState { get; set; }\n\n        public DateTime LastStatusUpdate { get; set; }\n\n        public string OpFailureMessage { get; set; }\n\n        public bool Equals(LicenseDiagnostics licenseDiagnostics)\n        {\n            return (licenseDiagnostics != null && this.SourceLastChanged == licenseDiagnostics.SourceLastChanged && this.SourceLost == licenseDiagnostics.SourceLost && this.SourceLatency == licenseDiagnostics.SourceLatency && this.LicenseRequests == licenseDiagnostics.LicenseRequests && this.LicenseRequestFailures == licenseDiagnostics.LicenseRequestFailures && this.LicenseFeatureUnknowns == licenseDiagnostics.LicenseFeatureUnknowns && this.OpState == licenseDiagnostics.OpState && this.LastStatusUpdate == licenseDiagnostics.LastStatusUpdate && this.OpFailureMessage == licenseDiagnostics.OpFailureMessage);\n        }\n\n        public override bool Equals(object licenseDiagnostics)\n        {\n            return Equals(licenseDiagnostics as LicenseDiagnostics);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceLastChanged + \"_\" + SourceLost + \"_\" + SourceLatency + \"_\" + LicenseRequests + \"_\" + LicenseRequestFailures + \"_\" + LicenseFeatureUnknowns + \"_\" + OpState + \"_\" + LastStatusUpdate + \"_\" + OpFailureMessage).GetHashCode();\n        }\n    }\n\n    public class LicenseDowngradeDisallowed : NotEnoughLicenses, IEquatable<LicenseDowngradeDisallowed>\n    {\n        public string Edition { get; set; }\n\n        public string EntityId { get; set; }\n\n        public KeyAnyValue[] Features { get; set; }\n\n        public bool Equals(LicenseDowngradeDisallowed licenseDowngradeDisallowed)\n        {\n            return (licenseDowngradeDisallowed != null && this.Edition == licenseDowngradeDisallowed.Edition && this.EntityId == licenseDowngradeDisallowed.EntityId && ((this.Features == null && licenseDowngradeDisallowed.Features == null) || (this.Features != null && licenseDowngradeDisallowed.Features != null && Enumerable.SequenceEqual(this.Features, licenseDowngradeDisallowed.Features))));\n        }\n\n        public override bool Equals(object licenseDowngradeDisallowed)\n        {\n            return Equals(licenseDowngradeDisallowed as LicenseDowngradeDisallowed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Edition + \"_\" + EntityId + \"_\" + Features).GetHashCode();\n        }\n    }\n\n    public class LicenseEntityNotFound : VimFault, IEquatable<LicenseEntityNotFound>\n    {\n        public string EntityId { get; set; }\n\n        public bool Equals(LicenseEntityNotFound licenseEntityNotFound)\n        {\n            return (licenseEntityNotFound != null && this.EntityId == licenseEntityNotFound.EntityId);\n        }\n\n        public override bool Equals(object licenseEntityNotFound)\n        {\n            return Equals(licenseEntityNotFound as LicenseEntityNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityId).GetHashCode();\n        }\n    }\n\n    public class LicenseEvent : Event, IEquatable<LicenseEvent>\n    {\n        public bool Equals(LicenseEvent licenseEvent)\n        {\n            return (licenseEvent != null && base.Equals(licenseEvent));\n        }\n\n        public override bool Equals(object licenseEvent)\n        {\n            return Equals(licenseEvent as LicenseEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseExpired : NotEnoughLicenses, IEquatable<LicenseExpired>\n    {\n        public string LicenseKey { get; set; }\n\n        public bool Equals(LicenseExpired licenseExpired)\n        {\n            return (licenseExpired != null && this.LicenseKey == licenseExpired.LicenseKey);\n        }\n\n        public override bool Equals(object licenseExpired)\n        {\n            return Equals(licenseExpired as LicenseExpired);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseKey).GetHashCode();\n        }\n    }\n\n    public class LicenseExpiredEvent : Event, IEquatable<LicenseExpiredEvent>\n    {\n        public LicenseFeatureInfo Feature { get; set; }\n\n        public bool Equals(LicenseExpiredEvent licenseExpiredEvent)\n        {\n            return (licenseExpiredEvent != null && ((this.Feature == null && licenseExpiredEvent.Feature == null) || (this.Feature != null && this.Feature.Equals(licenseExpiredEvent.Feature))));\n        }\n\n        public override bool Equals(object licenseExpiredEvent)\n        {\n            return Equals(licenseExpiredEvent as LicenseExpiredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Feature).GetHashCode();\n        }\n    }\n\n    public class LicenseFeatureInfo : DynamicData, IEquatable<LicenseFeatureInfo>\n    {\n        public string Key { get; set; }\n\n        public string FeatureName { get; set; }\n\n        public string FeatureDescription { get; set; }\n\n        public LicenseFeatureInfoState? State { get; set; }\n\n        public string CostUnit { get; set; }\n\n        public string SourceRestriction { get; set; }\n\n        public string[] DependentKey { get; set; }\n\n        public bool? Edition { get; set; }\n\n        public DateTime? ExpiresOn { get; set; }\n\n        public bool Equals(LicenseFeatureInfo licenseFeatureInfo)\n        {\n            return (licenseFeatureInfo != null && this.Key == licenseFeatureInfo.Key && this.FeatureName == licenseFeatureInfo.FeatureName && this.FeatureDescription == licenseFeatureInfo.FeatureDescription && ((this.State == null && licenseFeatureInfo.State == null) || (this.State != null && this.State.Equals(licenseFeatureInfo.State))) && this.CostUnit == licenseFeatureInfo.CostUnit && this.SourceRestriction == licenseFeatureInfo.SourceRestriction && ((this.DependentKey == null && licenseFeatureInfo.DependentKey == null) || (this.DependentKey != null && licenseFeatureInfo.DependentKey != null && Enumerable.SequenceEqual(this.DependentKey, licenseFeatureInfo.DependentKey))) && ((this.Edition == null && licenseFeatureInfo.Edition == null) || (this.Edition != null && this.Edition.Equals(licenseFeatureInfo.Edition))) && ((this.ExpiresOn == null && licenseFeatureInfo.ExpiresOn == null) || (this.ExpiresOn != null && this.ExpiresOn.Equals(licenseFeatureInfo.ExpiresOn))));\n        }\n\n        public override bool Equals(object licenseFeatureInfo)\n        {\n            return Equals(licenseFeatureInfo as LicenseFeatureInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + FeatureName + \"_\" + FeatureDescription + \"_\" + State + \"_\" + CostUnit + \"_\" + SourceRestriction + \"_\" + DependentKey + \"_\" + Edition + \"_\" + ExpiresOn).GetHashCode();\n        }\n    }\n\n    public class LicenseKeyEntityMismatch : NotEnoughLicenses, IEquatable<LicenseKeyEntityMismatch>\n    {\n        public bool Equals(LicenseKeyEntityMismatch licenseKeyEntityMismatch)\n        {\n            return (licenseKeyEntityMismatch != null && base.Equals(licenseKeyEntityMismatch));\n        }\n\n        public override bool Equals(object licenseKeyEntityMismatch)\n        {\n            return Equals(licenseKeyEntityMismatch as LicenseKeyEntityMismatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseManager : ViewBase, IEquatable<LicenseManager>\n    {\n        public LicenseSource Source { get; set; }\n\n        public bool SourceAvailable { get; set; }\n\n        public LicenseDiagnostics Diagnostics { get; set; }\n\n        public LicenseFeatureInfo[] FeatureInfo { get; set; }\n\n        public string LicensedEdition { get; set; }\n\n        public LicenseManagerLicenseInfo[] Licenses { get; set; }\n\n        public ManagedObjectReference LicenseAssignmentManager { get; set; }\n\n        public LicenseManagerEvaluationInfo Evaluation { get; set; }\n\n        public LicenseManager_LinkedView LinkedView { get; set; }\n\n        public LicenseFeatureInfo[] QuerySupportedFeatures(ManagedObjectReference host)\n        {\n            return default(LicenseFeatureInfo[]);\n        }\n\n        public LicenseAvailabilityInfo[] QueryLicenseSourceAvailability(ManagedObjectReference host)\n        {\n            return default(LicenseAvailabilityInfo[]);\n        }\n\n        public LicenseUsageInfo QueryLicenseUsage(ManagedObjectReference host)\n        {\n            return default(LicenseUsageInfo);\n        }\n\n        public void SetLicenseEdition(ManagedObjectReference host, string featureKey)\n        {\n        }\n\n        public bool CheckLicenseFeature(ManagedObjectReference host, string featureKey)\n        {\n            return default(bool);\n        }\n\n        public bool EnableFeature(ManagedObjectReference host, string featureKey)\n        {\n            return default(bool);\n        }\n\n        public bool DisableFeature(ManagedObjectReference host, string featureKey)\n        {\n            return default(bool);\n        }\n\n        public void ConfigureLicenseSource(ManagedObjectReference host, LicenseSource licenseSource)\n        {\n        }\n\n        public LicenseManagerLicenseInfo UpdateLicense(string licenseKey, KeyValue[] labels)\n        {\n            return default(LicenseManagerLicenseInfo);\n        }\n\n        public LicenseManagerLicenseInfo AddLicense(string licenseKey, KeyValue[] labels)\n        {\n            return default(LicenseManagerLicenseInfo);\n        }\n\n        public void RemoveLicense(string licenseKey)\n        {\n        }\n\n        public LicenseManagerLicenseInfo DecodeLicense(string licenseKey)\n        {\n            return default(LicenseManagerLicenseInfo);\n        }\n\n        public void UpdateLicenseLabel(string licenseKey, string labelKey, string labelValue)\n        {\n        }\n\n        public void RemoveLicenseLabel(string licenseKey, string labelKey)\n        {\n        }\n\n        public bool Equals(LicenseManager licenseManager)\n        {\n            return (licenseManager != null && ((this.Source == null && licenseManager.Source == null) || (this.Source != null && this.Source.Equals(licenseManager.Source))) && this.SourceAvailable == licenseManager.SourceAvailable && ((this.Diagnostics == null && licenseManager.Diagnostics == null) || (this.Diagnostics != null && this.Diagnostics.Equals(licenseManager.Diagnostics))) && ((this.FeatureInfo == null && licenseManager.FeatureInfo == null) || (this.FeatureInfo != null && licenseManager.FeatureInfo != null && Enumerable.SequenceEqual(this.FeatureInfo, licenseManager.FeatureInfo))) && this.LicensedEdition == licenseManager.LicensedEdition && ((this.Licenses == null && licenseManager.Licenses == null) || (this.Licenses != null && licenseManager.Licenses != null && Enumerable.SequenceEqual(this.Licenses, licenseManager.Licenses))) && ((this.LicenseAssignmentManager == null && licenseManager.LicenseAssignmentManager == null) || (this.LicenseAssignmentManager != null && this.LicenseAssignmentManager.Equals(licenseManager.LicenseAssignmentManager))) && ((this.Evaluation == null && licenseManager.Evaluation == null) || (this.Evaluation != null && this.Evaluation.Equals(licenseManager.Evaluation))) && ((this.LinkedView == null && licenseManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(licenseManager.LinkedView))));\n        }\n\n        public override bool Equals(object licenseManager)\n        {\n            return Equals(licenseManager as LicenseManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + SourceAvailable + \"_\" + Diagnostics + \"_\" + FeatureInfo + \"_\" + LicensedEdition + \"_\" + Licenses + \"_\" + LicenseAssignmentManager + \"_\" + Evaluation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class LicenseManager_LinkedView : IEquatable<LicenseManager_LinkedView>\n    {\n        public LicenseAssignmentManager LicenseAssignmentManager { get; set; }\n\n        public bool Equals(LicenseManager_LinkedView licenseManager_LinkedView)\n        {\n            return (licenseManager_LinkedView != null && ((this.LicenseAssignmentManager == null && licenseManager_LinkedView.LicenseAssignmentManager == null) || (this.LicenseAssignmentManager != null && this.LicenseAssignmentManager.Equals(licenseManager_LinkedView.LicenseAssignmentManager))));\n        }\n\n        public override bool Equals(object licenseManager_LinkedView)\n        {\n            return Equals(licenseManager_LinkedView as LicenseManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseAssignmentManager).GetHashCode();\n        }\n    }\n\n    public class LicenseManagerEvaluationInfo : DynamicData, IEquatable<LicenseManagerEvaluationInfo>\n    {\n        public KeyAnyValue[] Properties { get; set; }\n\n        public bool Equals(LicenseManagerEvaluationInfo licenseManagerEvaluationInfo)\n        {\n            return (licenseManagerEvaluationInfo != null && ((this.Properties == null && licenseManagerEvaluationInfo.Properties == null) || (this.Properties != null && licenseManagerEvaluationInfo.Properties != null && Enumerable.SequenceEqual(this.Properties, licenseManagerEvaluationInfo.Properties))));\n        }\n\n        public override bool Equals(object licenseManagerEvaluationInfo)\n        {\n            return Equals(licenseManagerEvaluationInfo as LicenseManagerEvaluationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Properties).GetHashCode();\n        }\n    }\n\n    public class LicenseManagerLicenseInfo : DynamicData, IEquatable<LicenseManagerLicenseInfo>\n    {\n        public string LicenseKey { get; set; }\n\n        public string EditionKey { get; set; }\n\n        public string Name { get; set; }\n\n        public int Total { get; set; }\n\n        public int? Used { get; set; }\n\n        public string CostUnit { get; set; }\n\n        public KeyAnyValue[] Properties { get; set; }\n\n        public KeyValue[] Labels { get; set; }\n\n        public bool Equals(LicenseManagerLicenseInfo licenseManagerLicenseInfo)\n        {\n            return (licenseManagerLicenseInfo != null && this.LicenseKey == licenseManagerLicenseInfo.LicenseKey && this.EditionKey == licenseManagerLicenseInfo.EditionKey && this.Name == licenseManagerLicenseInfo.Name && this.Total == licenseManagerLicenseInfo.Total && ((this.Used == null && licenseManagerLicenseInfo.Used == null) || (this.Used != null && this.Used.Equals(licenseManagerLicenseInfo.Used))) && this.CostUnit == licenseManagerLicenseInfo.CostUnit && ((this.Properties == null && licenseManagerLicenseInfo.Properties == null) || (this.Properties != null && licenseManagerLicenseInfo.Properties != null && Enumerable.SequenceEqual(this.Properties, licenseManagerLicenseInfo.Properties))) && ((this.Labels == null && licenseManagerLicenseInfo.Labels == null) || (this.Labels != null && licenseManagerLicenseInfo.Labels != null && Enumerable.SequenceEqual(this.Labels, licenseManagerLicenseInfo.Labels))));\n        }\n\n        public override bool Equals(object licenseManagerLicenseInfo)\n        {\n            return Equals(licenseManagerLicenseInfo as LicenseManagerLicenseInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseKey + \"_\" + EditionKey + \"_\" + Name + \"_\" + Total + \"_\" + Used + \"_\" + CostUnit + \"_\" + Properties + \"_\" + Labels).GetHashCode();\n        }\n    }\n\n    public class LicenseNonComplianceEvent : LicenseEvent, IEquatable<LicenseNonComplianceEvent>\n    {\n        public string Url { get; set; }\n\n        public bool Equals(LicenseNonComplianceEvent licenseNonComplianceEvent)\n        {\n            return (licenseNonComplianceEvent != null && this.Url == licenseNonComplianceEvent.Url);\n        }\n\n        public override bool Equals(object licenseNonComplianceEvent)\n        {\n            return Equals(licenseNonComplianceEvent as LicenseNonComplianceEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Url).GetHashCode();\n        }\n    }\n\n    public class LicenseReservationInfo : DynamicData, IEquatable<LicenseReservationInfo>\n    {\n        public string Key { get; set; }\n\n        public LicenseReservationInfoState State { get; set; }\n\n        public int Required { get; set; }\n\n        public bool Equals(LicenseReservationInfo licenseReservationInfo)\n        {\n            return (licenseReservationInfo != null && this.Key == licenseReservationInfo.Key && this.State == licenseReservationInfo.State && this.Required == licenseReservationInfo.Required);\n        }\n\n        public override bool Equals(object licenseReservationInfo)\n        {\n            return Equals(licenseReservationInfo as LicenseReservationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + State + \"_\" + Required).GetHashCode();\n        }\n    }\n\n    public class LicenseRestricted : NotEnoughLicenses, IEquatable<LicenseRestricted>\n    {\n        public bool Equals(LicenseRestricted licenseRestricted)\n        {\n            return (licenseRestricted != null && base.Equals(licenseRestricted));\n        }\n\n        public override bool Equals(object licenseRestricted)\n        {\n            return Equals(licenseRestricted as LicenseRestricted);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseRestrictedEvent : LicenseEvent, IEquatable<LicenseRestrictedEvent>\n    {\n        public bool Equals(LicenseRestrictedEvent licenseRestrictedEvent)\n        {\n            return (licenseRestrictedEvent != null && base.Equals(licenseRestrictedEvent));\n        }\n\n        public override bool Equals(object licenseRestrictedEvent)\n        {\n            return Equals(licenseRestrictedEvent as LicenseRestrictedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseServerAvailableEvent : LicenseEvent, IEquatable<LicenseServerAvailableEvent>\n    {\n        public string LicenseServer { get; set; }\n\n        public bool Equals(LicenseServerAvailableEvent licenseServerAvailableEvent)\n        {\n            return (licenseServerAvailableEvent != null && this.LicenseServer == licenseServerAvailableEvent.LicenseServer);\n        }\n\n        public override bool Equals(object licenseServerAvailableEvent)\n        {\n            return Equals(licenseServerAvailableEvent as LicenseServerAvailableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseServer).GetHashCode();\n        }\n    }\n\n    public class LicenseServerSource : LicenseSource, IEquatable<LicenseServerSource>\n    {\n        public string LicenseServer { get; set; }\n\n        public bool Equals(LicenseServerSource licenseServerSource)\n        {\n            return (licenseServerSource != null && this.LicenseServer == licenseServerSource.LicenseServer);\n        }\n\n        public override bool Equals(object licenseServerSource)\n        {\n            return Equals(licenseServerSource as LicenseServerSource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseServer).GetHashCode();\n        }\n    }\n\n    public class LicenseServerUnavailable : VimFault, IEquatable<LicenseServerUnavailable>\n    {\n        public string LicenseServer { get; set; }\n\n        public bool Equals(LicenseServerUnavailable licenseServerUnavailable)\n        {\n            return (licenseServerUnavailable != null && this.LicenseServer == licenseServerUnavailable.LicenseServer);\n        }\n\n        public override bool Equals(object licenseServerUnavailable)\n        {\n            return Equals(licenseServerUnavailable as LicenseServerUnavailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseServer).GetHashCode();\n        }\n    }\n\n    public class LicenseServerUnavailableEvent : LicenseEvent, IEquatable<LicenseServerUnavailableEvent>\n    {\n        public string LicenseServer { get; set; }\n\n        public bool Equals(LicenseServerUnavailableEvent licenseServerUnavailableEvent)\n        {\n            return (licenseServerUnavailableEvent != null && this.LicenseServer == licenseServerUnavailableEvent.LicenseServer);\n        }\n\n        public override bool Equals(object licenseServerUnavailableEvent)\n        {\n            return Equals(licenseServerUnavailableEvent as LicenseServerUnavailableEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseServer).GetHashCode();\n        }\n    }\n\n    public class LicenseSource : DynamicData, IEquatable<LicenseSource>\n    {\n        public bool Equals(LicenseSource licenseSource)\n        {\n            return (licenseSource != null && base.Equals(licenseSource));\n        }\n\n        public override bool Equals(object licenseSource)\n        {\n            return Equals(licenseSource as LicenseSource);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LicenseSourceUnavailable : NotEnoughLicenses, IEquatable<LicenseSourceUnavailable>\n    {\n        public LicenseSource LicenseSource { get; set; }\n\n        public bool Equals(LicenseSourceUnavailable licenseSourceUnavailable)\n        {\n            return (licenseSourceUnavailable != null && ((this.LicenseSource == null && licenseSourceUnavailable.LicenseSource == null) || (this.LicenseSource != null && this.LicenseSource.Equals(licenseSourceUnavailable.LicenseSource))));\n        }\n\n        public override bool Equals(object licenseSourceUnavailable)\n        {\n            return Equals(licenseSourceUnavailable as LicenseSourceUnavailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseSource).GetHashCode();\n        }\n    }\n\n    public class LicenseUsageInfo : DynamicData, IEquatable<LicenseUsageInfo>\n    {\n        public LicenseSource Source { get; set; }\n\n        public bool SourceAvailable { get; set; }\n\n        public LicenseReservationInfo[] ReservationInfo { get; set; }\n\n        public LicenseFeatureInfo[] FeatureInfo { get; set; }\n\n        public bool Equals(LicenseUsageInfo licenseUsageInfo)\n        {\n            return (licenseUsageInfo != null && ((this.Source == null && licenseUsageInfo.Source == null) || (this.Source != null && this.Source.Equals(licenseUsageInfo.Source))) && this.SourceAvailable == licenseUsageInfo.SourceAvailable && ((this.ReservationInfo == null && licenseUsageInfo.ReservationInfo == null) || (this.ReservationInfo != null && licenseUsageInfo.ReservationInfo != null && Enumerable.SequenceEqual(this.ReservationInfo, licenseUsageInfo.ReservationInfo))) && ((this.FeatureInfo == null && licenseUsageInfo.FeatureInfo == null) || (this.FeatureInfo != null && licenseUsageInfo.FeatureInfo != null && Enumerable.SequenceEqual(this.FeatureInfo, licenseUsageInfo.FeatureInfo))));\n        }\n\n        public override bool Equals(object licenseUsageInfo)\n        {\n            return Equals(licenseUsageInfo as LicenseUsageInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + SourceAvailable + \"_\" + ReservationInfo + \"_\" + FeatureInfo).GetHashCode();\n        }\n    }\n\n    public class LimitExceeded : VimFault, IEquatable<LimitExceeded>\n    {\n        public string Property { get; set; }\n\n        public int? Limit { get; set; }\n\n        public bool Equals(LimitExceeded limitExceeded)\n        {\n            return (limitExceeded != null && this.Property == limitExceeded.Property && ((this.Limit == null && limitExceeded.Limit == null) || (this.Limit != null && this.Limit.Equals(limitExceeded.Limit))));\n        }\n\n        public override bool Equals(object limitExceeded)\n        {\n            return Equals(limitExceeded as LimitExceeded);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Property + \"_\" + Limit).GetHashCode();\n        }\n    }\n\n    public class LinkDiscoveryProtocolConfig : DynamicData, IEquatable<LinkDiscoveryProtocolConfig>\n    {\n        public string Protocol { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(LinkDiscoveryProtocolConfig linkDiscoveryProtocolConfig)\n        {\n            return (linkDiscoveryProtocolConfig != null && this.Protocol == linkDiscoveryProtocolConfig.Protocol && this.Operation == linkDiscoveryProtocolConfig.Operation);\n        }\n\n        public override bool Equals(object linkDiscoveryProtocolConfig)\n        {\n            return Equals(linkDiscoveryProtocolConfig as LinkDiscoveryProtocolConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Protocol + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class LinkLayerDiscoveryProtocolInfo : DynamicData, IEquatable<LinkLayerDiscoveryProtocolInfo>\n    {\n        public string ChassisId { get; set; }\n\n        public string PortId { get; set; }\n\n        public int TimeToLive { get; set; }\n\n        public KeyAnyValue[] Parameter { get; set; }\n\n        public bool Equals(LinkLayerDiscoveryProtocolInfo linkLayerDiscoveryProtocolInfo)\n        {\n            return (linkLayerDiscoveryProtocolInfo != null && this.ChassisId == linkLayerDiscoveryProtocolInfo.ChassisId && this.PortId == linkLayerDiscoveryProtocolInfo.PortId && this.TimeToLive == linkLayerDiscoveryProtocolInfo.TimeToLive && ((this.Parameter == null && linkLayerDiscoveryProtocolInfo.Parameter == null) || (this.Parameter != null && linkLayerDiscoveryProtocolInfo.Parameter != null && Enumerable.SequenceEqual(this.Parameter, linkLayerDiscoveryProtocolInfo.Parameter))));\n        }\n\n        public override bool Equals(object linkLayerDiscoveryProtocolInfo)\n        {\n            return Equals(linkLayerDiscoveryProtocolInfo as LinkLayerDiscoveryProtocolInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChassisId + \"_\" + PortId + \"_\" + TimeToLive + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class LinkProfile : ApplyProfile, IEquatable<LinkProfile>\n    {\n        public bool Equals(LinkProfile linkProfile)\n        {\n            return (linkProfile != null && base.Equals(linkProfile));\n        }\n\n        public override bool Equals(object linkProfile)\n        {\n            return Equals(linkProfile as LinkProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LinuxVolumeNotClean : CustomizationFault, IEquatable<LinuxVolumeNotClean>\n    {\n        public bool Equals(LinuxVolumeNotClean linuxVolumeNotClean)\n        {\n            return (linuxVolumeNotClean != null && base.Equals(linuxVolumeNotClean));\n        }\n\n        public override bool Equals(object linuxVolumeNotClean)\n        {\n            return Equals(linuxVolumeNotClean as LinuxVolumeNotClean);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ListView : ManagedObjectView, IEquatable<ListView>\n    {\n        public ManagedObjectReference[] ModifyListView(ManagedObjectReference[] add, ManagedObjectReference[] remove)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ManagedObjectReference[] ResetListView(ManagedObjectReference[] obj)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public void ResetListViewFromView(ManagedObjectReference view)\n        {\n        }\n\n        public bool Equals(ListView listView)\n        {\n            return (listView != null && base.Equals(listView));\n        }\n\n        public override bool Equals(object listView)\n        {\n            return Equals(listView as ListView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LocalDatastoreCreatedEvent : HostEvent, IEquatable<LocalDatastoreCreatedEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public string DatastoreUrl { get; set; }\n\n        public bool Equals(LocalDatastoreCreatedEvent localDatastoreCreatedEvent)\n        {\n            return (localDatastoreCreatedEvent != null && ((this.Datastore == null && localDatastoreCreatedEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(localDatastoreCreatedEvent.Datastore))) && this.DatastoreUrl == localDatastoreCreatedEvent.DatastoreUrl);\n        }\n\n        public override bool Equals(object localDatastoreCreatedEvent)\n        {\n            return Equals(localDatastoreCreatedEvent as LocalDatastoreCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + DatastoreUrl).GetHashCode();\n        }\n    }\n\n    public class LocalDatastoreInfo : DatastoreInfo, IEquatable<LocalDatastoreInfo>\n    {\n        public string Path { get; set; }\n\n        public bool Equals(LocalDatastoreInfo localDatastoreInfo)\n        {\n            return (localDatastoreInfo != null && this.Path == localDatastoreInfo.Path);\n        }\n\n        public override bool Equals(object localDatastoreInfo)\n        {\n            return Equals(localDatastoreInfo as LocalDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path).GetHashCode();\n        }\n    }\n\n    public class LocalizableMessage : DynamicData, IEquatable<LocalizableMessage>\n    {\n        public string Key { get; set; }\n\n        public KeyAnyValue[] Arg { get; set; }\n\n        public string Message { get; set; }\n\n        public bool Equals(LocalizableMessage localizableMessage)\n        {\n            return (localizableMessage != null && this.Key == localizableMessage.Key && ((this.Arg == null && localizableMessage.Arg == null) || (this.Arg != null && localizableMessage.Arg != null && Enumerable.SequenceEqual(this.Arg, localizableMessage.Arg))) && this.Message == localizableMessage.Message);\n        }\n\n        public override bool Equals(object localizableMessage)\n        {\n            return Equals(localizableMessage as LocalizableMessage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Arg + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class LocalizationManager : ViewBase, IEquatable<LocalizationManager>\n    {\n        public LocalizationManagerMessageCatalog[] Catalog { get; set; }\n\n        public bool Equals(LocalizationManager localizationManager)\n        {\n            return (localizationManager != null && ((this.Catalog == null && localizationManager.Catalog == null) || (this.Catalog != null && localizationManager.Catalog != null && Enumerable.SequenceEqual(this.Catalog, localizationManager.Catalog))));\n        }\n\n        public override bool Equals(object localizationManager)\n        {\n            return Equals(localizationManager as LocalizationManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Catalog).GetHashCode();\n        }\n    }\n\n    public class LocalizationManagerMessageCatalog : DynamicData, IEquatable<LocalizationManagerMessageCatalog>\n    {\n        public string ModuleName { get; set; }\n\n        public string CatalogName { get; set; }\n\n        public string Locale { get; set; }\n\n        public string CatalogUri { get; set; }\n\n        public DateTime? LastModified { get; set; }\n\n        public string Md5sum { get; set; }\n\n        public string Version { get; set; }\n\n        public bool Equals(LocalizationManagerMessageCatalog localizationManagerMessageCatalog)\n        {\n            return (localizationManagerMessageCatalog != null && this.ModuleName == localizationManagerMessageCatalog.ModuleName && this.CatalogName == localizationManagerMessageCatalog.CatalogName && this.Locale == localizationManagerMessageCatalog.Locale && this.CatalogUri == localizationManagerMessageCatalog.CatalogUri && ((this.LastModified == null && localizationManagerMessageCatalog.LastModified == null) || (this.LastModified != null && this.LastModified.Equals(localizationManagerMessageCatalog.LastModified))) && this.Md5sum == localizationManagerMessageCatalog.Md5sum && this.Version == localizationManagerMessageCatalog.Version);\n        }\n\n        public override bool Equals(object localizationManagerMessageCatalog)\n        {\n            return Equals(localizationManagerMessageCatalog as LocalizationManagerMessageCatalog);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ModuleName + \"_\" + CatalogName + \"_\" + Locale + \"_\" + CatalogUri + \"_\" + LastModified + \"_\" + Md5sum + \"_\" + Version).GetHashCode();\n        }\n    }\n\n    public class LocalizedMethodFault : DynamicData, IEquatable<LocalizedMethodFault>\n    {\n        public MethodFault Fault { get; set; }\n\n        public string LocalizedMessage { get; set; }\n\n        public bool Equals(LocalizedMethodFault localizedMethodFault)\n        {\n            return (localizedMethodFault != null && ((this.Fault == null && localizedMethodFault.Fault == null) || (this.Fault != null && this.Fault.Equals(localizedMethodFault.Fault))) && this.LocalizedMessage == localizedMethodFault.LocalizedMessage);\n        }\n\n        public override bool Equals(object localizedMethodFault)\n        {\n            return Equals(localizedMethodFault as LocalizedMethodFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault + \"_\" + LocalizedMessage).GetHashCode();\n        }\n    }\n\n    public class LocalLicenseSource : LicenseSource, IEquatable<LocalLicenseSource>\n    {\n        public string LicenseKeys { get; set; }\n\n        public bool Equals(LocalLicenseSource localLicenseSource)\n        {\n            return (localLicenseSource != null && this.LicenseKeys == localLicenseSource.LicenseKeys);\n        }\n\n        public override bool Equals(object localLicenseSource)\n        {\n            return Equals(localLicenseSource as LocalLicenseSource);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LicenseKeys).GetHashCode();\n        }\n    }\n\n    public class LocalTSMEnabledEvent : HostEvent, IEquatable<LocalTSMEnabledEvent>\n    {\n        public bool Equals(LocalTSMEnabledEvent localTSMEnabledEvent)\n        {\n            return (localTSMEnabledEvent != null && base.Equals(localTSMEnabledEvent));\n        }\n\n        public override bool Equals(object localTSMEnabledEvent)\n        {\n            return Equals(localTSMEnabledEvent as LocalTSMEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LockerMisconfiguredEvent : Event, IEquatable<LockerMisconfiguredEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public bool Equals(LockerMisconfiguredEvent lockerMisconfiguredEvent)\n        {\n            return (lockerMisconfiguredEvent != null && ((this.Datastore == null && lockerMisconfiguredEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(lockerMisconfiguredEvent.Datastore))));\n        }\n\n        public override bool Equals(object lockerMisconfiguredEvent)\n        {\n            return Equals(lockerMisconfiguredEvent as LockerMisconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class LockerReconfiguredEvent : Event, IEquatable<LockerReconfiguredEvent>\n    {\n        public DatastoreEventArgument OldDatastore { get; set; }\n\n        public DatastoreEventArgument NewDatastore { get; set; }\n\n        public bool Equals(LockerReconfiguredEvent lockerReconfiguredEvent)\n        {\n            return (lockerReconfiguredEvent != null && ((this.OldDatastore == null && lockerReconfiguredEvent.OldDatastore == null) || (this.OldDatastore != null && this.OldDatastore.Equals(lockerReconfiguredEvent.OldDatastore))) && ((this.NewDatastore == null && lockerReconfiguredEvent.NewDatastore == null) || (this.NewDatastore != null && this.NewDatastore.Equals(lockerReconfiguredEvent.NewDatastore))));\n        }\n\n        public override bool Equals(object lockerReconfiguredEvent)\n        {\n            return Equals(lockerReconfiguredEvent as LockerReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldDatastore + \"_\" + NewDatastore).GetHashCode();\n        }\n    }\n\n    public class LogBundlingFailed : VimFault, IEquatable<LogBundlingFailed>\n    {\n        public bool Equals(LogBundlingFailed logBundlingFailed)\n        {\n            return (logBundlingFailed != null && base.Equals(logBundlingFailed));\n        }\n\n        public override bool Equals(object logBundlingFailed)\n        {\n            return Equals(logBundlingFailed as LogBundlingFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class LongOption : OptionType, IEquatable<LongOption>\n    {\n        public long Min { get; set; }\n\n        public long Max { get; set; }\n\n        public long DefaultValue { get; set; }\n\n        public bool Equals(LongOption longOption)\n        {\n            return (longOption != null && this.Min == longOption.Min && this.Max == longOption.Max && this.DefaultValue == longOption.DefaultValue);\n        }\n\n        public override bool Equals(object longOption)\n        {\n            return Equals(longOption as LongOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Min + \"_\" + Max + \"_\" + DefaultValue).GetHashCode();\n        }\n    }\n\n    public class LongPolicy : InheritablePolicy, IEquatable<LongPolicy>\n    {\n        public long? Value { get; set; }\n\n        public bool Equals(LongPolicy longPolicy)\n        {\n            return (longPolicy != null && ((this.Value == null && longPolicy.Value == null) || (this.Value != null && this.Value.Equals(longPolicy.Value))));\n        }\n\n        public override bool Equals(object longPolicy)\n        {\n            return Equals(longPolicy as LongPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class MacAddress : NegatableExpression, IEquatable<MacAddress>\n    {\n        public bool Equals(MacAddress macAddress)\n        {\n            return (macAddress != null && base.Equals(macAddress));\n        }\n\n        public override bool Equals(object macAddress)\n        {\n            return Equals(macAddress as MacAddress);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MacRange : MacAddress, IEquatable<MacRange>\n    {\n        public string Address { get; set; }\n\n        public string Mask { get; set; }\n\n        public bool Equals(MacRange macRange)\n        {\n            return (macRange != null && this.Address == macRange.Address && this.Mask == macRange.Mask);\n        }\n\n        public override bool Equals(object macRange)\n        {\n            return Equals(macRange as MacRange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address + \"_\" + Mask).GetHashCode();\n        }\n    }\n\n    public class MaintenanceModeFileMove : MigrationFault, IEquatable<MaintenanceModeFileMove>\n    {\n        public bool Equals(MaintenanceModeFileMove maintenanceModeFileMove)\n        {\n            return (maintenanceModeFileMove != null && base.Equals(maintenanceModeFileMove));\n        }\n\n        public override bool Equals(object maintenanceModeFileMove)\n        {\n            return Equals(maintenanceModeFileMove as MaintenanceModeFileMove);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ManagedByInfo : DynamicData, IEquatable<ManagedByInfo>\n    {\n        public string ExtensionKey { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(ManagedByInfo managedByInfo)\n        {\n            return (managedByInfo != null && this.ExtensionKey == managedByInfo.ExtensionKey && this.Type == managedByInfo.Type);\n        }\n\n        public override bool Equals(object managedByInfo)\n        {\n            return Equals(managedByInfo as ManagedByInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionKey + \"_\" + Type).GetHashCode();\n        }\n    }\n\n    public class ManagedEntity : EntityViewBase, IEquatable<ManagedEntity>\n    {\n        public ManagedObjectReference Parent { get; set; }\n\n        public CustomFieldValue[] CustomValue { get; set; }\n\n        public ManagedEntityStatus OverallStatus { get; set; }\n\n        public ManagedEntityStatus ConfigStatus { get; set; }\n\n        public Event[] ConfigIssue { get; set; }\n\n        public int[] EffectiveRole { get; set; }\n\n        public Permission[] Permission { get; set; }\n\n        public string Name { get; set; }\n\n        public string[] DisabledMethod { get; set; }\n\n        public ManagedObjectReference[] RecentTask { get; set; }\n\n        public AlarmState[] DeclaredAlarmState { get; set; }\n\n        public AlarmState[] TriggeredAlarmState { get; set; }\n\n        public bool AlarmActionsEnabled { get; set; }\n\n        public Tag[] Tag { get; set; }\n\n        public ManagedEntity_LinkedView LinkedView { get; set; }\n\n        public void Reload()\n        {\n        }\n\n        public ManagedObjectReference Rename_Task(string newName)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void Rename(string newName)\n        {\n        }\n\n        public ManagedObjectReference Destroy_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void Destroy()\n        {\n        }\n\n        public bool Equals(ManagedEntity managedEntity)\n        {\n            return (managedEntity != null && ((this.Parent == null && managedEntity.Parent == null) || (this.Parent != null && this.Parent.Equals(managedEntity.Parent))) && ((this.CustomValue == null && managedEntity.CustomValue == null) || (this.CustomValue != null && managedEntity.CustomValue != null && Enumerable.SequenceEqual(this.CustomValue, managedEntity.CustomValue))) && this.OverallStatus == managedEntity.OverallStatus && this.ConfigStatus == managedEntity.ConfigStatus && ((this.ConfigIssue == null && managedEntity.ConfigIssue == null) || (this.ConfigIssue != null && managedEntity.ConfigIssue != null && Enumerable.SequenceEqual(this.ConfigIssue, managedEntity.ConfigIssue))) && ((this.EffectiveRole == null && managedEntity.EffectiveRole == null) || (this.EffectiveRole != null && managedEntity.EffectiveRole != null && Enumerable.SequenceEqual(this.EffectiveRole, managedEntity.EffectiveRole))) && ((this.Permission == null && managedEntity.Permission == null) || (this.Permission != null && managedEntity.Permission != null && Enumerable.SequenceEqual(this.Permission, managedEntity.Permission))) && this.Name == managedEntity.Name && ((this.DisabledMethod == null && managedEntity.DisabledMethod == null) || (this.DisabledMethod != null && managedEntity.DisabledMethod != null && Enumerable.SequenceEqual(this.DisabledMethod, managedEntity.DisabledMethod))) && ((this.RecentTask == null && managedEntity.RecentTask == null) || (this.RecentTask != null && managedEntity.RecentTask != null && Enumerable.SequenceEqual(this.RecentTask, managedEntity.RecentTask))) && ((this.DeclaredAlarmState == null && managedEntity.DeclaredAlarmState == null) || (this.DeclaredAlarmState != null && managedEntity.DeclaredAlarmState != null && Enumerable.SequenceEqual(this.DeclaredAlarmState, managedEntity.DeclaredAlarmState))) && ((this.TriggeredAlarmState == null && managedEntity.TriggeredAlarmState == null) || (this.TriggeredAlarmState != null && managedEntity.TriggeredAlarmState != null && Enumerable.SequenceEqual(this.TriggeredAlarmState, managedEntity.TriggeredAlarmState))) && this.AlarmActionsEnabled == managedEntity.AlarmActionsEnabled && ((this.Tag == null && managedEntity.Tag == null) || (this.Tag != null && managedEntity.Tag != null && Enumerable.SequenceEqual(this.Tag, managedEntity.Tag))) && ((this.LinkedView == null && managedEntity.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(managedEntity.LinkedView))));\n        }\n\n        public override bool Equals(object managedEntity)\n        {\n            return Equals(managedEntity as ManagedEntity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent + \"_\" + CustomValue + \"_\" + OverallStatus + \"_\" + ConfigStatus + \"_\" + ConfigIssue + \"_\" + EffectiveRole + \"_\" + Permission + \"_\" + Name + \"_\" + DisabledMethod + \"_\" + RecentTask + \"_\" + DeclaredAlarmState + \"_\" + TriggeredAlarmState + \"_\" + AlarmActionsEnabled + \"_\" + Tag + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ManagedEntity_LinkedView : IEquatable<ManagedEntity_LinkedView>\n    {\n        public ManagedEntity Parent { get; set; }\n\n        public Task[] RecentTask { get; set; }\n\n        public bool Equals(ManagedEntity_LinkedView managedEntity_LinkedView)\n        {\n            return (managedEntity_LinkedView != null && ((this.Parent == null && managedEntity_LinkedView.Parent == null) || (this.Parent != null && this.Parent.Equals(managedEntity_LinkedView.Parent))) && ((this.RecentTask == null && managedEntity_LinkedView.RecentTask == null) || (this.RecentTask != null && managedEntity_LinkedView.RecentTask != null && Enumerable.SequenceEqual(this.RecentTask, managedEntity_LinkedView.RecentTask))));\n        }\n\n        public override bool Equals(object managedEntity_LinkedView)\n        {\n            return Equals(managedEntity_LinkedView as ManagedEntity_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent + \"_\" + RecentTask).GetHashCode();\n        }\n    }\n\n    public class ManagedEntityEventArgument : EntityEventArgument, IEquatable<ManagedEntityEventArgument>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public ManagedEntityEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ManagedEntityEventArgument managedEntityEventArgument)\n        {\n            return (managedEntityEventArgument != null && ((this.Entity == null && managedEntityEventArgument.Entity == null) || (this.Entity != null && this.Entity.Equals(managedEntityEventArgument.Entity))) && ((this.LinkedView == null && managedEntityEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(managedEntityEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object managedEntityEventArgument)\n        {\n            return Equals(managedEntityEventArgument as ManagedEntityEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ManagedEntityEventArgument_LinkedView : IEquatable<ManagedEntityEventArgument_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(ManagedEntityEventArgument_LinkedView managedEntityEventArgument_LinkedView)\n        {\n            return (managedEntityEventArgument_LinkedView != null && ((this.Entity == null && managedEntityEventArgument_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(managedEntityEventArgument_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object managedEntityEventArgument_LinkedView)\n        {\n            return Equals(managedEntityEventArgument_LinkedView as ManagedEntityEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class ManagedObjectNotFound : RuntimeFault, IEquatable<ManagedObjectNotFound>\n    {\n        public ManagedObjectReference Obj { get; set; }\n\n        public bool Equals(ManagedObjectNotFound managedObjectNotFound)\n        {\n            return (managedObjectNotFound != null && ((this.Obj == null && managedObjectNotFound.Obj == null) || (this.Obj != null && this.Obj.Equals(managedObjectNotFound.Obj))));\n        }\n\n        public override bool Equals(object managedObjectNotFound)\n        {\n            return Equals(managedObjectNotFound as ManagedObjectNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Obj).GetHashCode();\n        }\n    }\n\n    public class ManagedObjectReference : IEquatable<ManagedObjectReference>\n    {\n        public string Type { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(ManagedObjectReference managedObjectReference)\n        {\n            return (managedObjectReference != null && this.Type == managedObjectReference.Type && this.Value == managedObjectReference.Value);\n        }\n\n        public override bool Equals(object managedObjectReference)\n        {\n            return Equals(managedObjectReference as ManagedObjectReference);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Value).GetHashCode();\n        }\n\n        public override string ToString()\n        {\n            return (Type + \"_\" + Value);\n        }\n    }\n\n    public class ManagedObjectView : View, IEquatable<ManagedObjectView>\n    {\n        public ManagedObjectReference[] View { get; set; }\n\n        public bool Equals(ManagedObjectView managedObjectView)\n        {\n            return (managedObjectView != null && ((this.View == null && managedObjectView.View == null) || (this.View != null && managedObjectView.View != null && Enumerable.SequenceEqual(this.View, managedObjectView.View))));\n        }\n\n        public override bool Equals(object managedObjectView)\n        {\n            return Equals(managedObjectView as ManagedObjectView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (View).GetHashCode();\n        }\n    }\n\n    public class MemoryFileFormatNotSupportedByDatastore : UnsupportedDatastore, IEquatable<MemoryFileFormatNotSupportedByDatastore>\n    {\n        public string DatastoreName { get; set; }\n\n        public string Type { get; set; }\n\n        public new MemoryFileFormatNotSupportedByDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(MemoryFileFormatNotSupportedByDatastore memoryFileFormatNotSupportedByDatastore)\n        {\n            return (memoryFileFormatNotSupportedByDatastore != null && this.DatastoreName == memoryFileFormatNotSupportedByDatastore.DatastoreName && this.Type == memoryFileFormatNotSupportedByDatastore.Type && ((this.LinkedView == null && memoryFileFormatNotSupportedByDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(memoryFileFormatNotSupportedByDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object memoryFileFormatNotSupportedByDatastore)\n        {\n            return Equals(memoryFileFormatNotSupportedByDatastore as MemoryFileFormatNotSupportedByDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreName + \"_\" + Type + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class MemoryFileFormatNotSupportedByDatastore_LinkedView : UnsupportedDatastore_LinkedView, IEquatable<MemoryFileFormatNotSupportedByDatastore_LinkedView>\n    {\n        public bool Equals(MemoryFileFormatNotSupportedByDatastore_LinkedView memoryFileFormatNotSupportedByDatastore_LinkedView)\n        {\n            return (memoryFileFormatNotSupportedByDatastore_LinkedView != null && base.Equals(memoryFileFormatNotSupportedByDatastore_LinkedView));\n        }\n\n        public override bool Equals(object memoryFileFormatNotSupportedByDatastore_LinkedView)\n        {\n            return Equals(memoryFileFormatNotSupportedByDatastore_LinkedView as MemoryFileFormatNotSupportedByDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MemoryHotPlugNotSupported : VmConfigFault, IEquatable<MemoryHotPlugNotSupported>\n    {\n        public bool Equals(MemoryHotPlugNotSupported memoryHotPlugNotSupported)\n        {\n            return (memoryHotPlugNotSupported != null && base.Equals(memoryHotPlugNotSupported));\n        }\n\n        public override bool Equals(object memoryHotPlugNotSupported)\n        {\n            return Equals(memoryHotPlugNotSupported as MemoryHotPlugNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MemorySizeNotRecommended : VirtualHardwareCompatibilityIssue, IEquatable<MemorySizeNotRecommended>\n    {\n        public int MemorySizeMB { get; set; }\n\n        public int MinMemorySizeMB { get; set; }\n\n        public int MaxMemorySizeMB { get; set; }\n\n        public bool Equals(MemorySizeNotRecommended memorySizeNotRecommended)\n        {\n            return (memorySizeNotRecommended != null && this.MemorySizeMB == memorySizeNotRecommended.MemorySizeMB && this.MinMemorySizeMB == memorySizeNotRecommended.MinMemorySizeMB && this.MaxMemorySizeMB == memorySizeNotRecommended.MaxMemorySizeMB);\n        }\n\n        public override bool Equals(object memorySizeNotRecommended)\n        {\n            return Equals(memorySizeNotRecommended as MemorySizeNotRecommended);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MemorySizeMB + \"_\" + MinMemorySizeMB + \"_\" + MaxMemorySizeMB).GetHashCode();\n        }\n    }\n\n    public class MemorySizeNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<MemorySizeNotSupported>\n    {\n        public int MemorySizeMB { get; set; }\n\n        public int MinMemorySizeMB { get; set; }\n\n        public int MaxMemorySizeMB { get; set; }\n\n        public bool Equals(MemorySizeNotSupported memorySizeNotSupported)\n        {\n            return (memorySizeNotSupported != null && this.MemorySizeMB == memorySizeNotSupported.MemorySizeMB && this.MinMemorySizeMB == memorySizeNotSupported.MinMemorySizeMB && this.MaxMemorySizeMB == memorySizeNotSupported.MaxMemorySizeMB);\n        }\n\n        public override bool Equals(object memorySizeNotSupported)\n        {\n            return Equals(memorySizeNotSupported as MemorySizeNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MemorySizeMB + \"_\" + MinMemorySizeMB + \"_\" + MaxMemorySizeMB).GetHashCode();\n        }\n    }\n\n    public class MemorySizeNotSupportedByDatastore : VirtualHardwareCompatibilityIssue, IEquatable<MemorySizeNotSupportedByDatastore>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public int MemorySizeMB { get; set; }\n\n        public int MaxMemorySizeMB { get; set; }\n\n        public MemorySizeNotSupportedByDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(MemorySizeNotSupportedByDatastore memorySizeNotSupportedByDatastore)\n        {\n            return (memorySizeNotSupportedByDatastore != null && ((this.Datastore == null && memorySizeNotSupportedByDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(memorySizeNotSupportedByDatastore.Datastore))) && this.MemorySizeMB == memorySizeNotSupportedByDatastore.MemorySizeMB && this.MaxMemorySizeMB == memorySizeNotSupportedByDatastore.MaxMemorySizeMB && ((this.LinkedView == null && memorySizeNotSupportedByDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(memorySizeNotSupportedByDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object memorySizeNotSupportedByDatastore)\n        {\n            return Equals(memorySizeNotSupportedByDatastore as MemorySizeNotSupportedByDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + MemorySizeMB + \"_\" + MaxMemorySizeMB + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class MemorySizeNotSupportedByDatastore_LinkedView : IEquatable<MemorySizeNotSupportedByDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(MemorySizeNotSupportedByDatastore_LinkedView memorySizeNotSupportedByDatastore_LinkedView)\n        {\n            return (memorySizeNotSupportedByDatastore_LinkedView != null && ((this.Datastore == null && memorySizeNotSupportedByDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(memorySizeNotSupportedByDatastore_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object memorySizeNotSupportedByDatastore_LinkedView)\n        {\n            return Equals(memorySizeNotSupportedByDatastore_LinkedView as MemorySizeNotSupportedByDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class MemorySnapshotOnIndependentDisk : SnapshotFault, IEquatable<MemorySnapshotOnIndependentDisk>\n    {\n        public bool Equals(MemorySnapshotOnIndependentDisk memorySnapshotOnIndependentDisk)\n        {\n            return (memorySnapshotOnIndependentDisk != null && base.Equals(memorySnapshotOnIndependentDisk));\n        }\n\n        public override bool Equals(object memorySnapshotOnIndependentDisk)\n        {\n            return Equals(memorySnapshotOnIndependentDisk as MemorySnapshotOnIndependentDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MessageBusProxy : ViewBase, IEquatable<MessageBusProxy>\n    {\n        public bool Equals(MessageBusProxy messageBusProxy)\n        {\n            return (messageBusProxy != null && base.Equals(messageBusProxy));\n        }\n\n        public override bool Equals(object messageBusProxy)\n        {\n            return Equals(messageBusProxy as MessageBusProxy);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MethodAction : Action, IEquatable<MethodAction>\n    {\n        public string Name { get; set; }\n\n        public MethodActionArgument[] Argument { get; set; }\n\n        public bool Equals(MethodAction methodAction)\n        {\n            return (methodAction != null && this.Name == methodAction.Name && ((this.Argument == null && methodAction.Argument == null) || (this.Argument != null && methodAction.Argument != null && Enumerable.SequenceEqual(this.Argument, methodAction.Argument))));\n        }\n\n        public override bool Equals(object methodAction)\n        {\n            return Equals(methodAction as MethodAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Argument).GetHashCode();\n        }\n    }\n\n    public class MethodActionArgument : DynamicData, IEquatable<MethodActionArgument>\n    {\n        public object Value { get; set; }\n\n        public bool Equals(MethodActionArgument methodActionArgument)\n        {\n            return (methodActionArgument != null && ((this.Value == null && methodActionArgument.Value == null) || (this.Value != null && this.Value.Equals(methodActionArgument.Value))));\n        }\n\n        public override bool Equals(object methodActionArgument)\n        {\n            return Equals(methodActionArgument as MethodActionArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class MethodAlreadyDisabledFault : RuntimeFault, IEquatable<MethodAlreadyDisabledFault>\n    {\n        public string SourceId { get; set; }\n\n        public bool Equals(MethodAlreadyDisabledFault methodAlreadyDisabledFault)\n        {\n            return (methodAlreadyDisabledFault != null && this.SourceId == methodAlreadyDisabledFault.SourceId);\n        }\n\n        public override bool Equals(object methodAlreadyDisabledFault)\n        {\n            return Equals(methodAlreadyDisabledFault as MethodAlreadyDisabledFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceId).GetHashCode();\n        }\n    }\n\n    public class MethodDescription : Description, IEquatable<MethodDescription>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(MethodDescription methodDescription)\n        {\n            return (methodDescription != null && this.Key == methodDescription.Key);\n        }\n\n        public override bool Equals(object methodDescription)\n        {\n            return Equals(methodDescription as MethodDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class MethodDisabled : RuntimeFault, IEquatable<MethodDisabled>\n    {\n        public string Source { get; set; }\n\n        public bool Equals(MethodDisabled methodDisabled)\n        {\n            return (methodDisabled != null && this.Source == methodDisabled.Source);\n        }\n\n        public override bool Equals(object methodDisabled)\n        {\n            return Equals(methodDisabled as MethodDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source).GetHashCode();\n        }\n    }\n\n    public class MethodFault : IEquatable<MethodFault>\n    {\n        public LocalizedMethodFault FaultCause { get; set; }\n\n        public LocalizableMessage[] FaultMessage { get; set; }\n\n        public bool Equals(MethodFault methodFault)\n        {\n            return (methodFault != null && ((this.FaultCause == null && methodFault.FaultCause == null) || (this.FaultCause != null && this.FaultCause.Equals(methodFault.FaultCause))) && ((this.FaultMessage == null && methodFault.FaultMessage == null) || (this.FaultMessage != null && methodFault.FaultMessage != null && Enumerable.SequenceEqual(this.FaultMessage, methodFault.FaultMessage))));\n        }\n\n        public override bool Equals(object methodFault)\n        {\n            return Equals(methodFault as MethodFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FaultCause + \"_\" + FaultMessage).GetHashCode();\n        }\n    }\n\n    public class MethodNotFound : InvalidRequest, IEquatable<MethodNotFound>\n    {\n        public ManagedObjectReference Receiver { get; set; }\n\n        public string Method { get; set; }\n\n        public bool Equals(MethodNotFound methodNotFound)\n        {\n            return (methodNotFound != null && ((this.Receiver == null && methodNotFound.Receiver == null) || (this.Receiver != null && this.Receiver.Equals(methodNotFound.Receiver))) && this.Method == methodNotFound.Method);\n        }\n\n        public override bool Equals(object methodNotFound)\n        {\n            return Equals(methodNotFound as MethodNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Receiver + \"_\" + Method).GetHashCode();\n        }\n    }\n\n    public class MetricAlarmExpression : AlarmExpression, IEquatable<MetricAlarmExpression>\n    {\n        public MetricAlarmOperator Operator { get; set; }\n\n        public string Type { get; set; }\n\n        public PerfMetricId Metric { get; set; }\n\n        public int? Yellow { get; set; }\n\n        public int? YellowInterval { get; set; }\n\n        public int? Red { get; set; }\n\n        public int? RedInterval { get; set; }\n\n        public bool Equals(MetricAlarmExpression metricAlarmExpression)\n        {\n            return (metricAlarmExpression != null && this.Operator == metricAlarmExpression.Operator && this.Type == metricAlarmExpression.Type && ((this.Metric == null && metricAlarmExpression.Metric == null) || (this.Metric != null && this.Metric.Equals(metricAlarmExpression.Metric))) && ((this.Yellow == null && metricAlarmExpression.Yellow == null) || (this.Yellow != null && this.Yellow.Equals(metricAlarmExpression.Yellow))) && ((this.YellowInterval == null && metricAlarmExpression.YellowInterval == null) || (this.YellowInterval != null && this.YellowInterval.Equals(metricAlarmExpression.YellowInterval))) && ((this.Red == null && metricAlarmExpression.Red == null) || (this.Red != null && this.Red.Equals(metricAlarmExpression.Red))) && ((this.RedInterval == null && metricAlarmExpression.RedInterval == null) || (this.RedInterval != null && this.RedInterval.Equals(metricAlarmExpression.RedInterval))));\n        }\n\n        public override bool Equals(object metricAlarmExpression)\n        {\n            return Equals(metricAlarmExpression as MetricAlarmExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operator + \"_\" + Type + \"_\" + Metric + \"_\" + Yellow + \"_\" + YellowInterval + \"_\" + Red + \"_\" + RedInterval).GetHashCode();\n        }\n    }\n\n    public class MigrationDisabled : MigrationFault, IEquatable<MigrationDisabled>\n    {\n        public bool Equals(MigrationDisabled migrationDisabled)\n        {\n            return (migrationDisabled != null && base.Equals(migrationDisabled));\n        }\n\n        public override bool Equals(object migrationDisabled)\n        {\n            return Equals(migrationDisabled as MigrationDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MigrationErrorEvent : MigrationEvent, IEquatable<MigrationErrorEvent>\n    {\n        public bool Equals(MigrationErrorEvent migrationErrorEvent)\n        {\n            return (migrationErrorEvent != null && base.Equals(migrationErrorEvent));\n        }\n\n        public override bool Equals(object migrationErrorEvent)\n        {\n            return Equals(migrationErrorEvent as MigrationErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MigrationEvent : VmEvent, IEquatable<MigrationEvent>\n    {\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(MigrationEvent migrationEvent)\n        {\n            return (migrationEvent != null && ((this.Fault == null && migrationEvent.Fault == null) || (this.Fault != null && this.Fault.Equals(migrationEvent.Fault))));\n        }\n\n        public override bool Equals(object migrationEvent)\n        {\n            return Equals(migrationEvent as MigrationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault).GetHashCode();\n        }\n    }\n\n    public class MigrationFault : VimFault, IEquatable<MigrationFault>\n    {\n        public bool Equals(MigrationFault migrationFault)\n        {\n            return (migrationFault != null && base.Equals(migrationFault));\n        }\n\n        public override bool Equals(object migrationFault)\n        {\n            return Equals(migrationFault as MigrationFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MigrationFeatureNotSupported : MigrationFault, IEquatable<MigrationFeatureNotSupported>\n    {\n        public bool AtSourceHost { get; set; }\n\n        public string FailedHostName { get; set; }\n\n        public ManagedObjectReference FailedHost { get; set; }\n\n        public MigrationFeatureNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(MigrationFeatureNotSupported migrationFeatureNotSupported)\n        {\n            return (migrationFeatureNotSupported != null && this.AtSourceHost == migrationFeatureNotSupported.AtSourceHost && this.FailedHostName == migrationFeatureNotSupported.FailedHostName && ((this.FailedHost == null && migrationFeatureNotSupported.FailedHost == null) || (this.FailedHost != null && this.FailedHost.Equals(migrationFeatureNotSupported.FailedHost))) && ((this.LinkedView == null && migrationFeatureNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(migrationFeatureNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object migrationFeatureNotSupported)\n        {\n            return Equals(migrationFeatureNotSupported as MigrationFeatureNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AtSourceHost + \"_\" + FailedHostName + \"_\" + FailedHost + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class MigrationFeatureNotSupported_LinkedView : IEquatable<MigrationFeatureNotSupported_LinkedView>\n    {\n        public HostSystem FailedHost { get; set; }\n\n        public bool Equals(MigrationFeatureNotSupported_LinkedView migrationFeatureNotSupported_LinkedView)\n        {\n            return (migrationFeatureNotSupported_LinkedView != null && ((this.FailedHost == null && migrationFeatureNotSupported_LinkedView.FailedHost == null) || (this.FailedHost != null && this.FailedHost.Equals(migrationFeatureNotSupported_LinkedView.FailedHost))));\n        }\n\n        public override bool Equals(object migrationFeatureNotSupported_LinkedView)\n        {\n            return Equals(migrationFeatureNotSupported_LinkedView as MigrationFeatureNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailedHost).GetHashCode();\n        }\n    }\n\n    public class MigrationHostErrorEvent : MigrationEvent, IEquatable<MigrationHostErrorEvent>\n    {\n        public HostEventArgument DstHost { get; set; }\n\n        public bool Equals(MigrationHostErrorEvent migrationHostErrorEvent)\n        {\n            return (migrationHostErrorEvent != null && ((this.DstHost == null && migrationHostErrorEvent.DstHost == null) || (this.DstHost != null && this.DstHost.Equals(migrationHostErrorEvent.DstHost))));\n        }\n\n        public override bool Equals(object migrationHostErrorEvent)\n        {\n            return Equals(migrationHostErrorEvent as MigrationHostErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DstHost).GetHashCode();\n        }\n    }\n\n    public class MigrationHostWarningEvent : MigrationEvent, IEquatable<MigrationHostWarningEvent>\n    {\n        public HostEventArgument DstHost { get; set; }\n\n        public bool Equals(MigrationHostWarningEvent migrationHostWarningEvent)\n        {\n            return (migrationHostWarningEvent != null && ((this.DstHost == null && migrationHostWarningEvent.DstHost == null) || (this.DstHost != null && this.DstHost.Equals(migrationHostWarningEvent.DstHost))));\n        }\n\n        public override bool Equals(object migrationHostWarningEvent)\n        {\n            return Equals(migrationHostWarningEvent as MigrationHostWarningEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DstHost).GetHashCode();\n        }\n    }\n\n    public class MigrationNotReady : MigrationFault, IEquatable<MigrationNotReady>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(MigrationNotReady migrationNotReady)\n        {\n            return (migrationNotReady != null && this.Reason == migrationNotReady.Reason);\n        }\n\n        public override bool Equals(object migrationNotReady)\n        {\n            return Equals(migrationNotReady as MigrationNotReady);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class MigrationResourceErrorEvent : MigrationEvent, IEquatable<MigrationResourceErrorEvent>\n    {\n        public ResourcePoolEventArgument DstPool { get; set; }\n\n        public HostEventArgument DstHost { get; set; }\n\n        public bool Equals(MigrationResourceErrorEvent migrationResourceErrorEvent)\n        {\n            return (migrationResourceErrorEvent != null && ((this.DstPool == null && migrationResourceErrorEvent.DstPool == null) || (this.DstPool != null && this.DstPool.Equals(migrationResourceErrorEvent.DstPool))) && ((this.DstHost == null && migrationResourceErrorEvent.DstHost == null) || (this.DstHost != null && this.DstHost.Equals(migrationResourceErrorEvent.DstHost))));\n        }\n\n        public override bool Equals(object migrationResourceErrorEvent)\n        {\n            return Equals(migrationResourceErrorEvent as MigrationResourceErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DstPool + \"_\" + DstHost).GetHashCode();\n        }\n    }\n\n    public class MigrationResourceWarningEvent : MigrationEvent, IEquatable<MigrationResourceWarningEvent>\n    {\n        public ResourcePoolEventArgument DstPool { get; set; }\n\n        public HostEventArgument DstHost { get; set; }\n\n        public bool Equals(MigrationResourceWarningEvent migrationResourceWarningEvent)\n        {\n            return (migrationResourceWarningEvent != null && ((this.DstPool == null && migrationResourceWarningEvent.DstPool == null) || (this.DstPool != null && this.DstPool.Equals(migrationResourceWarningEvent.DstPool))) && ((this.DstHost == null && migrationResourceWarningEvent.DstHost == null) || (this.DstHost != null && this.DstHost.Equals(migrationResourceWarningEvent.DstHost))));\n        }\n\n        public override bool Equals(object migrationResourceWarningEvent)\n        {\n            return Equals(migrationResourceWarningEvent as MigrationResourceWarningEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DstPool + \"_\" + DstHost).GetHashCode();\n        }\n    }\n\n    public class MigrationWarningEvent : MigrationEvent, IEquatable<MigrationWarningEvent>\n    {\n        public bool Equals(MigrationWarningEvent migrationWarningEvent)\n        {\n            return (migrationWarningEvent != null && base.Equals(migrationWarningEvent));\n        }\n\n        public override bool Equals(object migrationWarningEvent)\n        {\n            return Equals(migrationWarningEvent as MigrationWarningEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MismatchedBundle : VimFault, IEquatable<MismatchedBundle>\n    {\n        public string BundleUuid { get; set; }\n\n        public string HostUuid { get; set; }\n\n        public int BundleBuildNumber { get; set; }\n\n        public int HostBuildNumber { get; set; }\n\n        public bool Equals(MismatchedBundle mismatchedBundle)\n        {\n            return (mismatchedBundle != null && this.BundleUuid == mismatchedBundle.BundleUuid && this.HostUuid == mismatchedBundle.HostUuid && this.BundleBuildNumber == mismatchedBundle.BundleBuildNumber && this.HostBuildNumber == mismatchedBundle.HostBuildNumber);\n        }\n\n        public override bool Equals(object mismatchedBundle)\n        {\n            return Equals(mismatchedBundle as MismatchedBundle);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BundleUuid + \"_\" + HostUuid + \"_\" + BundleBuildNumber + \"_\" + HostBuildNumber).GetHashCode();\n        }\n    }\n\n    public class MismatchedNetworkPolicies : MigrationFault, IEquatable<MismatchedNetworkPolicies>\n    {\n        public string Device { get; set; }\n\n        public string Backing { get; set; }\n\n        public bool Connected { get; set; }\n\n        public bool Equals(MismatchedNetworkPolicies mismatchedNetworkPolicies)\n        {\n            return (mismatchedNetworkPolicies != null && this.Device == mismatchedNetworkPolicies.Device && this.Backing == mismatchedNetworkPolicies.Backing && this.Connected == mismatchedNetworkPolicies.Connected);\n        }\n\n        public override bool Equals(object mismatchedNetworkPolicies)\n        {\n            return Equals(mismatchedNetworkPolicies as MismatchedNetworkPolicies);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Backing + \"_\" + Connected).GetHashCode();\n        }\n    }\n\n    public class MismatchedVMotionNetworkNames : MigrationFault, IEquatable<MismatchedVMotionNetworkNames>\n    {\n        public string SourceNetwork { get; set; }\n\n        public string DestNetwork { get; set; }\n\n        public bool Equals(MismatchedVMotionNetworkNames mismatchedVMotionNetworkNames)\n        {\n            return (mismatchedVMotionNetworkNames != null && this.SourceNetwork == mismatchedVMotionNetworkNames.SourceNetwork && this.DestNetwork == mismatchedVMotionNetworkNames.DestNetwork);\n        }\n\n        public override bool Equals(object mismatchedVMotionNetworkNames)\n        {\n            return Equals(mismatchedVMotionNetworkNames as MismatchedVMotionNetworkNames);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceNetwork + \"_\" + DestNetwork).GetHashCode();\n        }\n    }\n\n    public class MissingBmcSupport : VimFault, IEquatable<MissingBmcSupport>\n    {\n        public bool Equals(MissingBmcSupport missingBmcSupport)\n        {\n            return (missingBmcSupport != null && base.Equals(missingBmcSupport));\n        }\n\n        public override bool Equals(object missingBmcSupport)\n        {\n            return Equals(missingBmcSupport as MissingBmcSupport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingController : InvalidDeviceSpec, IEquatable<MissingController>\n    {\n        public bool Equals(MissingController missingController)\n        {\n            return (missingController != null && base.Equals(missingController));\n        }\n\n        public override bool Equals(object missingController)\n        {\n            return Equals(missingController as MissingController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingIpPool : VAppPropertyFault, IEquatable<MissingIpPool>\n    {\n        public bool Equals(MissingIpPool missingIpPool)\n        {\n            return (missingIpPool != null && base.Equals(missingIpPool));\n        }\n\n        public override bool Equals(object missingIpPool)\n        {\n            return Equals(missingIpPool as MissingIpPool);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingLinuxCustResources : CustomizationFault, IEquatable<MissingLinuxCustResources>\n    {\n        public bool Equals(MissingLinuxCustResources missingLinuxCustResources)\n        {\n            return (missingLinuxCustResources != null && base.Equals(missingLinuxCustResources));\n        }\n\n        public override bool Equals(object missingLinuxCustResources)\n        {\n            return Equals(missingLinuxCustResources as MissingLinuxCustResources);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingNetworkIpConfig : VAppPropertyFault, IEquatable<MissingNetworkIpConfig>\n    {\n        public bool Equals(MissingNetworkIpConfig missingNetworkIpConfig)\n        {\n            return (missingNetworkIpConfig != null && base.Equals(missingNetworkIpConfig));\n        }\n\n        public override bool Equals(object missingNetworkIpConfig)\n        {\n            return Equals(missingNetworkIpConfig as MissingNetworkIpConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingObject : DynamicData, IEquatable<MissingObject>\n    {\n        public ManagedObjectReference Obj { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(MissingObject missingObject)\n        {\n            return (missingObject != null && ((this.Obj == null && missingObject.Obj == null) || (this.Obj != null && this.Obj.Equals(missingObject.Obj))) && ((this.Fault == null && missingObject.Fault == null) || (this.Fault != null && this.Fault.Equals(missingObject.Fault))));\n        }\n\n        public override bool Equals(object missingObject)\n        {\n            return Equals(missingObject as MissingObject);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Obj + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class MissingPowerOffConfiguration : VAppConfigFault, IEquatable<MissingPowerOffConfiguration>\n    {\n        public bool Equals(MissingPowerOffConfiguration missingPowerOffConfiguration)\n        {\n            return (missingPowerOffConfiguration != null && base.Equals(missingPowerOffConfiguration));\n        }\n\n        public override bool Equals(object missingPowerOffConfiguration)\n        {\n            return Equals(missingPowerOffConfiguration as MissingPowerOffConfiguration);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingPowerOnConfiguration : VAppConfigFault, IEquatable<MissingPowerOnConfiguration>\n    {\n        public bool Equals(MissingPowerOnConfiguration missingPowerOnConfiguration)\n        {\n            return (missingPowerOnConfiguration != null && base.Equals(missingPowerOnConfiguration));\n        }\n\n        public override bool Equals(object missingPowerOnConfiguration)\n        {\n            return Equals(missingPowerOnConfiguration as MissingPowerOnConfiguration);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MissingProperty : DynamicData, IEquatable<MissingProperty>\n    {\n        public string Path { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(MissingProperty missingProperty)\n        {\n            return (missingProperty != null && this.Path == missingProperty.Path && ((this.Fault == null && missingProperty.Fault == null) || (this.Fault != null && this.Fault.Equals(missingProperty.Fault))));\n        }\n\n        public override bool Equals(object missingProperty)\n        {\n            return Equals(missingProperty as MissingProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class MissingWindowsCustResources : CustomizationFault, IEquatable<MissingWindowsCustResources>\n    {\n        public bool Equals(MissingWindowsCustResources missingWindowsCustResources)\n        {\n            return (missingWindowsCustResources != null && base.Equals(missingWindowsCustResources));\n        }\n\n        public override bool Equals(object missingWindowsCustResources)\n        {\n            return Equals(missingWindowsCustResources as MissingWindowsCustResources);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MksConnectionLimitReached : InvalidState, IEquatable<MksConnectionLimitReached>\n    {\n        public int ConnectionLimit { get; set; }\n\n        public bool Equals(MksConnectionLimitReached mksConnectionLimitReached)\n        {\n            return (mksConnectionLimitReached != null && this.ConnectionLimit == mksConnectionLimitReached.ConnectionLimit);\n        }\n\n        public override bool Equals(object mksConnectionLimitReached)\n        {\n            return Equals(mksConnectionLimitReached as MksConnectionLimitReached);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConnectionLimit).GetHashCode();\n        }\n    }\n\n    public class ModeInfo : DynamicData, IEquatable<ModeInfo>\n    {\n        public string Browse { get; set; }\n\n        public string Read { get; set; }\n\n        public string Modify { get; set; }\n\n        public string Use { get; set; }\n\n        public string Admin { get; set; }\n\n        public string Full { get; set; }\n\n        public bool Equals(ModeInfo modeInfo)\n        {\n            return (modeInfo != null && this.Browse == modeInfo.Browse && this.Read == modeInfo.Read && this.Modify == modeInfo.Modify && this.Use == modeInfo.Use && this.Admin == modeInfo.Admin && this.Full == modeInfo.Full);\n        }\n\n        public override bool Equals(object modeInfo)\n        {\n            return Equals(modeInfo as ModeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Browse + \"_\" + Read + \"_\" + Modify + \"_\" + Use + \"_\" + Admin + \"_\" + Full).GetHashCode();\n        }\n    }\n\n    public class MonthlyByDayTaskScheduler : MonthlyTaskScheduler, IEquatable<MonthlyByDayTaskScheduler>\n    {\n        public int Day { get; set; }\n\n        public bool Equals(MonthlyByDayTaskScheduler monthlyByDayTaskScheduler)\n        {\n            return (monthlyByDayTaskScheduler != null && this.Day == monthlyByDayTaskScheduler.Day);\n        }\n\n        public override bool Equals(object monthlyByDayTaskScheduler)\n        {\n            return Equals(monthlyByDayTaskScheduler as MonthlyByDayTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Day).GetHashCode();\n        }\n    }\n\n    public class MonthlyByWeekdayTaskScheduler : MonthlyTaskScheduler, IEquatable<MonthlyByWeekdayTaskScheduler>\n    {\n        public WeekOfMonth Offset { get; set; }\n\n        public DayOfWeek Weekday { get; set; }\n\n        public bool Equals(MonthlyByWeekdayTaskScheduler monthlyByWeekdayTaskScheduler)\n        {\n            return (monthlyByWeekdayTaskScheduler != null && this.Offset == monthlyByWeekdayTaskScheduler.Offset && this.Weekday == monthlyByWeekdayTaskScheduler.Weekday);\n        }\n\n        public override bool Equals(object monthlyByWeekdayTaskScheduler)\n        {\n            return Equals(monthlyByWeekdayTaskScheduler as MonthlyByWeekdayTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Offset + \"_\" + Weekday).GetHashCode();\n        }\n    }\n\n    public class MonthlyTaskScheduler : DailyTaskScheduler, IEquatable<MonthlyTaskScheduler>\n    {\n        public bool Equals(MonthlyTaskScheduler monthlyTaskScheduler)\n        {\n            return (monthlyTaskScheduler != null && base.Equals(monthlyTaskScheduler));\n        }\n\n        public override bool Equals(object monthlyTaskScheduler)\n        {\n            return Equals(monthlyTaskScheduler as MonthlyTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MountError : CustomizationFault, IEquatable<MountError>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public int DiskIndex { get; set; }\n\n        public MountError_LinkedView LinkedView { get; set; }\n\n        public bool Equals(MountError mountError)\n        {\n            return (mountError != null && ((this.Vm == null && mountError.Vm == null) || (this.Vm != null && this.Vm.Equals(mountError.Vm))) && this.DiskIndex == mountError.DiskIndex && ((this.LinkedView == null && mountError.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(mountError.LinkedView))));\n        }\n\n        public override bool Equals(object mountError)\n        {\n            return Equals(mountError as MountError);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + DiskIndex + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class MountError_LinkedView : IEquatable<MountError_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(MountError_LinkedView mountError_LinkedView)\n        {\n            return (mountError_LinkedView != null && ((this.Vm == null && mountError_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(mountError_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object mountError_LinkedView)\n        {\n            return Equals(mountError_LinkedView as MountError_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class MtuMatchEvent : DvsHealthStatusChangeEvent, IEquatable<MtuMatchEvent>\n    {\n        public bool Equals(MtuMatchEvent mtuMatchEvent)\n        {\n            return (mtuMatchEvent != null && base.Equals(mtuMatchEvent));\n        }\n\n        public override bool Equals(object mtuMatchEvent)\n        {\n            return Equals(mtuMatchEvent as MtuMatchEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MtuMismatchEvent : DvsHealthStatusChangeEvent, IEquatable<MtuMismatchEvent>\n    {\n        public bool Equals(MtuMismatchEvent mtuMismatchEvent)\n        {\n            return (mtuMismatchEvent != null && base.Equals(mtuMismatchEvent));\n        }\n\n        public override bool Equals(object mtuMismatchEvent)\n        {\n            return Equals(mtuMismatchEvent as MtuMismatchEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MultipleCertificatesVerifyFault : HostConnectFault, IEquatable<MultipleCertificatesVerifyFault>\n    {\n        public MultipleCertificatesVerifyFaultThumbprintData[] ThumbprintData { get; set; }\n\n        public bool Equals(MultipleCertificatesVerifyFault multipleCertificatesVerifyFault)\n        {\n            return (multipleCertificatesVerifyFault != null && ((this.ThumbprintData == null && multipleCertificatesVerifyFault.ThumbprintData == null) || (this.ThumbprintData != null && multipleCertificatesVerifyFault.ThumbprintData != null && Enumerable.SequenceEqual(this.ThumbprintData, multipleCertificatesVerifyFault.ThumbprintData))));\n        }\n\n        public override bool Equals(object multipleCertificatesVerifyFault)\n        {\n            return Equals(multipleCertificatesVerifyFault as MultipleCertificatesVerifyFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ThumbprintData).GetHashCode();\n        }\n    }\n\n    public class MultipleCertificatesVerifyFaultThumbprintData : DynamicData, IEquatable<MultipleCertificatesVerifyFaultThumbprintData>\n    {\n        public int Port { get; set; }\n\n        public string Thumbprint { get; set; }\n\n        public bool Equals(MultipleCertificatesVerifyFaultThumbprintData multipleCertificatesVerifyFaultThumbprintData)\n        {\n            return (multipleCertificatesVerifyFaultThumbprintData != null && this.Port == multipleCertificatesVerifyFaultThumbprintData.Port && this.Thumbprint == multipleCertificatesVerifyFaultThumbprintData.Thumbprint);\n        }\n\n        public override bool Equals(object multipleCertificatesVerifyFaultThumbprintData)\n        {\n            return Equals(multipleCertificatesVerifyFaultThumbprintData as MultipleCertificatesVerifyFaultThumbprintData);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Port + \"_\" + Thumbprint).GetHashCode();\n        }\n    }\n\n    public class MultipleSnapshotsNotSupported : SnapshotFault, IEquatable<MultipleSnapshotsNotSupported>\n    {\n        public bool Equals(MultipleSnapshotsNotSupported multipleSnapshotsNotSupported)\n        {\n            return (multipleSnapshotsNotSupported != null && base.Equals(multipleSnapshotsNotSupported));\n        }\n\n        public override bool Equals(object multipleSnapshotsNotSupported)\n        {\n            return Equals(multipleSnapshotsNotSupported as MultipleSnapshotsNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class MultiWriterNotSupported : DeviceNotSupported, IEquatable<MultiWriterNotSupported>\n    {\n        public bool Equals(MultiWriterNotSupported multiWriterNotSupported)\n        {\n            return (multiWriterNotSupported != null && base.Equals(multiWriterNotSupported));\n        }\n\n        public override bool Equals(object multiWriterNotSupported)\n        {\n            return Equals(multiWriterNotSupported as MultiWriterNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NamePasswordAuthentication : GuestAuthentication, IEquatable<NamePasswordAuthentication>\n    {\n        public string Username { get; set; }\n\n        public string Password { get; set; }\n\n        public bool Equals(NamePasswordAuthentication namePasswordAuthentication)\n        {\n            return (namePasswordAuthentication != null && this.Username == namePasswordAuthentication.Username && this.Password == namePasswordAuthentication.Password);\n        }\n\n        public override bool Equals(object namePasswordAuthentication)\n        {\n            return Equals(namePasswordAuthentication as NamePasswordAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Username + \"_\" + Password).GetHashCode();\n        }\n    }\n\n    public class NamespaceFull : VimFault, IEquatable<NamespaceFull>\n    {\n        public string Name { get; set; }\n\n        public long CurrentMaxSize { get; set; }\n\n        public long? RequiredSize { get; set; }\n\n        public bool Equals(NamespaceFull namespaceFull)\n        {\n            return (namespaceFull != null && this.Name == namespaceFull.Name && this.CurrentMaxSize == namespaceFull.CurrentMaxSize && ((this.RequiredSize == null && namespaceFull.RequiredSize == null) || (this.RequiredSize != null && this.RequiredSize.Equals(namespaceFull.RequiredSize))));\n        }\n\n        public override bool Equals(object namespaceFull)\n        {\n            return Equals(namespaceFull as NamespaceFull);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + CurrentMaxSize + \"_\" + RequiredSize).GetHashCode();\n        }\n    }\n\n    public class NamespaceLimitReached : VimFault, IEquatable<NamespaceLimitReached>\n    {\n        public int? Limit { get; set; }\n\n        public bool Equals(NamespaceLimitReached namespaceLimitReached)\n        {\n            return (namespaceLimitReached != null && ((this.Limit == null && namespaceLimitReached.Limit == null) || (this.Limit != null && this.Limit.Equals(namespaceLimitReached.Limit))));\n        }\n\n        public override bool Equals(object namespaceLimitReached)\n        {\n            return Equals(namespaceLimitReached as NamespaceLimitReached);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Limit).GetHashCode();\n        }\n    }\n\n    public class NamespaceWriteProtected : VimFault, IEquatable<NamespaceWriteProtected>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(NamespaceWriteProtected namespaceWriteProtected)\n        {\n            return (namespaceWriteProtected != null && this.Name == namespaceWriteProtected.Name);\n        }\n\n        public override bool Equals(object namespaceWriteProtected)\n        {\n            return Equals(namespaceWriteProtected as NamespaceWriteProtected);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class NasConfigFault : HostConfigFault, IEquatable<NasConfigFault>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(NasConfigFault nasConfigFault)\n        {\n            return (nasConfigFault != null && this.Name == nasConfigFault.Name);\n        }\n\n        public override bool Equals(object nasConfigFault)\n        {\n            return Equals(nasConfigFault as NasConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class NasConnectionLimitReached : NasConfigFault, IEquatable<NasConnectionLimitReached>\n    {\n        public string RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public bool Equals(NasConnectionLimitReached nasConnectionLimitReached)\n        {\n            return (nasConnectionLimitReached != null && this.RemoteHost == nasConnectionLimitReached.RemoteHost && this.RemotePath == nasConnectionLimitReached.RemotePath);\n        }\n\n        public override bool Equals(object nasConnectionLimitReached)\n        {\n            return Equals(nasConnectionLimitReached as NasConnectionLimitReached);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath).GetHashCode();\n        }\n    }\n\n    public class NASDatastoreCreatedEvent : HostEvent, IEquatable<NASDatastoreCreatedEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public string DatastoreUrl { get; set; }\n\n        public bool Equals(NASDatastoreCreatedEvent nASDatastoreCreatedEvent)\n        {\n            return (nASDatastoreCreatedEvent != null && ((this.Datastore == null && nASDatastoreCreatedEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(nASDatastoreCreatedEvent.Datastore))) && this.DatastoreUrl == nASDatastoreCreatedEvent.DatastoreUrl);\n        }\n\n        public override bool Equals(object nASDatastoreCreatedEvent)\n        {\n            return Equals(nASDatastoreCreatedEvent as NASDatastoreCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + DatastoreUrl).GetHashCode();\n        }\n    }\n\n    public class NasDatastoreInfo : DatastoreInfo, IEquatable<NasDatastoreInfo>\n    {\n        public HostNasVolume Nas { get; set; }\n\n        public bool Equals(NasDatastoreInfo nasDatastoreInfo)\n        {\n            return (nasDatastoreInfo != null && ((this.Nas == null && nasDatastoreInfo.Nas == null) || (this.Nas != null && this.Nas.Equals(nasDatastoreInfo.Nas))));\n        }\n\n        public override bool Equals(object nasDatastoreInfo)\n        {\n            return Equals(nasDatastoreInfo as NasDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Nas).GetHashCode();\n        }\n    }\n\n    public class NasSessionCredentialConflict : NasConfigFault, IEquatable<NasSessionCredentialConflict>\n    {\n        public string RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public string UserName { get; set; }\n\n        public bool Equals(NasSessionCredentialConflict nasSessionCredentialConflict)\n        {\n            return (nasSessionCredentialConflict != null && this.RemoteHost == nasSessionCredentialConflict.RemoteHost && this.RemotePath == nasSessionCredentialConflict.RemotePath && this.UserName == nasSessionCredentialConflict.UserName);\n        }\n\n        public override bool Equals(object nasSessionCredentialConflict)\n        {\n            return Equals(nasSessionCredentialConflict as NasSessionCredentialConflict);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath + \"_\" + UserName).GetHashCode();\n        }\n    }\n\n    public class NasStorageProfile : ApplyProfile, IEquatable<NasStorageProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(NasStorageProfile nasStorageProfile)\n        {\n            return (nasStorageProfile != null && this.Key == nasStorageProfile.Key);\n        }\n\n        public override bool Equals(object nasStorageProfile)\n        {\n            return Equals(nasStorageProfile as NasStorageProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class NasVolumeNotMounted : NasConfigFault, IEquatable<NasVolumeNotMounted>\n    {\n        public string RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public bool Equals(NasVolumeNotMounted nasVolumeNotMounted)\n        {\n            return (nasVolumeNotMounted != null && this.RemoteHost == nasVolumeNotMounted.RemoteHost && this.RemotePath == nasVolumeNotMounted.RemotePath);\n        }\n\n        public override bool Equals(object nasVolumeNotMounted)\n        {\n            return Equals(nasVolumeNotMounted as NasVolumeNotMounted);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath).GetHashCode();\n        }\n    }\n\n    public class NegatableExpression : DynamicData, IEquatable<NegatableExpression>\n    {\n        public bool? Negate { get; set; }\n\n        public bool Equals(NegatableExpression negatableExpression)\n        {\n            return (negatableExpression != null && ((this.Negate == null && negatableExpression.Negate == null) || (this.Negate != null && this.Negate.Equals(negatableExpression.Negate))));\n        }\n\n        public override bool Equals(object negatableExpression)\n        {\n            return Equals(negatableExpression as NegatableExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Negate).GetHashCode();\n        }\n    }\n\n    public class NetBIOSConfigInfo : DynamicData, IEquatable<NetBIOSConfigInfo>\n    {\n        public string Mode { get; set; }\n\n        public bool Equals(NetBIOSConfigInfo netBIOSConfigInfo)\n        {\n            return (netBIOSConfigInfo != null && this.Mode == netBIOSConfigInfo.Mode);\n        }\n\n        public override bool Equals(object netBIOSConfigInfo)\n        {\n            return Equals(netBIOSConfigInfo as NetBIOSConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Mode).GetHashCode();\n        }\n    }\n\n    public class NetDhcpConfigInfo : DynamicData, IEquatable<NetDhcpConfigInfo>\n    {\n        public NetDhcpConfigInfoDhcpOptions Ipv6 { get; set; }\n\n        public NetDhcpConfigInfoDhcpOptions Ipv4 { get; set; }\n\n        public bool Equals(NetDhcpConfigInfo netDhcpConfigInfo)\n        {\n            return (netDhcpConfigInfo != null && ((this.Ipv6 == null && netDhcpConfigInfo.Ipv6 == null) || (this.Ipv6 != null && this.Ipv6.Equals(netDhcpConfigInfo.Ipv6))) && ((this.Ipv4 == null && netDhcpConfigInfo.Ipv4 == null) || (this.Ipv4 != null && this.Ipv4.Equals(netDhcpConfigInfo.Ipv4))));\n        }\n\n        public override bool Equals(object netDhcpConfigInfo)\n        {\n            return Equals(netDhcpConfigInfo as NetDhcpConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ipv6 + \"_\" + Ipv4).GetHashCode();\n        }\n    }\n\n    public class NetDhcpConfigInfoDhcpOptions : DynamicData, IEquatable<NetDhcpConfigInfoDhcpOptions>\n    {\n        public bool Enable { get; set; }\n\n        public KeyValue[] Config { get; set; }\n\n        public bool Equals(NetDhcpConfigInfoDhcpOptions netDhcpConfigInfoDhcpOptions)\n        {\n            return (netDhcpConfigInfoDhcpOptions != null && this.Enable == netDhcpConfigInfoDhcpOptions.Enable && ((this.Config == null && netDhcpConfigInfoDhcpOptions.Config == null) || (this.Config != null && netDhcpConfigInfoDhcpOptions.Config != null && Enumerable.SequenceEqual(this.Config, netDhcpConfigInfoDhcpOptions.Config))));\n        }\n\n        public override bool Equals(object netDhcpConfigInfoDhcpOptions)\n        {\n            return Equals(netDhcpConfigInfoDhcpOptions as NetDhcpConfigInfoDhcpOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enable + \"_\" + Config).GetHashCode();\n        }\n    }\n\n    public class NetDhcpConfigSpec : DynamicData, IEquatable<NetDhcpConfigSpec>\n    {\n        public NetDhcpConfigSpecDhcpOptionsSpec Ipv6 { get; set; }\n\n        public NetDhcpConfigSpecDhcpOptionsSpec Ipv4 { get; set; }\n\n        public bool Equals(NetDhcpConfigSpec netDhcpConfigSpec)\n        {\n            return (netDhcpConfigSpec != null && ((this.Ipv6 == null && netDhcpConfigSpec.Ipv6 == null) || (this.Ipv6 != null && this.Ipv6.Equals(netDhcpConfigSpec.Ipv6))) && ((this.Ipv4 == null && netDhcpConfigSpec.Ipv4 == null) || (this.Ipv4 != null && this.Ipv4.Equals(netDhcpConfigSpec.Ipv4))));\n        }\n\n        public override bool Equals(object netDhcpConfigSpec)\n        {\n            return Equals(netDhcpConfigSpec as NetDhcpConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ipv6 + \"_\" + Ipv4).GetHashCode();\n        }\n    }\n\n    public class NetDhcpConfigSpecDhcpOptionsSpec : DynamicData, IEquatable<NetDhcpConfigSpecDhcpOptionsSpec>\n    {\n        public bool? Enable { get; set; }\n\n        public KeyValue[] Config { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(NetDhcpConfigSpecDhcpOptionsSpec netDhcpConfigSpecDhcpOptionsSpec)\n        {\n            return (netDhcpConfigSpecDhcpOptionsSpec != null && ((this.Enable == null && netDhcpConfigSpecDhcpOptionsSpec.Enable == null) || (this.Enable != null && this.Enable.Equals(netDhcpConfigSpecDhcpOptionsSpec.Enable))) && ((this.Config == null && netDhcpConfigSpecDhcpOptionsSpec.Config == null) || (this.Config != null && netDhcpConfigSpecDhcpOptionsSpec.Config != null && Enumerable.SequenceEqual(this.Config, netDhcpConfigSpecDhcpOptionsSpec.Config))) && this.Operation == netDhcpConfigSpecDhcpOptionsSpec.Operation);\n        }\n\n        public override bool Equals(object netDhcpConfigSpecDhcpOptionsSpec)\n        {\n            return Equals(netDhcpConfigSpecDhcpOptionsSpec as NetDhcpConfigSpecDhcpOptionsSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enable + \"_\" + Config + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class NetDnsConfigInfo : DynamicData, IEquatable<NetDnsConfigInfo>\n    {\n        public bool Dhcp { get; set; }\n\n        public string HostName { get; set; }\n\n        public string DomainName { get; set; }\n\n        public string[] IpAddress { get; set; }\n\n        public string[] SearchDomain { get; set; }\n\n        public bool Equals(NetDnsConfigInfo netDnsConfigInfo)\n        {\n            return (netDnsConfigInfo != null && this.Dhcp == netDnsConfigInfo.Dhcp && this.HostName == netDnsConfigInfo.HostName && this.DomainName == netDnsConfigInfo.DomainName && ((this.IpAddress == null && netDnsConfigInfo.IpAddress == null) || (this.IpAddress != null && netDnsConfigInfo.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, netDnsConfigInfo.IpAddress))) && ((this.SearchDomain == null && netDnsConfigInfo.SearchDomain == null) || (this.SearchDomain != null && netDnsConfigInfo.SearchDomain != null && Enumerable.SequenceEqual(this.SearchDomain, netDnsConfigInfo.SearchDomain))));\n        }\n\n        public override bool Equals(object netDnsConfigInfo)\n        {\n            return Equals(netDnsConfigInfo as NetDnsConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Dhcp + \"_\" + HostName + \"_\" + DomainName + \"_\" + IpAddress + \"_\" + SearchDomain).GetHashCode();\n        }\n    }\n\n    public class NetDnsConfigSpec : DynamicData, IEquatable<NetDnsConfigSpec>\n    {\n        public bool? Dhcp { get; set; }\n\n        public string HostName { get; set; }\n\n        public string DomainName { get; set; }\n\n        public string[] IpAddress { get; set; }\n\n        public string[] SearchDomain { get; set; }\n\n        public bool Equals(NetDnsConfigSpec netDnsConfigSpec)\n        {\n            return (netDnsConfigSpec != null && ((this.Dhcp == null && netDnsConfigSpec.Dhcp == null) || (this.Dhcp != null && this.Dhcp.Equals(netDnsConfigSpec.Dhcp))) && this.HostName == netDnsConfigSpec.HostName && this.DomainName == netDnsConfigSpec.DomainName && ((this.IpAddress == null && netDnsConfigSpec.IpAddress == null) || (this.IpAddress != null && netDnsConfigSpec.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, netDnsConfigSpec.IpAddress))) && ((this.SearchDomain == null && netDnsConfigSpec.SearchDomain == null) || (this.SearchDomain != null && netDnsConfigSpec.SearchDomain != null && Enumerable.SequenceEqual(this.SearchDomain, netDnsConfigSpec.SearchDomain))));\n        }\n\n        public override bool Equals(object netDnsConfigSpec)\n        {\n            return Equals(netDnsConfigSpec as NetDnsConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Dhcp + \"_\" + HostName + \"_\" + DomainName + \"_\" + IpAddress + \"_\" + SearchDomain).GetHashCode();\n        }\n    }\n\n    public class NetIpConfigInfo : DynamicData, IEquatable<NetIpConfigInfo>\n    {\n        public NetIpConfigInfoIpAddress[] IpAddress { get; set; }\n\n        public NetDhcpConfigInfo Dhcp { get; set; }\n\n        public bool? AutoConfigurationEnabled { get; set; }\n\n        public bool Equals(NetIpConfigInfo netIpConfigInfo)\n        {\n            return (netIpConfigInfo != null && ((this.IpAddress == null && netIpConfigInfo.IpAddress == null) || (this.IpAddress != null && netIpConfigInfo.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, netIpConfigInfo.IpAddress))) && ((this.Dhcp == null && netIpConfigInfo.Dhcp == null) || (this.Dhcp != null && this.Dhcp.Equals(netIpConfigInfo.Dhcp))) && ((this.AutoConfigurationEnabled == null && netIpConfigInfo.AutoConfigurationEnabled == null) || (this.AutoConfigurationEnabled != null && this.AutoConfigurationEnabled.Equals(netIpConfigInfo.AutoConfigurationEnabled))));\n        }\n\n        public override bool Equals(object netIpConfigInfo)\n        {\n            return Equals(netIpConfigInfo as NetIpConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + Dhcp + \"_\" + AutoConfigurationEnabled).GetHashCode();\n        }\n    }\n\n    public class NetIpConfigInfoIpAddress : DynamicData, IEquatable<NetIpConfigInfoIpAddress>\n    {\n        public string IpAddress { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public string Origin { get; set; }\n\n        public string State { get; set; }\n\n        public DateTime? Lifetime { get; set; }\n\n        public bool Equals(NetIpConfigInfoIpAddress netIpConfigInfoIpAddress)\n        {\n            return (netIpConfigInfoIpAddress != null && this.IpAddress == netIpConfigInfoIpAddress.IpAddress && this.PrefixLength == netIpConfigInfoIpAddress.PrefixLength && this.Origin == netIpConfigInfoIpAddress.Origin && this.State == netIpConfigInfoIpAddress.State && ((this.Lifetime == null && netIpConfigInfoIpAddress.Lifetime == null) || (this.Lifetime != null && this.Lifetime.Equals(netIpConfigInfoIpAddress.Lifetime))));\n        }\n\n        public override bool Equals(object netIpConfigInfoIpAddress)\n        {\n            return Equals(netIpConfigInfoIpAddress as NetIpConfigInfoIpAddress);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + PrefixLength + \"_\" + Origin + \"_\" + State + \"_\" + Lifetime).GetHashCode();\n        }\n    }\n\n    public class NetIpConfigSpec : DynamicData, IEquatable<NetIpConfigSpec>\n    {\n        public NetIpConfigSpecIpAddressSpec[] IpAddress { get; set; }\n\n        public NetDhcpConfigSpec Dhcp { get; set; }\n\n        public bool? AutoConfigurationEnabled { get; set; }\n\n        public bool Equals(NetIpConfigSpec netIpConfigSpec)\n        {\n            return (netIpConfigSpec != null && ((this.IpAddress == null && netIpConfigSpec.IpAddress == null) || (this.IpAddress != null && netIpConfigSpec.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, netIpConfigSpec.IpAddress))) && ((this.Dhcp == null && netIpConfigSpec.Dhcp == null) || (this.Dhcp != null && this.Dhcp.Equals(netIpConfigSpec.Dhcp))) && ((this.AutoConfigurationEnabled == null && netIpConfigSpec.AutoConfigurationEnabled == null) || (this.AutoConfigurationEnabled != null && this.AutoConfigurationEnabled.Equals(netIpConfigSpec.AutoConfigurationEnabled))));\n        }\n\n        public override bool Equals(object netIpConfigSpec)\n        {\n            return Equals(netIpConfigSpec as NetIpConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + Dhcp + \"_\" + AutoConfigurationEnabled).GetHashCode();\n        }\n    }\n\n    public class NetIpConfigSpecIpAddressSpec : DynamicData, IEquatable<NetIpConfigSpecIpAddressSpec>\n    {\n        public string IpAddress { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(NetIpConfigSpecIpAddressSpec netIpConfigSpecIpAddressSpec)\n        {\n            return (netIpConfigSpecIpAddressSpec != null && this.IpAddress == netIpConfigSpecIpAddressSpec.IpAddress && this.PrefixLength == netIpConfigSpecIpAddressSpec.PrefixLength && this.Operation == netIpConfigSpecIpAddressSpec.Operation);\n        }\n\n        public override bool Equals(object netIpConfigSpecIpAddressSpec)\n        {\n            return Equals(netIpConfigSpecIpAddressSpec as NetIpConfigSpecIpAddressSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + PrefixLength + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class NetIpRouteConfigInfo : DynamicData, IEquatable<NetIpRouteConfigInfo>\n    {\n        public NetIpRouteConfigInfoIpRoute[] IpRoute { get; set; }\n\n        public bool Equals(NetIpRouteConfigInfo netIpRouteConfigInfo)\n        {\n            return (netIpRouteConfigInfo != null && ((this.IpRoute == null && netIpRouteConfigInfo.IpRoute == null) || (this.IpRoute != null && netIpRouteConfigInfo.IpRoute != null && Enumerable.SequenceEqual(this.IpRoute, netIpRouteConfigInfo.IpRoute))));\n        }\n\n        public override bool Equals(object netIpRouteConfigInfo)\n        {\n            return Equals(netIpRouteConfigInfo as NetIpRouteConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpRoute).GetHashCode();\n        }\n    }\n\n    public class NetIpRouteConfigInfoGateway : DynamicData, IEquatable<NetIpRouteConfigInfoGateway>\n    {\n        public string IpAddress { get; set; }\n\n        public string Device { get; set; }\n\n        public bool Equals(NetIpRouteConfigInfoGateway netIpRouteConfigInfoGateway)\n        {\n            return (netIpRouteConfigInfoGateway != null && this.IpAddress == netIpRouteConfigInfoGateway.IpAddress && this.Device == netIpRouteConfigInfoGateway.Device);\n        }\n\n        public override bool Equals(object netIpRouteConfigInfoGateway)\n        {\n            return Equals(netIpRouteConfigInfoGateway as NetIpRouteConfigInfoGateway);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class NetIpRouteConfigInfoIpRoute : DynamicData, IEquatable<NetIpRouteConfigInfoIpRoute>\n    {\n        public string Network { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public NetIpRouteConfigInfoGateway Gateway { get; set; }\n\n        public bool Equals(NetIpRouteConfigInfoIpRoute netIpRouteConfigInfoIpRoute)\n        {\n            return (netIpRouteConfigInfoIpRoute != null && this.Network == netIpRouteConfigInfoIpRoute.Network && this.PrefixLength == netIpRouteConfigInfoIpRoute.PrefixLength && ((this.Gateway == null && netIpRouteConfigInfoIpRoute.Gateway == null) || (this.Gateway != null && this.Gateway.Equals(netIpRouteConfigInfoIpRoute.Gateway))));\n        }\n\n        public override bool Equals(object netIpRouteConfigInfoIpRoute)\n        {\n            return Equals(netIpRouteConfigInfoIpRoute as NetIpRouteConfigInfoIpRoute);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + PrefixLength + \"_\" + Gateway).GetHashCode();\n        }\n    }\n\n    public class NetIpRouteConfigSpec : DynamicData, IEquatable<NetIpRouteConfigSpec>\n    {\n        public NetIpRouteConfigSpecIpRouteSpec[] IpRoute { get; set; }\n\n        public bool Equals(NetIpRouteConfigSpec netIpRouteConfigSpec)\n        {\n            return (netIpRouteConfigSpec != null && ((this.IpRoute == null && netIpRouteConfigSpec.IpRoute == null) || (this.IpRoute != null && netIpRouteConfigSpec.IpRoute != null && Enumerable.SequenceEqual(this.IpRoute, netIpRouteConfigSpec.IpRoute))));\n        }\n\n        public override bool Equals(object netIpRouteConfigSpec)\n        {\n            return Equals(netIpRouteConfigSpec as NetIpRouteConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpRoute).GetHashCode();\n        }\n    }\n\n    public class NetIpRouteConfigSpecGatewaySpec : DynamicData, IEquatable<NetIpRouteConfigSpecGatewaySpec>\n    {\n        public string IpAddress { get; set; }\n\n        public string Device { get; set; }\n\n        public bool Equals(NetIpRouteConfigSpecGatewaySpec netIpRouteConfigSpecGatewaySpec)\n        {\n            return (netIpRouteConfigSpecGatewaySpec != null && this.IpAddress == netIpRouteConfigSpecGatewaySpec.IpAddress && this.Device == netIpRouteConfigSpecGatewaySpec.Device);\n        }\n\n        public override bool Equals(object netIpRouteConfigSpecGatewaySpec)\n        {\n            return Equals(netIpRouteConfigSpecGatewaySpec as NetIpRouteConfigSpecGatewaySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class NetIpRouteConfigSpecIpRouteSpec : DynamicData, IEquatable<NetIpRouteConfigSpecIpRouteSpec>\n    {\n        public string Network { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public NetIpRouteConfigSpecGatewaySpec Gateway { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(NetIpRouteConfigSpecIpRouteSpec netIpRouteConfigSpecIpRouteSpec)\n        {\n            return (netIpRouteConfigSpecIpRouteSpec != null && this.Network == netIpRouteConfigSpecIpRouteSpec.Network && this.PrefixLength == netIpRouteConfigSpecIpRouteSpec.PrefixLength && ((this.Gateway == null && netIpRouteConfigSpecIpRouteSpec.Gateway == null) || (this.Gateway != null && this.Gateway.Equals(netIpRouteConfigSpecIpRouteSpec.Gateway))) && this.Operation == netIpRouteConfigSpecIpRouteSpec.Operation);\n        }\n\n        public override bool Equals(object netIpRouteConfigSpecIpRouteSpec)\n        {\n            return Equals(netIpRouteConfigSpecIpRouteSpec as NetIpRouteConfigSpecIpRouteSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + PrefixLength + \"_\" + Gateway + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class NetIpStackInfo : DynamicData, IEquatable<NetIpStackInfo>\n    {\n        public NetIpStackInfoNetToMedia[] Neighbor { get; set; }\n\n        public NetIpStackInfoDefaultRouter[] DefaultRouter { get; set; }\n\n        public bool Equals(NetIpStackInfo netIpStackInfo)\n        {\n            return (netIpStackInfo != null && ((this.Neighbor == null && netIpStackInfo.Neighbor == null) || (this.Neighbor != null && netIpStackInfo.Neighbor != null && Enumerable.SequenceEqual(this.Neighbor, netIpStackInfo.Neighbor))) && ((this.DefaultRouter == null && netIpStackInfo.DefaultRouter == null) || (this.DefaultRouter != null && netIpStackInfo.DefaultRouter != null && Enumerable.SequenceEqual(this.DefaultRouter, netIpStackInfo.DefaultRouter))));\n        }\n\n        public override bool Equals(object netIpStackInfo)\n        {\n            return Equals(netIpStackInfo as NetIpStackInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Neighbor + \"_\" + DefaultRouter).GetHashCode();\n        }\n    }\n\n    public class NetIpStackInfoDefaultRouter : DynamicData, IEquatable<NetIpStackInfoDefaultRouter>\n    {\n        public string IpAddress { get; set; }\n\n        public string Device { get; set; }\n\n        public DateTime Lifetime { get; set; }\n\n        public string Preference { get; set; }\n\n        public bool Equals(NetIpStackInfoDefaultRouter netIpStackInfoDefaultRouter)\n        {\n            return (netIpStackInfoDefaultRouter != null && this.IpAddress == netIpStackInfoDefaultRouter.IpAddress && this.Device == netIpStackInfoDefaultRouter.Device && this.Lifetime == netIpStackInfoDefaultRouter.Lifetime && this.Preference == netIpStackInfoDefaultRouter.Preference);\n        }\n\n        public override bool Equals(object netIpStackInfoDefaultRouter)\n        {\n            return Equals(netIpStackInfoDefaultRouter as NetIpStackInfoDefaultRouter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + Device + \"_\" + Lifetime + \"_\" + Preference).GetHashCode();\n        }\n    }\n\n    public class NetIpStackInfoNetToMedia : DynamicData, IEquatable<NetIpStackInfoNetToMedia>\n    {\n        public string IpAddress { get; set; }\n\n        public string PhysicalAddress { get; set; }\n\n        public string Device { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(NetIpStackInfoNetToMedia netIpStackInfoNetToMedia)\n        {\n            return (netIpStackInfoNetToMedia != null && this.IpAddress == netIpStackInfoNetToMedia.IpAddress && this.PhysicalAddress == netIpStackInfoNetToMedia.PhysicalAddress && this.Device == netIpStackInfoNetToMedia.Device && this.Type == netIpStackInfoNetToMedia.Type);\n        }\n\n        public override bool Equals(object netIpStackInfoNetToMedia)\n        {\n            return Equals(netIpStackInfoNetToMedia as NetIpStackInfoNetToMedia);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + PhysicalAddress + \"_\" + Device + \"_\" + Type).GetHashCode();\n        }\n    }\n\n    public class NetStackInstanceProfile : ApplyProfile, IEquatable<NetStackInstanceProfile>\n    {\n        public string Key { get; set; }\n\n        public NetworkProfileDnsConfigProfile DnsConfig { get; set; }\n\n        public IpRouteProfile IpRouteConfig { get; set; }\n\n        public bool Equals(NetStackInstanceProfile netStackInstanceProfile)\n        {\n            return (netStackInstanceProfile != null && this.Key == netStackInstanceProfile.Key && ((this.DnsConfig == null && netStackInstanceProfile.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(netStackInstanceProfile.DnsConfig))) && ((this.IpRouteConfig == null && netStackInstanceProfile.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(netStackInstanceProfile.IpRouteConfig))));\n        }\n\n        public override bool Equals(object netStackInstanceProfile)\n        {\n            return Equals(netStackInstanceProfile as NetStackInstanceProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + DnsConfig + \"_\" + IpRouteConfig).GetHashCode();\n        }\n    }\n\n    public class Network : ManagedEntity, IEquatable<Network>\n    {\n        public new string Name { get; set; }\n\n        public NetworkSummary Summary { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public new Network_LinkedView LinkedView { get; set; }\n\n        public void DestroyNetwork()\n        {\n        }\n\n        public bool Equals(Network network)\n        {\n            return (network != null && this.Name == network.Name && ((this.Summary == null && network.Summary == null) || (this.Summary != null && this.Summary.Equals(network.Summary))) && ((this.Host == null && network.Host == null) || (this.Host != null && network.Host != null && Enumerable.SequenceEqual(this.Host, network.Host))) && ((this.Vm == null && network.Vm == null) || (this.Vm != null && network.Vm != null && Enumerable.SequenceEqual(this.Vm, network.Vm))) && ((this.LinkedView == null && network.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(network.LinkedView))));\n        }\n\n        public override bool Equals(object network)\n        {\n            return Equals(network as Network);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Summary + \"_\" + Host + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class Network_LinkedView : ManagedEntity_LinkedView, IEquatable<Network_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(Network_LinkedView network_LinkedView)\n        {\n            return (network_LinkedView != null && ((this.Host == null && network_LinkedView.Host == null) || (this.Host != null && network_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, network_LinkedView.Host))) && ((this.Vm == null && network_LinkedView.Vm == null) || (this.Vm != null && network_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, network_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object network_LinkedView)\n        {\n            return Equals(network_LinkedView as Network_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Vm).GetHashCode();\n        }\n    }\n\n    public class NetworkCopyFault : FileFault, IEquatable<NetworkCopyFault>\n    {\n        public bool Equals(NetworkCopyFault networkCopyFault)\n        {\n            return (networkCopyFault != null && base.Equals(networkCopyFault));\n        }\n\n        public override bool Equals(object networkCopyFault)\n        {\n            return Equals(networkCopyFault as NetworkCopyFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NetworkDisruptedAndConfigRolledBack : VimFault, IEquatable<NetworkDisruptedAndConfigRolledBack>\n    {\n        public string Host { get; set; }\n\n        public bool Equals(NetworkDisruptedAndConfigRolledBack networkDisruptedAndConfigRolledBack)\n        {\n            return (networkDisruptedAndConfigRolledBack != null && this.Host == networkDisruptedAndConfigRolledBack.Host);\n        }\n\n        public override bool Equals(object networkDisruptedAndConfigRolledBack)\n        {\n            return Equals(networkDisruptedAndConfigRolledBack as NetworkDisruptedAndConfigRolledBack);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class NetworkEventArgument : EntityEventArgument, IEquatable<NetworkEventArgument>\n    {\n        public ManagedObjectReference Network { get; set; }\n\n        public NetworkEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NetworkEventArgument networkEventArgument)\n        {\n            return (networkEventArgument != null && ((this.Network == null && networkEventArgument.Network == null) || (this.Network != null && this.Network.Equals(networkEventArgument.Network))) && ((this.LinkedView == null && networkEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(networkEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object networkEventArgument)\n        {\n            return Equals(networkEventArgument as NetworkEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NetworkEventArgument_LinkedView : IEquatable<NetworkEventArgument_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(NetworkEventArgument_LinkedView networkEventArgument_LinkedView)\n        {\n            return (networkEventArgument_LinkedView != null && ((this.Network == null && networkEventArgument_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(networkEventArgument_LinkedView.Network))));\n        }\n\n        public override bool Equals(object networkEventArgument_LinkedView)\n        {\n            return Equals(networkEventArgument_LinkedView as NetworkEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class NetworkInaccessible : NasConfigFault, IEquatable<NetworkInaccessible>\n    {\n        public bool Equals(NetworkInaccessible networkInaccessible)\n        {\n            return (networkInaccessible != null && base.Equals(networkInaccessible));\n        }\n\n        public override bool Equals(object networkInaccessible)\n        {\n            return Equals(networkInaccessible as NetworkInaccessible);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NetworkPolicyProfile : ApplyProfile, IEquatable<NetworkPolicyProfile>\n    {\n        public bool Equals(NetworkPolicyProfile networkPolicyProfile)\n        {\n            return (networkPolicyProfile != null && base.Equals(networkPolicyProfile));\n        }\n\n        public override bool Equals(object networkPolicyProfile)\n        {\n            return Equals(networkPolicyProfile as NetworkPolicyProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NetworkProfile : ApplyProfile, IEquatable<NetworkProfile>\n    {\n        public VirtualSwitchProfile[] Vswitch { get; set; }\n\n        public VmPortGroupProfile[] VmPortGroup { get; set; }\n\n        public HostPortGroupProfile[] HostPortGroup { get; set; }\n\n        public ServiceConsolePortGroupProfile[] ServiceConsolePortGroup { get; set; }\n\n        public NetworkProfileDnsConfigProfile DnsConfig { get; set; }\n\n        public IpRouteProfile IpRouteConfig { get; set; }\n\n        public IpRouteProfile ConsoleIpRouteConfig { get; set; }\n\n        public PhysicalNicProfile[] Pnic { get; set; }\n\n        public DvsProfile[] Dvswitch { get; set; }\n\n        public DvsServiceConsoleVNicProfile[] DvsServiceConsoleNic { get; set; }\n\n        public DvsHostVNicProfile[] DvsHostNic { get; set; }\n\n        public NsxHostVNicProfile[] NsxHostNic { get; set; }\n\n        public NetStackInstanceProfile[] NetStackInstance { get; set; }\n\n        public bool Equals(NetworkProfile networkProfile)\n        {\n            return (networkProfile != null && ((this.Vswitch == null && networkProfile.Vswitch == null) || (this.Vswitch != null && networkProfile.Vswitch != null && Enumerable.SequenceEqual(this.Vswitch, networkProfile.Vswitch))) && ((this.VmPortGroup == null && networkProfile.VmPortGroup == null) || (this.VmPortGroup != null && networkProfile.VmPortGroup != null && Enumerable.SequenceEqual(this.VmPortGroup, networkProfile.VmPortGroup))) && ((this.HostPortGroup == null && networkProfile.HostPortGroup == null) || (this.HostPortGroup != null && networkProfile.HostPortGroup != null && Enumerable.SequenceEqual(this.HostPortGroup, networkProfile.HostPortGroup))) && ((this.ServiceConsolePortGroup == null && networkProfile.ServiceConsolePortGroup == null) || (this.ServiceConsolePortGroup != null && networkProfile.ServiceConsolePortGroup != null && Enumerable.SequenceEqual(this.ServiceConsolePortGroup, networkProfile.ServiceConsolePortGroup))) && ((this.DnsConfig == null && networkProfile.DnsConfig == null) || (this.DnsConfig != null && this.DnsConfig.Equals(networkProfile.DnsConfig))) && ((this.IpRouteConfig == null && networkProfile.IpRouteConfig == null) || (this.IpRouteConfig != null && this.IpRouteConfig.Equals(networkProfile.IpRouteConfig))) && ((this.ConsoleIpRouteConfig == null && networkProfile.ConsoleIpRouteConfig == null) || (this.ConsoleIpRouteConfig != null && this.ConsoleIpRouteConfig.Equals(networkProfile.ConsoleIpRouteConfig))) && ((this.Pnic == null && networkProfile.Pnic == null) || (this.Pnic != null && networkProfile.Pnic != null && Enumerable.SequenceEqual(this.Pnic, networkProfile.Pnic))) && ((this.Dvswitch == null && networkProfile.Dvswitch == null) || (this.Dvswitch != null && networkProfile.Dvswitch != null && Enumerable.SequenceEqual(this.Dvswitch, networkProfile.Dvswitch))) && ((this.DvsServiceConsoleNic == null && networkProfile.DvsServiceConsoleNic == null) || (this.DvsServiceConsoleNic != null && networkProfile.DvsServiceConsoleNic != null && Enumerable.SequenceEqual(this.DvsServiceConsoleNic, networkProfile.DvsServiceConsoleNic))) && ((this.DvsHostNic == null && networkProfile.DvsHostNic == null) || (this.DvsHostNic != null && networkProfile.DvsHostNic != null && Enumerable.SequenceEqual(this.DvsHostNic, networkProfile.DvsHostNic))) && ((this.NsxHostNic == null && networkProfile.NsxHostNic == null) || (this.NsxHostNic != null && networkProfile.NsxHostNic != null && Enumerable.SequenceEqual(this.NsxHostNic, networkProfile.NsxHostNic))) && ((this.NetStackInstance == null && networkProfile.NetStackInstance == null) || (this.NetStackInstance != null && networkProfile.NetStackInstance != null && Enumerable.SequenceEqual(this.NetStackInstance, networkProfile.NetStackInstance))));\n        }\n\n        public override bool Equals(object networkProfile)\n        {\n            return Equals(networkProfile as NetworkProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vswitch + \"_\" + VmPortGroup + \"_\" + HostPortGroup + \"_\" + ServiceConsolePortGroup + \"_\" + DnsConfig + \"_\" + IpRouteConfig + \"_\" + ConsoleIpRouteConfig + \"_\" + Pnic + \"_\" + Dvswitch + \"_\" + DvsServiceConsoleNic + \"_\" + DvsHostNic + \"_\" + NsxHostNic + \"_\" + NetStackInstance).GetHashCode();\n        }\n    }\n\n    public class NetworkProfileDnsConfigProfile : ApplyProfile, IEquatable<NetworkProfileDnsConfigProfile>\n    {\n        public bool Equals(NetworkProfileDnsConfigProfile networkProfileDnsConfigProfile)\n        {\n            return (networkProfileDnsConfigProfile != null && base.Equals(networkProfileDnsConfigProfile));\n        }\n\n        public override bool Equals(object networkProfileDnsConfigProfile)\n        {\n            return Equals(networkProfileDnsConfigProfile as NetworkProfileDnsConfigProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NetworkRollbackEvent : Event, IEquatable<NetworkRollbackEvent>\n    {\n        public string MethodName { get; set; }\n\n        public string TransactionId { get; set; }\n\n        public bool Equals(NetworkRollbackEvent networkRollbackEvent)\n        {\n            return (networkRollbackEvent != null && this.MethodName == networkRollbackEvent.MethodName && this.TransactionId == networkRollbackEvent.TransactionId);\n        }\n\n        public override bool Equals(object networkRollbackEvent)\n        {\n            return Equals(networkRollbackEvent as NetworkRollbackEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MethodName + \"_\" + TransactionId).GetHashCode();\n        }\n    }\n\n    public class NetworksMayNotBeTheSame : MigrationFault, IEquatable<NetworksMayNotBeTheSame>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(NetworksMayNotBeTheSame networksMayNotBeTheSame)\n        {\n            return (networksMayNotBeTheSame != null && this.Name == networksMayNotBeTheSame.Name);\n        }\n\n        public override bool Equals(object networksMayNotBeTheSame)\n        {\n            return Equals(networksMayNotBeTheSame as NetworksMayNotBeTheSame);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class NetworkSummary : DynamicData, IEquatable<NetworkSummary>\n    {\n        public ManagedObjectReference Network { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Accessible { get; set; }\n\n        public string IpPoolName { get; set; }\n\n        public int? IpPoolId { get; set; }\n\n        public NetworkSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NetworkSummary networkSummary)\n        {\n            return (networkSummary != null && ((this.Network == null && networkSummary.Network == null) || (this.Network != null && this.Network.Equals(networkSummary.Network))) && this.Name == networkSummary.Name && this.Accessible == networkSummary.Accessible && this.IpPoolName == networkSummary.IpPoolName && ((this.IpPoolId == null && networkSummary.IpPoolId == null) || (this.IpPoolId != null && this.IpPoolId.Equals(networkSummary.IpPoolId))) && ((this.LinkedView == null && networkSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(networkSummary.LinkedView))));\n        }\n\n        public override bool Equals(object networkSummary)\n        {\n            return Equals(networkSummary as NetworkSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + Name + \"_\" + Accessible + \"_\" + IpPoolName + \"_\" + IpPoolId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NetworkSummary_LinkedView : IEquatable<NetworkSummary_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(NetworkSummary_LinkedView networkSummary_LinkedView)\n        {\n            return (networkSummary_LinkedView != null && ((this.Network == null && networkSummary_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(networkSummary_LinkedView.Network))));\n        }\n\n        public override bool Equals(object networkSummary_LinkedView)\n        {\n            return Equals(networkSummary_LinkedView as NetworkSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class NicSettingMismatch : CustomizationFault, IEquatable<NicSettingMismatch>\n    {\n        public int NumberOfNicsInSpec { get; set; }\n\n        public int NumberOfNicsInVM { get; set; }\n\n        public bool Equals(NicSettingMismatch nicSettingMismatch)\n        {\n            return (nicSettingMismatch != null && this.NumberOfNicsInSpec == nicSettingMismatch.NumberOfNicsInSpec && this.NumberOfNicsInVM == nicSettingMismatch.NumberOfNicsInVM);\n        }\n\n        public override bool Equals(object nicSettingMismatch)\n        {\n            return Equals(nicSettingMismatch as NicSettingMismatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumberOfNicsInSpec + \"_\" + NumberOfNicsInVM).GetHashCode();\n        }\n    }\n\n    public class NoAccessUserEvent : SessionEvent, IEquatable<NoAccessUserEvent>\n    {\n        public string IpAddress { get; set; }\n\n        public bool Equals(NoAccessUserEvent noAccessUserEvent)\n        {\n            return (noAccessUserEvent != null && this.IpAddress == noAccessUserEvent.IpAddress);\n        }\n\n        public override bool Equals(object noAccessUserEvent)\n        {\n            return Equals(noAccessUserEvent as NoAccessUserEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress).GetHashCode();\n        }\n    }\n\n    public class NoActiveHostInCluster : InvalidState, IEquatable<NoActiveHostInCluster>\n    {\n        public ManagedObjectReference ComputeResource { get; set; }\n\n        public NoActiveHostInCluster_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NoActiveHostInCluster noActiveHostInCluster)\n        {\n            return (noActiveHostInCluster != null && ((this.ComputeResource == null && noActiveHostInCluster.ComputeResource == null) || (this.ComputeResource != null && this.ComputeResource.Equals(noActiveHostInCluster.ComputeResource))) && ((this.LinkedView == null && noActiveHostInCluster.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(noActiveHostInCluster.LinkedView))));\n        }\n\n        public override bool Equals(object noActiveHostInCluster)\n        {\n            return Equals(noActiveHostInCluster as NoActiveHostInCluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComputeResource + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NoActiveHostInCluster_LinkedView : IEquatable<NoActiveHostInCluster_LinkedView>\n    {\n        public ComputeResource ComputeResource { get; set; }\n\n        public bool Equals(NoActiveHostInCluster_LinkedView noActiveHostInCluster_LinkedView)\n        {\n            return (noActiveHostInCluster_LinkedView != null && ((this.ComputeResource == null && noActiveHostInCluster_LinkedView.ComputeResource == null) || (this.ComputeResource != null && this.ComputeResource.Equals(noActiveHostInCluster_LinkedView.ComputeResource))));\n        }\n\n        public override bool Equals(object noActiveHostInCluster_LinkedView)\n        {\n            return Equals(noActiveHostInCluster_LinkedView as NoActiveHostInCluster_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ComputeResource).GetHashCode();\n        }\n    }\n\n    public class NoAvailableIp : VAppPropertyFault, IEquatable<NoAvailableIp>\n    {\n        public ManagedObjectReference Network { get; set; }\n\n        public NoAvailableIp_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NoAvailableIp noAvailableIp)\n        {\n            return (noAvailableIp != null && ((this.Network == null && noAvailableIp.Network == null) || (this.Network != null && this.Network.Equals(noAvailableIp.Network))) && ((this.LinkedView == null && noAvailableIp.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(noAvailableIp.LinkedView))));\n        }\n\n        public override bool Equals(object noAvailableIp)\n        {\n            return Equals(noAvailableIp as NoAvailableIp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NoAvailableIp_LinkedView : IEquatable<NoAvailableIp_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(NoAvailableIp_LinkedView noAvailableIp_LinkedView)\n        {\n            return (noAvailableIp_LinkedView != null && ((this.Network == null && noAvailableIp_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(noAvailableIp_LinkedView.Network))));\n        }\n\n        public override bool Equals(object noAvailableIp_LinkedView)\n        {\n            return Equals(noAvailableIp_LinkedView as NoAvailableIp_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class NoClientCertificate : VimFault, IEquatable<NoClientCertificate>\n    {\n        public bool Equals(NoClientCertificate noClientCertificate)\n        {\n            return (noClientCertificate != null && base.Equals(noClientCertificate));\n        }\n\n        public override bool Equals(object noClientCertificate)\n        {\n            return Equals(noClientCertificate as NoClientCertificate);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoCompatibleDatastore : VimFault, IEquatable<NoCompatibleDatastore>\n    {\n        public bool Equals(NoCompatibleDatastore noCompatibleDatastore)\n        {\n            return (noCompatibleDatastore != null && base.Equals(noCompatibleDatastore));\n        }\n\n        public override bool Equals(object noCompatibleDatastore)\n        {\n            return Equals(noCompatibleDatastore as NoCompatibleDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoCompatibleHardAffinityHost : VmConfigFault, IEquatable<NoCompatibleHardAffinityHost>\n    {\n        public string VmName { get; set; }\n\n        public bool Equals(NoCompatibleHardAffinityHost noCompatibleHardAffinityHost)\n        {\n            return (noCompatibleHardAffinityHost != null && this.VmName == noCompatibleHardAffinityHost.VmName);\n        }\n\n        public override bool Equals(object noCompatibleHardAffinityHost)\n        {\n            return Equals(noCompatibleHardAffinityHost as NoCompatibleHardAffinityHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName).GetHashCode();\n        }\n    }\n\n    public class NoCompatibleHost : VimFault, IEquatable<NoCompatibleHost>\n    {\n        public ManagedObjectReference[] Host { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public NoCompatibleHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NoCompatibleHost noCompatibleHost)\n        {\n            return (noCompatibleHost != null && ((this.Host == null && noCompatibleHost.Host == null) || (this.Host != null && noCompatibleHost.Host != null && Enumerable.SequenceEqual(this.Host, noCompatibleHost.Host))) && ((this.Error == null && noCompatibleHost.Error == null) || (this.Error != null && noCompatibleHost.Error != null && Enumerable.SequenceEqual(this.Error, noCompatibleHost.Error))) && ((this.LinkedView == null && noCompatibleHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(noCompatibleHost.LinkedView))));\n        }\n\n        public override bool Equals(object noCompatibleHost)\n        {\n            return Equals(noCompatibleHost as NoCompatibleHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Error + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NoCompatibleHost_LinkedView : IEquatable<NoCompatibleHost_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(NoCompatibleHost_LinkedView noCompatibleHost_LinkedView)\n        {\n            return (noCompatibleHost_LinkedView != null && ((this.Host == null && noCompatibleHost_LinkedView.Host == null) || (this.Host != null && noCompatibleHost_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, noCompatibleHost_LinkedView.Host))));\n        }\n\n        public override bool Equals(object noCompatibleHost_LinkedView)\n        {\n            return Equals(noCompatibleHost_LinkedView as NoCompatibleHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class NoCompatibleHostWithAccessToDevice : NoCompatibleHost, IEquatable<NoCompatibleHostWithAccessToDevice>\n    {\n        public new NoCompatibleHostWithAccessToDevice_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NoCompatibleHostWithAccessToDevice noCompatibleHostWithAccessToDevice)\n        {\n            return (noCompatibleHostWithAccessToDevice != null && ((this.LinkedView == null && noCompatibleHostWithAccessToDevice.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(noCompatibleHostWithAccessToDevice.LinkedView))));\n        }\n\n        public override bool Equals(object noCompatibleHostWithAccessToDevice)\n        {\n            return Equals(noCompatibleHostWithAccessToDevice as NoCompatibleHostWithAccessToDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class NoCompatibleHostWithAccessToDevice_LinkedView : NoCompatibleHost_LinkedView, IEquatable<NoCompatibleHostWithAccessToDevice_LinkedView>\n    {\n        public bool Equals(NoCompatibleHostWithAccessToDevice_LinkedView noCompatibleHostWithAccessToDevice_LinkedView)\n        {\n            return (noCompatibleHostWithAccessToDevice_LinkedView != null && base.Equals(noCompatibleHostWithAccessToDevice_LinkedView));\n        }\n\n        public override bool Equals(object noCompatibleHostWithAccessToDevice_LinkedView)\n        {\n            return Equals(noCompatibleHostWithAccessToDevice_LinkedView as NoCompatibleHostWithAccessToDevice_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoCompatibleSoftAffinityHost : VmConfigFault, IEquatable<NoCompatibleSoftAffinityHost>\n    {\n        public string VmName { get; set; }\n\n        public bool Equals(NoCompatibleSoftAffinityHost noCompatibleSoftAffinityHost)\n        {\n            return (noCompatibleSoftAffinityHost != null && this.VmName == noCompatibleSoftAffinityHost.VmName);\n        }\n\n        public override bool Equals(object noCompatibleSoftAffinityHost)\n        {\n            return Equals(noCompatibleSoftAffinityHost as NoCompatibleSoftAffinityHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName).GetHashCode();\n        }\n    }\n\n    public class NoConnectedDatastore : VimFault, IEquatable<NoConnectedDatastore>\n    {\n        public bool Equals(NoConnectedDatastore noConnectedDatastore)\n        {\n            return (noConnectedDatastore != null && base.Equals(noConnectedDatastore));\n        }\n\n        public override bool Equals(object noConnectedDatastore)\n        {\n            return Equals(noConnectedDatastore as NoConnectedDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoDatastoresConfiguredEvent : HostEvent, IEquatable<NoDatastoresConfiguredEvent>\n    {\n        public bool Equals(NoDatastoresConfiguredEvent noDatastoresConfiguredEvent)\n        {\n            return (noDatastoresConfiguredEvent != null && base.Equals(noDatastoresConfiguredEvent));\n        }\n\n        public override bool Equals(object noDatastoresConfiguredEvent)\n        {\n            return Equals(noDatastoresConfiguredEvent as NoDatastoresConfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NodeDeploymentSpec : DynamicData, IEquatable<NodeDeploymentSpec>\n    {\n        public ManagedObjectReference EsxHost { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public ManagedObjectReference PublicNetworkPortGroup { get; set; }\n\n        public ManagedObjectReference ClusterNetworkPortGroup { get; set; }\n\n        public ManagedObjectReference Folder { get; set; }\n\n        public ManagedObjectReference ResourcePool { get; set; }\n\n        public ServiceLocator ManagementVc { get; set; }\n\n        public string NodeName { get; set; }\n\n        public CustomizationIPSettings IpSettings { get; set; }\n\n        public NodeDeploymentSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NodeDeploymentSpec nodeDeploymentSpec)\n        {\n            return (nodeDeploymentSpec != null && ((this.EsxHost == null && nodeDeploymentSpec.EsxHost == null) || (this.EsxHost != null && this.EsxHost.Equals(nodeDeploymentSpec.EsxHost))) && ((this.Datastore == null && nodeDeploymentSpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(nodeDeploymentSpec.Datastore))) && ((this.PublicNetworkPortGroup == null && nodeDeploymentSpec.PublicNetworkPortGroup == null) || (this.PublicNetworkPortGroup != null && this.PublicNetworkPortGroup.Equals(nodeDeploymentSpec.PublicNetworkPortGroup))) && ((this.ClusterNetworkPortGroup == null && nodeDeploymentSpec.ClusterNetworkPortGroup == null) || (this.ClusterNetworkPortGroup != null && this.ClusterNetworkPortGroup.Equals(nodeDeploymentSpec.ClusterNetworkPortGroup))) && ((this.Folder == null && nodeDeploymentSpec.Folder == null) || (this.Folder != null && this.Folder.Equals(nodeDeploymentSpec.Folder))) && ((this.ResourcePool == null && nodeDeploymentSpec.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(nodeDeploymentSpec.ResourcePool))) && ((this.ManagementVc == null && nodeDeploymentSpec.ManagementVc == null) || (this.ManagementVc != null && this.ManagementVc.Equals(nodeDeploymentSpec.ManagementVc))) && this.NodeName == nodeDeploymentSpec.NodeName && ((this.IpSettings == null && nodeDeploymentSpec.IpSettings == null) || (this.IpSettings != null && this.IpSettings.Equals(nodeDeploymentSpec.IpSettings))) && ((this.LinkedView == null && nodeDeploymentSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(nodeDeploymentSpec.LinkedView))));\n        }\n\n        public override bool Equals(object nodeDeploymentSpec)\n        {\n            return Equals(nodeDeploymentSpec as NodeDeploymentSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EsxHost + \"_\" + Datastore + \"_\" + PublicNetworkPortGroup + \"_\" + ClusterNetworkPortGroup + \"_\" + Folder + \"_\" + ResourcePool + \"_\" + ManagementVc + \"_\" + NodeName + \"_\" + IpSettings + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NodeDeploymentSpec_LinkedView : IEquatable<NodeDeploymentSpec_LinkedView>\n    {\n        public HostSystem EsxHost { get; set; }\n\n        public Datastore Datastore { get; set; }\n\n        public Network PublicNetworkPortGroup { get; set; }\n\n        public Network ClusterNetworkPortGroup { get; set; }\n\n        public Folder Folder { get; set; }\n\n        public ResourcePool ResourcePool { get; set; }\n\n        public bool Equals(NodeDeploymentSpec_LinkedView nodeDeploymentSpec_LinkedView)\n        {\n            return (nodeDeploymentSpec_LinkedView != null && ((this.EsxHost == null && nodeDeploymentSpec_LinkedView.EsxHost == null) || (this.EsxHost != null && this.EsxHost.Equals(nodeDeploymentSpec_LinkedView.EsxHost))) && ((this.Datastore == null && nodeDeploymentSpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(nodeDeploymentSpec_LinkedView.Datastore))) && ((this.PublicNetworkPortGroup == null && nodeDeploymentSpec_LinkedView.PublicNetworkPortGroup == null) || (this.PublicNetworkPortGroup != null && this.PublicNetworkPortGroup.Equals(nodeDeploymentSpec_LinkedView.PublicNetworkPortGroup))) && ((this.ClusterNetworkPortGroup == null && nodeDeploymentSpec_LinkedView.ClusterNetworkPortGroup == null) || (this.ClusterNetworkPortGroup != null && this.ClusterNetworkPortGroup.Equals(nodeDeploymentSpec_LinkedView.ClusterNetworkPortGroup))) && ((this.Folder == null && nodeDeploymentSpec_LinkedView.Folder == null) || (this.Folder != null && this.Folder.Equals(nodeDeploymentSpec_LinkedView.Folder))) && ((this.ResourcePool == null && nodeDeploymentSpec_LinkedView.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(nodeDeploymentSpec_LinkedView.ResourcePool))));\n        }\n\n        public override bool Equals(object nodeDeploymentSpec_LinkedView)\n        {\n            return Equals(nodeDeploymentSpec_LinkedView as NodeDeploymentSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EsxHost + \"_\" + Datastore + \"_\" + PublicNetworkPortGroup + \"_\" + ClusterNetworkPortGroup + \"_\" + Folder + \"_\" + ResourcePool).GetHashCode();\n        }\n    }\n\n    public class NodeNetworkSpec : DynamicData, IEquatable<NodeNetworkSpec>\n    {\n        public CustomizationIPSettings IpSettings { get; set; }\n\n        public bool Equals(NodeNetworkSpec nodeNetworkSpec)\n        {\n            return (nodeNetworkSpec != null && ((this.IpSettings == null && nodeNetworkSpec.IpSettings == null) || (this.IpSettings != null && this.IpSettings.Equals(nodeNetworkSpec.IpSettings))));\n        }\n\n        public override bool Equals(object nodeNetworkSpec)\n        {\n            return Equals(nodeNetworkSpec as NodeNetworkSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpSettings).GetHashCode();\n        }\n    }\n\n    public class NoDiskFound : VimFault, IEquatable<NoDiskFound>\n    {\n        public bool Equals(NoDiskFound noDiskFound)\n        {\n            return (noDiskFound != null && base.Equals(noDiskFound));\n        }\n\n        public override bool Equals(object noDiskFound)\n        {\n            return Equals(noDiskFound as NoDiskFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoDiskSpace : FileFault, IEquatable<NoDiskSpace>\n    {\n        public string Datastore { get; set; }\n\n        public bool Equals(NoDiskSpace noDiskSpace)\n        {\n            return (noDiskSpace != null && this.Datastore == noDiskSpace.Datastore);\n        }\n\n        public override bool Equals(object noDiskSpace)\n        {\n            return Equals(noDiskSpace as NoDiskSpace);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class NoDisksToCustomize : CustomizationFault, IEquatable<NoDisksToCustomize>\n    {\n        public bool Equals(NoDisksToCustomize noDisksToCustomize)\n        {\n            return (noDisksToCustomize != null && base.Equals(noDisksToCustomize));\n        }\n\n        public override bool Equals(object noDisksToCustomize)\n        {\n            return Equals(noDisksToCustomize as NoDisksToCustomize);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoGateway : HostConfigFault, IEquatable<NoGateway>\n    {\n        public bool Equals(NoGateway noGateway)\n        {\n            return (noGateway != null && base.Equals(noGateway));\n        }\n\n        public override bool Equals(object noGateway)\n        {\n            return Equals(noGateway as NoGateway);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoGuestHeartbeat : MigrationFault, IEquatable<NoGuestHeartbeat>\n    {\n        public bool Equals(NoGuestHeartbeat noGuestHeartbeat)\n        {\n            return (noGuestHeartbeat != null && base.Equals(noGuestHeartbeat));\n        }\n\n        public override bool Equals(object noGuestHeartbeat)\n        {\n            return Equals(noGuestHeartbeat as NoGuestHeartbeat);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoHost : HostConnectFault, IEquatable<NoHost>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(NoHost noHost)\n        {\n            return (noHost != null && this.Name == noHost.Name);\n        }\n\n        public override bool Equals(object noHost)\n        {\n            return Equals(noHost as NoHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class NoHostSuitableForFtSecondary : VmFaultToleranceIssue, IEquatable<NoHostSuitableForFtSecondary>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public NoHostSuitableForFtSecondary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NoHostSuitableForFtSecondary noHostSuitableForFtSecondary)\n        {\n            return (noHostSuitableForFtSecondary != null && ((this.Vm == null && noHostSuitableForFtSecondary.Vm == null) || (this.Vm != null && this.Vm.Equals(noHostSuitableForFtSecondary.Vm))) && this.VmName == noHostSuitableForFtSecondary.VmName && ((this.LinkedView == null && noHostSuitableForFtSecondary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(noHostSuitableForFtSecondary.LinkedView))));\n        }\n\n        public override bool Equals(object noHostSuitableForFtSecondary)\n        {\n            return Equals(noHostSuitableForFtSecondary as NoHostSuitableForFtSecondary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NoHostSuitableForFtSecondary_LinkedView : IEquatable<NoHostSuitableForFtSecondary_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(NoHostSuitableForFtSecondary_LinkedView noHostSuitableForFtSecondary_LinkedView)\n        {\n            return (noHostSuitableForFtSecondary_LinkedView != null && ((this.Vm == null && noHostSuitableForFtSecondary_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(noHostSuitableForFtSecondary_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object noHostSuitableForFtSecondary_LinkedView)\n        {\n            return Equals(noHostSuitableForFtSecondary_LinkedView as NoHostSuitableForFtSecondary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class NoLicenseEvent : LicenseEvent, IEquatable<NoLicenseEvent>\n    {\n        public LicenseFeatureInfo Feature { get; set; }\n\n        public bool Equals(NoLicenseEvent noLicenseEvent)\n        {\n            return (noLicenseEvent != null && ((this.Feature == null && noLicenseEvent.Feature == null) || (this.Feature != null && this.Feature.Equals(noLicenseEvent.Feature))));\n        }\n\n        public override bool Equals(object noLicenseEvent)\n        {\n            return Equals(noLicenseEvent as NoLicenseEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Feature).GetHashCode();\n        }\n    }\n\n    public class NoLicenseServerConfigured : NotEnoughLicenses, IEquatable<NoLicenseServerConfigured>\n    {\n        public bool Equals(NoLicenseServerConfigured noLicenseServerConfigured)\n        {\n            return (noLicenseServerConfigured != null && base.Equals(noLicenseServerConfigured));\n        }\n\n        public override bool Equals(object noLicenseServerConfigured)\n        {\n            return Equals(noLicenseServerConfigured as NoLicenseServerConfigured);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoMaintenanceModeDrsRecommendationForVM : VmEvent, IEquatable<NoMaintenanceModeDrsRecommendationForVM>\n    {\n        public bool Equals(NoMaintenanceModeDrsRecommendationForVM noMaintenanceModeDrsRecommendationForVM)\n        {\n            return (noMaintenanceModeDrsRecommendationForVM != null && base.Equals(noMaintenanceModeDrsRecommendationForVM));\n        }\n\n        public override bool Equals(object noMaintenanceModeDrsRecommendationForVM)\n        {\n            return Equals(noMaintenanceModeDrsRecommendationForVM as NoMaintenanceModeDrsRecommendationForVM);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NonADUserRequired : ActiveDirectoryFault, IEquatable<NonADUserRequired>\n    {\n        public bool Equals(NonADUserRequired nonADUserRequired)\n        {\n            return (nonADUserRequired != null && base.Equals(nonADUserRequired));\n        }\n\n        public override bool Equals(object nonADUserRequired)\n        {\n            return Equals(nonADUserRequired as NonADUserRequired);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NonHomeRDMVMotionNotSupported : MigrationFeatureNotSupported, IEquatable<NonHomeRDMVMotionNotSupported>\n    {\n        public string Device { get; set; }\n\n        public new NonHomeRDMVMotionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NonHomeRDMVMotionNotSupported nonHomeRDMVMotionNotSupported)\n        {\n            return (nonHomeRDMVMotionNotSupported != null && this.Device == nonHomeRDMVMotionNotSupported.Device && ((this.LinkedView == null && nonHomeRDMVMotionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(nonHomeRDMVMotionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object nonHomeRDMVMotionNotSupported)\n        {\n            return Equals(nonHomeRDMVMotionNotSupported as NonHomeRDMVMotionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NonHomeRDMVMotionNotSupported_LinkedView : MigrationFeatureNotSupported_LinkedView, IEquatable<NonHomeRDMVMotionNotSupported_LinkedView>\n    {\n        public bool Equals(NonHomeRDMVMotionNotSupported_LinkedView nonHomeRDMVMotionNotSupported_LinkedView)\n        {\n            return (nonHomeRDMVMotionNotSupported_LinkedView != null && base.Equals(nonHomeRDMVMotionNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object nonHomeRDMVMotionNotSupported_LinkedView)\n        {\n            return Equals(nonHomeRDMVMotionNotSupported_LinkedView as NonHomeRDMVMotionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NonPersistentDisksNotSupported : DeviceNotSupported, IEquatable<NonPersistentDisksNotSupported>\n    {\n        public bool Equals(NonPersistentDisksNotSupported nonPersistentDisksNotSupported)\n        {\n            return (nonPersistentDisksNotSupported != null && base.Equals(nonPersistentDisksNotSupported));\n        }\n\n        public override bool Equals(object nonPersistentDisksNotSupported)\n        {\n            return Equals(nonPersistentDisksNotSupported as NonPersistentDisksNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NonVIWorkloadDetectedOnDatastoreEvent : DatastoreEvent, IEquatable<NonVIWorkloadDetectedOnDatastoreEvent>\n    {\n        public bool Equals(NonVIWorkloadDetectedOnDatastoreEvent nonVIWorkloadDetectedOnDatastoreEvent)\n        {\n            return (nonVIWorkloadDetectedOnDatastoreEvent != null && base.Equals(nonVIWorkloadDetectedOnDatastoreEvent));\n        }\n\n        public override bool Equals(object nonVIWorkloadDetectedOnDatastoreEvent)\n        {\n            return Equals(nonVIWorkloadDetectedOnDatastoreEvent as NonVIWorkloadDetectedOnDatastoreEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NonVmwareOuiMacNotSupportedHost : NotSupportedHost, IEquatable<NonVmwareOuiMacNotSupportedHost>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(NonVmwareOuiMacNotSupportedHost nonVmwareOuiMacNotSupportedHost)\n        {\n            return (nonVmwareOuiMacNotSupportedHost != null && this.HostName == nonVmwareOuiMacNotSupportedHost.HostName);\n        }\n\n        public override bool Equals(object nonVmwareOuiMacNotSupportedHost)\n        {\n            return Equals(nonVmwareOuiMacNotSupportedHost as NonVmwareOuiMacNotSupportedHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class NoPeerHostFound : HostPowerOpFailed, IEquatable<NoPeerHostFound>\n    {\n        public bool Equals(NoPeerHostFound noPeerHostFound)\n        {\n            return (noPeerHostFound != null && base.Equals(noPeerHostFound));\n        }\n\n        public override bool Equals(object noPeerHostFound)\n        {\n            return Equals(noPeerHostFound as NoPeerHostFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoPermission : SecurityError, IEquatable<NoPermission>\n    {\n        public ManagedObjectReference Object { get; set; }\n\n        public string PrivilegeId { get; set; }\n\n        public bool Equals(NoPermission noPermission)\n        {\n            return (noPermission != null && ((this.Object == null && noPermission.Object == null) || (this.Object != null && this.Object.Equals(noPermission.Object))) && this.PrivilegeId == noPermission.PrivilegeId);\n        }\n\n        public override bool Equals(object noPermission)\n        {\n            return Equals(noPermission as NoPermission);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Object + \"_\" + PrivilegeId).GetHashCode();\n        }\n    }\n\n    public class NoPermissionOnAD : ActiveDirectoryFault, IEquatable<NoPermissionOnAD>\n    {\n        public bool Equals(NoPermissionOnAD noPermissionOnAD)\n        {\n            return (noPermissionOnAD != null && base.Equals(noPermissionOnAD));\n        }\n\n        public override bool Equals(object noPermissionOnAD)\n        {\n            return Equals(noPermissionOnAD as NoPermissionOnAD);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoPermissionOnHost : HostConnectFault, IEquatable<NoPermissionOnHost>\n    {\n        public bool Equals(NoPermissionOnHost noPermissionOnHost)\n        {\n            return (noPermissionOnHost != null && base.Equals(noPermissionOnHost));\n        }\n\n        public override bool Equals(object noPermissionOnHost)\n        {\n            return Equals(noPermissionOnHost as NoPermissionOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoPermissionOnNasVolume : NasConfigFault, IEquatable<NoPermissionOnNasVolume>\n    {\n        public string UserName { get; set; }\n\n        public bool Equals(NoPermissionOnNasVolume noPermissionOnNasVolume)\n        {\n            return (noPermissionOnNasVolume != null && this.UserName == noPermissionOnNasVolume.UserName);\n        }\n\n        public override bool Equals(object noPermissionOnNasVolume)\n        {\n            return Equals(noPermissionOnNasVolume as NoPermissionOnNasVolume);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserName).GetHashCode();\n        }\n    }\n\n    public class NoSubjectName : VimFault, IEquatable<NoSubjectName>\n    {\n        public bool Equals(NoSubjectName noSubjectName)\n        {\n            return (noSubjectName != null && base.Equals(noSubjectName));\n        }\n\n        public override bool Equals(object noSubjectName)\n        {\n            return Equals(noSubjectName as NoSubjectName);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotADirectory : FileFault, IEquatable<NotADirectory>\n    {\n        public bool Equals(NotADirectory notADirectory)\n        {\n            return (notADirectory != null && base.Equals(notADirectory));\n        }\n\n        public override bool Equals(object notADirectory)\n        {\n            return Equals(notADirectory as NotADirectory);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotAFile : FileFault, IEquatable<NotAFile>\n    {\n        public bool Equals(NotAFile notAFile)\n        {\n            return (notAFile != null && base.Equals(notAFile));\n        }\n\n        public override bool Equals(object notAFile)\n        {\n            return Equals(notAFile as NotAFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotAuthenticated : NoPermission, IEquatable<NotAuthenticated>\n    {\n        public bool Equals(NotAuthenticated notAuthenticated)\n        {\n            return (notAuthenticated != null && base.Equals(notAuthenticated));\n        }\n\n        public override bool Equals(object notAuthenticated)\n        {\n            return Equals(notAuthenticated as NotAuthenticated);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotEnoughCpus : VirtualHardwareCompatibilityIssue, IEquatable<NotEnoughCpus>\n    {\n        public int NumCpuDest { get; set; }\n\n        public int NumCpuVm { get; set; }\n\n        public bool Equals(NotEnoughCpus notEnoughCpus)\n        {\n            return (notEnoughCpus != null && this.NumCpuDest == notEnoughCpus.NumCpuDest && this.NumCpuVm == notEnoughCpus.NumCpuVm);\n        }\n\n        public override bool Equals(object notEnoughCpus)\n        {\n            return Equals(notEnoughCpus as NotEnoughCpus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumCpuDest + \"_\" + NumCpuVm).GetHashCode();\n        }\n    }\n\n    public class NotEnoughLicenses : RuntimeFault, IEquatable<NotEnoughLicenses>\n    {\n        public bool Equals(NotEnoughLicenses notEnoughLicenses)\n        {\n            return (notEnoughLicenses != null && base.Equals(notEnoughLicenses));\n        }\n\n        public override bool Equals(object notEnoughLicenses)\n        {\n            return Equals(notEnoughLicenses as NotEnoughLicenses);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotEnoughLogicalCpus : NotEnoughCpus, IEquatable<NotEnoughLogicalCpus>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public NotEnoughLogicalCpus_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NotEnoughLogicalCpus notEnoughLogicalCpus)\n        {\n            return (notEnoughLogicalCpus != null && ((this.Host == null && notEnoughLogicalCpus.Host == null) || (this.Host != null && this.Host.Equals(notEnoughLogicalCpus.Host))) && ((this.LinkedView == null && notEnoughLogicalCpus.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(notEnoughLogicalCpus.LinkedView))));\n        }\n\n        public override bool Equals(object notEnoughLogicalCpus)\n        {\n            return Equals(notEnoughLogicalCpus as NotEnoughLogicalCpus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NotEnoughLogicalCpus_LinkedView : IEquatable<NotEnoughLogicalCpus_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(NotEnoughLogicalCpus_LinkedView notEnoughLogicalCpus_LinkedView)\n        {\n            return (notEnoughLogicalCpus_LinkedView != null && ((this.Host == null && notEnoughLogicalCpus_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(notEnoughLogicalCpus_LinkedView.Host))));\n        }\n\n        public override bool Equals(object notEnoughLogicalCpus_LinkedView)\n        {\n            return Equals(notEnoughLogicalCpus_LinkedView as NotEnoughLogicalCpus_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class NotEnoughResourcesToStartVmEvent : VmEvent, IEquatable<NotEnoughResourcesToStartVmEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(NotEnoughResourcesToStartVmEvent notEnoughResourcesToStartVmEvent)\n        {\n            return (notEnoughResourcesToStartVmEvent != null && this.Reason == notEnoughResourcesToStartVmEvent.Reason);\n        }\n\n        public override bool Equals(object notEnoughResourcesToStartVmEvent)\n        {\n            return Equals(notEnoughResourcesToStartVmEvent as NotEnoughResourcesToStartVmEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class NotFound : VimFault, IEquatable<NotFound>\n    {\n        public bool Equals(NotFound notFound)\n        {\n            return (notFound != null && base.Equals(notFound));\n        }\n\n        public override bool Equals(object notFound)\n        {\n            return Equals(notFound as NotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotImplemented : RuntimeFault, IEquatable<NotImplemented>\n    {\n        public bool Equals(NotImplemented notImplemented)\n        {\n            return (notImplemented != null && base.Equals(notImplemented));\n        }\n\n        public override bool Equals(object notImplemented)\n        {\n            return Equals(notImplemented as NotImplemented);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotSupported : RuntimeFault, IEquatable<NotSupported>\n    {\n        public bool Equals(NotSupported notSupported)\n        {\n            return (notSupported != null && base.Equals(notSupported));\n        }\n\n        public override bool Equals(object notSupported)\n        {\n            return Equals(notSupported as NotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotSupportedDeviceForFT : VmFaultToleranceIssue, IEquatable<NotSupportedDeviceForFT>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string HostName { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public string DeviceType { get; set; }\n\n        public string DeviceLabel { get; set; }\n\n        public NotSupportedDeviceForFT_LinkedView LinkedView { get; set; }\n\n        public bool Equals(NotSupportedDeviceForFT notSupportedDeviceForFT)\n        {\n            return (notSupportedDeviceForFT != null && ((this.Host == null && notSupportedDeviceForFT.Host == null) || (this.Host != null && this.Host.Equals(notSupportedDeviceForFT.Host))) && this.HostName == notSupportedDeviceForFT.HostName && ((this.Vm == null && notSupportedDeviceForFT.Vm == null) || (this.Vm != null && this.Vm.Equals(notSupportedDeviceForFT.Vm))) && this.VmName == notSupportedDeviceForFT.VmName && this.DeviceType == notSupportedDeviceForFT.DeviceType && this.DeviceLabel == notSupportedDeviceForFT.DeviceLabel && ((this.LinkedView == null && notSupportedDeviceForFT.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(notSupportedDeviceForFT.LinkedView))));\n        }\n\n        public override bool Equals(object notSupportedDeviceForFT)\n        {\n            return Equals(notSupportedDeviceForFT as NotSupportedDeviceForFT);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostName + \"_\" + Vm + \"_\" + VmName + \"_\" + DeviceType + \"_\" + DeviceLabel + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class NotSupportedDeviceForFT_LinkedView : IEquatable<NotSupportedDeviceForFT_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(NotSupportedDeviceForFT_LinkedView notSupportedDeviceForFT_LinkedView)\n        {\n            return (notSupportedDeviceForFT_LinkedView != null && ((this.Host == null && notSupportedDeviceForFT_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(notSupportedDeviceForFT_LinkedView.Host))) && ((this.Vm == null && notSupportedDeviceForFT_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(notSupportedDeviceForFT_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object notSupportedDeviceForFT_LinkedView)\n        {\n            return Equals(notSupportedDeviceForFT_LinkedView as NotSupportedDeviceForFT_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Vm).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHost : HostConnectFault, IEquatable<NotSupportedHost>\n    {\n        public string ProductName { get; set; }\n\n        public string ProductVersion { get; set; }\n\n        public bool Equals(NotSupportedHost notSupportedHost)\n        {\n            return (notSupportedHost != null && this.ProductName == notSupportedHost.ProductName && this.ProductVersion == notSupportedHost.ProductVersion);\n        }\n\n        public override bool Equals(object notSupportedHost)\n        {\n            return Equals(notSupportedHost as NotSupportedHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProductName + \"_\" + ProductVersion).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostForChecksum : VimFault, IEquatable<NotSupportedHostForChecksum>\n    {\n        public bool Equals(NotSupportedHostForChecksum notSupportedHostForChecksum)\n        {\n            return (notSupportedHostForChecksum != null && base.Equals(notSupportedHostForChecksum));\n        }\n\n        public override bool Equals(object notSupportedHostForChecksum)\n        {\n            return Equals(notSupportedHostForChecksum as NotSupportedHostForChecksum);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostForVFlash : NotSupportedHost, IEquatable<NotSupportedHostForVFlash>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(NotSupportedHostForVFlash notSupportedHostForVFlash)\n        {\n            return (notSupportedHostForVFlash != null && this.HostName == notSupportedHostForVFlash.HostName);\n        }\n\n        public override bool Equals(object notSupportedHostForVFlash)\n        {\n            return Equals(notSupportedHostForVFlash as NotSupportedHostForVFlash);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostForVmcp : NotSupportedHost, IEquatable<NotSupportedHostForVmcp>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(NotSupportedHostForVmcp notSupportedHostForVmcp)\n        {\n            return (notSupportedHostForVmcp != null && this.HostName == notSupportedHostForVmcp.HostName);\n        }\n\n        public override bool Equals(object notSupportedHostForVmcp)\n        {\n            return Equals(notSupportedHostForVmcp as NotSupportedHostForVmcp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostForVmemFile : NotSupportedHost, IEquatable<NotSupportedHostForVmemFile>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(NotSupportedHostForVmemFile notSupportedHostForVmemFile)\n        {\n            return (notSupportedHostForVmemFile != null && this.HostName == notSupportedHostForVmemFile.HostName);\n        }\n\n        public override bool Equals(object notSupportedHostForVmemFile)\n        {\n            return Equals(notSupportedHostForVmemFile as NotSupportedHostForVmemFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostForVsan : NotSupportedHost, IEquatable<NotSupportedHostForVsan>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(NotSupportedHostForVsan notSupportedHostForVsan)\n        {\n            return (notSupportedHostForVsan != null && this.HostName == notSupportedHostForVsan.HostName);\n        }\n\n        public override bool Equals(object notSupportedHostForVsan)\n        {\n            return Equals(notSupportedHostForVsan as NotSupportedHostForVsan);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostInCluster : NotSupportedHost, IEquatable<NotSupportedHostInCluster>\n    {\n        public bool Equals(NotSupportedHostInCluster notSupportedHostInCluster)\n        {\n            return (notSupportedHostInCluster != null && base.Equals(notSupportedHostInCluster));\n        }\n\n        public override bool Equals(object notSupportedHostInCluster)\n        {\n            return Equals(notSupportedHostInCluster as NotSupportedHostInCluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostInDvs : NotSupportedHost, IEquatable<NotSupportedHostInDvs>\n    {\n        public DistributedVirtualSwitchProductSpec SwitchProductSpec { get; set; }\n\n        public bool Equals(NotSupportedHostInDvs notSupportedHostInDvs)\n        {\n            return (notSupportedHostInDvs != null && ((this.SwitchProductSpec == null && notSupportedHostInDvs.SwitchProductSpec == null) || (this.SwitchProductSpec != null && this.SwitchProductSpec.Equals(notSupportedHostInDvs.SwitchProductSpec))));\n        }\n\n        public override bool Equals(object notSupportedHostInDvs)\n        {\n            return Equals(notSupportedHostInDvs as NotSupportedHostInDvs);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchProductSpec).GetHashCode();\n        }\n    }\n\n    public class NotSupportedHostInHACluster : NotSupportedHost, IEquatable<NotSupportedHostInHACluster>\n    {\n        public string HostName { get; set; }\n\n        public string Build { get; set; }\n\n        public bool Equals(NotSupportedHostInHACluster notSupportedHostInHACluster)\n        {\n            return (notSupportedHostInHACluster != null && this.HostName == notSupportedHostInHACluster.HostName && this.Build == notSupportedHostInHACluster.Build);\n        }\n\n        public override bool Equals(object notSupportedHostInHACluster)\n        {\n            return Equals(notSupportedHostInHACluster as NotSupportedHostInHACluster);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Build).GetHashCode();\n        }\n    }\n\n    public class NotUserConfigurableProperty : VAppPropertyFault, IEquatable<NotUserConfigurableProperty>\n    {\n        public bool Equals(NotUserConfigurableProperty notUserConfigurableProperty)\n        {\n            return (notUserConfigurableProperty != null && base.Equals(notUserConfigurableProperty));\n        }\n\n        public override bool Equals(object notUserConfigurableProperty)\n        {\n            return Equals(notUserConfigurableProperty as NotUserConfigurableProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoVcManagedIpConfigured : VAppPropertyFault, IEquatable<NoVcManagedIpConfigured>\n    {\n        public bool Equals(NoVcManagedIpConfigured noVcManagedIpConfigured)\n        {\n            return (noVcManagedIpConfigured != null && base.Equals(noVcManagedIpConfigured));\n        }\n\n        public override bool Equals(object noVcManagedIpConfigured)\n        {\n            return Equals(noVcManagedIpConfigured as NoVcManagedIpConfigured);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoVirtualNic : HostConfigFault, IEquatable<NoVirtualNic>\n    {\n        public bool Equals(NoVirtualNic noVirtualNic)\n        {\n            return (noVirtualNic != null && base.Equals(noVirtualNic));\n        }\n\n        public override bool Equals(object noVirtualNic)\n        {\n            return Equals(noVirtualNic as NoVirtualNic);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NoVmInVApp : VAppConfigFault, IEquatable<NoVmInVApp>\n    {\n        public bool Equals(NoVmInVApp noVmInVApp)\n        {\n            return (noVmInVApp != null && base.Equals(noVmInVApp));\n        }\n\n        public override bool Equals(object noVmInVApp)\n        {\n            return Equals(noVmInVApp as NoVmInVApp);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NsxHostVNicProfile : ApplyProfile, IEquatable<NsxHostVNicProfile>\n    {\n        public string Key { get; set; }\n\n        public IpAddressProfile IpConfig { get; set; }\n\n        public bool Equals(NsxHostVNicProfile nsxHostVNicProfile)\n        {\n            return (nsxHostVNicProfile != null && this.Key == nsxHostVNicProfile.Key && ((this.IpConfig == null && nsxHostVNicProfile.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(nsxHostVNicProfile.IpConfig))));\n        }\n\n        public override bool Equals(object nsxHostVNicProfile)\n        {\n            return Equals(nsxHostVNicProfile as NsxHostVNicProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + IpConfig).GetHashCode();\n        }\n    }\n\n    public class NumericRange : DynamicData, IEquatable<NumericRange>\n    {\n        public int Start { get; set; }\n\n        public int End { get; set; }\n\n        public bool Equals(NumericRange numericRange)\n        {\n            return (numericRange != null && this.Start == numericRange.Start && this.End == numericRange.End);\n        }\n\n        public override bool Equals(object numericRange)\n        {\n            return Equals(numericRange as NumericRange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Start + \"_\" + End).GetHashCode();\n        }\n    }\n\n    public class NumPortsProfile : ApplyProfile, IEquatable<NumPortsProfile>\n    {\n        public bool Equals(NumPortsProfile numPortsProfile)\n        {\n            return (numPortsProfile != null && base.Equals(numPortsProfile));\n        }\n\n        public override bool Equals(object numPortsProfile)\n        {\n            return Equals(numPortsProfile as NumPortsProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class NumVirtualCoresPerSocketNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<NumVirtualCoresPerSocketNotSupported>\n    {\n        public int MaxSupportedCoresPerSocketDest { get; set; }\n\n        public int NumCoresPerSocketVm { get; set; }\n\n        public bool Equals(NumVirtualCoresPerSocketNotSupported numVirtualCoresPerSocketNotSupported)\n        {\n            return (numVirtualCoresPerSocketNotSupported != null && this.MaxSupportedCoresPerSocketDest == numVirtualCoresPerSocketNotSupported.MaxSupportedCoresPerSocketDest && this.NumCoresPerSocketVm == numVirtualCoresPerSocketNotSupported.NumCoresPerSocketVm);\n        }\n\n        public override bool Equals(object numVirtualCoresPerSocketNotSupported)\n        {\n            return Equals(numVirtualCoresPerSocketNotSupported as NumVirtualCoresPerSocketNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxSupportedCoresPerSocketDest + \"_\" + NumCoresPerSocketVm).GetHashCode();\n        }\n    }\n\n    public class NumVirtualCpusExceedsLimit : InsufficientResourcesFault, IEquatable<NumVirtualCpusExceedsLimit>\n    {\n        public int MaxSupportedVcpus { get; set; }\n\n        public bool Equals(NumVirtualCpusExceedsLimit numVirtualCpusExceedsLimit)\n        {\n            return (numVirtualCpusExceedsLimit != null && this.MaxSupportedVcpus == numVirtualCpusExceedsLimit.MaxSupportedVcpus);\n        }\n\n        public override bool Equals(object numVirtualCpusExceedsLimit)\n        {\n            return Equals(numVirtualCpusExceedsLimit as NumVirtualCpusExceedsLimit);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxSupportedVcpus).GetHashCode();\n        }\n    }\n\n    public class NumVirtualCpusIncompatible : VmConfigFault, IEquatable<NumVirtualCpusIncompatible>\n    {\n        public string Reason { get; set; }\n\n        public int NumCpu { get; set; }\n\n        public bool Equals(NumVirtualCpusIncompatible numVirtualCpusIncompatible)\n        {\n            return (numVirtualCpusIncompatible != null && this.Reason == numVirtualCpusIncompatible.Reason && this.NumCpu == numVirtualCpusIncompatible.NumCpu);\n        }\n\n        public override bool Equals(object numVirtualCpusIncompatible)\n        {\n            return Equals(numVirtualCpusIncompatible as NumVirtualCpusIncompatible);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + NumCpu).GetHashCode();\n        }\n    }\n\n    public class NumVirtualCpusNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<NumVirtualCpusNotSupported>\n    {\n        public int MaxSupportedVcpusDest { get; set; }\n\n        public int NumCpuVm { get; set; }\n\n        public bool Equals(NumVirtualCpusNotSupported numVirtualCpusNotSupported)\n        {\n            return (numVirtualCpusNotSupported != null && this.MaxSupportedVcpusDest == numVirtualCpusNotSupported.MaxSupportedVcpusDest && this.NumCpuVm == numVirtualCpusNotSupported.NumCpuVm);\n        }\n\n        public override bool Equals(object numVirtualCpusNotSupported)\n        {\n            return Equals(numVirtualCpusNotSupported as NumVirtualCpusNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxSupportedVcpusDest + \"_\" + NumCpuVm).GetHashCode();\n        }\n    }\n\n    public class NvdimmDimmInfo : DynamicData, IEquatable<NvdimmDimmInfo>\n    {\n        public int DimmHandle { get; set; }\n\n        public NvdimmHealthInfo HealthInfo { get; set; }\n\n        public long TotalCapacity { get; set; }\n\n        public long PersistentCapacity { get; set; }\n\n        public long AvailablePersistentCapacity { get; set; }\n\n        public long VolatileCapacity { get; set; }\n\n        public long AvailableVolatileCapacity { get; set; }\n\n        public long BlockCapacity { get; set; }\n\n        public NvdimmRegionInfo[] RegionInfo { get; set; }\n\n        public string RepresentationString { get; set; }\n\n        public bool Equals(NvdimmDimmInfo nvdimmDimmInfo)\n        {\n            return (nvdimmDimmInfo != null && this.DimmHandle == nvdimmDimmInfo.DimmHandle && ((this.HealthInfo == null && nvdimmDimmInfo.HealthInfo == null) || (this.HealthInfo != null && this.HealthInfo.Equals(nvdimmDimmInfo.HealthInfo))) && this.TotalCapacity == nvdimmDimmInfo.TotalCapacity && this.PersistentCapacity == nvdimmDimmInfo.PersistentCapacity && this.AvailablePersistentCapacity == nvdimmDimmInfo.AvailablePersistentCapacity && this.VolatileCapacity == nvdimmDimmInfo.VolatileCapacity && this.AvailableVolatileCapacity == nvdimmDimmInfo.AvailableVolatileCapacity && this.BlockCapacity == nvdimmDimmInfo.BlockCapacity && ((this.RegionInfo == null && nvdimmDimmInfo.RegionInfo == null) || (this.RegionInfo != null && nvdimmDimmInfo.RegionInfo != null && Enumerable.SequenceEqual(this.RegionInfo, nvdimmDimmInfo.RegionInfo))) && this.RepresentationString == nvdimmDimmInfo.RepresentationString);\n        }\n\n        public override bool Equals(object nvdimmDimmInfo)\n        {\n            return Equals(nvdimmDimmInfo as NvdimmDimmInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DimmHandle + \"_\" + HealthInfo + \"_\" + TotalCapacity + \"_\" + PersistentCapacity + \"_\" + AvailablePersistentCapacity + \"_\" + VolatileCapacity + \"_\" + AvailableVolatileCapacity + \"_\" + BlockCapacity + \"_\" + RegionInfo + \"_\" + RepresentationString).GetHashCode();\n        }\n    }\n\n    public class NvdimmGuid : DynamicData, IEquatable<NvdimmGuid>\n    {\n        public string Uuid { get; set; }\n\n        public bool Equals(NvdimmGuid nvdimmGuid)\n        {\n            return (nvdimmGuid != null && this.Uuid == nvdimmGuid.Uuid);\n        }\n\n        public override bool Equals(object nvdimmGuid)\n        {\n            return Equals(nvdimmGuid as NvdimmGuid);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid).GetHashCode();\n        }\n    }\n\n    public class NvdimmHealthInfo : DynamicData, IEquatable<NvdimmHealthInfo>\n    {\n        public string HealthStatus { get; set; }\n\n        public string HealthInformation { get; set; }\n\n        public string[] StateFlagInfo { get; set; }\n\n        public int DimmTemperature { get; set; }\n\n        public int DimmTemperatureThreshold { get; set; }\n\n        public int SpareBlocksPercentage { get; set; }\n\n        public int SpareBlockThreshold { get; set; }\n\n        public int DimmLifespanPercentage { get; set; }\n\n        public int? EsTemperature { get; set; }\n\n        public int? EsTemperatureThreshold { get; set; }\n\n        public int? EsLifespanPercentage { get; set; }\n\n        public bool Equals(NvdimmHealthInfo nvdimmHealthInfo)\n        {\n            return (nvdimmHealthInfo != null && this.HealthStatus == nvdimmHealthInfo.HealthStatus && this.HealthInformation == nvdimmHealthInfo.HealthInformation && ((this.StateFlagInfo == null && nvdimmHealthInfo.StateFlagInfo == null) || (this.StateFlagInfo != null && nvdimmHealthInfo.StateFlagInfo != null && Enumerable.SequenceEqual(this.StateFlagInfo, nvdimmHealthInfo.StateFlagInfo))) && this.DimmTemperature == nvdimmHealthInfo.DimmTemperature && this.DimmTemperatureThreshold == nvdimmHealthInfo.DimmTemperatureThreshold && this.SpareBlocksPercentage == nvdimmHealthInfo.SpareBlocksPercentage && this.SpareBlockThreshold == nvdimmHealthInfo.SpareBlockThreshold && this.DimmLifespanPercentage == nvdimmHealthInfo.DimmLifespanPercentage && ((this.EsTemperature == null && nvdimmHealthInfo.EsTemperature == null) || (this.EsTemperature != null && this.EsTemperature.Equals(nvdimmHealthInfo.EsTemperature))) && ((this.EsTemperatureThreshold == null && nvdimmHealthInfo.EsTemperatureThreshold == null) || (this.EsTemperatureThreshold != null && this.EsTemperatureThreshold.Equals(nvdimmHealthInfo.EsTemperatureThreshold))) && ((this.EsLifespanPercentage == null && nvdimmHealthInfo.EsLifespanPercentage == null) || (this.EsLifespanPercentage != null && this.EsLifespanPercentage.Equals(nvdimmHealthInfo.EsLifespanPercentage))));\n        }\n\n        public override bool Equals(object nvdimmHealthInfo)\n        {\n            return Equals(nvdimmHealthInfo as NvdimmHealthInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HealthStatus + \"_\" + HealthInformation + \"_\" + StateFlagInfo + \"_\" + DimmTemperature + \"_\" + DimmTemperatureThreshold + \"_\" + SpareBlocksPercentage + \"_\" + SpareBlockThreshold + \"_\" + DimmLifespanPercentage + \"_\" + EsTemperature + \"_\" + EsTemperatureThreshold + \"_\" + EsLifespanPercentage).GetHashCode();\n        }\n    }\n\n    public class NvdimmInterleaveSetInfo : DynamicData, IEquatable<NvdimmInterleaveSetInfo>\n    {\n        public int SetId { get; set; }\n\n        public string RangeType { get; set; }\n\n        public long BaseAddress { get; set; }\n\n        public long Size { get; set; }\n\n        public long AvailableSize { get; set; }\n\n        public int[] DeviceList { get; set; }\n\n        public string State { get; set; }\n\n        public bool Equals(NvdimmInterleaveSetInfo nvdimmInterleaveSetInfo)\n        {\n            return (nvdimmInterleaveSetInfo != null && this.SetId == nvdimmInterleaveSetInfo.SetId && this.RangeType == nvdimmInterleaveSetInfo.RangeType && this.BaseAddress == nvdimmInterleaveSetInfo.BaseAddress && this.Size == nvdimmInterleaveSetInfo.Size && this.AvailableSize == nvdimmInterleaveSetInfo.AvailableSize && ((this.DeviceList == null && nvdimmInterleaveSetInfo.DeviceList == null) || (this.DeviceList != null && nvdimmInterleaveSetInfo.DeviceList != null && Enumerable.SequenceEqual(this.DeviceList, nvdimmInterleaveSetInfo.DeviceList))) && this.State == nvdimmInterleaveSetInfo.State);\n        }\n\n        public override bool Equals(object nvdimmInterleaveSetInfo)\n        {\n            return Equals(nvdimmInterleaveSetInfo as NvdimmInterleaveSetInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SetId + \"_\" + RangeType + \"_\" + BaseAddress + \"_\" + Size + \"_\" + AvailableSize + \"_\" + DeviceList + \"_\" + State).GetHashCode();\n        }\n    }\n\n    public class NvdimmNamespaceCreateSpec : DynamicData, IEquatable<NvdimmNamespaceCreateSpec>\n    {\n        public string FriendlyName { get; set; }\n\n        public long BlockSize { get; set; }\n\n        public long BlockCount { get; set; }\n\n        public string Type { get; set; }\n\n        public int LocationID { get; set; }\n\n        public bool Equals(NvdimmNamespaceCreateSpec nvdimmNamespaceCreateSpec)\n        {\n            return (nvdimmNamespaceCreateSpec != null && this.FriendlyName == nvdimmNamespaceCreateSpec.FriendlyName && this.BlockSize == nvdimmNamespaceCreateSpec.BlockSize && this.BlockCount == nvdimmNamespaceCreateSpec.BlockCount && this.Type == nvdimmNamespaceCreateSpec.Type && this.LocationID == nvdimmNamespaceCreateSpec.LocationID);\n        }\n\n        public override bool Equals(object nvdimmNamespaceCreateSpec)\n        {\n            return Equals(nvdimmNamespaceCreateSpec as NvdimmNamespaceCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FriendlyName + \"_\" + BlockSize + \"_\" + BlockCount + \"_\" + Type + \"_\" + LocationID).GetHashCode();\n        }\n    }\n\n    public class NvdimmNamespaceDeleteSpec : DynamicData, IEquatable<NvdimmNamespaceDeleteSpec>\n    {\n        public string Uuid { get; set; }\n\n        public bool Equals(NvdimmNamespaceDeleteSpec nvdimmNamespaceDeleteSpec)\n        {\n            return (nvdimmNamespaceDeleteSpec != null && this.Uuid == nvdimmNamespaceDeleteSpec.Uuid);\n        }\n\n        public override bool Equals(object nvdimmNamespaceDeleteSpec)\n        {\n            return Equals(nvdimmNamespaceDeleteSpec as NvdimmNamespaceDeleteSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid).GetHashCode();\n        }\n    }\n\n    public class NvdimmNamespaceDetails : DynamicData, IEquatable<NvdimmNamespaceDetails>\n    {\n        public string Uuid { get; set; }\n\n        public string FriendlyName { get; set; }\n\n        public long Size { get; set; }\n\n        public string Type { get; set; }\n\n        public string NamespaceHealthStatus { get; set; }\n\n        public int InterleavesetID { get; set; }\n\n        public string State { get; set; }\n\n        public bool Equals(NvdimmNamespaceDetails nvdimmNamespaceDetails)\n        {\n            return (nvdimmNamespaceDetails != null && this.Uuid == nvdimmNamespaceDetails.Uuid && this.FriendlyName == nvdimmNamespaceDetails.FriendlyName && this.Size == nvdimmNamespaceDetails.Size && this.Type == nvdimmNamespaceDetails.Type && this.NamespaceHealthStatus == nvdimmNamespaceDetails.NamespaceHealthStatus && this.InterleavesetID == nvdimmNamespaceDetails.InterleavesetID && this.State == nvdimmNamespaceDetails.State);\n        }\n\n        public override bool Equals(object nvdimmNamespaceDetails)\n        {\n            return Equals(nvdimmNamespaceDetails as NvdimmNamespaceDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + FriendlyName + \"_\" + Size + \"_\" + Type + \"_\" + NamespaceHealthStatus + \"_\" + InterleavesetID + \"_\" + State).GetHashCode();\n        }\n    }\n\n    public class NvdimmNamespaceInfo : DynamicData, IEquatable<NvdimmNamespaceInfo>\n    {\n        public string Uuid { get; set; }\n\n        public string FriendlyName { get; set; }\n\n        public long BlockSize { get; set; }\n\n        public long BlockCount { get; set; }\n\n        public string Type { get; set; }\n\n        public string NamespaceHealthStatus { get; set; }\n\n        public int LocationID { get; set; }\n\n        public string State { get; set; }\n\n        public bool Equals(NvdimmNamespaceInfo nvdimmNamespaceInfo)\n        {\n            return (nvdimmNamespaceInfo != null && this.Uuid == nvdimmNamespaceInfo.Uuid && this.FriendlyName == nvdimmNamespaceInfo.FriendlyName && this.BlockSize == nvdimmNamespaceInfo.BlockSize && this.BlockCount == nvdimmNamespaceInfo.BlockCount && this.Type == nvdimmNamespaceInfo.Type && this.NamespaceHealthStatus == nvdimmNamespaceInfo.NamespaceHealthStatus && this.LocationID == nvdimmNamespaceInfo.LocationID && this.State == nvdimmNamespaceInfo.State);\n        }\n\n        public override bool Equals(object nvdimmNamespaceInfo)\n        {\n            return Equals(nvdimmNamespaceInfo as NvdimmNamespaceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + FriendlyName + \"_\" + BlockSize + \"_\" + BlockCount + \"_\" + Type + \"_\" + NamespaceHealthStatus + \"_\" + LocationID + \"_\" + State).GetHashCode();\n        }\n    }\n\n    public class NvdimmPMemNamespaceCreateSpec : DynamicData, IEquatable<NvdimmPMemNamespaceCreateSpec>\n    {\n        public string FriendlyName { get; set; }\n\n        public long Size { get; set; }\n\n        public int InterleavesetID { get; set; }\n\n        public bool Equals(NvdimmPMemNamespaceCreateSpec nvdimmPMemNamespaceCreateSpec)\n        {\n            return (nvdimmPMemNamespaceCreateSpec != null && this.FriendlyName == nvdimmPMemNamespaceCreateSpec.FriendlyName && this.Size == nvdimmPMemNamespaceCreateSpec.Size && this.InterleavesetID == nvdimmPMemNamespaceCreateSpec.InterleavesetID);\n        }\n\n        public override bool Equals(object nvdimmPMemNamespaceCreateSpec)\n        {\n            return Equals(nvdimmPMemNamespaceCreateSpec as NvdimmPMemNamespaceCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FriendlyName + \"_\" + Size + \"_\" + InterleavesetID).GetHashCode();\n        }\n    }\n\n    public class NvdimmRegionInfo : DynamicData, IEquatable<NvdimmRegionInfo>\n    {\n        public int RegionId { get; set; }\n\n        public int SetId { get; set; }\n\n        public string RangeType { get; set; }\n\n        public long StartAddr { get; set; }\n\n        public long Size { get; set; }\n\n        public long Offset { get; set; }\n\n        public bool Equals(NvdimmRegionInfo nvdimmRegionInfo)\n        {\n            return (nvdimmRegionInfo != null && this.RegionId == nvdimmRegionInfo.RegionId && this.SetId == nvdimmRegionInfo.SetId && this.RangeType == nvdimmRegionInfo.RangeType && this.StartAddr == nvdimmRegionInfo.StartAddr && this.Size == nvdimmRegionInfo.Size && this.Offset == nvdimmRegionInfo.Offset);\n        }\n\n        public override bool Equals(object nvdimmRegionInfo)\n        {\n            return Equals(nvdimmRegionInfo as NvdimmRegionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RegionId + \"_\" + SetId + \"_\" + RangeType + \"_\" + StartAddr + \"_\" + Size + \"_\" + Offset).GetHashCode();\n        }\n    }\n\n    public class NvdimmSummary : DynamicData, IEquatable<NvdimmSummary>\n    {\n        public int NumDimms { get; set; }\n\n        public string HealthStatus { get; set; }\n\n        public long TotalCapacity { get; set; }\n\n        public long PersistentCapacity { get; set; }\n\n        public long BlockCapacity { get; set; }\n\n        public long AvailableCapacity { get; set; }\n\n        public int NumInterleavesets { get; set; }\n\n        public int NumNamespaces { get; set; }\n\n        public bool Equals(NvdimmSummary nvdimmSummary)\n        {\n            return (nvdimmSummary != null && this.NumDimms == nvdimmSummary.NumDimms && this.HealthStatus == nvdimmSummary.HealthStatus && this.TotalCapacity == nvdimmSummary.TotalCapacity && this.PersistentCapacity == nvdimmSummary.PersistentCapacity && this.BlockCapacity == nvdimmSummary.BlockCapacity && this.AvailableCapacity == nvdimmSummary.AvailableCapacity && this.NumInterleavesets == nvdimmSummary.NumInterleavesets && this.NumNamespaces == nvdimmSummary.NumNamespaces);\n        }\n\n        public override bool Equals(object nvdimmSummary)\n        {\n            return Equals(nvdimmSummary as NvdimmSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumDimms + \"_\" + HealthStatus + \"_\" + TotalCapacity + \"_\" + PersistentCapacity + \"_\" + BlockCapacity + \"_\" + AvailableCapacity + \"_\" + NumInterleavesets + \"_\" + NumNamespaces).GetHashCode();\n        }\n    }\n\n    public class NvdimmSystemInfo : DynamicData, IEquatable<NvdimmSystemInfo>\n    {\n        public NvdimmSummary Summary { get; set; }\n\n        public int[] Dimms { get; set; }\n\n        public NvdimmDimmInfo[] DimmInfo { get; set; }\n\n        public int[] InterleaveSet { get; set; }\n\n        public NvdimmInterleaveSetInfo[] ISetInfo { get; set; }\n\n        public NvdimmGuid[] Namespace { get; set; }\n\n        public NvdimmNamespaceInfo[] NsInfo { get; set; }\n\n        public NvdimmNamespaceDetails[] NsDetails { get; set; }\n\n        public bool Equals(NvdimmSystemInfo nvdimmSystemInfo)\n        {\n            return (nvdimmSystemInfo != null && ((this.Summary == null && nvdimmSystemInfo.Summary == null) || (this.Summary != null && this.Summary.Equals(nvdimmSystemInfo.Summary))) && ((this.Dimms == null && nvdimmSystemInfo.Dimms == null) || (this.Dimms != null && nvdimmSystemInfo.Dimms != null && Enumerable.SequenceEqual(this.Dimms, nvdimmSystemInfo.Dimms))) && ((this.DimmInfo == null && nvdimmSystemInfo.DimmInfo == null) || (this.DimmInfo != null && nvdimmSystemInfo.DimmInfo != null && Enumerable.SequenceEqual(this.DimmInfo, nvdimmSystemInfo.DimmInfo))) && ((this.InterleaveSet == null && nvdimmSystemInfo.InterleaveSet == null) || (this.InterleaveSet != null && nvdimmSystemInfo.InterleaveSet != null && Enumerable.SequenceEqual(this.InterleaveSet, nvdimmSystemInfo.InterleaveSet))) && ((this.ISetInfo == null && nvdimmSystemInfo.ISetInfo == null) || (this.ISetInfo != null && nvdimmSystemInfo.ISetInfo != null && Enumerable.SequenceEqual(this.ISetInfo, nvdimmSystemInfo.ISetInfo))) && ((this.Namespace == null && nvdimmSystemInfo.Namespace == null) || (this.Namespace != null && nvdimmSystemInfo.Namespace != null && Enumerable.SequenceEqual(this.Namespace, nvdimmSystemInfo.Namespace))) && ((this.NsInfo == null && nvdimmSystemInfo.NsInfo == null) || (this.NsInfo != null && nvdimmSystemInfo.NsInfo != null && Enumerable.SequenceEqual(this.NsInfo, nvdimmSystemInfo.NsInfo))) && ((this.NsDetails == null && nvdimmSystemInfo.NsDetails == null) || (this.NsDetails != null && nvdimmSystemInfo.NsDetails != null && Enumerable.SequenceEqual(this.NsDetails, nvdimmSystemInfo.NsDetails))));\n        }\n\n        public override bool Equals(object nvdimmSystemInfo)\n        {\n            return Equals(nvdimmSystemInfo as NvdimmSystemInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Summary + \"_\" + Dimms + \"_\" + DimmInfo + \"_\" + InterleaveSet + \"_\" + ISetInfo + \"_\" + Namespace + \"_\" + NsInfo + \"_\" + NsDetails).GetHashCode();\n        }\n    }\n\n    public class ObjectContent : DynamicData, IEquatable<ObjectContent>\n    {\n        public ManagedObjectReference Obj { get; set; }\n\n        public DynamicProperty[] PropSet { get; set; }\n\n        public MissingProperty[] MissingSet { get; set; }\n\n        public bool Equals(ObjectContent objectContent)\n        {\n            return (objectContent != null && ((this.Obj == null && objectContent.Obj == null) || (this.Obj != null && this.Obj.Equals(objectContent.Obj))) && ((this.PropSet == null && objectContent.PropSet == null) || (this.PropSet != null && objectContent.PropSet != null && Enumerable.SequenceEqual(this.PropSet, objectContent.PropSet))) && ((this.MissingSet == null && objectContent.MissingSet == null) || (this.MissingSet != null && objectContent.MissingSet != null && Enumerable.SequenceEqual(this.MissingSet, objectContent.MissingSet))));\n        }\n\n        public override bool Equals(object objectContent)\n        {\n            return Equals(objectContent as ObjectContent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Obj + \"_\" + PropSet + \"_\" + MissingSet).GetHashCode();\n        }\n    }\n\n    public class ObjectSpec : DynamicData, IEquatable<ObjectSpec>\n    {\n        public ManagedObjectReference Obj { get; set; }\n\n        public bool? Skip { get; set; }\n\n        public SelectionSpec[] SelectSet { get; set; }\n\n        public bool Equals(ObjectSpec objectSpec)\n        {\n            return (objectSpec != null && ((this.Obj == null && objectSpec.Obj == null) || (this.Obj != null && this.Obj.Equals(objectSpec.Obj))) && ((this.Skip == null && objectSpec.Skip == null) || (this.Skip != null && this.Skip.Equals(objectSpec.Skip))) && ((this.SelectSet == null && objectSpec.SelectSet == null) || (this.SelectSet != null && objectSpec.SelectSet != null && Enumerable.SequenceEqual(this.SelectSet, objectSpec.SelectSet))));\n        }\n\n        public override bool Equals(object objectSpec)\n        {\n            return Equals(objectSpec as ObjectSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Obj + \"_\" + Skip + \"_\" + SelectSet).GetHashCode();\n        }\n    }\n\n    public class ObjectUpdate : DynamicData, IEquatable<ObjectUpdate>\n    {\n        public ObjectUpdateKind Kind { get; set; }\n\n        public ManagedObjectReference Obj { get; set; }\n\n        public PropertyChange[] ChangeSet { get; set; }\n\n        public MissingProperty[] MissingSet { get; set; }\n\n        public bool Equals(ObjectUpdate objectUpdate)\n        {\n            return (objectUpdate != null && this.Kind == objectUpdate.Kind && ((this.Obj == null && objectUpdate.Obj == null) || (this.Obj != null && this.Obj.Equals(objectUpdate.Obj))) && ((this.ChangeSet == null && objectUpdate.ChangeSet == null) || (this.ChangeSet != null && objectUpdate.ChangeSet != null && Enumerable.SequenceEqual(this.ChangeSet, objectUpdate.ChangeSet))) && ((this.MissingSet == null && objectUpdate.MissingSet == null) || (this.MissingSet != null && objectUpdate.MissingSet != null && Enumerable.SequenceEqual(this.MissingSet, objectUpdate.MissingSet))));\n        }\n\n        public override bool Equals(object objectUpdate)\n        {\n            return Equals(objectUpdate as ObjectUpdate);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Kind + \"_\" + Obj + \"_\" + ChangeSet + \"_\" + MissingSet).GetHashCode();\n        }\n    }\n\n    public class OnceTaskScheduler : TaskScheduler, IEquatable<OnceTaskScheduler>\n    {\n        public DateTime? RunAt { get; set; }\n\n        public bool Equals(OnceTaskScheduler onceTaskScheduler)\n        {\n            return (onceTaskScheduler != null && ((this.RunAt == null && onceTaskScheduler.RunAt == null) || (this.RunAt != null && this.RunAt.Equals(onceTaskScheduler.RunAt))));\n        }\n\n        public override bool Equals(object onceTaskScheduler)\n        {\n            return Equals(onceTaskScheduler as OnceTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RunAt).GetHashCode();\n        }\n    }\n\n    public class OpaqueNetwork : Network, IEquatable<OpaqueNetwork>\n    {\n        public OpaqueNetworkCapability Capability { get; set; }\n\n        public OptionValue[] ExtraConfig { get; set; }\n\n        public new OpaqueNetwork_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OpaqueNetwork opaqueNetwork)\n        {\n            return (opaqueNetwork != null && ((this.Capability == null && opaqueNetwork.Capability == null) || (this.Capability != null && this.Capability.Equals(opaqueNetwork.Capability))) && ((this.ExtraConfig == null && opaqueNetwork.ExtraConfig == null) || (this.ExtraConfig != null && opaqueNetwork.ExtraConfig != null && Enumerable.SequenceEqual(this.ExtraConfig, opaqueNetwork.ExtraConfig))) && ((this.LinkedView == null && opaqueNetwork.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(opaqueNetwork.LinkedView))));\n        }\n\n        public override bool Equals(object opaqueNetwork)\n        {\n            return Equals(opaqueNetwork as OpaqueNetwork);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capability + \"_\" + ExtraConfig + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OpaqueNetwork_LinkedView : Network_LinkedView, IEquatable<OpaqueNetwork_LinkedView>\n    {\n        public bool Equals(OpaqueNetwork_LinkedView opaqueNetwork_LinkedView)\n        {\n            return (opaqueNetwork_LinkedView != null && base.Equals(opaqueNetwork_LinkedView));\n        }\n\n        public override bool Equals(object opaqueNetwork_LinkedView)\n        {\n            return Equals(opaqueNetwork_LinkedView as OpaqueNetwork_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OpaqueNetworkCapability : DynamicData, IEquatable<OpaqueNetworkCapability>\n    {\n        public bool NetworkReservationSupported { get; set; }\n\n        public bool Equals(OpaqueNetworkCapability opaqueNetworkCapability)\n        {\n            return (opaqueNetworkCapability != null && this.NetworkReservationSupported == opaqueNetworkCapability.NetworkReservationSupported);\n        }\n\n        public override bool Equals(object opaqueNetworkCapability)\n        {\n            return Equals(opaqueNetworkCapability as OpaqueNetworkCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NetworkReservationSupported).GetHashCode();\n        }\n    }\n\n    public class OpaqueNetworkSummary : NetworkSummary, IEquatable<OpaqueNetworkSummary>\n    {\n        public string OpaqueNetworkId { get; set; }\n\n        public string OpaqueNetworkType { get; set; }\n\n        public new OpaqueNetworkSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OpaqueNetworkSummary opaqueNetworkSummary)\n        {\n            return (opaqueNetworkSummary != null && this.OpaqueNetworkId == opaqueNetworkSummary.OpaqueNetworkId && this.OpaqueNetworkType == opaqueNetworkSummary.OpaqueNetworkType && ((this.LinkedView == null && opaqueNetworkSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(opaqueNetworkSummary.LinkedView))));\n        }\n\n        public override bool Equals(object opaqueNetworkSummary)\n        {\n            return Equals(opaqueNetworkSummary as OpaqueNetworkSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OpaqueNetworkId + \"_\" + OpaqueNetworkType + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OpaqueNetworkSummary_LinkedView : NetworkSummary_LinkedView, IEquatable<OpaqueNetworkSummary_LinkedView>\n    {\n        public bool Equals(OpaqueNetworkSummary_LinkedView opaqueNetworkSummary_LinkedView)\n        {\n            return (opaqueNetworkSummary_LinkedView != null && base.Equals(opaqueNetworkSummary_LinkedView));\n        }\n\n        public override bool Equals(object opaqueNetworkSummary_LinkedView)\n        {\n            return Equals(opaqueNetworkSummary_LinkedView as OpaqueNetworkSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OpaqueNetworkTargetInfo : VirtualMachineTargetInfo, IEquatable<OpaqueNetworkTargetInfo>\n    {\n        public OpaqueNetworkSummary Network { get; set; }\n\n        public bool? NetworkReservationSupported { get; set; }\n\n        public bool Equals(OpaqueNetworkTargetInfo opaqueNetworkTargetInfo)\n        {\n            return (opaqueNetworkTargetInfo != null && ((this.Network == null && opaqueNetworkTargetInfo.Network == null) || (this.Network != null && this.Network.Equals(opaqueNetworkTargetInfo.Network))) && ((this.NetworkReservationSupported == null && opaqueNetworkTargetInfo.NetworkReservationSupported == null) || (this.NetworkReservationSupported != null && this.NetworkReservationSupported.Equals(opaqueNetworkTargetInfo.NetworkReservationSupported))));\n        }\n\n        public override bool Equals(object opaqueNetworkTargetInfo)\n        {\n            return Equals(opaqueNetworkTargetInfo as OpaqueNetworkTargetInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + NetworkReservationSupported).GetHashCode();\n        }\n    }\n\n    public class OperationDisabledByGuest : GuestOperationsFault, IEquatable<OperationDisabledByGuest>\n    {\n        public bool Equals(OperationDisabledByGuest operationDisabledByGuest)\n        {\n            return (operationDisabledByGuest != null && base.Equals(operationDisabledByGuest));\n        }\n\n        public override bool Equals(object operationDisabledByGuest)\n        {\n            return Equals(operationDisabledByGuest as OperationDisabledByGuest);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OperationDisallowedOnHost : RuntimeFault, IEquatable<OperationDisallowedOnHost>\n    {\n        public bool Equals(OperationDisallowedOnHost operationDisallowedOnHost)\n        {\n            return (operationDisallowedOnHost != null && base.Equals(operationDisallowedOnHost));\n        }\n\n        public override bool Equals(object operationDisallowedOnHost)\n        {\n            return Equals(operationDisallowedOnHost as OperationDisallowedOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OperationNotSupportedByGuest : GuestOperationsFault, IEquatable<OperationNotSupportedByGuest>\n    {\n        public bool Equals(OperationNotSupportedByGuest operationNotSupportedByGuest)\n        {\n            return (operationNotSupportedByGuest != null && base.Equals(operationNotSupportedByGuest));\n        }\n\n        public override bool Equals(object operationNotSupportedByGuest)\n        {\n            return Equals(operationNotSupportedByGuest as OperationNotSupportedByGuest);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OptionDef : ElementDescription, IEquatable<OptionDef>\n    {\n        public OptionType OptionType { get; set; }\n\n        public bool Equals(OptionDef optionDef)\n        {\n            return (optionDef != null && ((this.OptionType == null && optionDef.OptionType == null) || (this.OptionType != null && this.OptionType.Equals(optionDef.OptionType))));\n        }\n\n        public override bool Equals(object optionDef)\n        {\n            return Equals(optionDef as OptionDef);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OptionType).GetHashCode();\n        }\n    }\n\n    public class OptionManager : ViewBase, IEquatable<OptionManager>\n    {\n        public OptionDef[] SupportedOption { get; set; }\n\n        public OptionValue[] Setting { get; set; }\n\n        public OptionValue[] QueryOptions(string name)\n        {\n            return default(OptionValue[]);\n        }\n\n        public void UpdateOptions(OptionValue[] changedValue)\n        {\n        }\n\n        public bool Equals(OptionManager optionManager)\n        {\n            return (optionManager != null && ((this.SupportedOption == null && optionManager.SupportedOption == null) || (this.SupportedOption != null && optionManager.SupportedOption != null && Enumerable.SequenceEqual(this.SupportedOption, optionManager.SupportedOption))) && ((this.Setting == null && optionManager.Setting == null) || (this.Setting != null && optionManager.Setting != null && Enumerable.SequenceEqual(this.Setting, optionManager.Setting))));\n        }\n\n        public override bool Equals(object optionManager)\n        {\n            return Equals(optionManager as OptionManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportedOption + \"_\" + Setting).GetHashCode();\n        }\n    }\n\n    public class OptionProfile : ApplyProfile, IEquatable<OptionProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(OptionProfile optionProfile)\n        {\n            return (optionProfile != null && this.Key == optionProfile.Key);\n        }\n\n        public override bool Equals(object optionProfile)\n        {\n            return Equals(optionProfile as OptionProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class OptionType : DynamicData, IEquatable<OptionType>\n    {\n        public bool? ValueIsReadonly { get; set; }\n\n        public bool Equals(OptionType optionType)\n        {\n            return (optionType != null && ((this.ValueIsReadonly == null && optionType.ValueIsReadonly == null) || (this.ValueIsReadonly != null && this.ValueIsReadonly.Equals(optionType.ValueIsReadonly))));\n        }\n\n        public override bool Equals(object optionType)\n        {\n            return Equals(optionType as OptionType);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ValueIsReadonly).GetHashCode();\n        }\n    }\n\n    public class OptionValue : DynamicData, IEquatable<OptionValue>\n    {\n        public string Key { get; set; }\n\n        public object Value { get; set; }\n\n        public bool Equals(OptionValue optionValue)\n        {\n            return (optionValue != null && this.Key == optionValue.Key && ((this.Value == null && optionValue.Value == null) || (this.Value != null && this.Value.Equals(optionValue.Value))));\n        }\n\n        public override bool Equals(object optionValue)\n        {\n            return Equals(optionValue as OptionValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class OrAlarmExpression : AlarmExpression, IEquatable<OrAlarmExpression>\n    {\n        public AlarmExpression[] Expression { get; set; }\n\n        public bool Equals(OrAlarmExpression orAlarmExpression)\n        {\n            return (orAlarmExpression != null && ((this.Expression == null && orAlarmExpression.Expression == null) || (this.Expression != null && orAlarmExpression.Expression != null && Enumerable.SequenceEqual(this.Expression, orAlarmExpression.Expression))));\n        }\n\n        public override bool Equals(object orAlarmExpression)\n        {\n            return Equals(orAlarmExpression as OrAlarmExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Expression).GetHashCode();\n        }\n    }\n\n    public class OutOfBounds : VimFault, IEquatable<OutOfBounds>\n    {\n        public string ArgumentName { get; set; }\n\n        public bool Equals(OutOfBounds outOfBounds)\n        {\n            return (outOfBounds != null && this.ArgumentName == outOfBounds.ArgumentName);\n        }\n\n        public override bool Equals(object outOfBounds)\n        {\n            return Equals(outOfBounds as OutOfBounds);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ArgumentName).GetHashCode();\n        }\n    }\n\n    public class OutOfSyncDvsHost : DvsEvent, IEquatable<OutOfSyncDvsHost>\n    {\n        public DvsOutOfSyncHostArgument[] HostOutOfSync { get; set; }\n\n        public bool Equals(OutOfSyncDvsHost outOfSyncDvsHost)\n        {\n            return (outOfSyncDvsHost != null && ((this.HostOutOfSync == null && outOfSyncDvsHost.HostOutOfSync == null) || (this.HostOutOfSync != null && outOfSyncDvsHost.HostOutOfSync != null && Enumerable.SequenceEqual(this.HostOutOfSync, outOfSyncDvsHost.HostOutOfSync))));\n        }\n\n        public override bool Equals(object outOfSyncDvsHost)\n        {\n            return Equals(outOfSyncDvsHost as OutOfSyncDvsHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostOutOfSync).GetHashCode();\n        }\n    }\n\n    public class OverheadMemoryManager : ViewBase, IEquatable<OverheadMemoryManager>\n    {\n        public long LookupVmOverheadMemory(ManagedObjectReference vm, ManagedObjectReference host)\n        {\n            return default(long);\n        }\n\n        public bool Equals(OverheadMemoryManager overheadMemoryManager)\n        {\n            return (overheadMemoryManager != null && base.Equals(overheadMemoryManager));\n        }\n\n        public override bool Equals(object overheadMemoryManager)\n        {\n            return Equals(overheadMemoryManager as OverheadMemoryManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfAttribute : OvfInvalidPackage, IEquatable<OvfAttribute>\n    {\n        public string ElementName { get; set; }\n\n        public string AttributeName { get; set; }\n\n        public bool Equals(OvfAttribute ovfAttribute)\n        {\n            return (ovfAttribute != null && this.ElementName == ovfAttribute.ElementName && this.AttributeName == ovfAttribute.AttributeName);\n        }\n\n        public override bool Equals(object ovfAttribute)\n        {\n            return Equals(ovfAttribute as OvfAttribute);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ElementName + \"_\" + AttributeName).GetHashCode();\n        }\n    }\n\n    public class OvfConnectedDevice : OvfHardwareExport, IEquatable<OvfConnectedDevice>\n    {\n        public bool Equals(OvfConnectedDevice ovfConnectedDevice)\n        {\n            return (ovfConnectedDevice != null && base.Equals(ovfConnectedDevice));\n        }\n\n        public override bool Equals(object ovfConnectedDevice)\n        {\n            return Equals(ovfConnectedDevice as OvfConnectedDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfConnectedDeviceFloppy : OvfConnectedDevice, IEquatable<OvfConnectedDeviceFloppy>\n    {\n        public string Filename { get; set; }\n\n        public bool Equals(OvfConnectedDeviceFloppy ovfConnectedDeviceFloppy)\n        {\n            return (ovfConnectedDeviceFloppy != null && this.Filename == ovfConnectedDeviceFloppy.Filename);\n        }\n\n        public override bool Equals(object ovfConnectedDeviceFloppy)\n        {\n            return Equals(ovfConnectedDeviceFloppy as OvfConnectedDeviceFloppy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filename).GetHashCode();\n        }\n    }\n\n    public class OvfConnectedDeviceIso : OvfConnectedDevice, IEquatable<OvfConnectedDeviceIso>\n    {\n        public string Filename { get; set; }\n\n        public bool Equals(OvfConnectedDeviceIso ovfConnectedDeviceIso)\n        {\n            return (ovfConnectedDeviceIso != null && this.Filename == ovfConnectedDeviceIso.Filename);\n        }\n\n        public override bool Equals(object ovfConnectedDeviceIso)\n        {\n            return Equals(ovfConnectedDeviceIso as OvfConnectedDeviceIso);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filename).GetHashCode();\n        }\n    }\n\n    public class OvfConstraint : OvfInvalidPackage, IEquatable<OvfConstraint>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(OvfConstraint ovfConstraint)\n        {\n            return (ovfConstraint != null && this.Name == ovfConstraint.Name);\n        }\n\n        public override bool Equals(object ovfConstraint)\n        {\n            return Equals(ovfConstraint as OvfConstraint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerCallbackFault : OvfFault, IEquatable<OvfConsumerCallbackFault>\n    {\n        public string ExtensionKey { get; set; }\n\n        public string ExtensionName { get; set; }\n\n        public bool Equals(OvfConsumerCallbackFault ovfConsumerCallbackFault)\n        {\n            return (ovfConsumerCallbackFault != null && this.ExtensionKey == ovfConsumerCallbackFault.ExtensionKey && this.ExtensionName == ovfConsumerCallbackFault.ExtensionName);\n        }\n\n        public override bool Equals(object ovfConsumerCallbackFault)\n        {\n            return Equals(ovfConsumerCallbackFault as OvfConsumerCallbackFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionKey + \"_\" + ExtensionName).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerCommunicationError : OvfConsumerCallbackFault, IEquatable<OvfConsumerCommunicationError>\n    {\n        public string Description { get; set; }\n\n        public bool Equals(OvfConsumerCommunicationError ovfConsumerCommunicationError)\n        {\n            return (ovfConsumerCommunicationError != null && this.Description == ovfConsumerCommunicationError.Description);\n        }\n\n        public override bool Equals(object ovfConsumerCommunicationError)\n        {\n            return Equals(ovfConsumerCommunicationError as OvfConsumerCommunicationError);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerFault : OvfConsumerCallbackFault, IEquatable<OvfConsumerFault>\n    {\n        public string ErrorKey { get; set; }\n\n        public string Message { get; set; }\n\n        public KeyValue[] Params { get; set; }\n\n        public bool Equals(OvfConsumerFault ovfConsumerFault)\n        {\n            return (ovfConsumerFault != null && this.ErrorKey == ovfConsumerFault.ErrorKey && this.Message == ovfConsumerFault.Message && ((this.Params == null && ovfConsumerFault.Params == null) || (this.Params != null && ovfConsumerFault.Params != null && Enumerable.SequenceEqual(this.Params, ovfConsumerFault.Params))));\n        }\n\n        public override bool Equals(object ovfConsumerFault)\n        {\n            return Equals(ovfConsumerFault as OvfConsumerFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ErrorKey + \"_\" + Message + \"_\" + Params).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerInvalidSection : OvfConsumerCallbackFault, IEquatable<OvfConsumerInvalidSection>\n    {\n        public int LineNumber { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(OvfConsumerInvalidSection ovfConsumerInvalidSection)\n        {\n            return (ovfConsumerInvalidSection != null && this.LineNumber == ovfConsumerInvalidSection.LineNumber && this.Description == ovfConsumerInvalidSection.Description);\n        }\n\n        public override bool Equals(object ovfConsumerInvalidSection)\n        {\n            return Equals(ovfConsumerInvalidSection as OvfConsumerInvalidSection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LineNumber + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerOstNode : DynamicData, IEquatable<OvfConsumerOstNode>\n    {\n        public string Id { get; set; }\n\n        public string Type { get; set; }\n\n        public OvfConsumerOvfSection[] Section { get; set; }\n\n        public OvfConsumerOstNode[] Child { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public OvfConsumerOstNode_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OvfConsumerOstNode ovfConsumerOstNode)\n        {\n            return (ovfConsumerOstNode != null && this.Id == ovfConsumerOstNode.Id && this.Type == ovfConsumerOstNode.Type && ((this.Section == null && ovfConsumerOstNode.Section == null) || (this.Section != null && ovfConsumerOstNode.Section != null && Enumerable.SequenceEqual(this.Section, ovfConsumerOstNode.Section))) && ((this.Child == null && ovfConsumerOstNode.Child == null) || (this.Child != null && ovfConsumerOstNode.Child != null && Enumerable.SequenceEqual(this.Child, ovfConsumerOstNode.Child))) && ((this.Entity == null && ovfConsumerOstNode.Entity == null) || (this.Entity != null && this.Entity.Equals(ovfConsumerOstNode.Entity))) && ((this.LinkedView == null && ovfConsumerOstNode.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ovfConsumerOstNode.LinkedView))));\n        }\n\n        public override bool Equals(object ovfConsumerOstNode)\n        {\n            return Equals(ovfConsumerOstNode as OvfConsumerOstNode);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Type + \"_\" + Section + \"_\" + Child + \"_\" + Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerOstNode_LinkedView : IEquatable<OvfConsumerOstNode_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(OvfConsumerOstNode_LinkedView ovfConsumerOstNode_LinkedView)\n        {\n            return (ovfConsumerOstNode_LinkedView != null && ((this.Entity == null && ovfConsumerOstNode_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(ovfConsumerOstNode_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object ovfConsumerOstNode_LinkedView)\n        {\n            return Equals(ovfConsumerOstNode_LinkedView as OvfConsumerOstNode_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerOvfSection : DynamicData, IEquatable<OvfConsumerOvfSection>\n    {\n        public int LineNumber { get; set; }\n\n        public string Xml { get; set; }\n\n        public bool Equals(OvfConsumerOvfSection ovfConsumerOvfSection)\n        {\n            return (ovfConsumerOvfSection != null && this.LineNumber == ovfConsumerOvfSection.LineNumber && this.Xml == ovfConsumerOvfSection.Xml);\n        }\n\n        public override bool Equals(object ovfConsumerOvfSection)\n        {\n            return Equals(ovfConsumerOvfSection as OvfConsumerOvfSection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LineNumber + \"_\" + Xml).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerPowerOnFault : InvalidState, IEquatable<OvfConsumerPowerOnFault>\n    {\n        public string ExtensionKey { get; set; }\n\n        public string ExtensionName { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(OvfConsumerPowerOnFault ovfConsumerPowerOnFault)\n        {\n            return (ovfConsumerPowerOnFault != null && this.ExtensionKey == ovfConsumerPowerOnFault.ExtensionKey && this.ExtensionName == ovfConsumerPowerOnFault.ExtensionName && this.Description == ovfConsumerPowerOnFault.Description);\n        }\n\n        public override bool Equals(object ovfConsumerPowerOnFault)\n        {\n            return Equals(ovfConsumerPowerOnFault as OvfConsumerPowerOnFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionKey + \"_\" + ExtensionName + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerUndeclaredSection : OvfConsumerCallbackFault, IEquatable<OvfConsumerUndeclaredSection>\n    {\n        public string QualifiedSectionType { get; set; }\n\n        public bool Equals(OvfConsumerUndeclaredSection ovfConsumerUndeclaredSection)\n        {\n            return (ovfConsumerUndeclaredSection != null && this.QualifiedSectionType == ovfConsumerUndeclaredSection.QualifiedSectionType);\n        }\n\n        public override bool Equals(object ovfConsumerUndeclaredSection)\n        {\n            return Equals(ovfConsumerUndeclaredSection as OvfConsumerUndeclaredSection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (QualifiedSectionType).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerUndefinedPrefix : OvfConsumerCallbackFault, IEquatable<OvfConsumerUndefinedPrefix>\n    {\n        public string Prefix { get; set; }\n\n        public bool Equals(OvfConsumerUndefinedPrefix ovfConsumerUndefinedPrefix)\n        {\n            return (ovfConsumerUndefinedPrefix != null && this.Prefix == ovfConsumerUndefinedPrefix.Prefix);\n        }\n\n        public override bool Equals(object ovfConsumerUndefinedPrefix)\n        {\n            return Equals(ovfConsumerUndefinedPrefix as OvfConsumerUndefinedPrefix);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Prefix).GetHashCode();\n        }\n    }\n\n    public class OvfConsumerValidationFault : VmConfigFault, IEquatable<OvfConsumerValidationFault>\n    {\n        public string ExtensionKey { get; set; }\n\n        public string ExtensionName { get; set; }\n\n        public string Message { get; set; }\n\n        public bool Equals(OvfConsumerValidationFault ovfConsumerValidationFault)\n        {\n            return (ovfConsumerValidationFault != null && this.ExtensionKey == ovfConsumerValidationFault.ExtensionKey && this.ExtensionName == ovfConsumerValidationFault.ExtensionName && this.Message == ovfConsumerValidationFault.Message);\n        }\n\n        public override bool Equals(object ovfConsumerValidationFault)\n        {\n            return Equals(ovfConsumerValidationFault as OvfConsumerValidationFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionKey + \"_\" + ExtensionName + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class OvfCpuCompatibility : OvfImport, IEquatable<OvfCpuCompatibility>\n    {\n        public string RegisterName { get; set; }\n\n        public int Level { get; set; }\n\n        public string RegisterValue { get; set; }\n\n        public string DesiredRegisterValue { get; set; }\n\n        public bool Equals(OvfCpuCompatibility ovfCpuCompatibility)\n        {\n            return (ovfCpuCompatibility != null && this.RegisterName == ovfCpuCompatibility.RegisterName && this.Level == ovfCpuCompatibility.Level && this.RegisterValue == ovfCpuCompatibility.RegisterValue && this.DesiredRegisterValue == ovfCpuCompatibility.DesiredRegisterValue);\n        }\n\n        public override bool Equals(object ovfCpuCompatibility)\n        {\n            return Equals(ovfCpuCompatibility as OvfCpuCompatibility);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RegisterName + \"_\" + Level + \"_\" + RegisterValue + \"_\" + DesiredRegisterValue).GetHashCode();\n        }\n    }\n\n    public class OvfCpuCompatibilityCheckNotSupported : OvfImport, IEquatable<OvfCpuCompatibilityCheckNotSupported>\n    {\n        public bool Equals(OvfCpuCompatibilityCheckNotSupported ovfCpuCompatibilityCheckNotSupported)\n        {\n            return (ovfCpuCompatibilityCheckNotSupported != null && base.Equals(ovfCpuCompatibilityCheckNotSupported));\n        }\n\n        public override bool Equals(object ovfCpuCompatibilityCheckNotSupported)\n        {\n            return Equals(ovfCpuCompatibilityCheckNotSupported as OvfCpuCompatibilityCheckNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfCreateDescriptorParams : DynamicData, IEquatable<OvfCreateDescriptorParams>\n    {\n        public OvfFile[] OvfFiles { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public bool? IncludeImageFiles { get; set; }\n\n        public string[] ExportOption { get; set; }\n\n        public ManagedObjectReference Snapshot { get; set; }\n\n        public OvfCreateDescriptorParams_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OvfCreateDescriptorParams ovfCreateDescriptorParams)\n        {\n            return (ovfCreateDescriptorParams != null && ((this.OvfFiles == null && ovfCreateDescriptorParams.OvfFiles == null) || (this.OvfFiles != null && ovfCreateDescriptorParams.OvfFiles != null && Enumerable.SequenceEqual(this.OvfFiles, ovfCreateDescriptorParams.OvfFiles))) && this.Name == ovfCreateDescriptorParams.Name && this.Description == ovfCreateDescriptorParams.Description && ((this.IncludeImageFiles == null && ovfCreateDescriptorParams.IncludeImageFiles == null) || (this.IncludeImageFiles != null && this.IncludeImageFiles.Equals(ovfCreateDescriptorParams.IncludeImageFiles))) && ((this.ExportOption == null && ovfCreateDescriptorParams.ExportOption == null) || (this.ExportOption != null && ovfCreateDescriptorParams.ExportOption != null && Enumerable.SequenceEqual(this.ExportOption, ovfCreateDescriptorParams.ExportOption))) && ((this.Snapshot == null && ovfCreateDescriptorParams.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(ovfCreateDescriptorParams.Snapshot))) && ((this.LinkedView == null && ovfCreateDescriptorParams.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ovfCreateDescriptorParams.LinkedView))));\n        }\n\n        public override bool Equals(object ovfCreateDescriptorParams)\n        {\n            return Equals(ovfCreateDescriptorParams as OvfCreateDescriptorParams);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OvfFiles + \"_\" + Name + \"_\" + Description + \"_\" + IncludeImageFiles + \"_\" + ExportOption + \"_\" + Snapshot + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OvfCreateDescriptorParams_LinkedView : IEquatable<OvfCreateDescriptorParams_LinkedView>\n    {\n        public VirtualMachineSnapshot Snapshot { get; set; }\n\n        public bool Equals(OvfCreateDescriptorParams_LinkedView ovfCreateDescriptorParams_LinkedView)\n        {\n            return (ovfCreateDescriptorParams_LinkedView != null && ((this.Snapshot == null && ovfCreateDescriptorParams_LinkedView.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(ovfCreateDescriptorParams_LinkedView.Snapshot))));\n        }\n\n        public override bool Equals(object ovfCreateDescriptorParams_LinkedView)\n        {\n            return Equals(ovfCreateDescriptorParams_LinkedView as OvfCreateDescriptorParams_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Snapshot).GetHashCode();\n        }\n    }\n\n    public class OvfCreateDescriptorResult : DynamicData, IEquatable<OvfCreateDescriptorResult>\n    {\n        public string OvfDescriptor { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public LocalizedMethodFault[] Warning { get; set; }\n\n        public bool? IncludeImageFiles { get; set; }\n\n        public bool Equals(OvfCreateDescriptorResult ovfCreateDescriptorResult)\n        {\n            return (ovfCreateDescriptorResult != null && this.OvfDescriptor == ovfCreateDescriptorResult.OvfDescriptor && ((this.Error == null && ovfCreateDescriptorResult.Error == null) || (this.Error != null && ovfCreateDescriptorResult.Error != null && Enumerable.SequenceEqual(this.Error, ovfCreateDescriptorResult.Error))) && ((this.Warning == null && ovfCreateDescriptorResult.Warning == null) || (this.Warning != null && ovfCreateDescriptorResult.Warning != null && Enumerable.SequenceEqual(this.Warning, ovfCreateDescriptorResult.Warning))) && ((this.IncludeImageFiles == null && ovfCreateDescriptorResult.IncludeImageFiles == null) || (this.IncludeImageFiles != null && this.IncludeImageFiles.Equals(ovfCreateDescriptorResult.IncludeImageFiles))));\n        }\n\n        public override bool Equals(object ovfCreateDescriptorResult)\n        {\n            return Equals(ovfCreateDescriptorResult as OvfCreateDescriptorResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OvfDescriptor + \"_\" + Error + \"_\" + Warning + \"_\" + IncludeImageFiles).GetHashCode();\n        }\n    }\n\n    public class OvfCreateImportSpecParams : OvfManagerCommonParams, IEquatable<OvfCreateImportSpecParams>\n    {\n        public string EntityName { get; set; }\n\n        public ManagedObjectReference HostSystem { get; set; }\n\n        public OvfNetworkMapping[] NetworkMapping { get; set; }\n\n        public string IpAllocationPolicy { get; set; }\n\n        public string IpProtocol { get; set; }\n\n        public KeyValue[] PropertyMapping { get; set; }\n\n        public OvfResourceMap[] ResourceMapping { get; set; }\n\n        public string DiskProvisioning { get; set; }\n\n        public OvfConsumerOstNode InstantiationOst { get; set; }\n\n        public OvfCreateImportSpecParams_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OvfCreateImportSpecParams ovfCreateImportSpecParams)\n        {\n            return (ovfCreateImportSpecParams != null && this.EntityName == ovfCreateImportSpecParams.EntityName && ((this.HostSystem == null && ovfCreateImportSpecParams.HostSystem == null) || (this.HostSystem != null && this.HostSystem.Equals(ovfCreateImportSpecParams.HostSystem))) && ((this.NetworkMapping == null && ovfCreateImportSpecParams.NetworkMapping == null) || (this.NetworkMapping != null && ovfCreateImportSpecParams.NetworkMapping != null && Enumerable.SequenceEqual(this.NetworkMapping, ovfCreateImportSpecParams.NetworkMapping))) && this.IpAllocationPolicy == ovfCreateImportSpecParams.IpAllocationPolicy && this.IpProtocol == ovfCreateImportSpecParams.IpProtocol && ((this.PropertyMapping == null && ovfCreateImportSpecParams.PropertyMapping == null) || (this.PropertyMapping != null && ovfCreateImportSpecParams.PropertyMapping != null && Enumerable.SequenceEqual(this.PropertyMapping, ovfCreateImportSpecParams.PropertyMapping))) && ((this.ResourceMapping == null && ovfCreateImportSpecParams.ResourceMapping == null) || (this.ResourceMapping != null && ovfCreateImportSpecParams.ResourceMapping != null && Enumerable.SequenceEqual(this.ResourceMapping, ovfCreateImportSpecParams.ResourceMapping))) && this.DiskProvisioning == ovfCreateImportSpecParams.DiskProvisioning && ((this.InstantiationOst == null && ovfCreateImportSpecParams.InstantiationOst == null) || (this.InstantiationOst != null && this.InstantiationOst.Equals(ovfCreateImportSpecParams.InstantiationOst))) && ((this.LinkedView == null && ovfCreateImportSpecParams.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ovfCreateImportSpecParams.LinkedView))));\n        }\n\n        public override bool Equals(object ovfCreateImportSpecParams)\n        {\n            return Equals(ovfCreateImportSpecParams as OvfCreateImportSpecParams);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityName + \"_\" + HostSystem + \"_\" + NetworkMapping + \"_\" + IpAllocationPolicy + \"_\" + IpProtocol + \"_\" + PropertyMapping + \"_\" + ResourceMapping + \"_\" + DiskProvisioning + \"_\" + InstantiationOst + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OvfCreateImportSpecParams_LinkedView : IEquatable<OvfCreateImportSpecParams_LinkedView>\n    {\n        public HostSystem HostSystem { get; set; }\n\n        public bool Equals(OvfCreateImportSpecParams_LinkedView ovfCreateImportSpecParams_LinkedView)\n        {\n            return (ovfCreateImportSpecParams_LinkedView != null && ((this.HostSystem == null && ovfCreateImportSpecParams_LinkedView.HostSystem == null) || (this.HostSystem != null && this.HostSystem.Equals(ovfCreateImportSpecParams_LinkedView.HostSystem))));\n        }\n\n        public override bool Equals(object ovfCreateImportSpecParams_LinkedView)\n        {\n            return Equals(ovfCreateImportSpecParams_LinkedView as OvfCreateImportSpecParams_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostSystem).GetHashCode();\n        }\n    }\n\n    public class OvfCreateImportSpecResult : DynamicData, IEquatable<OvfCreateImportSpecResult>\n    {\n        public ImportSpec ImportSpec { get; set; }\n\n        public OvfFileItem[] FileItem { get; set; }\n\n        public LocalizedMethodFault[] Warning { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public bool Equals(OvfCreateImportSpecResult ovfCreateImportSpecResult)\n        {\n            return (ovfCreateImportSpecResult != null && ((this.ImportSpec == null && ovfCreateImportSpecResult.ImportSpec == null) || (this.ImportSpec != null && this.ImportSpec.Equals(ovfCreateImportSpecResult.ImportSpec))) && ((this.FileItem == null && ovfCreateImportSpecResult.FileItem == null) || (this.FileItem != null && ovfCreateImportSpecResult.FileItem != null && Enumerable.SequenceEqual(this.FileItem, ovfCreateImportSpecResult.FileItem))) && ((this.Warning == null && ovfCreateImportSpecResult.Warning == null) || (this.Warning != null && ovfCreateImportSpecResult.Warning != null && Enumerable.SequenceEqual(this.Warning, ovfCreateImportSpecResult.Warning))) && ((this.Error == null && ovfCreateImportSpecResult.Error == null) || (this.Error != null && ovfCreateImportSpecResult.Error != null && Enumerable.SequenceEqual(this.Error, ovfCreateImportSpecResult.Error))));\n        }\n\n        public override bool Equals(object ovfCreateImportSpecResult)\n        {\n            return Equals(ovfCreateImportSpecResult as OvfCreateImportSpecResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ImportSpec + \"_\" + FileItem + \"_\" + Warning + \"_\" + Error).GetHashCode();\n        }\n    }\n\n    public class OvfDeploymentOption : DynamicData, IEquatable<OvfDeploymentOption>\n    {\n        public string Key { get; set; }\n\n        public string Label { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(OvfDeploymentOption ovfDeploymentOption)\n        {\n            return (ovfDeploymentOption != null && this.Key == ovfDeploymentOption.Key && this.Label == ovfDeploymentOption.Label && this.Description == ovfDeploymentOption.Description);\n        }\n\n        public override bool Equals(object ovfDeploymentOption)\n        {\n            return Equals(ovfDeploymentOption as OvfDeploymentOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Label + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class OvfDiskMappingNotFound : OvfSystemFault, IEquatable<OvfDiskMappingNotFound>\n    {\n        public string DiskName { get; set; }\n\n        public string VmName { get; set; }\n\n        public bool Equals(OvfDiskMappingNotFound ovfDiskMappingNotFound)\n        {\n            return (ovfDiskMappingNotFound != null && this.DiskName == ovfDiskMappingNotFound.DiskName && this.VmName == ovfDiskMappingNotFound.VmName);\n        }\n\n        public override bool Equals(object ovfDiskMappingNotFound)\n        {\n            return Equals(ovfDiskMappingNotFound as OvfDiskMappingNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskName + \"_\" + VmName).GetHashCode();\n        }\n    }\n\n    public class OvfDiskOrderConstraint : OvfConstraint, IEquatable<OvfDiskOrderConstraint>\n    {\n        public bool Equals(OvfDiskOrderConstraint ovfDiskOrderConstraint)\n        {\n            return (ovfDiskOrderConstraint != null && base.Equals(ovfDiskOrderConstraint));\n        }\n\n        public override bool Equals(object ovfDiskOrderConstraint)\n        {\n            return Equals(ovfDiskOrderConstraint as OvfDiskOrderConstraint);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfDuplicatedElementBoundary : OvfElement, IEquatable<OvfDuplicatedElementBoundary>\n    {\n        public string Boundary { get; set; }\n\n        public bool Equals(OvfDuplicatedElementBoundary ovfDuplicatedElementBoundary)\n        {\n            return (ovfDuplicatedElementBoundary != null && this.Boundary == ovfDuplicatedElementBoundary.Boundary);\n        }\n\n        public override bool Equals(object ovfDuplicatedElementBoundary)\n        {\n            return Equals(ovfDuplicatedElementBoundary as OvfDuplicatedElementBoundary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Boundary).GetHashCode();\n        }\n    }\n\n    public class OvfDuplicatedPropertyIdExport : OvfExport, IEquatable<OvfDuplicatedPropertyIdExport>\n    {\n        public string Fqid { get; set; }\n\n        public bool Equals(OvfDuplicatedPropertyIdExport ovfDuplicatedPropertyIdExport)\n        {\n            return (ovfDuplicatedPropertyIdExport != null && this.Fqid == ovfDuplicatedPropertyIdExport.Fqid);\n        }\n\n        public override bool Equals(object ovfDuplicatedPropertyIdExport)\n        {\n            return Equals(ovfDuplicatedPropertyIdExport as OvfDuplicatedPropertyIdExport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fqid).GetHashCode();\n        }\n    }\n\n    public class OvfDuplicatedPropertyIdImport : OvfExport, IEquatable<OvfDuplicatedPropertyIdImport>\n    {\n        public bool Equals(OvfDuplicatedPropertyIdImport ovfDuplicatedPropertyIdImport)\n        {\n            return (ovfDuplicatedPropertyIdImport != null && base.Equals(ovfDuplicatedPropertyIdImport));\n        }\n\n        public override bool Equals(object ovfDuplicatedPropertyIdImport)\n        {\n            return Equals(ovfDuplicatedPropertyIdImport as OvfDuplicatedPropertyIdImport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfDuplicateElement : OvfElement, IEquatable<OvfDuplicateElement>\n    {\n        public bool Equals(OvfDuplicateElement ovfDuplicateElement)\n        {\n            return (ovfDuplicateElement != null && base.Equals(ovfDuplicateElement));\n        }\n\n        public override bool Equals(object ovfDuplicateElement)\n        {\n            return Equals(ovfDuplicateElement as OvfDuplicateElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfElement : OvfInvalidPackage, IEquatable<OvfElement>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(OvfElement ovfElement)\n        {\n            return (ovfElement != null && this.Name == ovfElement.Name);\n        }\n\n        public override bool Equals(object ovfElement)\n        {\n            return Equals(ovfElement as OvfElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class OvfElementInvalidValue : OvfElement, IEquatable<OvfElementInvalidValue>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(OvfElementInvalidValue ovfElementInvalidValue)\n        {\n            return (ovfElementInvalidValue != null && this.Value == ovfElementInvalidValue.Value);\n        }\n\n        public override bool Equals(object ovfElementInvalidValue)\n        {\n            return Equals(ovfElementInvalidValue as OvfElementInvalidValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class OvfExport : OvfFault, IEquatable<OvfExport>\n    {\n        public bool Equals(OvfExport ovfExport)\n        {\n            return (ovfExport != null && base.Equals(ovfExport));\n        }\n\n        public override bool Equals(object ovfExport)\n        {\n            return Equals(ovfExport as OvfExport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfExportFailed : OvfExport, IEquatable<OvfExportFailed>\n    {\n        public bool Equals(OvfExportFailed ovfExportFailed)\n        {\n            return (ovfExportFailed != null && base.Equals(ovfExportFailed));\n        }\n\n        public override bool Equals(object ovfExportFailed)\n        {\n            return Equals(ovfExportFailed as OvfExportFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfFault : VimFault, IEquatable<OvfFault>\n    {\n        public bool Equals(OvfFault ovfFault)\n        {\n            return (ovfFault != null && base.Equals(ovfFault));\n        }\n\n        public override bool Equals(object ovfFault)\n        {\n            return Equals(ovfFault as OvfFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfFile : DynamicData, IEquatable<OvfFile>\n    {\n        public string DeviceId { get; set; }\n\n        public string Path { get; set; }\n\n        public string CompressionMethod { get; set; }\n\n        public long? ChunkSize { get; set; }\n\n        public long Size { get; set; }\n\n        public long? Capacity { get; set; }\n\n        public long? PopulatedSize { get; set; }\n\n        public bool Equals(OvfFile ovfFile)\n        {\n            return (ovfFile != null && this.DeviceId == ovfFile.DeviceId && this.Path == ovfFile.Path && this.CompressionMethod == ovfFile.CompressionMethod && ((this.ChunkSize == null && ovfFile.ChunkSize == null) || (this.ChunkSize != null && this.ChunkSize.Equals(ovfFile.ChunkSize))) && this.Size == ovfFile.Size && ((this.Capacity == null && ovfFile.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(ovfFile.Capacity))) && ((this.PopulatedSize == null && ovfFile.PopulatedSize == null) || (this.PopulatedSize != null && this.PopulatedSize.Equals(ovfFile.PopulatedSize))));\n        }\n\n        public override bool Equals(object ovfFile)\n        {\n            return Equals(ovfFile as OvfFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceId + \"_\" + Path + \"_\" + CompressionMethod + \"_\" + ChunkSize + \"_\" + Size + \"_\" + Capacity + \"_\" + PopulatedSize).GetHashCode();\n        }\n    }\n\n    public class OvfFileItem : DynamicData, IEquatable<OvfFileItem>\n    {\n        public string DeviceId { get; set; }\n\n        public string Path { get; set; }\n\n        public string CompressionMethod { get; set; }\n\n        public long? ChunkSize { get; set; }\n\n        public long? Size { get; set; }\n\n        public int CimType { get; set; }\n\n        public bool Create { get; set; }\n\n        public bool Equals(OvfFileItem ovfFileItem)\n        {\n            return (ovfFileItem != null && this.DeviceId == ovfFileItem.DeviceId && this.Path == ovfFileItem.Path && this.CompressionMethod == ovfFileItem.CompressionMethod && ((this.ChunkSize == null && ovfFileItem.ChunkSize == null) || (this.ChunkSize != null && this.ChunkSize.Equals(ovfFileItem.ChunkSize))) && ((this.Size == null && ovfFileItem.Size == null) || (this.Size != null && this.Size.Equals(ovfFileItem.Size))) && this.CimType == ovfFileItem.CimType && this.Create == ovfFileItem.Create);\n        }\n\n        public override bool Equals(object ovfFileItem)\n        {\n            return Equals(ovfFileItem as OvfFileItem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceId + \"_\" + Path + \"_\" + CompressionMethod + \"_\" + ChunkSize + \"_\" + Size + \"_\" + CimType + \"_\" + Create).GetHashCode();\n        }\n    }\n\n    public class OvfHardwareCheck : OvfImport, IEquatable<OvfHardwareCheck>\n    {\n        public bool Equals(OvfHardwareCheck ovfHardwareCheck)\n        {\n            return (ovfHardwareCheck != null && base.Equals(ovfHardwareCheck));\n        }\n\n        public override bool Equals(object ovfHardwareCheck)\n        {\n            return Equals(ovfHardwareCheck as OvfHardwareCheck);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfHardwareExport : OvfExport, IEquatable<OvfHardwareExport>\n    {\n        public VirtualDevice Device { get; set; }\n\n        public string VmPath { get; set; }\n\n        public bool Equals(OvfHardwareExport ovfHardwareExport)\n        {\n            return (ovfHardwareExport != null && ((this.Device == null && ovfHardwareExport.Device == null) || (this.Device != null && this.Device.Equals(ovfHardwareExport.Device))) && this.VmPath == ovfHardwareExport.VmPath);\n        }\n\n        public override bool Equals(object ovfHardwareExport)\n        {\n            return Equals(ovfHardwareExport as OvfHardwareExport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + VmPath).GetHashCode();\n        }\n    }\n\n    public class OvfHostResourceConstraint : OvfConstraint, IEquatable<OvfHostResourceConstraint>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(OvfHostResourceConstraint ovfHostResourceConstraint)\n        {\n            return (ovfHostResourceConstraint != null && this.Value == ovfHostResourceConstraint.Value);\n        }\n\n        public override bool Equals(object ovfHostResourceConstraint)\n        {\n            return Equals(ovfHostResourceConstraint as OvfHostResourceConstraint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class OvfHostValueNotParsed : OvfSystemFault, IEquatable<OvfHostValueNotParsed>\n    {\n        public string Property { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(OvfHostValueNotParsed ovfHostValueNotParsed)\n        {\n            return (ovfHostValueNotParsed != null && this.Property == ovfHostValueNotParsed.Property && this.Value == ovfHostValueNotParsed.Value);\n        }\n\n        public override bool Equals(object ovfHostValueNotParsed)\n        {\n            return Equals(ovfHostValueNotParsed as OvfHostValueNotParsed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Property + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class OvfImport : OvfFault, IEquatable<OvfImport>\n    {\n        public bool Equals(OvfImport ovfImport)\n        {\n            return (ovfImport != null && base.Equals(ovfImport));\n        }\n\n        public override bool Equals(object ovfImport)\n        {\n            return Equals(ovfImport as OvfImport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfImportFailed : OvfImport, IEquatable<OvfImportFailed>\n    {\n        public bool Equals(OvfImportFailed ovfImportFailed)\n        {\n            return (ovfImportFailed != null && base.Equals(ovfImportFailed));\n        }\n\n        public override bool Equals(object ovfImportFailed)\n        {\n            return Equals(ovfImportFailed as OvfImportFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfInternalError : OvfSystemFault, IEquatable<OvfInternalError>\n    {\n        public bool Equals(OvfInternalError ovfInternalError)\n        {\n            return (ovfInternalError != null && base.Equals(ovfInternalError));\n        }\n\n        public override bool Equals(object ovfInternalError)\n        {\n            return Equals(ovfInternalError as OvfInternalError);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfInvalidPackage : OvfFault, IEquatable<OvfInvalidPackage>\n    {\n        public int LineNumber { get; set; }\n\n        public bool Equals(OvfInvalidPackage ovfInvalidPackage)\n        {\n            return (ovfInvalidPackage != null && this.LineNumber == ovfInvalidPackage.LineNumber);\n        }\n\n        public override bool Equals(object ovfInvalidPackage)\n        {\n            return Equals(ovfInvalidPackage as OvfInvalidPackage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LineNumber).GetHashCode();\n        }\n    }\n\n    public class OvfInvalidValue : OvfAttribute, IEquatable<OvfInvalidValue>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(OvfInvalidValue ovfInvalidValue)\n        {\n            return (ovfInvalidValue != null && this.Value == ovfInvalidValue.Value);\n        }\n\n        public override bool Equals(object ovfInvalidValue)\n        {\n            return Equals(ovfInvalidValue as OvfInvalidValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class OvfInvalidValueConfiguration : OvfInvalidValue, IEquatable<OvfInvalidValueConfiguration>\n    {\n        public bool Equals(OvfInvalidValueConfiguration ovfInvalidValueConfiguration)\n        {\n            return (ovfInvalidValueConfiguration != null && base.Equals(ovfInvalidValueConfiguration));\n        }\n\n        public override bool Equals(object ovfInvalidValueConfiguration)\n        {\n            return Equals(ovfInvalidValueConfiguration as OvfInvalidValueConfiguration);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfInvalidValueEmpty : OvfInvalidValue, IEquatable<OvfInvalidValueEmpty>\n    {\n        public bool Equals(OvfInvalidValueEmpty ovfInvalidValueEmpty)\n        {\n            return (ovfInvalidValueEmpty != null && base.Equals(ovfInvalidValueEmpty));\n        }\n\n        public override bool Equals(object ovfInvalidValueEmpty)\n        {\n            return Equals(ovfInvalidValueEmpty as OvfInvalidValueEmpty);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfInvalidValueFormatMalformed : OvfInvalidValue, IEquatable<OvfInvalidValueFormatMalformed>\n    {\n        public bool Equals(OvfInvalidValueFormatMalformed ovfInvalidValueFormatMalformed)\n        {\n            return (ovfInvalidValueFormatMalformed != null && base.Equals(ovfInvalidValueFormatMalformed));\n        }\n\n        public override bool Equals(object ovfInvalidValueFormatMalformed)\n        {\n            return Equals(ovfInvalidValueFormatMalformed as OvfInvalidValueFormatMalformed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfInvalidValueReference : OvfInvalidValue, IEquatable<OvfInvalidValueReference>\n    {\n        public bool Equals(OvfInvalidValueReference ovfInvalidValueReference)\n        {\n            return (ovfInvalidValueReference != null && base.Equals(ovfInvalidValueReference));\n        }\n\n        public override bool Equals(object ovfInvalidValueReference)\n        {\n            return Equals(ovfInvalidValueReference as OvfInvalidValueReference);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfInvalidVmName : OvfUnsupportedPackage, IEquatable<OvfInvalidVmName>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(OvfInvalidVmName ovfInvalidVmName)\n        {\n            return (ovfInvalidVmName != null && this.Name == ovfInvalidVmName.Name);\n        }\n\n        public override bool Equals(object ovfInvalidVmName)\n        {\n            return Equals(ovfInvalidVmName as OvfInvalidVmName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class OvfManager : ViewBase, IEquatable<OvfManager>\n    {\n        public OvfOptionInfo[] OvfImportOption { get; set; }\n\n        public OvfOptionInfo[] OvfExportOption { get; set; }\n\n        public OvfValidateHostResult ValidateHost(string ovfDescriptor, ManagedObjectReference host, OvfValidateHostParams vhp)\n        {\n            return default(OvfValidateHostResult);\n        }\n\n        public OvfParseDescriptorResult ParseDescriptor(string ovfDescriptor, OvfParseDescriptorParams pdp)\n        {\n            return default(OvfParseDescriptorResult);\n        }\n\n        public OvfCreateImportSpecResult CreateImportSpec(string ovfDescriptor, ManagedObjectReference resourcePool, ManagedObjectReference datastore, OvfCreateImportSpecParams cisp)\n        {\n            return default(OvfCreateImportSpecResult);\n        }\n\n        public OvfCreateDescriptorResult CreateDescriptor(ManagedObjectReference obj, OvfCreateDescriptorParams cdp)\n        {\n            return default(OvfCreateDescriptorResult);\n        }\n\n        public bool Equals(OvfManager ovfManager)\n        {\n            return (ovfManager != null && ((this.OvfImportOption == null && ovfManager.OvfImportOption == null) || (this.OvfImportOption != null && ovfManager.OvfImportOption != null && Enumerable.SequenceEqual(this.OvfImportOption, ovfManager.OvfImportOption))) && ((this.OvfExportOption == null && ovfManager.OvfExportOption == null) || (this.OvfExportOption != null && ovfManager.OvfExportOption != null && Enumerable.SequenceEqual(this.OvfExportOption, ovfManager.OvfExportOption))));\n        }\n\n        public override bool Equals(object ovfManager)\n        {\n            return Equals(ovfManager as OvfManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OvfImportOption + \"_\" + OvfExportOption).GetHashCode();\n        }\n    }\n\n    public class OvfManagerCommonParams : DynamicData, IEquatable<OvfManagerCommonParams>\n    {\n        public string Locale { get; set; }\n\n        public string DeploymentOption { get; set; }\n\n        public KeyValue[] MsgBundle { get; set; }\n\n        public string[] ImportOption { get; set; }\n\n        public bool Equals(OvfManagerCommonParams ovfManagerCommonParams)\n        {\n            return (ovfManagerCommonParams != null && this.Locale == ovfManagerCommonParams.Locale && this.DeploymentOption == ovfManagerCommonParams.DeploymentOption && ((this.MsgBundle == null && ovfManagerCommonParams.MsgBundle == null) || (this.MsgBundle != null && ovfManagerCommonParams.MsgBundle != null && Enumerable.SequenceEqual(this.MsgBundle, ovfManagerCommonParams.MsgBundle))) && ((this.ImportOption == null && ovfManagerCommonParams.ImportOption == null) || (this.ImportOption != null && ovfManagerCommonParams.ImportOption != null && Enumerable.SequenceEqual(this.ImportOption, ovfManagerCommonParams.ImportOption))));\n        }\n\n        public override bool Equals(object ovfManagerCommonParams)\n        {\n            return Equals(ovfManagerCommonParams as OvfManagerCommonParams);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Locale + \"_\" + DeploymentOption + \"_\" + MsgBundle + \"_\" + ImportOption).GetHashCode();\n        }\n    }\n\n    public class OvfMappedOsId : OvfImport, IEquatable<OvfMappedOsId>\n    {\n        public int OvfId { get; set; }\n\n        public string OvfDescription { get; set; }\n\n        public string TargetDescription { get; set; }\n\n        public bool Equals(OvfMappedOsId ovfMappedOsId)\n        {\n            return (ovfMappedOsId != null && this.OvfId == ovfMappedOsId.OvfId && this.OvfDescription == ovfMappedOsId.OvfDescription && this.TargetDescription == ovfMappedOsId.TargetDescription);\n        }\n\n        public override bool Equals(object ovfMappedOsId)\n        {\n            return Equals(ovfMappedOsId as OvfMappedOsId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OvfId + \"_\" + OvfDescription + \"_\" + TargetDescription).GetHashCode();\n        }\n    }\n\n    public class OvfMissingAttribute : OvfAttribute, IEquatable<OvfMissingAttribute>\n    {\n        public bool Equals(OvfMissingAttribute ovfMissingAttribute)\n        {\n            return (ovfMissingAttribute != null && base.Equals(ovfMissingAttribute));\n        }\n\n        public override bool Equals(object ovfMissingAttribute)\n        {\n            return Equals(ovfMissingAttribute as OvfMissingAttribute);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfMissingElement : OvfElement, IEquatable<OvfMissingElement>\n    {\n        public bool Equals(OvfMissingElement ovfMissingElement)\n        {\n            return (ovfMissingElement != null && base.Equals(ovfMissingElement));\n        }\n\n        public override bool Equals(object ovfMissingElement)\n        {\n            return Equals(ovfMissingElement as OvfMissingElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfMissingElementNormalBoundary : OvfMissingElement, IEquatable<OvfMissingElementNormalBoundary>\n    {\n        public string Boundary { get; set; }\n\n        public bool Equals(OvfMissingElementNormalBoundary ovfMissingElementNormalBoundary)\n        {\n            return (ovfMissingElementNormalBoundary != null && this.Boundary == ovfMissingElementNormalBoundary.Boundary);\n        }\n\n        public override bool Equals(object ovfMissingElementNormalBoundary)\n        {\n            return Equals(ovfMissingElementNormalBoundary as OvfMissingElementNormalBoundary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Boundary).GetHashCode();\n        }\n    }\n\n    public class OvfMissingHardware : OvfImport, IEquatable<OvfMissingHardware>\n    {\n        public string Name { get; set; }\n\n        public int ResourceType { get; set; }\n\n        public bool Equals(OvfMissingHardware ovfMissingHardware)\n        {\n            return (ovfMissingHardware != null && this.Name == ovfMissingHardware.Name && this.ResourceType == ovfMissingHardware.ResourceType);\n        }\n\n        public override bool Equals(object ovfMissingHardware)\n        {\n            return Equals(ovfMissingHardware as OvfMissingHardware);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + ResourceType).GetHashCode();\n        }\n    }\n\n    public class OvfNetworkInfo : DynamicData, IEquatable<OvfNetworkInfo>\n    {\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(OvfNetworkInfo ovfNetworkInfo)\n        {\n            return (ovfNetworkInfo != null && this.Name == ovfNetworkInfo.Name && this.Description == ovfNetworkInfo.Description);\n        }\n\n        public override bool Equals(object ovfNetworkInfo)\n        {\n            return Equals(ovfNetworkInfo as OvfNetworkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class OvfNetworkMapping : DynamicData, IEquatable<OvfNetworkMapping>\n    {\n        public string Name { get; set; }\n\n        public ManagedObjectReference Network { get; set; }\n\n        public OvfNetworkMapping_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OvfNetworkMapping ovfNetworkMapping)\n        {\n            return (ovfNetworkMapping != null && this.Name == ovfNetworkMapping.Name && ((this.Network == null && ovfNetworkMapping.Network == null) || (this.Network != null && this.Network.Equals(ovfNetworkMapping.Network))) && ((this.LinkedView == null && ovfNetworkMapping.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ovfNetworkMapping.LinkedView))));\n        }\n\n        public override bool Equals(object ovfNetworkMapping)\n        {\n            return Equals(ovfNetworkMapping as OvfNetworkMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OvfNetworkMapping_LinkedView : IEquatable<OvfNetworkMapping_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(OvfNetworkMapping_LinkedView ovfNetworkMapping_LinkedView)\n        {\n            return (ovfNetworkMapping_LinkedView != null && ((this.Network == null && ovfNetworkMapping_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(ovfNetworkMapping_LinkedView.Network))));\n        }\n\n        public override bool Equals(object ovfNetworkMapping_LinkedView)\n        {\n            return Equals(ovfNetworkMapping_LinkedView as OvfNetworkMapping_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class OvfNetworkMappingNotSupported : OvfImport, IEquatable<OvfNetworkMappingNotSupported>\n    {\n        public bool Equals(OvfNetworkMappingNotSupported ovfNetworkMappingNotSupported)\n        {\n            return (ovfNetworkMappingNotSupported != null && base.Equals(ovfNetworkMappingNotSupported));\n        }\n\n        public override bool Equals(object ovfNetworkMappingNotSupported)\n        {\n            return Equals(ovfNetworkMappingNotSupported as OvfNetworkMappingNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfNoHostNic : OvfUnsupportedPackage, IEquatable<OvfNoHostNic>\n    {\n        public bool Equals(OvfNoHostNic ovfNoHostNic)\n        {\n            return (ovfNoHostNic != null && base.Equals(ovfNoHostNic));\n        }\n\n        public override bool Equals(object ovfNoHostNic)\n        {\n            return Equals(ovfNoHostNic as OvfNoHostNic);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfNoSpaceOnController : OvfUnsupportedElement, IEquatable<OvfNoSpaceOnController>\n    {\n        public string Parent { get; set; }\n\n        public bool Equals(OvfNoSpaceOnController ovfNoSpaceOnController)\n        {\n            return (ovfNoSpaceOnController != null && this.Parent == ovfNoSpaceOnController.Parent);\n        }\n\n        public override bool Equals(object ovfNoSpaceOnController)\n        {\n            return Equals(ovfNoSpaceOnController as OvfNoSpaceOnController);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent).GetHashCode();\n        }\n    }\n\n    public class OvfNoSupportedHardwareFamily : OvfUnsupportedPackage, IEquatable<OvfNoSupportedHardwareFamily>\n    {\n        public string Version { get; set; }\n\n        public bool Equals(OvfNoSupportedHardwareFamily ovfNoSupportedHardwareFamily)\n        {\n            return (ovfNoSupportedHardwareFamily != null && this.Version == ovfNoSupportedHardwareFamily.Version);\n        }\n\n        public override bool Equals(object ovfNoSupportedHardwareFamily)\n        {\n            return Equals(ovfNoSupportedHardwareFamily as OvfNoSupportedHardwareFamily);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version).GetHashCode();\n        }\n    }\n\n    public class OvfOptionInfo : DynamicData, IEquatable<OvfOptionInfo>\n    {\n        public string Option { get; set; }\n\n        public LocalizableMessage Description { get; set; }\n\n        public bool Equals(OvfOptionInfo ovfOptionInfo)\n        {\n            return (ovfOptionInfo != null && this.Option == ovfOptionInfo.Option && ((this.Description == null && ovfOptionInfo.Description == null) || (this.Description != null && this.Description.Equals(ovfOptionInfo.Description))));\n        }\n\n        public override bool Equals(object ovfOptionInfo)\n        {\n            return Equals(ovfOptionInfo as OvfOptionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Option + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class OvfParseDescriptorParams : OvfManagerCommonParams, IEquatable<OvfParseDescriptorParams>\n    {\n        public bool Equals(OvfParseDescriptorParams ovfParseDescriptorParams)\n        {\n            return (ovfParseDescriptorParams != null && base.Equals(ovfParseDescriptorParams));\n        }\n\n        public override bool Equals(object ovfParseDescriptorParams)\n        {\n            return Equals(ovfParseDescriptorParams as OvfParseDescriptorParams);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfParseDescriptorResult : DynamicData, IEquatable<OvfParseDescriptorResult>\n    {\n        public string[] Eula { get; set; }\n\n        public OvfNetworkInfo[] Network { get; set; }\n\n        public string[] IpAllocationScheme { get; set; }\n\n        public string[] IpProtocols { get; set; }\n\n        public VAppPropertyInfo[] Property { get; set; }\n\n        public VAppProductInfo ProductInfo { get; set; }\n\n        public string Annotation { get; set; }\n\n        public long? ApproximateDownloadSize { get; set; }\n\n        public long? ApproximateFlatDeploymentSize { get; set; }\n\n        public long? ApproximateSparseDeploymentSize { get; set; }\n\n        public string DefaultEntityName { get; set; }\n\n        public bool VirtualApp { get; set; }\n\n        public OvfDeploymentOption[] DeploymentOption { get; set; }\n\n        public string DefaultDeploymentOption { get; set; }\n\n        public KeyValue[] EntityName { get; set; }\n\n        public OvfConsumerOstNode AnnotatedOst { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public LocalizedMethodFault[] Warning { get; set; }\n\n        public bool Equals(OvfParseDescriptorResult ovfParseDescriptorResult)\n        {\n            return (ovfParseDescriptorResult != null && ((this.Eula == null && ovfParseDescriptorResult.Eula == null) || (this.Eula != null && ovfParseDescriptorResult.Eula != null && Enumerable.SequenceEqual(this.Eula, ovfParseDescriptorResult.Eula))) && ((this.Network == null && ovfParseDescriptorResult.Network == null) || (this.Network != null && ovfParseDescriptorResult.Network != null && Enumerable.SequenceEqual(this.Network, ovfParseDescriptorResult.Network))) && ((this.IpAllocationScheme == null && ovfParseDescriptorResult.IpAllocationScheme == null) || (this.IpAllocationScheme != null && ovfParseDescriptorResult.IpAllocationScheme != null && Enumerable.SequenceEqual(this.IpAllocationScheme, ovfParseDescriptorResult.IpAllocationScheme))) && ((this.IpProtocols == null && ovfParseDescriptorResult.IpProtocols == null) || (this.IpProtocols != null && ovfParseDescriptorResult.IpProtocols != null && Enumerable.SequenceEqual(this.IpProtocols, ovfParseDescriptorResult.IpProtocols))) && ((this.Property == null && ovfParseDescriptorResult.Property == null) || (this.Property != null && ovfParseDescriptorResult.Property != null && Enumerable.SequenceEqual(this.Property, ovfParseDescriptorResult.Property))) && ((this.ProductInfo == null && ovfParseDescriptorResult.ProductInfo == null) || (this.ProductInfo != null && this.ProductInfo.Equals(ovfParseDescriptorResult.ProductInfo))) && this.Annotation == ovfParseDescriptorResult.Annotation && ((this.ApproximateDownloadSize == null && ovfParseDescriptorResult.ApproximateDownloadSize == null) || (this.ApproximateDownloadSize != null && this.ApproximateDownloadSize.Equals(ovfParseDescriptorResult.ApproximateDownloadSize))) && ((this.ApproximateFlatDeploymentSize == null && ovfParseDescriptorResult.ApproximateFlatDeploymentSize == null) || (this.ApproximateFlatDeploymentSize != null && this.ApproximateFlatDeploymentSize.Equals(ovfParseDescriptorResult.ApproximateFlatDeploymentSize))) && ((this.ApproximateSparseDeploymentSize == null && ovfParseDescriptorResult.ApproximateSparseDeploymentSize == null) || (this.ApproximateSparseDeploymentSize != null && this.ApproximateSparseDeploymentSize.Equals(ovfParseDescriptorResult.ApproximateSparseDeploymentSize))) && this.DefaultEntityName == ovfParseDescriptorResult.DefaultEntityName && this.VirtualApp == ovfParseDescriptorResult.VirtualApp && ((this.DeploymentOption == null && ovfParseDescriptorResult.DeploymentOption == null) || (this.DeploymentOption != null && ovfParseDescriptorResult.DeploymentOption != null && Enumerable.SequenceEqual(this.DeploymentOption, ovfParseDescriptorResult.DeploymentOption))) && this.DefaultDeploymentOption == ovfParseDescriptorResult.DefaultDeploymentOption && ((this.EntityName == null && ovfParseDescriptorResult.EntityName == null) || (this.EntityName != null && ovfParseDescriptorResult.EntityName != null && Enumerable.SequenceEqual(this.EntityName, ovfParseDescriptorResult.EntityName))) && ((this.AnnotatedOst == null && ovfParseDescriptorResult.AnnotatedOst == null) || (this.AnnotatedOst != null && this.AnnotatedOst.Equals(ovfParseDescriptorResult.AnnotatedOst))) && ((this.Error == null && ovfParseDescriptorResult.Error == null) || (this.Error != null && ovfParseDescriptorResult.Error != null && Enumerable.SequenceEqual(this.Error, ovfParseDescriptorResult.Error))) && ((this.Warning == null && ovfParseDescriptorResult.Warning == null) || (this.Warning != null && ovfParseDescriptorResult.Warning != null && Enumerable.SequenceEqual(this.Warning, ovfParseDescriptorResult.Warning))));\n        }\n\n        public override bool Equals(object ovfParseDescriptorResult)\n        {\n            return Equals(ovfParseDescriptorResult as OvfParseDescriptorResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Eula + \"_\" + Network + \"_\" + IpAllocationScheme + \"_\" + IpProtocols + \"_\" + Property + \"_\" + ProductInfo + \"_\" + Annotation + \"_\" + ApproximateDownloadSize + \"_\" + ApproximateFlatDeploymentSize + \"_\" + ApproximateSparseDeploymentSize + \"_\" + DefaultEntityName + \"_\" + VirtualApp + \"_\" + DeploymentOption + \"_\" + DefaultDeploymentOption + \"_\" + EntityName + \"_\" + AnnotatedOst + \"_\" + Error + \"_\" + Warning).GetHashCode();\n        }\n    }\n\n    public class OvfProperty : OvfInvalidPackage, IEquatable<OvfProperty>\n    {\n        public string Type { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(OvfProperty ovfProperty)\n        {\n            return (ovfProperty != null && this.Type == ovfProperty.Type && this.Value == ovfProperty.Value);\n        }\n\n        public override bool Equals(object ovfProperty)\n        {\n            return Equals(ovfProperty as OvfProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyExport : OvfExport, IEquatable<OvfPropertyExport>\n    {\n        public string Type { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(OvfPropertyExport ovfPropertyExport)\n        {\n            return (ovfPropertyExport != null && this.Type == ovfPropertyExport.Type && this.Value == ovfPropertyExport.Value);\n        }\n\n        public override bool Equals(object ovfPropertyExport)\n        {\n            return Equals(ovfPropertyExport as OvfPropertyExport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyNetwork : OvfProperty, IEquatable<OvfPropertyNetwork>\n    {\n        public bool Equals(OvfPropertyNetwork ovfPropertyNetwork)\n        {\n            return (ovfPropertyNetwork != null && base.Equals(ovfPropertyNetwork));\n        }\n\n        public override bool Equals(object ovfPropertyNetwork)\n        {\n            return Equals(ovfPropertyNetwork as OvfPropertyNetwork);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfPropertyNetworkExport : OvfExport, IEquatable<OvfPropertyNetworkExport>\n    {\n        public string Network { get; set; }\n\n        public bool Equals(OvfPropertyNetworkExport ovfPropertyNetworkExport)\n        {\n            return (ovfPropertyNetworkExport != null && this.Network == ovfPropertyNetworkExport.Network);\n        }\n\n        public override bool Equals(object ovfPropertyNetworkExport)\n        {\n            return Equals(ovfPropertyNetworkExport as OvfPropertyNetworkExport);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyQualifier : OvfProperty, IEquatable<OvfPropertyQualifier>\n    {\n        public string Qualifier { get; set; }\n\n        public bool Equals(OvfPropertyQualifier ovfPropertyQualifier)\n        {\n            return (ovfPropertyQualifier != null && this.Qualifier == ovfPropertyQualifier.Qualifier);\n        }\n\n        public override bool Equals(object ovfPropertyQualifier)\n        {\n            return Equals(ovfPropertyQualifier as OvfPropertyQualifier);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Qualifier).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyQualifierDuplicate : OvfProperty, IEquatable<OvfPropertyQualifierDuplicate>\n    {\n        public string Qualifier { get; set; }\n\n        public bool Equals(OvfPropertyQualifierDuplicate ovfPropertyQualifierDuplicate)\n        {\n            return (ovfPropertyQualifierDuplicate != null && this.Qualifier == ovfPropertyQualifierDuplicate.Qualifier);\n        }\n\n        public override bool Equals(object ovfPropertyQualifierDuplicate)\n        {\n            return Equals(ovfPropertyQualifierDuplicate as OvfPropertyQualifierDuplicate);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Qualifier).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyQualifierIgnored : OvfProperty, IEquatable<OvfPropertyQualifierIgnored>\n    {\n        public string Qualifier { get; set; }\n\n        public bool Equals(OvfPropertyQualifierIgnored ovfPropertyQualifierIgnored)\n        {\n            return (ovfPropertyQualifierIgnored != null && this.Qualifier == ovfPropertyQualifierIgnored.Qualifier);\n        }\n\n        public override bool Equals(object ovfPropertyQualifierIgnored)\n        {\n            return Equals(ovfPropertyQualifierIgnored as OvfPropertyQualifierIgnored);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Qualifier).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyType : OvfProperty, IEquatable<OvfPropertyType>\n    {\n        public bool Equals(OvfPropertyType ovfPropertyType)\n        {\n            return (ovfPropertyType != null && base.Equals(ovfPropertyType));\n        }\n\n        public override bool Equals(object ovfPropertyType)\n        {\n            return Equals(ovfPropertyType as OvfPropertyType);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfPropertyValue : OvfProperty, IEquatable<OvfPropertyValue>\n    {\n        public bool Equals(OvfPropertyValue ovfPropertyValue)\n        {\n            return (ovfPropertyValue != null && base.Equals(ovfPropertyValue));\n        }\n\n        public override bool Equals(object ovfPropertyValue)\n        {\n            return Equals(ovfPropertyValue as OvfPropertyValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfResourceMap : DynamicData, IEquatable<OvfResourceMap>\n    {\n        public string Source { get; set; }\n\n        public ManagedObjectReference Parent { get; set; }\n\n        public ResourceConfigSpec ResourceSpec { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public OvfResourceMap_LinkedView LinkedView { get; set; }\n\n        public bool Equals(OvfResourceMap ovfResourceMap)\n        {\n            return (ovfResourceMap != null && this.Source == ovfResourceMap.Source && ((this.Parent == null && ovfResourceMap.Parent == null) || (this.Parent != null && this.Parent.Equals(ovfResourceMap.Parent))) && ((this.ResourceSpec == null && ovfResourceMap.ResourceSpec == null) || (this.ResourceSpec != null && this.ResourceSpec.Equals(ovfResourceMap.ResourceSpec))) && ((this.Datastore == null && ovfResourceMap.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(ovfResourceMap.Datastore))) && ((this.LinkedView == null && ovfResourceMap.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ovfResourceMap.LinkedView))));\n        }\n\n        public override bool Equals(object ovfResourceMap)\n        {\n            return Equals(ovfResourceMap as OvfResourceMap);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Parent + \"_\" + ResourceSpec + \"_\" + Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class OvfResourceMap_LinkedView : IEquatable<OvfResourceMap_LinkedView>\n    {\n        public ResourcePool Parent { get; set; }\n\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(OvfResourceMap_LinkedView ovfResourceMap_LinkedView)\n        {\n            return (ovfResourceMap_LinkedView != null && ((this.Parent == null && ovfResourceMap_LinkedView.Parent == null) || (this.Parent != null && this.Parent.Equals(ovfResourceMap_LinkedView.Parent))) && ((this.Datastore == null && ovfResourceMap_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(ovfResourceMap_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object ovfResourceMap_LinkedView)\n        {\n            return Equals(ovfResourceMap_LinkedView as OvfResourceMap_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent + \"_\" + Datastore).GetHashCode();\n        }\n    }\n\n    public class OvfSystemFault : OvfFault, IEquatable<OvfSystemFault>\n    {\n        public bool Equals(OvfSystemFault ovfSystemFault)\n        {\n            return (ovfSystemFault != null && base.Equals(ovfSystemFault));\n        }\n\n        public override bool Equals(object ovfSystemFault)\n        {\n            return Equals(ovfSystemFault as OvfSystemFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfToXmlUnsupportedElement : OvfSystemFault, IEquatable<OvfToXmlUnsupportedElement>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(OvfToXmlUnsupportedElement ovfToXmlUnsupportedElement)\n        {\n            return (ovfToXmlUnsupportedElement != null && this.Name == ovfToXmlUnsupportedElement.Name);\n        }\n\n        public override bool Equals(object ovfToXmlUnsupportedElement)\n        {\n            return Equals(ovfToXmlUnsupportedElement as OvfToXmlUnsupportedElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class OvfUnableToExportDisk : OvfHardwareExport, IEquatable<OvfUnableToExportDisk>\n    {\n        public string DiskName { get; set; }\n\n        public bool Equals(OvfUnableToExportDisk ovfUnableToExportDisk)\n        {\n            return (ovfUnableToExportDisk != null && this.DiskName == ovfUnableToExportDisk.DiskName);\n        }\n\n        public override bool Equals(object ovfUnableToExportDisk)\n        {\n            return Equals(ovfUnableToExportDisk as OvfUnableToExportDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskName).GetHashCode();\n        }\n    }\n\n    public class OvfUnexpectedElement : OvfElement, IEquatable<OvfUnexpectedElement>\n    {\n        public bool Equals(OvfUnexpectedElement ovfUnexpectedElement)\n        {\n            return (ovfUnexpectedElement != null && base.Equals(ovfUnexpectedElement));\n        }\n\n        public override bool Equals(object ovfUnexpectedElement)\n        {\n            return Equals(ovfUnexpectedElement as OvfUnexpectedElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfUnknownDevice : OvfSystemFault, IEquatable<OvfUnknownDevice>\n    {\n        public VirtualDevice Device { get; set; }\n\n        public string VmName { get; set; }\n\n        public bool Equals(OvfUnknownDevice ovfUnknownDevice)\n        {\n            return (ovfUnknownDevice != null && ((this.Device == null && ovfUnknownDevice.Device == null) || (this.Device != null && this.Device.Equals(ovfUnknownDevice.Device))) && this.VmName == ovfUnknownDevice.VmName);\n        }\n\n        public override bool Equals(object ovfUnknownDevice)\n        {\n            return Equals(ovfUnknownDevice as OvfUnknownDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + VmName).GetHashCode();\n        }\n    }\n\n    public class OvfUnknownDeviceBacking : OvfHardwareExport, IEquatable<OvfUnknownDeviceBacking>\n    {\n        public VirtualDeviceBackingInfo Backing { get; set; }\n\n        public bool Equals(OvfUnknownDeviceBacking ovfUnknownDeviceBacking)\n        {\n            return (ovfUnknownDeviceBacking != null && ((this.Backing == null && ovfUnknownDeviceBacking.Backing == null) || (this.Backing != null && this.Backing.Equals(ovfUnknownDeviceBacking.Backing))));\n        }\n\n        public override bool Equals(object ovfUnknownDeviceBacking)\n        {\n            return Equals(ovfUnknownDeviceBacking as OvfUnknownDeviceBacking);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Backing).GetHashCode();\n        }\n    }\n\n    public class OvfUnknownEntity : OvfSystemFault, IEquatable<OvfUnknownEntity>\n    {\n        public int LineNumber { get; set; }\n\n        public bool Equals(OvfUnknownEntity ovfUnknownEntity)\n        {\n            return (ovfUnknownEntity != null && this.LineNumber == ovfUnknownEntity.LineNumber);\n        }\n\n        public override bool Equals(object ovfUnknownEntity)\n        {\n            return Equals(ovfUnknownEntity as OvfUnknownEntity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LineNumber).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedAttribute : OvfUnsupportedPackage, IEquatable<OvfUnsupportedAttribute>\n    {\n        public string ElementName { get; set; }\n\n        public string AttributeName { get; set; }\n\n        public bool Equals(OvfUnsupportedAttribute ovfUnsupportedAttribute)\n        {\n            return (ovfUnsupportedAttribute != null && this.ElementName == ovfUnsupportedAttribute.ElementName && this.AttributeName == ovfUnsupportedAttribute.AttributeName);\n        }\n\n        public override bool Equals(object ovfUnsupportedAttribute)\n        {\n            return Equals(ovfUnsupportedAttribute as OvfUnsupportedAttribute);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ElementName + \"_\" + AttributeName).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedAttributeValue : OvfUnsupportedAttribute, IEquatable<OvfUnsupportedAttributeValue>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(OvfUnsupportedAttributeValue ovfUnsupportedAttributeValue)\n        {\n            return (ovfUnsupportedAttributeValue != null && this.Value == ovfUnsupportedAttributeValue.Value);\n        }\n\n        public override bool Equals(object ovfUnsupportedAttributeValue)\n        {\n            return Equals(ovfUnsupportedAttributeValue as OvfUnsupportedAttributeValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedDeviceBackingInfo : OvfSystemFault, IEquatable<OvfUnsupportedDeviceBackingInfo>\n    {\n        public string ElementName { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public string BackingName { get; set; }\n\n        public bool Equals(OvfUnsupportedDeviceBackingInfo ovfUnsupportedDeviceBackingInfo)\n        {\n            return (ovfUnsupportedDeviceBackingInfo != null && this.ElementName == ovfUnsupportedDeviceBackingInfo.ElementName && this.InstanceId == ovfUnsupportedDeviceBackingInfo.InstanceId && this.DeviceName == ovfUnsupportedDeviceBackingInfo.DeviceName && this.BackingName == ovfUnsupportedDeviceBackingInfo.BackingName);\n        }\n\n        public override bool Equals(object ovfUnsupportedDeviceBackingInfo)\n        {\n            return Equals(ovfUnsupportedDeviceBackingInfo as OvfUnsupportedDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ElementName + \"_\" + InstanceId + \"_\" + DeviceName + \"_\" + BackingName).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedDeviceBackingOption : OvfSystemFault, IEquatable<OvfUnsupportedDeviceBackingOption>\n    {\n        public string ElementName { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public string BackingName { get; set; }\n\n        public bool Equals(OvfUnsupportedDeviceBackingOption ovfUnsupportedDeviceBackingOption)\n        {\n            return (ovfUnsupportedDeviceBackingOption != null && this.ElementName == ovfUnsupportedDeviceBackingOption.ElementName && this.InstanceId == ovfUnsupportedDeviceBackingOption.InstanceId && this.DeviceName == ovfUnsupportedDeviceBackingOption.DeviceName && this.BackingName == ovfUnsupportedDeviceBackingOption.BackingName);\n        }\n\n        public override bool Equals(object ovfUnsupportedDeviceBackingOption)\n        {\n            return Equals(ovfUnsupportedDeviceBackingOption as OvfUnsupportedDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ElementName + \"_\" + InstanceId + \"_\" + DeviceName + \"_\" + BackingName).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedDeviceExport : OvfHardwareExport, IEquatable<OvfUnsupportedDeviceExport>\n    {\n        public bool Equals(OvfUnsupportedDeviceExport ovfUnsupportedDeviceExport)\n        {\n            return (ovfUnsupportedDeviceExport != null && base.Equals(ovfUnsupportedDeviceExport));\n        }\n\n        public override bool Equals(object ovfUnsupportedDeviceExport)\n        {\n            return Equals(ovfUnsupportedDeviceExport as OvfUnsupportedDeviceExport);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedDiskProvisioning : OvfImport, IEquatable<OvfUnsupportedDiskProvisioning>\n    {\n        public string DiskProvisioning { get; set; }\n\n        public string SupportedDiskProvisioning { get; set; }\n\n        public bool Equals(OvfUnsupportedDiskProvisioning ovfUnsupportedDiskProvisioning)\n        {\n            return (ovfUnsupportedDiskProvisioning != null && this.DiskProvisioning == ovfUnsupportedDiskProvisioning.DiskProvisioning && this.SupportedDiskProvisioning == ovfUnsupportedDiskProvisioning.SupportedDiskProvisioning);\n        }\n\n        public override bool Equals(object ovfUnsupportedDiskProvisioning)\n        {\n            return Equals(ovfUnsupportedDiskProvisioning as OvfUnsupportedDiskProvisioning);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskProvisioning + \"_\" + SupportedDiskProvisioning).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedElement : OvfUnsupportedPackage, IEquatable<OvfUnsupportedElement>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(OvfUnsupportedElement ovfUnsupportedElement)\n        {\n            return (ovfUnsupportedElement != null && this.Name == ovfUnsupportedElement.Name);\n        }\n\n        public override bool Equals(object ovfUnsupportedElement)\n        {\n            return Equals(ovfUnsupportedElement as OvfUnsupportedElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedElementValue : OvfUnsupportedElement, IEquatable<OvfUnsupportedElementValue>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(OvfUnsupportedElementValue ovfUnsupportedElementValue)\n        {\n            return (ovfUnsupportedElementValue != null && this.Value == ovfUnsupportedElementValue.Value);\n        }\n\n        public override bool Equals(object ovfUnsupportedElementValue)\n        {\n            return Equals(ovfUnsupportedElementValue as OvfUnsupportedElementValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedPackage : OvfFault, IEquatable<OvfUnsupportedPackage>\n    {\n        public int? LineNumber { get; set; }\n\n        public bool Equals(OvfUnsupportedPackage ovfUnsupportedPackage)\n        {\n            return (ovfUnsupportedPackage != null && ((this.LineNumber == null && ovfUnsupportedPackage.LineNumber == null) || (this.LineNumber != null && this.LineNumber.Equals(ovfUnsupportedPackage.LineNumber))));\n        }\n\n        public override bool Equals(object ovfUnsupportedPackage)\n        {\n            return Equals(ovfUnsupportedPackage as OvfUnsupportedPackage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LineNumber).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedSection : OvfUnsupportedElement, IEquatable<OvfUnsupportedSection>\n    {\n        public string Info { get; set; }\n\n        public bool Equals(OvfUnsupportedSection ovfUnsupportedSection)\n        {\n            return (ovfUnsupportedSection != null && this.Info == ovfUnsupportedSection.Info);\n        }\n\n        public override bool Equals(object ovfUnsupportedSection)\n        {\n            return Equals(ovfUnsupportedSection as OvfUnsupportedSection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedSubType : OvfUnsupportedPackage, IEquatable<OvfUnsupportedSubType>\n    {\n        public string ElementName { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public int DeviceType { get; set; }\n\n        public string DeviceSubType { get; set; }\n\n        public bool Equals(OvfUnsupportedSubType ovfUnsupportedSubType)\n        {\n            return (ovfUnsupportedSubType != null && this.ElementName == ovfUnsupportedSubType.ElementName && this.InstanceId == ovfUnsupportedSubType.InstanceId && this.DeviceType == ovfUnsupportedSubType.DeviceType && this.DeviceSubType == ovfUnsupportedSubType.DeviceSubType);\n        }\n\n        public override bool Equals(object ovfUnsupportedSubType)\n        {\n            return Equals(ovfUnsupportedSubType as OvfUnsupportedSubType);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ElementName + \"_\" + InstanceId + \"_\" + DeviceType + \"_\" + DeviceSubType).GetHashCode();\n        }\n    }\n\n    public class OvfUnsupportedType : OvfUnsupportedPackage, IEquatable<OvfUnsupportedType>\n    {\n        public string Name { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public int DeviceType { get; set; }\n\n        public bool Equals(OvfUnsupportedType ovfUnsupportedType)\n        {\n            return (ovfUnsupportedType != null && this.Name == ovfUnsupportedType.Name && this.InstanceId == ovfUnsupportedType.InstanceId && this.DeviceType == ovfUnsupportedType.DeviceType);\n        }\n\n        public override bool Equals(object ovfUnsupportedType)\n        {\n            return Equals(ovfUnsupportedType as OvfUnsupportedType);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + InstanceId + \"_\" + DeviceType).GetHashCode();\n        }\n    }\n\n    public class OvfValidateHostParams : OvfManagerCommonParams, IEquatable<OvfValidateHostParams>\n    {\n        public bool Equals(OvfValidateHostParams ovfValidateHostParams)\n        {\n            return (ovfValidateHostParams != null && base.Equals(ovfValidateHostParams));\n        }\n\n        public override bool Equals(object ovfValidateHostParams)\n        {\n            return Equals(ovfValidateHostParams as OvfValidateHostParams);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfValidateHostResult : DynamicData, IEquatable<OvfValidateHostResult>\n    {\n        public long? DownloadSize { get; set; }\n\n        public long? FlatDeploymentSize { get; set; }\n\n        public long? SparseDeploymentSize { get; set; }\n\n        public LocalizedMethodFault[] Error { get; set; }\n\n        public LocalizedMethodFault[] Warning { get; set; }\n\n        public string[] SupportedDiskProvisioning { get; set; }\n\n        public bool Equals(OvfValidateHostResult ovfValidateHostResult)\n        {\n            return (ovfValidateHostResult != null && ((this.DownloadSize == null && ovfValidateHostResult.DownloadSize == null) || (this.DownloadSize != null && this.DownloadSize.Equals(ovfValidateHostResult.DownloadSize))) && ((this.FlatDeploymentSize == null && ovfValidateHostResult.FlatDeploymentSize == null) || (this.FlatDeploymentSize != null && this.FlatDeploymentSize.Equals(ovfValidateHostResult.FlatDeploymentSize))) && ((this.SparseDeploymentSize == null && ovfValidateHostResult.SparseDeploymentSize == null) || (this.SparseDeploymentSize != null && this.SparseDeploymentSize.Equals(ovfValidateHostResult.SparseDeploymentSize))) && ((this.Error == null && ovfValidateHostResult.Error == null) || (this.Error != null && ovfValidateHostResult.Error != null && Enumerable.SequenceEqual(this.Error, ovfValidateHostResult.Error))) && ((this.Warning == null && ovfValidateHostResult.Warning == null) || (this.Warning != null && ovfValidateHostResult.Warning != null && Enumerable.SequenceEqual(this.Warning, ovfValidateHostResult.Warning))) && ((this.SupportedDiskProvisioning == null && ovfValidateHostResult.SupportedDiskProvisioning == null) || (this.SupportedDiskProvisioning != null && ovfValidateHostResult.SupportedDiskProvisioning != null && Enumerable.SequenceEqual(this.SupportedDiskProvisioning, ovfValidateHostResult.SupportedDiskProvisioning))));\n        }\n\n        public override bool Equals(object ovfValidateHostResult)\n        {\n            return Equals(ovfValidateHostResult as OvfValidateHostResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DownloadSize + \"_\" + FlatDeploymentSize + \"_\" + SparseDeploymentSize + \"_\" + Error + \"_\" + Warning + \"_\" + SupportedDiskProvisioning).GetHashCode();\n        }\n    }\n\n    public class OvfWrongElement : OvfElement, IEquatable<OvfWrongElement>\n    {\n        public bool Equals(OvfWrongElement ovfWrongElement)\n        {\n            return (ovfWrongElement != null && base.Equals(ovfWrongElement));\n        }\n\n        public override bool Equals(object ovfWrongElement)\n        {\n            return Equals(ovfWrongElement as OvfWrongElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class OvfWrongNamespace : OvfInvalidPackage, IEquatable<OvfWrongNamespace>\n    {\n        public string NamespaceName { get; set; }\n\n        public bool Equals(OvfWrongNamespace ovfWrongNamespace)\n        {\n            return (ovfWrongNamespace != null && this.NamespaceName == ovfWrongNamespace.NamespaceName);\n        }\n\n        public override bool Equals(object ovfWrongNamespace)\n        {\n            return Equals(ovfWrongNamespace as OvfWrongNamespace);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NamespaceName).GetHashCode();\n        }\n    }\n\n    public class OvfXmlFormat : OvfInvalidPackage, IEquatable<OvfXmlFormat>\n    {\n        public string Description { get; set; }\n\n        public bool Equals(OvfXmlFormat ovfXmlFormat)\n        {\n            return (ovfXmlFormat != null && this.Description == ovfXmlFormat.Description);\n        }\n\n        public override bool Equals(object ovfXmlFormat)\n        {\n            return Equals(ovfXmlFormat as OvfXmlFormat);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description).GetHashCode();\n        }\n    }\n\n    public class ParaVirtualSCSIController : VirtualSCSIController, IEquatable<ParaVirtualSCSIController>\n    {\n        public bool Equals(ParaVirtualSCSIController paraVirtualSCSIController)\n        {\n            return (paraVirtualSCSIController != null && base.Equals(paraVirtualSCSIController));\n        }\n\n        public override bool Equals(object paraVirtualSCSIController)\n        {\n            return Equals(paraVirtualSCSIController as ParaVirtualSCSIController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ParaVirtualSCSIControllerOption : VirtualSCSIControllerOption, IEquatable<ParaVirtualSCSIControllerOption>\n    {\n        public bool Equals(ParaVirtualSCSIControllerOption paraVirtualSCSIControllerOption)\n        {\n            return (paraVirtualSCSIControllerOption != null && base.Equals(paraVirtualSCSIControllerOption));\n        }\n\n        public override bool Equals(object paraVirtualSCSIControllerOption)\n        {\n            return Equals(paraVirtualSCSIControllerOption as ParaVirtualSCSIControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PassiveNodeDeploymentSpec : NodeDeploymentSpec, IEquatable<PassiveNodeDeploymentSpec>\n    {\n        public CustomizationIPSettings FailoverIpSettings { get; set; }\n\n        public new PassiveNodeDeploymentSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PassiveNodeDeploymentSpec passiveNodeDeploymentSpec)\n        {\n            return (passiveNodeDeploymentSpec != null && ((this.FailoverIpSettings == null && passiveNodeDeploymentSpec.FailoverIpSettings == null) || (this.FailoverIpSettings != null && this.FailoverIpSettings.Equals(passiveNodeDeploymentSpec.FailoverIpSettings))) && ((this.LinkedView == null && passiveNodeDeploymentSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(passiveNodeDeploymentSpec.LinkedView))));\n        }\n\n        public override bool Equals(object passiveNodeDeploymentSpec)\n        {\n            return Equals(passiveNodeDeploymentSpec as PassiveNodeDeploymentSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailoverIpSettings + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PassiveNodeDeploymentSpec_LinkedView : NodeDeploymentSpec_LinkedView, IEquatable<PassiveNodeDeploymentSpec_LinkedView>\n    {\n        public bool Equals(PassiveNodeDeploymentSpec_LinkedView passiveNodeDeploymentSpec_LinkedView)\n        {\n            return (passiveNodeDeploymentSpec_LinkedView != null && base.Equals(passiveNodeDeploymentSpec_LinkedView));\n        }\n\n        public override bool Equals(object passiveNodeDeploymentSpec_LinkedView)\n        {\n            return Equals(passiveNodeDeploymentSpec_LinkedView as PassiveNodeDeploymentSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PassiveNodeNetworkSpec : NodeNetworkSpec, IEquatable<PassiveNodeNetworkSpec>\n    {\n        public CustomizationIPSettings FailoverIpSettings { get; set; }\n\n        public bool Equals(PassiveNodeNetworkSpec passiveNodeNetworkSpec)\n        {\n            return (passiveNodeNetworkSpec != null && ((this.FailoverIpSettings == null && passiveNodeNetworkSpec.FailoverIpSettings == null) || (this.FailoverIpSettings != null && this.FailoverIpSettings.Equals(passiveNodeNetworkSpec.FailoverIpSettings))));\n        }\n\n        public override bool Equals(object passiveNodeNetworkSpec)\n        {\n            return Equals(passiveNodeNetworkSpec as PassiveNodeNetworkSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailoverIpSettings).GetHashCode();\n        }\n    }\n\n    public class PasswordField : DynamicData, IEquatable<PasswordField>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(PasswordField passwordField)\n        {\n            return (passwordField != null && this.Value == passwordField.Value);\n        }\n\n        public override bool Equals(object passwordField)\n        {\n            return Equals(passwordField as PasswordField);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class PatchAlreadyInstalled : PatchNotApplicable, IEquatable<PatchAlreadyInstalled>\n    {\n        public bool Equals(PatchAlreadyInstalled patchAlreadyInstalled)\n        {\n            return (patchAlreadyInstalled != null && base.Equals(patchAlreadyInstalled));\n        }\n\n        public override bool Equals(object patchAlreadyInstalled)\n        {\n            return Equals(patchAlreadyInstalled as PatchAlreadyInstalled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PatchBinariesNotFound : VimFault, IEquatable<PatchBinariesNotFound>\n    {\n        public string PatchID { get; set; }\n\n        public string[] Binary { get; set; }\n\n        public bool Equals(PatchBinariesNotFound patchBinariesNotFound)\n        {\n            return (patchBinariesNotFound != null && this.PatchID == patchBinariesNotFound.PatchID && ((this.Binary == null && patchBinariesNotFound.Binary == null) || (this.Binary != null && patchBinariesNotFound.Binary != null && Enumerable.SequenceEqual(this.Binary, patchBinariesNotFound.Binary))));\n        }\n\n        public override bool Equals(object patchBinariesNotFound)\n        {\n            return Equals(patchBinariesNotFound as PatchBinariesNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PatchID + \"_\" + Binary).GetHashCode();\n        }\n    }\n\n    public class PatchInstallFailed : PlatformConfigFault, IEquatable<PatchInstallFailed>\n    {\n        public bool RolledBack { get; set; }\n\n        public bool Equals(PatchInstallFailed patchInstallFailed)\n        {\n            return (patchInstallFailed != null && this.RolledBack == patchInstallFailed.RolledBack);\n        }\n\n        public override bool Equals(object patchInstallFailed)\n        {\n            return Equals(patchInstallFailed as PatchInstallFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RolledBack).GetHashCode();\n        }\n    }\n\n    public class PatchIntegrityError : PlatformConfigFault, IEquatable<PatchIntegrityError>\n    {\n        public bool Equals(PatchIntegrityError patchIntegrityError)\n        {\n            return (patchIntegrityError != null && base.Equals(patchIntegrityError));\n        }\n\n        public override bool Equals(object patchIntegrityError)\n        {\n            return Equals(patchIntegrityError as PatchIntegrityError);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PatchMetadataCorrupted : PatchMetadataInvalid, IEquatable<PatchMetadataCorrupted>\n    {\n        public bool Equals(PatchMetadataCorrupted patchMetadataCorrupted)\n        {\n            return (patchMetadataCorrupted != null && base.Equals(patchMetadataCorrupted));\n        }\n\n        public override bool Equals(object patchMetadataCorrupted)\n        {\n            return Equals(patchMetadataCorrupted as PatchMetadataCorrupted);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PatchMetadataInvalid : VimFault, IEquatable<PatchMetadataInvalid>\n    {\n        public string PatchID { get; set; }\n\n        public string[] MetaData { get; set; }\n\n        public bool Equals(PatchMetadataInvalid patchMetadataInvalid)\n        {\n            return (patchMetadataInvalid != null && this.PatchID == patchMetadataInvalid.PatchID && ((this.MetaData == null && patchMetadataInvalid.MetaData == null) || (this.MetaData != null && patchMetadataInvalid.MetaData != null && Enumerable.SequenceEqual(this.MetaData, patchMetadataInvalid.MetaData))));\n        }\n\n        public override bool Equals(object patchMetadataInvalid)\n        {\n            return Equals(patchMetadataInvalid as PatchMetadataInvalid);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PatchID + \"_\" + MetaData).GetHashCode();\n        }\n    }\n\n    public class PatchMetadataNotFound : PatchMetadataInvalid, IEquatable<PatchMetadataNotFound>\n    {\n        public bool Equals(PatchMetadataNotFound patchMetadataNotFound)\n        {\n            return (patchMetadataNotFound != null && base.Equals(patchMetadataNotFound));\n        }\n\n        public override bool Equals(object patchMetadataNotFound)\n        {\n            return Equals(patchMetadataNotFound as PatchMetadataNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PatchMissingDependencies : PatchNotApplicable, IEquatable<PatchMissingDependencies>\n    {\n        public string[] PrerequisitePatch { get; set; }\n\n        public string[] PrerequisiteLib { get; set; }\n\n        public bool Equals(PatchMissingDependencies patchMissingDependencies)\n        {\n            return (patchMissingDependencies != null && ((this.PrerequisitePatch == null && patchMissingDependencies.PrerequisitePatch == null) || (this.PrerequisitePatch != null && patchMissingDependencies.PrerequisitePatch != null && Enumerable.SequenceEqual(this.PrerequisitePatch, patchMissingDependencies.PrerequisitePatch))) && ((this.PrerequisiteLib == null && patchMissingDependencies.PrerequisiteLib == null) || (this.PrerequisiteLib != null && patchMissingDependencies.PrerequisiteLib != null && Enumerable.SequenceEqual(this.PrerequisiteLib, patchMissingDependencies.PrerequisiteLib))));\n        }\n\n        public override bool Equals(object patchMissingDependencies)\n        {\n            return Equals(patchMissingDependencies as PatchMissingDependencies);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrerequisitePatch + \"_\" + PrerequisiteLib).GetHashCode();\n        }\n    }\n\n    public class PatchNotApplicable : VimFault, IEquatable<PatchNotApplicable>\n    {\n        public string PatchID { get; set; }\n\n        public bool Equals(PatchNotApplicable patchNotApplicable)\n        {\n            return (patchNotApplicable != null && this.PatchID == patchNotApplicable.PatchID);\n        }\n\n        public override bool Equals(object patchNotApplicable)\n        {\n            return Equals(patchNotApplicable as PatchNotApplicable);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PatchID).GetHashCode();\n        }\n    }\n\n    public class PatchSuperseded : PatchNotApplicable, IEquatable<PatchSuperseded>\n    {\n        public string[] Supersede { get; set; }\n\n        public bool Equals(PatchSuperseded patchSuperseded)\n        {\n            return (patchSuperseded != null && ((this.Supersede == null && patchSuperseded.Supersede == null) || (this.Supersede != null && patchSuperseded.Supersede != null && Enumerable.SequenceEqual(this.Supersede, patchSuperseded.Supersede))));\n        }\n\n        public override bool Equals(object patchSuperseded)\n        {\n            return Equals(patchSuperseded as PatchSuperseded);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Supersede).GetHashCode();\n        }\n    }\n\n    public class PerfCompositeMetric : DynamicData, IEquatable<PerfCompositeMetric>\n    {\n        public PerfEntityMetricBase Entity { get; set; }\n\n        public PerfEntityMetricBase[] ChildEntity { get; set; }\n\n        public bool Equals(PerfCompositeMetric perfCompositeMetric)\n        {\n            return (perfCompositeMetric != null && ((this.Entity == null && perfCompositeMetric.Entity == null) || (this.Entity != null && this.Entity.Equals(perfCompositeMetric.Entity))) && ((this.ChildEntity == null && perfCompositeMetric.ChildEntity == null) || (this.ChildEntity != null && perfCompositeMetric.ChildEntity != null && Enumerable.SequenceEqual(this.ChildEntity, perfCompositeMetric.ChildEntity))));\n        }\n\n        public override bool Equals(object perfCompositeMetric)\n        {\n            return Equals(perfCompositeMetric as PerfCompositeMetric);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + ChildEntity).GetHashCode();\n        }\n    }\n\n    public class PerfCounterInfo : DynamicData, IEquatable<PerfCounterInfo>\n    {\n        public int Key { get; set; }\n\n        public ElementDescription NameInfo { get; set; }\n\n        public ElementDescription GroupInfo { get; set; }\n\n        public ElementDescription UnitInfo { get; set; }\n\n        public PerfSummaryType RollupType { get; set; }\n\n        public PerfStatsType StatsType { get; set; }\n\n        public int? Level { get; set; }\n\n        public int? PerDeviceLevel { get; set; }\n\n        public int[] AssociatedCounterId { get; set; }\n\n        public bool Equals(PerfCounterInfo perfCounterInfo)\n        {\n            return (perfCounterInfo != null && this.Key == perfCounterInfo.Key && ((this.NameInfo == null && perfCounterInfo.NameInfo == null) || (this.NameInfo != null && this.NameInfo.Equals(perfCounterInfo.NameInfo))) && ((this.GroupInfo == null && perfCounterInfo.GroupInfo == null) || (this.GroupInfo != null && this.GroupInfo.Equals(perfCounterInfo.GroupInfo))) && ((this.UnitInfo == null && perfCounterInfo.UnitInfo == null) || (this.UnitInfo != null && this.UnitInfo.Equals(perfCounterInfo.UnitInfo))) && this.RollupType == perfCounterInfo.RollupType && this.StatsType == perfCounterInfo.StatsType && ((this.Level == null && perfCounterInfo.Level == null) || (this.Level != null && this.Level.Equals(perfCounterInfo.Level))) && ((this.PerDeviceLevel == null && perfCounterInfo.PerDeviceLevel == null) || (this.PerDeviceLevel != null && this.PerDeviceLevel.Equals(perfCounterInfo.PerDeviceLevel))) && ((this.AssociatedCounterId == null && perfCounterInfo.AssociatedCounterId == null) || (this.AssociatedCounterId != null && perfCounterInfo.AssociatedCounterId != null && Enumerable.SequenceEqual(this.AssociatedCounterId, perfCounterInfo.AssociatedCounterId))));\n        }\n\n        public override bool Equals(object perfCounterInfo)\n        {\n            return Equals(perfCounterInfo as PerfCounterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + NameInfo + \"_\" + GroupInfo + \"_\" + UnitInfo + \"_\" + RollupType + \"_\" + StatsType + \"_\" + Level + \"_\" + PerDeviceLevel + \"_\" + AssociatedCounterId).GetHashCode();\n        }\n    }\n\n    public class PerfEntityMetric : PerfEntityMetricBase, IEquatable<PerfEntityMetric>\n    {\n        public PerfSampleInfo[] SampleInfo { get; set; }\n\n        public PerfMetricSeries[] Value { get; set; }\n\n        public bool Equals(PerfEntityMetric perfEntityMetric)\n        {\n            return (perfEntityMetric != null && ((this.SampleInfo == null && perfEntityMetric.SampleInfo == null) || (this.SampleInfo != null && perfEntityMetric.SampleInfo != null && Enumerable.SequenceEqual(this.SampleInfo, perfEntityMetric.SampleInfo))) && ((this.Value == null && perfEntityMetric.Value == null) || (this.Value != null && perfEntityMetric.Value != null && Enumerable.SequenceEqual(this.Value, perfEntityMetric.Value))));\n        }\n\n        public override bool Equals(object perfEntityMetric)\n        {\n            return Equals(perfEntityMetric as PerfEntityMetric);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SampleInfo + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class PerfEntityMetricBase : DynamicData, IEquatable<PerfEntityMetricBase>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public bool Equals(PerfEntityMetricBase perfEntityMetricBase)\n        {\n            return (perfEntityMetricBase != null && ((this.Entity == null && perfEntityMetricBase.Entity == null) || (this.Entity != null && this.Entity.Equals(perfEntityMetricBase.Entity))));\n        }\n\n        public override bool Equals(object perfEntityMetricBase)\n        {\n            return Equals(perfEntityMetricBase as PerfEntityMetricBase);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class PerfEntityMetricCSV : PerfEntityMetricBase, IEquatable<PerfEntityMetricCSV>\n    {\n        public string SampleInfoCSV { get; set; }\n\n        public PerfMetricSeriesCSV[] Value { get; set; }\n\n        public bool Equals(PerfEntityMetricCSV perfEntityMetricCSV)\n        {\n            return (perfEntityMetricCSV != null && this.SampleInfoCSV == perfEntityMetricCSV.SampleInfoCSV && ((this.Value == null && perfEntityMetricCSV.Value == null) || (this.Value != null && perfEntityMetricCSV.Value != null && Enumerable.SequenceEqual(this.Value, perfEntityMetricCSV.Value))));\n        }\n\n        public override bool Equals(object perfEntityMetricCSV)\n        {\n            return Equals(perfEntityMetricCSV as PerfEntityMetricCSV);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SampleInfoCSV + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class PerfInterval : DynamicData, IEquatable<PerfInterval>\n    {\n        public int Key { get; set; }\n\n        public int SamplingPeriod { get; set; }\n\n        public string Name { get; set; }\n\n        public int Length { get; set; }\n\n        public int? Level { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public bool Equals(PerfInterval perfInterval)\n        {\n            return (perfInterval != null && this.Key == perfInterval.Key && this.SamplingPeriod == perfInterval.SamplingPeriod && this.Name == perfInterval.Name && this.Length == perfInterval.Length && ((this.Level == null && perfInterval.Level == null) || (this.Level != null && this.Level.Equals(perfInterval.Level))) && this.Enabled == perfInterval.Enabled);\n        }\n\n        public override bool Equals(object perfInterval)\n        {\n            return Equals(perfInterval as PerfInterval);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + SamplingPeriod + \"_\" + Name + \"_\" + Length + \"_\" + Level + \"_\" + Enabled).GetHashCode();\n        }\n    }\n\n    public class PerfMetricId : DynamicData, IEquatable<PerfMetricId>\n    {\n        public int CounterId { get; set; }\n\n        public string Instance { get; set; }\n\n        public bool Equals(PerfMetricId perfMetricId)\n        {\n            return (perfMetricId != null && this.CounterId == perfMetricId.CounterId && this.Instance == perfMetricId.Instance);\n        }\n\n        public override bool Equals(object perfMetricId)\n        {\n            return Equals(perfMetricId as PerfMetricId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CounterId + \"_\" + Instance).GetHashCode();\n        }\n    }\n\n    public class PerfMetricIntSeries : PerfMetricSeries, IEquatable<PerfMetricIntSeries>\n    {\n        public long[] Value { get; set; }\n\n        public bool Equals(PerfMetricIntSeries perfMetricIntSeries)\n        {\n            return (perfMetricIntSeries != null && ((this.Value == null && perfMetricIntSeries.Value == null) || (this.Value != null && perfMetricIntSeries.Value != null && Enumerable.SequenceEqual(this.Value, perfMetricIntSeries.Value))));\n        }\n\n        public override bool Equals(object perfMetricIntSeries)\n        {\n            return Equals(perfMetricIntSeries as PerfMetricIntSeries);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class PerfMetricSeries : DynamicData, IEquatable<PerfMetricSeries>\n    {\n        public PerfMetricId Id { get; set; }\n\n        public bool Equals(PerfMetricSeries perfMetricSeries)\n        {\n            return (perfMetricSeries != null && ((this.Id == null && perfMetricSeries.Id == null) || (this.Id != null && this.Id.Equals(perfMetricSeries.Id))));\n        }\n\n        public override bool Equals(object perfMetricSeries)\n        {\n            return Equals(perfMetricSeries as PerfMetricSeries);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id).GetHashCode();\n        }\n    }\n\n    public class PerfMetricSeriesCSV : PerfMetricSeries, IEquatable<PerfMetricSeriesCSV>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(PerfMetricSeriesCSV perfMetricSeriesCSV)\n        {\n            return (perfMetricSeriesCSV != null && this.Value == perfMetricSeriesCSV.Value);\n        }\n\n        public override bool Equals(object perfMetricSeriesCSV)\n        {\n            return Equals(perfMetricSeriesCSV as PerfMetricSeriesCSV);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class PerformanceDescription : DynamicData, IEquatable<PerformanceDescription>\n    {\n        public ElementDescription[] CounterType { get; set; }\n\n        public ElementDescription[] StatsType { get; set; }\n\n        public bool Equals(PerformanceDescription performanceDescription)\n        {\n            return (performanceDescription != null && ((this.CounterType == null && performanceDescription.CounterType == null) || (this.CounterType != null && performanceDescription.CounterType != null && Enumerable.SequenceEqual(this.CounterType, performanceDescription.CounterType))) && ((this.StatsType == null && performanceDescription.StatsType == null) || (this.StatsType != null && performanceDescription.StatsType != null && Enumerable.SequenceEqual(this.StatsType, performanceDescription.StatsType))));\n        }\n\n        public override bool Equals(object performanceDescription)\n        {\n            return Equals(performanceDescription as PerformanceDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CounterType + \"_\" + StatsType).GetHashCode();\n        }\n    }\n\n    public class PerformanceManager : ViewBase, IEquatable<PerformanceManager>\n    {\n        public PerformanceDescription Description { get; set; }\n\n        public PerfInterval[] HistoricalInterval { get; set; }\n\n        public PerfCounterInfo[] PerfCounter { get; set; }\n\n        public PerfProviderSummary QueryPerfProviderSummary(ManagedObjectReference entity)\n        {\n            return default(PerfProviderSummary);\n        }\n\n        public PerfMetricId[] QueryAvailablePerfMetric(ManagedObjectReference entity, DateTime? beginTime, DateTime? endTime, int? intervalId)\n        {\n            return default(PerfMetricId[]);\n        }\n\n        public PerfCounterInfo[] QueryPerfCounter(int[] counterId)\n        {\n            return default(PerfCounterInfo[]);\n        }\n\n        public PerfCounterInfo[] QueryPerfCounterByLevel(int level)\n        {\n            return default(PerfCounterInfo[]);\n        }\n\n        public PerfEntityMetricBase[] QueryPerf(PerfQuerySpec[] querySpec)\n        {\n            return default(PerfEntityMetricBase[]);\n        }\n\n        public PerfCompositeMetric QueryPerfComposite(PerfQuerySpec querySpec)\n        {\n            return default(PerfCompositeMetric);\n        }\n\n        public void CreatePerfInterval(PerfInterval intervalId)\n        {\n        }\n\n        public void RemovePerfInterval(int samplePeriod)\n        {\n        }\n\n        public void UpdatePerfInterval(PerfInterval interval)\n        {\n        }\n\n        public void UpdateCounterLevelMapping(PerformanceManagerCounterLevelMapping[] counterLevelMap)\n        {\n        }\n\n        public void ResetCounterLevelMapping(int[] counters)\n        {\n        }\n\n        public bool Equals(PerformanceManager performanceManager)\n        {\n            return (performanceManager != null && ((this.Description == null && performanceManager.Description == null) || (this.Description != null && this.Description.Equals(performanceManager.Description))) && ((this.HistoricalInterval == null && performanceManager.HistoricalInterval == null) || (this.HistoricalInterval != null && performanceManager.HistoricalInterval != null && Enumerable.SequenceEqual(this.HistoricalInterval, performanceManager.HistoricalInterval))) && ((this.PerfCounter == null && performanceManager.PerfCounter == null) || (this.PerfCounter != null && performanceManager.PerfCounter != null && Enumerable.SequenceEqual(this.PerfCounter, performanceManager.PerfCounter))));\n        }\n\n        public override bool Equals(object performanceManager)\n        {\n            return Equals(performanceManager as PerformanceManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + HistoricalInterval + \"_\" + PerfCounter).GetHashCode();\n        }\n    }\n\n    public class PerformanceManagerCounterLevelMapping : DynamicData, IEquatable<PerformanceManagerCounterLevelMapping>\n    {\n        public int CounterId { get; set; }\n\n        public int? AggregateLevel { get; set; }\n\n        public int? PerDeviceLevel { get; set; }\n\n        public bool Equals(PerformanceManagerCounterLevelMapping performanceManagerCounterLevelMapping)\n        {\n            return (performanceManagerCounterLevelMapping != null && this.CounterId == performanceManagerCounterLevelMapping.CounterId && ((this.AggregateLevel == null && performanceManagerCounterLevelMapping.AggregateLevel == null) || (this.AggregateLevel != null && this.AggregateLevel.Equals(performanceManagerCounterLevelMapping.AggregateLevel))) && ((this.PerDeviceLevel == null && performanceManagerCounterLevelMapping.PerDeviceLevel == null) || (this.PerDeviceLevel != null && this.PerDeviceLevel.Equals(performanceManagerCounterLevelMapping.PerDeviceLevel))));\n        }\n\n        public override bool Equals(object performanceManagerCounterLevelMapping)\n        {\n            return Equals(performanceManagerCounterLevelMapping as PerformanceManagerCounterLevelMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CounterId + \"_\" + AggregateLevel + \"_\" + PerDeviceLevel).GetHashCode();\n        }\n    }\n\n    public class PerformanceStatisticsDescription : DynamicData, IEquatable<PerformanceStatisticsDescription>\n    {\n        public PerfInterval[] Intervals { get; set; }\n\n        public bool Equals(PerformanceStatisticsDescription performanceStatisticsDescription)\n        {\n            return (performanceStatisticsDescription != null && ((this.Intervals == null && performanceStatisticsDescription.Intervals == null) || (this.Intervals != null && performanceStatisticsDescription.Intervals != null && Enumerable.SequenceEqual(this.Intervals, performanceStatisticsDescription.Intervals))));\n        }\n\n        public override bool Equals(object performanceStatisticsDescription)\n        {\n            return Equals(performanceStatisticsDescription as PerformanceStatisticsDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Intervals).GetHashCode();\n        }\n    }\n\n    public class PerfProviderSummary : DynamicData, IEquatable<PerfProviderSummary>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public bool CurrentSupported { get; set; }\n\n        public bool SummarySupported { get; set; }\n\n        public int? RefreshRate { get; set; }\n\n        public bool Equals(PerfProviderSummary perfProviderSummary)\n        {\n            return (perfProviderSummary != null && ((this.Entity == null && perfProviderSummary.Entity == null) || (this.Entity != null && this.Entity.Equals(perfProviderSummary.Entity))) && this.CurrentSupported == perfProviderSummary.CurrentSupported && this.SummarySupported == perfProviderSummary.SummarySupported && ((this.RefreshRate == null && perfProviderSummary.RefreshRate == null) || (this.RefreshRate != null && this.RefreshRate.Equals(perfProviderSummary.RefreshRate))));\n        }\n\n        public override bool Equals(object perfProviderSummary)\n        {\n            return Equals(perfProviderSummary as PerfProviderSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + CurrentSupported + \"_\" + SummarySupported + \"_\" + RefreshRate).GetHashCode();\n        }\n    }\n\n    public class PerfQuerySpec : DynamicData, IEquatable<PerfQuerySpec>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public DateTime? StartTime { get; set; }\n\n        public DateTime? EndTime { get; set; }\n\n        public int? MaxSample { get; set; }\n\n        public PerfMetricId[] MetricId { get; set; }\n\n        public int? IntervalId { get; set; }\n\n        public string Format { get; set; }\n\n        public bool Equals(PerfQuerySpec perfQuerySpec)\n        {\n            return (perfQuerySpec != null && ((this.Entity == null && perfQuerySpec.Entity == null) || (this.Entity != null && this.Entity.Equals(perfQuerySpec.Entity))) && ((this.StartTime == null && perfQuerySpec.StartTime == null) || (this.StartTime != null && this.StartTime.Equals(perfQuerySpec.StartTime))) && ((this.EndTime == null && perfQuerySpec.EndTime == null) || (this.EndTime != null && this.EndTime.Equals(perfQuerySpec.EndTime))) && ((this.MaxSample == null && perfQuerySpec.MaxSample == null) || (this.MaxSample != null && this.MaxSample.Equals(perfQuerySpec.MaxSample))) && ((this.MetricId == null && perfQuerySpec.MetricId == null) || (this.MetricId != null && perfQuerySpec.MetricId != null && Enumerable.SequenceEqual(this.MetricId, perfQuerySpec.MetricId))) && ((this.IntervalId == null && perfQuerySpec.IntervalId == null) || (this.IntervalId != null && this.IntervalId.Equals(perfQuerySpec.IntervalId))) && this.Format == perfQuerySpec.Format);\n        }\n\n        public override bool Equals(object perfQuerySpec)\n        {\n            return Equals(perfQuerySpec as PerfQuerySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + StartTime + \"_\" + EndTime + \"_\" + MaxSample + \"_\" + MetricId + \"_\" + IntervalId + \"_\" + Format).GetHashCode();\n        }\n    }\n\n    public class PerfSampleInfo : DynamicData, IEquatable<PerfSampleInfo>\n    {\n        public DateTime Timestamp { get; set; }\n\n        public int Interval { get; set; }\n\n        public bool Equals(PerfSampleInfo perfSampleInfo)\n        {\n            return (perfSampleInfo != null && this.Timestamp == perfSampleInfo.Timestamp && this.Interval == perfSampleInfo.Interval);\n        }\n\n        public override bool Equals(object perfSampleInfo)\n        {\n            return Equals(perfSampleInfo as PerfSampleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Timestamp + \"_\" + Interval).GetHashCode();\n        }\n    }\n\n    public class Permission : DynamicData, IEquatable<Permission>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public string Principal { get; set; }\n\n        public bool Group { get; set; }\n\n        public int RoleId { get; set; }\n\n        public bool Propagate { get; set; }\n\n        public Permission_LinkedView LinkedView { get; set; }\n\n        public bool Equals(Permission permission)\n        {\n            return (permission != null && ((this.Entity == null && permission.Entity == null) || (this.Entity != null && this.Entity.Equals(permission.Entity))) && this.Principal == permission.Principal && this.Group == permission.Group && this.RoleId == permission.RoleId && this.Propagate == permission.Propagate && ((this.LinkedView == null && permission.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(permission.LinkedView))));\n        }\n\n        public override bool Equals(object permission)\n        {\n            return Equals(permission as Permission);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Principal + \"_\" + Group + \"_\" + RoleId + \"_\" + Propagate + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class Permission_LinkedView : IEquatable<Permission_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(Permission_LinkedView permission_LinkedView)\n        {\n            return (permission_LinkedView != null && ((this.Entity == null && permission_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(permission_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object permission_LinkedView)\n        {\n            return Equals(permission_LinkedView as Permission_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class PermissionAddedEvent : PermissionEvent, IEquatable<PermissionAddedEvent>\n    {\n        public RoleEventArgument Role { get; set; }\n\n        public bool Propagate { get; set; }\n\n        public bool Equals(PermissionAddedEvent permissionAddedEvent)\n        {\n            return (permissionAddedEvent != null && ((this.Role == null && permissionAddedEvent.Role == null) || (this.Role != null && this.Role.Equals(permissionAddedEvent.Role))) && this.Propagate == permissionAddedEvent.Propagate);\n        }\n\n        public override bool Equals(object permissionAddedEvent)\n        {\n            return Equals(permissionAddedEvent as PermissionAddedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Role + \"_\" + Propagate).GetHashCode();\n        }\n    }\n\n    public class PermissionEvent : AuthorizationEvent, IEquatable<PermissionEvent>\n    {\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public string Principal { get; set; }\n\n        public bool Group { get; set; }\n\n        public bool Equals(PermissionEvent permissionEvent)\n        {\n            return (permissionEvent != null && ((this.Entity == null && permissionEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(permissionEvent.Entity))) && this.Principal == permissionEvent.Principal && this.Group == permissionEvent.Group);\n        }\n\n        public override bool Equals(object permissionEvent)\n        {\n            return Equals(permissionEvent as PermissionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Principal + \"_\" + Group).GetHashCode();\n        }\n    }\n\n    public class PermissionProfile : ApplyProfile, IEquatable<PermissionProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(PermissionProfile permissionProfile)\n        {\n            return (permissionProfile != null && this.Key == permissionProfile.Key);\n        }\n\n        public override bool Equals(object permissionProfile)\n        {\n            return Equals(permissionProfile as PermissionProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class PermissionRemovedEvent : PermissionEvent, IEquatable<PermissionRemovedEvent>\n    {\n        public bool Equals(PermissionRemovedEvent permissionRemovedEvent)\n        {\n            return (permissionRemovedEvent != null && base.Equals(permissionRemovedEvent));\n        }\n\n        public override bool Equals(object permissionRemovedEvent)\n        {\n            return Equals(permissionRemovedEvent as PermissionRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PermissionUpdatedEvent : PermissionEvent, IEquatable<PermissionUpdatedEvent>\n    {\n        public RoleEventArgument Role { get; set; }\n\n        public bool Propagate { get; set; }\n\n        public RoleEventArgument PrevRole { get; set; }\n\n        public bool? PrevPropagate { get; set; }\n\n        public bool Equals(PermissionUpdatedEvent permissionUpdatedEvent)\n        {\n            return (permissionUpdatedEvent != null && ((this.Role == null && permissionUpdatedEvent.Role == null) || (this.Role != null && this.Role.Equals(permissionUpdatedEvent.Role))) && this.Propagate == permissionUpdatedEvent.Propagate && ((this.PrevRole == null && permissionUpdatedEvent.PrevRole == null) || (this.PrevRole != null && this.PrevRole.Equals(permissionUpdatedEvent.PrevRole))) && ((this.PrevPropagate == null && permissionUpdatedEvent.PrevPropagate == null) || (this.PrevPropagate != null && this.PrevPropagate.Equals(permissionUpdatedEvent.PrevPropagate))));\n        }\n\n        public override bool Equals(object permissionUpdatedEvent)\n        {\n            return Equals(permissionUpdatedEvent as PermissionUpdatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Role + \"_\" + Propagate + \"_\" + PrevRole + \"_\" + PrevPropagate).GetHashCode();\n        }\n    }\n\n    public class PhysCompatRDMNotSupported : RDMNotSupported, IEquatable<PhysCompatRDMNotSupported>\n    {\n        public bool Equals(PhysCompatRDMNotSupported physCompatRDMNotSupported)\n        {\n            return (physCompatRDMNotSupported != null && base.Equals(physCompatRDMNotSupported));\n        }\n\n        public override bool Equals(object physCompatRDMNotSupported)\n        {\n            return Equals(physCompatRDMNotSupported as PhysCompatRDMNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class PhysicalNic : DynamicData, IEquatable<PhysicalNic>\n    {\n        public string Key { get; set; }\n\n        public string Device { get; set; }\n\n        public string Pci { get; set; }\n\n        public string Driver { get; set; }\n\n        public PhysicalNicLinkInfo LinkSpeed { get; set; }\n\n        public PhysicalNicLinkInfo[] ValidLinkSpecification { get; set; }\n\n        public PhysicalNicSpec Spec { get; set; }\n\n        public bool WakeOnLanSupported { get; set; }\n\n        public string Mac { get; set; }\n\n        public FcoeConfig FcoeConfiguration { get; set; }\n\n        public bool? VmDirectPathGen2Supported { get; set; }\n\n        public string VmDirectPathGen2SupportedMode { get; set; }\n\n        public bool? ResourcePoolSchedulerAllowed { get; set; }\n\n        public string[] ResourcePoolSchedulerDisallowedReason { get; set; }\n\n        public bool? AutoNegotiateSupported { get; set; }\n\n        public bool? EnhancedNetworkingStackSupported { get; set; }\n\n        public bool Equals(PhysicalNic physicalNic)\n        {\n            return (physicalNic != null && this.Key == physicalNic.Key && this.Device == physicalNic.Device && this.Pci == physicalNic.Pci && this.Driver == physicalNic.Driver && ((this.LinkSpeed == null && physicalNic.LinkSpeed == null) || (this.LinkSpeed != null && this.LinkSpeed.Equals(physicalNic.LinkSpeed))) && ((this.ValidLinkSpecification == null && physicalNic.ValidLinkSpecification == null) || (this.ValidLinkSpecification != null && physicalNic.ValidLinkSpecification != null && Enumerable.SequenceEqual(this.ValidLinkSpecification, physicalNic.ValidLinkSpecification))) && ((this.Spec == null && physicalNic.Spec == null) || (this.Spec != null && this.Spec.Equals(physicalNic.Spec))) && this.WakeOnLanSupported == physicalNic.WakeOnLanSupported && this.Mac == physicalNic.Mac && ((this.FcoeConfiguration == null && physicalNic.FcoeConfiguration == null) || (this.FcoeConfiguration != null && this.FcoeConfiguration.Equals(physicalNic.FcoeConfiguration))) && ((this.VmDirectPathGen2Supported == null && physicalNic.VmDirectPathGen2Supported == null) || (this.VmDirectPathGen2Supported != null && this.VmDirectPathGen2Supported.Equals(physicalNic.VmDirectPathGen2Supported))) && this.VmDirectPathGen2SupportedMode == physicalNic.VmDirectPathGen2SupportedMode && ((this.ResourcePoolSchedulerAllowed == null && physicalNic.ResourcePoolSchedulerAllowed == null) || (this.ResourcePoolSchedulerAllowed != null && this.ResourcePoolSchedulerAllowed.Equals(physicalNic.ResourcePoolSchedulerAllowed))) && ((this.ResourcePoolSchedulerDisallowedReason == null && physicalNic.ResourcePoolSchedulerDisallowedReason == null) || (this.ResourcePoolSchedulerDisallowedReason != null && physicalNic.ResourcePoolSchedulerDisallowedReason != null && Enumerable.SequenceEqual(this.ResourcePoolSchedulerDisallowedReason, physicalNic.ResourcePoolSchedulerDisallowedReason))) && ((this.AutoNegotiateSupported == null && physicalNic.AutoNegotiateSupported == null) || (this.AutoNegotiateSupported != null && this.AutoNegotiateSupported.Equals(physicalNic.AutoNegotiateSupported))) && ((this.EnhancedNetworkingStackSupported == null && physicalNic.EnhancedNetworkingStackSupported == null) || (this.EnhancedNetworkingStackSupported != null && this.EnhancedNetworkingStackSupported.Equals(physicalNic.EnhancedNetworkingStackSupported))));\n        }\n\n        public override bool Equals(object physicalNic)\n        {\n            return Equals(physicalNic as PhysicalNic);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Device + \"_\" + Pci + \"_\" + Driver + \"_\" + LinkSpeed + \"_\" + ValidLinkSpecification + \"_\" + Spec + \"_\" + WakeOnLanSupported + \"_\" + Mac + \"_\" + FcoeConfiguration + \"_\" + VmDirectPathGen2Supported + \"_\" + VmDirectPathGen2SupportedMode + \"_\" + ResourcePoolSchedulerAllowed + \"_\" + ResourcePoolSchedulerDisallowedReason + \"_\" + AutoNegotiateSupported + \"_\" + EnhancedNetworkingStackSupported).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicCdpDeviceCapability : DynamicData, IEquatable<PhysicalNicCdpDeviceCapability>\n    {\n        public bool Router { get; set; }\n\n        public bool TransparentBridge { get; set; }\n\n        public bool SourceRouteBridge { get; set; }\n\n        public bool NetworkSwitch { get; set; }\n\n        public bool Host { get; set; }\n\n        public bool IgmpEnabled { get; set; }\n\n        public bool Repeater { get; set; }\n\n        public bool Equals(PhysicalNicCdpDeviceCapability physicalNicCdpDeviceCapability)\n        {\n            return (physicalNicCdpDeviceCapability != null && this.Router == physicalNicCdpDeviceCapability.Router && this.TransparentBridge == physicalNicCdpDeviceCapability.TransparentBridge && this.SourceRouteBridge == physicalNicCdpDeviceCapability.SourceRouteBridge && this.NetworkSwitch == physicalNicCdpDeviceCapability.NetworkSwitch && this.Host == physicalNicCdpDeviceCapability.Host && this.IgmpEnabled == physicalNicCdpDeviceCapability.IgmpEnabled && this.Repeater == physicalNicCdpDeviceCapability.Repeater);\n        }\n\n        public override bool Equals(object physicalNicCdpDeviceCapability)\n        {\n            return Equals(physicalNicCdpDeviceCapability as PhysicalNicCdpDeviceCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Router + \"_\" + TransparentBridge + \"_\" + SourceRouteBridge + \"_\" + NetworkSwitch + \"_\" + Host + \"_\" + IgmpEnabled + \"_\" + Repeater).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicCdpInfo : DynamicData, IEquatable<PhysicalNicCdpInfo>\n    {\n        public int? CdpVersion { get; set; }\n\n        public int? Timeout { get; set; }\n\n        public int? Ttl { get; set; }\n\n        public int? Samples { get; set; }\n\n        public string DevId { get; set; }\n\n        public string Address { get; set; }\n\n        public string PortId { get; set; }\n\n        public PhysicalNicCdpDeviceCapability DeviceCapability { get; set; }\n\n        public string SoftwareVersion { get; set; }\n\n        public string HardwarePlatform { get; set; }\n\n        public string IpPrefix { get; set; }\n\n        public int? IpPrefixLen { get; set; }\n\n        public int? Vlan { get; set; }\n\n        public bool? FullDuplex { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public string SystemName { get; set; }\n\n        public string SystemOID { get; set; }\n\n        public string MgmtAddr { get; set; }\n\n        public string Location { get; set; }\n\n        public bool Equals(PhysicalNicCdpInfo physicalNicCdpInfo)\n        {\n            return (physicalNicCdpInfo != null && ((this.CdpVersion == null && physicalNicCdpInfo.CdpVersion == null) || (this.CdpVersion != null && this.CdpVersion.Equals(physicalNicCdpInfo.CdpVersion))) && ((this.Timeout == null && physicalNicCdpInfo.Timeout == null) || (this.Timeout != null && this.Timeout.Equals(physicalNicCdpInfo.Timeout))) && ((this.Ttl == null && physicalNicCdpInfo.Ttl == null) || (this.Ttl != null && this.Ttl.Equals(physicalNicCdpInfo.Ttl))) && ((this.Samples == null && physicalNicCdpInfo.Samples == null) || (this.Samples != null && this.Samples.Equals(physicalNicCdpInfo.Samples))) && this.DevId == physicalNicCdpInfo.DevId && this.Address == physicalNicCdpInfo.Address && this.PortId == physicalNicCdpInfo.PortId && ((this.DeviceCapability == null && physicalNicCdpInfo.DeviceCapability == null) || (this.DeviceCapability != null && this.DeviceCapability.Equals(physicalNicCdpInfo.DeviceCapability))) && this.SoftwareVersion == physicalNicCdpInfo.SoftwareVersion && this.HardwarePlatform == physicalNicCdpInfo.HardwarePlatform && this.IpPrefix == physicalNicCdpInfo.IpPrefix && ((this.IpPrefixLen == null && physicalNicCdpInfo.IpPrefixLen == null) || (this.IpPrefixLen != null && this.IpPrefixLen.Equals(physicalNicCdpInfo.IpPrefixLen))) && ((this.Vlan == null && physicalNicCdpInfo.Vlan == null) || (this.Vlan != null && this.Vlan.Equals(physicalNicCdpInfo.Vlan))) && ((this.FullDuplex == null && physicalNicCdpInfo.FullDuplex == null) || (this.FullDuplex != null && this.FullDuplex.Equals(physicalNicCdpInfo.FullDuplex))) && ((this.Mtu == null && physicalNicCdpInfo.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(physicalNicCdpInfo.Mtu))) && this.SystemName == physicalNicCdpInfo.SystemName && this.SystemOID == physicalNicCdpInfo.SystemOID && this.MgmtAddr == physicalNicCdpInfo.MgmtAddr && this.Location == physicalNicCdpInfo.Location);\n        }\n\n        public override bool Equals(object physicalNicCdpInfo)\n        {\n            return Equals(physicalNicCdpInfo as PhysicalNicCdpInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CdpVersion + \"_\" + Timeout + \"_\" + Ttl + \"_\" + Samples + \"_\" + DevId + \"_\" + Address + \"_\" + PortId + \"_\" + DeviceCapability + \"_\" + SoftwareVersion + \"_\" + HardwarePlatform + \"_\" + IpPrefix + \"_\" + IpPrefixLen + \"_\" + Vlan + \"_\" + FullDuplex + \"_\" + Mtu + \"_\" + SystemName + \"_\" + SystemOID + \"_\" + MgmtAddr + \"_\" + Location).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicConfig : DynamicData, IEquatable<PhysicalNicConfig>\n    {\n        public string Device { get; set; }\n\n        public PhysicalNicSpec Spec { get; set; }\n\n        public bool Equals(PhysicalNicConfig physicalNicConfig)\n        {\n            return (physicalNicConfig != null && this.Device == physicalNicConfig.Device && ((this.Spec == null && physicalNicConfig.Spec == null) || (this.Spec != null && this.Spec.Equals(physicalNicConfig.Spec))));\n        }\n\n        public override bool Equals(object physicalNicConfig)\n        {\n            return Equals(physicalNicConfig as PhysicalNicConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicHint : DynamicData, IEquatable<PhysicalNicHint>\n    {\n        public int? VlanId { get; set; }\n\n        public bool Equals(PhysicalNicHint physicalNicHint)\n        {\n            return (physicalNicHint != null && ((this.VlanId == null && physicalNicHint.VlanId == null) || (this.VlanId != null && this.VlanId.Equals(physicalNicHint.VlanId))));\n        }\n\n        public override bool Equals(object physicalNicHint)\n        {\n            return Equals(physicalNicHint as PhysicalNicHint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanId).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicHintInfo : DynamicData, IEquatable<PhysicalNicHintInfo>\n    {\n        public string Device { get; set; }\n\n        public PhysicalNicIpHint[] Subnet { get; set; }\n\n        public PhysicalNicNameHint[] Network { get; set; }\n\n        public PhysicalNicCdpInfo ConnectedSwitchPort { get; set; }\n\n        public LinkLayerDiscoveryProtocolInfo LldpInfo { get; set; }\n\n        public bool Equals(PhysicalNicHintInfo physicalNicHintInfo)\n        {\n            return (physicalNicHintInfo != null && this.Device == physicalNicHintInfo.Device && ((this.Subnet == null && physicalNicHintInfo.Subnet == null) || (this.Subnet != null && physicalNicHintInfo.Subnet != null && Enumerable.SequenceEqual(this.Subnet, physicalNicHintInfo.Subnet))) && ((this.Network == null && physicalNicHintInfo.Network == null) || (this.Network != null && physicalNicHintInfo.Network != null && Enumerable.SequenceEqual(this.Network, physicalNicHintInfo.Network))) && ((this.ConnectedSwitchPort == null && physicalNicHintInfo.ConnectedSwitchPort == null) || (this.ConnectedSwitchPort != null && this.ConnectedSwitchPort.Equals(physicalNicHintInfo.ConnectedSwitchPort))) && ((this.LldpInfo == null && physicalNicHintInfo.LldpInfo == null) || (this.LldpInfo != null && this.LldpInfo.Equals(physicalNicHintInfo.LldpInfo))));\n        }\n\n        public override bool Equals(object physicalNicHintInfo)\n        {\n            return Equals(physicalNicHintInfo as PhysicalNicHintInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Subnet + \"_\" + Network + \"_\" + ConnectedSwitchPort + \"_\" + LldpInfo).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicIpHint : PhysicalNicHint, IEquatable<PhysicalNicIpHint>\n    {\n        public string IpSubnet { get; set; }\n\n        public bool Equals(PhysicalNicIpHint physicalNicIpHint)\n        {\n            return (physicalNicIpHint != null && this.IpSubnet == physicalNicIpHint.IpSubnet);\n        }\n\n        public override bool Equals(object physicalNicIpHint)\n        {\n            return Equals(physicalNicIpHint as PhysicalNicIpHint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpSubnet).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicLinkInfo : DynamicData, IEquatable<PhysicalNicLinkInfo>\n    {\n        public int SpeedMb { get; set; }\n\n        public bool Duplex { get; set; }\n\n        public bool Equals(PhysicalNicLinkInfo physicalNicLinkInfo)\n        {\n            return (physicalNicLinkInfo != null && this.SpeedMb == physicalNicLinkInfo.SpeedMb && this.Duplex == physicalNicLinkInfo.Duplex);\n        }\n\n        public override bool Equals(object physicalNicLinkInfo)\n        {\n            return Equals(physicalNicLinkInfo as PhysicalNicLinkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SpeedMb + \"_\" + Duplex).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicNameHint : PhysicalNicHint, IEquatable<PhysicalNicNameHint>\n    {\n        public string Network { get; set; }\n\n        public bool Equals(PhysicalNicNameHint physicalNicNameHint)\n        {\n            return (physicalNicNameHint != null && this.Network == physicalNicNameHint.Network);\n        }\n\n        public override bool Equals(object physicalNicNameHint)\n        {\n            return Equals(physicalNicNameHint as PhysicalNicNameHint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicProfile : ApplyProfile, IEquatable<PhysicalNicProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(PhysicalNicProfile physicalNicProfile)\n        {\n            return (physicalNicProfile != null && this.Key == physicalNicProfile.Key);\n        }\n\n        public override bool Equals(object physicalNicProfile)\n        {\n            return Equals(physicalNicProfile as PhysicalNicProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicSpec : DynamicData, IEquatable<PhysicalNicSpec>\n    {\n        public HostIpConfig Ip { get; set; }\n\n        public PhysicalNicLinkInfo LinkSpeed { get; set; }\n\n        public bool? EnableEnhancedNetworkingStack { get; set; }\n\n        public bool Equals(PhysicalNicSpec physicalNicSpec)\n        {\n            return (physicalNicSpec != null && ((this.Ip == null && physicalNicSpec.Ip == null) || (this.Ip != null && this.Ip.Equals(physicalNicSpec.Ip))) && ((this.LinkSpeed == null && physicalNicSpec.LinkSpeed == null) || (this.LinkSpeed != null && this.LinkSpeed.Equals(physicalNicSpec.LinkSpeed))) && ((this.EnableEnhancedNetworkingStack == null && physicalNicSpec.EnableEnhancedNetworkingStack == null) || (this.EnableEnhancedNetworkingStack != null && this.EnableEnhancedNetworkingStack.Equals(physicalNicSpec.EnableEnhancedNetworkingStack))));\n        }\n\n        public override bool Equals(object physicalNicSpec)\n        {\n            return Equals(physicalNicSpec as PhysicalNicSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ip + \"_\" + LinkSpeed + \"_\" + EnableEnhancedNetworkingStack).GetHashCode();\n        }\n    }\n\n    public class PlacementAction : ClusterAction, IEquatable<PlacementAction>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public ManagedObjectReference TargetHost { get; set; }\n\n        public VirtualMachineRelocateSpec RelocateSpec { get; set; }\n\n        public PlacementAction_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PlacementAction placementAction)\n        {\n            return (placementAction != null && ((this.Vm == null && placementAction.Vm == null) || (this.Vm != null && this.Vm.Equals(placementAction.Vm))) && ((this.TargetHost == null && placementAction.TargetHost == null) || (this.TargetHost != null && this.TargetHost.Equals(placementAction.TargetHost))) && ((this.RelocateSpec == null && placementAction.RelocateSpec == null) || (this.RelocateSpec != null && this.RelocateSpec.Equals(placementAction.RelocateSpec))) && ((this.LinkedView == null && placementAction.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(placementAction.LinkedView))));\n        }\n\n        public override bool Equals(object placementAction)\n        {\n            return Equals(placementAction as PlacementAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + TargetHost + \"_\" + RelocateSpec + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PlacementAction_LinkedView : IEquatable<PlacementAction_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public HostSystem TargetHost { get; set; }\n\n        public bool Equals(PlacementAction_LinkedView placementAction_LinkedView)\n        {\n            return (placementAction_LinkedView != null && ((this.Vm == null && placementAction_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(placementAction_LinkedView.Vm))) && ((this.TargetHost == null && placementAction_LinkedView.TargetHost == null) || (this.TargetHost != null && this.TargetHost.Equals(placementAction_LinkedView.TargetHost))));\n        }\n\n        public override bool Equals(object placementAction_LinkedView)\n        {\n            return Equals(placementAction_LinkedView as PlacementAction_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + TargetHost).GetHashCode();\n        }\n    }\n\n    public class PlacementAffinityRule : DynamicData, IEquatable<PlacementAffinityRule>\n    {\n        public string RuleType { get; set; }\n\n        public string RuleScope { get; set; }\n\n        public ManagedObjectReference[] Vms { get; set; }\n\n        public string[] Keys { get; set; }\n\n        public PlacementAffinityRule_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PlacementAffinityRule placementAffinityRule)\n        {\n            return (placementAffinityRule != null && this.RuleType == placementAffinityRule.RuleType && this.RuleScope == placementAffinityRule.RuleScope && ((this.Vms == null && placementAffinityRule.Vms == null) || (this.Vms != null && placementAffinityRule.Vms != null && Enumerable.SequenceEqual(this.Vms, placementAffinityRule.Vms))) && ((this.Keys == null && placementAffinityRule.Keys == null) || (this.Keys != null && placementAffinityRule.Keys != null && Enumerable.SequenceEqual(this.Keys, placementAffinityRule.Keys))) && ((this.LinkedView == null && placementAffinityRule.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(placementAffinityRule.LinkedView))));\n        }\n\n        public override bool Equals(object placementAffinityRule)\n        {\n            return Equals(placementAffinityRule as PlacementAffinityRule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RuleType + \"_\" + RuleScope + \"_\" + Vms + \"_\" + Keys + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PlacementAffinityRule_LinkedView : IEquatable<PlacementAffinityRule_LinkedView>\n    {\n        public VirtualMachine[] Vms { get; set; }\n\n        public bool Equals(PlacementAffinityRule_LinkedView placementAffinityRule_LinkedView)\n        {\n            return (placementAffinityRule_LinkedView != null && ((this.Vms == null && placementAffinityRule_LinkedView.Vms == null) || (this.Vms != null && placementAffinityRule_LinkedView.Vms != null && Enumerable.SequenceEqual(this.Vms, placementAffinityRule_LinkedView.Vms))));\n        }\n\n        public override bool Equals(object placementAffinityRule_LinkedView)\n        {\n            return Equals(placementAffinityRule_LinkedView as PlacementAffinityRule_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vms).GetHashCode();\n        }\n    }\n\n    public class PlacementRankResult : DynamicData, IEquatable<PlacementRankResult>\n    {\n        public string Key { get; set; }\n\n        public ManagedObjectReference Candidate { get; set; }\n\n        public long ReservedSpaceMB { get; set; }\n\n        public long UsedSpaceMB { get; set; }\n\n        public long TotalSpaceMB { get; set; }\n\n        public double Utilization { get; set; }\n\n        public LocalizedMethodFault[] Faults { get; set; }\n\n        public PlacementRankResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PlacementRankResult placementRankResult)\n        {\n            return (placementRankResult != null && this.Key == placementRankResult.Key && ((this.Candidate == null && placementRankResult.Candidate == null) || (this.Candidate != null && this.Candidate.Equals(placementRankResult.Candidate))) && this.ReservedSpaceMB == placementRankResult.ReservedSpaceMB && this.UsedSpaceMB == placementRankResult.UsedSpaceMB && this.TotalSpaceMB == placementRankResult.TotalSpaceMB && this.Utilization == placementRankResult.Utilization && ((this.Faults == null && placementRankResult.Faults == null) || (this.Faults != null && placementRankResult.Faults != null && Enumerable.SequenceEqual(this.Faults, placementRankResult.Faults))) && ((this.LinkedView == null && placementRankResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(placementRankResult.LinkedView))));\n        }\n\n        public override bool Equals(object placementRankResult)\n        {\n            return Equals(placementRankResult as PlacementRankResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Candidate + \"_\" + ReservedSpaceMB + \"_\" + UsedSpaceMB + \"_\" + TotalSpaceMB + \"_\" + Utilization + \"_\" + Faults + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PlacementRankResult_LinkedView : IEquatable<PlacementRankResult_LinkedView>\n    {\n        public ClusterComputeResource Candidate { get; set; }\n\n        public bool Equals(PlacementRankResult_LinkedView placementRankResult_LinkedView)\n        {\n            return (placementRankResult_LinkedView != null && ((this.Candidate == null && placementRankResult_LinkedView.Candidate == null) || (this.Candidate != null && this.Candidate.Equals(placementRankResult_LinkedView.Candidate))));\n        }\n\n        public override bool Equals(object placementRankResult_LinkedView)\n        {\n            return Equals(placementRankResult_LinkedView as PlacementRankResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Candidate).GetHashCode();\n        }\n    }\n\n    public class PlacementRankSpec : DynamicData, IEquatable<PlacementRankSpec>\n    {\n        public PlacementSpec[] Specs { get; set; }\n\n        public ManagedObjectReference[] Clusters { get; set; }\n\n        public PlacementAffinityRule[] Rules { get; set; }\n\n        public StorageDrsPlacementRankVmSpec[] PlacementRankByVm { get; set; }\n\n        public PlacementRankSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PlacementRankSpec placementRankSpec)\n        {\n            return (placementRankSpec != null && ((this.Specs == null && placementRankSpec.Specs == null) || (this.Specs != null && placementRankSpec.Specs != null && Enumerable.SequenceEqual(this.Specs, placementRankSpec.Specs))) && ((this.Clusters == null && placementRankSpec.Clusters == null) || (this.Clusters != null && placementRankSpec.Clusters != null && Enumerable.SequenceEqual(this.Clusters, placementRankSpec.Clusters))) && ((this.Rules == null && placementRankSpec.Rules == null) || (this.Rules != null && placementRankSpec.Rules != null && Enumerable.SequenceEqual(this.Rules, placementRankSpec.Rules))) && ((this.PlacementRankByVm == null && placementRankSpec.PlacementRankByVm == null) || (this.PlacementRankByVm != null && placementRankSpec.PlacementRankByVm != null && Enumerable.SequenceEqual(this.PlacementRankByVm, placementRankSpec.PlacementRankByVm))) && ((this.LinkedView == null && placementRankSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(placementRankSpec.LinkedView))));\n        }\n\n        public override bool Equals(object placementRankSpec)\n        {\n            return Equals(placementRankSpec as PlacementRankSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Specs + \"_\" + Clusters + \"_\" + Rules + \"_\" + PlacementRankByVm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PlacementRankSpec_LinkedView : IEquatable<PlacementRankSpec_LinkedView>\n    {\n        public ClusterComputeResource[] Clusters { get; set; }\n\n        public bool Equals(PlacementRankSpec_LinkedView placementRankSpec_LinkedView)\n        {\n            return (placementRankSpec_LinkedView != null && ((this.Clusters == null && placementRankSpec_LinkedView.Clusters == null) || (this.Clusters != null && placementRankSpec_LinkedView.Clusters != null && Enumerable.SequenceEqual(this.Clusters, placementRankSpec_LinkedView.Clusters))));\n        }\n\n        public override bool Equals(object placementRankSpec_LinkedView)\n        {\n            return Equals(placementRankSpec_LinkedView as PlacementRankSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Clusters).GetHashCode();\n        }\n    }\n\n    public class PlacementResult : DynamicData, IEquatable<PlacementResult>\n    {\n        public ClusterRecommendation[] Recommendations { get; set; }\n\n        public ClusterDrsFaults DrsFault { get; set; }\n\n        public bool Equals(PlacementResult placementResult)\n        {\n            return (placementResult != null && ((this.Recommendations == null && placementResult.Recommendations == null) || (this.Recommendations != null && placementResult.Recommendations != null && Enumerable.SequenceEqual(this.Recommendations, placementResult.Recommendations))) && ((this.DrsFault == null && placementResult.DrsFault == null) || (this.DrsFault != null && this.DrsFault.Equals(placementResult.DrsFault))));\n        }\n\n        public override bool Equals(object placementResult)\n        {\n            return Equals(placementResult as PlacementResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Recommendations + \"_\" + DrsFault).GetHashCode();\n        }\n    }\n\n    public class PlacementSpec : DynamicData, IEquatable<PlacementSpec>\n    {\n        public VirtualMachineMovePriority? Priority { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public VirtualMachineConfigSpec ConfigSpec { get; set; }\n\n        public VirtualMachineRelocateSpec RelocateSpec { get; set; }\n\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public ManagedObjectReference[] Datastores { get; set; }\n\n        public ManagedObjectReference[] StoragePods { get; set; }\n\n        public bool? DisallowPrerequisiteMoves { get; set; }\n\n        public ClusterRuleInfo[] Rules { get; set; }\n\n        public string Key { get; set; }\n\n        public string PlacementType { get; set; }\n\n        public VirtualMachineCloneSpec CloneSpec { get; set; }\n\n        public string CloneName { get; set; }\n\n        public PlacementSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PlacementSpec placementSpec)\n        {\n            return (placementSpec != null && ((this.Priority == null && placementSpec.Priority == null) || (this.Priority != null && this.Priority.Equals(placementSpec.Priority))) && ((this.Vm == null && placementSpec.Vm == null) || (this.Vm != null && this.Vm.Equals(placementSpec.Vm))) && ((this.ConfigSpec == null && placementSpec.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(placementSpec.ConfigSpec))) && ((this.RelocateSpec == null && placementSpec.RelocateSpec == null) || (this.RelocateSpec != null && this.RelocateSpec.Equals(placementSpec.RelocateSpec))) && ((this.Hosts == null && placementSpec.Hosts == null) || (this.Hosts != null && placementSpec.Hosts != null && Enumerable.SequenceEqual(this.Hosts, placementSpec.Hosts))) && ((this.Datastores == null && placementSpec.Datastores == null) || (this.Datastores != null && placementSpec.Datastores != null && Enumerable.SequenceEqual(this.Datastores, placementSpec.Datastores))) && ((this.StoragePods == null && placementSpec.StoragePods == null) || (this.StoragePods != null && placementSpec.StoragePods != null && Enumerable.SequenceEqual(this.StoragePods, placementSpec.StoragePods))) && ((this.DisallowPrerequisiteMoves == null && placementSpec.DisallowPrerequisiteMoves == null) || (this.DisallowPrerequisiteMoves != null && this.DisallowPrerequisiteMoves.Equals(placementSpec.DisallowPrerequisiteMoves))) && ((this.Rules == null && placementSpec.Rules == null) || (this.Rules != null && placementSpec.Rules != null && Enumerable.SequenceEqual(this.Rules, placementSpec.Rules))) && this.Key == placementSpec.Key && this.PlacementType == placementSpec.PlacementType && ((this.CloneSpec == null && placementSpec.CloneSpec == null) || (this.CloneSpec != null && this.CloneSpec.Equals(placementSpec.CloneSpec))) && this.CloneName == placementSpec.CloneName && ((this.LinkedView == null && placementSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(placementSpec.LinkedView))));\n        }\n\n        public override bool Equals(object placementSpec)\n        {\n            return Equals(placementSpec as PlacementSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Priority + \"_\" + Vm + \"_\" + ConfigSpec + \"_\" + RelocateSpec + \"_\" + Hosts + \"_\" + Datastores + \"_\" + StoragePods + \"_\" + DisallowPrerequisiteMoves + \"_\" + Rules + \"_\" + Key + \"_\" + PlacementType + \"_\" + CloneSpec + \"_\" + CloneName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PlacementSpec_LinkedView : IEquatable<PlacementSpec_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public HostSystem[] Hosts { get; set; }\n\n        public Datastore[] Datastores { get; set; }\n\n        public StoragePod[] StoragePods { get; set; }\n\n        public bool Equals(PlacementSpec_LinkedView placementSpec_LinkedView)\n        {\n            return (placementSpec_LinkedView != null && ((this.Vm == null && placementSpec_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(placementSpec_LinkedView.Vm))) && ((this.Hosts == null && placementSpec_LinkedView.Hosts == null) || (this.Hosts != null && placementSpec_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, placementSpec_LinkedView.Hosts))) && ((this.Datastores == null && placementSpec_LinkedView.Datastores == null) || (this.Datastores != null && placementSpec_LinkedView.Datastores != null && Enumerable.SequenceEqual(this.Datastores, placementSpec_LinkedView.Datastores))) && ((this.StoragePods == null && placementSpec_LinkedView.StoragePods == null) || (this.StoragePods != null && placementSpec_LinkedView.StoragePods != null && Enumerable.SequenceEqual(this.StoragePods, placementSpec_LinkedView.StoragePods))));\n        }\n\n        public override bool Equals(object placementSpec_LinkedView)\n        {\n            return Equals(placementSpec_LinkedView as PlacementSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Hosts + \"_\" + Datastores + \"_\" + StoragePods).GetHashCode();\n        }\n    }\n\n    public class PlatformConfigFault : HostConfigFault, IEquatable<PlatformConfigFault>\n    {\n        public string Text { get; set; }\n\n        public bool Equals(PlatformConfigFault platformConfigFault)\n        {\n            return (platformConfigFault != null && this.Text == platformConfigFault.Text);\n        }\n\n        public override bool Equals(object platformConfigFault)\n        {\n            return Equals(platformConfigFault as PlatformConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Text).GetHashCode();\n        }\n    }\n\n    public class PMemDatastoreInfo : DatastoreInfo, IEquatable<PMemDatastoreInfo>\n    {\n        public HostPMemVolume Pmem { get; set; }\n\n        public bool Equals(PMemDatastoreInfo pMemDatastoreInfo)\n        {\n            return (pMemDatastoreInfo != null && ((this.Pmem == null && pMemDatastoreInfo.Pmem == null) || (this.Pmem != null && this.Pmem.Equals(pMemDatastoreInfo.Pmem))));\n        }\n\n        public override bool Equals(object pMemDatastoreInfo)\n        {\n            return Equals(pMemDatastoreInfo as PMemDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Pmem).GetHashCode();\n        }\n    }\n\n    public class PnicUplinkProfile : ApplyProfile, IEquatable<PnicUplinkProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(PnicUplinkProfile pnicUplinkProfile)\n        {\n            return (pnicUplinkProfile != null && this.Key == pnicUplinkProfile.Key);\n        }\n\n        public override bool Equals(object pnicUplinkProfile)\n        {\n            return Equals(pnicUplinkProfile as PnicUplinkProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class PodDiskLocator : DynamicData, IEquatable<PodDiskLocator>\n    {\n        public int DiskId { get; set; }\n\n        public string DiskMoveType { get; set; }\n\n        public VirtualDeviceBackingInfo DiskBackingInfo { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public bool Equals(PodDiskLocator podDiskLocator)\n        {\n            return (podDiskLocator != null && this.DiskId == podDiskLocator.DiskId && this.DiskMoveType == podDiskLocator.DiskMoveType && ((this.DiskBackingInfo == null && podDiskLocator.DiskBackingInfo == null) || (this.DiskBackingInfo != null && this.DiskBackingInfo.Equals(podDiskLocator.DiskBackingInfo))) && ((this.Profile == null && podDiskLocator.Profile == null) || (this.Profile != null && podDiskLocator.Profile != null && Enumerable.SequenceEqual(this.Profile, podDiskLocator.Profile))));\n        }\n\n        public override bool Equals(object podDiskLocator)\n        {\n            return Equals(podDiskLocator as PodDiskLocator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId + \"_\" + DiskMoveType + \"_\" + DiskBackingInfo + \"_\" + Profile).GetHashCode();\n        }\n    }\n\n    public class PodStorageDrsEntry : DynamicData, IEquatable<PodStorageDrsEntry>\n    {\n        public StorageDrsConfigInfo StorageDrsConfig { get; set; }\n\n        public ClusterRecommendation[] Recommendation { get; set; }\n\n        public ClusterDrsFaults[] DrsFault { get; set; }\n\n        public ClusterActionHistory[] ActionHistory { get; set; }\n\n        public bool Equals(PodStorageDrsEntry podStorageDrsEntry)\n        {\n            return (podStorageDrsEntry != null && ((this.StorageDrsConfig == null && podStorageDrsEntry.StorageDrsConfig == null) || (this.StorageDrsConfig != null && this.StorageDrsConfig.Equals(podStorageDrsEntry.StorageDrsConfig))) && ((this.Recommendation == null && podStorageDrsEntry.Recommendation == null) || (this.Recommendation != null && podStorageDrsEntry.Recommendation != null && Enumerable.SequenceEqual(this.Recommendation, podStorageDrsEntry.Recommendation))) && ((this.DrsFault == null && podStorageDrsEntry.DrsFault == null) || (this.DrsFault != null && podStorageDrsEntry.DrsFault != null && Enumerable.SequenceEqual(this.DrsFault, podStorageDrsEntry.DrsFault))) && ((this.ActionHistory == null && podStorageDrsEntry.ActionHistory == null) || (this.ActionHistory != null && podStorageDrsEntry.ActionHistory != null && Enumerable.SequenceEqual(this.ActionHistory, podStorageDrsEntry.ActionHistory))));\n        }\n\n        public override bool Equals(object podStorageDrsEntry)\n        {\n            return Equals(podStorageDrsEntry as PodStorageDrsEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StorageDrsConfig + \"_\" + Recommendation + \"_\" + DrsFault + \"_\" + ActionHistory).GetHashCode();\n        }\n    }\n\n    public class PolicyOption : DynamicData, IEquatable<PolicyOption>\n    {\n        public string Id { get; set; }\n\n        public KeyAnyValue[] Parameter { get; set; }\n\n        public bool Equals(PolicyOption policyOption)\n        {\n            return (policyOption != null && this.Id == policyOption.Id && ((this.Parameter == null && policyOption.Parameter == null) || (this.Parameter != null && policyOption.Parameter != null && Enumerable.SequenceEqual(this.Parameter, policyOption.Parameter))));\n        }\n\n        public override bool Equals(object policyOption)\n        {\n            return Equals(policyOption as PolicyOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class PortGroupProfile : ApplyProfile, IEquatable<PortGroupProfile>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public VlanProfile Vlan { get; set; }\n\n        public VirtualSwitchSelectionProfile Vswitch { get; set; }\n\n        public NetworkPolicyProfile NetworkPolicy { get; set; }\n\n        public bool Equals(PortGroupProfile portGroupProfile)\n        {\n            return (portGroupProfile != null && this.Key == portGroupProfile.Key && this.Name == portGroupProfile.Name && ((this.Vlan == null && portGroupProfile.Vlan == null) || (this.Vlan != null && this.Vlan.Equals(portGroupProfile.Vlan))) && ((this.Vswitch == null && portGroupProfile.Vswitch == null) || (this.Vswitch != null && this.Vswitch.Equals(portGroupProfile.Vswitch))) && ((this.NetworkPolicy == null && portGroupProfile.NetworkPolicy == null) || (this.NetworkPolicy != null && this.NetworkPolicy.Equals(portGroupProfile.NetworkPolicy))));\n        }\n\n        public override bool Equals(object portGroupProfile)\n        {\n            return Equals(portGroupProfile as PortGroupProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Vlan + \"_\" + Vswitch + \"_\" + NetworkPolicy).GetHashCode();\n        }\n    }\n\n    public class PosixUserSearchResult : UserSearchResult, IEquatable<PosixUserSearchResult>\n    {\n        public int Id { get; set; }\n\n        public bool? ShellAccess { get; set; }\n\n        public bool Equals(PosixUserSearchResult posixUserSearchResult)\n        {\n            return (posixUserSearchResult != null && this.Id == posixUserSearchResult.Id && ((this.ShellAccess == null && posixUserSearchResult.ShellAccess == null) || (this.ShellAccess != null && this.ShellAccess.Equals(posixUserSearchResult.ShellAccess))));\n        }\n\n        public override bool Equals(object posixUserSearchResult)\n        {\n            return Equals(posixUserSearchResult as PosixUserSearchResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + ShellAccess).GetHashCode();\n        }\n    }\n\n    public class PowerOnFtSecondaryFailed : VmFaultToleranceIssue, IEquatable<PowerOnFtSecondaryFailed>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public FtIssuesOnHostHostSelectionType HostSelectionBy { get; set; }\n\n        public LocalizedMethodFault[] HostErrors { get; set; }\n\n        public LocalizedMethodFault RootCause { get; set; }\n\n        public PowerOnFtSecondaryFailed_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PowerOnFtSecondaryFailed powerOnFtSecondaryFailed)\n        {\n            return (powerOnFtSecondaryFailed != null && ((this.Vm == null && powerOnFtSecondaryFailed.Vm == null) || (this.Vm != null && this.Vm.Equals(powerOnFtSecondaryFailed.Vm))) && this.VmName == powerOnFtSecondaryFailed.VmName && this.HostSelectionBy == powerOnFtSecondaryFailed.HostSelectionBy && ((this.HostErrors == null && powerOnFtSecondaryFailed.HostErrors == null) || (this.HostErrors != null && powerOnFtSecondaryFailed.HostErrors != null && Enumerable.SequenceEqual(this.HostErrors, powerOnFtSecondaryFailed.HostErrors))) && ((this.RootCause == null && powerOnFtSecondaryFailed.RootCause == null) || (this.RootCause != null && this.RootCause.Equals(powerOnFtSecondaryFailed.RootCause))) && ((this.LinkedView == null && powerOnFtSecondaryFailed.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(powerOnFtSecondaryFailed.LinkedView))));\n        }\n\n        public override bool Equals(object powerOnFtSecondaryFailed)\n        {\n            return Equals(powerOnFtSecondaryFailed as PowerOnFtSecondaryFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + HostSelectionBy + \"_\" + HostErrors + \"_\" + RootCause + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PowerOnFtSecondaryFailed_LinkedView : IEquatable<PowerOnFtSecondaryFailed_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(PowerOnFtSecondaryFailed_LinkedView powerOnFtSecondaryFailed_LinkedView)\n        {\n            return (powerOnFtSecondaryFailed_LinkedView != null && ((this.Vm == null && powerOnFtSecondaryFailed_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(powerOnFtSecondaryFailed_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object powerOnFtSecondaryFailed_LinkedView)\n        {\n            return Equals(powerOnFtSecondaryFailed_LinkedView as PowerOnFtSecondaryFailed_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class PowerOnFtSecondaryTimedout : Timedout, IEquatable<PowerOnFtSecondaryTimedout>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public string VmName { get; set; }\n\n        public int Timeout { get; set; }\n\n        public PowerOnFtSecondaryTimedout_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PowerOnFtSecondaryTimedout powerOnFtSecondaryTimedout)\n        {\n            return (powerOnFtSecondaryTimedout != null && ((this.Vm == null && powerOnFtSecondaryTimedout.Vm == null) || (this.Vm != null && this.Vm.Equals(powerOnFtSecondaryTimedout.Vm))) && this.VmName == powerOnFtSecondaryTimedout.VmName && this.Timeout == powerOnFtSecondaryTimedout.Timeout && ((this.LinkedView == null && powerOnFtSecondaryTimedout.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(powerOnFtSecondaryTimedout.LinkedView))));\n        }\n\n        public override bool Equals(object powerOnFtSecondaryTimedout)\n        {\n            return Equals(powerOnFtSecondaryTimedout as PowerOnFtSecondaryTimedout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + VmName + \"_\" + Timeout + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PowerOnFtSecondaryTimedout_LinkedView : IEquatable<PowerOnFtSecondaryTimedout_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(PowerOnFtSecondaryTimedout_LinkedView powerOnFtSecondaryTimedout_LinkedView)\n        {\n            return (powerOnFtSecondaryTimedout_LinkedView != null && ((this.Vm == null && powerOnFtSecondaryTimedout_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(powerOnFtSecondaryTimedout_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object powerOnFtSecondaryTimedout_LinkedView)\n        {\n            return Equals(powerOnFtSecondaryTimedout_LinkedView as PowerOnFtSecondaryTimedout_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class PowerSystemCapability : DynamicData, IEquatable<PowerSystemCapability>\n    {\n        public HostPowerPolicy[] AvailablePolicy { get; set; }\n\n        public bool Equals(PowerSystemCapability powerSystemCapability)\n        {\n            return (powerSystemCapability != null && ((this.AvailablePolicy == null && powerSystemCapability.AvailablePolicy == null) || (this.AvailablePolicy != null && powerSystemCapability.AvailablePolicy != null && Enumerable.SequenceEqual(this.AvailablePolicy, powerSystemCapability.AvailablePolicy))));\n        }\n\n        public override bool Equals(object powerSystemCapability)\n        {\n            return Equals(powerSystemCapability as PowerSystemCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AvailablePolicy).GetHashCode();\n        }\n    }\n\n    public class PowerSystemInfo : DynamicData, IEquatable<PowerSystemInfo>\n    {\n        public HostPowerPolicy CurrentPolicy { get; set; }\n\n        public bool Equals(PowerSystemInfo powerSystemInfo)\n        {\n            return (powerSystemInfo != null && ((this.CurrentPolicy == null && powerSystemInfo.CurrentPolicy == null) || (this.CurrentPolicy != null && this.CurrentPolicy.Equals(powerSystemInfo.CurrentPolicy))));\n        }\n\n        public override bool Equals(object powerSystemInfo)\n        {\n            return Equals(powerSystemInfo as PowerSystemInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentPolicy).GetHashCode();\n        }\n    }\n\n    public class PrivilegeAvailability : DynamicData, IEquatable<PrivilegeAvailability>\n    {\n        public string PrivId { get; set; }\n\n        public bool IsGranted { get; set; }\n\n        public bool Equals(PrivilegeAvailability privilegeAvailability)\n        {\n            return (privilegeAvailability != null && this.PrivId == privilegeAvailability.PrivId && this.IsGranted == privilegeAvailability.IsGranted);\n        }\n\n        public override bool Equals(object privilegeAvailability)\n        {\n            return Equals(privilegeAvailability as PrivilegeAvailability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrivId + \"_\" + IsGranted).GetHashCode();\n        }\n    }\n\n    public class PrivilegePolicyDef : DynamicData, IEquatable<PrivilegePolicyDef>\n    {\n        public string CreatePrivilege { get; set; }\n\n        public string ReadPrivilege { get; set; }\n\n        public string UpdatePrivilege { get; set; }\n\n        public string DeletePrivilege { get; set; }\n\n        public bool Equals(PrivilegePolicyDef privilegePolicyDef)\n        {\n            return (privilegePolicyDef != null && this.CreatePrivilege == privilegePolicyDef.CreatePrivilege && this.ReadPrivilege == privilegePolicyDef.ReadPrivilege && this.UpdatePrivilege == privilegePolicyDef.UpdatePrivilege && this.DeletePrivilege == privilegePolicyDef.DeletePrivilege);\n        }\n\n        public override bool Equals(object privilegePolicyDef)\n        {\n            return Equals(privilegePolicyDef as PrivilegePolicyDef);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CreatePrivilege + \"_\" + ReadPrivilege + \"_\" + UpdatePrivilege + \"_\" + DeletePrivilege).GetHashCode();\n        }\n    }\n\n    public class ProductComponentInfo : DynamicData, IEquatable<ProductComponentInfo>\n    {\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Version { get; set; }\n\n        public int Release { get; set; }\n\n        public bool Equals(ProductComponentInfo productComponentInfo)\n        {\n            return (productComponentInfo != null && this.Id == productComponentInfo.Id && this.Name == productComponentInfo.Name && this.Version == productComponentInfo.Version && this.Release == productComponentInfo.Release);\n        }\n\n        public override bool Equals(object productComponentInfo)\n        {\n            return Equals(productComponentInfo as ProductComponentInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + Version + \"_\" + Release).GetHashCode();\n        }\n    }\n\n    public class Profile : ViewBase, IEquatable<Profile>\n    {\n        public ProfileConfigInfo Config { get; set; }\n\n        public ProfileDescription Description { get; set; }\n\n        public string Name { get; set; }\n\n        public DateTime CreatedTime { get; set; }\n\n        public DateTime ModifiedTime { get; set; }\n\n        public ManagedObjectReference[] Entity { get; set; }\n\n        public string ComplianceStatus { get; set; }\n\n        public Profile_LinkedView LinkedView { get; set; }\n\n        public ProfileDescription RetrieveDescription()\n        {\n            return default(ProfileDescription);\n        }\n\n        public void DestroyProfile()\n        {\n        }\n\n        public void AssociateProfile(ManagedObjectReference[] entity)\n        {\n        }\n\n        public void DissociateProfile(ManagedObjectReference[] entity)\n        {\n        }\n\n        public ManagedObjectReference CheckProfileCompliance_Task(ManagedObjectReference[] entity)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ComplianceResult[] CheckProfileCompliance(ManagedObjectReference[] entity)\n        {\n            return default(ComplianceResult[]);\n        }\n\n        public string ExportProfile()\n        {\n            return default(string);\n        }\n\n        public bool Equals(Profile profile)\n        {\n            return (profile != null && ((this.Config == null && profile.Config == null) || (this.Config != null && this.Config.Equals(profile.Config))) && ((this.Description == null && profile.Description == null) || (this.Description != null && this.Description.Equals(profile.Description))) && this.Name == profile.Name && this.CreatedTime == profile.CreatedTime && this.ModifiedTime == profile.ModifiedTime && ((this.Entity == null && profile.Entity == null) || (this.Entity != null && profile.Entity != null && Enumerable.SequenceEqual(this.Entity, profile.Entity))) && this.ComplianceStatus == profile.ComplianceStatus && ((this.LinkedView == null && profile.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(profile.LinkedView))));\n        }\n\n        public override bool Equals(object profile)\n        {\n            return Equals(profile as Profile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Config + \"_\" + Description + \"_\" + Name + \"_\" + CreatedTime + \"_\" + ModifiedTime + \"_\" + Entity + \"_\" + ComplianceStatus + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class Profile_LinkedView : IEquatable<Profile_LinkedView>\n    {\n        public ManagedEntity[] Entity { get; set; }\n\n        public bool Equals(Profile_LinkedView profile_LinkedView)\n        {\n            return (profile_LinkedView != null && ((this.Entity == null && profile_LinkedView.Entity == null) || (this.Entity != null && profile_LinkedView.Entity != null && Enumerable.SequenceEqual(this.Entity, profile_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object profile_LinkedView)\n        {\n            return Equals(profile_LinkedView as Profile_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class ProfileApplyProfileElement : ApplyProfile, IEquatable<ProfileApplyProfileElement>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(ProfileApplyProfileElement profileApplyProfileElement)\n        {\n            return (profileApplyProfileElement != null && this.Key == profileApplyProfileElement.Key);\n        }\n\n        public override bool Equals(object profileApplyProfileElement)\n        {\n            return Equals(profileApplyProfileElement as ProfileApplyProfileElement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class ProfileApplyProfileProperty : DynamicData, IEquatable<ProfileApplyProfileProperty>\n    {\n        public string PropertyName { get; set; }\n\n        public bool Array { get; set; }\n\n        public ApplyProfile[] Profile { get; set; }\n\n        public bool Equals(ProfileApplyProfileProperty profileApplyProfileProperty)\n        {\n            return (profileApplyProfileProperty != null && this.PropertyName == profileApplyProfileProperty.PropertyName && this.Array == profileApplyProfileProperty.Array && ((this.Profile == null && profileApplyProfileProperty.Profile == null) || (this.Profile != null && profileApplyProfileProperty.Profile != null && Enumerable.SequenceEqual(this.Profile, profileApplyProfileProperty.Profile))));\n        }\n\n        public override bool Equals(object profileApplyProfileProperty)\n        {\n            return Equals(profileApplyProfileProperty as ProfileApplyProfileProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PropertyName + \"_\" + Array + \"_\" + Profile).GetHashCode();\n        }\n    }\n\n    public class ProfileAssociatedEvent : ProfileEvent, IEquatable<ProfileAssociatedEvent>\n    {\n        public bool Equals(ProfileAssociatedEvent profileAssociatedEvent)\n        {\n            return (profileAssociatedEvent != null && base.Equals(profileAssociatedEvent));\n        }\n\n        public override bool Equals(object profileAssociatedEvent)\n        {\n            return Equals(profileAssociatedEvent as ProfileAssociatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ProfileChangedEvent : ProfileEvent, IEquatable<ProfileChangedEvent>\n    {\n        public bool Equals(ProfileChangedEvent profileChangedEvent)\n        {\n            return (profileChangedEvent != null && base.Equals(profileChangedEvent));\n        }\n\n        public override bool Equals(object profileChangedEvent)\n        {\n            return Equals(profileChangedEvent as ProfileChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ProfileComplianceManager : ViewBase, IEquatable<ProfileComplianceManager>\n    {\n        public ManagedObjectReference CheckCompliance_Task(ManagedObjectReference[] profile, ManagedObjectReference[] entity)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ComplianceResult[] CheckCompliance(ManagedObjectReference[] profile, ManagedObjectReference[] entity)\n        {\n            return default(ComplianceResult[]);\n        }\n\n        public ComplianceResult[] QueryComplianceStatus(ManagedObjectReference[] profile, ManagedObjectReference[] entity)\n        {\n            return default(ComplianceResult[]);\n        }\n\n        public void ClearComplianceStatus(ManagedObjectReference[] profile, ManagedObjectReference[] entity)\n        {\n        }\n\n        public ProfileExpressionMetadata[] QueryExpressionMetadata(string[] expressionName, ManagedObjectReference profile)\n        {\n            return default(ProfileExpressionMetadata[]);\n        }\n\n        public bool Equals(ProfileComplianceManager profileComplianceManager)\n        {\n            return (profileComplianceManager != null && base.Equals(profileComplianceManager));\n        }\n\n        public override bool Equals(object profileComplianceManager)\n        {\n            return Equals(profileComplianceManager as ProfileComplianceManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ProfileCompositeExpression : ProfileExpression, IEquatable<ProfileCompositeExpression>\n    {\n        public string Operator { get; set; }\n\n        public string[] ExpressionName { get; set; }\n\n        public bool Equals(ProfileCompositeExpression profileCompositeExpression)\n        {\n            return (profileCompositeExpression != null && this.Operator == profileCompositeExpression.Operator && ((this.ExpressionName == null && profileCompositeExpression.ExpressionName == null) || (this.ExpressionName != null && profileCompositeExpression.ExpressionName != null && Enumerable.SequenceEqual(this.ExpressionName, profileCompositeExpression.ExpressionName))));\n        }\n\n        public override bool Equals(object profileCompositeExpression)\n        {\n            return Equals(profileCompositeExpression as ProfileCompositeExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operator + \"_\" + ExpressionName).GetHashCode();\n        }\n    }\n\n    public class ProfileCompositePolicyOptionMetadata : ProfilePolicyOptionMetadata, IEquatable<ProfileCompositePolicyOptionMetadata>\n    {\n        public string[] Option { get; set; }\n\n        public bool Equals(ProfileCompositePolicyOptionMetadata profileCompositePolicyOptionMetadata)\n        {\n            return (profileCompositePolicyOptionMetadata != null && ((this.Option == null && profileCompositePolicyOptionMetadata.Option == null) || (this.Option != null && profileCompositePolicyOptionMetadata.Option != null && Enumerable.SequenceEqual(this.Option, profileCompositePolicyOptionMetadata.Option))));\n        }\n\n        public override bool Equals(object profileCompositePolicyOptionMetadata)\n        {\n            return Equals(profileCompositePolicyOptionMetadata as ProfileCompositePolicyOptionMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Option).GetHashCode();\n        }\n    }\n\n    public class ProfileConfigInfo : DynamicData, IEquatable<ProfileConfigInfo>\n    {\n        public string Name { get; set; }\n\n        public string Annotation { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public bool Equals(ProfileConfigInfo profileConfigInfo)\n        {\n            return (profileConfigInfo != null && this.Name == profileConfigInfo.Name && this.Annotation == profileConfigInfo.Annotation && this.Enabled == profileConfigInfo.Enabled);\n        }\n\n        public override bool Equals(object profileConfigInfo)\n        {\n            return Equals(profileConfigInfo as ProfileConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Annotation + \"_\" + Enabled).GetHashCode();\n        }\n    }\n\n    public class ProfileCreatedEvent : ProfileEvent, IEquatable<ProfileCreatedEvent>\n    {\n        public bool Equals(ProfileCreatedEvent profileCreatedEvent)\n        {\n            return (profileCreatedEvent != null && base.Equals(profileCreatedEvent));\n        }\n\n        public override bool Equals(object profileCreatedEvent)\n        {\n            return Equals(profileCreatedEvent as ProfileCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ProfileCreateSpec : DynamicData, IEquatable<ProfileCreateSpec>\n    {\n        public string Name { get; set; }\n\n        public string Annotation { get; set; }\n\n        public bool? Enabled { get; set; }\n\n        public bool Equals(ProfileCreateSpec profileCreateSpec)\n        {\n            return (profileCreateSpec != null && this.Name == profileCreateSpec.Name && this.Annotation == profileCreateSpec.Annotation && ((this.Enabled == null && profileCreateSpec.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(profileCreateSpec.Enabled))));\n        }\n\n        public override bool Equals(object profileCreateSpec)\n        {\n            return Equals(profileCreateSpec as ProfileCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Annotation + \"_\" + Enabled).GetHashCode();\n        }\n    }\n\n    public class ProfileDeferredPolicyOptionParameter : DynamicData, IEquatable<ProfileDeferredPolicyOptionParameter>\n    {\n        public ProfilePropertyPath InputPath { get; set; }\n\n        public KeyAnyValue[] Parameter { get; set; }\n\n        public bool Equals(ProfileDeferredPolicyOptionParameter profileDeferredPolicyOptionParameter)\n        {\n            return (profileDeferredPolicyOptionParameter != null && ((this.InputPath == null && profileDeferredPolicyOptionParameter.InputPath == null) || (this.InputPath != null && this.InputPath.Equals(profileDeferredPolicyOptionParameter.InputPath))) && ((this.Parameter == null && profileDeferredPolicyOptionParameter.Parameter == null) || (this.Parameter != null && profileDeferredPolicyOptionParameter.Parameter != null && Enumerable.SequenceEqual(this.Parameter, profileDeferredPolicyOptionParameter.Parameter))));\n        }\n\n        public override bool Equals(object profileDeferredPolicyOptionParameter)\n        {\n            return Equals(profileDeferredPolicyOptionParameter as ProfileDeferredPolicyOptionParameter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InputPath + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class ProfileDescription : DynamicData, IEquatable<ProfileDescription>\n    {\n        public ProfileDescriptionSection[] Section { get; set; }\n\n        public bool Equals(ProfileDescription profileDescription)\n        {\n            return (profileDescription != null && ((this.Section == null && profileDescription.Section == null) || (this.Section != null && profileDescription.Section != null && Enumerable.SequenceEqual(this.Section, profileDescription.Section))));\n        }\n\n        public override bool Equals(object profileDescription)\n        {\n            return Equals(profileDescription as ProfileDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Section).GetHashCode();\n        }\n    }\n\n    public class ProfileDescriptionSection : DynamicData, IEquatable<ProfileDescriptionSection>\n    {\n        public ExtendedElementDescription Description { get; set; }\n\n        public LocalizableMessage[] Message { get; set; }\n\n        public bool Equals(ProfileDescriptionSection profileDescriptionSection)\n        {\n            return (profileDescriptionSection != null && ((this.Description == null && profileDescriptionSection.Description == null) || (this.Description != null && this.Description.Equals(profileDescriptionSection.Description))) && ((this.Message == null && profileDescriptionSection.Message == null) || (this.Message != null && profileDescriptionSection.Message != null && Enumerable.SequenceEqual(this.Message, profileDescriptionSection.Message))));\n        }\n\n        public override bool Equals(object profileDescriptionSection)\n        {\n            return Equals(profileDescriptionSection as ProfileDescriptionSection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class ProfileDissociatedEvent : ProfileEvent, IEquatable<ProfileDissociatedEvent>\n    {\n        public bool Equals(ProfileDissociatedEvent profileDissociatedEvent)\n        {\n            return (profileDissociatedEvent != null && base.Equals(profileDissociatedEvent));\n        }\n\n        public override bool Equals(object profileDissociatedEvent)\n        {\n            return Equals(profileDissociatedEvent as ProfileDissociatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ProfileEvent : Event, IEquatable<ProfileEvent>\n    {\n        public ProfileEventArgument Profile { get; set; }\n\n        public bool Equals(ProfileEvent profileEvent)\n        {\n            return (profileEvent != null && ((this.Profile == null && profileEvent.Profile == null) || (this.Profile != null && this.Profile.Equals(profileEvent.Profile))));\n        }\n\n        public override bool Equals(object profileEvent)\n        {\n            return Equals(profileEvent as ProfileEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile).GetHashCode();\n        }\n    }\n\n    public class ProfileEventArgument : EventArgument, IEquatable<ProfileEventArgument>\n    {\n        public ManagedObjectReference Profile { get; set; }\n\n        public string Name { get; set; }\n\n        public ProfileEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ProfileEventArgument profileEventArgument)\n        {\n            return (profileEventArgument != null && ((this.Profile == null && profileEventArgument.Profile == null) || (this.Profile != null && this.Profile.Equals(profileEventArgument.Profile))) && this.Name == profileEventArgument.Name && ((this.LinkedView == null && profileEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(profileEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object profileEventArgument)\n        {\n            return Equals(profileEventArgument as ProfileEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile + \"_\" + Name + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ProfileEventArgument_LinkedView : IEquatable<ProfileEventArgument_LinkedView>\n    {\n        public Profile Profile { get; set; }\n\n        public bool Equals(ProfileEventArgument_LinkedView profileEventArgument_LinkedView)\n        {\n            return (profileEventArgument_LinkedView != null && ((this.Profile == null && profileEventArgument_LinkedView.Profile == null) || (this.Profile != null && this.Profile.Equals(profileEventArgument_LinkedView.Profile))));\n        }\n\n        public override bool Equals(object profileEventArgument_LinkedView)\n        {\n            return Equals(profileEventArgument_LinkedView as ProfileEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile).GetHashCode();\n        }\n    }\n\n    public class ProfileExecuteError : DynamicData, IEquatable<ProfileExecuteError>\n    {\n        public ProfilePropertyPath Path { get; set; }\n\n        public LocalizableMessage Message { get; set; }\n\n        public bool Equals(ProfileExecuteError profileExecuteError)\n        {\n            return (profileExecuteError != null && ((this.Path == null && profileExecuteError.Path == null) || (this.Path != null && this.Path.Equals(profileExecuteError.Path))) && ((this.Message == null && profileExecuteError.Message == null) || (this.Message != null && this.Message.Equals(profileExecuteError.Message))));\n        }\n\n        public override bool Equals(object profileExecuteError)\n        {\n            return Equals(profileExecuteError as ProfileExecuteError);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class ProfileExecuteResult : DynamicData, IEquatable<ProfileExecuteResult>\n    {\n        public string Status { get; set; }\n\n        public HostConfigSpec ConfigSpec { get; set; }\n\n        public string[] InapplicablePath { get; set; }\n\n        public ProfileDeferredPolicyOptionParameter[] RequireInput { get; set; }\n\n        public ProfileExecuteError[] Error { get; set; }\n\n        public bool Equals(ProfileExecuteResult profileExecuteResult)\n        {\n            return (profileExecuteResult != null && this.Status == profileExecuteResult.Status && ((this.ConfigSpec == null && profileExecuteResult.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(profileExecuteResult.ConfigSpec))) && ((this.InapplicablePath == null && profileExecuteResult.InapplicablePath == null) || (this.InapplicablePath != null && profileExecuteResult.InapplicablePath != null && Enumerable.SequenceEqual(this.InapplicablePath, profileExecuteResult.InapplicablePath))) && ((this.RequireInput == null && profileExecuteResult.RequireInput == null) || (this.RequireInput != null && profileExecuteResult.RequireInput != null && Enumerable.SequenceEqual(this.RequireInput, profileExecuteResult.RequireInput))) && ((this.Error == null && profileExecuteResult.Error == null) || (this.Error != null && profileExecuteResult.Error != null && Enumerable.SequenceEqual(this.Error, profileExecuteResult.Error))));\n        }\n\n        public override bool Equals(object profileExecuteResult)\n        {\n            return Equals(profileExecuteResult as ProfileExecuteResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Status + \"_\" + ConfigSpec + \"_\" + InapplicablePath + \"_\" + RequireInput + \"_\" + Error).GetHashCode();\n        }\n    }\n\n    public class ProfileExpression : DynamicData, IEquatable<ProfileExpression>\n    {\n        public string Id { get; set; }\n\n        public string DisplayName { get; set; }\n\n        public bool Negated { get; set; }\n\n        public bool Equals(ProfileExpression profileExpression)\n        {\n            return (profileExpression != null && this.Id == profileExpression.Id && this.DisplayName == profileExpression.DisplayName && this.Negated == profileExpression.Negated);\n        }\n\n        public override bool Equals(object profileExpression)\n        {\n            return Equals(profileExpression as ProfileExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + DisplayName + \"_\" + Negated).GetHashCode();\n        }\n    }\n\n    public class ProfileExpressionMetadata : DynamicData, IEquatable<ProfileExpressionMetadata>\n    {\n        public ExtendedElementDescription ExpressionId { get; set; }\n\n        public ProfileParameterMetadata[] Parameter { get; set; }\n\n        public bool Equals(ProfileExpressionMetadata profileExpressionMetadata)\n        {\n            return (profileExpressionMetadata != null && ((this.ExpressionId == null && profileExpressionMetadata.ExpressionId == null) || (this.ExpressionId != null && this.ExpressionId.Equals(profileExpressionMetadata.ExpressionId))) && ((this.Parameter == null && profileExpressionMetadata.Parameter == null) || (this.Parameter != null && profileExpressionMetadata.Parameter != null && Enumerable.SequenceEqual(this.Parameter, profileExpressionMetadata.Parameter))));\n        }\n\n        public override bool Equals(object profileExpressionMetadata)\n        {\n            return Equals(profileExpressionMetadata as ProfileExpressionMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExpressionId + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class ProfileManager : ViewBase, IEquatable<ProfileManager>\n    {\n        public ManagedObjectReference[] Profile { get; set; }\n\n        public ProfileManager_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference CreateProfile(ProfileCreateSpec createSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ProfilePolicyMetadata[] QueryPolicyMetadata(string[] policyName, ManagedObjectReference profile)\n        {\n            return default(ProfilePolicyMetadata[]);\n        }\n\n        public ManagedObjectReference[] FindAssociatedProfile(ManagedObjectReference entity)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool Equals(ProfileManager profileManager)\n        {\n            return (profileManager != null && ((this.Profile == null && profileManager.Profile == null) || (this.Profile != null && profileManager.Profile != null && Enumerable.SequenceEqual(this.Profile, profileManager.Profile))) && ((this.LinkedView == null && profileManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(profileManager.LinkedView))));\n        }\n\n        public override bool Equals(object profileManager)\n        {\n            return Equals(profileManager as ProfileManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ProfileManager_LinkedView : IEquatable<ProfileManager_LinkedView>\n    {\n        public Profile[] Profile { get; set; }\n\n        public bool Equals(ProfileManager_LinkedView profileManager_LinkedView)\n        {\n            return (profileManager_LinkedView != null && ((this.Profile == null && profileManager_LinkedView.Profile == null) || (this.Profile != null && profileManager_LinkedView.Profile != null && Enumerable.SequenceEqual(this.Profile, profileManager_LinkedView.Profile))));\n        }\n\n        public override bool Equals(object profileManager_LinkedView)\n        {\n            return Equals(profileManager_LinkedView as ProfileManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile).GetHashCode();\n        }\n    }\n\n    public class ProfileMetadata : DynamicData, IEquatable<ProfileMetadata>\n    {\n        public string Key { get; set; }\n\n        public string ProfileTypeName { get; set; }\n\n        public ExtendedDescription Description { get; set; }\n\n        public ProfileMetadataProfileSortSpec[] SortSpec { get; set; }\n\n        public string ProfileCategory { get; set; }\n\n        public string ProfileComponent { get; set; }\n\n        public ProfileMetadataProfileOperationMessage[] OperationMessages { get; set; }\n\n        public bool Equals(ProfileMetadata profileMetadata)\n        {\n            return (profileMetadata != null && this.Key == profileMetadata.Key && this.ProfileTypeName == profileMetadata.ProfileTypeName && ((this.Description == null && profileMetadata.Description == null) || (this.Description != null && this.Description.Equals(profileMetadata.Description))) && ((this.SortSpec == null && profileMetadata.SortSpec == null) || (this.SortSpec != null && profileMetadata.SortSpec != null && Enumerable.SequenceEqual(this.SortSpec, profileMetadata.SortSpec))) && this.ProfileCategory == profileMetadata.ProfileCategory && this.ProfileComponent == profileMetadata.ProfileComponent && ((this.OperationMessages == null && profileMetadata.OperationMessages == null) || (this.OperationMessages != null && profileMetadata.OperationMessages != null && Enumerable.SequenceEqual(this.OperationMessages, profileMetadata.OperationMessages))));\n        }\n\n        public override bool Equals(object profileMetadata)\n        {\n            return Equals(profileMetadata as ProfileMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ProfileTypeName + \"_\" + Description + \"_\" + SortSpec + \"_\" + ProfileCategory + \"_\" + ProfileComponent + \"_\" + OperationMessages).GetHashCode();\n        }\n    }\n\n    public class ProfileMetadataProfileOperationMessage : DynamicData, IEquatable<ProfileMetadataProfileOperationMessage>\n    {\n        public string OperationName { get; set; }\n\n        public LocalizableMessage Message { get; set; }\n\n        public bool Equals(ProfileMetadataProfileOperationMessage profileMetadataProfileOperationMessage)\n        {\n            return (profileMetadataProfileOperationMessage != null && this.OperationName == profileMetadataProfileOperationMessage.OperationName && ((this.Message == null && profileMetadataProfileOperationMessage.Message == null) || (this.Message != null && this.Message.Equals(profileMetadataProfileOperationMessage.Message))));\n        }\n\n        public override bool Equals(object profileMetadataProfileOperationMessage)\n        {\n            return Equals(profileMetadataProfileOperationMessage as ProfileMetadataProfileOperationMessage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OperationName + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class ProfileMetadataProfileSortSpec : DynamicData, IEquatable<ProfileMetadataProfileSortSpec>\n    {\n        public string PolicyId { get; set; }\n\n        public string Parameter { get; set; }\n\n        public bool Equals(ProfileMetadataProfileSortSpec profileMetadataProfileSortSpec)\n        {\n            return (profileMetadataProfileSortSpec != null && this.PolicyId == profileMetadataProfileSortSpec.PolicyId && this.Parameter == profileMetadataProfileSortSpec.Parameter);\n        }\n\n        public override bool Equals(object profileMetadataProfileSortSpec)\n        {\n            return Equals(profileMetadataProfileSortSpec as ProfileMetadataProfileSortSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PolicyId + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class ProfileParameterMetadata : DynamicData, IEquatable<ProfileParameterMetadata>\n    {\n        public ExtendedElementDescription Id { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Optional { get; set; }\n\n        public object DefaultValue { get; set; }\n\n        public bool? Hidden { get; set; }\n\n        public bool? SecuritySensitive { get; set; }\n\n        public bool? ReadOnly { get; set; }\n\n        public ProfileParameterMetadataParameterRelationMetadata[] ParameterRelations { get; set; }\n\n        public bool Equals(ProfileParameterMetadata profileParameterMetadata)\n        {\n            return (profileParameterMetadata != null && ((this.Id == null && profileParameterMetadata.Id == null) || (this.Id != null && this.Id.Equals(profileParameterMetadata.Id))) && this.Type == profileParameterMetadata.Type && this.Optional == profileParameterMetadata.Optional && ((this.DefaultValue == null && profileParameterMetadata.DefaultValue == null) || (this.DefaultValue != null && this.DefaultValue.Equals(profileParameterMetadata.DefaultValue))) && ((this.Hidden == null && profileParameterMetadata.Hidden == null) || (this.Hidden != null && this.Hidden.Equals(profileParameterMetadata.Hidden))) && ((this.SecuritySensitive == null && profileParameterMetadata.SecuritySensitive == null) || (this.SecuritySensitive != null && this.SecuritySensitive.Equals(profileParameterMetadata.SecuritySensitive))) && ((this.ReadOnly == null && profileParameterMetadata.ReadOnly == null) || (this.ReadOnly != null && this.ReadOnly.Equals(profileParameterMetadata.ReadOnly))) && ((this.ParameterRelations == null && profileParameterMetadata.ParameterRelations == null) || (this.ParameterRelations != null && profileParameterMetadata.ParameterRelations != null && Enumerable.SequenceEqual(this.ParameterRelations, profileParameterMetadata.ParameterRelations))));\n        }\n\n        public override bool Equals(object profileParameterMetadata)\n        {\n            return Equals(profileParameterMetadata as ProfileParameterMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Type + \"_\" + Optional + \"_\" + DefaultValue + \"_\" + Hidden + \"_\" + SecuritySensitive + \"_\" + ReadOnly + \"_\" + ParameterRelations).GetHashCode();\n        }\n    }\n\n    public class ProfileParameterMetadataParameterRelationMetadata : DynamicData, IEquatable<ProfileParameterMetadataParameterRelationMetadata>\n    {\n        public string[] RelationTypes { get; set; }\n\n        public object[] Values { get; set; }\n\n        public ProfilePropertyPath Path { get; set; }\n\n        public int MinCount { get; set; }\n\n        public int MaxCount { get; set; }\n\n        public bool Equals(ProfileParameterMetadataParameterRelationMetadata profileParameterMetadataParameterRelationMetadata)\n        {\n            return (profileParameterMetadataParameterRelationMetadata != null && ((this.RelationTypes == null && profileParameterMetadataParameterRelationMetadata.RelationTypes == null) || (this.RelationTypes != null && profileParameterMetadataParameterRelationMetadata.RelationTypes != null && Enumerable.SequenceEqual(this.RelationTypes, profileParameterMetadataParameterRelationMetadata.RelationTypes))) && ((this.Values == null && profileParameterMetadataParameterRelationMetadata.Values == null) || (this.Values != null && profileParameterMetadataParameterRelationMetadata.Values != null && Enumerable.SequenceEqual(this.Values, profileParameterMetadataParameterRelationMetadata.Values))) && ((this.Path == null && profileParameterMetadataParameterRelationMetadata.Path == null) || (this.Path != null && this.Path.Equals(profileParameterMetadataParameterRelationMetadata.Path))) && this.MinCount == profileParameterMetadataParameterRelationMetadata.MinCount && this.MaxCount == profileParameterMetadataParameterRelationMetadata.MaxCount);\n        }\n\n        public override bool Equals(object profileParameterMetadataParameterRelationMetadata)\n        {\n            return Equals(profileParameterMetadataParameterRelationMetadata as ProfileParameterMetadataParameterRelationMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RelationTypes + \"_\" + Values + \"_\" + Path + \"_\" + MinCount + \"_\" + MaxCount).GetHashCode();\n        }\n    }\n\n    public class ProfilePolicy : DynamicData, IEquatable<ProfilePolicy>\n    {\n        public string Id { get; set; }\n\n        public PolicyOption PolicyOption { get; set; }\n\n        public bool Equals(ProfilePolicy profilePolicy)\n        {\n            return (profilePolicy != null && this.Id == profilePolicy.Id && ((this.PolicyOption == null && profilePolicy.PolicyOption == null) || (this.PolicyOption != null && this.PolicyOption.Equals(profilePolicy.PolicyOption))));\n        }\n\n        public override bool Equals(object profilePolicy)\n        {\n            return Equals(profilePolicy as ProfilePolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + PolicyOption).GetHashCode();\n        }\n    }\n\n    public class ProfilePolicyMetadata : DynamicData, IEquatable<ProfilePolicyMetadata>\n    {\n        public ExtendedElementDescription Id { get; set; }\n\n        public ProfilePolicyOptionMetadata[] PossibleOption { get; set; }\n\n        public bool Equals(ProfilePolicyMetadata profilePolicyMetadata)\n        {\n            return (profilePolicyMetadata != null && ((this.Id == null && profilePolicyMetadata.Id == null) || (this.Id != null && this.Id.Equals(profilePolicyMetadata.Id))) && ((this.PossibleOption == null && profilePolicyMetadata.PossibleOption == null) || (this.PossibleOption != null && profilePolicyMetadata.PossibleOption != null && Enumerable.SequenceEqual(this.PossibleOption, profilePolicyMetadata.PossibleOption))));\n        }\n\n        public override bool Equals(object profilePolicyMetadata)\n        {\n            return Equals(profilePolicyMetadata as ProfilePolicyMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + PossibleOption).GetHashCode();\n        }\n    }\n\n    public class ProfilePolicyOptionMetadata : DynamicData, IEquatable<ProfilePolicyOptionMetadata>\n    {\n        public ExtendedElementDescription Id { get; set; }\n\n        public ProfileParameterMetadata[] Parameter { get; set; }\n\n        public bool Equals(ProfilePolicyOptionMetadata profilePolicyOptionMetadata)\n        {\n            return (profilePolicyOptionMetadata != null && ((this.Id == null && profilePolicyOptionMetadata.Id == null) || (this.Id != null && this.Id.Equals(profilePolicyOptionMetadata.Id))) && ((this.Parameter == null && profilePolicyOptionMetadata.Parameter == null) || (this.Parameter != null && profilePolicyOptionMetadata.Parameter != null && Enumerable.SequenceEqual(this.Parameter, profilePolicyOptionMetadata.Parameter))));\n        }\n\n        public override bool Equals(object profilePolicyOptionMetadata)\n        {\n            return Equals(profilePolicyOptionMetadata as ProfilePolicyOptionMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class ProfileProfileStructure : DynamicData, IEquatable<ProfileProfileStructure>\n    {\n        public string ProfileTypeName { get; set; }\n\n        public ProfileProfileStructureProperty[] Child { get; set; }\n\n        public bool Equals(ProfileProfileStructure profileProfileStructure)\n        {\n            return (profileProfileStructure != null && this.ProfileTypeName == profileProfileStructure.ProfileTypeName && ((this.Child == null && profileProfileStructure.Child == null) || (this.Child != null && profileProfileStructure.Child != null && Enumerable.SequenceEqual(this.Child, profileProfileStructure.Child))));\n        }\n\n        public override bool Equals(object profileProfileStructure)\n        {\n            return Equals(profileProfileStructure as ProfileProfileStructure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProfileTypeName + \"_\" + Child).GetHashCode();\n        }\n    }\n\n    public class ProfileProfileStructureProperty : DynamicData, IEquatable<ProfileProfileStructureProperty>\n    {\n        public string PropertyName { get; set; }\n\n        public bool Array { get; set; }\n\n        public ProfileProfileStructure Element { get; set; }\n\n        public bool Equals(ProfileProfileStructureProperty profileProfileStructureProperty)\n        {\n            return (profileProfileStructureProperty != null && this.PropertyName == profileProfileStructureProperty.PropertyName && this.Array == profileProfileStructureProperty.Array && ((this.Element == null && profileProfileStructureProperty.Element == null) || (this.Element != null && this.Element.Equals(profileProfileStructureProperty.Element))));\n        }\n\n        public override bool Equals(object profileProfileStructureProperty)\n        {\n            return Equals(profileProfileStructureProperty as ProfileProfileStructureProperty);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PropertyName + \"_\" + Array + \"_\" + Element).GetHashCode();\n        }\n    }\n\n    public class ProfilePropertyPath : DynamicData, IEquatable<ProfilePropertyPath>\n    {\n        public string ProfilePath { get; set; }\n\n        public string PolicyId { get; set; }\n\n        public string ParameterId { get; set; }\n\n        public string PolicyOptionId { get; set; }\n\n        public bool Equals(ProfilePropertyPath profilePropertyPath)\n        {\n            return (profilePropertyPath != null && this.ProfilePath == profilePropertyPath.ProfilePath && this.PolicyId == profilePropertyPath.PolicyId && this.ParameterId == profilePropertyPath.ParameterId && this.PolicyOptionId == profilePropertyPath.PolicyOptionId);\n        }\n\n        public override bool Equals(object profilePropertyPath)\n        {\n            return Equals(profilePropertyPath as ProfilePropertyPath);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProfilePath + \"_\" + PolicyId + \"_\" + ParameterId + \"_\" + PolicyOptionId).GetHashCode();\n        }\n    }\n\n    public class ProfileReferenceHostChangedEvent : ProfileEvent, IEquatable<ProfileReferenceHostChangedEvent>\n    {\n        public ManagedObjectReference ReferenceHost { get; set; }\n\n        public string ReferenceHostName { get; set; }\n\n        public string PrevReferenceHostName { get; set; }\n\n        public ProfileReferenceHostChangedEvent_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ProfileReferenceHostChangedEvent profileReferenceHostChangedEvent)\n        {\n            return (profileReferenceHostChangedEvent != null && ((this.ReferenceHost == null && profileReferenceHostChangedEvent.ReferenceHost == null) || (this.ReferenceHost != null && this.ReferenceHost.Equals(profileReferenceHostChangedEvent.ReferenceHost))) && this.ReferenceHostName == profileReferenceHostChangedEvent.ReferenceHostName && this.PrevReferenceHostName == profileReferenceHostChangedEvent.PrevReferenceHostName && ((this.LinkedView == null && profileReferenceHostChangedEvent.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(profileReferenceHostChangedEvent.LinkedView))));\n        }\n\n        public override bool Equals(object profileReferenceHostChangedEvent)\n        {\n            return Equals(profileReferenceHostChangedEvent as ProfileReferenceHostChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReferenceHost + \"_\" + ReferenceHostName + \"_\" + PrevReferenceHostName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ProfileReferenceHostChangedEvent_LinkedView : IEquatable<ProfileReferenceHostChangedEvent_LinkedView>\n    {\n        public HostSystem ReferenceHost { get; set; }\n\n        public bool Equals(ProfileReferenceHostChangedEvent_LinkedView profileReferenceHostChangedEvent_LinkedView)\n        {\n            return (profileReferenceHostChangedEvent_LinkedView != null && ((this.ReferenceHost == null && profileReferenceHostChangedEvent_LinkedView.ReferenceHost == null) || (this.ReferenceHost != null && this.ReferenceHost.Equals(profileReferenceHostChangedEvent_LinkedView.ReferenceHost))));\n        }\n\n        public override bool Equals(object profileReferenceHostChangedEvent_LinkedView)\n        {\n            return Equals(profileReferenceHostChangedEvent_LinkedView as ProfileReferenceHostChangedEvent_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReferenceHost).GetHashCode();\n        }\n    }\n\n    public class ProfileRemovedEvent : ProfileEvent, IEquatable<ProfileRemovedEvent>\n    {\n        public bool Equals(ProfileRemovedEvent profileRemovedEvent)\n        {\n            return (profileRemovedEvent != null && base.Equals(profileRemovedEvent));\n        }\n\n        public override bool Equals(object profileRemovedEvent)\n        {\n            return Equals(profileRemovedEvent as ProfileRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ProfileSerializedCreateSpec : ProfileCreateSpec, IEquatable<ProfileSerializedCreateSpec>\n    {\n        public string ProfileConfigString { get; set; }\n\n        public bool Equals(ProfileSerializedCreateSpec profileSerializedCreateSpec)\n        {\n            return (profileSerializedCreateSpec != null && this.ProfileConfigString == profileSerializedCreateSpec.ProfileConfigString);\n        }\n\n        public override bool Equals(object profileSerializedCreateSpec)\n        {\n            return Equals(profileSerializedCreateSpec as ProfileSerializedCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProfileConfigString).GetHashCode();\n        }\n    }\n\n    public class ProfileSimpleExpression : ProfileExpression, IEquatable<ProfileSimpleExpression>\n    {\n        public string ExpressionType { get; set; }\n\n        public KeyAnyValue[] Parameter { get; set; }\n\n        public bool Equals(ProfileSimpleExpression profileSimpleExpression)\n        {\n            return (profileSimpleExpression != null && this.ExpressionType == profileSimpleExpression.ExpressionType && ((this.Parameter == null && profileSimpleExpression.Parameter == null) || (this.Parameter != null && profileSimpleExpression.Parameter != null && Enumerable.SequenceEqual(this.Parameter, profileSimpleExpression.Parameter))));\n        }\n\n        public override bool Equals(object profileSimpleExpression)\n        {\n            return Equals(profileSimpleExpression as ProfileSimpleExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExpressionType + \"_\" + Parameter).GetHashCode();\n        }\n    }\n\n    public class ProfileUpdateFailed : VimFault, IEquatable<ProfileUpdateFailed>\n    {\n        public ProfileUpdateFailedUpdateFailure[] Failure { get; set; }\n\n        public ProfileUpdateFailedUpdateFailure[] Warnings { get; set; }\n\n        public bool Equals(ProfileUpdateFailed profileUpdateFailed)\n        {\n            return (profileUpdateFailed != null && ((this.Failure == null && profileUpdateFailed.Failure == null) || (this.Failure != null && profileUpdateFailed.Failure != null && Enumerable.SequenceEqual(this.Failure, profileUpdateFailed.Failure))) && ((this.Warnings == null && profileUpdateFailed.Warnings == null) || (this.Warnings != null && profileUpdateFailed.Warnings != null && Enumerable.SequenceEqual(this.Warnings, profileUpdateFailed.Warnings))));\n        }\n\n        public override bool Equals(object profileUpdateFailed)\n        {\n            return Equals(profileUpdateFailed as ProfileUpdateFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Failure + \"_\" + Warnings).GetHashCode();\n        }\n    }\n\n    public class ProfileUpdateFailedUpdateFailure : DynamicData, IEquatable<ProfileUpdateFailedUpdateFailure>\n    {\n        public ProfilePropertyPath ProfilePath { get; set; }\n\n        public LocalizableMessage ErrMsg { get; set; }\n\n        public bool Equals(ProfileUpdateFailedUpdateFailure profileUpdateFailedUpdateFailure)\n        {\n            return (profileUpdateFailedUpdateFailure != null && ((this.ProfilePath == null && profileUpdateFailedUpdateFailure.ProfilePath == null) || (this.ProfilePath != null && this.ProfilePath.Equals(profileUpdateFailedUpdateFailure.ProfilePath))) && ((this.ErrMsg == null && profileUpdateFailedUpdateFailure.ErrMsg == null) || (this.ErrMsg != null && this.ErrMsg.Equals(profileUpdateFailedUpdateFailure.ErrMsg))));\n        }\n\n        public override bool Equals(object profileUpdateFailedUpdateFailure)\n        {\n            return Equals(profileUpdateFailedUpdateFailure as ProfileUpdateFailedUpdateFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProfilePath + \"_\" + ErrMsg).GetHashCode();\n        }\n    }\n\n    public class PropertyChange : DynamicData, IEquatable<PropertyChange>\n    {\n        public string Name { get; set; }\n\n        public PropertyChangeOp Op { get; set; }\n\n        public object Val { get; set; }\n\n        public bool Equals(PropertyChange propertyChange)\n        {\n            return (propertyChange != null && this.Name == propertyChange.Name && this.Op == propertyChange.Op && ((this.Val == null && propertyChange.Val == null) || (this.Val != null && this.Val.Equals(propertyChange.Val))));\n        }\n\n        public override bool Equals(object propertyChange)\n        {\n            return Equals(propertyChange as PropertyChange);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Op + \"_\" + Val).GetHashCode();\n        }\n    }\n\n    public class PropertyCollector : ViewBase, IEquatable<PropertyCollector>\n    {\n        public ManagedObjectReference[] Filter { get; set; }\n\n        public PropertyCollector_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference CreateFilter(PropertyFilterSpec spec, bool partialUpdates)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ObjectContent[] RetrieveProperties(PropertyFilterSpec[] specSet)\n        {\n            return default(ObjectContent[]);\n        }\n\n        public UpdateSet CheckForUpdates(string version)\n        {\n            return default(UpdateSet);\n        }\n\n        public UpdateSet WaitForUpdates(string version)\n        {\n            return default(UpdateSet);\n        }\n\n        public void CancelWaitForUpdates()\n        {\n        }\n\n        public UpdateSet WaitForUpdatesEx(string version, WaitOptions options)\n        {\n            return default(UpdateSet);\n        }\n\n        public RetrieveResult RetrievePropertiesEx(PropertyFilterSpec[] specSet, RetrieveOptions options)\n        {\n            return default(RetrieveResult);\n        }\n\n        public RetrieveResult ContinueRetrievePropertiesEx(string token)\n        {\n            return default(RetrieveResult);\n        }\n\n        public void CancelRetrievePropertiesEx(string token)\n        {\n        }\n\n        public ManagedObjectReference CreatePropertyCollector()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DestroyPropertyCollector()\n        {\n        }\n\n        public bool Equals(PropertyCollector propertyCollector)\n        {\n            return (propertyCollector != null && ((this.Filter == null && propertyCollector.Filter == null) || (this.Filter != null && propertyCollector.Filter != null && Enumerable.SequenceEqual(this.Filter, propertyCollector.Filter))) && ((this.LinkedView == null && propertyCollector.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(propertyCollector.LinkedView))));\n        }\n\n        public override bool Equals(object propertyCollector)\n        {\n            return Equals(propertyCollector as PropertyCollector);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PropertyCollector_LinkedView : IEquatable<PropertyCollector_LinkedView>\n    {\n        public PropertyFilter[] Filter { get; set; }\n\n        public bool Equals(PropertyCollector_LinkedView propertyCollector_LinkedView)\n        {\n            return (propertyCollector_LinkedView != null && ((this.Filter == null && propertyCollector_LinkedView.Filter == null) || (this.Filter != null && propertyCollector_LinkedView.Filter != null && Enumerable.SequenceEqual(this.Filter, propertyCollector_LinkedView.Filter))));\n        }\n\n        public override bool Equals(object propertyCollector_LinkedView)\n        {\n            return Equals(propertyCollector_LinkedView as PropertyCollector_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter).GetHashCode();\n        }\n    }\n\n    public class PropertyFilter : ViewBase, IEquatable<PropertyFilter>\n    {\n        public PropertyFilterSpec Spec { get; set; }\n\n        public bool PartialUpdates { get; set; }\n\n        public void DestroyPropertyFilter()\n        {\n        }\n\n        public bool Equals(PropertyFilter propertyFilter)\n        {\n            return (propertyFilter != null && ((this.Spec == null && propertyFilter.Spec == null) || (this.Spec != null && this.Spec.Equals(propertyFilter.Spec))) && this.PartialUpdates == propertyFilter.PartialUpdates);\n        }\n\n        public override bool Equals(object propertyFilter)\n        {\n            return Equals(propertyFilter as PropertyFilter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Spec + \"_\" + PartialUpdates).GetHashCode();\n        }\n    }\n\n    public class PropertyFilterSpec : DynamicData, IEquatable<PropertyFilterSpec>\n    {\n        public PropertySpec[] PropSet { get; set; }\n\n        public ObjectSpec[] ObjectSet { get; set; }\n\n        public bool? ReportMissingObjectsInResults { get; set; }\n\n        public bool Equals(PropertyFilterSpec propertyFilterSpec)\n        {\n            return (propertyFilterSpec != null && ((this.PropSet == null && propertyFilterSpec.PropSet == null) || (this.PropSet != null && propertyFilterSpec.PropSet != null && Enumerable.SequenceEqual(this.PropSet, propertyFilterSpec.PropSet))) && ((this.ObjectSet == null && propertyFilterSpec.ObjectSet == null) || (this.ObjectSet != null && propertyFilterSpec.ObjectSet != null && Enumerable.SequenceEqual(this.ObjectSet, propertyFilterSpec.ObjectSet))) && ((this.ReportMissingObjectsInResults == null && propertyFilterSpec.ReportMissingObjectsInResults == null) || (this.ReportMissingObjectsInResults != null && this.ReportMissingObjectsInResults.Equals(propertyFilterSpec.ReportMissingObjectsInResults))));\n        }\n\n        public override bool Equals(object propertyFilterSpec)\n        {\n            return Equals(propertyFilterSpec as PropertyFilterSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PropSet + \"_\" + ObjectSet + \"_\" + ReportMissingObjectsInResults).GetHashCode();\n        }\n    }\n\n    public class PropertyFilterUpdate : DynamicData, IEquatable<PropertyFilterUpdate>\n    {\n        public ManagedObjectReference Filter { get; set; }\n\n        public ObjectUpdate[] ObjectSet { get; set; }\n\n        public MissingObject[] MissingSet { get; set; }\n\n        public PropertyFilterUpdate_LinkedView LinkedView { get; set; }\n\n        public bool Equals(PropertyFilterUpdate propertyFilterUpdate)\n        {\n            return (propertyFilterUpdate != null && ((this.Filter == null && propertyFilterUpdate.Filter == null) || (this.Filter != null && this.Filter.Equals(propertyFilterUpdate.Filter))) && ((this.ObjectSet == null && propertyFilterUpdate.ObjectSet == null) || (this.ObjectSet != null && propertyFilterUpdate.ObjectSet != null && Enumerable.SequenceEqual(this.ObjectSet, propertyFilterUpdate.ObjectSet))) && ((this.MissingSet == null && propertyFilterUpdate.MissingSet == null) || (this.MissingSet != null && propertyFilterUpdate.MissingSet != null && Enumerable.SequenceEqual(this.MissingSet, propertyFilterUpdate.MissingSet))) && ((this.LinkedView == null && propertyFilterUpdate.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(propertyFilterUpdate.LinkedView))));\n        }\n\n        public override bool Equals(object propertyFilterUpdate)\n        {\n            return Equals(propertyFilterUpdate as PropertyFilterUpdate);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter + \"_\" + ObjectSet + \"_\" + MissingSet + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class PropertyFilterUpdate_LinkedView : IEquatable<PropertyFilterUpdate_LinkedView>\n    {\n        public PropertyFilter Filter { get; set; }\n\n        public bool Equals(PropertyFilterUpdate_LinkedView propertyFilterUpdate_LinkedView)\n        {\n            return (propertyFilterUpdate_LinkedView != null && ((this.Filter == null && propertyFilterUpdate_LinkedView.Filter == null) || (this.Filter != null && this.Filter.Equals(propertyFilterUpdate_LinkedView.Filter))));\n        }\n\n        public override bool Equals(object propertyFilterUpdate_LinkedView)\n        {\n            return Equals(propertyFilterUpdate_LinkedView as PropertyFilterUpdate_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter).GetHashCode();\n        }\n    }\n\n    public class PropertySpec : DynamicData, IEquatable<PropertySpec>\n    {\n        public string Type { get; set; }\n\n        public bool? All { get; set; }\n\n        public string[] PathSet { get; set; }\n\n        public bool Equals(PropertySpec propertySpec)\n        {\n            return (propertySpec != null && this.Type == propertySpec.Type && ((this.All == null && propertySpec.All == null) || (this.All != null && this.All.Equals(propertySpec.All))) && ((this.PathSet == null && propertySpec.PathSet == null) || (this.PathSet != null && propertySpec.PathSet != null && Enumerable.SequenceEqual(this.PathSet, propertySpec.PathSet))));\n        }\n\n        public override bool Equals(object propertySpec)\n        {\n            return Equals(propertySpec as PropertySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + All + \"_\" + PathSet).GetHashCode();\n        }\n    }\n\n    public class QuarantineModeFault : VmConfigFault, IEquatable<QuarantineModeFault>\n    {\n        public string VmName { get; set; }\n\n        public string FaultType { get; set; }\n\n        public bool Equals(QuarantineModeFault quarantineModeFault)\n        {\n            return (quarantineModeFault != null && this.VmName == quarantineModeFault.VmName && this.FaultType == quarantineModeFault.FaultType);\n        }\n\n        public override bool Equals(object quarantineModeFault)\n        {\n            return Equals(quarantineModeFault as QuarantineModeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName + \"_\" + FaultType).GetHashCode();\n        }\n    }\n\n    public class QuestionPending : InvalidState, IEquatable<QuestionPending>\n    {\n        public string Text { get; set; }\n\n        public bool Equals(QuestionPending questionPending)\n        {\n            return (questionPending != null && this.Text == questionPending.Text);\n        }\n\n        public override bool Equals(object questionPending)\n        {\n            return Equals(questionPending as QuestionPending);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Text).GetHashCode();\n        }\n    }\n\n    public class QuiesceDatastoreIOForHAFailed : ResourceInUse, IEquatable<QuiesceDatastoreIOForHAFailed>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string HostName { get; set; }\n\n        public ManagedObjectReference Ds { get; set; }\n\n        public string DsName { get; set; }\n\n        public QuiesceDatastoreIOForHAFailed_LinkedView LinkedView { get; set; }\n\n        public bool Equals(QuiesceDatastoreIOForHAFailed quiesceDatastoreIOForHAFailed)\n        {\n            return (quiesceDatastoreIOForHAFailed != null && ((this.Host == null && quiesceDatastoreIOForHAFailed.Host == null) || (this.Host != null && this.Host.Equals(quiesceDatastoreIOForHAFailed.Host))) && this.HostName == quiesceDatastoreIOForHAFailed.HostName && ((this.Ds == null && quiesceDatastoreIOForHAFailed.Ds == null) || (this.Ds != null && this.Ds.Equals(quiesceDatastoreIOForHAFailed.Ds))) && this.DsName == quiesceDatastoreIOForHAFailed.DsName && ((this.LinkedView == null && quiesceDatastoreIOForHAFailed.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(quiesceDatastoreIOForHAFailed.LinkedView))));\n        }\n\n        public override bool Equals(object quiesceDatastoreIOForHAFailed)\n        {\n            return Equals(quiesceDatastoreIOForHAFailed as QuiesceDatastoreIOForHAFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + HostName + \"_\" + Ds + \"_\" + DsName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class QuiesceDatastoreIOForHAFailed_LinkedView : IEquatable<QuiesceDatastoreIOForHAFailed_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public Datastore Ds { get; set; }\n\n        public bool Equals(QuiesceDatastoreIOForHAFailed_LinkedView quiesceDatastoreIOForHAFailed_LinkedView)\n        {\n            return (quiesceDatastoreIOForHAFailed_LinkedView != null && ((this.Host == null && quiesceDatastoreIOForHAFailed_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(quiesceDatastoreIOForHAFailed_LinkedView.Host))) && ((this.Ds == null && quiesceDatastoreIOForHAFailed_LinkedView.Ds == null) || (this.Ds != null && this.Ds.Equals(quiesceDatastoreIOForHAFailed_LinkedView.Ds))));\n        }\n\n        public override bool Equals(object quiesceDatastoreIOForHAFailed_LinkedView)\n        {\n            return Equals(quiesceDatastoreIOForHAFailed_LinkedView as QuiesceDatastoreIOForHAFailed_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Ds).GetHashCode();\n        }\n    }\n\n    public class RawDiskNotSupported : DeviceNotSupported, IEquatable<RawDiskNotSupported>\n    {\n        public bool Equals(RawDiskNotSupported rawDiskNotSupported)\n        {\n            return (rawDiskNotSupported != null && base.Equals(rawDiskNotSupported));\n        }\n\n        public override bool Equals(object rawDiskNotSupported)\n        {\n            return Equals(rawDiskNotSupported as RawDiskNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RDMConversionNotSupported : MigrationFault, IEquatable<RDMConversionNotSupported>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(RDMConversionNotSupported rDMConversionNotSupported)\n        {\n            return (rDMConversionNotSupported != null && this.Device == rDMConversionNotSupported.Device);\n        }\n\n        public override bool Equals(object rDMConversionNotSupported)\n        {\n            return Equals(rDMConversionNotSupported as RDMConversionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class RDMNotPreserved : MigrationFault, IEquatable<RDMNotPreserved>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(RDMNotPreserved rDMNotPreserved)\n        {\n            return (rDMNotPreserved != null && this.Device == rDMNotPreserved.Device);\n        }\n\n        public override bool Equals(object rDMNotPreserved)\n        {\n            return Equals(rDMNotPreserved as RDMNotPreserved);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class RDMNotSupported : DeviceNotSupported, IEquatable<RDMNotSupported>\n    {\n        public bool Equals(RDMNotSupported rDMNotSupported)\n        {\n            return (rDMNotSupported != null && base.Equals(rDMNotSupported));\n        }\n\n        public override bool Equals(object rDMNotSupported)\n        {\n            return Equals(rDMNotSupported as RDMNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RDMNotSupportedOnDatastore : VmConfigFault, IEquatable<RDMNotSupportedOnDatastore>\n    {\n        public string Device { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string DatastoreName { get; set; }\n\n        public RDMNotSupportedOnDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(RDMNotSupportedOnDatastore rDMNotSupportedOnDatastore)\n        {\n            return (rDMNotSupportedOnDatastore != null && this.Device == rDMNotSupportedOnDatastore.Device && ((this.Datastore == null && rDMNotSupportedOnDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(rDMNotSupportedOnDatastore.Datastore))) && this.DatastoreName == rDMNotSupportedOnDatastore.DatastoreName && ((this.LinkedView == null && rDMNotSupportedOnDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(rDMNotSupportedOnDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object rDMNotSupportedOnDatastore)\n        {\n            return Equals(rDMNotSupportedOnDatastore as RDMNotSupportedOnDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Datastore + \"_\" + DatastoreName + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class RDMNotSupportedOnDatastore_LinkedView : IEquatable<RDMNotSupportedOnDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(RDMNotSupportedOnDatastore_LinkedView rDMNotSupportedOnDatastore_LinkedView)\n        {\n            return (rDMNotSupportedOnDatastore_LinkedView != null && ((this.Datastore == null && rDMNotSupportedOnDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(rDMNotSupportedOnDatastore_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object rDMNotSupportedOnDatastore_LinkedView)\n        {\n            return Equals(rDMNotSupportedOnDatastore_LinkedView as RDMNotSupportedOnDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class RDMPointsToInaccessibleDisk : CannotAccessVmDisk, IEquatable<RDMPointsToInaccessibleDisk>\n    {\n        public bool Equals(RDMPointsToInaccessibleDisk rDMPointsToInaccessibleDisk)\n        {\n            return (rDMPointsToInaccessibleDisk != null && base.Equals(rDMPointsToInaccessibleDisk));\n        }\n\n        public override bool Equals(object rDMPointsToInaccessibleDisk)\n        {\n            return Equals(rDMPointsToInaccessibleDisk as RDMPointsToInaccessibleDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReadHostResourcePoolTreeFailed : HostConnectFault, IEquatable<ReadHostResourcePoolTreeFailed>\n    {\n        public bool Equals(ReadHostResourcePoolTreeFailed readHostResourcePoolTreeFailed)\n        {\n            return (readHostResourcePoolTreeFailed != null && base.Equals(readHostResourcePoolTreeFailed));\n        }\n\n        public override bool Equals(object readHostResourcePoolTreeFailed)\n        {\n            return Equals(readHostResourcePoolTreeFailed as ReadHostResourcePoolTreeFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReadOnlyDisksWithLegacyDestination : MigrationFault, IEquatable<ReadOnlyDisksWithLegacyDestination>\n    {\n        public int RoDiskCount { get; set; }\n\n        public bool TimeoutDanger { get; set; }\n\n        public bool Equals(ReadOnlyDisksWithLegacyDestination readOnlyDisksWithLegacyDestination)\n        {\n            return (readOnlyDisksWithLegacyDestination != null && this.RoDiskCount == readOnlyDisksWithLegacyDestination.RoDiskCount && this.TimeoutDanger == readOnlyDisksWithLegacyDestination.TimeoutDanger);\n        }\n\n        public override bool Equals(object readOnlyDisksWithLegacyDestination)\n        {\n            return Equals(readOnlyDisksWithLegacyDestination as ReadOnlyDisksWithLegacyDestination);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RoDiskCount + \"_\" + TimeoutDanger).GetHashCode();\n        }\n    }\n\n    public class RebootRequired : VimFault, IEquatable<RebootRequired>\n    {\n        public string Patch { get; set; }\n\n        public bool Equals(RebootRequired rebootRequired)\n        {\n            return (rebootRequired != null && this.Patch == rebootRequired.Patch);\n        }\n\n        public override bool Equals(object rebootRequired)\n        {\n            return Equals(rebootRequired as RebootRequired);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Patch).GetHashCode();\n        }\n    }\n\n    public class RecordReplayDisabled : VimFault, IEquatable<RecordReplayDisabled>\n    {\n        public bool Equals(RecordReplayDisabled recordReplayDisabled)\n        {\n            return (recordReplayDisabled != null && base.Equals(recordReplayDisabled));\n        }\n\n        public override bool Equals(object recordReplayDisabled)\n        {\n            return Equals(recordReplayDisabled as RecordReplayDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RecoveryEvent : DvsEvent, IEquatable<RecoveryEvent>\n    {\n        public string HostName { get; set; }\n\n        public string PortKey { get; set; }\n\n        public string DvsUuid { get; set; }\n\n        public string Vnic { get; set; }\n\n        public bool Equals(RecoveryEvent recoveryEvent)\n        {\n            return (recoveryEvent != null && this.HostName == recoveryEvent.HostName && this.PortKey == recoveryEvent.PortKey && this.DvsUuid == recoveryEvent.DvsUuid && this.Vnic == recoveryEvent.Vnic);\n        }\n\n        public override bool Equals(object recoveryEvent)\n        {\n            return Equals(recoveryEvent as RecoveryEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + PortKey + \"_\" + DvsUuid + \"_\" + Vnic).GetHashCode();\n        }\n    }\n\n    public class RecurrentTaskScheduler : TaskScheduler, IEquatable<RecurrentTaskScheduler>\n    {\n        public int Interval { get; set; }\n\n        public bool Equals(RecurrentTaskScheduler recurrentTaskScheduler)\n        {\n            return (recurrentTaskScheduler != null && this.Interval == recurrentTaskScheduler.Interval);\n        }\n\n        public override bool Equals(object recurrentTaskScheduler)\n        {\n            return Equals(recurrentTaskScheduler as RecurrentTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Interval).GetHashCode();\n        }\n    }\n\n    public class Relation : DynamicData, IEquatable<Relation>\n    {\n        public string Constraint { get; set; }\n\n        public string Name { get; set; }\n\n        public string Version { get; set; }\n\n        public bool Equals(Relation relation)\n        {\n            return (relation != null && this.Constraint == relation.Constraint && this.Name == relation.Name && this.Version == relation.Version);\n        }\n\n        public override bool Equals(object relation)\n        {\n            return Equals(relation as Relation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Constraint + \"_\" + Name + \"_\" + Version).GetHashCode();\n        }\n    }\n\n    public class RemoteDeviceNotSupported : DeviceNotSupported, IEquatable<RemoteDeviceNotSupported>\n    {\n        public bool Equals(RemoteDeviceNotSupported remoteDeviceNotSupported)\n        {\n            return (remoteDeviceNotSupported != null && base.Equals(remoteDeviceNotSupported));\n        }\n\n        public override bool Equals(object remoteDeviceNotSupported)\n        {\n            return Equals(remoteDeviceNotSupported as RemoteDeviceNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RemoteTSMEnabledEvent : HostEvent, IEquatable<RemoteTSMEnabledEvent>\n    {\n        public bool Equals(RemoteTSMEnabledEvent remoteTSMEnabledEvent)\n        {\n            return (remoteTSMEnabledEvent != null && base.Equals(remoteTSMEnabledEvent));\n        }\n\n        public override bool Equals(object remoteTSMEnabledEvent)\n        {\n            return Equals(remoteTSMEnabledEvent as RemoteTSMEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RemoveFailed : VimFault, IEquatable<RemoveFailed>\n    {\n        public bool Equals(RemoveFailed removeFailed)\n        {\n            return (removeFailed != null && base.Equals(removeFailed));\n        }\n\n        public override bool Equals(object removeFailed)\n        {\n            return Equals(removeFailed as RemoveFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReplicationConfigFault : ReplicationFault, IEquatable<ReplicationConfigFault>\n    {\n        public bool Equals(ReplicationConfigFault replicationConfigFault)\n        {\n            return (replicationConfigFault != null && base.Equals(replicationConfigFault));\n        }\n\n        public override bool Equals(object replicationConfigFault)\n        {\n            return Equals(replicationConfigFault as ReplicationConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReplicationConfigSpec : DynamicData, IEquatable<ReplicationConfigSpec>\n    {\n        public long Generation { get; set; }\n\n        public string VmReplicationId { get; set; }\n\n        public string Destination { get; set; }\n\n        public int Port { get; set; }\n\n        public long Rpo { get; set; }\n\n        public bool QuiesceGuestEnabled { get; set; }\n\n        public bool Paused { get; set; }\n\n        public bool OppUpdatesEnabled { get; set; }\n\n        public bool? NetCompressionEnabled { get; set; }\n\n        public bool? NetEncryptionEnabled { get; set; }\n\n        public string EncryptionDestination { get; set; }\n\n        public int? EncryptionPort { get; set; }\n\n        public string RemoteCertificateThumbprint { get; set; }\n\n        public ReplicationInfoDiskSettings[] Disk { get; set; }\n\n        public bool Equals(ReplicationConfigSpec replicationConfigSpec)\n        {\n            return (replicationConfigSpec != null && this.Generation == replicationConfigSpec.Generation && this.VmReplicationId == replicationConfigSpec.VmReplicationId && this.Destination == replicationConfigSpec.Destination && this.Port == replicationConfigSpec.Port && this.Rpo == replicationConfigSpec.Rpo && this.QuiesceGuestEnabled == replicationConfigSpec.QuiesceGuestEnabled && this.Paused == replicationConfigSpec.Paused && this.OppUpdatesEnabled == replicationConfigSpec.OppUpdatesEnabled && ((this.NetCompressionEnabled == null && replicationConfigSpec.NetCompressionEnabled == null) || (this.NetCompressionEnabled != null && this.NetCompressionEnabled.Equals(replicationConfigSpec.NetCompressionEnabled))) && ((this.NetEncryptionEnabled == null && replicationConfigSpec.NetEncryptionEnabled == null) || (this.NetEncryptionEnabled != null && this.NetEncryptionEnabled.Equals(replicationConfigSpec.NetEncryptionEnabled))) && this.EncryptionDestination == replicationConfigSpec.EncryptionDestination && ((this.EncryptionPort == null && replicationConfigSpec.EncryptionPort == null) || (this.EncryptionPort != null && this.EncryptionPort.Equals(replicationConfigSpec.EncryptionPort))) && this.RemoteCertificateThumbprint == replicationConfigSpec.RemoteCertificateThumbprint && ((this.Disk == null && replicationConfigSpec.Disk == null) || (this.Disk != null && replicationConfigSpec.Disk != null && Enumerable.SequenceEqual(this.Disk, replicationConfigSpec.Disk))));\n        }\n\n        public override bool Equals(object replicationConfigSpec)\n        {\n            return Equals(replicationConfigSpec as ReplicationConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Generation + \"_\" + VmReplicationId + \"_\" + Destination + \"_\" + Port + \"_\" + Rpo + \"_\" + QuiesceGuestEnabled + \"_\" + Paused + \"_\" + OppUpdatesEnabled + \"_\" + NetCompressionEnabled + \"_\" + NetEncryptionEnabled + \"_\" + EncryptionDestination + \"_\" + EncryptionPort + \"_\" + RemoteCertificateThumbprint + \"_\" + Disk).GetHashCode();\n        }\n    }\n\n    public class ReplicationDiskConfigFault : ReplicationConfigFault, IEquatable<ReplicationDiskConfigFault>\n    {\n        public string Reason { get; set; }\n\n        public ManagedObjectReference VmRef { get; set; }\n\n        public int? Key { get; set; }\n\n        public ReplicationDiskConfigFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ReplicationDiskConfigFault replicationDiskConfigFault)\n        {\n            return (replicationDiskConfigFault != null && this.Reason == replicationDiskConfigFault.Reason && ((this.VmRef == null && replicationDiskConfigFault.VmRef == null) || (this.VmRef != null && this.VmRef.Equals(replicationDiskConfigFault.VmRef))) && ((this.Key == null && replicationDiskConfigFault.Key == null) || (this.Key != null && this.Key.Equals(replicationDiskConfigFault.Key))) && ((this.LinkedView == null && replicationDiskConfigFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(replicationDiskConfigFault.LinkedView))));\n        }\n\n        public override bool Equals(object replicationDiskConfigFault)\n        {\n            return Equals(replicationDiskConfigFault as ReplicationDiskConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + VmRef + \"_\" + Key + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ReplicationDiskConfigFault_LinkedView : IEquatable<ReplicationDiskConfigFault_LinkedView>\n    {\n        public VirtualMachine VmRef { get; set; }\n\n        public bool Equals(ReplicationDiskConfigFault_LinkedView replicationDiskConfigFault_LinkedView)\n        {\n            return (replicationDiskConfigFault_LinkedView != null && ((this.VmRef == null && replicationDiskConfigFault_LinkedView.VmRef == null) || (this.VmRef != null && this.VmRef.Equals(replicationDiskConfigFault_LinkedView.VmRef))));\n        }\n\n        public override bool Equals(object replicationDiskConfigFault_LinkedView)\n        {\n            return Equals(replicationDiskConfigFault_LinkedView as ReplicationDiskConfigFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmRef).GetHashCode();\n        }\n    }\n\n    public class ReplicationFault : VimFault, IEquatable<ReplicationFault>\n    {\n        public bool Equals(ReplicationFault replicationFault)\n        {\n            return (replicationFault != null && base.Equals(replicationFault));\n        }\n\n        public override bool Equals(object replicationFault)\n        {\n            return Equals(replicationFault as ReplicationFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReplicationGroupId : DynamicData, IEquatable<ReplicationGroupId>\n    {\n        public FaultDomainId FaultDomainId { get; set; }\n\n        public DeviceGroupId DeviceGroupId { get; set; }\n\n        public bool Equals(ReplicationGroupId replicationGroupId)\n        {\n            return (replicationGroupId != null && ((this.FaultDomainId == null && replicationGroupId.FaultDomainId == null) || (this.FaultDomainId != null && this.FaultDomainId.Equals(replicationGroupId.FaultDomainId))) && ((this.DeviceGroupId == null && replicationGroupId.DeviceGroupId == null) || (this.DeviceGroupId != null && this.DeviceGroupId.Equals(replicationGroupId.DeviceGroupId))));\n        }\n\n        public override bool Equals(object replicationGroupId)\n        {\n            return Equals(replicationGroupId as ReplicationGroupId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FaultDomainId + \"_\" + DeviceGroupId).GetHashCode();\n        }\n    }\n\n    public class ReplicationIncompatibleWithFT : ReplicationFault, IEquatable<ReplicationIncompatibleWithFT>\n    {\n        public bool Equals(ReplicationIncompatibleWithFT replicationIncompatibleWithFT)\n        {\n            return (replicationIncompatibleWithFT != null && base.Equals(replicationIncompatibleWithFT));\n        }\n\n        public override bool Equals(object replicationIncompatibleWithFT)\n        {\n            return Equals(replicationIncompatibleWithFT as ReplicationIncompatibleWithFT);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReplicationInfoDiskSettings : DynamicData, IEquatable<ReplicationInfoDiskSettings>\n    {\n        public int Key { get; set; }\n\n        public string DiskReplicationId { get; set; }\n\n        public bool Equals(ReplicationInfoDiskSettings replicationInfoDiskSettings)\n        {\n            return (replicationInfoDiskSettings != null && this.Key == replicationInfoDiskSettings.Key && this.DiskReplicationId == replicationInfoDiskSettings.DiskReplicationId);\n        }\n\n        public override bool Equals(object replicationInfoDiskSettings)\n        {\n            return Equals(replicationInfoDiskSettings as ReplicationInfoDiskSettings);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + DiskReplicationId).GetHashCode();\n        }\n    }\n\n    public class ReplicationInvalidOptions : ReplicationFault, IEquatable<ReplicationInvalidOptions>\n    {\n        public string Options { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public ReplicationInvalidOptions_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ReplicationInvalidOptions replicationInvalidOptions)\n        {\n            return (replicationInvalidOptions != null && this.Options == replicationInvalidOptions.Options && ((this.Entity == null && replicationInvalidOptions.Entity == null) || (this.Entity != null && this.Entity.Equals(replicationInvalidOptions.Entity))) && ((this.LinkedView == null && replicationInvalidOptions.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(replicationInvalidOptions.LinkedView))));\n        }\n\n        public override bool Equals(object replicationInvalidOptions)\n        {\n            return Equals(replicationInvalidOptions as ReplicationInvalidOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Options + \"_\" + Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ReplicationInvalidOptions_LinkedView : IEquatable<ReplicationInvalidOptions_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(ReplicationInvalidOptions_LinkedView replicationInvalidOptions_LinkedView)\n        {\n            return (replicationInvalidOptions_LinkedView != null && ((this.Entity == null && replicationInvalidOptions_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(replicationInvalidOptions_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object replicationInvalidOptions_LinkedView)\n        {\n            return Equals(replicationInvalidOptions_LinkedView as ReplicationInvalidOptions_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class ReplicationNotSupportedOnHost : ReplicationFault, IEquatable<ReplicationNotSupportedOnHost>\n    {\n        public bool Equals(ReplicationNotSupportedOnHost replicationNotSupportedOnHost)\n        {\n            return (replicationNotSupportedOnHost != null && base.Equals(replicationNotSupportedOnHost));\n        }\n\n        public override bool Equals(object replicationNotSupportedOnHost)\n        {\n            return Equals(replicationNotSupportedOnHost as ReplicationNotSupportedOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReplicationSpec : DynamicData, IEquatable<ReplicationSpec>\n    {\n        public ReplicationGroupId ReplicationGroupId { get; set; }\n\n        public bool Equals(ReplicationSpec replicationSpec)\n        {\n            return (replicationSpec != null && ((this.ReplicationGroupId == null && replicationSpec.ReplicationGroupId == null) || (this.ReplicationGroupId != null && this.ReplicationGroupId.Equals(replicationSpec.ReplicationGroupId))));\n        }\n\n        public override bool Equals(object replicationSpec)\n        {\n            return Equals(replicationSpec as ReplicationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReplicationGroupId).GetHashCode();\n        }\n    }\n\n    public class ReplicationVmConfigFault : ReplicationConfigFault, IEquatable<ReplicationVmConfigFault>\n    {\n        public string Reason { get; set; }\n\n        public ManagedObjectReference VmRef { get; set; }\n\n        public ReplicationVmConfigFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ReplicationVmConfigFault replicationVmConfigFault)\n        {\n            return (replicationVmConfigFault != null && this.Reason == replicationVmConfigFault.Reason && ((this.VmRef == null && replicationVmConfigFault.VmRef == null) || (this.VmRef != null && this.VmRef.Equals(replicationVmConfigFault.VmRef))) && ((this.LinkedView == null && replicationVmConfigFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(replicationVmConfigFault.LinkedView))));\n        }\n\n        public override bool Equals(object replicationVmConfigFault)\n        {\n            return Equals(replicationVmConfigFault as ReplicationVmConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + VmRef + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ReplicationVmConfigFault_LinkedView : IEquatable<ReplicationVmConfigFault_LinkedView>\n    {\n        public VirtualMachine VmRef { get; set; }\n\n        public bool Equals(ReplicationVmConfigFault_LinkedView replicationVmConfigFault_LinkedView)\n        {\n            return (replicationVmConfigFault_LinkedView != null && ((this.VmRef == null && replicationVmConfigFault_LinkedView.VmRef == null) || (this.VmRef != null && this.VmRef.Equals(replicationVmConfigFault_LinkedView.VmRef))));\n        }\n\n        public override bool Equals(object replicationVmConfigFault_LinkedView)\n        {\n            return Equals(replicationVmConfigFault_LinkedView as ReplicationVmConfigFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmRef).GetHashCode();\n        }\n    }\n\n    public class ReplicationVmFault : ReplicationFault, IEquatable<ReplicationVmFault>\n    {\n        public string Reason { get; set; }\n\n        public string State { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public ReplicationVmFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ReplicationVmFault replicationVmFault)\n        {\n            return (replicationVmFault != null && this.Reason == replicationVmFault.Reason && this.State == replicationVmFault.State && this.InstanceId == replicationVmFault.InstanceId && ((this.Vm == null && replicationVmFault.Vm == null) || (this.Vm != null && this.Vm.Equals(replicationVmFault.Vm))) && ((this.LinkedView == null && replicationVmFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(replicationVmFault.LinkedView))));\n        }\n\n        public override bool Equals(object replicationVmFault)\n        {\n            return Equals(replicationVmFault as ReplicationVmFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + State + \"_\" + InstanceId + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ReplicationVmFault_LinkedView : IEquatable<ReplicationVmFault_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(ReplicationVmFault_LinkedView replicationVmFault_LinkedView)\n        {\n            return (replicationVmFault_LinkedView != null && ((this.Vm == null && replicationVmFault_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(replicationVmFault_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object replicationVmFault_LinkedView)\n        {\n            return Equals(replicationVmFault_LinkedView as ReplicationVmFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class ReplicationVmInProgressFault : ReplicationVmFault, IEquatable<ReplicationVmInProgressFault>\n    {\n        public string RequestedActivity { get; set; }\n\n        public string InProgressActivity { get; set; }\n\n        public new ReplicationVmInProgressFault_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ReplicationVmInProgressFault replicationVmInProgressFault)\n        {\n            return (replicationVmInProgressFault != null && this.RequestedActivity == replicationVmInProgressFault.RequestedActivity && this.InProgressActivity == replicationVmInProgressFault.InProgressActivity && ((this.LinkedView == null && replicationVmInProgressFault.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(replicationVmInProgressFault.LinkedView))));\n        }\n\n        public override bool Equals(object replicationVmInProgressFault)\n        {\n            return Equals(replicationVmInProgressFault as ReplicationVmInProgressFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RequestedActivity + \"_\" + InProgressActivity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ReplicationVmInProgressFault_LinkedView : ReplicationVmFault_LinkedView, IEquatable<ReplicationVmInProgressFault_LinkedView>\n    {\n        public bool Equals(ReplicationVmInProgressFault_LinkedView replicationVmInProgressFault_LinkedView)\n        {\n            return (replicationVmInProgressFault_LinkedView != null && base.Equals(replicationVmInProgressFault_LinkedView));\n        }\n\n        public override bool Equals(object replicationVmInProgressFault_LinkedView)\n        {\n            return Equals(replicationVmInProgressFault_LinkedView as ReplicationVmInProgressFault_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ReplicationVmProgressInfo : DynamicData, IEquatable<ReplicationVmProgressInfo>\n    {\n        public int Progress { get; set; }\n\n        public long BytesTransferred { get; set; }\n\n        public long BytesToTransfer { get; set; }\n\n        public long? ChecksumTotalBytes { get; set; }\n\n        public long? ChecksumComparedBytes { get; set; }\n\n        public bool Equals(ReplicationVmProgressInfo replicationVmProgressInfo)\n        {\n            return (replicationVmProgressInfo != null && this.Progress == replicationVmProgressInfo.Progress && this.BytesTransferred == replicationVmProgressInfo.BytesTransferred && this.BytesToTransfer == replicationVmProgressInfo.BytesToTransfer && ((this.ChecksumTotalBytes == null && replicationVmProgressInfo.ChecksumTotalBytes == null) || (this.ChecksumTotalBytes != null && this.ChecksumTotalBytes.Equals(replicationVmProgressInfo.ChecksumTotalBytes))) && ((this.ChecksumComparedBytes == null && replicationVmProgressInfo.ChecksumComparedBytes == null) || (this.ChecksumComparedBytes != null && this.ChecksumComparedBytes.Equals(replicationVmProgressInfo.ChecksumComparedBytes))));\n        }\n\n        public override bool Equals(object replicationVmProgressInfo)\n        {\n            return Equals(replicationVmProgressInfo as ReplicationVmProgressInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Progress + \"_\" + BytesTransferred + \"_\" + BytesToTransfer + \"_\" + ChecksumTotalBytes + \"_\" + ChecksumComparedBytes).GetHashCode();\n        }\n    }\n\n    public class RequestCanceled : RuntimeFault, IEquatable<RequestCanceled>\n    {\n        public bool Equals(RequestCanceled requestCanceled)\n        {\n            return (requestCanceled != null && base.Equals(requestCanceled));\n        }\n\n        public override bool Equals(object requestCanceled)\n        {\n            return Equals(requestCanceled as RequestCanceled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ResourceAllocationInfo : DynamicData, IEquatable<ResourceAllocationInfo>\n    {\n        public long? Reservation { get; set; }\n\n        public bool? ExpandableReservation { get; set; }\n\n        public long? Limit { get; set; }\n\n        public SharesInfo Shares { get; set; }\n\n        public long? OverheadLimit { get; set; }\n\n        public bool Equals(ResourceAllocationInfo resourceAllocationInfo)\n        {\n            return (resourceAllocationInfo != null && ((this.Reservation == null && resourceAllocationInfo.Reservation == null) || (this.Reservation != null && this.Reservation.Equals(resourceAllocationInfo.Reservation))) && ((this.ExpandableReservation == null && resourceAllocationInfo.ExpandableReservation == null) || (this.ExpandableReservation != null && this.ExpandableReservation.Equals(resourceAllocationInfo.ExpandableReservation))) && ((this.Limit == null && resourceAllocationInfo.Limit == null) || (this.Limit != null && this.Limit.Equals(resourceAllocationInfo.Limit))) && ((this.Shares == null && resourceAllocationInfo.Shares == null) || (this.Shares != null && this.Shares.Equals(resourceAllocationInfo.Shares))) && ((this.OverheadLimit == null && resourceAllocationInfo.OverheadLimit == null) || (this.OverheadLimit != null && this.OverheadLimit.Equals(resourceAllocationInfo.OverheadLimit))));\n        }\n\n        public override bool Equals(object resourceAllocationInfo)\n        {\n            return Equals(resourceAllocationInfo as ResourceAllocationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reservation + \"_\" + ExpandableReservation + \"_\" + Limit + \"_\" + Shares + \"_\" + OverheadLimit).GetHashCode();\n        }\n    }\n\n    public class ResourceAllocationOption : DynamicData, IEquatable<ResourceAllocationOption>\n    {\n        public SharesOption SharesOption { get; set; }\n\n        public bool Equals(ResourceAllocationOption resourceAllocationOption)\n        {\n            return (resourceAllocationOption != null && ((this.SharesOption == null && resourceAllocationOption.SharesOption == null) || (this.SharesOption != null && this.SharesOption.Equals(resourceAllocationOption.SharesOption))));\n        }\n\n        public override bool Equals(object resourceAllocationOption)\n        {\n            return Equals(resourceAllocationOption as ResourceAllocationOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SharesOption).GetHashCode();\n        }\n    }\n\n    public class ResourceConfigOption : DynamicData, IEquatable<ResourceConfigOption>\n    {\n        public ResourceAllocationOption CpuAllocationOption { get; set; }\n\n        public ResourceAllocationOption MemoryAllocationOption { get; set; }\n\n        public bool Equals(ResourceConfigOption resourceConfigOption)\n        {\n            return (resourceConfigOption != null && ((this.CpuAllocationOption == null && resourceConfigOption.CpuAllocationOption == null) || (this.CpuAllocationOption != null && this.CpuAllocationOption.Equals(resourceConfigOption.CpuAllocationOption))) && ((this.MemoryAllocationOption == null && resourceConfigOption.MemoryAllocationOption == null) || (this.MemoryAllocationOption != null && this.MemoryAllocationOption.Equals(resourceConfigOption.MemoryAllocationOption))));\n        }\n\n        public override bool Equals(object resourceConfigOption)\n        {\n            return Equals(resourceConfigOption as ResourceConfigOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CpuAllocationOption + \"_\" + MemoryAllocationOption).GetHashCode();\n        }\n    }\n\n    public class ResourceConfigSpec : DynamicData, IEquatable<ResourceConfigSpec>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public string ChangeVersion { get; set; }\n\n        public DateTime? LastModified { get; set; }\n\n        public ResourceAllocationInfo CpuAllocation { get; set; }\n\n        public ResourceAllocationInfo MemoryAllocation { get; set; }\n\n        public ResourceConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ResourceConfigSpec resourceConfigSpec)\n        {\n            return (resourceConfigSpec != null && ((this.Entity == null && resourceConfigSpec.Entity == null) || (this.Entity != null && this.Entity.Equals(resourceConfigSpec.Entity))) && this.ChangeVersion == resourceConfigSpec.ChangeVersion && ((this.LastModified == null && resourceConfigSpec.LastModified == null) || (this.LastModified != null && this.LastModified.Equals(resourceConfigSpec.LastModified))) && ((this.CpuAllocation == null && resourceConfigSpec.CpuAllocation == null) || (this.CpuAllocation != null && this.CpuAllocation.Equals(resourceConfigSpec.CpuAllocation))) && ((this.MemoryAllocation == null && resourceConfigSpec.MemoryAllocation == null) || (this.MemoryAllocation != null && this.MemoryAllocation.Equals(resourceConfigSpec.MemoryAllocation))) && ((this.LinkedView == null && resourceConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(resourceConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object resourceConfigSpec)\n        {\n            return Equals(resourceConfigSpec as ResourceConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + ChangeVersion + \"_\" + LastModified + \"_\" + CpuAllocation + \"_\" + MemoryAllocation + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ResourceConfigSpec_LinkedView : IEquatable<ResourceConfigSpec_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(ResourceConfigSpec_LinkedView resourceConfigSpec_LinkedView)\n        {\n            return (resourceConfigSpec_LinkedView != null && ((this.Entity == null && resourceConfigSpec_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(resourceConfigSpec_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object resourceConfigSpec_LinkedView)\n        {\n            return Equals(resourceConfigSpec_LinkedView as ResourceConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class ResourceInUse : VimFault, IEquatable<ResourceInUse>\n    {\n        public string Type { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(ResourceInUse resourceInUse)\n        {\n            return (resourceInUse != null && this.Type == resourceInUse.Type && this.Name == resourceInUse.Name);\n        }\n\n        public override bool Equals(object resourceInUse)\n        {\n            return Equals(resourceInUse as ResourceInUse);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class ResourceNotAvailable : VimFault, IEquatable<ResourceNotAvailable>\n    {\n        public string ContainerType { get; set; }\n\n        public string ContainerName { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(ResourceNotAvailable resourceNotAvailable)\n        {\n            return (resourceNotAvailable != null && this.ContainerType == resourceNotAvailable.ContainerType && this.ContainerName == resourceNotAvailable.ContainerName && this.Type == resourceNotAvailable.Type);\n        }\n\n        public override bool Equals(object resourceNotAvailable)\n        {\n            return Equals(resourceNotAvailable as ResourceNotAvailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ContainerType + \"_\" + ContainerName + \"_\" + Type).GetHashCode();\n        }\n    }\n\n    public class ResourcePlanningManager : ViewBase, IEquatable<ResourcePlanningManager>\n    {\n        public DatabaseSizeEstimate EstimateDatabaseSize(DatabaseSizeParam dbSizeParam)\n        {\n            return default(DatabaseSizeEstimate);\n        }\n\n        public bool Equals(ResourcePlanningManager resourcePlanningManager)\n        {\n            return (resourcePlanningManager != null && base.Equals(resourcePlanningManager));\n        }\n\n        public override bool Equals(object resourcePlanningManager)\n        {\n            return Equals(resourcePlanningManager as ResourcePlanningManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ResourcePool : ManagedEntity, IEquatable<ResourcePool>\n    {\n        public ResourcePoolSummary Summary { get; set; }\n\n        public ResourcePoolRuntimeInfo Runtime { get; set; }\n\n        public ManagedObjectReference Owner { get; set; }\n\n        public ManagedObjectReference[] resourcePool { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public ResourceConfigSpec Config { get; set; }\n\n        public ResourceConfigSpec[] ChildConfiguration { get; set; }\n\n        public new ResourcePool_LinkedView LinkedView { get; set; }\n\n        public void UpdateConfig(string name, ResourceConfigSpec config)\n        {\n        }\n\n        public void MoveIntoResourcePool(ManagedObjectReference[] list)\n        {\n        }\n\n        public void UpdateChildResourceConfiguration(ResourceConfigSpec[] spec)\n        {\n        }\n\n        public ManagedObjectReference CreateResourcePool(string name, ResourceConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DestroyChildren()\n        {\n        }\n\n        public ManagedObjectReference CreateVApp(string name, ResourceConfigSpec resSpec, VAppConfigSpec configSpec, ManagedObjectReference vmFolder)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateChildVM_Task(VirtualMachineConfigSpec config, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateChildVM(VirtualMachineConfigSpec config, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference RegisterChildVM_Task(string path, string name, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference RegisterChildVM(string path, string name, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference ImportVApp(ImportSpec spec, ManagedObjectReference folder, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ResourceConfigOption QueryResourceConfigOption()\n        {\n            return default(ResourceConfigOption);\n        }\n\n        public void RefreshRuntime()\n        {\n        }\n\n        public bool Equals(ResourcePool resourcePool)\n        {\n            return (resourcePool != null && ((this.Summary == null && resourcePool.Summary == null) || (this.Summary != null && this.Summary.Equals(resourcePool.Summary))) && ((this.Runtime == null && resourcePool.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(resourcePool.Runtime))) && ((this.Owner == null && resourcePool.Owner == null) || (this.Owner != null && this.Owner.Equals(resourcePool.Owner))) && ((this.resourcePool == null && resourcePool.resourcePool == null) || (this.resourcePool != null && resourcePool.resourcePool != null && Enumerable.SequenceEqual(this.resourcePool, resourcePool.resourcePool))) && ((this.Vm == null && resourcePool.Vm == null) || (this.Vm != null && resourcePool.Vm != null && Enumerable.SequenceEqual(this.Vm, resourcePool.Vm))) && ((this.Config == null && resourcePool.Config == null) || (this.Config != null && this.Config.Equals(resourcePool.Config))) && ((this.ChildConfiguration == null && resourcePool.ChildConfiguration == null) || (this.ChildConfiguration != null && resourcePool.ChildConfiguration != null && Enumerable.SequenceEqual(this.ChildConfiguration, resourcePool.ChildConfiguration))) && ((this.LinkedView == null && resourcePool.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(resourcePool.LinkedView))));\n        }\n\n        public override bool Equals(object resourcePool)\n        {\n            return Equals(resourcePool as ResourcePool);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Summary + \"_\" + Runtime + \"_\" + Owner + \"_\" + resourcePool + \"_\" + Vm + \"_\" + Config + \"_\" + ChildConfiguration + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ResourcePool_LinkedView : ManagedEntity_LinkedView, IEquatable<ResourcePool_LinkedView>\n    {\n        public ComputeResource Owner { get; set; }\n\n        public ResourcePool[] ResourcePool { get; set; }\n\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(ResourcePool_LinkedView resourcePool_LinkedView)\n        {\n            return (resourcePool_LinkedView != null && ((this.Owner == null && resourcePool_LinkedView.Owner == null) || (this.Owner != null && this.Owner.Equals(resourcePool_LinkedView.Owner))) && ((this.ResourcePool == null && resourcePool_LinkedView.ResourcePool == null) || (this.ResourcePool != null && resourcePool_LinkedView.ResourcePool != null && Enumerable.SequenceEqual(this.ResourcePool, resourcePool_LinkedView.ResourcePool))) && ((this.Vm == null && resourcePool_LinkedView.Vm == null) || (this.Vm != null && resourcePool_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, resourcePool_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object resourcePool_LinkedView)\n        {\n            return Equals(resourcePool_LinkedView as ResourcePool_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Owner + \"_\" + ResourcePool + \"_\" + Vm).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolCreatedEvent : ResourcePoolEvent, IEquatable<ResourcePoolCreatedEvent>\n    {\n        public ResourcePoolEventArgument Parent { get; set; }\n\n        public bool Equals(ResourcePoolCreatedEvent resourcePoolCreatedEvent)\n        {\n            return (resourcePoolCreatedEvent != null && ((this.Parent == null && resourcePoolCreatedEvent.Parent == null) || (this.Parent != null && this.Parent.Equals(resourcePoolCreatedEvent.Parent))));\n        }\n\n        public override bool Equals(object resourcePoolCreatedEvent)\n        {\n            return Equals(resourcePoolCreatedEvent as ResourcePoolCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolDestroyedEvent : ResourcePoolEvent, IEquatable<ResourcePoolDestroyedEvent>\n    {\n        public bool Equals(ResourcePoolDestroyedEvent resourcePoolDestroyedEvent)\n        {\n            return (resourcePoolDestroyedEvent != null && base.Equals(resourcePoolDestroyedEvent));\n        }\n\n        public override bool Equals(object resourcePoolDestroyedEvent)\n        {\n            return Equals(resourcePoolDestroyedEvent as ResourcePoolDestroyedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ResourcePoolEvent : Event, IEquatable<ResourcePoolEvent>\n    {\n        public ResourcePoolEventArgument ResourcePool { get; set; }\n\n        public bool Equals(ResourcePoolEvent resourcePoolEvent)\n        {\n            return (resourcePoolEvent != null && ((this.ResourcePool == null && resourcePoolEvent.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(resourcePoolEvent.ResourcePool))));\n        }\n\n        public override bool Equals(object resourcePoolEvent)\n        {\n            return Equals(resourcePoolEvent as ResourcePoolEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResourcePool).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolEventArgument : EntityEventArgument, IEquatable<ResourcePoolEventArgument>\n    {\n        public ManagedObjectReference ResourcePool { get; set; }\n\n        public ResourcePoolEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ResourcePoolEventArgument resourcePoolEventArgument)\n        {\n            return (resourcePoolEventArgument != null && ((this.ResourcePool == null && resourcePoolEventArgument.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(resourcePoolEventArgument.ResourcePool))) && ((this.LinkedView == null && resourcePoolEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(resourcePoolEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object resourcePoolEventArgument)\n        {\n            return Equals(resourcePoolEventArgument as ResourcePoolEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResourcePool + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolEventArgument_LinkedView : IEquatable<ResourcePoolEventArgument_LinkedView>\n    {\n        public ResourcePool ResourcePool { get; set; }\n\n        public bool Equals(ResourcePoolEventArgument_LinkedView resourcePoolEventArgument_LinkedView)\n        {\n            return (resourcePoolEventArgument_LinkedView != null && ((this.ResourcePool == null && resourcePoolEventArgument_LinkedView.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(resourcePoolEventArgument_LinkedView.ResourcePool))));\n        }\n\n        public override bool Equals(object resourcePoolEventArgument_LinkedView)\n        {\n            return Equals(resourcePoolEventArgument_LinkedView as ResourcePoolEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResourcePool).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolMovedEvent : ResourcePoolEvent, IEquatable<ResourcePoolMovedEvent>\n    {\n        public ResourcePoolEventArgument OldParent { get; set; }\n\n        public ResourcePoolEventArgument NewParent { get; set; }\n\n        public bool Equals(ResourcePoolMovedEvent resourcePoolMovedEvent)\n        {\n            return (resourcePoolMovedEvent != null && ((this.OldParent == null && resourcePoolMovedEvent.OldParent == null) || (this.OldParent != null && this.OldParent.Equals(resourcePoolMovedEvent.OldParent))) && ((this.NewParent == null && resourcePoolMovedEvent.NewParent == null) || (this.NewParent != null && this.NewParent.Equals(resourcePoolMovedEvent.NewParent))));\n        }\n\n        public override bool Equals(object resourcePoolMovedEvent)\n        {\n            return Equals(resourcePoolMovedEvent as ResourcePoolMovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldParent + \"_\" + NewParent).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolQuickStats : DynamicData, IEquatable<ResourcePoolQuickStats>\n    {\n        public long? OverallCpuUsage { get; set; }\n\n        public long? OverallCpuDemand { get; set; }\n\n        public long? GuestMemoryUsage { get; set; }\n\n        public long? HostMemoryUsage { get; set; }\n\n        public long? DistributedCpuEntitlement { get; set; }\n\n        public long? DistributedMemoryEntitlement { get; set; }\n\n        public int? StaticCpuEntitlement { get; set; }\n\n        public int? StaticMemoryEntitlement { get; set; }\n\n        public long? PrivateMemory { get; set; }\n\n        public long? SharedMemory { get; set; }\n\n        public long? SwappedMemory { get; set; }\n\n        public long? BalloonedMemory { get; set; }\n\n        public long? OverheadMemory { get; set; }\n\n        public long? ConsumedOverheadMemory { get; set; }\n\n        public long? CompressedMemory { get; set; }\n\n        public bool Equals(ResourcePoolQuickStats resourcePoolQuickStats)\n        {\n            return (resourcePoolQuickStats != null && ((this.OverallCpuUsage == null && resourcePoolQuickStats.OverallCpuUsage == null) || (this.OverallCpuUsage != null && this.OverallCpuUsage.Equals(resourcePoolQuickStats.OverallCpuUsage))) && ((this.OverallCpuDemand == null && resourcePoolQuickStats.OverallCpuDemand == null) || (this.OverallCpuDemand != null && this.OverallCpuDemand.Equals(resourcePoolQuickStats.OverallCpuDemand))) && ((this.GuestMemoryUsage == null && resourcePoolQuickStats.GuestMemoryUsage == null) || (this.GuestMemoryUsage != null && this.GuestMemoryUsage.Equals(resourcePoolQuickStats.GuestMemoryUsage))) && ((this.HostMemoryUsage == null && resourcePoolQuickStats.HostMemoryUsage == null) || (this.HostMemoryUsage != null && this.HostMemoryUsage.Equals(resourcePoolQuickStats.HostMemoryUsage))) && ((this.DistributedCpuEntitlement == null && resourcePoolQuickStats.DistributedCpuEntitlement == null) || (this.DistributedCpuEntitlement != null && this.DistributedCpuEntitlement.Equals(resourcePoolQuickStats.DistributedCpuEntitlement))) && ((this.DistributedMemoryEntitlement == null && resourcePoolQuickStats.DistributedMemoryEntitlement == null) || (this.DistributedMemoryEntitlement != null && this.DistributedMemoryEntitlement.Equals(resourcePoolQuickStats.DistributedMemoryEntitlement))) && ((this.StaticCpuEntitlement == null && resourcePoolQuickStats.StaticCpuEntitlement == null) || (this.StaticCpuEntitlement != null && this.StaticCpuEntitlement.Equals(resourcePoolQuickStats.StaticCpuEntitlement))) && ((this.StaticMemoryEntitlement == null && resourcePoolQuickStats.StaticMemoryEntitlement == null) || (this.StaticMemoryEntitlement != null && this.StaticMemoryEntitlement.Equals(resourcePoolQuickStats.StaticMemoryEntitlement))) && ((this.PrivateMemory == null && resourcePoolQuickStats.PrivateMemory == null) || (this.PrivateMemory != null && this.PrivateMemory.Equals(resourcePoolQuickStats.PrivateMemory))) && ((this.SharedMemory == null && resourcePoolQuickStats.SharedMemory == null) || (this.SharedMemory != null && this.SharedMemory.Equals(resourcePoolQuickStats.SharedMemory))) && ((this.SwappedMemory == null && resourcePoolQuickStats.SwappedMemory == null) || (this.SwappedMemory != null && this.SwappedMemory.Equals(resourcePoolQuickStats.SwappedMemory))) && ((this.BalloonedMemory == null && resourcePoolQuickStats.BalloonedMemory == null) || (this.BalloonedMemory != null && this.BalloonedMemory.Equals(resourcePoolQuickStats.BalloonedMemory))) && ((this.OverheadMemory == null && resourcePoolQuickStats.OverheadMemory == null) || (this.OverheadMemory != null && this.OverheadMemory.Equals(resourcePoolQuickStats.OverheadMemory))) && ((this.ConsumedOverheadMemory == null && resourcePoolQuickStats.ConsumedOverheadMemory == null) || (this.ConsumedOverheadMemory != null && this.ConsumedOverheadMemory.Equals(resourcePoolQuickStats.ConsumedOverheadMemory))) && ((this.CompressedMemory == null && resourcePoolQuickStats.CompressedMemory == null) || (this.CompressedMemory != null && this.CompressedMemory.Equals(resourcePoolQuickStats.CompressedMemory))));\n        }\n\n        public override bool Equals(object resourcePoolQuickStats)\n        {\n            return Equals(resourcePoolQuickStats as ResourcePoolQuickStats);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OverallCpuUsage + \"_\" + OverallCpuDemand + \"_\" + GuestMemoryUsage + \"_\" + HostMemoryUsage + \"_\" + DistributedCpuEntitlement + \"_\" + DistributedMemoryEntitlement + \"_\" + StaticCpuEntitlement + \"_\" + StaticMemoryEntitlement + \"_\" + PrivateMemory + \"_\" + SharedMemory + \"_\" + SwappedMemory + \"_\" + BalloonedMemory + \"_\" + OverheadMemory + \"_\" + ConsumedOverheadMemory + \"_\" + CompressedMemory).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolReconfiguredEvent : ResourcePoolEvent, IEquatable<ResourcePoolReconfiguredEvent>\n    {\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(ResourcePoolReconfiguredEvent resourcePoolReconfiguredEvent)\n        {\n            return (resourcePoolReconfiguredEvent != null && ((this.ConfigChanges == null && resourcePoolReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(resourcePoolReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object resourcePoolReconfiguredEvent)\n        {\n            return Equals(resourcePoolReconfiguredEvent as ResourcePoolReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolResourceUsage : DynamicData, IEquatable<ResourcePoolResourceUsage>\n    {\n        public long ReservationUsed { get; set; }\n\n        public long ReservationUsedForVm { get; set; }\n\n        public long UnreservedForPool { get; set; }\n\n        public long UnreservedForVm { get; set; }\n\n        public long OverallUsage { get; set; }\n\n        public long MaxUsage { get; set; }\n\n        public bool Equals(ResourcePoolResourceUsage resourcePoolResourceUsage)\n        {\n            return (resourcePoolResourceUsage != null && this.ReservationUsed == resourcePoolResourceUsage.ReservationUsed && this.ReservationUsedForVm == resourcePoolResourceUsage.ReservationUsedForVm && this.UnreservedForPool == resourcePoolResourceUsage.UnreservedForPool && this.UnreservedForVm == resourcePoolResourceUsage.UnreservedForVm && this.OverallUsage == resourcePoolResourceUsage.OverallUsage && this.MaxUsage == resourcePoolResourceUsage.MaxUsage);\n        }\n\n        public override bool Equals(object resourcePoolResourceUsage)\n        {\n            return Equals(resourcePoolResourceUsage as ResourcePoolResourceUsage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReservationUsed + \"_\" + ReservationUsedForVm + \"_\" + UnreservedForPool + \"_\" + UnreservedForVm + \"_\" + OverallUsage + \"_\" + MaxUsage).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolRuntimeInfo : DynamicData, IEquatable<ResourcePoolRuntimeInfo>\n    {\n        public ResourcePoolResourceUsage Memory { get; set; }\n\n        public ResourcePoolResourceUsage Cpu { get; set; }\n\n        public ManagedEntityStatus OverallStatus { get; set; }\n\n        public bool Equals(ResourcePoolRuntimeInfo resourcePoolRuntimeInfo)\n        {\n            return (resourcePoolRuntimeInfo != null && ((this.Memory == null && resourcePoolRuntimeInfo.Memory == null) || (this.Memory != null && this.Memory.Equals(resourcePoolRuntimeInfo.Memory))) && ((this.Cpu == null && resourcePoolRuntimeInfo.Cpu == null) || (this.Cpu != null && this.Cpu.Equals(resourcePoolRuntimeInfo.Cpu))) && this.OverallStatus == resourcePoolRuntimeInfo.OverallStatus);\n        }\n\n        public override bool Equals(object resourcePoolRuntimeInfo)\n        {\n            return Equals(resourcePoolRuntimeInfo as ResourcePoolRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Memory + \"_\" + Cpu + \"_\" + OverallStatus).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolSummary : DynamicData, IEquatable<ResourcePoolSummary>\n    {\n        public string Name { get; set; }\n\n        public ResourceConfigSpec Config { get; set; }\n\n        public ResourcePoolRuntimeInfo Runtime { get; set; }\n\n        public ResourcePoolQuickStats QuickStats { get; set; }\n\n        public int? ConfiguredMemoryMB { get; set; }\n\n        public bool Equals(ResourcePoolSummary resourcePoolSummary)\n        {\n            return (resourcePoolSummary != null && this.Name == resourcePoolSummary.Name && ((this.Config == null && resourcePoolSummary.Config == null) || (this.Config != null && this.Config.Equals(resourcePoolSummary.Config))) && ((this.Runtime == null && resourcePoolSummary.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(resourcePoolSummary.Runtime))) && ((this.QuickStats == null && resourcePoolSummary.QuickStats == null) || (this.QuickStats != null && this.QuickStats.Equals(resourcePoolSummary.QuickStats))) && ((this.ConfiguredMemoryMB == null && resourcePoolSummary.ConfiguredMemoryMB == null) || (this.ConfiguredMemoryMB != null && this.ConfiguredMemoryMB.Equals(resourcePoolSummary.ConfiguredMemoryMB))));\n        }\n\n        public override bool Equals(object resourcePoolSummary)\n        {\n            return Equals(resourcePoolSummary as ResourcePoolSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Config + \"_\" + Runtime + \"_\" + QuickStats + \"_\" + ConfiguredMemoryMB).GetHashCode();\n        }\n    }\n\n    public class ResourceViolatedEvent : ResourcePoolEvent, IEquatable<ResourceViolatedEvent>\n    {\n        public bool Equals(ResourceViolatedEvent resourceViolatedEvent)\n        {\n            return (resourceViolatedEvent != null && base.Equals(resourceViolatedEvent));\n        }\n\n        public override bool Equals(object resourceViolatedEvent)\n        {\n            return Equals(resourceViolatedEvent as ResourceViolatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RestrictedByAdministrator : RuntimeFault, IEquatable<RestrictedByAdministrator>\n    {\n        public string Details { get; set; }\n\n        public bool Equals(RestrictedByAdministrator restrictedByAdministrator)\n        {\n            return (restrictedByAdministrator != null && this.Details == restrictedByAdministrator.Details);\n        }\n\n        public override bool Equals(object restrictedByAdministrator)\n        {\n            return Equals(restrictedByAdministrator as RestrictedByAdministrator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Details).GetHashCode();\n        }\n    }\n\n    public class RestrictedVersion : SecurityError, IEquatable<RestrictedVersion>\n    {\n        public bool Equals(RestrictedVersion restrictedVersion)\n        {\n            return (restrictedVersion != null && base.Equals(restrictedVersion));\n        }\n\n        public override bool Equals(object restrictedVersion)\n        {\n            return Equals(restrictedVersion as RestrictedVersion);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RetrieveOptions : DynamicData, IEquatable<RetrieveOptions>\n    {\n        public int? MaxObjects { get; set; }\n\n        public bool Equals(RetrieveOptions retrieveOptions)\n        {\n            return (retrieveOptions != null && ((this.MaxObjects == null && retrieveOptions.MaxObjects == null) || (this.MaxObjects != null && this.MaxObjects.Equals(retrieveOptions.MaxObjects))));\n        }\n\n        public override bool Equals(object retrieveOptions)\n        {\n            return Equals(retrieveOptions as RetrieveOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxObjects).GetHashCode();\n        }\n    }\n\n    public class RetrieveResult : DynamicData, IEquatable<RetrieveResult>\n    {\n        public string Token { get; set; }\n\n        public ObjectContent[] Objects { get; set; }\n\n        public bool Equals(RetrieveResult retrieveResult)\n        {\n            return (retrieveResult != null && this.Token == retrieveResult.Token && ((this.Objects == null && retrieveResult.Objects == null) || (this.Objects != null && retrieveResult.Objects != null && Enumerable.SequenceEqual(this.Objects, retrieveResult.Objects))));\n        }\n\n        public override bool Equals(object retrieveResult)\n        {\n            return Equals(retrieveResult as RetrieveResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Token + \"_\" + Objects).GetHashCode();\n        }\n    }\n\n    public class RetrieveVStorageObjSpec : DynamicData, IEquatable<RetrieveVStorageObjSpec>\n    {\n        public ID Id { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public RetrieveVStorageObjSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(RetrieveVStorageObjSpec retrieveVStorageObjSpec)\n        {\n            return (retrieveVStorageObjSpec != null && ((this.Id == null && retrieveVStorageObjSpec.Id == null) || (this.Id != null && this.Id.Equals(retrieveVStorageObjSpec.Id))) && ((this.Datastore == null && retrieveVStorageObjSpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(retrieveVStorageObjSpec.Datastore))) && ((this.LinkedView == null && retrieveVStorageObjSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(retrieveVStorageObjSpec.LinkedView))));\n        }\n\n        public override bool Equals(object retrieveVStorageObjSpec)\n        {\n            return Equals(retrieveVStorageObjSpec as RetrieveVStorageObjSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class RetrieveVStorageObjSpec_LinkedView : IEquatable<RetrieveVStorageObjSpec_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(RetrieveVStorageObjSpec_LinkedView retrieveVStorageObjSpec_LinkedView)\n        {\n            return (retrieveVStorageObjSpec_LinkedView != null && ((this.Datastore == null && retrieveVStorageObjSpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(retrieveVStorageObjSpec_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object retrieveVStorageObjSpec_LinkedView)\n        {\n            return Equals(retrieveVStorageObjSpec_LinkedView as RetrieveVStorageObjSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class RoleAddedEvent : RoleEvent, IEquatable<RoleAddedEvent>\n    {\n        public string[] PrivilegeList { get; set; }\n\n        public bool Equals(RoleAddedEvent roleAddedEvent)\n        {\n            return (roleAddedEvent != null && ((this.PrivilegeList == null && roleAddedEvent.PrivilegeList == null) || (this.PrivilegeList != null && roleAddedEvent.PrivilegeList != null && Enumerable.SequenceEqual(this.PrivilegeList, roleAddedEvent.PrivilegeList))));\n        }\n\n        public override bool Equals(object roleAddedEvent)\n        {\n            return Equals(roleAddedEvent as RoleAddedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrivilegeList).GetHashCode();\n        }\n    }\n\n    public class RoleEvent : AuthorizationEvent, IEquatable<RoleEvent>\n    {\n        public RoleEventArgument Role { get; set; }\n\n        public bool Equals(RoleEvent roleEvent)\n        {\n            return (roleEvent != null && ((this.Role == null && roleEvent.Role == null) || (this.Role != null && this.Role.Equals(roleEvent.Role))));\n        }\n\n        public override bool Equals(object roleEvent)\n        {\n            return Equals(roleEvent as RoleEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Role).GetHashCode();\n        }\n    }\n\n    public class RoleEventArgument : EventArgument, IEquatable<RoleEventArgument>\n    {\n        public int RoleId { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(RoleEventArgument roleEventArgument)\n        {\n            return (roleEventArgument != null && this.RoleId == roleEventArgument.RoleId && this.Name == roleEventArgument.Name);\n        }\n\n        public override bool Equals(object roleEventArgument)\n        {\n            return Equals(roleEventArgument as RoleEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RoleId + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class RoleRemovedEvent : RoleEvent, IEquatable<RoleRemovedEvent>\n    {\n        public bool Equals(RoleRemovedEvent roleRemovedEvent)\n        {\n            return (roleRemovedEvent != null && base.Equals(roleRemovedEvent));\n        }\n\n        public override bool Equals(object roleRemovedEvent)\n        {\n            return Equals(roleRemovedEvent as RoleRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class RoleUpdatedEvent : RoleEvent, IEquatable<RoleUpdatedEvent>\n    {\n        public string[] PrivilegeList { get; set; }\n\n        public string PrevRoleName { get; set; }\n\n        public string[] PrivilegesAdded { get; set; }\n\n        public string[] PrivilegesRemoved { get; set; }\n\n        public bool Equals(RoleUpdatedEvent roleUpdatedEvent)\n        {\n            return (roleUpdatedEvent != null && ((this.PrivilegeList == null && roleUpdatedEvent.PrivilegeList == null) || (this.PrivilegeList != null && roleUpdatedEvent.PrivilegeList != null && Enumerable.SequenceEqual(this.PrivilegeList, roleUpdatedEvent.PrivilegeList))) && this.PrevRoleName == roleUpdatedEvent.PrevRoleName && ((this.PrivilegesAdded == null && roleUpdatedEvent.PrivilegesAdded == null) || (this.PrivilegesAdded != null && roleUpdatedEvent.PrivilegesAdded != null && Enumerable.SequenceEqual(this.PrivilegesAdded, roleUpdatedEvent.PrivilegesAdded))) && ((this.PrivilegesRemoved == null && roleUpdatedEvent.PrivilegesRemoved == null) || (this.PrivilegesRemoved != null && roleUpdatedEvent.PrivilegesRemoved != null && Enumerable.SequenceEqual(this.PrivilegesRemoved, roleUpdatedEvent.PrivilegesRemoved))));\n        }\n\n        public override bool Equals(object roleUpdatedEvent)\n        {\n            return Equals(roleUpdatedEvent as RoleUpdatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrivilegeList + \"_\" + PrevRoleName + \"_\" + PrivilegesAdded + \"_\" + PrivilegesRemoved).GetHashCode();\n        }\n    }\n\n    public class RollbackEvent : DvsEvent, IEquatable<RollbackEvent>\n    {\n        public string HostName { get; set; }\n\n        public string MethodName { get; set; }\n\n        public bool Equals(RollbackEvent rollbackEvent)\n        {\n            return (rollbackEvent != null && this.HostName == rollbackEvent.HostName && this.MethodName == rollbackEvent.MethodName);\n        }\n\n        public override bool Equals(object rollbackEvent)\n        {\n            return Equals(rollbackEvent as RollbackEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + MethodName).GetHashCode();\n        }\n    }\n\n    public class RollbackFailure : DvsFault, IEquatable<RollbackFailure>\n    {\n        public string EntityName { get; set; }\n\n        public string EntityType { get; set; }\n\n        public bool Equals(RollbackFailure rollbackFailure)\n        {\n            return (rollbackFailure != null && this.EntityName == rollbackFailure.EntityName && this.EntityType == rollbackFailure.EntityType);\n        }\n\n        public override bool Equals(object rollbackFailure)\n        {\n            return Equals(rollbackFailure as RollbackFailure);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityName + \"_\" + EntityType).GetHashCode();\n        }\n    }\n\n    public class RuleViolation : VmConfigFault, IEquatable<RuleViolation>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public ClusterRuleInfo Rule { get; set; }\n\n        public RuleViolation_LinkedView LinkedView { get; set; }\n\n        public bool Equals(RuleViolation ruleViolation)\n        {\n            return (ruleViolation != null && ((this.Host == null && ruleViolation.Host == null) || (this.Host != null && this.Host.Equals(ruleViolation.Host))) && ((this.Rule == null && ruleViolation.Rule == null) || (this.Rule != null && this.Rule.Equals(ruleViolation.Rule))) && ((this.LinkedView == null && ruleViolation.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(ruleViolation.LinkedView))));\n        }\n\n        public override bool Equals(object ruleViolation)\n        {\n            return Equals(ruleViolation as RuleViolation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Rule + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class RuleViolation_LinkedView : IEquatable<RuleViolation_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(RuleViolation_LinkedView ruleViolation_LinkedView)\n        {\n            return (ruleViolation_LinkedView != null && ((this.Host == null && ruleViolation_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(ruleViolation_LinkedView.Host))));\n        }\n\n        public override bool Equals(object ruleViolation_LinkedView)\n        {\n            return Equals(ruleViolation_LinkedView as RuleViolation_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class RunScriptAction : Action, IEquatable<RunScriptAction>\n    {\n        public string Script { get; set; }\n\n        public bool Equals(RunScriptAction runScriptAction)\n        {\n            return (runScriptAction != null && this.Script == runScriptAction.Script);\n        }\n\n        public override bool Equals(object runScriptAction)\n        {\n            return Equals(runScriptAction as RunScriptAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Script).GetHashCode();\n        }\n    }\n\n    public class RuntimeFault : MethodFault, IEquatable<RuntimeFault>\n    {\n        public bool Equals(RuntimeFault runtimeFault)\n        {\n            return (runtimeFault != null && base.Equals(runtimeFault));\n        }\n\n        public override bool Equals(object runtimeFault)\n        {\n            return Equals(runtimeFault as RuntimeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SAMLTokenAuthentication : GuestAuthentication, IEquatable<SAMLTokenAuthentication>\n    {\n        public string Token { get; set; }\n\n        public string Username { get; set; }\n\n        public bool Equals(SAMLTokenAuthentication sAMLTokenAuthentication)\n        {\n            return (sAMLTokenAuthentication != null && this.Token == sAMLTokenAuthentication.Token && this.Username == sAMLTokenAuthentication.Username);\n        }\n\n        public override bool Equals(object sAMLTokenAuthentication)\n        {\n            return Equals(sAMLTokenAuthentication as SAMLTokenAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Token + \"_\" + Username).GetHashCode();\n        }\n    }\n\n    public class SatpClaimRule : IEquatable<SatpClaimRule>\n    {\n        public SatpClaimRule()\n        {\n        }\n\n        public string Name { get; set; }\n\n        public string PSPOptions { get; set; }\n\n        public string Transport { get; set; }\n\n        public string Description { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Device { get; set; }\n\n        public string Driver { get; set; }\n\n        public string ClaimOptions { get; set; }\n\n        public string DefaultPSP { get; set; }\n\n        public string Options { get; set; }\n\n        public string Model { get; set; }\n\n        public bool Equals(SatpClaimRule satpClaimRule)\n        {\n            return (satpClaimRule != null && this.Name == satpClaimRule.Name && this.PSPOptions == satpClaimRule.PSPOptions && this.Transport == satpClaimRule.Transport && this.Description == satpClaimRule.Description && this.Vendor == satpClaimRule.Vendor && this.Device == satpClaimRule.Device && this.Driver == satpClaimRule.Driver && this.ClaimOptions == satpClaimRule.ClaimOptions && this.DefaultPSP == satpClaimRule.DefaultPSP && this.Options == satpClaimRule.Options && this.Model == satpClaimRule.Model);\n        }\n\n        public override bool Equals(object satpClaimRule)\n        {\n            return Equals(satpClaimRule as SatpClaimRule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + PSPOptions + \"_\" + Transport + \"_\" + Description + \"_\" + Vendor + \"_\" + Device + \"_\" + Driver + \"_\" + ClaimOptions + \"_\" + DefaultPSP + \"_\" + Options + \"_\" + Model).GetHashCode();\n        }\n    }\n\n    public class ScheduledHardwareUpgradeInfo : DynamicData, IEquatable<ScheduledHardwareUpgradeInfo>\n    {\n        public string UpgradePolicy { get; set; }\n\n        public string VersionKey { get; set; }\n\n        public string ScheduledHardwareUpgradeStatus { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(ScheduledHardwareUpgradeInfo scheduledHardwareUpgradeInfo)\n        {\n            return (scheduledHardwareUpgradeInfo != null && this.UpgradePolicy == scheduledHardwareUpgradeInfo.UpgradePolicy && this.VersionKey == scheduledHardwareUpgradeInfo.VersionKey && this.ScheduledHardwareUpgradeStatus == scheduledHardwareUpgradeInfo.ScheduledHardwareUpgradeStatus && ((this.Fault == null && scheduledHardwareUpgradeInfo.Fault == null) || (this.Fault != null && this.Fault.Equals(scheduledHardwareUpgradeInfo.Fault))));\n        }\n\n        public override bool Equals(object scheduledHardwareUpgradeInfo)\n        {\n            return Equals(scheduledHardwareUpgradeInfo as ScheduledHardwareUpgradeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UpgradePolicy + \"_\" + VersionKey + \"_\" + ScheduledHardwareUpgradeStatus + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class ScheduledTask : ExtensibleManagedObject, IEquatable<ScheduledTask>\n    {\n        public ScheduledTaskInfo Info { get; set; }\n\n        public void RemoveScheduledTask()\n        {\n        }\n\n        public void ReconfigureScheduledTask(ScheduledTaskSpec spec)\n        {\n        }\n\n        public void RunScheduledTask()\n        {\n        }\n\n        public bool Equals(ScheduledTask scheduledTask)\n        {\n            return (scheduledTask != null && ((this.Info == null && scheduledTask.Info == null) || (this.Info != null && this.Info.Equals(scheduledTask.Info))));\n        }\n\n        public override bool Equals(object scheduledTask)\n        {\n            return Equals(scheduledTask as ScheduledTask);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskCompletedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskCompletedEvent>\n    {\n        public bool Equals(ScheduledTaskCompletedEvent scheduledTaskCompletedEvent)\n        {\n            return (scheduledTaskCompletedEvent != null && base.Equals(scheduledTaskCompletedEvent));\n        }\n\n        public override bool Equals(object scheduledTaskCompletedEvent)\n        {\n            return Equals(scheduledTaskCompletedEvent as ScheduledTaskCompletedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskCreatedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskCreatedEvent>\n    {\n        public bool Equals(ScheduledTaskCreatedEvent scheduledTaskCreatedEvent)\n        {\n            return (scheduledTaskCreatedEvent != null && base.Equals(scheduledTaskCreatedEvent));\n        }\n\n        public override bool Equals(object scheduledTaskCreatedEvent)\n        {\n            return Equals(scheduledTaskCreatedEvent as ScheduledTaskCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskDescription : DynamicData, IEquatable<ScheduledTaskDescription>\n    {\n        public TypeDescription[] Action { get; set; }\n\n        public ScheduledTaskDetail[] SchedulerInfo { get; set; }\n\n        public ElementDescription[] State { get; set; }\n\n        public ElementDescription[] DayOfWeek { get; set; }\n\n        public ElementDescription[] WeekOfMonth { get; set; }\n\n        public bool Equals(ScheduledTaskDescription scheduledTaskDescription)\n        {\n            return (scheduledTaskDescription != null && ((this.Action == null && scheduledTaskDescription.Action == null) || (this.Action != null && scheduledTaskDescription.Action != null && Enumerable.SequenceEqual(this.Action, scheduledTaskDescription.Action))) && ((this.SchedulerInfo == null && scheduledTaskDescription.SchedulerInfo == null) || (this.SchedulerInfo != null && scheduledTaskDescription.SchedulerInfo != null && Enumerable.SequenceEqual(this.SchedulerInfo, scheduledTaskDescription.SchedulerInfo))) && ((this.State == null && scheduledTaskDescription.State == null) || (this.State != null && scheduledTaskDescription.State != null && Enumerable.SequenceEqual(this.State, scheduledTaskDescription.State))) && ((this.DayOfWeek == null && scheduledTaskDescription.DayOfWeek == null) || (this.DayOfWeek != null && scheduledTaskDescription.DayOfWeek != null && Enumerable.SequenceEqual(this.DayOfWeek, scheduledTaskDescription.DayOfWeek))) && ((this.WeekOfMonth == null && scheduledTaskDescription.WeekOfMonth == null) || (this.WeekOfMonth != null && scheduledTaskDescription.WeekOfMonth != null && Enumerable.SequenceEqual(this.WeekOfMonth, scheduledTaskDescription.WeekOfMonth))));\n        }\n\n        public override bool Equals(object scheduledTaskDescription)\n        {\n            return Equals(scheduledTaskDescription as ScheduledTaskDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Action + \"_\" + SchedulerInfo + \"_\" + State + \"_\" + DayOfWeek + \"_\" + WeekOfMonth).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskDetail : TypeDescription, IEquatable<ScheduledTaskDetail>\n    {\n        public string Frequency { get; set; }\n\n        public bool Equals(ScheduledTaskDetail scheduledTaskDetail)\n        {\n            return (scheduledTaskDetail != null && this.Frequency == scheduledTaskDetail.Frequency);\n        }\n\n        public override bool Equals(object scheduledTaskDetail)\n        {\n            return Equals(scheduledTaskDetail as ScheduledTaskDetail);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Frequency).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskEmailCompletedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskEmailCompletedEvent>\n    {\n        public string To { get; set; }\n\n        public bool Equals(ScheduledTaskEmailCompletedEvent scheduledTaskEmailCompletedEvent)\n        {\n            return (scheduledTaskEmailCompletedEvent != null && this.To == scheduledTaskEmailCompletedEvent.To);\n        }\n\n        public override bool Equals(object scheduledTaskEmailCompletedEvent)\n        {\n            return Equals(scheduledTaskEmailCompletedEvent as ScheduledTaskEmailCompletedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (To).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskEmailFailedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskEmailFailedEvent>\n    {\n        public string To { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(ScheduledTaskEmailFailedEvent scheduledTaskEmailFailedEvent)\n        {\n            return (scheduledTaskEmailFailedEvent != null && this.To == scheduledTaskEmailFailedEvent.To && ((this.Reason == null && scheduledTaskEmailFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(scheduledTaskEmailFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object scheduledTaskEmailFailedEvent)\n        {\n            return Equals(scheduledTaskEmailFailedEvent as ScheduledTaskEmailFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (To + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskEvent : Event, IEquatable<ScheduledTaskEvent>\n    {\n        public ScheduledTaskEventArgument ScheduledTask { get; set; }\n\n        public ManagedEntityEventArgument Entity { get; set; }\n\n        public bool Equals(ScheduledTaskEvent scheduledTaskEvent)\n        {\n            return (scheduledTaskEvent != null && ((this.ScheduledTask == null && scheduledTaskEvent.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(scheduledTaskEvent.ScheduledTask))) && ((this.Entity == null && scheduledTaskEvent.Entity == null) || (this.Entity != null && this.Entity.Equals(scheduledTaskEvent.Entity))));\n        }\n\n        public override bool Equals(object scheduledTaskEvent)\n        {\n            return Equals(scheduledTaskEvent as ScheduledTaskEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskEventArgument : EntityEventArgument, IEquatable<ScheduledTaskEventArgument>\n    {\n        public ManagedObjectReference ScheduledTask { get; set; }\n\n        public ScheduledTaskEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ScheduledTaskEventArgument scheduledTaskEventArgument)\n        {\n            return (scheduledTaskEventArgument != null && ((this.ScheduledTask == null && scheduledTaskEventArgument.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(scheduledTaskEventArgument.ScheduledTask))) && ((this.LinkedView == null && scheduledTaskEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(scheduledTaskEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object scheduledTaskEventArgument)\n        {\n            return Equals(scheduledTaskEventArgument as ScheduledTaskEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskEventArgument_LinkedView : IEquatable<ScheduledTaskEventArgument_LinkedView>\n    {\n        public ScheduledTask ScheduledTask { get; set; }\n\n        public bool Equals(ScheduledTaskEventArgument_LinkedView scheduledTaskEventArgument_LinkedView)\n        {\n            return (scheduledTaskEventArgument_LinkedView != null && ((this.ScheduledTask == null && scheduledTaskEventArgument_LinkedView.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(scheduledTaskEventArgument_LinkedView.ScheduledTask))));\n        }\n\n        public override bool Equals(object scheduledTaskEventArgument_LinkedView)\n        {\n            return Equals(scheduledTaskEventArgument_LinkedView as ScheduledTaskEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskFailedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskFailedEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(ScheduledTaskFailedEvent scheduledTaskFailedEvent)\n        {\n            return (scheduledTaskFailedEvent != null && ((this.Reason == null && scheduledTaskFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(scheduledTaskFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object scheduledTaskFailedEvent)\n        {\n            return Equals(scheduledTaskFailedEvent as ScheduledTaskFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskInfo : ScheduledTaskSpec, IEquatable<ScheduledTaskInfo>\n    {\n        public ManagedObjectReference ScheduledTask { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public DateTime LastModifiedTime { get; set; }\n\n        public string LastModifiedUser { get; set; }\n\n        public DateTime? NextRunTime { get; set; }\n\n        public DateTime? PrevRunTime { get; set; }\n\n        public TaskInfoState State { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public object Result { get; set; }\n\n        public int? Progress { get; set; }\n\n        public ManagedObjectReference ActiveTask { get; set; }\n\n        public ManagedObjectReference TaskObject { get; set; }\n\n        public ScheduledTaskInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ScheduledTaskInfo scheduledTaskInfo)\n        {\n            return (scheduledTaskInfo != null && ((this.ScheduledTask == null && scheduledTaskInfo.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(scheduledTaskInfo.ScheduledTask))) && ((this.Entity == null && scheduledTaskInfo.Entity == null) || (this.Entity != null && this.Entity.Equals(scheduledTaskInfo.Entity))) && this.LastModifiedTime == scheduledTaskInfo.LastModifiedTime && this.LastModifiedUser == scheduledTaskInfo.LastModifiedUser && ((this.NextRunTime == null && scheduledTaskInfo.NextRunTime == null) || (this.NextRunTime != null && this.NextRunTime.Equals(scheduledTaskInfo.NextRunTime))) && ((this.PrevRunTime == null && scheduledTaskInfo.PrevRunTime == null) || (this.PrevRunTime != null && this.PrevRunTime.Equals(scheduledTaskInfo.PrevRunTime))) && this.State == scheduledTaskInfo.State && ((this.Error == null && scheduledTaskInfo.Error == null) || (this.Error != null && this.Error.Equals(scheduledTaskInfo.Error))) && ((this.Result == null && scheduledTaskInfo.Result == null) || (this.Result != null && this.Result.Equals(scheduledTaskInfo.Result))) && ((this.Progress == null && scheduledTaskInfo.Progress == null) || (this.Progress != null && this.Progress.Equals(scheduledTaskInfo.Progress))) && ((this.ActiveTask == null && scheduledTaskInfo.ActiveTask == null) || (this.ActiveTask != null && this.ActiveTask.Equals(scheduledTaskInfo.ActiveTask))) && ((this.TaskObject == null && scheduledTaskInfo.TaskObject == null) || (this.TaskObject != null && this.TaskObject.Equals(scheduledTaskInfo.TaskObject))) && ((this.LinkedView == null && scheduledTaskInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(scheduledTaskInfo.LinkedView))));\n        }\n\n        public override bool Equals(object scheduledTaskInfo)\n        {\n            return Equals(scheduledTaskInfo as ScheduledTaskInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask + \"_\" + Entity + \"_\" + LastModifiedTime + \"_\" + LastModifiedUser + \"_\" + NextRunTime + \"_\" + PrevRunTime + \"_\" + State + \"_\" + Error + \"_\" + Result + \"_\" + Progress + \"_\" + ActiveTask + \"_\" + TaskObject + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskInfo_LinkedView : IEquatable<ScheduledTaskInfo_LinkedView>\n    {\n        public ScheduledTask ScheduledTask { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public Task ActiveTask { get; set; }\n\n        public bool Equals(ScheduledTaskInfo_LinkedView scheduledTaskInfo_LinkedView)\n        {\n            return (scheduledTaskInfo_LinkedView != null && ((this.ScheduledTask == null && scheduledTaskInfo_LinkedView.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(scheduledTaskInfo_LinkedView.ScheduledTask))) && ((this.Entity == null && scheduledTaskInfo_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(scheduledTaskInfo_LinkedView.Entity))) && ((this.ActiveTask == null && scheduledTaskInfo_LinkedView.ActiveTask == null) || (this.ActiveTask != null && this.ActiveTask.Equals(scheduledTaskInfo_LinkedView.ActiveTask))));\n        }\n\n        public override bool Equals(object scheduledTaskInfo_LinkedView)\n        {\n            return Equals(scheduledTaskInfo_LinkedView as ScheduledTaskInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask + \"_\" + Entity + \"_\" + ActiveTask).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskManager : ViewBase, IEquatable<ScheduledTaskManager>\n    {\n        public ManagedObjectReference[] ScheduledTask { get; set; }\n\n        public ScheduledTaskDescription Description { get; set; }\n\n        public ScheduledTaskManager_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference CreateScheduledTask(ManagedObjectReference entity, ScheduledTaskSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference[] RetrieveEntityScheduledTask(ManagedObjectReference entity)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ManagedObjectReference CreateObjectScheduledTask(ManagedObjectReference obj, ScheduledTaskSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference[] RetrieveObjectScheduledTask(ManagedObjectReference obj)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool Equals(ScheduledTaskManager scheduledTaskManager)\n        {\n            return (scheduledTaskManager != null && ((this.ScheduledTask == null && scheduledTaskManager.ScheduledTask == null) || (this.ScheduledTask != null && scheduledTaskManager.ScheduledTask != null && Enumerable.SequenceEqual(this.ScheduledTask, scheduledTaskManager.ScheduledTask))) && ((this.Description == null && scheduledTaskManager.Description == null) || (this.Description != null && this.Description.Equals(scheduledTaskManager.Description))) && ((this.LinkedView == null && scheduledTaskManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(scheduledTaskManager.LinkedView))));\n        }\n\n        public override bool Equals(object scheduledTaskManager)\n        {\n            return Equals(scheduledTaskManager as ScheduledTaskManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask + \"_\" + Description + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskManager_LinkedView : IEquatable<ScheduledTaskManager_LinkedView>\n    {\n        public ScheduledTask[] ScheduledTask { get; set; }\n\n        public bool Equals(ScheduledTaskManager_LinkedView scheduledTaskManager_LinkedView)\n        {\n            return (scheduledTaskManager_LinkedView != null && ((this.ScheduledTask == null && scheduledTaskManager_LinkedView.ScheduledTask == null) || (this.ScheduledTask != null && scheduledTaskManager_LinkedView.ScheduledTask != null && Enumerable.SequenceEqual(this.ScheduledTask, scheduledTaskManager_LinkedView.ScheduledTask))));\n        }\n\n        public override bool Equals(object scheduledTaskManager_LinkedView)\n        {\n            return Equals(scheduledTaskManager_LinkedView as ScheduledTaskManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskReconfiguredEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskReconfiguredEvent>\n    {\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(ScheduledTaskReconfiguredEvent scheduledTaskReconfiguredEvent)\n        {\n            return (scheduledTaskReconfiguredEvent != null && ((this.ConfigChanges == null && scheduledTaskReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(scheduledTaskReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object scheduledTaskReconfiguredEvent)\n        {\n            return Equals(scheduledTaskReconfiguredEvent as ScheduledTaskReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskRemovedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskRemovedEvent>\n    {\n        public bool Equals(ScheduledTaskRemovedEvent scheduledTaskRemovedEvent)\n        {\n            return (scheduledTaskRemovedEvent != null && base.Equals(scheduledTaskRemovedEvent));\n        }\n\n        public override bool Equals(object scheduledTaskRemovedEvent)\n        {\n            return Equals(scheduledTaskRemovedEvent as ScheduledTaskRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskSpec : DynamicData, IEquatable<ScheduledTaskSpec>\n    {\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public TaskScheduler Scheduler { get; set; }\n\n        public Action Action { get; set; }\n\n        public string Notification { get; set; }\n\n        public bool Equals(ScheduledTaskSpec scheduledTaskSpec)\n        {\n            return (scheduledTaskSpec != null && this.Name == scheduledTaskSpec.Name && this.Description == scheduledTaskSpec.Description && this.Enabled == scheduledTaskSpec.Enabled && ((this.Scheduler == null && scheduledTaskSpec.Scheduler == null) || (this.Scheduler != null && this.Scheduler.Equals(scheduledTaskSpec.Scheduler))) && ((this.Action == null && scheduledTaskSpec.Action == null) || (this.Action != null && this.Action.Equals(scheduledTaskSpec.Action))) && this.Notification == scheduledTaskSpec.Notification);\n        }\n\n        public override bool Equals(object scheduledTaskSpec)\n        {\n            return Equals(scheduledTaskSpec as ScheduledTaskSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Description + \"_\" + Enabled + \"_\" + Scheduler + \"_\" + Action + \"_\" + Notification).GetHashCode();\n        }\n    }\n\n    public class ScheduledTaskStartedEvent : ScheduledTaskEvent, IEquatable<ScheduledTaskStartedEvent>\n    {\n        public bool Equals(ScheduledTaskStartedEvent scheduledTaskStartedEvent)\n        {\n            return (scheduledTaskStartedEvent != null && base.Equals(scheduledTaskStartedEvent));\n        }\n\n        public override bool Equals(object scheduledTaskStartedEvent)\n        {\n            return Equals(scheduledTaskStartedEvent as ScheduledTaskStartedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ScsiLun : HostDevice, IEquatable<ScsiLun>\n    {\n        public string Key { get; set; }\n\n        public string Uuid { get; set; }\n\n        public ScsiLunDescriptor[] Descriptor { get; set; }\n\n        public string CanonicalName { get; set; }\n\n        public string DisplayName { get; set; }\n\n        public string LunType { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Model { get; set; }\n\n        public string Revision { get; set; }\n\n        public int? ScsiLevel { get; set; }\n\n        public string SerialNumber { get; set; }\n\n        public ScsiLunDurableName DurableName { get; set; }\n\n        public ScsiLunDurableName[] AlternateName { get; set; }\n\n        public sbyte[] StandardInquiry { get; set; }\n\n        public int? QueueDepth { get; set; }\n\n        public string[] OperationalState { get; set; }\n\n        public ScsiLunCapabilities Capabilities { get; set; }\n\n        public string VStorageSupport { get; set; }\n\n        public bool? ProtocolEndpoint { get; set; }\n\n        public bool Equals(ScsiLun scsiLun)\n        {\n            return (scsiLun != null && this.Key == scsiLun.Key && this.Uuid == scsiLun.Uuid && ((this.Descriptor == null && scsiLun.Descriptor == null) || (this.Descriptor != null && scsiLun.Descriptor != null && Enumerable.SequenceEqual(this.Descriptor, scsiLun.Descriptor))) && this.CanonicalName == scsiLun.CanonicalName && this.DisplayName == scsiLun.DisplayName && this.LunType == scsiLun.LunType && this.Vendor == scsiLun.Vendor && this.Model == scsiLun.Model && this.Revision == scsiLun.Revision && ((this.ScsiLevel == null && scsiLun.ScsiLevel == null) || (this.ScsiLevel != null && this.ScsiLevel.Equals(scsiLun.ScsiLevel))) && this.SerialNumber == scsiLun.SerialNumber && ((this.DurableName == null && scsiLun.DurableName == null) || (this.DurableName != null && this.DurableName.Equals(scsiLun.DurableName))) && ((this.AlternateName == null && scsiLun.AlternateName == null) || (this.AlternateName != null && scsiLun.AlternateName != null && Enumerable.SequenceEqual(this.AlternateName, scsiLun.AlternateName))) && ((this.StandardInquiry == null && scsiLun.StandardInquiry == null) || (this.StandardInquiry != null && scsiLun.StandardInquiry != null && Enumerable.SequenceEqual(this.StandardInquiry, scsiLun.StandardInquiry))) && ((this.QueueDepth == null && scsiLun.QueueDepth == null) || (this.QueueDepth != null && this.QueueDepth.Equals(scsiLun.QueueDepth))) && ((this.OperationalState == null && scsiLun.OperationalState == null) || (this.OperationalState != null && scsiLun.OperationalState != null && Enumerable.SequenceEqual(this.OperationalState, scsiLun.OperationalState))) && ((this.Capabilities == null && scsiLun.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(scsiLun.Capabilities))) && this.VStorageSupport == scsiLun.VStorageSupport && ((this.ProtocolEndpoint == null && scsiLun.ProtocolEndpoint == null) || (this.ProtocolEndpoint != null && this.ProtocolEndpoint.Equals(scsiLun.ProtocolEndpoint))));\n        }\n\n        public override bool Equals(object scsiLun)\n        {\n            return Equals(scsiLun as ScsiLun);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Uuid + \"_\" + Descriptor + \"_\" + CanonicalName + \"_\" + DisplayName + \"_\" + LunType + \"_\" + Vendor + \"_\" + Model + \"_\" + Revision + \"_\" + ScsiLevel + \"_\" + SerialNumber + \"_\" + DurableName + \"_\" + AlternateName + \"_\" + StandardInquiry + \"_\" + QueueDepth + \"_\" + OperationalState + \"_\" + Capabilities + \"_\" + VStorageSupport + \"_\" + ProtocolEndpoint).GetHashCode();\n        }\n    }\n\n    public class ScsiLunCapabilities : DynamicData, IEquatable<ScsiLunCapabilities>\n    {\n        public bool UpdateDisplayNameSupported { get; set; }\n\n        public bool Equals(ScsiLunCapabilities scsiLunCapabilities)\n        {\n            return (scsiLunCapabilities != null && this.UpdateDisplayNameSupported == scsiLunCapabilities.UpdateDisplayNameSupported);\n        }\n\n        public override bool Equals(object scsiLunCapabilities)\n        {\n            return Equals(scsiLunCapabilities as ScsiLunCapabilities);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UpdateDisplayNameSupported).GetHashCode();\n        }\n    }\n\n    public class ScsiLunDescriptor : DynamicData, IEquatable<ScsiLunDescriptor>\n    {\n        public string Quality { get; set; }\n\n        public string Id { get; set; }\n\n        public bool Equals(ScsiLunDescriptor scsiLunDescriptor)\n        {\n            return (scsiLunDescriptor != null && this.Quality == scsiLunDescriptor.Quality && this.Id == scsiLunDescriptor.Id);\n        }\n\n        public override bool Equals(object scsiLunDescriptor)\n        {\n            return Equals(scsiLunDescriptor as ScsiLunDescriptor);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Quality + \"_\" + Id).GetHashCode();\n        }\n    }\n\n    public class ScsiLunDurableName : DynamicData, IEquatable<ScsiLunDurableName>\n    {\n        public string Namespace { get; set; }\n\n        public sbyte NamespaceId { get; set; }\n\n        public sbyte[] Data { get; set; }\n\n        public bool Equals(ScsiLunDurableName scsiLunDurableName)\n        {\n            return (scsiLunDurableName != null && this.Namespace == scsiLunDurableName.Namespace && this.NamespaceId == scsiLunDurableName.NamespaceId && ((this.Data == null && scsiLunDurableName.Data == null) || (this.Data != null && scsiLunDurableName.Data != null && Enumerable.SequenceEqual(this.Data, scsiLunDurableName.Data))));\n        }\n\n        public override bool Equals(object scsiLunDurableName)\n        {\n            return Equals(scsiLunDurableName as ScsiLunDurableName);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Namespace + \"_\" + NamespaceId + \"_\" + Data).GetHashCode();\n        }\n    }\n\n    public class SDDCBase : DynamicData, IEquatable<SDDCBase>\n    {\n        public bool Equals(SDDCBase sDDCBase)\n        {\n            return (sDDCBase != null && base.Equals(sDDCBase));\n        }\n\n        public override bool Equals(object sDDCBase)\n        {\n            return Equals(sDDCBase as SDDCBase);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SearchIndex : ViewBase, IEquatable<SearchIndex>\n    {\n        public ManagedObjectReference FindByUuid(ManagedObjectReference datacenter, string uuid, bool vmSearch, bool? instanceUuid)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference FindByDatastorePath(ManagedObjectReference datacenter, string path)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference FindByDnsName(ManagedObjectReference datacenter, string dnsName, bool vmSearch)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference FindByIp(ManagedObjectReference datacenter, string ip, bool vmSearch)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference FindByInventoryPath(string inventoryPath)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference FindChild(ManagedObjectReference entity, string name)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference[] FindAllByUuid(ManagedObjectReference datacenter, string uuid, bool vmSearch, bool? instanceUuid)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ManagedObjectReference[] FindAllByDnsName(ManagedObjectReference datacenter, string dnsName, bool vmSearch)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public ManagedObjectReference[] FindAllByIp(ManagedObjectReference datacenter, string ip, bool vmSearch)\n        {\n            return default(ManagedObjectReference[]);\n        }\n\n        public bool Equals(SearchIndex searchIndex)\n        {\n            return (searchIndex != null && base.Equals(searchIndex));\n        }\n\n        public override bool Equals(object searchIndex)\n        {\n            return Equals(searchIndex as SearchIndex);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SecondaryVmAlreadyDisabled : VmFaultToleranceIssue, IEquatable<SecondaryVmAlreadyDisabled>\n    {\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(SecondaryVmAlreadyDisabled secondaryVmAlreadyDisabled)\n        {\n            return (secondaryVmAlreadyDisabled != null && this.InstanceUuid == secondaryVmAlreadyDisabled.InstanceUuid);\n        }\n\n        public override bool Equals(object secondaryVmAlreadyDisabled)\n        {\n            return Equals(secondaryVmAlreadyDisabled as SecondaryVmAlreadyDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class SecondaryVmAlreadyEnabled : VmFaultToleranceIssue, IEquatable<SecondaryVmAlreadyEnabled>\n    {\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(SecondaryVmAlreadyEnabled secondaryVmAlreadyEnabled)\n        {\n            return (secondaryVmAlreadyEnabled != null && this.InstanceUuid == secondaryVmAlreadyEnabled.InstanceUuid);\n        }\n\n        public override bool Equals(object secondaryVmAlreadyEnabled)\n        {\n            return Equals(secondaryVmAlreadyEnabled as SecondaryVmAlreadyEnabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class SecondaryVmAlreadyRegistered : VmFaultToleranceIssue, IEquatable<SecondaryVmAlreadyRegistered>\n    {\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(SecondaryVmAlreadyRegistered secondaryVmAlreadyRegistered)\n        {\n            return (secondaryVmAlreadyRegistered != null && this.InstanceUuid == secondaryVmAlreadyRegistered.InstanceUuid);\n        }\n\n        public override bool Equals(object secondaryVmAlreadyRegistered)\n        {\n            return Equals(secondaryVmAlreadyRegistered as SecondaryVmAlreadyRegistered);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class SecondaryVmNotRegistered : VmFaultToleranceIssue, IEquatable<SecondaryVmNotRegistered>\n    {\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(SecondaryVmNotRegistered secondaryVmNotRegistered)\n        {\n            return (secondaryVmNotRegistered != null && this.InstanceUuid == secondaryVmNotRegistered.InstanceUuid);\n        }\n\n        public override bool Equals(object secondaryVmNotRegistered)\n        {\n            return Equals(secondaryVmNotRegistered as SecondaryVmNotRegistered);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class SecurityError : RuntimeFault, IEquatable<SecurityError>\n    {\n        public bool Equals(SecurityError securityError)\n        {\n            return (securityError != null && base.Equals(securityError));\n        }\n\n        public override bool Equals(object securityError)\n        {\n            return Equals(securityError as SecurityError);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SecurityProfile : ApplyProfile, IEquatable<SecurityProfile>\n    {\n        public PermissionProfile[] Permission { get; set; }\n\n        public bool Equals(SecurityProfile securityProfile)\n        {\n            return (securityProfile != null && ((this.Permission == null && securityProfile.Permission == null) || (this.Permission != null && securityProfile.Permission != null && Enumerable.SequenceEqual(this.Permission, securityProfile.Permission))));\n        }\n\n        public override bool Equals(object securityProfile)\n        {\n            return Equals(securityProfile as SecurityProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Permission).GetHashCode();\n        }\n    }\n\n    public class SelectionSet : DynamicData, IEquatable<SelectionSet>\n    {\n        public bool Equals(SelectionSet selectionSet)\n        {\n            return (selectionSet != null && base.Equals(selectionSet));\n        }\n\n        public override bool Equals(object selectionSet)\n        {\n            return Equals(selectionSet as SelectionSet);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SelectionSpec : DynamicData, IEquatable<SelectionSpec>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(SelectionSpec selectionSpec)\n        {\n            return (selectionSpec != null && this.Name == selectionSpec.Name);\n        }\n\n        public override bool Equals(object selectionSpec)\n        {\n            return Equals(selectionSpec as SelectionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class SendEmailAction : Action, IEquatable<SendEmailAction>\n    {\n        public string ToList { get; set; }\n\n        public string CcList { get; set; }\n\n        public string Subject { get; set; }\n\n        public string Body { get; set; }\n\n        public bool Equals(SendEmailAction sendEmailAction)\n        {\n            return (sendEmailAction != null && this.ToList == sendEmailAction.ToList && this.CcList == sendEmailAction.CcList && this.Subject == sendEmailAction.Subject && this.Body == sendEmailAction.Body);\n        }\n\n        public override bool Equals(object sendEmailAction)\n        {\n            return Equals(sendEmailAction as SendEmailAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ToList + \"_\" + CcList + \"_\" + Subject + \"_\" + Body).GetHashCode();\n        }\n    }\n\n    public class SendSNMPAction : Action, IEquatable<SendSNMPAction>\n    {\n        public bool Equals(SendSNMPAction sendSNMPAction)\n        {\n            return (sendSNMPAction != null && base.Equals(sendSNMPAction));\n        }\n\n        public override bool Equals(object sendSNMPAction)\n        {\n            return Equals(sendSNMPAction as SendSNMPAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ServerLicenseExpiredEvent : LicenseEvent, IEquatable<ServerLicenseExpiredEvent>\n    {\n        public string Product { get; set; }\n\n        public bool Equals(ServerLicenseExpiredEvent serverLicenseExpiredEvent)\n        {\n            return (serverLicenseExpiredEvent != null && this.Product == serverLicenseExpiredEvent.Product);\n        }\n\n        public override bool Equals(object serverLicenseExpiredEvent)\n        {\n            return Equals(serverLicenseExpiredEvent as ServerLicenseExpiredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Product).GetHashCode();\n        }\n    }\n\n    public class ServerStartedSessionEvent : SessionEvent, IEquatable<ServerStartedSessionEvent>\n    {\n        public bool Equals(ServerStartedSessionEvent serverStartedSessionEvent)\n        {\n            return (serverStartedSessionEvent != null && base.Equals(serverStartedSessionEvent));\n        }\n\n        public override bool Equals(object serverStartedSessionEvent)\n        {\n            return Equals(serverStartedSessionEvent as ServerStartedSessionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ServiceConsolePortGroupProfile : PortGroupProfile, IEquatable<ServiceConsolePortGroupProfile>\n    {\n        public IpAddressProfile IpConfig { get; set; }\n\n        public bool Equals(ServiceConsolePortGroupProfile serviceConsolePortGroupProfile)\n        {\n            return (serviceConsolePortGroupProfile != null && ((this.IpConfig == null && serviceConsolePortGroupProfile.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(serviceConsolePortGroupProfile.IpConfig))));\n        }\n\n        public override bool Equals(object serviceConsolePortGroupProfile)\n        {\n            return Equals(serviceConsolePortGroupProfile as ServiceConsolePortGroupProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpConfig).GetHashCode();\n        }\n    }\n\n    public class ServiceConsoleReservationInfo : DynamicData, IEquatable<ServiceConsoleReservationInfo>\n    {\n        public long ServiceConsoleReservedCfg { get; set; }\n\n        public long ServiceConsoleReserved { get; set; }\n\n        public long Unreserved { get; set; }\n\n        public bool Equals(ServiceConsoleReservationInfo serviceConsoleReservationInfo)\n        {\n            return (serviceConsoleReservationInfo != null && this.ServiceConsoleReservedCfg == serviceConsoleReservationInfo.ServiceConsoleReservedCfg && this.ServiceConsoleReserved == serviceConsoleReservationInfo.ServiceConsoleReserved && this.Unreserved == serviceConsoleReservationInfo.Unreserved);\n        }\n\n        public override bool Equals(object serviceConsoleReservationInfo)\n        {\n            return Equals(serviceConsoleReservationInfo as ServiceConsoleReservationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceConsoleReservedCfg + \"_\" + ServiceConsoleReserved + \"_\" + Unreserved).GetHashCode();\n        }\n    }\n\n    public class ServiceContent : DynamicData, IEquatable<ServiceContent>\n    {\n        public ManagedObjectReference RootFolder { get; set; }\n\n        public ManagedObjectReference PropertyCollector { get; set; }\n\n        public ManagedObjectReference ViewManager { get; set; }\n\n        public AboutInfo About { get; set; }\n\n        public ManagedObjectReference Setting { get; set; }\n\n        public ManagedObjectReference UserDirectory { get; set; }\n\n        public ManagedObjectReference SessionManager { get; set; }\n\n        public ManagedObjectReference AuthorizationManager { get; set; }\n\n        public ManagedObjectReference ServiceManager { get; set; }\n\n        public ManagedObjectReference PerfManager { get; set; }\n\n        public ManagedObjectReference ScheduledTaskManager { get; set; }\n\n        public ManagedObjectReference AlarmManager { get; set; }\n\n        public ManagedObjectReference EventManager { get; set; }\n\n        public ManagedObjectReference TaskManager { get; set; }\n\n        public ManagedObjectReference ExtensionManager { get; set; }\n\n        public ManagedObjectReference CustomizationSpecManager { get; set; }\n\n        public ManagedObjectReference CustomFieldsManager { get; set; }\n\n        public ManagedObjectReference AccountManager { get; set; }\n\n        public ManagedObjectReference DiagnosticManager { get; set; }\n\n        public ManagedObjectReference LicenseManager { get; set; }\n\n        public ManagedObjectReference SearchIndex { get; set; }\n\n        public ManagedObjectReference FileManager { get; set; }\n\n        public ManagedObjectReference DatastoreNamespaceManager { get; set; }\n\n        public ManagedObjectReference VirtualDiskManager { get; set; }\n\n        public ManagedObjectReference VirtualizationManager { get; set; }\n\n        public ManagedObjectReference SnmpSystem { get; set; }\n\n        public ManagedObjectReference VmProvisioningChecker { get; set; }\n\n        public ManagedObjectReference VmCompatibilityChecker { get; set; }\n\n        public ManagedObjectReference OvfManager { get; set; }\n\n        public ManagedObjectReference IpPoolManager { get; set; }\n\n        public ManagedObjectReference DvSwitchManager { get; set; }\n\n        public ManagedObjectReference HostProfileManager { get; set; }\n\n        public ManagedObjectReference ClusterProfileManager { get; set; }\n\n        public ManagedObjectReference ComplianceManager { get; set; }\n\n        public ManagedObjectReference LocalizationManager { get; set; }\n\n        public ManagedObjectReference StorageResourceManager { get; set; }\n\n        public ManagedObjectReference GuestOperationsManager { get; set; }\n\n        public ManagedObjectReference OverheadMemoryManager { get; set; }\n\n        public ManagedObjectReference CertificateManager { get; set; }\n\n        public ManagedObjectReference IoFilterManager { get; set; }\n\n        public ManagedObjectReference VStorageObjectManager { get; set; }\n\n        public ManagedObjectReference HostSpecManager { get; set; }\n\n        public ManagedObjectReference CryptoManager { get; set; }\n\n        public ManagedObjectReference HealthUpdateManager { get; set; }\n\n        public ManagedObjectReference FailoverClusterConfigurator { get; set; }\n\n        public ManagedObjectReference FailoverClusterManager { get; set; }\n\n        public ServiceContent_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ServiceContent serviceContent)\n        {\n            return (serviceContent != null && ((this.RootFolder == null && serviceContent.RootFolder == null) || (this.RootFolder != null && this.RootFolder.Equals(serviceContent.RootFolder))) && ((this.PropertyCollector == null && serviceContent.PropertyCollector == null) || (this.PropertyCollector != null && this.PropertyCollector.Equals(serviceContent.PropertyCollector))) && ((this.ViewManager == null && serviceContent.ViewManager == null) || (this.ViewManager != null && this.ViewManager.Equals(serviceContent.ViewManager))) && ((this.About == null && serviceContent.About == null) || (this.About != null && this.About.Equals(serviceContent.About))) && ((this.Setting == null && serviceContent.Setting == null) || (this.Setting != null && this.Setting.Equals(serviceContent.Setting))) && ((this.UserDirectory == null && serviceContent.UserDirectory == null) || (this.UserDirectory != null && this.UserDirectory.Equals(serviceContent.UserDirectory))) && ((this.SessionManager == null && serviceContent.SessionManager == null) || (this.SessionManager != null && this.SessionManager.Equals(serviceContent.SessionManager))) && ((this.AuthorizationManager == null && serviceContent.AuthorizationManager == null) || (this.AuthorizationManager != null && this.AuthorizationManager.Equals(serviceContent.AuthorizationManager))) && ((this.ServiceManager == null && serviceContent.ServiceManager == null) || (this.ServiceManager != null && this.ServiceManager.Equals(serviceContent.ServiceManager))) && ((this.PerfManager == null && serviceContent.PerfManager == null) || (this.PerfManager != null && this.PerfManager.Equals(serviceContent.PerfManager))) && ((this.ScheduledTaskManager == null && serviceContent.ScheduledTaskManager == null) || (this.ScheduledTaskManager != null && this.ScheduledTaskManager.Equals(serviceContent.ScheduledTaskManager))) && ((this.AlarmManager == null && serviceContent.AlarmManager == null) || (this.AlarmManager != null && this.AlarmManager.Equals(serviceContent.AlarmManager))) && ((this.EventManager == null && serviceContent.EventManager == null) || (this.EventManager != null && this.EventManager.Equals(serviceContent.EventManager))) && ((this.TaskManager == null && serviceContent.TaskManager == null) || (this.TaskManager != null && this.TaskManager.Equals(serviceContent.TaskManager))) && ((this.ExtensionManager == null && serviceContent.ExtensionManager == null) || (this.ExtensionManager != null && this.ExtensionManager.Equals(serviceContent.ExtensionManager))) && ((this.CustomizationSpecManager == null && serviceContent.CustomizationSpecManager == null) || (this.CustomizationSpecManager != null && this.CustomizationSpecManager.Equals(serviceContent.CustomizationSpecManager))) && ((this.CustomFieldsManager == null && serviceContent.CustomFieldsManager == null) || (this.CustomFieldsManager != null && this.CustomFieldsManager.Equals(serviceContent.CustomFieldsManager))) && ((this.AccountManager == null && serviceContent.AccountManager == null) || (this.AccountManager != null && this.AccountManager.Equals(serviceContent.AccountManager))) && ((this.DiagnosticManager == null && serviceContent.DiagnosticManager == null) || (this.DiagnosticManager != null && this.DiagnosticManager.Equals(serviceContent.DiagnosticManager))) && ((this.LicenseManager == null && serviceContent.LicenseManager == null) || (this.LicenseManager != null && this.LicenseManager.Equals(serviceContent.LicenseManager))) && ((this.SearchIndex == null && serviceContent.SearchIndex == null) || (this.SearchIndex != null && this.SearchIndex.Equals(serviceContent.SearchIndex))) && ((this.FileManager == null && serviceContent.FileManager == null) || (this.FileManager != null && this.FileManager.Equals(serviceContent.FileManager))) && ((this.DatastoreNamespaceManager == null && serviceContent.DatastoreNamespaceManager == null) || (this.DatastoreNamespaceManager != null && this.DatastoreNamespaceManager.Equals(serviceContent.DatastoreNamespaceManager))) && ((this.VirtualDiskManager == null && serviceContent.VirtualDiskManager == null) || (this.VirtualDiskManager != null && this.VirtualDiskManager.Equals(serviceContent.VirtualDiskManager))) && ((this.VirtualizationManager == null && serviceContent.VirtualizationManager == null) || (this.VirtualizationManager != null && this.VirtualizationManager.Equals(serviceContent.VirtualizationManager))) && ((this.SnmpSystem == null && serviceContent.SnmpSystem == null) || (this.SnmpSystem != null && this.SnmpSystem.Equals(serviceContent.SnmpSystem))) && ((this.VmProvisioningChecker == null && serviceContent.VmProvisioningChecker == null) || (this.VmProvisioningChecker != null && this.VmProvisioningChecker.Equals(serviceContent.VmProvisioningChecker))) && ((this.VmCompatibilityChecker == null && serviceContent.VmCompatibilityChecker == null) || (this.VmCompatibilityChecker != null && this.VmCompatibilityChecker.Equals(serviceContent.VmCompatibilityChecker))) && ((this.OvfManager == null && serviceContent.OvfManager == null) || (this.OvfManager != null && this.OvfManager.Equals(serviceContent.OvfManager))) && ((this.IpPoolManager == null && serviceContent.IpPoolManager == null) || (this.IpPoolManager != null && this.IpPoolManager.Equals(serviceContent.IpPoolManager))) && ((this.DvSwitchManager == null && serviceContent.DvSwitchManager == null) || (this.DvSwitchManager != null && this.DvSwitchManager.Equals(serviceContent.DvSwitchManager))) && ((this.HostProfileManager == null && serviceContent.HostProfileManager == null) || (this.HostProfileManager != null && this.HostProfileManager.Equals(serviceContent.HostProfileManager))) && ((this.ClusterProfileManager == null && serviceContent.ClusterProfileManager == null) || (this.ClusterProfileManager != null && this.ClusterProfileManager.Equals(serviceContent.ClusterProfileManager))) && ((this.ComplianceManager == null && serviceContent.ComplianceManager == null) || (this.ComplianceManager != null && this.ComplianceManager.Equals(serviceContent.ComplianceManager))) && ((this.LocalizationManager == null && serviceContent.LocalizationManager == null) || (this.LocalizationManager != null && this.LocalizationManager.Equals(serviceContent.LocalizationManager))) && ((this.StorageResourceManager == null && serviceContent.StorageResourceManager == null) || (this.StorageResourceManager != null && this.StorageResourceManager.Equals(serviceContent.StorageResourceManager))) && ((this.GuestOperationsManager == null && serviceContent.GuestOperationsManager == null) || (this.GuestOperationsManager != null && this.GuestOperationsManager.Equals(serviceContent.GuestOperationsManager))) && ((this.OverheadMemoryManager == null && serviceContent.OverheadMemoryManager == null) || (this.OverheadMemoryManager != null && this.OverheadMemoryManager.Equals(serviceContent.OverheadMemoryManager))) && ((this.CertificateManager == null && serviceContent.CertificateManager == null) || (this.CertificateManager != null && this.CertificateManager.Equals(serviceContent.CertificateManager))) && ((this.IoFilterManager == null && serviceContent.IoFilterManager == null) || (this.IoFilterManager != null && this.IoFilterManager.Equals(serviceContent.IoFilterManager))) && ((this.VStorageObjectManager == null && serviceContent.VStorageObjectManager == null) || (this.VStorageObjectManager != null && this.VStorageObjectManager.Equals(serviceContent.VStorageObjectManager))) && ((this.HostSpecManager == null && serviceContent.HostSpecManager == null) || (this.HostSpecManager != null && this.HostSpecManager.Equals(serviceContent.HostSpecManager))) && ((this.CryptoManager == null && serviceContent.CryptoManager == null) || (this.CryptoManager != null && this.CryptoManager.Equals(serviceContent.CryptoManager))) && ((this.HealthUpdateManager == null && serviceContent.HealthUpdateManager == null) || (this.HealthUpdateManager != null && this.HealthUpdateManager.Equals(serviceContent.HealthUpdateManager))) && ((this.FailoverClusterConfigurator == null && serviceContent.FailoverClusterConfigurator == null) || (this.FailoverClusterConfigurator != null && this.FailoverClusterConfigurator.Equals(serviceContent.FailoverClusterConfigurator))) && ((this.FailoverClusterManager == null && serviceContent.FailoverClusterManager == null) || (this.FailoverClusterManager != null && this.FailoverClusterManager.Equals(serviceContent.FailoverClusterManager))) && ((this.LinkedView == null && serviceContent.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(serviceContent.LinkedView))));\n        }\n\n        public override bool Equals(object serviceContent)\n        {\n            return Equals(serviceContent as ServiceContent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RootFolder + \"_\" + PropertyCollector + \"_\" + ViewManager + \"_\" + About + \"_\" + Setting + \"_\" + UserDirectory + \"_\" + SessionManager + \"_\" + AuthorizationManager + \"_\" + ServiceManager + \"_\" + PerfManager + \"_\" + ScheduledTaskManager + \"_\" + AlarmManager + \"_\" + EventManager + \"_\" + TaskManager + \"_\" + ExtensionManager + \"_\" + CustomizationSpecManager + \"_\" + CustomFieldsManager + \"_\" + AccountManager + \"_\" + DiagnosticManager + \"_\" + LicenseManager + \"_\" + SearchIndex + \"_\" + FileManager + \"_\" + DatastoreNamespaceManager + \"_\" + VirtualDiskManager + \"_\" + VirtualizationManager + \"_\" + SnmpSystem + \"_\" + VmProvisioningChecker + \"_\" + VmCompatibilityChecker + \"_\" + OvfManager + \"_\" + IpPoolManager + \"_\" + DvSwitchManager + \"_\" + HostProfileManager + \"_\" + ClusterProfileManager + \"_\" + ComplianceManager + \"_\" + LocalizationManager + \"_\" + StorageResourceManager + \"_\" + GuestOperationsManager + \"_\" + OverheadMemoryManager + \"_\" + CertificateManager + \"_\" + IoFilterManager + \"_\" + VStorageObjectManager + \"_\" + HostSpecManager + \"_\" + CryptoManager + \"_\" + HealthUpdateManager + \"_\" + FailoverClusterConfigurator + \"_\" + FailoverClusterManager + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ServiceContent_LinkedView : IEquatable<ServiceContent_LinkedView>\n    {\n        public Folder RootFolder { get; set; }\n\n        public PropertyCollector PropertyCollector { get; set; }\n\n        public ViewManager ViewManager { get; set; }\n\n        public OptionManager Setting { get; set; }\n\n        public UserDirectory UserDirectory { get; set; }\n\n        public SessionManager SessionManager { get; set; }\n\n        public AuthorizationManager AuthorizationManager { get; set; }\n\n        public ServiceManager ServiceManager { get; set; }\n\n        public PerformanceManager PerfManager { get; set; }\n\n        public ScheduledTaskManager ScheduledTaskManager { get; set; }\n\n        public AlarmManager AlarmManager { get; set; }\n\n        public EventManager EventManager { get; set; }\n\n        public TaskManager TaskManager { get; set; }\n\n        public ExtensionManager ExtensionManager { get; set; }\n\n        public CustomizationSpecManager CustomizationSpecManager { get; set; }\n\n        public CustomFieldsManager CustomFieldsManager { get; set; }\n\n        public HostLocalAccountManager AccountManager { get; set; }\n\n        public DiagnosticManager DiagnosticManager { get; set; }\n\n        public LicenseManager LicenseManager { get; set; }\n\n        public SearchIndex SearchIndex { get; set; }\n\n        public FileManager FileManager { get; set; }\n\n        public DatastoreNamespaceManager DatastoreNamespaceManager { get; set; }\n\n        public VirtualDiskManager VirtualDiskManager { get; set; }\n\n        public VirtualizationManager VirtualizationManager { get; set; }\n\n        public HostSnmpSystem SnmpSystem { get; set; }\n\n        public VirtualMachineProvisioningChecker VmProvisioningChecker { get; set; }\n\n        public VirtualMachineCompatibilityChecker VmCompatibilityChecker { get; set; }\n\n        public OvfManager OvfManager { get; set; }\n\n        public IpPoolManager IpPoolManager { get; set; }\n\n        public DistributedVirtualSwitchManager DvSwitchManager { get; set; }\n\n        public HostProfileManager HostProfileManager { get; set; }\n\n        public ClusterProfileManager ClusterProfileManager { get; set; }\n\n        public ProfileComplianceManager ComplianceManager { get; set; }\n\n        public LocalizationManager LocalizationManager { get; set; }\n\n        public StorageResourceManager StorageResourceManager { get; set; }\n\n        public GuestOperationsManager GuestOperationsManager { get; set; }\n\n        public OverheadMemoryManager OverheadMemoryManager { get; set; }\n\n        public CertificateManager CertificateManager { get; set; }\n\n        public IoFilterManager IoFilterManager { get; set; }\n\n        public VStorageObjectManagerBase VStorageObjectManager { get; set; }\n\n        public HostSpecificationManager HostSpecManager { get; set; }\n\n        public CryptoManager CryptoManager { get; set; }\n\n        public HealthUpdateManager HealthUpdateManager { get; set; }\n\n        public FailoverClusterConfigurator FailoverClusterConfigurator { get; set; }\n\n        public FailoverClusterManager FailoverClusterManager { get; set; }\n\n        public bool Equals(ServiceContent_LinkedView serviceContent_LinkedView)\n        {\n            return (serviceContent_LinkedView != null && ((this.RootFolder == null && serviceContent_LinkedView.RootFolder == null) || (this.RootFolder != null && this.RootFolder.Equals(serviceContent_LinkedView.RootFolder))) && ((this.PropertyCollector == null && serviceContent_LinkedView.PropertyCollector == null) || (this.PropertyCollector != null && this.PropertyCollector.Equals(serviceContent_LinkedView.PropertyCollector))) && ((this.ViewManager == null && serviceContent_LinkedView.ViewManager == null) || (this.ViewManager != null && this.ViewManager.Equals(serviceContent_LinkedView.ViewManager))) && ((this.Setting == null && serviceContent_LinkedView.Setting == null) || (this.Setting != null && this.Setting.Equals(serviceContent_LinkedView.Setting))) && ((this.UserDirectory == null && serviceContent_LinkedView.UserDirectory == null) || (this.UserDirectory != null && this.UserDirectory.Equals(serviceContent_LinkedView.UserDirectory))) && ((this.SessionManager == null && serviceContent_LinkedView.SessionManager == null) || (this.SessionManager != null && this.SessionManager.Equals(serviceContent_LinkedView.SessionManager))) && ((this.AuthorizationManager == null && serviceContent_LinkedView.AuthorizationManager == null) || (this.AuthorizationManager != null && this.AuthorizationManager.Equals(serviceContent_LinkedView.AuthorizationManager))) && ((this.ServiceManager == null && serviceContent_LinkedView.ServiceManager == null) || (this.ServiceManager != null && this.ServiceManager.Equals(serviceContent_LinkedView.ServiceManager))) && ((this.PerfManager == null && serviceContent_LinkedView.PerfManager == null) || (this.PerfManager != null && this.PerfManager.Equals(serviceContent_LinkedView.PerfManager))) && ((this.ScheduledTaskManager == null && serviceContent_LinkedView.ScheduledTaskManager == null) || (this.ScheduledTaskManager != null && this.ScheduledTaskManager.Equals(serviceContent_LinkedView.ScheduledTaskManager))) && ((this.AlarmManager == null && serviceContent_LinkedView.AlarmManager == null) || (this.AlarmManager != null && this.AlarmManager.Equals(serviceContent_LinkedView.AlarmManager))) && ((this.EventManager == null && serviceContent_LinkedView.EventManager == null) || (this.EventManager != null && this.EventManager.Equals(serviceContent_LinkedView.EventManager))) && ((this.TaskManager == null && serviceContent_LinkedView.TaskManager == null) || (this.TaskManager != null && this.TaskManager.Equals(serviceContent_LinkedView.TaskManager))) && ((this.ExtensionManager == null && serviceContent_LinkedView.ExtensionManager == null) || (this.ExtensionManager != null && this.ExtensionManager.Equals(serviceContent_LinkedView.ExtensionManager))) && ((this.CustomizationSpecManager == null && serviceContent_LinkedView.CustomizationSpecManager == null) || (this.CustomizationSpecManager != null && this.CustomizationSpecManager.Equals(serviceContent_LinkedView.CustomizationSpecManager))) && ((this.CustomFieldsManager == null && serviceContent_LinkedView.CustomFieldsManager == null) || (this.CustomFieldsManager != null && this.CustomFieldsManager.Equals(serviceContent_LinkedView.CustomFieldsManager))) && ((this.AccountManager == null && serviceContent_LinkedView.AccountManager == null) || (this.AccountManager != null && this.AccountManager.Equals(serviceContent_LinkedView.AccountManager))) && ((this.DiagnosticManager == null && serviceContent_LinkedView.DiagnosticManager == null) || (this.DiagnosticManager != null && this.DiagnosticManager.Equals(serviceContent_LinkedView.DiagnosticManager))) && ((this.LicenseManager == null && serviceContent_LinkedView.LicenseManager == null) || (this.LicenseManager != null && this.LicenseManager.Equals(serviceContent_LinkedView.LicenseManager))) && ((this.SearchIndex == null && serviceContent_LinkedView.SearchIndex == null) || (this.SearchIndex != null && this.SearchIndex.Equals(serviceContent_LinkedView.SearchIndex))) && ((this.FileManager == null && serviceContent_LinkedView.FileManager == null) || (this.FileManager != null && this.FileManager.Equals(serviceContent_LinkedView.FileManager))) && ((this.DatastoreNamespaceManager == null && serviceContent_LinkedView.DatastoreNamespaceManager == null) || (this.DatastoreNamespaceManager != null && this.DatastoreNamespaceManager.Equals(serviceContent_LinkedView.DatastoreNamespaceManager))) && ((this.VirtualDiskManager == null && serviceContent_LinkedView.VirtualDiskManager == null) || (this.VirtualDiskManager != null && this.VirtualDiskManager.Equals(serviceContent_LinkedView.VirtualDiskManager))) && ((this.VirtualizationManager == null && serviceContent_LinkedView.VirtualizationManager == null) || (this.VirtualizationManager != null && this.VirtualizationManager.Equals(serviceContent_LinkedView.VirtualizationManager))) && ((this.SnmpSystem == null && serviceContent_LinkedView.SnmpSystem == null) || (this.SnmpSystem != null && this.SnmpSystem.Equals(serviceContent_LinkedView.SnmpSystem))) && ((this.VmProvisioningChecker == null && serviceContent_LinkedView.VmProvisioningChecker == null) || (this.VmProvisioningChecker != null && this.VmProvisioningChecker.Equals(serviceContent_LinkedView.VmProvisioningChecker))) && ((this.VmCompatibilityChecker == null && serviceContent_LinkedView.VmCompatibilityChecker == null) || (this.VmCompatibilityChecker != null && this.VmCompatibilityChecker.Equals(serviceContent_LinkedView.VmCompatibilityChecker))) && ((this.OvfManager == null && serviceContent_LinkedView.OvfManager == null) || (this.OvfManager != null && this.OvfManager.Equals(serviceContent_LinkedView.OvfManager))) && ((this.IpPoolManager == null && serviceContent_LinkedView.IpPoolManager == null) || (this.IpPoolManager != null && this.IpPoolManager.Equals(serviceContent_LinkedView.IpPoolManager))) && ((this.DvSwitchManager == null && serviceContent_LinkedView.DvSwitchManager == null) || (this.DvSwitchManager != null && this.DvSwitchManager.Equals(serviceContent_LinkedView.DvSwitchManager))) && ((this.HostProfileManager == null && serviceContent_LinkedView.HostProfileManager == null) || (this.HostProfileManager != null && this.HostProfileManager.Equals(serviceContent_LinkedView.HostProfileManager))) && ((this.ClusterProfileManager == null && serviceContent_LinkedView.ClusterProfileManager == null) || (this.ClusterProfileManager != null && this.ClusterProfileManager.Equals(serviceContent_LinkedView.ClusterProfileManager))) && ((this.ComplianceManager == null && serviceContent_LinkedView.ComplianceManager == null) || (this.ComplianceManager != null && this.ComplianceManager.Equals(serviceContent_LinkedView.ComplianceManager))) && ((this.LocalizationManager == null && serviceContent_LinkedView.LocalizationManager == null) || (this.LocalizationManager != null && this.LocalizationManager.Equals(serviceContent_LinkedView.LocalizationManager))) && ((this.StorageResourceManager == null && serviceContent_LinkedView.StorageResourceManager == null) || (this.StorageResourceManager != null && this.StorageResourceManager.Equals(serviceContent_LinkedView.StorageResourceManager))) && ((this.GuestOperationsManager == null && serviceContent_LinkedView.GuestOperationsManager == null) || (this.GuestOperationsManager != null && this.GuestOperationsManager.Equals(serviceContent_LinkedView.GuestOperationsManager))) && ((this.OverheadMemoryManager == null && serviceContent_LinkedView.OverheadMemoryManager == null) || (this.OverheadMemoryManager != null && this.OverheadMemoryManager.Equals(serviceContent_LinkedView.OverheadMemoryManager))) && ((this.CertificateManager == null && serviceContent_LinkedView.CertificateManager == null) || (this.CertificateManager != null && this.CertificateManager.Equals(serviceContent_LinkedView.CertificateManager))) && ((this.IoFilterManager == null && serviceContent_LinkedView.IoFilterManager == null) || (this.IoFilterManager != null && this.IoFilterManager.Equals(serviceContent_LinkedView.IoFilterManager))) && ((this.VStorageObjectManager == null && serviceContent_LinkedView.VStorageObjectManager == null) || (this.VStorageObjectManager != null && this.VStorageObjectManager.Equals(serviceContent_LinkedView.VStorageObjectManager))) && ((this.HostSpecManager == null && serviceContent_LinkedView.HostSpecManager == null) || (this.HostSpecManager != null && this.HostSpecManager.Equals(serviceContent_LinkedView.HostSpecManager))) && ((this.CryptoManager == null && serviceContent_LinkedView.CryptoManager == null) || (this.CryptoManager != null && this.CryptoManager.Equals(serviceContent_LinkedView.CryptoManager))) && ((this.HealthUpdateManager == null && serviceContent_LinkedView.HealthUpdateManager == null) || (this.HealthUpdateManager != null && this.HealthUpdateManager.Equals(serviceContent_LinkedView.HealthUpdateManager))) && ((this.FailoverClusterConfigurator == null && serviceContent_LinkedView.FailoverClusterConfigurator == null) || (this.FailoverClusterConfigurator != null && this.FailoverClusterConfigurator.Equals(serviceContent_LinkedView.FailoverClusterConfigurator))) && ((this.FailoverClusterManager == null && serviceContent_LinkedView.FailoverClusterManager == null) || (this.FailoverClusterManager != null && this.FailoverClusterManager.Equals(serviceContent_LinkedView.FailoverClusterManager))));\n        }\n\n        public override bool Equals(object serviceContent_LinkedView)\n        {\n            return Equals(serviceContent_LinkedView as ServiceContent_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RootFolder + \"_\" + PropertyCollector + \"_\" + ViewManager + \"_\" + Setting + \"_\" + UserDirectory + \"_\" + SessionManager + \"_\" + AuthorizationManager + \"_\" + ServiceManager + \"_\" + PerfManager + \"_\" + ScheduledTaskManager + \"_\" + AlarmManager + \"_\" + EventManager + \"_\" + TaskManager + \"_\" + ExtensionManager + \"_\" + CustomizationSpecManager + \"_\" + CustomFieldsManager + \"_\" + AccountManager + \"_\" + DiagnosticManager + \"_\" + LicenseManager + \"_\" + SearchIndex + \"_\" + FileManager + \"_\" + DatastoreNamespaceManager + \"_\" + VirtualDiskManager + \"_\" + VirtualizationManager + \"_\" + SnmpSystem + \"_\" + VmProvisioningChecker + \"_\" + VmCompatibilityChecker + \"_\" + OvfManager + \"_\" + IpPoolManager + \"_\" + DvSwitchManager + \"_\" + HostProfileManager + \"_\" + ClusterProfileManager + \"_\" + ComplianceManager + \"_\" + LocalizationManager + \"_\" + StorageResourceManager + \"_\" + GuestOperationsManager + \"_\" + OverheadMemoryManager + \"_\" + CertificateManager + \"_\" + IoFilterManager + \"_\" + VStorageObjectManager + \"_\" + HostSpecManager + \"_\" + CryptoManager + \"_\" + HealthUpdateManager + \"_\" + FailoverClusterConfigurator + \"_\" + FailoverClusterManager).GetHashCode();\n        }\n    }\n\n    public class ServiceInstance : ViewBase, IEquatable<ServiceInstance>\n    {\n        public DateTime ServerClock { get; set; }\n\n        public Capability Capability { get; set; }\n\n        public ServiceContent Content { get; set; }\n\n        public DateTime CurrentTime()\n        {\n            return default(DateTime);\n        }\n\n        public ServiceContent RetrieveServiceContent()\n        {\n            return default(ServiceContent);\n        }\n\n        public Event[] ValidateMigration(ManagedObjectReference[] vm, VirtualMachinePowerState? state, string[] testType, ManagedObjectReference pool, ManagedObjectReference host)\n        {\n            return default(Event[]);\n        }\n\n        public HostVMotionCompatibility[] QueryVMotionCompatibility(ManagedObjectReference vm, ManagedObjectReference[] host, string[] compatibility)\n        {\n            return default(HostVMotionCompatibility[]);\n        }\n\n        public ProductComponentInfo[] RetrieveProductComponents()\n        {\n            return default(ProductComponentInfo[]);\n        }\n\n        public bool Equals(ServiceInstance serviceInstance)\n        {\n            return (serviceInstance != null && this.ServerClock == serviceInstance.ServerClock && ((this.Capability == null && serviceInstance.Capability == null) || (this.Capability != null && this.Capability.Equals(serviceInstance.Capability))) && ((this.Content == null && serviceInstance.Content == null) || (this.Content != null && this.Content.Equals(serviceInstance.Content))));\n        }\n\n        public override bool Equals(object serviceInstance)\n        {\n            return Equals(serviceInstance as ServiceInstance);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerClock + \"_\" + Capability + \"_\" + Content).GetHashCode();\n        }\n    }\n\n    public class ServiceLocator : DynamicData, IEquatable<ServiceLocator>\n    {\n        public string InstanceUuid { get; set; }\n\n        public string Url { get; set; }\n\n        public ServiceLocatorCredential Credential { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public bool Equals(ServiceLocator serviceLocator)\n        {\n            return (serviceLocator != null && this.InstanceUuid == serviceLocator.InstanceUuid && this.Url == serviceLocator.Url && ((this.Credential == null && serviceLocator.Credential == null) || (this.Credential != null && this.Credential.Equals(serviceLocator.Credential))) && this.SslThumbprint == serviceLocator.SslThumbprint);\n        }\n\n        public override bool Equals(object serviceLocator)\n        {\n            return Equals(serviceLocator as ServiceLocator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid + \"_\" + Url + \"_\" + Credential + \"_\" + SslThumbprint).GetHashCode();\n        }\n    }\n\n    public class ServiceLocatorCredential : DynamicData, IEquatable<ServiceLocatorCredential>\n    {\n        public bool Equals(ServiceLocatorCredential serviceLocatorCredential)\n        {\n            return (serviceLocatorCredential != null && base.Equals(serviceLocatorCredential));\n        }\n\n        public override bool Equals(object serviceLocatorCredential)\n        {\n            return Equals(serviceLocatorCredential as ServiceLocatorCredential);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ServiceLocatorNamePassword : ServiceLocatorCredential, IEquatable<ServiceLocatorNamePassword>\n    {\n        public string Username { get; set; }\n\n        public string Password { get; set; }\n\n        public bool Equals(ServiceLocatorNamePassword serviceLocatorNamePassword)\n        {\n            return (serviceLocatorNamePassword != null && this.Username == serviceLocatorNamePassword.Username && this.Password == serviceLocatorNamePassword.Password);\n        }\n\n        public override bool Equals(object serviceLocatorNamePassword)\n        {\n            return Equals(serviceLocatorNamePassword as ServiceLocatorNamePassword);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Username + \"_\" + Password).GetHashCode();\n        }\n    }\n\n    public class ServiceLocatorSAMLCredential : ServiceLocatorCredential, IEquatable<ServiceLocatorSAMLCredential>\n    {\n        public string Token { get; set; }\n\n        public bool Equals(ServiceLocatorSAMLCredential serviceLocatorSAMLCredential)\n        {\n            return (serviceLocatorSAMLCredential != null && this.Token == serviceLocatorSAMLCredential.Token);\n        }\n\n        public override bool Equals(object serviceLocatorSAMLCredential)\n        {\n            return Equals(serviceLocatorSAMLCredential as ServiceLocatorSAMLCredential);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Token).GetHashCode();\n        }\n    }\n\n    public class ServiceManager : ViewBase, IEquatable<ServiceManager>\n    {\n        public ServiceManagerServiceInfo[] Service { get; set; }\n\n        public ServiceManagerServiceInfo[] QueryServiceList(string serviceName, string[] location)\n        {\n            return default(ServiceManagerServiceInfo[]);\n        }\n\n        public bool Equals(ServiceManager serviceManager)\n        {\n            return (serviceManager != null && ((this.Service == null && serviceManager.Service == null) || (this.Service != null && serviceManager.Service != null && Enumerable.SequenceEqual(this.Service, serviceManager.Service))));\n        }\n\n        public override bool Equals(object serviceManager)\n        {\n            return Equals(serviceManager as ServiceManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Service).GetHashCode();\n        }\n    }\n\n    public class ServiceManagerServiceInfo : DynamicData, IEquatable<ServiceManagerServiceInfo>\n    {\n        public string ServiceName { get; set; }\n\n        public string[] Location { get; set; }\n\n        public ManagedObjectReference Service { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(ServiceManagerServiceInfo serviceManagerServiceInfo)\n        {\n            return (serviceManagerServiceInfo != null && this.ServiceName == serviceManagerServiceInfo.ServiceName && ((this.Location == null && serviceManagerServiceInfo.Location == null) || (this.Location != null && serviceManagerServiceInfo.Location != null && Enumerable.SequenceEqual(this.Location, serviceManagerServiceInfo.Location))) && ((this.Service == null && serviceManagerServiceInfo.Service == null) || (this.Service != null && this.Service.Equals(serviceManagerServiceInfo.Service))) && this.Description == serviceManagerServiceInfo.Description);\n        }\n\n        public override bool Equals(object serviceManagerServiceInfo)\n        {\n            return Equals(serviceManagerServiceInfo as ServiceManagerServiceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceName + \"_\" + Location + \"_\" + Service + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class ServiceProfile : ApplyProfile, IEquatable<ServiceProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(ServiceProfile serviceProfile)\n        {\n            return (serviceProfile != null && this.Key == serviceProfile.Key);\n        }\n\n        public override bool Equals(object serviceProfile)\n        {\n            return Equals(serviceProfile as ServiceProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class SeSparseVirtualDiskSpec : FileBackedVirtualDiskSpec, IEquatable<SeSparseVirtualDiskSpec>\n    {\n        public int? GrainSizeKb { get; set; }\n\n        public bool Equals(SeSparseVirtualDiskSpec seSparseVirtualDiskSpec)\n        {\n            return (seSparseVirtualDiskSpec != null && ((this.GrainSizeKb == null && seSparseVirtualDiskSpec.GrainSizeKb == null) || (this.GrainSizeKb != null && this.GrainSizeKb.Equals(seSparseVirtualDiskSpec.GrainSizeKb))));\n        }\n\n        public override bool Equals(object seSparseVirtualDiskSpec)\n        {\n            return Equals(seSparseVirtualDiskSpec as SeSparseVirtualDiskSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GrainSizeKb).GetHashCode();\n        }\n    }\n\n    public class SessionEvent : Event, IEquatable<SessionEvent>\n    {\n        public bool Equals(SessionEvent sessionEvent)\n        {\n            return (sessionEvent != null && base.Equals(sessionEvent));\n        }\n\n        public override bool Equals(object sessionEvent)\n        {\n            return Equals(sessionEvent as SessionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SessionManager : ViewBase, IEquatable<SessionManager>\n    {\n        public UserSession[] SessionList { get; set; }\n\n        public UserSession CurrentSession { get; set; }\n\n        public string Message { get; set; }\n\n        public string[] MessageLocaleList { get; set; }\n\n        public string[] SupportedLocaleList { get; set; }\n\n        public string DefaultLocale { get; set; }\n\n        public void UpdateServiceMessage(string message)\n        {\n        }\n\n        public UserSession LoginByToken(string locale)\n        {\n            return default(UserSession);\n        }\n\n        public UserSession Login(string userName, string password, string locale)\n        {\n            return default(UserSession);\n        }\n\n        public UserSession LoginBySSPI(string base64Token, string locale)\n        {\n            return default(UserSession);\n        }\n\n        public void Logout()\n        {\n        }\n\n        public SessionManagerLocalTicket AcquireLocalTicket(string userName)\n        {\n            return default(SessionManagerLocalTicket);\n        }\n\n        public SessionManagerGenericServiceTicket AcquireGenericServiceTicket(SessionManagerServiceRequestSpec spec)\n        {\n            return default(SessionManagerGenericServiceTicket);\n        }\n\n        public void TerminateSession(string[] sessionId)\n        {\n        }\n\n        public void SetLocale(string locale)\n        {\n        }\n\n        public UserSession LoginExtensionBySubjectName(string extensionKey, string locale)\n        {\n            return default(UserSession);\n        }\n\n        public UserSession LoginExtensionByCertificate(string extensionKey, string locale)\n        {\n            return default(UserSession);\n        }\n\n        public UserSession ImpersonateUser(string userName, string locale)\n        {\n            return default(UserSession);\n        }\n\n        public bool SessionIsActive(string sessionID, string userName)\n        {\n            return default(bool);\n        }\n\n        public string AcquireCloneTicket()\n        {\n            return default(string);\n        }\n\n        public UserSession CloneSession(string cloneTicket)\n        {\n            return default(UserSession);\n        }\n\n        public bool Equals(SessionManager sessionManager)\n        {\n            return (sessionManager != null && ((this.SessionList == null && sessionManager.SessionList == null) || (this.SessionList != null && sessionManager.SessionList != null && Enumerable.SequenceEqual(this.SessionList, sessionManager.SessionList))) && ((this.CurrentSession == null && sessionManager.CurrentSession == null) || (this.CurrentSession != null && this.CurrentSession.Equals(sessionManager.CurrentSession))) && this.Message == sessionManager.Message && ((this.MessageLocaleList == null && sessionManager.MessageLocaleList == null) || (this.MessageLocaleList != null && sessionManager.MessageLocaleList != null && Enumerable.SequenceEqual(this.MessageLocaleList, sessionManager.MessageLocaleList))) && ((this.SupportedLocaleList == null && sessionManager.SupportedLocaleList == null) || (this.SupportedLocaleList != null && sessionManager.SupportedLocaleList != null && Enumerable.SequenceEqual(this.SupportedLocaleList, sessionManager.SupportedLocaleList))) && this.DefaultLocale == sessionManager.DefaultLocale);\n        }\n\n        public override bool Equals(object sessionManager)\n        {\n            return Equals(sessionManager as SessionManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SessionList + \"_\" + CurrentSession + \"_\" + Message + \"_\" + MessageLocaleList + \"_\" + SupportedLocaleList + \"_\" + DefaultLocale).GetHashCode();\n        }\n    }\n\n    public class SessionManagerGenericServiceTicket : DynamicData, IEquatable<SessionManagerGenericServiceTicket>\n    {\n        public string Id { get; set; }\n\n        public string HostName { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public bool Equals(SessionManagerGenericServiceTicket sessionManagerGenericServiceTicket)\n        {\n            return (sessionManagerGenericServiceTicket != null && this.Id == sessionManagerGenericServiceTicket.Id && this.HostName == sessionManagerGenericServiceTicket.HostName && this.SslThumbprint == sessionManagerGenericServiceTicket.SslThumbprint);\n        }\n\n        public override bool Equals(object sessionManagerGenericServiceTicket)\n        {\n            return Equals(sessionManagerGenericServiceTicket as SessionManagerGenericServiceTicket);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + HostName + \"_\" + SslThumbprint).GetHashCode();\n        }\n    }\n\n    public class SessionManagerHttpServiceRequestSpec : SessionManagerServiceRequestSpec, IEquatable<SessionManagerHttpServiceRequestSpec>\n    {\n        public string Method { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(SessionManagerHttpServiceRequestSpec sessionManagerHttpServiceRequestSpec)\n        {\n            return (sessionManagerHttpServiceRequestSpec != null && this.Method == sessionManagerHttpServiceRequestSpec.Method && this.Url == sessionManagerHttpServiceRequestSpec.Url);\n        }\n\n        public override bool Equals(object sessionManagerHttpServiceRequestSpec)\n        {\n            return Equals(sessionManagerHttpServiceRequestSpec as SessionManagerHttpServiceRequestSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Method + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class SessionManagerLocalTicket : DynamicData, IEquatable<SessionManagerLocalTicket>\n    {\n        public string UserName { get; set; }\n\n        public string PasswordFilePath { get; set; }\n\n        public bool Equals(SessionManagerLocalTicket sessionManagerLocalTicket)\n        {\n            return (sessionManagerLocalTicket != null && this.UserName == sessionManagerLocalTicket.UserName && this.PasswordFilePath == sessionManagerLocalTicket.PasswordFilePath);\n        }\n\n        public override bool Equals(object sessionManagerLocalTicket)\n        {\n            return Equals(sessionManagerLocalTicket as SessionManagerLocalTicket);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserName + \"_\" + PasswordFilePath).GetHashCode();\n        }\n    }\n\n    public class SessionManagerServiceRequestSpec : DynamicData, IEquatable<SessionManagerServiceRequestSpec>\n    {\n        public bool Equals(SessionManagerServiceRequestSpec sessionManagerServiceRequestSpec)\n        {\n            return (sessionManagerServiceRequestSpec != null && base.Equals(sessionManagerServiceRequestSpec));\n        }\n\n        public override bool Equals(object sessionManagerServiceRequestSpec)\n        {\n            return Equals(sessionManagerServiceRequestSpec as SessionManagerServiceRequestSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SessionManagerVmomiServiceRequestSpec : SessionManagerServiceRequestSpec, IEquatable<SessionManagerVmomiServiceRequestSpec>\n    {\n        public string Method { get; set; }\n\n        public bool Equals(SessionManagerVmomiServiceRequestSpec sessionManagerVmomiServiceRequestSpec)\n        {\n            return (sessionManagerVmomiServiceRequestSpec != null && this.Method == sessionManagerVmomiServiceRequestSpec.Method);\n        }\n\n        public override bool Equals(object sessionManagerVmomiServiceRequestSpec)\n        {\n            return Equals(sessionManagerVmomiServiceRequestSpec as SessionManagerVmomiServiceRequestSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Method).GetHashCode();\n        }\n    }\n\n    public class SessionTerminatedEvent : SessionEvent, IEquatable<SessionTerminatedEvent>\n    {\n        public string SessionId { get; set; }\n\n        public string TerminatedUsername { get; set; }\n\n        public bool Equals(SessionTerminatedEvent sessionTerminatedEvent)\n        {\n            return (sessionTerminatedEvent != null && this.SessionId == sessionTerminatedEvent.SessionId && this.TerminatedUsername == sessionTerminatedEvent.TerminatedUsername);\n        }\n\n        public override bool Equals(object sessionTerminatedEvent)\n        {\n            return Equals(sessionTerminatedEvent as SessionTerminatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SessionId + \"_\" + TerminatedUsername).GetHashCode();\n        }\n    }\n\n    public class SharedBusControllerNotSupported : DeviceNotSupported, IEquatable<SharedBusControllerNotSupported>\n    {\n        public bool Equals(SharedBusControllerNotSupported sharedBusControllerNotSupported)\n        {\n            return (sharedBusControllerNotSupported != null && base.Equals(sharedBusControllerNotSupported));\n        }\n\n        public override bool Equals(object sharedBusControllerNotSupported)\n        {\n            return Equals(sharedBusControllerNotSupported as SharedBusControllerNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SharesInfo : DynamicData, IEquatable<SharesInfo>\n    {\n        public int Shares { get; set; }\n\n        public SharesLevel Level { get; set; }\n\n        public bool Equals(SharesInfo sharesInfo)\n        {\n            return (sharesInfo != null && this.Shares == sharesInfo.Shares && this.Level == sharesInfo.Level);\n        }\n\n        public override bool Equals(object sharesInfo)\n        {\n            return Equals(sharesInfo as SharesInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Shares + \"_\" + Level).GetHashCode();\n        }\n    }\n\n    public class SharesOption : DynamicData, IEquatable<SharesOption>\n    {\n        public IntOption sharesOption { get; set; }\n\n        public SharesLevel DefaultLevel { get; set; }\n\n        public bool Equals(SharesOption sharesOption)\n        {\n            return (sharesOption != null && ((this.sharesOption == null && sharesOption.sharesOption == null) || (this.sharesOption != null && this.sharesOption.Equals(sharesOption.sharesOption))) && this.DefaultLevel == sharesOption.DefaultLevel);\n        }\n\n        public override bool Equals(object sharesOption)\n        {\n            return Equals(sharesOption as SharesOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (sharesOption + \"_\" + DefaultLevel).GetHashCode();\n        }\n    }\n\n    public class ShrinkDiskFault : VimFault, IEquatable<ShrinkDiskFault>\n    {\n        public int? DiskId { get; set; }\n\n        public bool Equals(ShrinkDiskFault shrinkDiskFault)\n        {\n            return (shrinkDiskFault != null && ((this.DiskId == null && shrinkDiskFault.DiskId == null) || (this.DiskId != null && this.DiskId.Equals(shrinkDiskFault.DiskId))));\n        }\n\n        public override bool Equals(object shrinkDiskFault)\n        {\n            return Equals(shrinkDiskFault as ShrinkDiskFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId).GetHashCode();\n        }\n    }\n\n    public class SimpleCommand : ViewBase, IEquatable<SimpleCommand>\n    {\n        public SimpleCommandEncoding EncodingType { get; set; }\n\n        public ServiceManagerServiceInfo Entity { get; set; }\n\n        public string ExecuteSimpleCommand(string[] arguments)\n        {\n            return default(string);\n        }\n\n        public bool Equals(SimpleCommand simpleCommand)\n        {\n            return (simpleCommand != null && this.EncodingType == simpleCommand.EncodingType && ((this.Entity == null && simpleCommand.Entity == null) || (this.Entity != null && this.Entity.Equals(simpleCommand.Entity))));\n        }\n\n        public override bool Equals(object simpleCommand)\n        {\n            return Equals(simpleCommand as SimpleCommand);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EncodingType + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class SingleIp : IpAddress, IEquatable<SingleIp>\n    {\n        public string Address { get; set; }\n\n        public bool Equals(SingleIp singleIp)\n        {\n            return (singleIp != null && this.Address == singleIp.Address);\n        }\n\n        public override bool Equals(object singleIp)\n        {\n            return Equals(singleIp as SingleIp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address).GetHashCode();\n        }\n    }\n\n    public class SingleMac : MacAddress, IEquatable<SingleMac>\n    {\n        public string Address { get; set; }\n\n        public bool Equals(SingleMac singleMac)\n        {\n            return (singleMac != null && this.Address == singleMac.Address);\n        }\n\n        public override bool Equals(object singleMac)\n        {\n            return Equals(singleMac as SingleMac);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address).GetHashCode();\n        }\n    }\n\n    public class SnapshotCloneNotSupported : SnapshotCopyNotSupported, IEquatable<SnapshotCloneNotSupported>\n    {\n        public bool Equals(SnapshotCloneNotSupported snapshotCloneNotSupported)\n        {\n            return (snapshotCloneNotSupported != null && base.Equals(snapshotCloneNotSupported));\n        }\n\n        public override bool Equals(object snapshotCloneNotSupported)\n        {\n            return Equals(snapshotCloneNotSupported as SnapshotCloneNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotCopyNotSupported : MigrationFault, IEquatable<SnapshotCopyNotSupported>\n    {\n        public bool Equals(SnapshotCopyNotSupported snapshotCopyNotSupported)\n        {\n            return (snapshotCopyNotSupported != null && base.Equals(snapshotCopyNotSupported));\n        }\n\n        public override bool Equals(object snapshotCopyNotSupported)\n        {\n            return Equals(snapshotCopyNotSupported as SnapshotCopyNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotDisabled : SnapshotFault, IEquatable<SnapshotDisabled>\n    {\n        public bool Equals(SnapshotDisabled snapshotDisabled)\n        {\n            return (snapshotDisabled != null && base.Equals(snapshotDisabled));\n        }\n\n        public override bool Equals(object snapshotDisabled)\n        {\n            return Equals(snapshotDisabled as SnapshotDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotFault : VimFault, IEquatable<SnapshotFault>\n    {\n        public bool Equals(SnapshotFault snapshotFault)\n        {\n            return (snapshotFault != null && base.Equals(snapshotFault));\n        }\n\n        public override bool Equals(object snapshotFault)\n        {\n            return Equals(snapshotFault as SnapshotFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotIncompatibleDeviceInVm : SnapshotFault, IEquatable<SnapshotIncompatibleDeviceInVm>\n    {\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(SnapshotIncompatibleDeviceInVm snapshotIncompatibleDeviceInVm)\n        {\n            return (snapshotIncompatibleDeviceInVm != null && ((this.Fault == null && snapshotIncompatibleDeviceInVm.Fault == null) || (this.Fault != null && this.Fault.Equals(snapshotIncompatibleDeviceInVm.Fault))));\n        }\n\n        public override bool Equals(object snapshotIncompatibleDeviceInVm)\n        {\n            return Equals(snapshotIncompatibleDeviceInVm as SnapshotIncompatibleDeviceInVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault).GetHashCode();\n        }\n    }\n\n    public class SnapshotLocked : SnapshotFault, IEquatable<SnapshotLocked>\n    {\n        public bool Equals(SnapshotLocked snapshotLocked)\n        {\n            return (snapshotLocked != null && base.Equals(snapshotLocked));\n        }\n\n        public override bool Equals(object snapshotLocked)\n        {\n            return Equals(snapshotLocked as SnapshotLocked);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotMoveFromNonHomeNotSupported : SnapshotCopyNotSupported, IEquatable<SnapshotMoveFromNonHomeNotSupported>\n    {\n        public bool Equals(SnapshotMoveFromNonHomeNotSupported snapshotMoveFromNonHomeNotSupported)\n        {\n            return (snapshotMoveFromNonHomeNotSupported != null && base.Equals(snapshotMoveFromNonHomeNotSupported));\n        }\n\n        public override bool Equals(object snapshotMoveFromNonHomeNotSupported)\n        {\n            return Equals(snapshotMoveFromNonHomeNotSupported as SnapshotMoveFromNonHomeNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotMoveNotSupported : SnapshotCopyNotSupported, IEquatable<SnapshotMoveNotSupported>\n    {\n        public bool Equals(SnapshotMoveNotSupported snapshotMoveNotSupported)\n        {\n            return (snapshotMoveNotSupported != null && base.Equals(snapshotMoveNotSupported));\n        }\n\n        public override bool Equals(object snapshotMoveNotSupported)\n        {\n            return Equals(snapshotMoveNotSupported as SnapshotMoveNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotMoveToNonHomeNotSupported : SnapshotCopyNotSupported, IEquatable<SnapshotMoveToNonHomeNotSupported>\n    {\n        public bool Equals(SnapshotMoveToNonHomeNotSupported snapshotMoveToNonHomeNotSupported)\n        {\n            return (snapshotMoveToNonHomeNotSupported != null && base.Equals(snapshotMoveToNonHomeNotSupported));\n        }\n\n        public override bool Equals(object snapshotMoveToNonHomeNotSupported)\n        {\n            return Equals(snapshotMoveToNonHomeNotSupported as SnapshotMoveToNonHomeNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotNoChange : SnapshotFault, IEquatable<SnapshotNoChange>\n    {\n        public bool Equals(SnapshotNoChange snapshotNoChange)\n        {\n            return (snapshotNoChange != null && base.Equals(snapshotNoChange));\n        }\n\n        public override bool Equals(object snapshotNoChange)\n        {\n            return Equals(snapshotNoChange as SnapshotNoChange);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SnapshotRevertIssue : MigrationFault, IEquatable<SnapshotRevertIssue>\n    {\n        public string SnapshotName { get; set; }\n\n        public Event[] Event { get; set; }\n\n        public bool Errors { get; set; }\n\n        public bool Equals(SnapshotRevertIssue snapshotRevertIssue)\n        {\n            return (snapshotRevertIssue != null && this.SnapshotName == snapshotRevertIssue.SnapshotName && ((this.Event == null && snapshotRevertIssue.Event == null) || (this.Event != null && snapshotRevertIssue.Event != null && Enumerable.SequenceEqual(this.Event, snapshotRevertIssue.Event))) && this.Errors == snapshotRevertIssue.Errors);\n        }\n\n        public override bool Equals(object snapshotRevertIssue)\n        {\n            return Equals(snapshotRevertIssue as SnapshotRevertIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SnapshotName + \"_\" + Event + \"_\" + Errors).GetHashCode();\n        }\n    }\n\n    public class SoftRuleVioCorrectionDisallowed : VmConfigFault, IEquatable<SoftRuleVioCorrectionDisallowed>\n    {\n        public string VmName { get; set; }\n\n        public bool Equals(SoftRuleVioCorrectionDisallowed softRuleVioCorrectionDisallowed)\n        {\n            return (softRuleVioCorrectionDisallowed != null && this.VmName == softRuleVioCorrectionDisallowed.VmName);\n        }\n\n        public override bool Equals(object softRuleVioCorrectionDisallowed)\n        {\n            return Equals(softRuleVioCorrectionDisallowed as SoftRuleVioCorrectionDisallowed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName).GetHashCode();\n        }\n    }\n\n    public class SoftRuleVioCorrectionImpact : VmConfigFault, IEquatable<SoftRuleVioCorrectionImpact>\n    {\n        public string VmName { get; set; }\n\n        public bool Equals(SoftRuleVioCorrectionImpact softRuleVioCorrectionImpact)\n        {\n            return (softRuleVioCorrectionImpact != null && this.VmName == softRuleVioCorrectionImpact.VmName);\n        }\n\n        public override bool Equals(object softRuleVioCorrectionImpact)\n        {\n            return Equals(softRuleVioCorrectionImpact as SoftRuleVioCorrectionImpact);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName).GetHashCode();\n        }\n    }\n\n    public class SoftwarePackage : DynamicData, IEquatable<SoftwarePackage>\n    {\n        public string Name { get; set; }\n\n        public string Version { get; set; }\n\n        public string Type { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string AcceptanceLevel { get; set; }\n\n        public string Summary { get; set; }\n\n        public string Description { get; set; }\n\n        public string[] ReferenceURL { get; set; }\n\n        public DateTime? CreationDate { get; set; }\n\n        public Relation[] Depends { get; set; }\n\n        public Relation[] Conflicts { get; set; }\n\n        public Relation[] Replaces { get; set; }\n\n        public string[] Provides { get; set; }\n\n        public bool? MaintenanceModeRequired { get; set; }\n\n        public string[] HardwarePlatformsRequired { get; set; }\n\n        public SoftwarePackageCapability Capability { get; set; }\n\n        public string[] Tag { get; set; }\n\n        public string[] Payload { get; set; }\n\n        public bool Equals(SoftwarePackage softwarePackage)\n        {\n            return (softwarePackage != null && this.Name == softwarePackage.Name && this.Version == softwarePackage.Version && this.Type == softwarePackage.Type && this.Vendor == softwarePackage.Vendor && this.AcceptanceLevel == softwarePackage.AcceptanceLevel && this.Summary == softwarePackage.Summary && this.Description == softwarePackage.Description && ((this.ReferenceURL == null && softwarePackage.ReferenceURL == null) || (this.ReferenceURL != null && softwarePackage.ReferenceURL != null && Enumerable.SequenceEqual(this.ReferenceURL, softwarePackage.ReferenceURL))) && ((this.CreationDate == null && softwarePackage.CreationDate == null) || (this.CreationDate != null && this.CreationDate.Equals(softwarePackage.CreationDate))) && ((this.Depends == null && softwarePackage.Depends == null) || (this.Depends != null && softwarePackage.Depends != null && Enumerable.SequenceEqual(this.Depends, softwarePackage.Depends))) && ((this.Conflicts == null && softwarePackage.Conflicts == null) || (this.Conflicts != null && softwarePackage.Conflicts != null && Enumerable.SequenceEqual(this.Conflicts, softwarePackage.Conflicts))) && ((this.Replaces == null && softwarePackage.Replaces == null) || (this.Replaces != null && softwarePackage.Replaces != null && Enumerable.SequenceEqual(this.Replaces, softwarePackage.Replaces))) && ((this.Provides == null && softwarePackage.Provides == null) || (this.Provides != null && softwarePackage.Provides != null && Enumerable.SequenceEqual(this.Provides, softwarePackage.Provides))) && ((this.MaintenanceModeRequired == null && softwarePackage.MaintenanceModeRequired == null) || (this.MaintenanceModeRequired != null && this.MaintenanceModeRequired.Equals(softwarePackage.MaintenanceModeRequired))) && ((this.HardwarePlatformsRequired == null && softwarePackage.HardwarePlatformsRequired == null) || (this.HardwarePlatformsRequired != null && softwarePackage.HardwarePlatformsRequired != null && Enumerable.SequenceEqual(this.HardwarePlatformsRequired, softwarePackage.HardwarePlatformsRequired))) && ((this.Capability == null && softwarePackage.Capability == null) || (this.Capability != null && this.Capability.Equals(softwarePackage.Capability))) && ((this.Tag == null && softwarePackage.Tag == null) || (this.Tag != null && softwarePackage.Tag != null && Enumerable.SequenceEqual(this.Tag, softwarePackage.Tag))) && ((this.Payload == null && softwarePackage.Payload == null) || (this.Payload != null && softwarePackage.Payload != null && Enumerable.SequenceEqual(this.Payload, softwarePackage.Payload))));\n        }\n\n        public override bool Equals(object softwarePackage)\n        {\n            return Equals(softwarePackage as SoftwarePackage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Version + \"_\" + Type + \"_\" + Vendor + \"_\" + AcceptanceLevel + \"_\" + Summary + \"_\" + Description + \"_\" + ReferenceURL + \"_\" + CreationDate + \"_\" + Depends + \"_\" + Conflicts + \"_\" + Replaces + \"_\" + Provides + \"_\" + MaintenanceModeRequired + \"_\" + HardwarePlatformsRequired + \"_\" + Capability + \"_\" + Tag + \"_\" + Payload).GetHashCode();\n        }\n    }\n\n    public class SoftwarePackageCapability : DynamicData, IEquatable<SoftwarePackageCapability>\n    {\n        public bool? LiveInstallAllowed { get; set; }\n\n        public bool? LiveRemoveAllowed { get; set; }\n\n        public bool? StatelessReady { get; set; }\n\n        public bool? Overlay { get; set; }\n\n        public bool Equals(SoftwarePackageCapability softwarePackageCapability)\n        {\n            return (softwarePackageCapability != null && ((this.LiveInstallAllowed == null && softwarePackageCapability.LiveInstallAllowed == null) || (this.LiveInstallAllowed != null && this.LiveInstallAllowed.Equals(softwarePackageCapability.LiveInstallAllowed))) && ((this.LiveRemoveAllowed == null && softwarePackageCapability.LiveRemoveAllowed == null) || (this.LiveRemoveAllowed != null && this.LiveRemoveAllowed.Equals(softwarePackageCapability.LiveRemoveAllowed))) && ((this.StatelessReady == null && softwarePackageCapability.StatelessReady == null) || (this.StatelessReady != null && this.StatelessReady.Equals(softwarePackageCapability.StatelessReady))) && ((this.Overlay == null && softwarePackageCapability.Overlay == null) || (this.Overlay != null && this.Overlay.Equals(softwarePackageCapability.Overlay))));\n        }\n\n        public override bool Equals(object softwarePackageCapability)\n        {\n            return Equals(softwarePackageCapability as SoftwarePackageCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LiveInstallAllowed + \"_\" + LiveRemoveAllowed + \"_\" + StatelessReady + \"_\" + Overlay).GetHashCode();\n        }\n    }\n\n    public class SourceNodeSpec : DynamicData, IEquatable<SourceNodeSpec>\n    {\n        public ServiceLocator ManagementVc { get; set; }\n\n        public ManagedObjectReference ActiveVc { get; set; }\n\n        public SourceNodeSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(SourceNodeSpec sourceNodeSpec)\n        {\n            return (sourceNodeSpec != null && ((this.ManagementVc == null && sourceNodeSpec.ManagementVc == null) || (this.ManagementVc != null && this.ManagementVc.Equals(sourceNodeSpec.ManagementVc))) && ((this.ActiveVc == null && sourceNodeSpec.ActiveVc == null) || (this.ActiveVc != null && this.ActiveVc.Equals(sourceNodeSpec.ActiveVc))) && ((this.LinkedView == null && sourceNodeSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(sourceNodeSpec.LinkedView))));\n        }\n\n        public override bool Equals(object sourceNodeSpec)\n        {\n            return Equals(sourceNodeSpec as SourceNodeSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ManagementVc + \"_\" + ActiveVc + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class SourceNodeSpec_LinkedView : IEquatable<SourceNodeSpec_LinkedView>\n    {\n        public VirtualMachine ActiveVc { get; set; }\n\n        public bool Equals(SourceNodeSpec_LinkedView sourceNodeSpec_LinkedView)\n        {\n            return (sourceNodeSpec_LinkedView != null && ((this.ActiveVc == null && sourceNodeSpec_LinkedView.ActiveVc == null) || (this.ActiveVc != null && this.ActiveVc.Equals(sourceNodeSpec_LinkedView.ActiveVc))));\n        }\n\n        public override bool Equals(object sourceNodeSpec_LinkedView)\n        {\n            return Equals(sourceNodeSpec_LinkedView as SourceNodeSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActiveVc).GetHashCode();\n        }\n    }\n\n    public class SsdDiskNotAvailable : VimFault, IEquatable<SsdDiskNotAvailable>\n    {\n        public string DevicePath { get; set; }\n\n        public bool Equals(SsdDiskNotAvailable ssdDiskNotAvailable)\n        {\n            return (ssdDiskNotAvailable != null && this.DevicePath == ssdDiskNotAvailable.DevicePath);\n        }\n\n        public override bool Equals(object ssdDiskNotAvailable)\n        {\n            return Equals(ssdDiskNotAvailable as SsdDiskNotAvailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DevicePath).GetHashCode();\n        }\n    }\n\n    public class SSLDisabledFault : HostConnectFault, IEquatable<SSLDisabledFault>\n    {\n        public bool Equals(SSLDisabledFault sSLDisabledFault)\n        {\n            return (sSLDisabledFault != null && base.Equals(sSLDisabledFault));\n        }\n\n        public override bool Equals(object sSLDisabledFault)\n        {\n            return Equals(sSLDisabledFault as SSLDisabledFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SSLVerifyFault : HostConnectFault, IEquatable<SSLVerifyFault>\n    {\n        public bool SelfSigned { get; set; }\n\n        public string Thumbprint { get; set; }\n\n        public bool Equals(SSLVerifyFault sSLVerifyFault)\n        {\n            return (sSLVerifyFault != null && this.SelfSigned == sSLVerifyFault.SelfSigned && this.Thumbprint == sSLVerifyFault.Thumbprint);\n        }\n\n        public override bool Equals(object sSLVerifyFault)\n        {\n            return Equals(sSLVerifyFault as SSLVerifyFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SelfSigned + \"_\" + Thumbprint).GetHashCode();\n        }\n    }\n\n    public class SSPIAuthentication : GuestAuthentication, IEquatable<SSPIAuthentication>\n    {\n        public string SspiToken { get; set; }\n\n        public bool Equals(SSPIAuthentication sSPIAuthentication)\n        {\n            return (sSPIAuthentication != null && this.SspiToken == sSPIAuthentication.SspiToken);\n        }\n\n        public override bool Equals(object sSPIAuthentication)\n        {\n            return Equals(sSPIAuthentication as SSPIAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SspiToken).GetHashCode();\n        }\n    }\n\n    public class SSPIChallenge : VimFault, IEquatable<SSPIChallenge>\n    {\n        public string Base64Token { get; set; }\n\n        public bool Equals(SSPIChallenge sSPIChallenge)\n        {\n            return (sSPIChallenge != null && this.Base64Token == sSPIChallenge.Base64Token);\n        }\n\n        public override bool Equals(object sSPIChallenge)\n        {\n            return Equals(sSPIChallenge as SSPIChallenge);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Base64Token).GetHashCode();\n        }\n    }\n\n    public class StateAlarmExpression : AlarmExpression, IEquatable<StateAlarmExpression>\n    {\n        public StateAlarmOperator Operator { get; set; }\n\n        public string Type { get; set; }\n\n        public string StatePath { get; set; }\n\n        public string Yellow { get; set; }\n\n        public string Red { get; set; }\n\n        public bool Equals(StateAlarmExpression stateAlarmExpression)\n        {\n            return (stateAlarmExpression != null && this.Operator == stateAlarmExpression.Operator && this.Type == stateAlarmExpression.Type && this.StatePath == stateAlarmExpression.StatePath && this.Yellow == stateAlarmExpression.Yellow && this.Red == stateAlarmExpression.Red);\n        }\n\n        public override bool Equals(object stateAlarmExpression)\n        {\n            return Equals(stateAlarmExpression as StateAlarmExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operator + \"_\" + Type + \"_\" + StatePath + \"_\" + Yellow + \"_\" + Red).GetHashCode();\n        }\n    }\n\n    public class StaticRouteProfile : ApplyProfile, IEquatable<StaticRouteProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(StaticRouteProfile staticRouteProfile)\n        {\n            return (staticRouteProfile != null && this.Key == staticRouteProfile.Key);\n        }\n\n        public override bool Equals(object staticRouteProfile)\n        {\n            return Equals(staticRouteProfile as StaticRouteProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class StorageDrsAutomationConfig : DynamicData, IEquatable<StorageDrsAutomationConfig>\n    {\n        public string SpaceLoadBalanceAutomationMode { get; set; }\n\n        public string IoLoadBalanceAutomationMode { get; set; }\n\n        public string RuleEnforcementAutomationMode { get; set; }\n\n        public string PolicyEnforcementAutomationMode { get; set; }\n\n        public string VmEvacuationAutomationMode { get; set; }\n\n        public bool Equals(StorageDrsAutomationConfig storageDrsAutomationConfig)\n        {\n            return (storageDrsAutomationConfig != null && this.SpaceLoadBalanceAutomationMode == storageDrsAutomationConfig.SpaceLoadBalanceAutomationMode && this.IoLoadBalanceAutomationMode == storageDrsAutomationConfig.IoLoadBalanceAutomationMode && this.RuleEnforcementAutomationMode == storageDrsAutomationConfig.RuleEnforcementAutomationMode && this.PolicyEnforcementAutomationMode == storageDrsAutomationConfig.PolicyEnforcementAutomationMode && this.VmEvacuationAutomationMode == storageDrsAutomationConfig.VmEvacuationAutomationMode);\n        }\n\n        public override bool Equals(object storageDrsAutomationConfig)\n        {\n            return Equals(storageDrsAutomationConfig as StorageDrsAutomationConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SpaceLoadBalanceAutomationMode + \"_\" + IoLoadBalanceAutomationMode + \"_\" + RuleEnforcementAutomationMode + \"_\" + PolicyEnforcementAutomationMode + \"_\" + VmEvacuationAutomationMode).GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveDiskInMultiWriterMode : VimFault, IEquatable<StorageDrsCannotMoveDiskInMultiWriterMode>\n    {\n        public bool Equals(StorageDrsCannotMoveDiskInMultiWriterMode storageDrsCannotMoveDiskInMultiWriterMode)\n        {\n            return (storageDrsCannotMoveDiskInMultiWriterMode != null && base.Equals(storageDrsCannotMoveDiskInMultiWriterMode));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveDiskInMultiWriterMode)\n        {\n            return Equals(storageDrsCannotMoveDiskInMultiWriterMode as StorageDrsCannotMoveDiskInMultiWriterMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveFTVm : VimFault, IEquatable<StorageDrsCannotMoveFTVm>\n    {\n        public bool Equals(StorageDrsCannotMoveFTVm storageDrsCannotMoveFTVm)\n        {\n            return (storageDrsCannotMoveFTVm != null && base.Equals(storageDrsCannotMoveFTVm));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveFTVm)\n        {\n            return Equals(storageDrsCannotMoveFTVm as StorageDrsCannotMoveFTVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveIndependentDisk : VimFault, IEquatable<StorageDrsCannotMoveIndependentDisk>\n    {\n        public bool Equals(StorageDrsCannotMoveIndependentDisk storageDrsCannotMoveIndependentDisk)\n        {\n            return (storageDrsCannotMoveIndependentDisk != null && base.Equals(storageDrsCannotMoveIndependentDisk));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveIndependentDisk)\n        {\n            return Equals(storageDrsCannotMoveIndependentDisk as StorageDrsCannotMoveIndependentDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveManuallyPlacedSwapFile : VimFault, IEquatable<StorageDrsCannotMoveManuallyPlacedSwapFile>\n    {\n        public bool Equals(StorageDrsCannotMoveManuallyPlacedSwapFile storageDrsCannotMoveManuallyPlacedSwapFile)\n        {\n            return (storageDrsCannotMoveManuallyPlacedSwapFile != null && base.Equals(storageDrsCannotMoveManuallyPlacedSwapFile));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveManuallyPlacedSwapFile)\n        {\n            return Equals(storageDrsCannotMoveManuallyPlacedSwapFile as StorageDrsCannotMoveManuallyPlacedSwapFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveManuallyPlacedVm : VimFault, IEquatable<StorageDrsCannotMoveManuallyPlacedVm>\n    {\n        public bool Equals(StorageDrsCannotMoveManuallyPlacedVm storageDrsCannotMoveManuallyPlacedVm)\n        {\n            return (storageDrsCannotMoveManuallyPlacedVm != null && base.Equals(storageDrsCannotMoveManuallyPlacedVm));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveManuallyPlacedVm)\n        {\n            return Equals(storageDrsCannotMoveManuallyPlacedVm as StorageDrsCannotMoveManuallyPlacedVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveSharedDisk : VimFault, IEquatable<StorageDrsCannotMoveSharedDisk>\n    {\n        public bool Equals(StorageDrsCannotMoveSharedDisk storageDrsCannotMoveSharedDisk)\n        {\n            return (storageDrsCannotMoveSharedDisk != null && base.Equals(storageDrsCannotMoveSharedDisk));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveSharedDisk)\n        {\n            return Equals(storageDrsCannotMoveSharedDisk as StorageDrsCannotMoveSharedDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveTemplate : VimFault, IEquatable<StorageDrsCannotMoveTemplate>\n    {\n        public bool Equals(StorageDrsCannotMoveTemplate storageDrsCannotMoveTemplate)\n        {\n            return (storageDrsCannotMoveTemplate != null && base.Equals(storageDrsCannotMoveTemplate));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveTemplate)\n        {\n            return Equals(storageDrsCannotMoveTemplate as StorageDrsCannotMoveTemplate);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveVmInUserFolder : VimFault, IEquatable<StorageDrsCannotMoveVmInUserFolder>\n    {\n        public bool Equals(StorageDrsCannotMoveVmInUserFolder storageDrsCannotMoveVmInUserFolder)\n        {\n            return (storageDrsCannotMoveVmInUserFolder != null && base.Equals(storageDrsCannotMoveVmInUserFolder));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveVmInUserFolder)\n        {\n            return Equals(storageDrsCannotMoveVmInUserFolder as StorageDrsCannotMoveVmInUserFolder);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveVmWithMountedCDROM : VimFault, IEquatable<StorageDrsCannotMoveVmWithMountedCDROM>\n    {\n        public bool Equals(StorageDrsCannotMoveVmWithMountedCDROM storageDrsCannotMoveVmWithMountedCDROM)\n        {\n            return (storageDrsCannotMoveVmWithMountedCDROM != null && base.Equals(storageDrsCannotMoveVmWithMountedCDROM));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveVmWithMountedCDROM)\n        {\n            return Equals(storageDrsCannotMoveVmWithMountedCDROM as StorageDrsCannotMoveVmWithMountedCDROM);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsCannotMoveVmWithNoFilesInLayout : VimFault, IEquatable<StorageDrsCannotMoveVmWithNoFilesInLayout>\n    {\n        public bool Equals(StorageDrsCannotMoveVmWithNoFilesInLayout storageDrsCannotMoveVmWithNoFilesInLayout)\n        {\n            return (storageDrsCannotMoveVmWithNoFilesInLayout != null && base.Equals(storageDrsCannotMoveVmWithNoFilesInLayout));\n        }\n\n        public override bool Equals(object storageDrsCannotMoveVmWithNoFilesInLayout)\n        {\n            return Equals(storageDrsCannotMoveVmWithNoFilesInLayout as StorageDrsCannotMoveVmWithNoFilesInLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsConfigInfo : DynamicData, IEquatable<StorageDrsConfigInfo>\n    {\n        public StorageDrsPodConfigInfo PodConfig { get; set; }\n\n        public StorageDrsVmConfigInfo[] VmConfig { get; set; }\n\n        public bool Equals(StorageDrsConfigInfo storageDrsConfigInfo)\n        {\n            return (storageDrsConfigInfo != null && ((this.PodConfig == null && storageDrsConfigInfo.PodConfig == null) || (this.PodConfig != null && this.PodConfig.Equals(storageDrsConfigInfo.PodConfig))) && ((this.VmConfig == null && storageDrsConfigInfo.VmConfig == null) || (this.VmConfig != null && storageDrsConfigInfo.VmConfig != null && Enumerable.SequenceEqual(this.VmConfig, storageDrsConfigInfo.VmConfig))));\n        }\n\n        public override bool Equals(object storageDrsConfigInfo)\n        {\n            return Equals(storageDrsConfigInfo as StorageDrsConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PodConfig + \"_\" + VmConfig).GetHashCode();\n        }\n    }\n\n    public class StorageDrsConfigSpec : DynamicData, IEquatable<StorageDrsConfigSpec>\n    {\n        public StorageDrsPodConfigSpec PodConfigSpec { get; set; }\n\n        public StorageDrsVmConfigSpec[] VmConfigSpec { get; set; }\n\n        public bool Equals(StorageDrsConfigSpec storageDrsConfigSpec)\n        {\n            return (storageDrsConfigSpec != null && ((this.PodConfigSpec == null && storageDrsConfigSpec.PodConfigSpec == null) || (this.PodConfigSpec != null && this.PodConfigSpec.Equals(storageDrsConfigSpec.PodConfigSpec))) && ((this.VmConfigSpec == null && storageDrsConfigSpec.VmConfigSpec == null) || (this.VmConfigSpec != null && storageDrsConfigSpec.VmConfigSpec != null && Enumerable.SequenceEqual(this.VmConfigSpec, storageDrsConfigSpec.VmConfigSpec))));\n        }\n\n        public override bool Equals(object storageDrsConfigSpec)\n        {\n            return Equals(storageDrsConfigSpec as StorageDrsConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PodConfigSpec + \"_\" + VmConfigSpec).GetHashCode();\n        }\n    }\n\n    public class StorageDrsDatacentersCannotShareDatastore : VimFault, IEquatable<StorageDrsDatacentersCannotShareDatastore>\n    {\n        public bool Equals(StorageDrsDatacentersCannotShareDatastore storageDrsDatacentersCannotShareDatastore)\n        {\n            return (storageDrsDatacentersCannotShareDatastore != null && base.Equals(storageDrsDatacentersCannotShareDatastore));\n        }\n\n        public override bool Equals(object storageDrsDatacentersCannotShareDatastore)\n        {\n            return Equals(storageDrsDatacentersCannotShareDatastore as StorageDrsDatacentersCannotShareDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsDisabledOnVm : VimFault, IEquatable<StorageDrsDisabledOnVm>\n    {\n        public bool Equals(StorageDrsDisabledOnVm storageDrsDisabledOnVm)\n        {\n            return (storageDrsDisabledOnVm != null && base.Equals(storageDrsDisabledOnVm));\n        }\n\n        public override bool Equals(object storageDrsDisabledOnVm)\n        {\n            return Equals(storageDrsDisabledOnVm as StorageDrsDisabledOnVm);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsHbrDiskNotMovable : VimFault, IEquatable<StorageDrsHbrDiskNotMovable>\n    {\n        public string NonMovableDiskIds { get; set; }\n\n        public bool Equals(StorageDrsHbrDiskNotMovable storageDrsHbrDiskNotMovable)\n        {\n            return (storageDrsHbrDiskNotMovable != null && this.NonMovableDiskIds == storageDrsHbrDiskNotMovable.NonMovableDiskIds);\n        }\n\n        public override bool Equals(object storageDrsHbrDiskNotMovable)\n        {\n            return Equals(storageDrsHbrDiskNotMovable as StorageDrsHbrDiskNotMovable);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NonMovableDiskIds).GetHashCode();\n        }\n    }\n\n    public class StorageDrsHmsMoveInProgress : VimFault, IEquatable<StorageDrsHmsMoveInProgress>\n    {\n        public bool Equals(StorageDrsHmsMoveInProgress storageDrsHmsMoveInProgress)\n        {\n            return (storageDrsHmsMoveInProgress != null && base.Equals(storageDrsHmsMoveInProgress));\n        }\n\n        public override bool Equals(object storageDrsHmsMoveInProgress)\n        {\n            return Equals(storageDrsHmsMoveInProgress as StorageDrsHmsMoveInProgress);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsHmsUnreachable : VimFault, IEquatable<StorageDrsHmsUnreachable>\n    {\n        public bool Equals(StorageDrsHmsUnreachable storageDrsHmsUnreachable)\n        {\n            return (storageDrsHmsUnreachable != null && base.Equals(storageDrsHmsUnreachable));\n        }\n\n        public override bool Equals(object storageDrsHmsUnreachable)\n        {\n            return Equals(storageDrsHmsUnreachable as StorageDrsHmsUnreachable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsIolbDisabledInternally : VimFault, IEquatable<StorageDrsIolbDisabledInternally>\n    {\n        public bool Equals(StorageDrsIolbDisabledInternally storageDrsIolbDisabledInternally)\n        {\n            return (storageDrsIolbDisabledInternally != null && base.Equals(storageDrsIolbDisabledInternally));\n        }\n\n        public override bool Equals(object storageDrsIolbDisabledInternally)\n        {\n            return Equals(storageDrsIolbDisabledInternally as StorageDrsIolbDisabledInternally);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsIoLoadBalanceConfig : DynamicData, IEquatable<StorageDrsIoLoadBalanceConfig>\n    {\n        public int? ReservablePercentThreshold { get; set; }\n\n        public int? ReservableIopsThreshold { get; set; }\n\n        public string ReservableThresholdMode { get; set; }\n\n        public int? IoLatencyThreshold { get; set; }\n\n        public int? IoLoadImbalanceThreshold { get; set; }\n\n        public bool Equals(StorageDrsIoLoadBalanceConfig storageDrsIoLoadBalanceConfig)\n        {\n            return (storageDrsIoLoadBalanceConfig != null && ((this.ReservablePercentThreshold == null && storageDrsIoLoadBalanceConfig.ReservablePercentThreshold == null) || (this.ReservablePercentThreshold != null && this.ReservablePercentThreshold.Equals(storageDrsIoLoadBalanceConfig.ReservablePercentThreshold))) && ((this.ReservableIopsThreshold == null && storageDrsIoLoadBalanceConfig.ReservableIopsThreshold == null) || (this.ReservableIopsThreshold != null && this.ReservableIopsThreshold.Equals(storageDrsIoLoadBalanceConfig.ReservableIopsThreshold))) && this.ReservableThresholdMode == storageDrsIoLoadBalanceConfig.ReservableThresholdMode && ((this.IoLatencyThreshold == null && storageDrsIoLoadBalanceConfig.IoLatencyThreshold == null) || (this.IoLatencyThreshold != null && this.IoLatencyThreshold.Equals(storageDrsIoLoadBalanceConfig.IoLatencyThreshold))) && ((this.IoLoadImbalanceThreshold == null && storageDrsIoLoadBalanceConfig.IoLoadImbalanceThreshold == null) || (this.IoLoadImbalanceThreshold != null && this.IoLoadImbalanceThreshold.Equals(storageDrsIoLoadBalanceConfig.IoLoadImbalanceThreshold))));\n        }\n\n        public override bool Equals(object storageDrsIoLoadBalanceConfig)\n        {\n            return Equals(storageDrsIoLoadBalanceConfig as StorageDrsIoLoadBalanceConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReservablePercentThreshold + \"_\" + ReservableIopsThreshold + \"_\" + ReservableThresholdMode + \"_\" + IoLatencyThreshold + \"_\" + IoLoadImbalanceThreshold).GetHashCode();\n        }\n    }\n\n    public class StorageDrsOptionSpec : ArrayUpdateSpec, IEquatable<StorageDrsOptionSpec>\n    {\n        public OptionValue Option { get; set; }\n\n        public bool Equals(StorageDrsOptionSpec storageDrsOptionSpec)\n        {\n            return (storageDrsOptionSpec != null && ((this.Option == null && storageDrsOptionSpec.Option == null) || (this.Option != null && this.Option.Equals(storageDrsOptionSpec.Option))));\n        }\n\n        public override bool Equals(object storageDrsOptionSpec)\n        {\n            return Equals(storageDrsOptionSpec as StorageDrsOptionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Option).GetHashCode();\n        }\n    }\n\n    public class StorageDrsPlacementRankVmSpec : DynamicData, IEquatable<StorageDrsPlacementRankVmSpec>\n    {\n        public PlacementSpec VmPlacementSpec { get; set; }\n\n        public ManagedObjectReference[] VmClusters { get; set; }\n\n        public StorageDrsPlacementRankVmSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageDrsPlacementRankVmSpec storageDrsPlacementRankVmSpec)\n        {\n            return (storageDrsPlacementRankVmSpec != null && ((this.VmPlacementSpec == null && storageDrsPlacementRankVmSpec.VmPlacementSpec == null) || (this.VmPlacementSpec != null && this.VmPlacementSpec.Equals(storageDrsPlacementRankVmSpec.VmPlacementSpec))) && ((this.VmClusters == null && storageDrsPlacementRankVmSpec.VmClusters == null) || (this.VmClusters != null && storageDrsPlacementRankVmSpec.VmClusters != null && Enumerable.SequenceEqual(this.VmClusters, storageDrsPlacementRankVmSpec.VmClusters))) && ((this.LinkedView == null && storageDrsPlacementRankVmSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageDrsPlacementRankVmSpec.LinkedView))));\n        }\n\n        public override bool Equals(object storageDrsPlacementRankVmSpec)\n        {\n            return Equals(storageDrsPlacementRankVmSpec as StorageDrsPlacementRankVmSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmPlacementSpec + \"_\" + VmClusters + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageDrsPlacementRankVmSpec_LinkedView : IEquatable<StorageDrsPlacementRankVmSpec_LinkedView>\n    {\n        public ClusterComputeResource[] VmClusters { get; set; }\n\n        public bool Equals(StorageDrsPlacementRankVmSpec_LinkedView storageDrsPlacementRankVmSpec_LinkedView)\n        {\n            return (storageDrsPlacementRankVmSpec_LinkedView != null && ((this.VmClusters == null && storageDrsPlacementRankVmSpec_LinkedView.VmClusters == null) || (this.VmClusters != null && storageDrsPlacementRankVmSpec_LinkedView.VmClusters != null && Enumerable.SequenceEqual(this.VmClusters, storageDrsPlacementRankVmSpec_LinkedView.VmClusters))));\n        }\n\n        public override bool Equals(object storageDrsPlacementRankVmSpec_LinkedView)\n        {\n            return Equals(storageDrsPlacementRankVmSpec_LinkedView as StorageDrsPlacementRankVmSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmClusters).GetHashCode();\n        }\n    }\n\n    public class StorageDrsPodConfigInfo : DynamicData, IEquatable<StorageDrsPodConfigInfo>\n    {\n        public bool Enabled { get; set; }\n\n        public bool IoLoadBalanceEnabled { get; set; }\n\n        public string DefaultVmBehavior { get; set; }\n\n        public int? LoadBalanceInterval { get; set; }\n\n        public bool? DefaultIntraVmAffinity { get; set; }\n\n        public StorageDrsSpaceLoadBalanceConfig SpaceLoadBalanceConfig { get; set; }\n\n        public StorageDrsIoLoadBalanceConfig IoLoadBalanceConfig { get; set; }\n\n        public StorageDrsAutomationConfig AutomationOverrides { get; set; }\n\n        public ClusterRuleInfo[] Rule { get; set; }\n\n        public OptionValue[] Option { get; set; }\n\n        public bool Equals(StorageDrsPodConfigInfo storageDrsPodConfigInfo)\n        {\n            return (storageDrsPodConfigInfo != null && this.Enabled == storageDrsPodConfigInfo.Enabled && this.IoLoadBalanceEnabled == storageDrsPodConfigInfo.IoLoadBalanceEnabled && this.DefaultVmBehavior == storageDrsPodConfigInfo.DefaultVmBehavior && ((this.LoadBalanceInterval == null && storageDrsPodConfigInfo.LoadBalanceInterval == null) || (this.LoadBalanceInterval != null && this.LoadBalanceInterval.Equals(storageDrsPodConfigInfo.LoadBalanceInterval))) && ((this.DefaultIntraVmAffinity == null && storageDrsPodConfigInfo.DefaultIntraVmAffinity == null) || (this.DefaultIntraVmAffinity != null && this.DefaultIntraVmAffinity.Equals(storageDrsPodConfigInfo.DefaultIntraVmAffinity))) && ((this.SpaceLoadBalanceConfig == null && storageDrsPodConfigInfo.SpaceLoadBalanceConfig == null) || (this.SpaceLoadBalanceConfig != null && this.SpaceLoadBalanceConfig.Equals(storageDrsPodConfigInfo.SpaceLoadBalanceConfig))) && ((this.IoLoadBalanceConfig == null && storageDrsPodConfigInfo.IoLoadBalanceConfig == null) || (this.IoLoadBalanceConfig != null && this.IoLoadBalanceConfig.Equals(storageDrsPodConfigInfo.IoLoadBalanceConfig))) && ((this.AutomationOverrides == null && storageDrsPodConfigInfo.AutomationOverrides == null) || (this.AutomationOverrides != null && this.AutomationOverrides.Equals(storageDrsPodConfigInfo.AutomationOverrides))) && ((this.Rule == null && storageDrsPodConfigInfo.Rule == null) || (this.Rule != null && storageDrsPodConfigInfo.Rule != null && Enumerable.SequenceEqual(this.Rule, storageDrsPodConfigInfo.Rule))) && ((this.Option == null && storageDrsPodConfigInfo.Option == null) || (this.Option != null && storageDrsPodConfigInfo.Option != null && Enumerable.SequenceEqual(this.Option, storageDrsPodConfigInfo.Option))));\n        }\n\n        public override bool Equals(object storageDrsPodConfigInfo)\n        {\n            return Equals(storageDrsPodConfigInfo as StorageDrsPodConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + IoLoadBalanceEnabled + \"_\" + DefaultVmBehavior + \"_\" + LoadBalanceInterval + \"_\" + DefaultIntraVmAffinity + \"_\" + SpaceLoadBalanceConfig + \"_\" + IoLoadBalanceConfig + \"_\" + AutomationOverrides + \"_\" + Rule + \"_\" + Option).GetHashCode();\n        }\n    }\n\n    public class StorageDrsPodConfigSpec : DynamicData, IEquatable<StorageDrsPodConfigSpec>\n    {\n        public bool? Enabled { get; set; }\n\n        public bool? IoLoadBalanceEnabled { get; set; }\n\n        public string DefaultVmBehavior { get; set; }\n\n        public int? LoadBalanceInterval { get; set; }\n\n        public bool? DefaultIntraVmAffinity { get; set; }\n\n        public StorageDrsSpaceLoadBalanceConfig SpaceLoadBalanceConfig { get; set; }\n\n        public StorageDrsIoLoadBalanceConfig IoLoadBalanceConfig { get; set; }\n\n        public StorageDrsAutomationConfig AutomationOverrides { get; set; }\n\n        public ClusterRuleSpec[] Rule { get; set; }\n\n        public StorageDrsOptionSpec[] Option { get; set; }\n\n        public bool Equals(StorageDrsPodConfigSpec storageDrsPodConfigSpec)\n        {\n            return (storageDrsPodConfigSpec != null && ((this.Enabled == null && storageDrsPodConfigSpec.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(storageDrsPodConfigSpec.Enabled))) && ((this.IoLoadBalanceEnabled == null && storageDrsPodConfigSpec.IoLoadBalanceEnabled == null) || (this.IoLoadBalanceEnabled != null && this.IoLoadBalanceEnabled.Equals(storageDrsPodConfigSpec.IoLoadBalanceEnabled))) && this.DefaultVmBehavior == storageDrsPodConfigSpec.DefaultVmBehavior && ((this.LoadBalanceInterval == null && storageDrsPodConfigSpec.LoadBalanceInterval == null) || (this.LoadBalanceInterval != null && this.LoadBalanceInterval.Equals(storageDrsPodConfigSpec.LoadBalanceInterval))) && ((this.DefaultIntraVmAffinity == null && storageDrsPodConfigSpec.DefaultIntraVmAffinity == null) || (this.DefaultIntraVmAffinity != null && this.DefaultIntraVmAffinity.Equals(storageDrsPodConfigSpec.DefaultIntraVmAffinity))) && ((this.SpaceLoadBalanceConfig == null && storageDrsPodConfigSpec.SpaceLoadBalanceConfig == null) || (this.SpaceLoadBalanceConfig != null && this.SpaceLoadBalanceConfig.Equals(storageDrsPodConfigSpec.SpaceLoadBalanceConfig))) && ((this.IoLoadBalanceConfig == null && storageDrsPodConfigSpec.IoLoadBalanceConfig == null) || (this.IoLoadBalanceConfig != null && this.IoLoadBalanceConfig.Equals(storageDrsPodConfigSpec.IoLoadBalanceConfig))) && ((this.AutomationOverrides == null && storageDrsPodConfigSpec.AutomationOverrides == null) || (this.AutomationOverrides != null && this.AutomationOverrides.Equals(storageDrsPodConfigSpec.AutomationOverrides))) && ((this.Rule == null && storageDrsPodConfigSpec.Rule == null) || (this.Rule != null && storageDrsPodConfigSpec.Rule != null && Enumerable.SequenceEqual(this.Rule, storageDrsPodConfigSpec.Rule))) && ((this.Option == null && storageDrsPodConfigSpec.Option == null) || (this.Option != null && storageDrsPodConfigSpec.Option != null && Enumerable.SequenceEqual(this.Option, storageDrsPodConfigSpec.Option))));\n        }\n\n        public override bool Equals(object storageDrsPodConfigSpec)\n        {\n            return Equals(storageDrsPodConfigSpec as StorageDrsPodConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + IoLoadBalanceEnabled + \"_\" + DefaultVmBehavior + \"_\" + LoadBalanceInterval + \"_\" + DefaultIntraVmAffinity + \"_\" + SpaceLoadBalanceConfig + \"_\" + IoLoadBalanceConfig + \"_\" + AutomationOverrides + \"_\" + Rule + \"_\" + Option).GetHashCode();\n        }\n    }\n\n    public class StorageDrsPodSelectionSpec : DynamicData, IEquatable<StorageDrsPodSelectionSpec>\n    {\n        public VmPodConfigForPlacement[] InitialVmConfig { get; set; }\n\n        public ManagedObjectReference StoragePod { get; set; }\n\n        public StorageDrsPodSelectionSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageDrsPodSelectionSpec storageDrsPodSelectionSpec)\n        {\n            return (storageDrsPodSelectionSpec != null && ((this.InitialVmConfig == null && storageDrsPodSelectionSpec.InitialVmConfig == null) || (this.InitialVmConfig != null && storageDrsPodSelectionSpec.InitialVmConfig != null && Enumerable.SequenceEqual(this.InitialVmConfig, storageDrsPodSelectionSpec.InitialVmConfig))) && ((this.StoragePod == null && storageDrsPodSelectionSpec.StoragePod == null) || (this.StoragePod != null && this.StoragePod.Equals(storageDrsPodSelectionSpec.StoragePod))) && ((this.LinkedView == null && storageDrsPodSelectionSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageDrsPodSelectionSpec.LinkedView))));\n        }\n\n        public override bool Equals(object storageDrsPodSelectionSpec)\n        {\n            return Equals(storageDrsPodSelectionSpec as StorageDrsPodSelectionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InitialVmConfig + \"_\" + StoragePod + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageDrsPodSelectionSpec_LinkedView : IEquatable<StorageDrsPodSelectionSpec_LinkedView>\n    {\n        public StoragePod StoragePod { get; set; }\n\n        public bool Equals(StorageDrsPodSelectionSpec_LinkedView storageDrsPodSelectionSpec_LinkedView)\n        {\n            return (storageDrsPodSelectionSpec_LinkedView != null && ((this.StoragePod == null && storageDrsPodSelectionSpec_LinkedView.StoragePod == null) || (this.StoragePod != null && this.StoragePod.Equals(storageDrsPodSelectionSpec_LinkedView.StoragePod))));\n        }\n\n        public override bool Equals(object storageDrsPodSelectionSpec_LinkedView)\n        {\n            return Equals(storageDrsPodSelectionSpec_LinkedView as StorageDrsPodSelectionSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StoragePod).GetHashCode();\n        }\n    }\n\n    public class StorageDrsRelocateDisabled : VimFault, IEquatable<StorageDrsRelocateDisabled>\n    {\n        public bool Equals(StorageDrsRelocateDisabled storageDrsRelocateDisabled)\n        {\n            return (storageDrsRelocateDisabled != null && base.Equals(storageDrsRelocateDisabled));\n        }\n\n        public override bool Equals(object storageDrsRelocateDisabled)\n        {\n            return Equals(storageDrsRelocateDisabled as StorageDrsRelocateDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsSpaceLoadBalanceConfig : DynamicData, IEquatable<StorageDrsSpaceLoadBalanceConfig>\n    {\n        public string SpaceThresholdMode { get; set; }\n\n        public int? SpaceUtilizationThreshold { get; set; }\n\n        public int? FreeSpaceThresholdGB { get; set; }\n\n        public int? MinSpaceUtilizationDifference { get; set; }\n\n        public bool Equals(StorageDrsSpaceLoadBalanceConfig storageDrsSpaceLoadBalanceConfig)\n        {\n            return (storageDrsSpaceLoadBalanceConfig != null && this.SpaceThresholdMode == storageDrsSpaceLoadBalanceConfig.SpaceThresholdMode && ((this.SpaceUtilizationThreshold == null && storageDrsSpaceLoadBalanceConfig.SpaceUtilizationThreshold == null) || (this.SpaceUtilizationThreshold != null && this.SpaceUtilizationThreshold.Equals(storageDrsSpaceLoadBalanceConfig.SpaceUtilizationThreshold))) && ((this.FreeSpaceThresholdGB == null && storageDrsSpaceLoadBalanceConfig.FreeSpaceThresholdGB == null) || (this.FreeSpaceThresholdGB != null && this.FreeSpaceThresholdGB.Equals(storageDrsSpaceLoadBalanceConfig.FreeSpaceThresholdGB))) && ((this.MinSpaceUtilizationDifference == null && storageDrsSpaceLoadBalanceConfig.MinSpaceUtilizationDifference == null) || (this.MinSpaceUtilizationDifference != null && this.MinSpaceUtilizationDifference.Equals(storageDrsSpaceLoadBalanceConfig.MinSpaceUtilizationDifference))));\n        }\n\n        public override bool Equals(object storageDrsSpaceLoadBalanceConfig)\n        {\n            return Equals(storageDrsSpaceLoadBalanceConfig as StorageDrsSpaceLoadBalanceConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SpaceThresholdMode + \"_\" + SpaceUtilizationThreshold + \"_\" + FreeSpaceThresholdGB + \"_\" + MinSpaceUtilizationDifference).GetHashCode();\n        }\n    }\n\n    public class StorageDrsStaleHmsCollection : VimFault, IEquatable<StorageDrsStaleHmsCollection>\n    {\n        public bool Equals(StorageDrsStaleHmsCollection storageDrsStaleHmsCollection)\n        {\n            return (storageDrsStaleHmsCollection != null && base.Equals(storageDrsStaleHmsCollection));\n        }\n\n        public override bool Equals(object storageDrsStaleHmsCollection)\n        {\n            return Equals(storageDrsStaleHmsCollection as StorageDrsStaleHmsCollection);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsUnableToMoveFiles : VimFault, IEquatable<StorageDrsUnableToMoveFiles>\n    {\n        public bool Equals(StorageDrsUnableToMoveFiles storageDrsUnableToMoveFiles)\n        {\n            return (storageDrsUnableToMoveFiles != null && base.Equals(storageDrsUnableToMoveFiles));\n        }\n\n        public override bool Equals(object storageDrsUnableToMoveFiles)\n        {\n            return Equals(storageDrsUnableToMoveFiles as StorageDrsUnableToMoveFiles);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageDrsVmConfigInfo : DynamicData, IEquatable<StorageDrsVmConfigInfo>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public bool? Enabled { get; set; }\n\n        public string Behavior { get; set; }\n\n        public bool? IntraVmAffinity { get; set; }\n\n        public VirtualDiskAntiAffinityRuleSpec IntraVmAntiAffinity { get; set; }\n\n        public VirtualDiskRuleSpec[] VirtualDiskRules { get; set; }\n\n        public StorageDrsVmConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageDrsVmConfigInfo storageDrsVmConfigInfo)\n        {\n            return (storageDrsVmConfigInfo != null && ((this.Vm == null && storageDrsVmConfigInfo.Vm == null) || (this.Vm != null && this.Vm.Equals(storageDrsVmConfigInfo.Vm))) && ((this.Enabled == null && storageDrsVmConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(storageDrsVmConfigInfo.Enabled))) && this.Behavior == storageDrsVmConfigInfo.Behavior && ((this.IntraVmAffinity == null && storageDrsVmConfigInfo.IntraVmAffinity == null) || (this.IntraVmAffinity != null && this.IntraVmAffinity.Equals(storageDrsVmConfigInfo.IntraVmAffinity))) && ((this.IntraVmAntiAffinity == null && storageDrsVmConfigInfo.IntraVmAntiAffinity == null) || (this.IntraVmAntiAffinity != null && this.IntraVmAntiAffinity.Equals(storageDrsVmConfigInfo.IntraVmAntiAffinity))) && ((this.VirtualDiskRules == null && storageDrsVmConfigInfo.VirtualDiskRules == null) || (this.VirtualDiskRules != null && storageDrsVmConfigInfo.VirtualDiskRules != null && Enumerable.SequenceEqual(this.VirtualDiskRules, storageDrsVmConfigInfo.VirtualDiskRules))) && ((this.LinkedView == null && storageDrsVmConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageDrsVmConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object storageDrsVmConfigInfo)\n        {\n            return Equals(storageDrsVmConfigInfo as StorageDrsVmConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Enabled + \"_\" + Behavior + \"_\" + IntraVmAffinity + \"_\" + IntraVmAntiAffinity + \"_\" + VirtualDiskRules + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageDrsVmConfigInfo_LinkedView : IEquatable<StorageDrsVmConfigInfo_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(StorageDrsVmConfigInfo_LinkedView storageDrsVmConfigInfo_LinkedView)\n        {\n            return (storageDrsVmConfigInfo_LinkedView != null && ((this.Vm == null && storageDrsVmConfigInfo_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(storageDrsVmConfigInfo_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object storageDrsVmConfigInfo_LinkedView)\n        {\n            return Equals(storageDrsVmConfigInfo_LinkedView as StorageDrsVmConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class StorageDrsVmConfigSpec : ArrayUpdateSpec, IEquatable<StorageDrsVmConfigSpec>\n    {\n        public StorageDrsVmConfigInfo Info { get; set; }\n\n        public bool Equals(StorageDrsVmConfigSpec storageDrsVmConfigSpec)\n        {\n            return (storageDrsVmConfigSpec != null && ((this.Info == null && storageDrsVmConfigSpec.Info == null) || (this.Info != null && this.Info.Equals(storageDrsVmConfigSpec.Info))));\n        }\n\n        public override bool Equals(object storageDrsVmConfigSpec)\n        {\n            return Equals(storageDrsVmConfigSpec as StorageDrsVmConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class StorageIOAllocationInfo : DynamicData, IEquatable<StorageIOAllocationInfo>\n    {\n        public long? Limit { get; set; }\n\n        public SharesInfo Shares { get; set; }\n\n        public int? Reservation { get; set; }\n\n        public bool Equals(StorageIOAllocationInfo storageIOAllocationInfo)\n        {\n            return (storageIOAllocationInfo != null && ((this.Limit == null && storageIOAllocationInfo.Limit == null) || (this.Limit != null && this.Limit.Equals(storageIOAllocationInfo.Limit))) && ((this.Shares == null && storageIOAllocationInfo.Shares == null) || (this.Shares != null && this.Shares.Equals(storageIOAllocationInfo.Shares))) && ((this.Reservation == null && storageIOAllocationInfo.Reservation == null) || (this.Reservation != null && this.Reservation.Equals(storageIOAllocationInfo.Reservation))));\n        }\n\n        public override bool Equals(object storageIOAllocationInfo)\n        {\n            return Equals(storageIOAllocationInfo as StorageIOAllocationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Limit + \"_\" + Shares + \"_\" + Reservation).GetHashCode();\n        }\n    }\n\n    public class StorageIOAllocationOption : DynamicData, IEquatable<StorageIOAllocationOption>\n    {\n        public LongOption LimitOption { get; set; }\n\n        public SharesOption SharesOption { get; set; }\n\n        public bool Equals(StorageIOAllocationOption storageIOAllocationOption)\n        {\n            return (storageIOAllocationOption != null && ((this.LimitOption == null && storageIOAllocationOption.LimitOption == null) || (this.LimitOption != null && this.LimitOption.Equals(storageIOAllocationOption.LimitOption))) && ((this.SharesOption == null && storageIOAllocationOption.SharesOption == null) || (this.SharesOption != null && this.SharesOption.Equals(storageIOAllocationOption.SharesOption))));\n        }\n\n        public override bool Equals(object storageIOAllocationOption)\n        {\n            return Equals(storageIOAllocationOption as StorageIOAllocationOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LimitOption + \"_\" + SharesOption).GetHashCode();\n        }\n    }\n\n    public class StorageIORMConfigOption : DynamicData, IEquatable<StorageIORMConfigOption>\n    {\n        public BoolOption EnabledOption { get; set; }\n\n        public IntOption CongestionThresholdOption { get; set; }\n\n        public BoolOption StatsCollectionEnabledOption { get; set; }\n\n        public BoolOption ReservationEnabledOption { get; set; }\n\n        public bool Equals(StorageIORMConfigOption storageIORMConfigOption)\n        {\n            return (storageIORMConfigOption != null && ((this.EnabledOption == null && storageIORMConfigOption.EnabledOption == null) || (this.EnabledOption != null && this.EnabledOption.Equals(storageIORMConfigOption.EnabledOption))) && ((this.CongestionThresholdOption == null && storageIORMConfigOption.CongestionThresholdOption == null) || (this.CongestionThresholdOption != null && this.CongestionThresholdOption.Equals(storageIORMConfigOption.CongestionThresholdOption))) && ((this.StatsCollectionEnabledOption == null && storageIORMConfigOption.StatsCollectionEnabledOption == null) || (this.StatsCollectionEnabledOption != null && this.StatsCollectionEnabledOption.Equals(storageIORMConfigOption.StatsCollectionEnabledOption))) && ((this.ReservationEnabledOption == null && storageIORMConfigOption.ReservationEnabledOption == null) || (this.ReservationEnabledOption != null && this.ReservationEnabledOption.Equals(storageIORMConfigOption.ReservationEnabledOption))));\n        }\n\n        public override bool Equals(object storageIORMConfigOption)\n        {\n            return Equals(storageIORMConfigOption as StorageIORMConfigOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EnabledOption + \"_\" + CongestionThresholdOption + \"_\" + StatsCollectionEnabledOption + \"_\" + ReservationEnabledOption).GetHashCode();\n        }\n    }\n\n    public class StorageIORMConfigSpec : DynamicData, IEquatable<StorageIORMConfigSpec>\n    {\n        public bool? Enabled { get; set; }\n\n        public string CongestionThresholdMode { get; set; }\n\n        public int? CongestionThreshold { get; set; }\n\n        public int? PercentOfPeakThroughput { get; set; }\n\n        public bool? StatsCollectionEnabled { get; set; }\n\n        public bool? ReservationEnabled { get; set; }\n\n        public bool? StatsAggregationDisabled { get; set; }\n\n        public int? ReservableIopsThreshold { get; set; }\n\n        public bool Equals(StorageIORMConfigSpec storageIORMConfigSpec)\n        {\n            return (storageIORMConfigSpec != null && ((this.Enabled == null && storageIORMConfigSpec.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(storageIORMConfigSpec.Enabled))) && this.CongestionThresholdMode == storageIORMConfigSpec.CongestionThresholdMode && ((this.CongestionThreshold == null && storageIORMConfigSpec.CongestionThreshold == null) || (this.CongestionThreshold != null && this.CongestionThreshold.Equals(storageIORMConfigSpec.CongestionThreshold))) && ((this.PercentOfPeakThroughput == null && storageIORMConfigSpec.PercentOfPeakThroughput == null) || (this.PercentOfPeakThroughput != null && this.PercentOfPeakThroughput.Equals(storageIORMConfigSpec.PercentOfPeakThroughput))) && ((this.StatsCollectionEnabled == null && storageIORMConfigSpec.StatsCollectionEnabled == null) || (this.StatsCollectionEnabled != null && this.StatsCollectionEnabled.Equals(storageIORMConfigSpec.StatsCollectionEnabled))) && ((this.ReservationEnabled == null && storageIORMConfigSpec.ReservationEnabled == null) || (this.ReservationEnabled != null && this.ReservationEnabled.Equals(storageIORMConfigSpec.ReservationEnabled))) && ((this.StatsAggregationDisabled == null && storageIORMConfigSpec.StatsAggregationDisabled == null) || (this.StatsAggregationDisabled != null && this.StatsAggregationDisabled.Equals(storageIORMConfigSpec.StatsAggregationDisabled))) && ((this.ReservableIopsThreshold == null && storageIORMConfigSpec.ReservableIopsThreshold == null) || (this.ReservableIopsThreshold != null && this.ReservableIopsThreshold.Equals(storageIORMConfigSpec.ReservableIopsThreshold))));\n        }\n\n        public override bool Equals(object storageIORMConfigSpec)\n        {\n            return Equals(storageIORMConfigSpec as StorageIORMConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + CongestionThresholdMode + \"_\" + CongestionThreshold + \"_\" + PercentOfPeakThroughput + \"_\" + StatsCollectionEnabled + \"_\" + ReservationEnabled + \"_\" + StatsAggregationDisabled + \"_\" + ReservableIopsThreshold).GetHashCode();\n        }\n    }\n\n    public class StorageIORMInfo : DynamicData, IEquatable<StorageIORMInfo>\n    {\n        public bool Enabled { get; set; }\n\n        public string CongestionThresholdMode { get; set; }\n\n        public int CongestionThreshold { get; set; }\n\n        public int? PercentOfPeakThroughput { get; set; }\n\n        public bool StatsCollectionEnabled { get; set; }\n\n        public bool ReservationEnabled { get; set; }\n\n        public bool? StatsAggregationDisabled { get; set; }\n\n        public int? ReservableIopsThreshold { get; set; }\n\n        public bool Equals(StorageIORMInfo storageIORMInfo)\n        {\n            return (storageIORMInfo != null && this.Enabled == storageIORMInfo.Enabled && this.CongestionThresholdMode == storageIORMInfo.CongestionThresholdMode && this.CongestionThreshold == storageIORMInfo.CongestionThreshold && ((this.PercentOfPeakThroughput == null && storageIORMInfo.PercentOfPeakThroughput == null) || (this.PercentOfPeakThroughput != null && this.PercentOfPeakThroughput.Equals(storageIORMInfo.PercentOfPeakThroughput))) && this.StatsCollectionEnabled == storageIORMInfo.StatsCollectionEnabled && this.ReservationEnabled == storageIORMInfo.ReservationEnabled && ((this.StatsAggregationDisabled == null && storageIORMInfo.StatsAggregationDisabled == null) || (this.StatsAggregationDisabled != null && this.StatsAggregationDisabled.Equals(storageIORMInfo.StatsAggregationDisabled))) && ((this.ReservableIopsThreshold == null && storageIORMInfo.ReservableIopsThreshold == null) || (this.ReservableIopsThreshold != null && this.ReservableIopsThreshold.Equals(storageIORMInfo.ReservableIopsThreshold))));\n        }\n\n        public override bool Equals(object storageIORMInfo)\n        {\n            return Equals(storageIORMInfo as StorageIORMInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + CongestionThresholdMode + \"_\" + CongestionThreshold + \"_\" + PercentOfPeakThroughput + \"_\" + StatsCollectionEnabled + \"_\" + ReservationEnabled + \"_\" + StatsAggregationDisabled + \"_\" + ReservableIopsThreshold).GetHashCode();\n        }\n    }\n\n    public class StorageMigrationAction : ClusterAction, IEquatable<StorageMigrationAction>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public VirtualMachineRelocateSpec RelocateSpec { get; set; }\n\n        public ManagedObjectReference Source { get; set; }\n\n        public ManagedObjectReference Destination { get; set; }\n\n        public long SizeTransferred { get; set; }\n\n        public float? SpaceUtilSrcBefore { get; set; }\n\n        public float? SpaceUtilDstBefore { get; set; }\n\n        public float? SpaceUtilSrcAfter { get; set; }\n\n        public float? SpaceUtilDstAfter { get; set; }\n\n        public float? IoLatencySrcBefore { get; set; }\n\n        public float? IoLatencyDstBefore { get; set; }\n\n        public StorageMigrationAction_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageMigrationAction storageMigrationAction)\n        {\n            return (storageMigrationAction != null && ((this.Vm == null && storageMigrationAction.Vm == null) || (this.Vm != null && this.Vm.Equals(storageMigrationAction.Vm))) && ((this.RelocateSpec == null && storageMigrationAction.RelocateSpec == null) || (this.RelocateSpec != null && this.RelocateSpec.Equals(storageMigrationAction.RelocateSpec))) && ((this.Source == null && storageMigrationAction.Source == null) || (this.Source != null && this.Source.Equals(storageMigrationAction.Source))) && ((this.Destination == null && storageMigrationAction.Destination == null) || (this.Destination != null && this.Destination.Equals(storageMigrationAction.Destination))) && this.SizeTransferred == storageMigrationAction.SizeTransferred && ((this.SpaceUtilSrcBefore == null && storageMigrationAction.SpaceUtilSrcBefore == null) || (this.SpaceUtilSrcBefore != null && this.SpaceUtilSrcBefore.Equals(storageMigrationAction.SpaceUtilSrcBefore))) && ((this.SpaceUtilDstBefore == null && storageMigrationAction.SpaceUtilDstBefore == null) || (this.SpaceUtilDstBefore != null && this.SpaceUtilDstBefore.Equals(storageMigrationAction.SpaceUtilDstBefore))) && ((this.SpaceUtilSrcAfter == null && storageMigrationAction.SpaceUtilSrcAfter == null) || (this.SpaceUtilSrcAfter != null && this.SpaceUtilSrcAfter.Equals(storageMigrationAction.SpaceUtilSrcAfter))) && ((this.SpaceUtilDstAfter == null && storageMigrationAction.SpaceUtilDstAfter == null) || (this.SpaceUtilDstAfter != null && this.SpaceUtilDstAfter.Equals(storageMigrationAction.SpaceUtilDstAfter))) && ((this.IoLatencySrcBefore == null && storageMigrationAction.IoLatencySrcBefore == null) || (this.IoLatencySrcBefore != null && this.IoLatencySrcBefore.Equals(storageMigrationAction.IoLatencySrcBefore))) && ((this.IoLatencyDstBefore == null && storageMigrationAction.IoLatencyDstBefore == null) || (this.IoLatencyDstBefore != null && this.IoLatencyDstBefore.Equals(storageMigrationAction.IoLatencyDstBefore))) && ((this.LinkedView == null && storageMigrationAction.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageMigrationAction.LinkedView))));\n        }\n\n        public override bool Equals(object storageMigrationAction)\n        {\n            return Equals(storageMigrationAction as StorageMigrationAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + RelocateSpec + \"_\" + Source + \"_\" + Destination + \"_\" + SizeTransferred + \"_\" + SpaceUtilSrcBefore + \"_\" + SpaceUtilDstBefore + \"_\" + SpaceUtilSrcAfter + \"_\" + SpaceUtilDstAfter + \"_\" + IoLatencySrcBefore + \"_\" + IoLatencyDstBefore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageMigrationAction_LinkedView : IEquatable<StorageMigrationAction_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public Datastore Source { get; set; }\n\n        public Datastore Destination { get; set; }\n\n        public bool Equals(StorageMigrationAction_LinkedView storageMigrationAction_LinkedView)\n        {\n            return (storageMigrationAction_LinkedView != null && ((this.Vm == null && storageMigrationAction_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(storageMigrationAction_LinkedView.Vm))) && ((this.Source == null && storageMigrationAction_LinkedView.Source == null) || (this.Source != null && this.Source.Equals(storageMigrationAction_LinkedView.Source))) && ((this.Destination == null && storageMigrationAction_LinkedView.Destination == null) || (this.Destination != null && this.Destination.Equals(storageMigrationAction_LinkedView.Destination))));\n        }\n\n        public override bool Equals(object storageMigrationAction_LinkedView)\n        {\n            return Equals(storageMigrationAction_LinkedView as StorageMigrationAction_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Source + \"_\" + Destination).GetHashCode();\n        }\n    }\n\n    public class StoragePerformanceSummary : DynamicData, IEquatable<StoragePerformanceSummary>\n    {\n        public int Interval { get; set; }\n\n        public int[] Percentile { get; set; }\n\n        public double[] DatastoreReadLatency { get; set; }\n\n        public double[] DatastoreWriteLatency { get; set; }\n\n        public double[] DatastoreVmLatency { get; set; }\n\n        public double[] DatastoreReadIops { get; set; }\n\n        public double[] DatastoreWriteIops { get; set; }\n\n        public int SiocActivityDuration { get; set; }\n\n        public bool Equals(StoragePerformanceSummary storagePerformanceSummary)\n        {\n            return (storagePerformanceSummary != null && this.Interval == storagePerformanceSummary.Interval && ((this.Percentile == null && storagePerformanceSummary.Percentile == null) || (this.Percentile != null && storagePerformanceSummary.Percentile != null && Enumerable.SequenceEqual(this.Percentile, storagePerformanceSummary.Percentile))) && ((this.DatastoreReadLatency == null && storagePerformanceSummary.DatastoreReadLatency == null) || (this.DatastoreReadLatency != null && storagePerformanceSummary.DatastoreReadLatency != null && Enumerable.SequenceEqual(this.DatastoreReadLatency, storagePerformanceSummary.DatastoreReadLatency))) && ((this.DatastoreWriteLatency == null && storagePerformanceSummary.DatastoreWriteLatency == null) || (this.DatastoreWriteLatency != null && storagePerformanceSummary.DatastoreWriteLatency != null && Enumerable.SequenceEqual(this.DatastoreWriteLatency, storagePerformanceSummary.DatastoreWriteLatency))) && ((this.DatastoreVmLatency == null && storagePerformanceSummary.DatastoreVmLatency == null) || (this.DatastoreVmLatency != null && storagePerformanceSummary.DatastoreVmLatency != null && Enumerable.SequenceEqual(this.DatastoreVmLatency, storagePerformanceSummary.DatastoreVmLatency))) && ((this.DatastoreReadIops == null && storagePerformanceSummary.DatastoreReadIops == null) || (this.DatastoreReadIops != null && storagePerformanceSummary.DatastoreReadIops != null && Enumerable.SequenceEqual(this.DatastoreReadIops, storagePerformanceSummary.DatastoreReadIops))) && ((this.DatastoreWriteIops == null && storagePerformanceSummary.DatastoreWriteIops == null) || (this.DatastoreWriteIops != null && storagePerformanceSummary.DatastoreWriteIops != null && Enumerable.SequenceEqual(this.DatastoreWriteIops, storagePerformanceSummary.DatastoreWriteIops))) && this.SiocActivityDuration == storagePerformanceSummary.SiocActivityDuration);\n        }\n\n        public override bool Equals(object storagePerformanceSummary)\n        {\n            return Equals(storagePerformanceSummary as StoragePerformanceSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Interval + \"_\" + Percentile + \"_\" + DatastoreReadLatency + \"_\" + DatastoreWriteLatency + \"_\" + DatastoreVmLatency + \"_\" + DatastoreReadIops + \"_\" + DatastoreWriteIops + \"_\" + SiocActivityDuration).GetHashCode();\n        }\n    }\n\n    public class StoragePlacementAction : ClusterAction, IEquatable<StoragePlacementAction>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public VirtualMachineRelocateSpec RelocateSpec { get; set; }\n\n        public ManagedObjectReference Destination { get; set; }\n\n        public float? SpaceUtilBefore { get; set; }\n\n        public float? SpaceDemandBefore { get; set; }\n\n        public float? SpaceUtilAfter { get; set; }\n\n        public float? SpaceDemandAfter { get; set; }\n\n        public float? IoLatencyBefore { get; set; }\n\n        public StoragePlacementAction_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StoragePlacementAction storagePlacementAction)\n        {\n            return (storagePlacementAction != null && ((this.Vm == null && storagePlacementAction.Vm == null) || (this.Vm != null && this.Vm.Equals(storagePlacementAction.Vm))) && ((this.RelocateSpec == null && storagePlacementAction.RelocateSpec == null) || (this.RelocateSpec != null && this.RelocateSpec.Equals(storagePlacementAction.RelocateSpec))) && ((this.Destination == null && storagePlacementAction.Destination == null) || (this.Destination != null && this.Destination.Equals(storagePlacementAction.Destination))) && ((this.SpaceUtilBefore == null && storagePlacementAction.SpaceUtilBefore == null) || (this.SpaceUtilBefore != null && this.SpaceUtilBefore.Equals(storagePlacementAction.SpaceUtilBefore))) && ((this.SpaceDemandBefore == null && storagePlacementAction.SpaceDemandBefore == null) || (this.SpaceDemandBefore != null && this.SpaceDemandBefore.Equals(storagePlacementAction.SpaceDemandBefore))) && ((this.SpaceUtilAfter == null && storagePlacementAction.SpaceUtilAfter == null) || (this.SpaceUtilAfter != null && this.SpaceUtilAfter.Equals(storagePlacementAction.SpaceUtilAfter))) && ((this.SpaceDemandAfter == null && storagePlacementAction.SpaceDemandAfter == null) || (this.SpaceDemandAfter != null && this.SpaceDemandAfter.Equals(storagePlacementAction.SpaceDemandAfter))) && ((this.IoLatencyBefore == null && storagePlacementAction.IoLatencyBefore == null) || (this.IoLatencyBefore != null && this.IoLatencyBefore.Equals(storagePlacementAction.IoLatencyBefore))) && ((this.LinkedView == null && storagePlacementAction.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storagePlacementAction.LinkedView))));\n        }\n\n        public override bool Equals(object storagePlacementAction)\n        {\n            return Equals(storagePlacementAction as StoragePlacementAction);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + RelocateSpec + \"_\" + Destination + \"_\" + SpaceUtilBefore + \"_\" + SpaceDemandBefore + \"_\" + SpaceUtilAfter + \"_\" + SpaceDemandAfter + \"_\" + IoLatencyBefore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StoragePlacementAction_LinkedView : IEquatable<StoragePlacementAction_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public Datastore Destination { get; set; }\n\n        public bool Equals(StoragePlacementAction_LinkedView storagePlacementAction_LinkedView)\n        {\n            return (storagePlacementAction_LinkedView != null && ((this.Vm == null && storagePlacementAction_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(storagePlacementAction_LinkedView.Vm))) && ((this.Destination == null && storagePlacementAction_LinkedView.Destination == null) || (this.Destination != null && this.Destination.Equals(storagePlacementAction_LinkedView.Destination))));\n        }\n\n        public override bool Equals(object storagePlacementAction_LinkedView)\n        {\n            return Equals(storagePlacementAction_LinkedView as StoragePlacementAction_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Destination).GetHashCode();\n        }\n    }\n\n    public class StoragePlacementResult : DynamicData, IEquatable<StoragePlacementResult>\n    {\n        public ClusterRecommendation[] Recommendations { get; set; }\n\n        public ClusterDrsFaults DrsFault { get; set; }\n\n        public ManagedObjectReference Task { get; set; }\n\n        public StoragePlacementResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StoragePlacementResult storagePlacementResult)\n        {\n            return (storagePlacementResult != null && ((this.Recommendations == null && storagePlacementResult.Recommendations == null) || (this.Recommendations != null && storagePlacementResult.Recommendations != null && Enumerable.SequenceEqual(this.Recommendations, storagePlacementResult.Recommendations))) && ((this.DrsFault == null && storagePlacementResult.DrsFault == null) || (this.DrsFault != null && this.DrsFault.Equals(storagePlacementResult.DrsFault))) && ((this.Task == null && storagePlacementResult.Task == null) || (this.Task != null && this.Task.Equals(storagePlacementResult.Task))) && ((this.LinkedView == null && storagePlacementResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storagePlacementResult.LinkedView))));\n        }\n\n        public override bool Equals(object storagePlacementResult)\n        {\n            return Equals(storagePlacementResult as StoragePlacementResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Recommendations + \"_\" + DrsFault + \"_\" + Task + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StoragePlacementResult_LinkedView : IEquatable<StoragePlacementResult_LinkedView>\n    {\n        public Task Task { get; set; }\n\n        public bool Equals(StoragePlacementResult_LinkedView storagePlacementResult_LinkedView)\n        {\n            return (storagePlacementResult_LinkedView != null && ((this.Task == null && storagePlacementResult_LinkedView.Task == null) || (this.Task != null && this.Task.Equals(storagePlacementResult_LinkedView.Task))));\n        }\n\n        public override bool Equals(object storagePlacementResult_LinkedView)\n        {\n            return Equals(storagePlacementResult_LinkedView as StoragePlacementResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Task).GetHashCode();\n        }\n    }\n\n    public class StoragePlacementSpec : DynamicData, IEquatable<StoragePlacementSpec>\n    {\n        public string Type { get; set; }\n\n        public VirtualMachineMovePriority? Priority { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public StorageDrsPodSelectionSpec PodSelectionSpec { get; set; }\n\n        public VirtualMachineCloneSpec CloneSpec { get; set; }\n\n        public string CloneName { get; set; }\n\n        public VirtualMachineConfigSpec ConfigSpec { get; set; }\n\n        public VirtualMachineRelocateSpec RelocateSpec { get; set; }\n\n        public ManagedObjectReference ResourcePool { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public ManagedObjectReference Folder { get; set; }\n\n        public bool? DisallowPrerequisiteMoves { get; set; }\n\n        public int? ResourceLeaseDurationSec { get; set; }\n\n        public StoragePlacementSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StoragePlacementSpec storagePlacementSpec)\n        {\n            return (storagePlacementSpec != null && this.Type == storagePlacementSpec.Type && ((this.Priority == null && storagePlacementSpec.Priority == null) || (this.Priority != null && this.Priority.Equals(storagePlacementSpec.Priority))) && ((this.Vm == null && storagePlacementSpec.Vm == null) || (this.Vm != null && this.Vm.Equals(storagePlacementSpec.Vm))) && ((this.PodSelectionSpec == null && storagePlacementSpec.PodSelectionSpec == null) || (this.PodSelectionSpec != null && this.PodSelectionSpec.Equals(storagePlacementSpec.PodSelectionSpec))) && ((this.CloneSpec == null && storagePlacementSpec.CloneSpec == null) || (this.CloneSpec != null && this.CloneSpec.Equals(storagePlacementSpec.CloneSpec))) && this.CloneName == storagePlacementSpec.CloneName && ((this.ConfigSpec == null && storagePlacementSpec.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(storagePlacementSpec.ConfigSpec))) && ((this.RelocateSpec == null && storagePlacementSpec.RelocateSpec == null) || (this.RelocateSpec != null && this.RelocateSpec.Equals(storagePlacementSpec.RelocateSpec))) && ((this.ResourcePool == null && storagePlacementSpec.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(storagePlacementSpec.ResourcePool))) && ((this.Host == null && storagePlacementSpec.Host == null) || (this.Host != null && this.Host.Equals(storagePlacementSpec.Host))) && ((this.Folder == null && storagePlacementSpec.Folder == null) || (this.Folder != null && this.Folder.Equals(storagePlacementSpec.Folder))) && ((this.DisallowPrerequisiteMoves == null && storagePlacementSpec.DisallowPrerequisiteMoves == null) || (this.DisallowPrerequisiteMoves != null && this.DisallowPrerequisiteMoves.Equals(storagePlacementSpec.DisallowPrerequisiteMoves))) && ((this.ResourceLeaseDurationSec == null && storagePlacementSpec.ResourceLeaseDurationSec == null) || (this.ResourceLeaseDurationSec != null && this.ResourceLeaseDurationSec.Equals(storagePlacementSpec.ResourceLeaseDurationSec))) && ((this.LinkedView == null && storagePlacementSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storagePlacementSpec.LinkedView))));\n        }\n\n        public override bool Equals(object storagePlacementSpec)\n        {\n            return Equals(storagePlacementSpec as StoragePlacementSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Priority + \"_\" + Vm + \"_\" + PodSelectionSpec + \"_\" + CloneSpec + \"_\" + CloneName + \"_\" + ConfigSpec + \"_\" + RelocateSpec + \"_\" + ResourcePool + \"_\" + Host + \"_\" + Folder + \"_\" + DisallowPrerequisiteMoves + \"_\" + ResourceLeaseDurationSec + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StoragePlacementSpec_LinkedView : IEquatable<StoragePlacementSpec_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public ResourcePool ResourcePool { get; set; }\n\n        public HostSystem Host { get; set; }\n\n        public Folder Folder { get; set; }\n\n        public bool Equals(StoragePlacementSpec_LinkedView storagePlacementSpec_LinkedView)\n        {\n            return (storagePlacementSpec_LinkedView != null && ((this.Vm == null && storagePlacementSpec_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(storagePlacementSpec_LinkedView.Vm))) && ((this.ResourcePool == null && storagePlacementSpec_LinkedView.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(storagePlacementSpec_LinkedView.ResourcePool))) && ((this.Host == null && storagePlacementSpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(storagePlacementSpec_LinkedView.Host))) && ((this.Folder == null && storagePlacementSpec_LinkedView.Folder == null) || (this.Folder != null && this.Folder.Equals(storagePlacementSpec_LinkedView.Folder))));\n        }\n\n        public override bool Equals(object storagePlacementSpec_LinkedView)\n        {\n            return Equals(storagePlacementSpec_LinkedView as StoragePlacementSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + ResourcePool + \"_\" + Host + \"_\" + Folder).GetHashCode();\n        }\n    }\n\n    public class StoragePod : Folder, IEquatable<StoragePod>\n    {\n        public StoragePodSummary Summary { get; set; }\n\n        public PodStorageDrsEntry PodStorageDrsEntry { get; set; }\n\n        public new StoragePod_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StoragePod storagePod)\n        {\n            return (storagePod != null && ((this.Summary == null && storagePod.Summary == null) || (this.Summary != null && this.Summary.Equals(storagePod.Summary))) && ((this.PodStorageDrsEntry == null && storagePod.PodStorageDrsEntry == null) || (this.PodStorageDrsEntry != null && this.PodStorageDrsEntry.Equals(storagePod.PodStorageDrsEntry))) && ((this.LinkedView == null && storagePod.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storagePod.LinkedView))));\n        }\n\n        public override bool Equals(object storagePod)\n        {\n            return Equals(storagePod as StoragePod);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Summary + \"_\" + PodStorageDrsEntry + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StoragePod_LinkedView : Folder_LinkedView, IEquatable<StoragePod_LinkedView>\n    {\n        public bool Equals(StoragePod_LinkedView storagePod_LinkedView)\n        {\n            return (storagePod_LinkedView != null && base.Equals(storagePod_LinkedView));\n        }\n\n        public override bool Equals(object storagePod_LinkedView)\n        {\n            return Equals(storagePod_LinkedView as StoragePod_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StoragePodSummary : DynamicData, IEquatable<StoragePodSummary>\n    {\n        public string Name { get; set; }\n\n        public long Capacity { get; set; }\n\n        public long FreeSpace { get; set; }\n\n        public bool Equals(StoragePodSummary storagePodSummary)\n        {\n            return (storagePodSummary != null && this.Name == storagePodSummary.Name && this.Capacity == storagePodSummary.Capacity && this.FreeSpace == storagePodSummary.FreeSpace);\n        }\n\n        public override bool Equals(object storagePodSummary)\n        {\n            return Equals(storagePodSummary as StoragePodSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Capacity + \"_\" + FreeSpace).GetHashCode();\n        }\n    }\n\n    public class StorageProfile : ApplyProfile, IEquatable<StorageProfile>\n    {\n        public NasStorageProfile[] NasStorage { get; set; }\n\n        public bool Equals(StorageProfile storageProfile)\n        {\n            return (storageProfile != null && ((this.NasStorage == null && storageProfile.NasStorage == null) || (this.NasStorage != null && storageProfile.NasStorage != null && Enumerable.SequenceEqual(this.NasStorage, storageProfile.NasStorage))));\n        }\n\n        public override bool Equals(object storageProfile)\n        {\n            return Equals(storageProfile as StorageProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NasStorage).GetHashCode();\n        }\n    }\n\n    public class StorageRequirement : DynamicData, IEquatable<StorageRequirement>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public long FreeSpaceRequiredInKb { get; set; }\n\n        public StorageRequirement_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageRequirement storageRequirement)\n        {\n            return (storageRequirement != null && ((this.Datastore == null && storageRequirement.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(storageRequirement.Datastore))) && this.FreeSpaceRequiredInKb == storageRequirement.FreeSpaceRequiredInKb && ((this.LinkedView == null && storageRequirement.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageRequirement.LinkedView))));\n        }\n\n        public override bool Equals(object storageRequirement)\n        {\n            return Equals(storageRequirement as StorageRequirement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + FreeSpaceRequiredInKb + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageRequirement_LinkedView : IEquatable<StorageRequirement_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(StorageRequirement_LinkedView storageRequirement_LinkedView)\n        {\n            return (storageRequirement_LinkedView != null && ((this.Datastore == null && storageRequirement_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(storageRequirement_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object storageRequirement_LinkedView)\n        {\n            return Equals(storageRequirement_LinkedView as StorageRequirement_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class StorageResourceManager : ViewBase, IEquatable<StorageResourceManager>\n    {\n        public ManagedObjectReference ConfigureDatastoreIORM_Task(ManagedObjectReference datastore, StorageIORMConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ConfigureDatastoreIORM(ManagedObjectReference datastore, StorageIORMConfigSpec spec)\n        {\n        }\n\n        public StorageIORMConfigOption QueryIORMConfigOption(ManagedObjectReference host)\n        {\n            return default(StorageIORMConfigOption);\n        }\n\n        public StoragePerformanceSummary[] QueryDatastorePerformanceSummary(ManagedObjectReference datastore)\n        {\n            return default(StoragePerformanceSummary[]);\n        }\n\n        public ManagedObjectReference ApplyStorageDrsRecommendationToPod_Task(ManagedObjectReference pod, string key)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ApplyStorageRecommendationResult ApplyStorageDrsRecommendationToPod(ManagedObjectReference pod, string key)\n        {\n            return default(ApplyStorageRecommendationResult);\n        }\n\n        public ManagedObjectReference ApplyStorageDrsRecommendation_Task(string[] key)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ApplyStorageRecommendationResult ApplyStorageDrsRecommendation(string[] key)\n        {\n            return default(ApplyStorageRecommendationResult);\n        }\n\n        public void CancelStorageDrsRecommendation(string[] key)\n        {\n        }\n\n        public void RefreshStorageDrsRecommendation(ManagedObjectReference pod)\n        {\n        }\n\n        public ManagedObjectReference RefreshStorageDrsRecommendationsForPod_Task(ManagedObjectReference pod)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RefreshStorageDrsRecommendationsForPod(ManagedObjectReference pod)\n        {\n        }\n\n        public ManagedObjectReference ConfigureStorageDrsForPod_Task(ManagedObjectReference pod, StorageDrsConfigSpec spec, bool modify)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ConfigureStorageDrsForPod(ManagedObjectReference pod, StorageDrsConfigSpec spec, bool modify)\n        {\n        }\n\n        public LocalizedMethodFault ValidateStoragePodConfig(ManagedObjectReference pod, StorageDrsConfigSpec spec)\n        {\n            return default(LocalizedMethodFault);\n        }\n\n        public StoragePlacementResult RecommendDatastores(StoragePlacementSpec storageSpec)\n        {\n            return default(StoragePlacementResult);\n        }\n\n        public bool Equals(StorageResourceManager storageResourceManager)\n        {\n            return (storageResourceManager != null && base.Equals(storageResourceManager));\n        }\n\n        public override bool Equals(object storageResourceManager)\n        {\n            return Equals(storageResourceManager as StorageResourceManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StorageResourceManagerStorageProfileStatistics : DynamicData, IEquatable<StorageResourceManagerStorageProfileStatistics>\n    {\n        public string ProfileId { get; set; }\n\n        public long TotalSpaceMB { get; set; }\n\n        public long UsedSpaceMB { get; set; }\n\n        public bool Equals(StorageResourceManagerStorageProfileStatistics storageResourceManagerStorageProfileStatistics)\n        {\n            return (storageResourceManagerStorageProfileStatistics != null && this.ProfileId == storageResourceManagerStorageProfileStatistics.ProfileId && this.TotalSpaceMB == storageResourceManagerStorageProfileStatistics.TotalSpaceMB && this.UsedSpaceMB == storageResourceManagerStorageProfileStatistics.UsedSpaceMB);\n        }\n\n        public override bool Equals(object storageResourceManagerStorageProfileStatistics)\n        {\n            return Equals(storageResourceManagerStorageProfileStatistics as StorageResourceManagerStorageProfileStatistics);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProfileId + \"_\" + TotalSpaceMB + \"_\" + UsedSpaceMB).GetHashCode();\n        }\n    }\n\n    public class StorageVmotionIncompatible : VirtualHardwareCompatibilityIssue, IEquatable<StorageVmotionIncompatible>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public StorageVmotionIncompatible_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageVmotionIncompatible storageVmotionIncompatible)\n        {\n            return (storageVmotionIncompatible != null && ((this.Datastore == null && storageVmotionIncompatible.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(storageVmotionIncompatible.Datastore))) && ((this.LinkedView == null && storageVmotionIncompatible.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageVmotionIncompatible.LinkedView))));\n        }\n\n        public override bool Equals(object storageVmotionIncompatible)\n        {\n            return Equals(storageVmotionIncompatible as StorageVmotionIncompatible);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageVmotionIncompatible_LinkedView : IEquatable<StorageVmotionIncompatible_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(StorageVmotionIncompatible_LinkedView storageVmotionIncompatible_LinkedView)\n        {\n            return (storageVmotionIncompatible_LinkedView != null && ((this.Datastore == null && storageVmotionIncompatible_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(storageVmotionIncompatible_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object storageVmotionIncompatible_LinkedView)\n        {\n            return Equals(storageVmotionIncompatible_LinkedView as StorageVmotionIncompatible_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class StorageVMotionNotSupported : MigrationFeatureNotSupported, IEquatable<StorageVMotionNotSupported>\n    {\n        public new StorageVMotionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StorageVMotionNotSupported storageVMotionNotSupported)\n        {\n            return (storageVMotionNotSupported != null && ((this.LinkedView == null && storageVMotionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(storageVMotionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object storageVMotionNotSupported)\n        {\n            return Equals(storageVMotionNotSupported as StorageVMotionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class StorageVMotionNotSupported_LinkedView : MigrationFeatureNotSupported_LinkedView, IEquatable<StorageVMotionNotSupported_LinkedView>\n    {\n        public bool Equals(StorageVMotionNotSupported_LinkedView storageVMotionNotSupported_LinkedView)\n        {\n            return (storageVMotionNotSupported_LinkedView != null && base.Equals(storageVMotionNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object storageVMotionNotSupported_LinkedView)\n        {\n            return Equals(storageVMotionNotSupported_LinkedView as StorageVMotionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class StringExpression : NegatableExpression, IEquatable<StringExpression>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(StringExpression stringExpression)\n        {\n            return (stringExpression != null && this.Value == stringExpression.Value);\n        }\n\n        public override bool Equals(object stringExpression)\n        {\n            return Equals(stringExpression as StringExpression);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class StringOption : OptionType, IEquatable<StringOption>\n    {\n        public string DefaultValue { get; set; }\n\n        public string ValidCharacters { get; set; }\n\n        public bool Equals(StringOption stringOption)\n        {\n            return (stringOption != null && this.DefaultValue == stringOption.DefaultValue && this.ValidCharacters == stringOption.ValidCharacters);\n        }\n\n        public override bool Equals(object stringOption)\n        {\n            return Equals(stringOption as StringOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultValue + \"_\" + ValidCharacters).GetHashCode();\n        }\n    }\n\n    public class StringPolicy : InheritablePolicy, IEquatable<StringPolicy>\n    {\n        public string Value { get; set; }\n\n        public bool Equals(StringPolicy stringPolicy)\n        {\n            return (stringPolicy != null && this.Value == stringPolicy.Value);\n        }\n\n        public override bool Equals(object stringPolicy)\n        {\n            return Equals(stringPolicy as StringPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value).GetHashCode();\n        }\n    }\n\n    public class StructuredCustomizations : HostProfilesEntityCustomizations, IEquatable<StructuredCustomizations>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public AnswerFile Customizations { get; set; }\n\n        public StructuredCustomizations_LinkedView LinkedView { get; set; }\n\n        public bool Equals(StructuredCustomizations structuredCustomizations)\n        {\n            return (structuredCustomizations != null && ((this.Entity == null && structuredCustomizations.Entity == null) || (this.Entity != null && this.Entity.Equals(structuredCustomizations.Entity))) && ((this.Customizations == null && structuredCustomizations.Customizations == null) || (this.Customizations != null && this.Customizations.Equals(structuredCustomizations.Customizations))) && ((this.LinkedView == null && structuredCustomizations.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(structuredCustomizations.LinkedView))));\n        }\n\n        public override bool Equals(object structuredCustomizations)\n        {\n            return Equals(structuredCustomizations as StructuredCustomizations);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Customizations + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class StructuredCustomizations_LinkedView : IEquatable<StructuredCustomizations_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(StructuredCustomizations_LinkedView structuredCustomizations_LinkedView)\n        {\n            return (structuredCustomizations_LinkedView != null && ((this.Entity == null && structuredCustomizations_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(structuredCustomizations_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object structuredCustomizations_LinkedView)\n        {\n            return Equals(structuredCustomizations_LinkedView as StructuredCustomizations_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class SuspendedRelocateNotSupported : MigrationFault, IEquatable<SuspendedRelocateNotSupported>\n    {\n        public bool Equals(SuspendedRelocateNotSupported suspendedRelocateNotSupported)\n        {\n            return (suspendedRelocateNotSupported != null && base.Equals(suspendedRelocateNotSupported));\n        }\n\n        public override bool Equals(object suspendedRelocateNotSupported)\n        {\n            return Equals(suspendedRelocateNotSupported as SuspendedRelocateNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SwapDatastoreNotWritableOnHost : DatastoreNotWritableOnHost, IEquatable<SwapDatastoreNotWritableOnHost>\n    {\n        public new SwapDatastoreNotWritableOnHost_LinkedView LinkedView { get; set; }\n\n        public bool Equals(SwapDatastoreNotWritableOnHost swapDatastoreNotWritableOnHost)\n        {\n            return (swapDatastoreNotWritableOnHost != null && ((this.LinkedView == null && swapDatastoreNotWritableOnHost.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(swapDatastoreNotWritableOnHost.LinkedView))));\n        }\n\n        public override bool Equals(object swapDatastoreNotWritableOnHost)\n        {\n            return Equals(swapDatastoreNotWritableOnHost as SwapDatastoreNotWritableOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class SwapDatastoreNotWritableOnHost_LinkedView : DatastoreNotWritableOnHost_LinkedView, IEquatable<SwapDatastoreNotWritableOnHost_LinkedView>\n    {\n        public bool Equals(SwapDatastoreNotWritableOnHost_LinkedView swapDatastoreNotWritableOnHost_LinkedView)\n        {\n            return (swapDatastoreNotWritableOnHost_LinkedView != null && base.Equals(swapDatastoreNotWritableOnHost_LinkedView));\n        }\n\n        public override bool Equals(object swapDatastoreNotWritableOnHost_LinkedView)\n        {\n            return Equals(swapDatastoreNotWritableOnHost_LinkedView as SwapDatastoreNotWritableOnHost_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SwapDatastoreUnset : VimFault, IEquatable<SwapDatastoreUnset>\n    {\n        public bool Equals(SwapDatastoreUnset swapDatastoreUnset)\n        {\n            return (swapDatastoreUnset != null && base.Equals(swapDatastoreUnset));\n        }\n\n        public override bool Equals(object swapDatastoreUnset)\n        {\n            return Equals(swapDatastoreUnset as SwapDatastoreUnset);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SwapPlacementOverrideNotSupported : InvalidVmConfig, IEquatable<SwapPlacementOverrideNotSupported>\n    {\n        public bool Equals(SwapPlacementOverrideNotSupported swapPlacementOverrideNotSupported)\n        {\n            return (swapPlacementOverrideNotSupported != null && base.Equals(swapPlacementOverrideNotSupported));\n        }\n\n        public override bool Equals(object swapPlacementOverrideNotSupported)\n        {\n            return Equals(swapPlacementOverrideNotSupported as SwapPlacementOverrideNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SwitchIpUnset : DvsFault, IEquatable<SwitchIpUnset>\n    {\n        public bool Equals(SwitchIpUnset switchIpUnset)\n        {\n            return (switchIpUnset != null && base.Equals(switchIpUnset));\n        }\n\n        public override bool Equals(object switchIpUnset)\n        {\n            return Equals(switchIpUnset as SwitchIpUnset);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SwitchNotInUpgradeMode : DvsFault, IEquatable<SwitchNotInUpgradeMode>\n    {\n        public bool Equals(SwitchNotInUpgradeMode switchNotInUpgradeMode)\n        {\n            return (switchNotInUpgradeMode != null && base.Equals(switchNotInUpgradeMode));\n        }\n\n        public override bool Equals(object switchNotInUpgradeMode)\n        {\n            return Equals(switchNotInUpgradeMode as SwitchNotInUpgradeMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class SyslogConfig : IEquatable<SyslogConfig>\n    {\n        public SyslogConfig()\n        {\n        }\n\n        public string LogHost { get; set; }\n\n        public string LogDir { get; set; }\n\n        public bool LogDirUnique { get; set; }\n\n        public bool CheckSslCerts { get; set; }\n\n        public long DefaultRotate { get; set; }\n\n        public long DefaultSize { get; set; }\n\n        public long DefaultTimeout { get; set; }\n\n        public long QueueDropMark { get; set; }\n\n        public long DropLogRotate { get; set; }\n\n        public long DropLogSize { get; set; }\n\n        public bool Equals(SyslogConfig syslogConfig)\n        {\n            return (syslogConfig != null && this.LogHost == syslogConfig.LogHost && this.CheckSslCerts == syslogConfig.CheckSslCerts && this.DefaultRotate == syslogConfig.DefaultRotate && this.DefaultSize == syslogConfig.DefaultSize && this.DefaultTimeout == syslogConfig.DefaultTimeout && this.DropLogRotate == syslogConfig.DropLogRotate && this.DropLogSize == syslogConfig.DropLogSize && this.LogDir == syslogConfig.LogDir && this.LogDirUnique == syslogConfig.LogDirUnique && this.QueueDropMark == syslogConfig.QueueDropMark);\n        }\n\n        public override bool Equals(object syslogConfig)\n        {\n            return this.Equals(syslogConfig as SyslogConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LogHost + \"_\" +LogDir + \"_\" + DefaultRotate + \"_\" + DefaultSize + \"_\" + DefaultTimeout + \"_\" + QueueDropMark + \"_\" + DropLogRotate + \"_\" + DropLogSize).GetHashCode();\n        }\n    }\n\n    public class SyslogConfigOut : IEquatable<SyslogConfigOut>\n    {\n        public SyslogConfigOut()\n        {\n        }\n\n        public string RemoteHost { get; set; }\n\n        public string LogDir { get; set; }\n\n        public bool LogDirUnique { get; set; }\n\n        public bool CheckSslCerts { get; set; }\n\n        public long DefaultRotate { get; set; }\n\n        public long DefaultSize { get; set; }\n\n        public long DefaultTimeout { get; set; }\n\n        public long QueueDropMark { get; set; }\n\n        public long DropLogRotate { get; set; }\n\n        public long DropLogSize { get; set; }\n\n        public bool Equals(SyslogConfigOut syslogConfigOut)\n        {\n            return (syslogConfigOut != null && this.RemoteHost == syslogConfigOut.RemoteHost && this.LogDir == syslogConfigOut.LogDir && this.LogDirUnique == syslogConfigOut.LogDirUnique && this.CheckSslCerts == syslogConfigOut.CheckSslCerts && this.DefaultRotate == syslogConfigOut.DefaultRotate && this.DefaultSize == syslogConfigOut.DefaultSize && this.DefaultTimeout == syslogConfigOut.DefaultTimeout && this.QueueDropMark == syslogConfigOut.QueueDropMark && this.DropLogRotate == syslogConfigOut.DropLogRotate && this.DropLogSize == syslogConfigOut.DropLogSize);\n        }\n\n        public override bool Equals(object syslogConfigOut)\n        {\n            return this.Equals(syslogConfigOut as SyslogConfigOut);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + LogDir + \"_\" + LogDirUnique + \"_\" + CheckSslCerts + \"_\" + DefaultRotate + \"_\" + DefaultSize + \"_\" + DefaultTimeout + \"_\" + QueueDropMark + \"_\" + DropLogRotate + \"_\" + DropLogSize).GetHashCode();\n        }\n    }\n\n    public class SystemError : RuntimeFault, IEquatable<SystemError>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(SystemError systemError)\n        {\n            return (systemError != null && this.Reason == systemError.Reason);\n        }\n\n        public override bool Equals(object systemError)\n        {\n            return Equals(systemError as SystemError);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class SystemEventInfo : DynamicData, IEquatable<SystemEventInfo>\n    {\n        public long RecordId { get; set; }\n\n        public string When { get; set; }\n\n        public long SelType { get; set; }\n\n        public string Message { get; set; }\n\n        public long SensorNumber { get; set; }\n\n        public bool Equals(SystemEventInfo systemEventInfo)\n        {\n            return (systemEventInfo != null && this.RecordId == systemEventInfo.RecordId && this.When == systemEventInfo.When && this.SelType == systemEventInfo.SelType && this.Message == systemEventInfo.Message && this.SensorNumber == systemEventInfo.SensorNumber);\n        }\n\n        public override bool Equals(object systemEventInfo)\n        {\n            return Equals(systemEventInfo as SystemEventInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RecordId + \"_\" + When + \"_\" + SelType + \"_\" + Message + \"_\" + SensorNumber).GetHashCode();\n        }\n    }\n\n    public class Tag : DynamicData, IEquatable<Tag>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(Tag tag)\n        {\n            return (tag != null && this.Key == tag.Key);\n        }\n\n        public override bool Equals(object tag)\n        {\n            return Equals(tag as Tag);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class Task : ExtensibleManagedObject, IEquatable<Task>\n    {\n        public TaskInfo Info { get; set; }\n\n        public void CancelTask()\n        {\n        }\n\n        public void UpdateProgress(int percentDone)\n        {\n        }\n\n        public void SetTaskState(TaskInfoState state, object result, LocalizedMethodFault fault)\n        {\n        }\n\n        public void SetTaskDescription(LocalizableMessage description)\n        {\n        }\n\n        public bool Equals(Task task)\n        {\n            return (task != null && ((this.Info == null && task.Info == null) || (this.Info != null && this.Info.Equals(task.Info))));\n        }\n\n        public override bool Equals(object task)\n        {\n            return Equals(task as Task);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class TaskDescription : DynamicData, IEquatable<TaskDescription>\n    {\n        public ElementDescription[] MethodInfo { get; set; }\n\n        public ElementDescription[] State { get; set; }\n\n        public TypeDescription[] Reason { get; set; }\n\n        public bool Equals(TaskDescription taskDescription)\n        {\n            return (taskDescription != null && ((this.MethodInfo == null && taskDescription.MethodInfo == null) || (this.MethodInfo != null && taskDescription.MethodInfo != null && Enumerable.SequenceEqual(this.MethodInfo, taskDescription.MethodInfo))) && ((this.State == null && taskDescription.State == null) || (this.State != null && taskDescription.State != null && Enumerable.SequenceEqual(this.State, taskDescription.State))) && ((this.Reason == null && taskDescription.Reason == null) || (this.Reason != null && taskDescription.Reason != null && Enumerable.SequenceEqual(this.Reason, taskDescription.Reason))));\n        }\n\n        public override bool Equals(object taskDescription)\n        {\n            return Equals(taskDescription as TaskDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MethodInfo + \"_\" + State + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class TaskEvent : Event, IEquatable<TaskEvent>\n    {\n        public TaskInfo Info { get; set; }\n\n        public bool Equals(TaskEvent taskEvent)\n        {\n            return (taskEvent != null && ((this.Info == null && taskEvent.Info == null) || (this.Info != null && this.Info.Equals(taskEvent.Info))));\n        }\n\n        public override bool Equals(object taskEvent)\n        {\n            return Equals(taskEvent as TaskEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class TaskFilterSpec : DynamicData, IEquatable<TaskFilterSpec>\n    {\n        public TaskFilterSpecByEntity Entity { get; set; }\n\n        public TaskFilterSpecByTime Time { get; set; }\n\n        public TaskFilterSpecByUsername UserName { get; set; }\n\n        public string[] ActivationId { get; set; }\n\n        public TaskInfoState[] State { get; set; }\n\n        public ManagedObjectReference Alarm { get; set; }\n\n        public ManagedObjectReference ScheduledTask { get; set; }\n\n        public int[] EventChainId { get; set; }\n\n        public string[] Tag { get; set; }\n\n        public string[] ParentTaskKey { get; set; }\n\n        public string[] RootTaskKey { get; set; }\n\n        public TaskFilterSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(TaskFilterSpec taskFilterSpec)\n        {\n            return (taskFilterSpec != null && ((this.Entity == null && taskFilterSpec.Entity == null) || (this.Entity != null && this.Entity.Equals(taskFilterSpec.Entity))) && ((this.Time == null && taskFilterSpec.Time == null) || (this.Time != null && this.Time.Equals(taskFilterSpec.Time))) && ((this.UserName == null && taskFilterSpec.UserName == null) || (this.UserName != null && this.UserName.Equals(taskFilterSpec.UserName))) && ((this.ActivationId == null && taskFilterSpec.ActivationId == null) || (this.ActivationId != null && taskFilterSpec.ActivationId != null && Enumerable.SequenceEqual(this.ActivationId, taskFilterSpec.ActivationId))) && ((this.State == null && taskFilterSpec.State == null) || (this.State != null && taskFilterSpec.State != null && Enumerable.SequenceEqual(this.State, taskFilterSpec.State))) && ((this.Alarm == null && taskFilterSpec.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(taskFilterSpec.Alarm))) && ((this.ScheduledTask == null && taskFilterSpec.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(taskFilterSpec.ScheduledTask))) && ((this.EventChainId == null && taskFilterSpec.EventChainId == null) || (this.EventChainId != null && taskFilterSpec.EventChainId != null && Enumerable.SequenceEqual(this.EventChainId, taskFilterSpec.EventChainId))) && ((this.Tag == null && taskFilterSpec.Tag == null) || (this.Tag != null && taskFilterSpec.Tag != null && Enumerable.SequenceEqual(this.Tag, taskFilterSpec.Tag))) && ((this.ParentTaskKey == null && taskFilterSpec.ParentTaskKey == null) || (this.ParentTaskKey != null && taskFilterSpec.ParentTaskKey != null && Enumerable.SequenceEqual(this.ParentTaskKey, taskFilterSpec.ParentTaskKey))) && ((this.RootTaskKey == null && taskFilterSpec.RootTaskKey == null) || (this.RootTaskKey != null && taskFilterSpec.RootTaskKey != null && Enumerable.SequenceEqual(this.RootTaskKey, taskFilterSpec.RootTaskKey))) && ((this.LinkedView == null && taskFilterSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskFilterSpec.LinkedView))));\n        }\n\n        public override bool Equals(object taskFilterSpec)\n        {\n            return Equals(taskFilterSpec as TaskFilterSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Time + \"_\" + UserName + \"_\" + ActivationId + \"_\" + State + \"_\" + Alarm + \"_\" + ScheduledTask + \"_\" + EventChainId + \"_\" + Tag + \"_\" + ParentTaskKey + \"_\" + RootTaskKey + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskFilterSpec_LinkedView : IEquatable<TaskFilterSpec_LinkedView>\n    {\n        public Alarm Alarm { get; set; }\n\n        public ScheduledTask ScheduledTask { get; set; }\n\n        public bool Equals(TaskFilterSpec_LinkedView taskFilterSpec_LinkedView)\n        {\n            return (taskFilterSpec_LinkedView != null && ((this.Alarm == null && taskFilterSpec_LinkedView.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(taskFilterSpec_LinkedView.Alarm))) && ((this.ScheduledTask == null && taskFilterSpec_LinkedView.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(taskFilterSpec_LinkedView.ScheduledTask))));\n        }\n\n        public override bool Equals(object taskFilterSpec_LinkedView)\n        {\n            return Equals(taskFilterSpec_LinkedView as TaskFilterSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm + \"_\" + ScheduledTask).GetHashCode();\n        }\n    }\n\n    public class TaskFilterSpecByEntity : DynamicData, IEquatable<TaskFilterSpecByEntity>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public TaskFilterSpecRecursionOption Recursion { get; set; }\n\n        public TaskFilterSpecByEntity_LinkedView LinkedView { get; set; }\n\n        public bool Equals(TaskFilterSpecByEntity taskFilterSpecByEntity)\n        {\n            return (taskFilterSpecByEntity != null && ((this.Entity == null && taskFilterSpecByEntity.Entity == null) || (this.Entity != null && this.Entity.Equals(taskFilterSpecByEntity.Entity))) && this.Recursion == taskFilterSpecByEntity.Recursion && ((this.LinkedView == null && taskFilterSpecByEntity.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskFilterSpecByEntity.LinkedView))));\n        }\n\n        public override bool Equals(object taskFilterSpecByEntity)\n        {\n            return Equals(taskFilterSpecByEntity as TaskFilterSpecByEntity);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Recursion + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskFilterSpecByEntity_LinkedView : IEquatable<TaskFilterSpecByEntity_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(TaskFilterSpecByEntity_LinkedView taskFilterSpecByEntity_LinkedView)\n        {\n            return (taskFilterSpecByEntity_LinkedView != null && ((this.Entity == null && taskFilterSpecByEntity_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(taskFilterSpecByEntity_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object taskFilterSpecByEntity_LinkedView)\n        {\n            return Equals(taskFilterSpecByEntity_LinkedView as TaskFilterSpecByEntity_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class TaskFilterSpecByTime : DynamicData, IEquatable<TaskFilterSpecByTime>\n    {\n        public TaskFilterSpecTimeOption TimeType { get; set; }\n\n        public DateTime? BeginTime { get; set; }\n\n        public DateTime? EndTime { get; set; }\n\n        public bool Equals(TaskFilterSpecByTime taskFilterSpecByTime)\n        {\n            return (taskFilterSpecByTime != null && this.TimeType == taskFilterSpecByTime.TimeType && ((this.BeginTime == null && taskFilterSpecByTime.BeginTime == null) || (this.BeginTime != null && this.BeginTime.Equals(taskFilterSpecByTime.BeginTime))) && ((this.EndTime == null && taskFilterSpecByTime.EndTime == null) || (this.EndTime != null && this.EndTime.Equals(taskFilterSpecByTime.EndTime))));\n        }\n\n        public override bool Equals(object taskFilterSpecByTime)\n        {\n            return Equals(taskFilterSpecByTime as TaskFilterSpecByTime);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TimeType + \"_\" + BeginTime + \"_\" + EndTime).GetHashCode();\n        }\n    }\n\n    public class TaskFilterSpecByUsername : DynamicData, IEquatable<TaskFilterSpecByUsername>\n    {\n        public bool SystemUser { get; set; }\n\n        public string[] UserList { get; set; }\n\n        public bool Equals(TaskFilterSpecByUsername taskFilterSpecByUsername)\n        {\n            return (taskFilterSpecByUsername != null && this.SystemUser == taskFilterSpecByUsername.SystemUser && ((this.UserList == null && taskFilterSpecByUsername.UserList == null) || (this.UserList != null && taskFilterSpecByUsername.UserList != null && Enumerable.SequenceEqual(this.UserList, taskFilterSpecByUsername.UserList))));\n        }\n\n        public override bool Equals(object taskFilterSpecByUsername)\n        {\n            return Equals(taskFilterSpecByUsername as TaskFilterSpecByUsername);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SystemUser + \"_\" + UserList).GetHashCode();\n        }\n    }\n\n    public class TaskHistoryCollector : HistoryCollector, IEquatable<TaskHistoryCollector>\n    {\n        public TaskInfo[] LatestPage { get; set; }\n\n        public TaskInfo[] ReadNextTasks(int maxCount)\n        {\n            return default(TaskInfo[]);\n        }\n\n        public TaskInfo[] ReadPreviousTasks(int maxCount)\n        {\n            return default(TaskInfo[]);\n        }\n\n        public bool Equals(TaskHistoryCollector taskHistoryCollector)\n        {\n            return (taskHistoryCollector != null && ((this.LatestPage == null && taskHistoryCollector.LatestPage == null) || (this.LatestPage != null && taskHistoryCollector.LatestPage != null && Enumerable.SequenceEqual(this.LatestPage, taskHistoryCollector.LatestPage))));\n        }\n\n        public override bool Equals(object taskHistoryCollector)\n        {\n            return Equals(taskHistoryCollector as TaskHistoryCollector);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LatestPage).GetHashCode();\n        }\n    }\n\n    public class TaskInfo : DynamicData, IEquatable<TaskInfo>\n    {\n        public string Key { get; set; }\n\n        public ManagedObjectReference Task { get; set; }\n\n        public LocalizableMessage Description { get; set; }\n\n        public string Name { get; set; }\n\n        public string DescriptionId { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public string EntityName { get; set; }\n\n        public ManagedObjectReference[] Locked { get; set; }\n\n        public TaskInfoState State { get; set; }\n\n        public bool Cancelled { get; set; }\n\n        public bool Cancelable { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public object Result { get; set; }\n\n        public int? Progress { get; set; }\n\n        public TaskReason Reason { get; set; }\n\n        public DateTime QueueTime { get; set; }\n\n        public DateTime? StartTime { get; set; }\n\n        public DateTime? CompleteTime { get; set; }\n\n        public int EventChainId { get; set; }\n\n        public string ChangeTag { get; set; }\n\n        public string ParentTaskKey { get; set; }\n\n        public string RootTaskKey { get; set; }\n\n        public string ActivationId { get; set; }\n\n        public TaskInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(TaskInfo taskInfo)\n        {\n            return (taskInfo != null && this.Key == taskInfo.Key && ((this.Task == null && taskInfo.Task == null) || (this.Task != null && this.Task.Equals(taskInfo.Task))) && ((this.Description == null && taskInfo.Description == null) || (this.Description != null && this.Description.Equals(taskInfo.Description))) && this.Name == taskInfo.Name && this.DescriptionId == taskInfo.DescriptionId && ((this.Entity == null && taskInfo.Entity == null) || (this.Entity != null && this.Entity.Equals(taskInfo.Entity))) && this.EntityName == taskInfo.EntityName && ((this.Locked == null && taskInfo.Locked == null) || (this.Locked != null && taskInfo.Locked != null && Enumerable.SequenceEqual(this.Locked, taskInfo.Locked))) && this.State == taskInfo.State && this.Cancelled == taskInfo.Cancelled && this.Cancelable == taskInfo.Cancelable && ((this.Error == null && taskInfo.Error == null) || (this.Error != null && this.Error.Equals(taskInfo.Error))) && ((this.Result == null && taskInfo.Result == null) || (this.Result != null && this.Result.Equals(taskInfo.Result))) && ((this.Progress == null && taskInfo.Progress == null) || (this.Progress != null && this.Progress.Equals(taskInfo.Progress))) && ((this.Reason == null && taskInfo.Reason == null) || (this.Reason != null && this.Reason.Equals(taskInfo.Reason))) && this.QueueTime == taskInfo.QueueTime && ((this.StartTime == null && taskInfo.StartTime == null) || (this.StartTime != null && this.StartTime.Equals(taskInfo.StartTime))) && ((this.CompleteTime == null && taskInfo.CompleteTime == null) || (this.CompleteTime != null && this.CompleteTime.Equals(taskInfo.CompleteTime))) && this.EventChainId == taskInfo.EventChainId && this.ChangeTag == taskInfo.ChangeTag && this.ParentTaskKey == taskInfo.ParentTaskKey && this.RootTaskKey == taskInfo.RootTaskKey && this.ActivationId == taskInfo.ActivationId && ((this.LinkedView == null && taskInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskInfo.LinkedView))));\n        }\n\n        public override bool Equals(object taskInfo)\n        {\n            return Equals(taskInfo as TaskInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Task + \"_\" + Description + \"_\" + Name + \"_\" + DescriptionId + \"_\" + Entity + \"_\" + EntityName + \"_\" + Locked + \"_\" + State + \"_\" + Cancelled + \"_\" + Cancelable + \"_\" + Error + \"_\" + Result + \"_\" + Progress + \"_\" + Reason + \"_\" + QueueTime + \"_\" + StartTime + \"_\" + CompleteTime + \"_\" + EventChainId + \"_\" + ChangeTag + \"_\" + ParentTaskKey + \"_\" + RootTaskKey + \"_\" + ActivationId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskInfo_LinkedView : IEquatable<TaskInfo_LinkedView>\n    {\n        public Task Task { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public ManagedEntity[] Locked { get; set; }\n\n        public bool Equals(TaskInfo_LinkedView taskInfo_LinkedView)\n        {\n            return (taskInfo_LinkedView != null && ((this.Task == null && taskInfo_LinkedView.Task == null) || (this.Task != null && this.Task.Equals(taskInfo_LinkedView.Task))) && ((this.Entity == null && taskInfo_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(taskInfo_LinkedView.Entity))) && ((this.Locked == null && taskInfo_LinkedView.Locked == null) || (this.Locked != null && taskInfo_LinkedView.Locked != null && Enumerable.SequenceEqual(this.Locked, taskInfo_LinkedView.Locked))));\n        }\n\n        public override bool Equals(object taskInfo_LinkedView)\n        {\n            return Equals(taskInfo_LinkedView as TaskInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Task + \"_\" + Entity + \"_\" + Locked).GetHashCode();\n        }\n    }\n\n    public class TaskInProgress : VimFault, IEquatable<TaskInProgress>\n    {\n        public ManagedObjectReference Task { get; set; }\n\n        public TaskInProgress_LinkedView LinkedView { get; set; }\n\n        public bool Equals(TaskInProgress taskInProgress)\n        {\n            return (taskInProgress != null && ((this.Task == null && taskInProgress.Task == null) || (this.Task != null && this.Task.Equals(taskInProgress.Task))) && ((this.LinkedView == null && taskInProgress.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskInProgress.LinkedView))));\n        }\n\n        public override bool Equals(object taskInProgress)\n        {\n            return Equals(taskInProgress as TaskInProgress);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Task + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskInProgress_LinkedView : IEquatable<TaskInProgress_LinkedView>\n    {\n        public Task Task { get; set; }\n\n        public bool Equals(TaskInProgress_LinkedView taskInProgress_LinkedView)\n        {\n            return (taskInProgress_LinkedView != null && ((this.Task == null && taskInProgress_LinkedView.Task == null) || (this.Task != null && this.Task.Equals(taskInProgress_LinkedView.Task))));\n        }\n\n        public override bool Equals(object taskInProgress_LinkedView)\n        {\n            return Equals(taskInProgress_LinkedView as TaskInProgress_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Task).GetHashCode();\n        }\n    }\n\n    public class TaskManager : ViewBase, IEquatable<TaskManager>\n    {\n        public ManagedObjectReference[] RecentTask { get; set; }\n\n        public TaskDescription Description { get; set; }\n\n        public int MaxCollector { get; set; }\n\n        public TaskManager_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference CreateCollectorForTasks(TaskFilterSpec filter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public TaskInfo CreateTask(ManagedObjectReference obj, string taskTypeId, string initiatedBy, bool cancelable, string parentTaskKey, string activationId)\n        {\n            return default(TaskInfo);\n        }\n\n        public bool Equals(TaskManager taskManager)\n        {\n            return (taskManager != null && ((this.RecentTask == null && taskManager.RecentTask == null) || (this.RecentTask != null && taskManager.RecentTask != null && Enumerable.SequenceEqual(this.RecentTask, taskManager.RecentTask))) && ((this.Description == null && taskManager.Description == null) || (this.Description != null && this.Description.Equals(taskManager.Description))) && this.MaxCollector == taskManager.MaxCollector && ((this.LinkedView == null && taskManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskManager.LinkedView))));\n        }\n\n        public override bool Equals(object taskManager)\n        {\n            return Equals(taskManager as TaskManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RecentTask + \"_\" + Description + \"_\" + MaxCollector + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskManager_LinkedView : IEquatable<TaskManager_LinkedView>\n    {\n        public Task[] RecentTask { get; set; }\n\n        public bool Equals(TaskManager_LinkedView taskManager_LinkedView)\n        {\n            return (taskManager_LinkedView != null && ((this.RecentTask == null && taskManager_LinkedView.RecentTask == null) || (this.RecentTask != null && taskManager_LinkedView.RecentTask != null && Enumerable.SequenceEqual(this.RecentTask, taskManager_LinkedView.RecentTask))));\n        }\n\n        public override bool Equals(object taskManager_LinkedView)\n        {\n            return Equals(taskManager_LinkedView as TaskManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RecentTask).GetHashCode();\n        }\n    }\n\n    public class TaskReason : DynamicData, IEquatable<TaskReason>\n    {\n        public bool Equals(TaskReason taskReason)\n        {\n            return (taskReason != null && base.Equals(taskReason));\n        }\n\n        public override bool Equals(object taskReason)\n        {\n            return Equals(taskReason as TaskReason);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TaskReasonAlarm : TaskReason, IEquatable<TaskReasonAlarm>\n    {\n        public string AlarmName { get; set; }\n\n        public ManagedObjectReference Alarm { get; set; }\n\n        public string EntityName { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public TaskReasonAlarm_LinkedView LinkedView { get; set; }\n\n        public bool Equals(TaskReasonAlarm taskReasonAlarm)\n        {\n            return (taskReasonAlarm != null && this.AlarmName == taskReasonAlarm.AlarmName && ((this.Alarm == null && taskReasonAlarm.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(taskReasonAlarm.Alarm))) && this.EntityName == taskReasonAlarm.EntityName && ((this.Entity == null && taskReasonAlarm.Entity == null) || (this.Entity != null && this.Entity.Equals(taskReasonAlarm.Entity))) && ((this.LinkedView == null && taskReasonAlarm.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskReasonAlarm.LinkedView))));\n        }\n\n        public override bool Equals(object taskReasonAlarm)\n        {\n            return Equals(taskReasonAlarm as TaskReasonAlarm);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AlarmName + \"_\" + Alarm + \"_\" + EntityName + \"_\" + Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskReasonAlarm_LinkedView : IEquatable<TaskReasonAlarm_LinkedView>\n    {\n        public Alarm Alarm { get; set; }\n\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(TaskReasonAlarm_LinkedView taskReasonAlarm_LinkedView)\n        {\n            return (taskReasonAlarm_LinkedView != null && ((this.Alarm == null && taskReasonAlarm_LinkedView.Alarm == null) || (this.Alarm != null && this.Alarm.Equals(taskReasonAlarm_LinkedView.Alarm))) && ((this.Entity == null && taskReasonAlarm_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(taskReasonAlarm_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object taskReasonAlarm_LinkedView)\n        {\n            return Equals(taskReasonAlarm_LinkedView as TaskReasonAlarm_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Alarm + \"_\" + Entity).GetHashCode();\n        }\n    }\n\n    public class TaskReasonSchedule : TaskReason, IEquatable<TaskReasonSchedule>\n    {\n        public string Name { get; set; }\n\n        public ManagedObjectReference ScheduledTask { get; set; }\n\n        public TaskReasonSchedule_LinkedView LinkedView { get; set; }\n\n        public bool Equals(TaskReasonSchedule taskReasonSchedule)\n        {\n            return (taskReasonSchedule != null && this.Name == taskReasonSchedule.Name && ((this.ScheduledTask == null && taskReasonSchedule.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(taskReasonSchedule.ScheduledTask))) && ((this.LinkedView == null && taskReasonSchedule.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(taskReasonSchedule.LinkedView))));\n        }\n\n        public override bool Equals(object taskReasonSchedule)\n        {\n            return Equals(taskReasonSchedule as TaskReasonSchedule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + ScheduledTask + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class TaskReasonSchedule_LinkedView : IEquatable<TaskReasonSchedule_LinkedView>\n    {\n        public ScheduledTask ScheduledTask { get; set; }\n\n        public bool Equals(TaskReasonSchedule_LinkedView taskReasonSchedule_LinkedView)\n        {\n            return (taskReasonSchedule_LinkedView != null && ((this.ScheduledTask == null && taskReasonSchedule_LinkedView.ScheduledTask == null) || (this.ScheduledTask != null && this.ScheduledTask.Equals(taskReasonSchedule_LinkedView.ScheduledTask))));\n        }\n\n        public override bool Equals(object taskReasonSchedule_LinkedView)\n        {\n            return Equals(taskReasonSchedule_LinkedView as TaskReasonSchedule_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScheduledTask).GetHashCode();\n        }\n    }\n\n    public class TaskReasonSystem : TaskReason, IEquatable<TaskReasonSystem>\n    {\n        public bool Equals(TaskReasonSystem taskReasonSystem)\n        {\n            return (taskReasonSystem != null && base.Equals(taskReasonSystem));\n        }\n\n        public override bool Equals(object taskReasonSystem)\n        {\n            return Equals(taskReasonSystem as TaskReasonSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TaskReasonUser : TaskReason, IEquatable<TaskReasonUser>\n    {\n        public string UserName { get; set; }\n\n        public bool Equals(TaskReasonUser taskReasonUser)\n        {\n            return (taskReasonUser != null && this.UserName == taskReasonUser.UserName);\n        }\n\n        public override bool Equals(object taskReasonUser)\n        {\n            return Equals(taskReasonUser as TaskReasonUser);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserName).GetHashCode();\n        }\n    }\n\n    public class TaskScheduler : DynamicData, IEquatable<TaskScheduler>\n    {\n        public DateTime? ActiveTime { get; set; }\n\n        public DateTime? ExpireTime { get; set; }\n\n        public bool Equals(TaskScheduler taskScheduler)\n        {\n            return (taskScheduler != null && ((this.ActiveTime == null && taskScheduler.ActiveTime == null) || (this.ActiveTime != null && this.ActiveTime.Equals(taskScheduler.ActiveTime))) && ((this.ExpireTime == null && taskScheduler.ExpireTime == null) || (this.ExpireTime != null && this.ExpireTime.Equals(taskScheduler.ExpireTime))));\n        }\n\n        public override bool Equals(object taskScheduler)\n        {\n            return Equals(taskScheduler as TaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActiveTime + \"_\" + ExpireTime).GetHashCode();\n        }\n    }\n\n    public class TaskTimeoutEvent : TaskEvent, IEquatable<TaskTimeoutEvent>\n    {\n        public bool Equals(TaskTimeoutEvent taskTimeoutEvent)\n        {\n            return (taskTimeoutEvent != null && base.Equals(taskTimeoutEvent));\n        }\n\n        public override bool Equals(object taskTimeoutEvent)\n        {\n            return Equals(taskTimeoutEvent as TaskTimeoutEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TeamingMatchEvent : DvsHealthStatusChangeEvent, IEquatable<TeamingMatchEvent>\n    {\n        public bool Equals(TeamingMatchEvent teamingMatchEvent)\n        {\n            return (teamingMatchEvent != null && base.Equals(teamingMatchEvent));\n        }\n\n        public override bool Equals(object teamingMatchEvent)\n        {\n            return Equals(teamingMatchEvent as TeamingMatchEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TeamingMisMatchEvent : DvsHealthStatusChangeEvent, IEquatable<TeamingMisMatchEvent>\n    {\n        public bool Equals(TeamingMisMatchEvent teamingMisMatchEvent)\n        {\n            return (teamingMisMatchEvent != null && base.Equals(teamingMisMatchEvent));\n        }\n\n        public override bool Equals(object teamingMisMatchEvent)\n        {\n            return Equals(teamingMisMatchEvent as TeamingMisMatchEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TemplateBeingUpgradedEvent : TemplateUpgradeEvent, IEquatable<TemplateBeingUpgradedEvent>\n    {\n        public bool Equals(TemplateBeingUpgradedEvent templateBeingUpgradedEvent)\n        {\n            return (templateBeingUpgradedEvent != null && base.Equals(templateBeingUpgradedEvent));\n        }\n\n        public override bool Equals(object templateBeingUpgradedEvent)\n        {\n            return Equals(templateBeingUpgradedEvent as TemplateBeingUpgradedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TemplateConfigFileInfo : VmConfigFileInfo, IEquatable<TemplateConfigFileInfo>\n    {\n        public bool Equals(TemplateConfigFileInfo templateConfigFileInfo)\n        {\n            return (templateConfigFileInfo != null && base.Equals(templateConfigFileInfo));\n        }\n\n        public override bool Equals(object templateConfigFileInfo)\n        {\n            return Equals(templateConfigFileInfo as TemplateConfigFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TemplateConfigFileQuery : VmConfigFileQuery, IEquatable<TemplateConfigFileQuery>\n    {\n        public bool Equals(TemplateConfigFileQuery templateConfigFileQuery)\n        {\n            return (templateConfigFileQuery != null && base.Equals(templateConfigFileQuery));\n        }\n\n        public override bool Equals(object templateConfigFileQuery)\n        {\n            return Equals(templateConfigFileQuery as TemplateConfigFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TemplateUpgradedEvent : TemplateUpgradeEvent, IEquatable<TemplateUpgradedEvent>\n    {\n        public bool Equals(TemplateUpgradedEvent templateUpgradedEvent)\n        {\n            return (templateUpgradedEvent != null && base.Equals(templateUpgradedEvent));\n        }\n\n        public override bool Equals(object templateUpgradedEvent)\n        {\n            return Equals(templateUpgradedEvent as TemplateUpgradedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TemplateUpgradeEvent : Event, IEquatable<TemplateUpgradeEvent>\n    {\n        public string LegacyTemplate { get; set; }\n\n        public bool Equals(TemplateUpgradeEvent templateUpgradeEvent)\n        {\n            return (templateUpgradeEvent != null && this.LegacyTemplate == templateUpgradeEvent.LegacyTemplate);\n        }\n\n        public override bool Equals(object templateUpgradeEvent)\n        {\n            return Equals(templateUpgradeEvent as TemplateUpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LegacyTemplate).GetHashCode();\n        }\n    }\n\n    public class TemplateUpgradeFailedEvent : TemplateUpgradeEvent, IEquatable<TemplateUpgradeFailedEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(TemplateUpgradeFailedEvent templateUpgradeFailedEvent)\n        {\n            return (templateUpgradeFailedEvent != null && ((this.Reason == null && templateUpgradeFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(templateUpgradeFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object templateUpgradeFailedEvent)\n        {\n            return Equals(templateUpgradeFailedEvent as TemplateUpgradeFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class ThirdPartyLicenseAssignmentFailed : RuntimeFault, IEquatable<ThirdPartyLicenseAssignmentFailed>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string Module { get; set; }\n\n        public string Reason { get; set; }\n\n        public ThirdPartyLicenseAssignmentFailed_LinkedView LinkedView { get; set; }\n\n        public bool Equals(ThirdPartyLicenseAssignmentFailed thirdPartyLicenseAssignmentFailed)\n        {\n            return (thirdPartyLicenseAssignmentFailed != null && ((this.Host == null && thirdPartyLicenseAssignmentFailed.Host == null) || (this.Host != null && this.Host.Equals(thirdPartyLicenseAssignmentFailed.Host))) && this.Module == thirdPartyLicenseAssignmentFailed.Module && this.Reason == thirdPartyLicenseAssignmentFailed.Reason && ((this.LinkedView == null && thirdPartyLicenseAssignmentFailed.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(thirdPartyLicenseAssignmentFailed.LinkedView))));\n        }\n\n        public override bool Equals(object thirdPartyLicenseAssignmentFailed)\n        {\n            return Equals(thirdPartyLicenseAssignmentFailed as ThirdPartyLicenseAssignmentFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Module + \"_\" + Reason + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ThirdPartyLicenseAssignmentFailed_LinkedView : IEquatable<ThirdPartyLicenseAssignmentFailed_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(ThirdPartyLicenseAssignmentFailed_LinkedView thirdPartyLicenseAssignmentFailed_LinkedView)\n        {\n            return (thirdPartyLicenseAssignmentFailed_LinkedView != null && ((this.Host == null && thirdPartyLicenseAssignmentFailed_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(thirdPartyLicenseAssignmentFailed_LinkedView.Host))));\n        }\n\n        public override bool Equals(object thirdPartyLicenseAssignmentFailed_LinkedView)\n        {\n            return Equals(thirdPartyLicenseAssignmentFailed_LinkedView as ThirdPartyLicenseAssignmentFailed_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class TicketedSessionAuthentication : GuestAuthentication, IEquatable<TicketedSessionAuthentication>\n    {\n        public string Ticket { get; set; }\n\n        public bool Equals(TicketedSessionAuthentication ticketedSessionAuthentication)\n        {\n            return (ticketedSessionAuthentication != null && this.Ticket == ticketedSessionAuthentication.Ticket);\n        }\n\n        public override bool Equals(object ticketedSessionAuthentication)\n        {\n            return Equals(ticketedSessionAuthentication as TicketedSessionAuthentication);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ticket).GetHashCode();\n        }\n    }\n\n    public class Timedout : VimFault, IEquatable<Timedout>\n    {\n        public bool Equals(Timedout timedout)\n        {\n            return (timedout != null && base.Equals(timedout));\n        }\n\n        public override bool Equals(object timedout)\n        {\n            return Equals(timedout as Timedout);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TimedOutHostOperationEvent : HostEvent, IEquatable<TimedOutHostOperationEvent>\n    {\n        public bool Equals(TimedOutHostOperationEvent timedOutHostOperationEvent)\n        {\n            return (timedOutHostOperationEvent != null && base.Equals(timedOutHostOperationEvent));\n        }\n\n        public override bool Equals(object timedOutHostOperationEvent)\n        {\n            return Equals(timedOutHostOperationEvent as TimedOutHostOperationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsAlreadyUpgraded : VmToolsUpgradeFault, IEquatable<ToolsAlreadyUpgraded>\n    {\n        public bool Equals(ToolsAlreadyUpgraded toolsAlreadyUpgraded)\n        {\n            return (toolsAlreadyUpgraded != null && base.Equals(toolsAlreadyUpgraded));\n        }\n\n        public override bool Equals(object toolsAlreadyUpgraded)\n        {\n            return Equals(toolsAlreadyUpgraded as ToolsAlreadyUpgraded);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsAutoUpgradeNotSupported : VmToolsUpgradeFault, IEquatable<ToolsAutoUpgradeNotSupported>\n    {\n        public bool Equals(ToolsAutoUpgradeNotSupported toolsAutoUpgradeNotSupported)\n        {\n            return (toolsAutoUpgradeNotSupported != null && base.Equals(toolsAutoUpgradeNotSupported));\n        }\n\n        public override bool Equals(object toolsAutoUpgradeNotSupported)\n        {\n            return Equals(toolsAutoUpgradeNotSupported as ToolsAutoUpgradeNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsConfigInfo : DynamicData, IEquatable<ToolsConfigInfo>\n    {\n        public int? ToolsVersion { get; set; }\n\n        public string ToolsInstallType { get; set; }\n\n        public bool? AfterPowerOn { get; set; }\n\n        public bool? AfterResume { get; set; }\n\n        public bool? BeforeGuestStandby { get; set; }\n\n        public bool? BeforeGuestShutdown { get; set; }\n\n        public bool? BeforeGuestReboot { get; set; }\n\n        public string ToolsUpgradePolicy { get; set; }\n\n        public string PendingCustomization { get; set; }\n\n        public CryptoKeyId CustomizationKeyId { get; set; }\n\n        public bool? SyncTimeWithHost { get; set; }\n\n        public ToolsConfigInfoToolsLastInstallInfo LastInstallInfo { get; set; }\n\n        public bool Equals(ToolsConfigInfo toolsConfigInfo)\n        {\n            return (toolsConfigInfo != null && ((this.ToolsVersion == null && toolsConfigInfo.ToolsVersion == null) || (this.ToolsVersion != null && this.ToolsVersion.Equals(toolsConfigInfo.ToolsVersion))) && this.ToolsInstallType == toolsConfigInfo.ToolsInstallType && ((this.AfterPowerOn == null && toolsConfigInfo.AfterPowerOn == null) || (this.AfterPowerOn != null && this.AfterPowerOn.Equals(toolsConfigInfo.AfterPowerOn))) && ((this.AfterResume == null && toolsConfigInfo.AfterResume == null) || (this.AfterResume != null && this.AfterResume.Equals(toolsConfigInfo.AfterResume))) && ((this.BeforeGuestStandby == null && toolsConfigInfo.BeforeGuestStandby == null) || (this.BeforeGuestStandby != null && this.BeforeGuestStandby.Equals(toolsConfigInfo.BeforeGuestStandby))) && ((this.BeforeGuestShutdown == null && toolsConfigInfo.BeforeGuestShutdown == null) || (this.BeforeGuestShutdown != null && this.BeforeGuestShutdown.Equals(toolsConfigInfo.BeforeGuestShutdown))) && ((this.BeforeGuestReboot == null && toolsConfigInfo.BeforeGuestReboot == null) || (this.BeforeGuestReboot != null && this.BeforeGuestReboot.Equals(toolsConfigInfo.BeforeGuestReboot))) && this.ToolsUpgradePolicy == toolsConfigInfo.ToolsUpgradePolicy && this.PendingCustomization == toolsConfigInfo.PendingCustomization && ((this.CustomizationKeyId == null && toolsConfigInfo.CustomizationKeyId == null) || (this.CustomizationKeyId != null && this.CustomizationKeyId.Equals(toolsConfigInfo.CustomizationKeyId))) && ((this.SyncTimeWithHost == null && toolsConfigInfo.SyncTimeWithHost == null) || (this.SyncTimeWithHost != null && this.SyncTimeWithHost.Equals(toolsConfigInfo.SyncTimeWithHost))) && ((this.LastInstallInfo == null && toolsConfigInfo.LastInstallInfo == null) || (this.LastInstallInfo != null && this.LastInstallInfo.Equals(toolsConfigInfo.LastInstallInfo))));\n        }\n\n        public override bool Equals(object toolsConfigInfo)\n        {\n            return Equals(toolsConfigInfo as ToolsConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ToolsVersion + \"_\" + ToolsInstallType + \"_\" + AfterPowerOn + \"_\" + AfterResume + \"_\" + BeforeGuestStandby + \"_\" + BeforeGuestShutdown + \"_\" + BeforeGuestReboot + \"_\" + ToolsUpgradePolicy + \"_\" + PendingCustomization + \"_\" + CustomizationKeyId + \"_\" + SyncTimeWithHost + \"_\" + LastInstallInfo).GetHashCode();\n        }\n    }\n\n    public class ToolsConfigInfoToolsLastInstallInfo : DynamicData, IEquatable<ToolsConfigInfoToolsLastInstallInfo>\n    {\n        public int Counter { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(ToolsConfigInfoToolsLastInstallInfo toolsConfigInfoToolsLastInstallInfo)\n        {\n            return (toolsConfigInfoToolsLastInstallInfo != null && this.Counter == toolsConfigInfoToolsLastInstallInfo.Counter && ((this.Fault == null && toolsConfigInfoToolsLastInstallInfo.Fault == null) || (this.Fault != null && this.Fault.Equals(toolsConfigInfoToolsLastInstallInfo.Fault))));\n        }\n\n        public override bool Equals(object toolsConfigInfoToolsLastInstallInfo)\n        {\n            return Equals(toolsConfigInfoToolsLastInstallInfo as ToolsConfigInfoToolsLastInstallInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Counter + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class ToolsImageCopyFailed : VmToolsUpgradeFault, IEquatable<ToolsImageCopyFailed>\n    {\n        public bool Equals(ToolsImageCopyFailed toolsImageCopyFailed)\n        {\n            return (toolsImageCopyFailed != null && base.Equals(toolsImageCopyFailed));\n        }\n\n        public override bool Equals(object toolsImageCopyFailed)\n        {\n            return Equals(toolsImageCopyFailed as ToolsImageCopyFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsImageNotAvailable : VmToolsUpgradeFault, IEquatable<ToolsImageNotAvailable>\n    {\n        public bool Equals(ToolsImageNotAvailable toolsImageNotAvailable)\n        {\n            return (toolsImageNotAvailable != null && base.Equals(toolsImageNotAvailable));\n        }\n\n        public override bool Equals(object toolsImageNotAvailable)\n        {\n            return Equals(toolsImageNotAvailable as ToolsImageNotAvailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsImageSignatureCheckFailed : VmToolsUpgradeFault, IEquatable<ToolsImageSignatureCheckFailed>\n    {\n        public bool Equals(ToolsImageSignatureCheckFailed toolsImageSignatureCheckFailed)\n        {\n            return (toolsImageSignatureCheckFailed != null && base.Equals(toolsImageSignatureCheckFailed));\n        }\n\n        public override bool Equals(object toolsImageSignatureCheckFailed)\n        {\n            return Equals(toolsImageSignatureCheckFailed as ToolsImageSignatureCheckFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsInstallationInProgress : MigrationFault, IEquatable<ToolsInstallationInProgress>\n    {\n        public bool Equals(ToolsInstallationInProgress toolsInstallationInProgress)\n        {\n            return (toolsInstallationInProgress != null && base.Equals(toolsInstallationInProgress));\n        }\n\n        public override bool Equals(object toolsInstallationInProgress)\n        {\n            return Equals(toolsInstallationInProgress as ToolsInstallationInProgress);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsUnavailable : VimFault, IEquatable<ToolsUnavailable>\n    {\n        public bool Equals(ToolsUnavailable toolsUnavailable)\n        {\n            return (toolsUnavailable != null && base.Equals(toolsUnavailable));\n        }\n\n        public override bool Equals(object toolsUnavailable)\n        {\n            return Equals(toolsUnavailable as ToolsUnavailable);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ToolsUpgradeCancelled : VmToolsUpgradeFault, IEquatable<ToolsUpgradeCancelled>\n    {\n        public bool Equals(ToolsUpgradeCancelled toolsUpgradeCancelled)\n        {\n            return (toolsUpgradeCancelled != null && base.Equals(toolsUpgradeCancelled));\n        }\n\n        public override bool Equals(object toolsUpgradeCancelled)\n        {\n            return Equals(toolsUpgradeCancelled as ToolsUpgradeCancelled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyConcurrentNativeClones : FileFault, IEquatable<TooManyConcurrentNativeClones>\n    {\n        public bool Equals(TooManyConcurrentNativeClones tooManyConcurrentNativeClones)\n        {\n            return (tooManyConcurrentNativeClones != null && base.Equals(tooManyConcurrentNativeClones));\n        }\n\n        public override bool Equals(object tooManyConcurrentNativeClones)\n        {\n            return Equals(tooManyConcurrentNativeClones as TooManyConcurrentNativeClones);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyConsecutiveOverrides : VimFault, IEquatable<TooManyConsecutiveOverrides>\n    {\n        public bool Equals(TooManyConsecutiveOverrides tooManyConsecutiveOverrides)\n        {\n            return (tooManyConsecutiveOverrides != null && base.Equals(tooManyConsecutiveOverrides));\n        }\n\n        public override bool Equals(object tooManyConsecutiveOverrides)\n        {\n            return Equals(tooManyConsecutiveOverrides as TooManyConsecutiveOverrides);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyDevices : InvalidVmConfig, IEquatable<TooManyDevices>\n    {\n        public bool Equals(TooManyDevices tooManyDevices)\n        {\n            return (tooManyDevices != null && base.Equals(tooManyDevices));\n        }\n\n        public override bool Equals(object tooManyDevices)\n        {\n            return Equals(tooManyDevices as TooManyDevices);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyDisksOnLegacyHost : MigrationFault, IEquatable<TooManyDisksOnLegacyHost>\n    {\n        public int DiskCount { get; set; }\n\n        public bool TimeoutDanger { get; set; }\n\n        public bool Equals(TooManyDisksOnLegacyHost tooManyDisksOnLegacyHost)\n        {\n            return (tooManyDisksOnLegacyHost != null && this.DiskCount == tooManyDisksOnLegacyHost.DiskCount && this.TimeoutDanger == tooManyDisksOnLegacyHost.TimeoutDanger);\n        }\n\n        public override bool Equals(object tooManyDisksOnLegacyHost)\n        {\n            return Equals(tooManyDisksOnLegacyHost as TooManyDisksOnLegacyHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskCount + \"_\" + TimeoutDanger).GetHashCode();\n        }\n    }\n\n    public class TooManyGuestLogons : GuestOperationsFault, IEquatable<TooManyGuestLogons>\n    {\n        public bool Equals(TooManyGuestLogons tooManyGuestLogons)\n        {\n            return (tooManyGuestLogons != null && base.Equals(tooManyGuestLogons));\n        }\n\n        public override bool Equals(object tooManyGuestLogons)\n        {\n            return Equals(tooManyGuestLogons as TooManyGuestLogons);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyHosts : HostConnectFault, IEquatable<TooManyHosts>\n    {\n        public bool Equals(TooManyHosts tooManyHosts)\n        {\n            return (tooManyHosts != null && base.Equals(tooManyHosts));\n        }\n\n        public override bool Equals(object tooManyHosts)\n        {\n            return Equals(tooManyHosts as TooManyHosts);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyNativeCloneLevels : FileFault, IEquatable<TooManyNativeCloneLevels>\n    {\n        public bool Equals(TooManyNativeCloneLevels tooManyNativeCloneLevels)\n        {\n            return (tooManyNativeCloneLevels != null && base.Equals(tooManyNativeCloneLevels));\n        }\n\n        public override bool Equals(object tooManyNativeCloneLevels)\n        {\n            return Equals(tooManyNativeCloneLevels as TooManyNativeCloneLevels);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManyNativeClonesOnFile : FileFault, IEquatable<TooManyNativeClonesOnFile>\n    {\n        public bool Equals(TooManyNativeClonesOnFile tooManyNativeClonesOnFile)\n        {\n            return (tooManyNativeClonesOnFile != null && base.Equals(tooManyNativeClonesOnFile));\n        }\n\n        public override bool Equals(object tooManyNativeClonesOnFile)\n        {\n            return Equals(tooManyNativeClonesOnFile as TooManyNativeClonesOnFile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TooManySnapshotLevels : SnapshotFault, IEquatable<TooManySnapshotLevels>\n    {\n        public bool Equals(TooManySnapshotLevels tooManySnapshotLevels)\n        {\n            return (tooManySnapshotLevels != null && base.Equals(tooManySnapshotLevels));\n        }\n\n        public override bool Equals(object tooManySnapshotLevels)\n        {\n            return Equals(tooManySnapshotLevels as TooManySnapshotLevels);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TraversalSpec : SelectionSpec, IEquatable<TraversalSpec>\n    {\n        public string Type { get; set; }\n\n        public string Path { get; set; }\n\n        public bool? Skip { get; set; }\n\n        public SelectionSpec[] SelectSet { get; set; }\n\n        public bool Equals(TraversalSpec traversalSpec)\n        {\n            return (traversalSpec != null && this.Type == traversalSpec.Type && this.Path == traversalSpec.Path && ((this.Skip == null && traversalSpec.Skip == null) || (this.Skip != null && this.Skip.Equals(traversalSpec.Skip))) && ((this.SelectSet == null && traversalSpec.SelectSet == null) || (this.SelectSet != null && traversalSpec.SelectSet != null && Enumerable.SequenceEqual(this.SelectSet, traversalSpec.SelectSet))));\n        }\n\n        public override bool Equals(object traversalSpec)\n        {\n            return Equals(traversalSpec as TraversalSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Path + \"_\" + Skip + \"_\" + SelectSet).GetHashCode();\n        }\n    }\n\n    public class TypeDescription : Description, IEquatable<TypeDescription>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(TypeDescription typeDescription)\n        {\n            return (typeDescription != null && this.Key == typeDescription.Key);\n        }\n\n        public override bool Equals(object typeDescription)\n        {\n            return Equals(typeDescription as TypeDescription);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class UncommittedUndoableDisk : MigrationFault, IEquatable<UncommittedUndoableDisk>\n    {\n        public bool Equals(UncommittedUndoableDisk uncommittedUndoableDisk)\n        {\n            return (uncommittedUndoableDisk != null && base.Equals(uncommittedUndoableDisk));\n        }\n\n        public override bool Equals(object uncommittedUndoableDisk)\n        {\n            return Equals(uncommittedUndoableDisk as UncommittedUndoableDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UnconfiguredPropertyValue : InvalidPropertyValue, IEquatable<UnconfiguredPropertyValue>\n    {\n        public bool Equals(UnconfiguredPropertyValue unconfiguredPropertyValue)\n        {\n            return (unconfiguredPropertyValue != null && base.Equals(unconfiguredPropertyValue));\n        }\n\n        public override bool Equals(object unconfiguredPropertyValue)\n        {\n            return Equals(unconfiguredPropertyValue as UnconfiguredPropertyValue);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UncustomizableGuest : CustomizationFault, IEquatable<UncustomizableGuest>\n    {\n        public string UncustomizableGuestOS { get; set; }\n\n        public bool Equals(UncustomizableGuest uncustomizableGuest)\n        {\n            return (uncustomizableGuest != null && this.UncustomizableGuestOS == uncustomizableGuest.UncustomizableGuestOS);\n        }\n\n        public override bool Equals(object uncustomizableGuest)\n        {\n            return Equals(uncustomizableGuest as UncustomizableGuest);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UncustomizableGuestOS).GetHashCode();\n        }\n    }\n\n    public class UnexpectedCustomizationFault : CustomizationFault, IEquatable<UnexpectedCustomizationFault>\n    {\n        public bool Equals(UnexpectedCustomizationFault unexpectedCustomizationFault)\n        {\n            return (unexpectedCustomizationFault != null && base.Equals(unexpectedCustomizationFault));\n        }\n\n        public override bool Equals(object unexpectedCustomizationFault)\n        {\n            return Equals(unexpectedCustomizationFault as UnexpectedCustomizationFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UnexpectedFault : RuntimeFault, IEquatable<UnexpectedFault>\n    {\n        public string FaultName { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(UnexpectedFault unexpectedFault)\n        {\n            return (unexpectedFault != null && this.FaultName == unexpectedFault.FaultName && ((this.Fault == null && unexpectedFault.Fault == null) || (this.Fault != null && this.Fault.Equals(unexpectedFault.Fault))));\n        }\n\n        public override bool Equals(object unexpectedFault)\n        {\n            return Equals(unexpectedFault as UnexpectedFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FaultName + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class UnlicensedVirtualMachinesEvent : LicenseEvent, IEquatable<UnlicensedVirtualMachinesEvent>\n    {\n        public int Unlicensed { get; set; }\n\n        public int Available { get; set; }\n\n        public bool Equals(UnlicensedVirtualMachinesEvent unlicensedVirtualMachinesEvent)\n        {\n            return (unlicensedVirtualMachinesEvent != null && this.Unlicensed == unlicensedVirtualMachinesEvent.Unlicensed && this.Available == unlicensedVirtualMachinesEvent.Available);\n        }\n\n        public override bool Equals(object unlicensedVirtualMachinesEvent)\n        {\n            return Equals(unlicensedVirtualMachinesEvent as UnlicensedVirtualMachinesEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Unlicensed + \"_\" + Available).GetHashCode();\n        }\n    }\n\n    public class UnlicensedVirtualMachinesFoundEvent : LicenseEvent, IEquatable<UnlicensedVirtualMachinesFoundEvent>\n    {\n        public int Available { get; set; }\n\n        public bool Equals(UnlicensedVirtualMachinesFoundEvent unlicensedVirtualMachinesFoundEvent)\n        {\n            return (unlicensedVirtualMachinesFoundEvent != null && this.Available == unlicensedVirtualMachinesFoundEvent.Available);\n        }\n\n        public override bool Equals(object unlicensedVirtualMachinesFoundEvent)\n        {\n            return Equals(unlicensedVirtualMachinesFoundEvent as UnlicensedVirtualMachinesFoundEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Available).GetHashCode();\n        }\n    }\n\n    public class UnrecognizedHost : VimFault, IEquatable<UnrecognizedHost>\n    {\n        public string HostName { get; set; }\n\n        public bool Equals(UnrecognizedHost unrecognizedHost)\n        {\n            return (unrecognizedHost != null && this.HostName == unrecognizedHost.HostName);\n        }\n\n        public override bool Equals(object unrecognizedHost)\n        {\n            return Equals(unrecognizedHost as UnrecognizedHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName).GetHashCode();\n        }\n    }\n\n    public class UnsharedSwapVMotionNotSupported : MigrationFeatureNotSupported, IEquatable<UnsharedSwapVMotionNotSupported>\n    {\n        public new UnsharedSwapVMotionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(UnsharedSwapVMotionNotSupported unsharedSwapVMotionNotSupported)\n        {\n            return (unsharedSwapVMotionNotSupported != null && ((this.LinkedView == null && unsharedSwapVMotionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(unsharedSwapVMotionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object unsharedSwapVMotionNotSupported)\n        {\n            return Equals(unsharedSwapVMotionNotSupported as UnsharedSwapVMotionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class UnsharedSwapVMotionNotSupported_LinkedView : MigrationFeatureNotSupported_LinkedView, IEquatable<UnsharedSwapVMotionNotSupported_LinkedView>\n    {\n        public bool Equals(UnsharedSwapVMotionNotSupported_LinkedView unsharedSwapVMotionNotSupported_LinkedView)\n        {\n            return (unsharedSwapVMotionNotSupported_LinkedView != null && base.Equals(unsharedSwapVMotionNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object unsharedSwapVMotionNotSupported_LinkedView)\n        {\n            return Equals(unsharedSwapVMotionNotSupported_LinkedView as UnsharedSwapVMotionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UnsupportedDatastore : VmConfigFault, IEquatable<UnsupportedDatastore>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public UnsupportedDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(UnsupportedDatastore unsupportedDatastore)\n        {\n            return (unsupportedDatastore != null && ((this.Datastore == null && unsupportedDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(unsupportedDatastore.Datastore))) && ((this.LinkedView == null && unsupportedDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(unsupportedDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object unsupportedDatastore)\n        {\n            return Equals(unsupportedDatastore as UnsupportedDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class UnsupportedDatastore_LinkedView : IEquatable<UnsupportedDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(UnsupportedDatastore_LinkedView unsupportedDatastore_LinkedView)\n        {\n            return (unsupportedDatastore_LinkedView != null && ((this.Datastore == null && unsupportedDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(unsupportedDatastore_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object unsupportedDatastore_LinkedView)\n        {\n            return Equals(unsupportedDatastore_LinkedView as UnsupportedDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class UnSupportedDatastoreForVFlash : UnsupportedDatastore, IEquatable<UnSupportedDatastoreForVFlash>\n    {\n        public string DatastoreName { get; set; }\n\n        public string Type { get; set; }\n\n        public new UnSupportedDatastoreForVFlash_LinkedView LinkedView { get; set; }\n\n        public bool Equals(UnSupportedDatastoreForVFlash unSupportedDatastoreForVFlash)\n        {\n            return (unSupportedDatastoreForVFlash != null && this.DatastoreName == unSupportedDatastoreForVFlash.DatastoreName && this.Type == unSupportedDatastoreForVFlash.Type && ((this.LinkedView == null && unSupportedDatastoreForVFlash.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(unSupportedDatastoreForVFlash.LinkedView))));\n        }\n\n        public override bool Equals(object unSupportedDatastoreForVFlash)\n        {\n            return Equals(unSupportedDatastoreForVFlash as UnSupportedDatastoreForVFlash);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreName + \"_\" + Type + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class UnSupportedDatastoreForVFlash_LinkedView : UnsupportedDatastore_LinkedView, IEquatable<UnSupportedDatastoreForVFlash_LinkedView>\n    {\n        public bool Equals(UnSupportedDatastoreForVFlash_LinkedView unSupportedDatastoreForVFlash_LinkedView)\n        {\n            return (unSupportedDatastoreForVFlash_LinkedView != null && base.Equals(unSupportedDatastoreForVFlash_LinkedView));\n        }\n\n        public override bool Equals(object unSupportedDatastoreForVFlash_LinkedView)\n        {\n            return Equals(unSupportedDatastoreForVFlash_LinkedView as UnSupportedDatastoreForVFlash_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UnsupportedGuest : InvalidVmConfig, IEquatable<UnsupportedGuest>\n    {\n        public string UnsupportedGuestOS { get; set; }\n\n        public bool Equals(UnsupportedGuest unsupportedGuest)\n        {\n            return (unsupportedGuest != null && this.UnsupportedGuestOS == unsupportedGuest.UnsupportedGuestOS);\n        }\n\n        public override bool Equals(object unsupportedGuest)\n        {\n            return Equals(unsupportedGuest as UnsupportedGuest);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UnsupportedGuestOS).GetHashCode();\n        }\n    }\n\n    public class UnsupportedVimApiVersion : VimFault, IEquatable<UnsupportedVimApiVersion>\n    {\n        public string Version { get; set; }\n\n        public bool Equals(UnsupportedVimApiVersion unsupportedVimApiVersion)\n        {\n            return (unsupportedVimApiVersion != null && this.Version == unsupportedVimApiVersion.Version);\n        }\n\n        public override bool Equals(object unsupportedVimApiVersion)\n        {\n            return Equals(unsupportedVimApiVersion as UnsupportedVimApiVersion);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version).GetHashCode();\n        }\n    }\n\n    public class UnsupportedVmxLocation : VmConfigFault, IEquatable<UnsupportedVmxLocation>\n    {\n        public bool Equals(UnsupportedVmxLocation unsupportedVmxLocation)\n        {\n            return (unsupportedVmxLocation != null && base.Equals(unsupportedVmxLocation));\n        }\n\n        public override bool Equals(object unsupportedVmxLocation)\n        {\n            return Equals(unsupportedVmxLocation as UnsupportedVmxLocation);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UnusedVirtualDiskBlocksNotScrubbed : DeviceBackingNotSupported, IEquatable<UnusedVirtualDiskBlocksNotScrubbed>\n    {\n        public bool Equals(UnusedVirtualDiskBlocksNotScrubbed unusedVirtualDiskBlocksNotScrubbed)\n        {\n            return (unusedVirtualDiskBlocksNotScrubbed != null && base.Equals(unusedVirtualDiskBlocksNotScrubbed));\n        }\n\n        public override bool Equals(object unusedVirtualDiskBlocksNotScrubbed)\n        {\n            return Equals(unusedVirtualDiskBlocksNotScrubbed as UnusedVirtualDiskBlocksNotScrubbed);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UpdatedAgentBeingRestartedEvent : HostEvent, IEquatable<UpdatedAgentBeingRestartedEvent>\n    {\n        public bool Equals(UpdatedAgentBeingRestartedEvent updatedAgentBeingRestartedEvent)\n        {\n            return (updatedAgentBeingRestartedEvent != null && base.Equals(updatedAgentBeingRestartedEvent));\n        }\n\n        public override bool Equals(object updatedAgentBeingRestartedEvent)\n        {\n            return Equals(updatedAgentBeingRestartedEvent as UpdatedAgentBeingRestartedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UpdateSet : DynamicData, IEquatable<UpdateSet>\n    {\n        public string Version { get; set; }\n\n        public PropertyFilterUpdate[] FilterSet { get; set; }\n\n        public bool? Truncated { get; set; }\n\n        public bool Equals(UpdateSet updateSet)\n        {\n            return (updateSet != null && this.Version == updateSet.Version && ((this.FilterSet == null && updateSet.FilterSet == null) || (this.FilterSet != null && updateSet.FilterSet != null && Enumerable.SequenceEqual(this.FilterSet, updateSet.FilterSet))) && ((this.Truncated == null && updateSet.Truncated == null) || (this.Truncated != null && this.Truncated.Equals(updateSet.Truncated))));\n        }\n\n        public override bool Equals(object updateSet)\n        {\n            return Equals(updateSet as UpdateSet);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version + \"_\" + FilterSet + \"_\" + Truncated).GetHashCode();\n        }\n    }\n\n    public class UpdateVirtualMachineFilesResult : DynamicData, IEquatable<UpdateVirtualMachineFilesResult>\n    {\n        public UpdateVirtualMachineFilesResultFailedVmFileInfo[] FailedVmFile { get; set; }\n\n        public bool Equals(UpdateVirtualMachineFilesResult updateVirtualMachineFilesResult)\n        {\n            return (updateVirtualMachineFilesResult != null && ((this.FailedVmFile == null && updateVirtualMachineFilesResult.FailedVmFile == null) || (this.FailedVmFile != null && updateVirtualMachineFilesResult.FailedVmFile != null && Enumerable.SequenceEqual(this.FailedVmFile, updateVirtualMachineFilesResult.FailedVmFile))));\n        }\n\n        public override bool Equals(object updateVirtualMachineFilesResult)\n        {\n            return Equals(updateVirtualMachineFilesResult as UpdateVirtualMachineFilesResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailedVmFile).GetHashCode();\n        }\n    }\n\n    public class UpdateVirtualMachineFilesResultFailedVmFileInfo : DynamicData, IEquatable<UpdateVirtualMachineFilesResultFailedVmFileInfo>\n    {\n        public string VmFile { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(UpdateVirtualMachineFilesResultFailedVmFileInfo updateVirtualMachineFilesResultFailedVmFileInfo)\n        {\n            return (updateVirtualMachineFilesResultFailedVmFileInfo != null && this.VmFile == updateVirtualMachineFilesResultFailedVmFileInfo.VmFile && ((this.Fault == null && updateVirtualMachineFilesResultFailedVmFileInfo.Fault == null) || (this.Fault != null && this.Fault.Equals(updateVirtualMachineFilesResultFailedVmFileInfo.Fault))));\n        }\n\n        public override bool Equals(object updateVirtualMachineFilesResultFailedVmFileInfo)\n        {\n            return Equals(updateVirtualMachineFilesResultFailedVmFileInfo as UpdateVirtualMachineFilesResultFailedVmFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmFile + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class UpgradeEvent : Event, IEquatable<UpgradeEvent>\n    {\n        public string Message { get; set; }\n\n        public bool Equals(UpgradeEvent upgradeEvent)\n        {\n            return (upgradeEvent != null && this.Message == upgradeEvent.Message);\n        }\n\n        public override bool Equals(object upgradeEvent)\n        {\n            return Equals(upgradeEvent as UpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message).GetHashCode();\n        }\n    }\n\n    public class UplinkPortMtuNotSupportEvent : DvsHealthStatusChangeEvent, IEquatable<UplinkPortMtuNotSupportEvent>\n    {\n        public bool Equals(UplinkPortMtuNotSupportEvent uplinkPortMtuNotSupportEvent)\n        {\n            return (uplinkPortMtuNotSupportEvent != null && base.Equals(uplinkPortMtuNotSupportEvent));\n        }\n\n        public override bool Equals(object uplinkPortMtuNotSupportEvent)\n        {\n            return Equals(uplinkPortMtuNotSupportEvent as UplinkPortMtuNotSupportEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UplinkPortMtuSupportEvent : DvsHealthStatusChangeEvent, IEquatable<UplinkPortMtuSupportEvent>\n    {\n        public bool Equals(UplinkPortMtuSupportEvent uplinkPortMtuSupportEvent)\n        {\n            return (uplinkPortMtuSupportEvent != null && base.Equals(uplinkPortMtuSupportEvent));\n        }\n\n        public override bool Equals(object uplinkPortMtuSupportEvent)\n        {\n            return Equals(uplinkPortMtuSupportEvent as UplinkPortMtuSupportEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UplinkPortVlanTrunkedEvent : DvsHealthStatusChangeEvent, IEquatable<UplinkPortVlanTrunkedEvent>\n    {\n        public bool Equals(UplinkPortVlanTrunkedEvent uplinkPortVlanTrunkedEvent)\n        {\n            return (uplinkPortVlanTrunkedEvent != null && base.Equals(uplinkPortVlanTrunkedEvent));\n        }\n\n        public override bool Equals(object uplinkPortVlanTrunkedEvent)\n        {\n            return Equals(uplinkPortVlanTrunkedEvent as UplinkPortVlanTrunkedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UplinkPortVlanUntrunkedEvent : DvsHealthStatusChangeEvent, IEquatable<UplinkPortVlanUntrunkedEvent>\n    {\n        public bool Equals(UplinkPortVlanUntrunkedEvent uplinkPortVlanUntrunkedEvent)\n        {\n            return (uplinkPortVlanUntrunkedEvent != null && base.Equals(uplinkPortVlanUntrunkedEvent));\n        }\n\n        public override bool Equals(object uplinkPortVlanUntrunkedEvent)\n        {\n            return Equals(uplinkPortVlanUntrunkedEvent as UplinkPortVlanUntrunkedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class UsbScanCodeSpec : DynamicData, IEquatable<UsbScanCodeSpec>\n    {\n        public UsbScanCodeSpecKeyEvent[] KeyEvents { get; set; }\n\n        public bool Equals(UsbScanCodeSpec usbScanCodeSpec)\n        {\n            return (usbScanCodeSpec != null && ((this.KeyEvents == null && usbScanCodeSpec.KeyEvents == null) || (this.KeyEvents != null && usbScanCodeSpec.KeyEvents != null && Enumerable.SequenceEqual(this.KeyEvents, usbScanCodeSpec.KeyEvents))));\n        }\n\n        public override bool Equals(object usbScanCodeSpec)\n        {\n            return Equals(usbScanCodeSpec as UsbScanCodeSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyEvents).GetHashCode();\n        }\n    }\n\n    public class UsbScanCodeSpecKeyEvent : DynamicData, IEquatable<UsbScanCodeSpecKeyEvent>\n    {\n        public int UsbHidCode { get; set; }\n\n        public UsbScanCodeSpecModifierType Modifiers { get; set; }\n\n        public bool Equals(UsbScanCodeSpecKeyEvent usbScanCodeSpecKeyEvent)\n        {\n            return (usbScanCodeSpecKeyEvent != null && this.UsbHidCode == usbScanCodeSpecKeyEvent.UsbHidCode && ((this.Modifiers == null && usbScanCodeSpecKeyEvent.Modifiers == null) || (this.Modifiers != null && this.Modifiers.Equals(usbScanCodeSpecKeyEvent.Modifiers))));\n        }\n\n        public override bool Equals(object usbScanCodeSpecKeyEvent)\n        {\n            return Equals(usbScanCodeSpecKeyEvent as UsbScanCodeSpecKeyEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UsbHidCode + \"_\" + Modifiers).GetHashCode();\n        }\n    }\n\n    public class UsbScanCodeSpecModifierType : DynamicData, IEquatable<UsbScanCodeSpecModifierType>\n    {\n        public bool? LeftControl { get; set; }\n\n        public bool? LeftShift { get; set; }\n\n        public bool? LeftAlt { get; set; }\n\n        public bool? LeftGui { get; set; }\n\n        public bool? RightControl { get; set; }\n\n        public bool? RightShift { get; set; }\n\n        public bool? RightAlt { get; set; }\n\n        public bool? RightGui { get; set; }\n\n        public bool Equals(UsbScanCodeSpecModifierType usbScanCodeSpecModifierType)\n        {\n            return (usbScanCodeSpecModifierType != null && ((this.LeftControl == null && usbScanCodeSpecModifierType.LeftControl == null) || (this.LeftControl != null && this.LeftControl.Equals(usbScanCodeSpecModifierType.LeftControl))) && ((this.LeftShift == null && usbScanCodeSpecModifierType.LeftShift == null) || (this.LeftShift != null && this.LeftShift.Equals(usbScanCodeSpecModifierType.LeftShift))) && ((this.LeftAlt == null && usbScanCodeSpecModifierType.LeftAlt == null) || (this.LeftAlt != null && this.LeftAlt.Equals(usbScanCodeSpecModifierType.LeftAlt))) && ((this.LeftGui == null && usbScanCodeSpecModifierType.LeftGui == null) || (this.LeftGui != null && this.LeftGui.Equals(usbScanCodeSpecModifierType.LeftGui))) && ((this.RightControl == null && usbScanCodeSpecModifierType.RightControl == null) || (this.RightControl != null && this.RightControl.Equals(usbScanCodeSpecModifierType.RightControl))) && ((this.RightShift == null && usbScanCodeSpecModifierType.RightShift == null) || (this.RightShift != null && this.RightShift.Equals(usbScanCodeSpecModifierType.RightShift))) && ((this.RightAlt == null && usbScanCodeSpecModifierType.RightAlt == null) || (this.RightAlt != null && this.RightAlt.Equals(usbScanCodeSpecModifierType.RightAlt))) && ((this.RightGui == null && usbScanCodeSpecModifierType.RightGui == null) || (this.RightGui != null && this.RightGui.Equals(usbScanCodeSpecModifierType.RightGui))));\n        }\n\n        public override bool Equals(object usbScanCodeSpecModifierType)\n        {\n            return Equals(usbScanCodeSpecModifierType as UsbScanCodeSpecModifierType);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LeftControl + \"_\" + LeftShift + \"_\" + LeftAlt + \"_\" + LeftGui + \"_\" + RightControl + \"_\" + RightShift + \"_\" + RightAlt + \"_\" + RightGui).GetHashCode();\n        }\n    }\n\n    public class UserAssignedToGroup : HostEvent, IEquatable<UserAssignedToGroup>\n    {\n        public string UserLogin { get; set; }\n\n        public string Group { get; set; }\n\n        public bool Equals(UserAssignedToGroup userAssignedToGroup)\n        {\n            return (userAssignedToGroup != null && this.UserLogin == userAssignedToGroup.UserLogin && this.Group == userAssignedToGroup.Group);\n        }\n\n        public override bool Equals(object userAssignedToGroup)\n        {\n            return Equals(userAssignedToGroup as UserAssignedToGroup);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserLogin + \"_\" + Group).GetHashCode();\n        }\n    }\n\n    public class UserDirectory : ViewBase, IEquatable<UserDirectory>\n    {\n        public string[] DomainList { get; set; }\n\n        public UserSearchResult[] RetrieveUserGroups(string domain, string searchStr, string belongsToGroup, string belongsToUser, bool exactMatch, bool findUsers, bool findGroups)\n        {\n            return default(UserSearchResult[]);\n        }\n\n        public bool Equals(UserDirectory userDirectory)\n        {\n            return (userDirectory != null && ((this.DomainList == null && userDirectory.DomainList == null) || (this.DomainList != null && userDirectory.DomainList != null && Enumerable.SequenceEqual(this.DomainList, userDirectory.DomainList))));\n        }\n\n        public override bool Equals(object userDirectory)\n        {\n            return Equals(userDirectory as UserDirectory);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DomainList).GetHashCode();\n        }\n    }\n\n    public class UserGroupProfile : ApplyProfile, IEquatable<UserGroupProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(UserGroupProfile userGroupProfile)\n        {\n            return (userGroupProfile != null && this.Key == userGroupProfile.Key);\n        }\n\n        public override bool Equals(object userGroupProfile)\n        {\n            return Equals(userGroupProfile as UserGroupProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class UserInputRequiredParameterMetadata : ProfilePolicyOptionMetadata, IEquatable<UserInputRequiredParameterMetadata>\n    {\n        public ProfileParameterMetadata[] UserInputParameter { get; set; }\n\n        public bool Equals(UserInputRequiredParameterMetadata userInputRequiredParameterMetadata)\n        {\n            return (userInputRequiredParameterMetadata != null && ((this.UserInputParameter == null && userInputRequiredParameterMetadata.UserInputParameter == null) || (this.UserInputParameter != null && userInputRequiredParameterMetadata.UserInputParameter != null && Enumerable.SequenceEqual(this.UserInputParameter, userInputRequiredParameterMetadata.UserInputParameter))));\n        }\n\n        public override bool Equals(object userInputRequiredParameterMetadata)\n        {\n            return Equals(userInputRequiredParameterMetadata as UserInputRequiredParameterMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserInputParameter).GetHashCode();\n        }\n    }\n\n    public class UserLoginSessionEvent : SessionEvent, IEquatable<UserLoginSessionEvent>\n    {\n        public string IpAddress { get; set; }\n\n        public string UserAgent { get; set; }\n\n        public string Locale { get; set; }\n\n        public string SessionId { get; set; }\n\n        public bool Equals(UserLoginSessionEvent userLoginSessionEvent)\n        {\n            return (userLoginSessionEvent != null && this.IpAddress == userLoginSessionEvent.IpAddress && this.UserAgent == userLoginSessionEvent.UserAgent && this.Locale == userLoginSessionEvent.Locale && this.SessionId == userLoginSessionEvent.SessionId);\n        }\n\n        public override bool Equals(object userLoginSessionEvent)\n        {\n            return Equals(userLoginSessionEvent as UserLoginSessionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + UserAgent + \"_\" + Locale + \"_\" + SessionId).GetHashCode();\n        }\n    }\n\n    public class UserLogoutSessionEvent : SessionEvent, IEquatable<UserLogoutSessionEvent>\n    {\n        public string IpAddress { get; set; }\n\n        public string UserAgent { get; set; }\n\n        public long? CallCount { get; set; }\n\n        public string SessionId { get; set; }\n\n        public DateTime? LoginTime { get; set; }\n\n        public bool Equals(UserLogoutSessionEvent userLogoutSessionEvent)\n        {\n            return (userLogoutSessionEvent != null && this.IpAddress == userLogoutSessionEvent.IpAddress && this.UserAgent == userLogoutSessionEvent.UserAgent && ((this.CallCount == null && userLogoutSessionEvent.CallCount == null) || (this.CallCount != null && this.CallCount.Equals(userLogoutSessionEvent.CallCount))) && this.SessionId == userLogoutSessionEvent.SessionId && ((this.LoginTime == null && userLogoutSessionEvent.LoginTime == null) || (this.LoginTime != null && this.LoginTime.Equals(userLogoutSessionEvent.LoginTime))));\n        }\n\n        public override bool Equals(object userLogoutSessionEvent)\n        {\n            return Equals(userLogoutSessionEvent as UserLogoutSessionEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpAddress + \"_\" + UserAgent + \"_\" + CallCount + \"_\" + SessionId + \"_\" + LoginTime).GetHashCode();\n        }\n    }\n\n    public class UserNotFound : VimFault, IEquatable<UserNotFound>\n    {\n        public string Principal { get; set; }\n\n        public bool Unresolved { get; set; }\n\n        public bool Equals(UserNotFound userNotFound)\n        {\n            return (userNotFound != null && this.Principal == userNotFound.Principal && this.Unresolved == userNotFound.Unresolved);\n        }\n\n        public override bool Equals(object userNotFound)\n        {\n            return Equals(userNotFound as UserNotFound);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Principal + \"_\" + Unresolved).GetHashCode();\n        }\n    }\n\n    public class UserPasswordChanged : HostEvent, IEquatable<UserPasswordChanged>\n    {\n        public string UserLogin { get; set; }\n\n        public bool Equals(UserPasswordChanged userPasswordChanged)\n        {\n            return (userPasswordChanged != null && this.UserLogin == userPasswordChanged.UserLogin);\n        }\n\n        public override bool Equals(object userPasswordChanged)\n        {\n            return Equals(userPasswordChanged as UserPasswordChanged);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserLogin).GetHashCode();\n        }\n    }\n\n    public class UserPrivilegeResult : DynamicData, IEquatable<UserPrivilegeResult>\n    {\n        public ManagedObjectReference Entity { get; set; }\n\n        public string[] Privileges { get; set; }\n\n        public UserPrivilegeResult_LinkedView LinkedView { get; set; }\n\n        public bool Equals(UserPrivilegeResult userPrivilegeResult)\n        {\n            return (userPrivilegeResult != null && ((this.Entity == null && userPrivilegeResult.Entity == null) || (this.Entity != null && this.Entity.Equals(userPrivilegeResult.Entity))) && ((this.Privileges == null && userPrivilegeResult.Privileges == null) || (this.Privileges != null && userPrivilegeResult.Privileges != null && Enumerable.SequenceEqual(this.Privileges, userPrivilegeResult.Privileges))) && ((this.LinkedView == null && userPrivilegeResult.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(userPrivilegeResult.LinkedView))));\n        }\n\n        public override bool Equals(object userPrivilegeResult)\n        {\n            return Equals(userPrivilegeResult as UserPrivilegeResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Privileges + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class UserPrivilegeResult_LinkedView : IEquatable<UserPrivilegeResult_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(UserPrivilegeResult_LinkedView userPrivilegeResult_LinkedView)\n        {\n            return (userPrivilegeResult_LinkedView != null && ((this.Entity == null && userPrivilegeResult_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(userPrivilegeResult_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object userPrivilegeResult_LinkedView)\n        {\n            return Equals(userPrivilegeResult_LinkedView as UserPrivilegeResult_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class UserProfile : ApplyProfile, IEquatable<UserProfile>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(UserProfile userProfile)\n        {\n            return (userProfile != null && this.Key == userProfile.Key);\n        }\n\n        public override bool Equals(object userProfile)\n        {\n            return Equals(userProfile as UserProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class UserSearchResult : DynamicData, IEquatable<UserSearchResult>\n    {\n        public string Principal { get; set; }\n\n        public string FullName { get; set; }\n\n        public bool Group { get; set; }\n\n        public bool Equals(UserSearchResult userSearchResult)\n        {\n            return (userSearchResult != null && this.Principal == userSearchResult.Principal && this.FullName == userSearchResult.FullName && this.Group == userSearchResult.Group);\n        }\n\n        public override bool Equals(object userSearchResult)\n        {\n            return Equals(userSearchResult as UserSearchResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Principal + \"_\" + FullName + \"_\" + Group).GetHashCode();\n        }\n    }\n\n    public class UserSession : DynamicData, IEquatable<UserSession>\n    {\n        public string Key { get; set; }\n\n        public string UserName { get; set; }\n\n        public string FullName { get; set; }\n\n        public DateTime LoginTime { get; set; }\n\n        public DateTime LastActiveTime { get; set; }\n\n        public string Locale { get; set; }\n\n        public string MessageLocale { get; set; }\n\n        public bool ExtensionSession { get; set; }\n\n        public string IpAddress { get; set; }\n\n        public string UserAgent { get; set; }\n\n        public long CallCount { get; set; }\n\n        public bool Equals(UserSession userSession)\n        {\n            return (userSession != null && this.Key == userSession.Key && this.UserName == userSession.UserName && this.FullName == userSession.FullName && this.LoginTime == userSession.LoginTime && this.LastActiveTime == userSession.LastActiveTime && this.Locale == userSession.Locale && this.MessageLocale == userSession.MessageLocale && this.ExtensionSession == userSession.ExtensionSession && this.IpAddress == userSession.IpAddress && this.UserAgent == userSession.UserAgent && this.CallCount == userSession.CallCount);\n        }\n\n        public override bool Equals(object userSession)\n        {\n            return Equals(userSession as UserSession);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + UserName + \"_\" + FullName + \"_\" + LoginTime + \"_\" + LastActiveTime + \"_\" + Locale + \"_\" + MessageLocale + \"_\" + ExtensionSession + \"_\" + IpAddress + \"_\" + UserAgent + \"_\" + CallCount).GetHashCode();\n        }\n    }\n\n    public class UserUnassignedFromGroup : HostEvent, IEquatable<UserUnassignedFromGroup>\n    {\n        public string UserLogin { get; set; }\n\n        public string Group { get; set; }\n\n        public bool Equals(UserUnassignedFromGroup userUnassignedFromGroup)\n        {\n            return (userUnassignedFromGroup != null && this.UserLogin == userUnassignedFromGroup.UserLogin && this.Group == userUnassignedFromGroup.Group);\n        }\n\n        public override bool Equals(object userUnassignedFromGroup)\n        {\n            return Equals(userUnassignedFromGroup as UserUnassignedFromGroup);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserLogin + \"_\" + Group).GetHashCode();\n        }\n    }\n\n    public class UserUpgradeEvent : UpgradeEvent, IEquatable<UserUpgradeEvent>\n    {\n        public bool Equals(UserUpgradeEvent userUpgradeEvent)\n        {\n            return (userUpgradeEvent != null && base.Equals(userUpgradeEvent));\n        }\n\n        public override bool Equals(object userUpgradeEvent)\n        {\n            return Equals(userUpgradeEvent as UserUpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VAppCloneSpec : DynamicData, IEquatable<VAppCloneSpec>\n    {\n        public ManagedObjectReference Location { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public ResourceConfigSpec ResourceSpec { get; set; }\n\n        public ManagedObjectReference VmFolder { get; set; }\n\n        public VAppCloneSpecNetworkMappingPair[] NetworkMapping { get; set; }\n\n        public KeyValue[] Property { get; set; }\n\n        public VAppCloneSpecResourceMap[] ResourceMapping { get; set; }\n\n        public string Provisioning { get; set; }\n\n        public VAppCloneSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VAppCloneSpec vAppCloneSpec)\n        {\n            return (vAppCloneSpec != null && ((this.Location == null && vAppCloneSpec.Location == null) || (this.Location != null && this.Location.Equals(vAppCloneSpec.Location))) && ((this.Host == null && vAppCloneSpec.Host == null) || (this.Host != null && this.Host.Equals(vAppCloneSpec.Host))) && ((this.ResourceSpec == null && vAppCloneSpec.ResourceSpec == null) || (this.ResourceSpec != null && this.ResourceSpec.Equals(vAppCloneSpec.ResourceSpec))) && ((this.VmFolder == null && vAppCloneSpec.VmFolder == null) || (this.VmFolder != null && this.VmFolder.Equals(vAppCloneSpec.VmFolder))) && ((this.NetworkMapping == null && vAppCloneSpec.NetworkMapping == null) || (this.NetworkMapping != null && vAppCloneSpec.NetworkMapping != null && Enumerable.SequenceEqual(this.NetworkMapping, vAppCloneSpec.NetworkMapping))) && ((this.Property == null && vAppCloneSpec.Property == null) || (this.Property != null && vAppCloneSpec.Property != null && Enumerable.SequenceEqual(this.Property, vAppCloneSpec.Property))) && ((this.ResourceMapping == null && vAppCloneSpec.ResourceMapping == null) || (this.ResourceMapping != null && vAppCloneSpec.ResourceMapping != null && Enumerable.SequenceEqual(this.ResourceMapping, vAppCloneSpec.ResourceMapping))) && this.Provisioning == vAppCloneSpec.Provisioning && ((this.LinkedView == null && vAppCloneSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vAppCloneSpec.LinkedView))));\n        }\n\n        public override bool Equals(object vAppCloneSpec)\n        {\n            return Equals(vAppCloneSpec as VAppCloneSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Location + \"_\" + Host + \"_\" + ResourceSpec + \"_\" + VmFolder + \"_\" + NetworkMapping + \"_\" + Property + \"_\" + ResourceMapping + \"_\" + Provisioning + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VAppCloneSpec_LinkedView : IEquatable<VAppCloneSpec_LinkedView>\n    {\n        public Datastore Location { get; set; }\n\n        public HostSystem Host { get; set; }\n\n        public Folder VmFolder { get; set; }\n\n        public bool Equals(VAppCloneSpec_LinkedView vAppCloneSpec_LinkedView)\n        {\n            return (vAppCloneSpec_LinkedView != null && ((this.Location == null && vAppCloneSpec_LinkedView.Location == null) || (this.Location != null && this.Location.Equals(vAppCloneSpec_LinkedView.Location))) && ((this.Host == null && vAppCloneSpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(vAppCloneSpec_LinkedView.Host))) && ((this.VmFolder == null && vAppCloneSpec_LinkedView.VmFolder == null) || (this.VmFolder != null && this.VmFolder.Equals(vAppCloneSpec_LinkedView.VmFolder))));\n        }\n\n        public override bool Equals(object vAppCloneSpec_LinkedView)\n        {\n            return Equals(vAppCloneSpec_LinkedView as VAppCloneSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Location + \"_\" + Host + \"_\" + VmFolder).GetHashCode();\n        }\n    }\n\n    public class VAppCloneSpecNetworkMappingPair : DynamicData, IEquatable<VAppCloneSpecNetworkMappingPair>\n    {\n        public ManagedObjectReference Source { get; set; }\n\n        public ManagedObjectReference Destination { get; set; }\n\n        public VAppCloneSpecNetworkMappingPair_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VAppCloneSpecNetworkMappingPair vAppCloneSpecNetworkMappingPair)\n        {\n            return (vAppCloneSpecNetworkMappingPair != null && ((this.Source == null && vAppCloneSpecNetworkMappingPair.Source == null) || (this.Source != null && this.Source.Equals(vAppCloneSpecNetworkMappingPair.Source))) && ((this.Destination == null && vAppCloneSpecNetworkMappingPair.Destination == null) || (this.Destination != null && this.Destination.Equals(vAppCloneSpecNetworkMappingPair.Destination))) && ((this.LinkedView == null && vAppCloneSpecNetworkMappingPair.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vAppCloneSpecNetworkMappingPair.LinkedView))));\n        }\n\n        public override bool Equals(object vAppCloneSpecNetworkMappingPair)\n        {\n            return Equals(vAppCloneSpecNetworkMappingPair as VAppCloneSpecNetworkMappingPair);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Destination + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VAppCloneSpecNetworkMappingPair_LinkedView : IEquatable<VAppCloneSpecNetworkMappingPair_LinkedView>\n    {\n        public Network Source { get; set; }\n\n        public Network Destination { get; set; }\n\n        public bool Equals(VAppCloneSpecNetworkMappingPair_LinkedView vAppCloneSpecNetworkMappingPair_LinkedView)\n        {\n            return (vAppCloneSpecNetworkMappingPair_LinkedView != null && ((this.Source == null && vAppCloneSpecNetworkMappingPair_LinkedView.Source == null) || (this.Source != null && this.Source.Equals(vAppCloneSpecNetworkMappingPair_LinkedView.Source))) && ((this.Destination == null && vAppCloneSpecNetworkMappingPair_LinkedView.Destination == null) || (this.Destination != null && this.Destination.Equals(vAppCloneSpecNetworkMappingPair_LinkedView.Destination))));\n        }\n\n        public override bool Equals(object vAppCloneSpecNetworkMappingPair_LinkedView)\n        {\n            return Equals(vAppCloneSpecNetworkMappingPair_LinkedView as VAppCloneSpecNetworkMappingPair_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Destination).GetHashCode();\n        }\n    }\n\n    public class VAppCloneSpecResourceMap : DynamicData, IEquatable<VAppCloneSpecResourceMap>\n    {\n        public ManagedObjectReference Source { get; set; }\n\n        public ManagedObjectReference Parent { get; set; }\n\n        public ResourceConfigSpec ResourceSpec { get; set; }\n\n        public ManagedObjectReference Location { get; set; }\n\n        public VAppCloneSpecResourceMap_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VAppCloneSpecResourceMap vAppCloneSpecResourceMap)\n        {\n            return (vAppCloneSpecResourceMap != null && ((this.Source == null && vAppCloneSpecResourceMap.Source == null) || (this.Source != null && this.Source.Equals(vAppCloneSpecResourceMap.Source))) && ((this.Parent == null && vAppCloneSpecResourceMap.Parent == null) || (this.Parent != null && this.Parent.Equals(vAppCloneSpecResourceMap.Parent))) && ((this.ResourceSpec == null && vAppCloneSpecResourceMap.ResourceSpec == null) || (this.ResourceSpec != null && this.ResourceSpec.Equals(vAppCloneSpecResourceMap.ResourceSpec))) && ((this.Location == null && vAppCloneSpecResourceMap.Location == null) || (this.Location != null && this.Location.Equals(vAppCloneSpecResourceMap.Location))) && ((this.LinkedView == null && vAppCloneSpecResourceMap.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vAppCloneSpecResourceMap.LinkedView))));\n        }\n\n        public override bool Equals(object vAppCloneSpecResourceMap)\n        {\n            return Equals(vAppCloneSpecResourceMap as VAppCloneSpecResourceMap);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Parent + \"_\" + ResourceSpec + \"_\" + Location + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VAppCloneSpecResourceMap_LinkedView : IEquatable<VAppCloneSpecResourceMap_LinkedView>\n    {\n        public ManagedEntity Source { get; set; }\n\n        public ResourcePool Parent { get; set; }\n\n        public Datastore Location { get; set; }\n\n        public bool Equals(VAppCloneSpecResourceMap_LinkedView vAppCloneSpecResourceMap_LinkedView)\n        {\n            return (vAppCloneSpecResourceMap_LinkedView != null && ((this.Source == null && vAppCloneSpecResourceMap_LinkedView.Source == null) || (this.Source != null && this.Source.Equals(vAppCloneSpecResourceMap_LinkedView.Source))) && ((this.Parent == null && vAppCloneSpecResourceMap_LinkedView.Parent == null) || (this.Parent != null && this.Parent.Equals(vAppCloneSpecResourceMap_LinkedView.Parent))) && ((this.Location == null && vAppCloneSpecResourceMap_LinkedView.Location == null) || (this.Location != null && this.Location.Equals(vAppCloneSpecResourceMap_LinkedView.Location))));\n        }\n\n        public override bool Equals(object vAppCloneSpecResourceMap_LinkedView)\n        {\n            return Equals(vAppCloneSpecResourceMap_LinkedView as VAppCloneSpecResourceMap_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source + \"_\" + Parent + \"_\" + Location).GetHashCode();\n        }\n    }\n\n    public class VAppConfigFault : VimFault, IEquatable<VAppConfigFault>\n    {\n        public bool Equals(VAppConfigFault vAppConfigFault)\n        {\n            return (vAppConfigFault != null && base.Equals(vAppConfigFault));\n        }\n\n        public override bool Equals(object vAppConfigFault)\n        {\n            return Equals(vAppConfigFault as VAppConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VAppConfigInfo : VmConfigInfo, IEquatable<VAppConfigInfo>\n    {\n        public VAppEntityConfigInfo[] EntityConfig { get; set; }\n\n        public string Annotation { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public ManagedByInfo ManagedBy { get; set; }\n\n        public bool Equals(VAppConfigInfo vAppConfigInfo)\n        {\n            return (vAppConfigInfo != null && ((this.EntityConfig == null && vAppConfigInfo.EntityConfig == null) || (this.EntityConfig != null && vAppConfigInfo.EntityConfig != null && Enumerable.SequenceEqual(this.EntityConfig, vAppConfigInfo.EntityConfig))) && this.Annotation == vAppConfigInfo.Annotation && this.InstanceUuid == vAppConfigInfo.InstanceUuid && ((this.ManagedBy == null && vAppConfigInfo.ManagedBy == null) || (this.ManagedBy != null && this.ManagedBy.Equals(vAppConfigInfo.ManagedBy))));\n        }\n\n        public override bool Equals(object vAppConfigInfo)\n        {\n            return Equals(vAppConfigInfo as VAppConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityConfig + \"_\" + Annotation + \"_\" + InstanceUuid + \"_\" + ManagedBy).GetHashCode();\n        }\n    }\n\n    public class VAppConfigSpec : VmConfigSpec, IEquatable<VAppConfigSpec>\n    {\n        public VAppEntityConfigInfo[] EntityConfig { get; set; }\n\n        public string Annotation { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public ManagedByInfo ManagedBy { get; set; }\n\n        public bool Equals(VAppConfigSpec vAppConfigSpec)\n        {\n            return (vAppConfigSpec != null && ((this.EntityConfig == null && vAppConfigSpec.EntityConfig == null) || (this.EntityConfig != null && vAppConfigSpec.EntityConfig != null && Enumerable.SequenceEqual(this.EntityConfig, vAppConfigSpec.EntityConfig))) && this.Annotation == vAppConfigSpec.Annotation && this.InstanceUuid == vAppConfigSpec.InstanceUuid && ((this.ManagedBy == null && vAppConfigSpec.ManagedBy == null) || (this.ManagedBy != null && this.ManagedBy.Equals(vAppConfigSpec.ManagedBy))));\n        }\n\n        public override bool Equals(object vAppConfigSpec)\n        {\n            return Equals(vAppConfigSpec as VAppConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityConfig + \"_\" + Annotation + \"_\" + InstanceUuid + \"_\" + ManagedBy).GetHashCode();\n        }\n    }\n\n    public class VAppEntityConfigInfo : DynamicData, IEquatable<VAppEntityConfigInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public string Tag { get; set; }\n\n        public int? StartOrder { get; set; }\n\n        public int? StartDelay { get; set; }\n\n        public bool? WaitingForGuest { get; set; }\n\n        public string StartAction { get; set; }\n\n        public int? StopDelay { get; set; }\n\n        public string StopAction { get; set; }\n\n        public bool? DestroyWithParent { get; set; }\n\n        public VAppEntityConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VAppEntityConfigInfo vAppEntityConfigInfo)\n        {\n            return (vAppEntityConfigInfo != null && ((this.Key == null && vAppEntityConfigInfo.Key == null) || (this.Key != null && this.Key.Equals(vAppEntityConfigInfo.Key))) && this.Tag == vAppEntityConfigInfo.Tag && ((this.StartOrder == null && vAppEntityConfigInfo.StartOrder == null) || (this.StartOrder != null && this.StartOrder.Equals(vAppEntityConfigInfo.StartOrder))) && ((this.StartDelay == null && vAppEntityConfigInfo.StartDelay == null) || (this.StartDelay != null && this.StartDelay.Equals(vAppEntityConfigInfo.StartDelay))) && ((this.WaitingForGuest == null && vAppEntityConfigInfo.WaitingForGuest == null) || (this.WaitingForGuest != null && this.WaitingForGuest.Equals(vAppEntityConfigInfo.WaitingForGuest))) && this.StartAction == vAppEntityConfigInfo.StartAction && ((this.StopDelay == null && vAppEntityConfigInfo.StopDelay == null) || (this.StopDelay != null && this.StopDelay.Equals(vAppEntityConfigInfo.StopDelay))) && this.StopAction == vAppEntityConfigInfo.StopAction && ((this.DestroyWithParent == null && vAppEntityConfigInfo.DestroyWithParent == null) || (this.DestroyWithParent != null && this.DestroyWithParent.Equals(vAppEntityConfigInfo.DestroyWithParent))) && ((this.LinkedView == null && vAppEntityConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vAppEntityConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object vAppEntityConfigInfo)\n        {\n            return Equals(vAppEntityConfigInfo as VAppEntityConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Tag + \"_\" + StartOrder + \"_\" + StartDelay + \"_\" + WaitingForGuest + \"_\" + StartAction + \"_\" + StopDelay + \"_\" + StopAction + \"_\" + DestroyWithParent + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VAppEntityConfigInfo_LinkedView : IEquatable<VAppEntityConfigInfo_LinkedView>\n    {\n        public ManagedEntity Key { get; set; }\n\n        public bool Equals(VAppEntityConfigInfo_LinkedView vAppEntityConfigInfo_LinkedView)\n        {\n            return (vAppEntityConfigInfo_LinkedView != null && ((this.Key == null && vAppEntityConfigInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(vAppEntityConfigInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object vAppEntityConfigInfo_LinkedView)\n        {\n            return Equals(vAppEntityConfigInfo_LinkedView as VAppEntityConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class VAppIPAssignmentInfo : DynamicData, IEquatable<VAppIPAssignmentInfo>\n    {\n        public string[] SupportedAllocationScheme { get; set; }\n\n        public string IpAllocationPolicy { get; set; }\n\n        public string[] SupportedIpProtocol { get; set; }\n\n        public string IpProtocol { get; set; }\n\n        public bool Equals(VAppIPAssignmentInfo vAppIPAssignmentInfo)\n        {\n            return (vAppIPAssignmentInfo != null && ((this.SupportedAllocationScheme == null && vAppIPAssignmentInfo.SupportedAllocationScheme == null) || (this.SupportedAllocationScheme != null && vAppIPAssignmentInfo.SupportedAllocationScheme != null && Enumerable.SequenceEqual(this.SupportedAllocationScheme, vAppIPAssignmentInfo.SupportedAllocationScheme))) && this.IpAllocationPolicy == vAppIPAssignmentInfo.IpAllocationPolicy && ((this.SupportedIpProtocol == null && vAppIPAssignmentInfo.SupportedIpProtocol == null) || (this.SupportedIpProtocol != null && vAppIPAssignmentInfo.SupportedIpProtocol != null && Enumerable.SequenceEqual(this.SupportedIpProtocol, vAppIPAssignmentInfo.SupportedIpProtocol))) && this.IpProtocol == vAppIPAssignmentInfo.IpProtocol);\n        }\n\n        public override bool Equals(object vAppIPAssignmentInfo)\n        {\n            return Equals(vAppIPAssignmentInfo as VAppIPAssignmentInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportedAllocationScheme + \"_\" + IpAllocationPolicy + \"_\" + SupportedIpProtocol + \"_\" + IpProtocol).GetHashCode();\n        }\n    }\n\n    public class VAppNotRunning : VmConfigFault, IEquatable<VAppNotRunning>\n    {\n        public bool Equals(VAppNotRunning vAppNotRunning)\n        {\n            return (vAppNotRunning != null && base.Equals(vAppNotRunning));\n        }\n\n        public override bool Equals(object vAppNotRunning)\n        {\n            return Equals(vAppNotRunning as VAppNotRunning);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VAppOperationInProgress : RuntimeFault, IEquatable<VAppOperationInProgress>\n    {\n        public bool Equals(VAppOperationInProgress vAppOperationInProgress)\n        {\n            return (vAppOperationInProgress != null && base.Equals(vAppOperationInProgress));\n        }\n\n        public override bool Equals(object vAppOperationInProgress)\n        {\n            return Equals(vAppOperationInProgress as VAppOperationInProgress);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VAppOvfSectionInfo : DynamicData, IEquatable<VAppOvfSectionInfo>\n    {\n        public int? Key { get; set; }\n\n        public string Namespace { get; set; }\n\n        public string Type { get; set; }\n\n        public bool? AtEnvelopeLevel { get; set; }\n\n        public string Contents { get; set; }\n\n        public bool Equals(VAppOvfSectionInfo vAppOvfSectionInfo)\n        {\n            return (vAppOvfSectionInfo != null && ((this.Key == null && vAppOvfSectionInfo.Key == null) || (this.Key != null && this.Key.Equals(vAppOvfSectionInfo.Key))) && this.Namespace == vAppOvfSectionInfo.Namespace && this.Type == vAppOvfSectionInfo.Type && ((this.AtEnvelopeLevel == null && vAppOvfSectionInfo.AtEnvelopeLevel == null) || (this.AtEnvelopeLevel != null && this.AtEnvelopeLevel.Equals(vAppOvfSectionInfo.AtEnvelopeLevel))) && this.Contents == vAppOvfSectionInfo.Contents);\n        }\n\n        public override bool Equals(object vAppOvfSectionInfo)\n        {\n            return Equals(vAppOvfSectionInfo as VAppOvfSectionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Namespace + \"_\" + Type + \"_\" + AtEnvelopeLevel + \"_\" + Contents).GetHashCode();\n        }\n    }\n\n    public class VAppOvfSectionSpec : ArrayUpdateSpec, IEquatable<VAppOvfSectionSpec>\n    {\n        public VAppOvfSectionInfo Info { get; set; }\n\n        public bool Equals(VAppOvfSectionSpec vAppOvfSectionSpec)\n        {\n            return (vAppOvfSectionSpec != null && ((this.Info == null && vAppOvfSectionSpec.Info == null) || (this.Info != null && this.Info.Equals(vAppOvfSectionSpec.Info))));\n        }\n\n        public override bool Equals(object vAppOvfSectionSpec)\n        {\n            return Equals(vAppOvfSectionSpec as VAppOvfSectionSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class VAppProductInfo : DynamicData, IEquatable<VAppProductInfo>\n    {\n        public int Key { get; set; }\n\n        public string ClassId { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public string Name { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string Version { get; set; }\n\n        public string FullVersion { get; set; }\n\n        public string VendorUrl { get; set; }\n\n        public string ProductUrl { get; set; }\n\n        public string AppUrl { get; set; }\n\n        public bool Equals(VAppProductInfo vAppProductInfo)\n        {\n            return (vAppProductInfo != null && this.Key == vAppProductInfo.Key && this.ClassId == vAppProductInfo.ClassId && this.InstanceId == vAppProductInfo.InstanceId && this.Name == vAppProductInfo.Name && this.Vendor == vAppProductInfo.Vendor && this.Version == vAppProductInfo.Version && this.FullVersion == vAppProductInfo.FullVersion && this.VendorUrl == vAppProductInfo.VendorUrl && this.ProductUrl == vAppProductInfo.ProductUrl && this.AppUrl == vAppProductInfo.AppUrl);\n        }\n\n        public override bool Equals(object vAppProductInfo)\n        {\n            return Equals(vAppProductInfo as VAppProductInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ClassId + \"_\" + InstanceId + \"_\" + Name + \"_\" + Vendor + \"_\" + Version + \"_\" + FullVersion + \"_\" + VendorUrl + \"_\" + ProductUrl + \"_\" + AppUrl).GetHashCode();\n        }\n    }\n\n    public class VAppProductSpec : ArrayUpdateSpec, IEquatable<VAppProductSpec>\n    {\n        public VAppProductInfo Info { get; set; }\n\n        public bool Equals(VAppProductSpec vAppProductSpec)\n        {\n            return (vAppProductSpec != null && ((this.Info == null && vAppProductSpec.Info == null) || (this.Info != null && this.Info.Equals(vAppProductSpec.Info))));\n        }\n\n        public override bool Equals(object vAppProductSpec)\n        {\n            return Equals(vAppProductSpec as VAppProductSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class VAppPropertyFault : VmConfigFault, IEquatable<VAppPropertyFault>\n    {\n        public string Id { get; set; }\n\n        public string Category { get; set; }\n\n        public string Label { get; set; }\n\n        public string Type { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(VAppPropertyFault vAppPropertyFault)\n        {\n            return (vAppPropertyFault != null && this.Id == vAppPropertyFault.Id && this.Category == vAppPropertyFault.Category && this.Label == vAppPropertyFault.Label && this.Type == vAppPropertyFault.Type && this.Value == vAppPropertyFault.Value);\n        }\n\n        public override bool Equals(object vAppPropertyFault)\n        {\n            return Equals(vAppPropertyFault as VAppPropertyFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Category + \"_\" + Label + \"_\" + Type + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class VAppPropertyInfo : DynamicData, IEquatable<VAppPropertyInfo>\n    {\n        public int Key { get; set; }\n\n        public string ClassId { get; set; }\n\n        public string InstanceId { get; set; }\n\n        public string Id { get; set; }\n\n        public string Category { get; set; }\n\n        public string Label { get; set; }\n\n        public string Type { get; set; }\n\n        public string TypeReference { get; set; }\n\n        public bool? UserConfigurable { get; set; }\n\n        public string DefaultValue { get; set; }\n\n        public string Value { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(VAppPropertyInfo vAppPropertyInfo)\n        {\n            return (vAppPropertyInfo != null && this.Key == vAppPropertyInfo.Key && this.ClassId == vAppPropertyInfo.ClassId && this.InstanceId == vAppPropertyInfo.InstanceId && this.Id == vAppPropertyInfo.Id && this.Category == vAppPropertyInfo.Category && this.Label == vAppPropertyInfo.Label && this.Type == vAppPropertyInfo.Type && this.TypeReference == vAppPropertyInfo.TypeReference && ((this.UserConfigurable == null && vAppPropertyInfo.UserConfigurable == null) || (this.UserConfigurable != null && this.UserConfigurable.Equals(vAppPropertyInfo.UserConfigurable))) && this.DefaultValue == vAppPropertyInfo.DefaultValue && this.Value == vAppPropertyInfo.Value && this.Description == vAppPropertyInfo.Description);\n        }\n\n        public override bool Equals(object vAppPropertyInfo)\n        {\n            return Equals(vAppPropertyInfo as VAppPropertyInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ClassId + \"_\" + InstanceId + \"_\" + Id + \"_\" + Category + \"_\" + Label + \"_\" + Type + \"_\" + TypeReference + \"_\" + UserConfigurable + \"_\" + DefaultValue + \"_\" + Value + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class VAppPropertySpec : ArrayUpdateSpec, IEquatable<VAppPropertySpec>\n    {\n        public VAppPropertyInfo Info { get; set; }\n\n        public bool Equals(VAppPropertySpec vAppPropertySpec)\n        {\n            return (vAppPropertySpec != null && ((this.Info == null && vAppPropertySpec.Info == null) || (this.Info != null && this.Info.Equals(vAppPropertySpec.Info))));\n        }\n\n        public override bool Equals(object vAppPropertySpec)\n        {\n            return Equals(vAppPropertySpec as VAppPropertySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class VAppTaskInProgress : TaskInProgress, IEquatable<VAppTaskInProgress>\n    {\n        public new VAppTaskInProgress_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VAppTaskInProgress vAppTaskInProgress)\n        {\n            return (vAppTaskInProgress != null && ((this.LinkedView == null && vAppTaskInProgress.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vAppTaskInProgress.LinkedView))));\n        }\n\n        public override bool Equals(object vAppTaskInProgress)\n        {\n            return Equals(vAppTaskInProgress as VAppTaskInProgress);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VAppTaskInProgress_LinkedView : TaskInProgress_LinkedView, IEquatable<VAppTaskInProgress_LinkedView>\n    {\n        public bool Equals(VAppTaskInProgress_LinkedView vAppTaskInProgress_LinkedView)\n        {\n            return (vAppTaskInProgress_LinkedView != null && base.Equals(vAppTaskInProgress_LinkedView));\n        }\n\n        public override bool Equals(object vAppTaskInProgress_LinkedView)\n        {\n            return Equals(vAppTaskInProgress_LinkedView as VAppTaskInProgress_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VasaProviderContainerSpec : DynamicData, IEquatable<VasaProviderContainerSpec>\n    {\n        public VimVasaProviderInfo[] VasaProviderInfo { get; set; }\n\n        public string ScId { get; set; }\n\n        public bool Deleted { get; set; }\n\n        public bool Equals(VasaProviderContainerSpec vasaProviderContainerSpec)\n        {\n            return (vasaProviderContainerSpec != null && ((this.VasaProviderInfo == null && vasaProviderContainerSpec.VasaProviderInfo == null) || (this.VasaProviderInfo != null && vasaProviderContainerSpec.VasaProviderInfo != null && Enumerable.SequenceEqual(this.VasaProviderInfo, vasaProviderContainerSpec.VasaProviderInfo))) && this.ScId == vasaProviderContainerSpec.ScId && this.Deleted == vasaProviderContainerSpec.Deleted);\n        }\n\n        public override bool Equals(object vasaProviderContainerSpec)\n        {\n            return Equals(vasaProviderContainerSpec as VasaProviderContainerSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VasaProviderInfo + \"_\" + ScId + \"_\" + Deleted).GetHashCode();\n        }\n    }\n\n    public class VASAStorageArray : DynamicData, IEquatable<VASAStorageArray>\n    {\n        public string Name { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string VendorId { get; set; }\n\n        public string ModelId { get; set; }\n\n        public bool Equals(VASAStorageArray vASAStorageArray)\n        {\n            return (vASAStorageArray != null && this.Name == vASAStorageArray.Name && this.Uuid == vASAStorageArray.Uuid && this.VendorId == vASAStorageArray.VendorId && this.ModelId == vASAStorageArray.ModelId);\n        }\n\n        public override bool Equals(object vASAStorageArray)\n        {\n            return Equals(vASAStorageArray as VASAStorageArray);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Uuid + \"_\" + VendorId + \"_\" + ModelId).GetHashCode();\n        }\n    }\n\n    public class VcAgentUninstalledEvent : HostEvent, IEquatable<VcAgentUninstalledEvent>\n    {\n        public bool Equals(VcAgentUninstalledEvent vcAgentUninstalledEvent)\n        {\n            return (vcAgentUninstalledEvent != null && base.Equals(vcAgentUninstalledEvent));\n        }\n\n        public override bool Equals(object vcAgentUninstalledEvent)\n        {\n            return Equals(vcAgentUninstalledEvent as VcAgentUninstalledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VcAgentUninstallFailedEvent : HostEvent, IEquatable<VcAgentUninstallFailedEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(VcAgentUninstallFailedEvent vcAgentUninstallFailedEvent)\n        {\n            return (vcAgentUninstallFailedEvent != null && this.Reason == vcAgentUninstallFailedEvent.Reason);\n        }\n\n        public override bool Equals(object vcAgentUninstallFailedEvent)\n        {\n            return Equals(vcAgentUninstallFailedEvent as VcAgentUninstallFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VcAgentUpgradedEvent : HostEvent, IEquatable<VcAgentUpgradedEvent>\n    {\n        public bool Equals(VcAgentUpgradedEvent vcAgentUpgradedEvent)\n        {\n            return (vcAgentUpgradedEvent != null && base.Equals(vcAgentUpgradedEvent));\n        }\n\n        public override bool Equals(object vcAgentUpgradedEvent)\n        {\n            return Equals(vcAgentUpgradedEvent as VcAgentUpgradedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VcAgentUpgradeFailedEvent : HostEvent, IEquatable<VcAgentUpgradeFailedEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(VcAgentUpgradeFailedEvent vcAgentUpgradeFailedEvent)\n        {\n            return (vcAgentUpgradeFailedEvent != null && this.Reason == vcAgentUpgradeFailedEvent.Reason);\n        }\n\n        public override bool Equals(object vcAgentUpgradeFailedEvent)\n        {\n            return Equals(vcAgentUpgradeFailedEvent as VcAgentUpgradeFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VcenterVStorageObjectManager : VStorageObjectManagerBase, IEquatable<VcenterVStorageObjectManager>\n    {\n        public ManagedObjectReference CreateDisk_Task(VslmCreateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject CreateDisk(VslmCreateSpec spec)\n        {\n            return default(VStorageObject);\n        }\n\n        public VStorageObject RegisterDisk(string path, string name)\n        {\n            return default(VStorageObject);\n        }\n\n        public ManagedObjectReference ExtendDisk_Task(ID id, ManagedObjectReference datastore, long newCapacityInMB)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ExtendDisk(ID id, ManagedObjectReference datastore, long newCapacityInMB)\n        {\n        }\n\n        public ManagedObjectReference InflateDisk_Task(ID id, ManagedObjectReference datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void InflateDisk(ID id, ManagedObjectReference datastore)\n        {\n        }\n\n        public void RenameVStorageObject(ID id, ManagedObjectReference datastore, string name)\n        {\n        }\n\n        public ManagedObjectReference UpdateVStorageObjectPolicy_Task(ID id, ManagedObjectReference datastore, VirtualMachineProfileSpec[] profile)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpdateVStorageObjectPolicy(ID id, ManagedObjectReference datastore, VirtualMachineProfileSpec[] profile)\n        {\n        }\n\n        public ManagedObjectReference UpdateVStorageInfrastructureObjectPolicy_Task(vslmInfrastructureObjectPolicySpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpdateVStorageInfrastructureObjectPolicy(vslmInfrastructureObjectPolicySpec spec)\n        {\n        }\n\n        public vslmInfrastructureObjectPolicy[] RetrieveVStorageInfrastructureObjectPolicy(ManagedObjectReference datastore)\n        {\n            return default(vslmInfrastructureObjectPolicy[]);\n        }\n\n        public ManagedObjectReference DeleteVStorageObject_Task(ID id, ManagedObjectReference datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DeleteVStorageObject(ID id, ManagedObjectReference datastore)\n        {\n        }\n\n        public VStorageObject RetrieveVStorageObject(ID id, ManagedObjectReference datastore)\n        {\n            return default(VStorageObject);\n        }\n\n        public VStorageObjectStateInfo RetrieveVStorageObjectState(ID id, ManagedObjectReference datastore)\n        {\n            return default(VStorageObjectStateInfo);\n        }\n\n        public VStorageObjectAssociations[] RetrieveVStorageObjectAssociations(RetrieveVStorageObjSpec[] ids)\n        {\n            return default(VStorageObjectAssociations[]);\n        }\n\n        public ID[] ListVStorageObject(ManagedObjectReference datastore)\n        {\n            return default(ID[]);\n        }\n\n        public ManagedObjectReference CloneVStorageObject_Task(ID id, ManagedObjectReference datastore, VslmCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject CloneVStorageObject(ID id, ManagedObjectReference datastore, VslmCloneSpec spec)\n        {\n            return default(VStorageObject);\n        }\n\n        public ManagedObjectReference RelocateVStorageObject_Task(ID id, ManagedObjectReference datastore, VslmRelocateSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject RelocateVStorageObject(ID id, ManagedObjectReference datastore, VslmRelocateSpec spec)\n        {\n            return default(VStorageObject);\n        }\n\n        public void SetVStorageObjectControlFlags(ID id, ManagedObjectReference datastore, string[] controlFlags)\n        {\n        }\n\n        public void ClearVStorageObjectControlFlags(ID id, ManagedObjectReference datastore, string[] controlFlags)\n        {\n        }\n\n        public void AttachTagToVStorageObject(ID id, string category, string tag)\n        {\n        }\n\n        public void DetachTagFromVStorageObject(ID id, string category, string tag)\n        {\n        }\n\n        public ID[] ListVStorageObjectsAttachedToTag(string category, string tag)\n        {\n            return default(ID[]);\n        }\n\n        public VslmTagEntry[] ListTagsAttachedToVStorageObject(ID id)\n        {\n            return default(VslmTagEntry[]);\n        }\n\n        public ManagedObjectReference ReconcileDatastoreInventory_Task(ManagedObjectReference datastore)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconcileDatastoreInventory(ManagedObjectReference datastore)\n        {\n        }\n\n        public void ScheduleReconcileDatastoreInventory(ManagedObjectReference datastore)\n        {\n        }\n\n        public ManagedObjectReference VStorageObjectCreateSnapshot_Task(ID id, ManagedObjectReference datastore, string description)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ID VStorageObjectCreateSnapshot(ID id, ManagedObjectReference datastore, string description)\n        {\n            return default(ID);\n        }\n\n        public ManagedObjectReference DeleteSnapshot_Task(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DeleteSnapshot(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n        }\n\n        public VStorageObjectSnapshotInfo RetrieveSnapshotInfo(ID id, ManagedObjectReference datastore)\n        {\n            return default(VStorageObjectSnapshotInfo);\n        }\n\n        public ManagedObjectReference CreateDiskFromSnapshot_Task(ID id, ManagedObjectReference datastore, ID snapshotId, string name, VirtualMachineProfileSpec[] profile, CryptoSpec crypto, string path)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VStorageObject CreateDiskFromSnapshot(ID id, ManagedObjectReference datastore, ID snapshotId, string name, VirtualMachineProfileSpec[] profile, CryptoSpec crypto, string path)\n        {\n            return default(VStorageObject);\n        }\n\n        public ManagedObjectReference RevertVStorageObject_Task(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RevertVStorageObject(ID id, ManagedObjectReference datastore, ID snapshotId)\n        {\n        }\n\n        public bool Equals(VcenterVStorageObjectManager vcenterVStorageObjectManager)\n        {\n            return (vcenterVStorageObjectManager != null && base.Equals(vcenterVStorageObjectManager));\n        }\n\n        public override bool Equals(object vcenterVStorageObjectManager)\n        {\n            return Equals(vcenterVStorageObjectManager as VcenterVStorageObjectManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VchaClusterConfigInfo : DynamicData, IEquatable<VchaClusterConfigInfo>\n    {\n        public FailoverNodeInfo FailoverNodeInfo1 { get; set; }\n\n        public FailoverNodeInfo FailoverNodeInfo2 { get; set; }\n\n        public WitnessNodeInfo WitnessNodeInfo { get; set; }\n\n        public string State { get; set; }\n\n        public bool Equals(VchaClusterConfigInfo vchaClusterConfigInfo)\n        {\n            return (vchaClusterConfigInfo != null && ((this.FailoverNodeInfo1 == null && vchaClusterConfigInfo.FailoverNodeInfo1 == null) || (this.FailoverNodeInfo1 != null && this.FailoverNodeInfo1.Equals(vchaClusterConfigInfo.FailoverNodeInfo1))) && ((this.FailoverNodeInfo2 == null && vchaClusterConfigInfo.FailoverNodeInfo2 == null) || (this.FailoverNodeInfo2 != null && this.FailoverNodeInfo2.Equals(vchaClusterConfigInfo.FailoverNodeInfo2))) && ((this.WitnessNodeInfo == null && vchaClusterConfigInfo.WitnessNodeInfo == null) || (this.WitnessNodeInfo != null && this.WitnessNodeInfo.Equals(vchaClusterConfigInfo.WitnessNodeInfo))) && this.State == vchaClusterConfigInfo.State);\n        }\n\n        public override bool Equals(object vchaClusterConfigInfo)\n        {\n            return Equals(vchaClusterConfigInfo as VchaClusterConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailoverNodeInfo1 + \"_\" + FailoverNodeInfo2 + \"_\" + WitnessNodeInfo + \"_\" + State).GetHashCode();\n        }\n    }\n\n    public class VchaClusterConfigSpec : DynamicData, IEquatable<VchaClusterConfigSpec>\n    {\n        public string PassiveIp { get; set; }\n\n        public string WitnessIp { get; set; }\n\n        public bool Equals(VchaClusterConfigSpec vchaClusterConfigSpec)\n        {\n            return (vchaClusterConfigSpec != null && this.PassiveIp == vchaClusterConfigSpec.PassiveIp && this.WitnessIp == vchaClusterConfigSpec.WitnessIp);\n        }\n\n        public override bool Equals(object vchaClusterConfigSpec)\n        {\n            return Equals(vchaClusterConfigSpec as VchaClusterConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PassiveIp + \"_\" + WitnessIp).GetHashCode();\n        }\n    }\n\n    public class VchaClusterDeploymentSpec : DynamicData, IEquatable<VchaClusterDeploymentSpec>\n    {\n        public PassiveNodeDeploymentSpec PassiveDeploymentSpec { get; set; }\n\n        public NodeDeploymentSpec WitnessDeploymentSpec { get; set; }\n\n        public SourceNodeSpec ActiveVcSpec { get; set; }\n\n        public ClusterNetworkConfigSpec ActiveVcNetworkConfig { get; set; }\n\n        public bool Equals(VchaClusterDeploymentSpec vchaClusterDeploymentSpec)\n        {\n            return (vchaClusterDeploymentSpec != null && ((this.PassiveDeploymentSpec == null && vchaClusterDeploymentSpec.PassiveDeploymentSpec == null) || (this.PassiveDeploymentSpec != null && this.PassiveDeploymentSpec.Equals(vchaClusterDeploymentSpec.PassiveDeploymentSpec))) && ((this.WitnessDeploymentSpec == null && vchaClusterDeploymentSpec.WitnessDeploymentSpec == null) || (this.WitnessDeploymentSpec != null && this.WitnessDeploymentSpec.Equals(vchaClusterDeploymentSpec.WitnessDeploymentSpec))) && ((this.ActiveVcSpec == null && vchaClusterDeploymentSpec.ActiveVcSpec == null) || (this.ActiveVcSpec != null && this.ActiveVcSpec.Equals(vchaClusterDeploymentSpec.ActiveVcSpec))) && ((this.ActiveVcNetworkConfig == null && vchaClusterDeploymentSpec.ActiveVcNetworkConfig == null) || (this.ActiveVcNetworkConfig != null && this.ActiveVcNetworkConfig.Equals(vchaClusterDeploymentSpec.ActiveVcNetworkConfig))));\n        }\n\n        public override bool Equals(object vchaClusterDeploymentSpec)\n        {\n            return Equals(vchaClusterDeploymentSpec as VchaClusterDeploymentSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PassiveDeploymentSpec + \"_\" + WitnessDeploymentSpec + \"_\" + ActiveVcSpec + \"_\" + ActiveVcNetworkConfig).GetHashCode();\n        }\n    }\n\n    public class VchaClusterHealth : DynamicData, IEquatable<VchaClusterHealth>\n    {\n        public VchaClusterRuntimeInfo RuntimeInfo { get; set; }\n\n        public LocalizableMessage[] HealthMessages { get; set; }\n\n        public LocalizableMessage[] AdditionalInformation { get; set; }\n\n        public bool Equals(VchaClusterHealth vchaClusterHealth)\n        {\n            return (vchaClusterHealth != null && ((this.RuntimeInfo == null && vchaClusterHealth.RuntimeInfo == null) || (this.RuntimeInfo != null && this.RuntimeInfo.Equals(vchaClusterHealth.RuntimeInfo))) && ((this.HealthMessages == null && vchaClusterHealth.HealthMessages == null) || (this.HealthMessages != null && vchaClusterHealth.HealthMessages != null && Enumerable.SequenceEqual(this.HealthMessages, vchaClusterHealth.HealthMessages))) && ((this.AdditionalInformation == null && vchaClusterHealth.AdditionalInformation == null) || (this.AdditionalInformation != null && vchaClusterHealth.AdditionalInformation != null && Enumerable.SequenceEqual(this.AdditionalInformation, vchaClusterHealth.AdditionalInformation))));\n        }\n\n        public override bool Equals(object vchaClusterHealth)\n        {\n            return Equals(vchaClusterHealth as VchaClusterHealth);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RuntimeInfo + \"_\" + HealthMessages + \"_\" + AdditionalInformation).GetHashCode();\n        }\n    }\n\n    public class VchaClusterNetworkSpec : DynamicData, IEquatable<VchaClusterNetworkSpec>\n    {\n        public NodeNetworkSpec WitnessNetworkSpec { get; set; }\n\n        public PassiveNodeNetworkSpec PassiveNetworkSpec { get; set; }\n\n        public bool Equals(VchaClusterNetworkSpec vchaClusterNetworkSpec)\n        {\n            return (vchaClusterNetworkSpec != null && ((this.WitnessNetworkSpec == null && vchaClusterNetworkSpec.WitnessNetworkSpec == null) || (this.WitnessNetworkSpec != null && this.WitnessNetworkSpec.Equals(vchaClusterNetworkSpec.WitnessNetworkSpec))) && ((this.PassiveNetworkSpec == null && vchaClusterNetworkSpec.PassiveNetworkSpec == null) || (this.PassiveNetworkSpec != null && this.PassiveNetworkSpec.Equals(vchaClusterNetworkSpec.PassiveNetworkSpec))));\n        }\n\n        public override bool Equals(object vchaClusterNetworkSpec)\n        {\n            return Equals(vchaClusterNetworkSpec as VchaClusterNetworkSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (WitnessNetworkSpec + \"_\" + PassiveNetworkSpec).GetHashCode();\n        }\n    }\n\n    public class VchaClusterRuntimeInfo : DynamicData, IEquatable<VchaClusterRuntimeInfo>\n    {\n        public string ClusterState { get; set; }\n\n        public VchaNodeRuntimeInfo[] NodeInfo { get; set; }\n\n        public string ClusterMode { get; set; }\n\n        public bool Equals(VchaClusterRuntimeInfo vchaClusterRuntimeInfo)\n        {\n            return (vchaClusterRuntimeInfo != null && this.ClusterState == vchaClusterRuntimeInfo.ClusterState && ((this.NodeInfo == null && vchaClusterRuntimeInfo.NodeInfo == null) || (this.NodeInfo != null && vchaClusterRuntimeInfo.NodeInfo != null && Enumerable.SequenceEqual(this.NodeInfo, vchaClusterRuntimeInfo.NodeInfo))) && this.ClusterMode == vchaClusterRuntimeInfo.ClusterMode);\n        }\n\n        public override bool Equals(object vchaClusterRuntimeInfo)\n        {\n            return Equals(vchaClusterRuntimeInfo as VchaClusterRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ClusterState + \"_\" + NodeInfo + \"_\" + ClusterMode).GetHashCode();\n        }\n    }\n\n    public class VchaNodeRuntimeInfo : DynamicData, IEquatable<VchaNodeRuntimeInfo>\n    {\n        public string NodeState { get; set; }\n\n        public string NodeRole { get; set; }\n\n        public string NodeIp { get; set; }\n\n        public bool Equals(VchaNodeRuntimeInfo vchaNodeRuntimeInfo)\n        {\n            return (vchaNodeRuntimeInfo != null && this.NodeState == vchaNodeRuntimeInfo.NodeState && this.NodeRole == vchaNodeRuntimeInfo.NodeRole && this.NodeIp == vchaNodeRuntimeInfo.NodeIp);\n        }\n\n        public override bool Equals(object vchaNodeRuntimeInfo)\n        {\n            return Equals(vchaNodeRuntimeInfo as VchaNodeRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NodeState + \"_\" + NodeRole + \"_\" + NodeIp).GetHashCode();\n        }\n    }\n\n    public class VFlashCacheHotConfigNotSupported : VmConfigFault, IEquatable<VFlashCacheHotConfigNotSupported>\n    {\n        public bool Equals(VFlashCacheHotConfigNotSupported vFlashCacheHotConfigNotSupported)\n        {\n            return (vFlashCacheHotConfigNotSupported != null && base.Equals(vFlashCacheHotConfigNotSupported));\n        }\n\n        public override bool Equals(object vFlashCacheHotConfigNotSupported)\n        {\n            return Equals(vFlashCacheHotConfigNotSupported as VFlashCacheHotConfigNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VFlashModuleNotSupported : VmConfigFault, IEquatable<VFlashModuleNotSupported>\n    {\n        public string VmName { get; set; }\n\n        public string ModuleName { get; set; }\n\n        public string Reason { get; set; }\n\n        public string HostName { get; set; }\n\n        public bool Equals(VFlashModuleNotSupported vFlashModuleNotSupported)\n        {\n            return (vFlashModuleNotSupported != null && this.VmName == vFlashModuleNotSupported.VmName && this.ModuleName == vFlashModuleNotSupported.ModuleName && this.Reason == vFlashModuleNotSupported.Reason && this.HostName == vFlashModuleNotSupported.HostName);\n        }\n\n        public override bool Equals(object vFlashModuleNotSupported)\n        {\n            return Equals(vFlashModuleNotSupported as VFlashModuleNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName + \"_\" + ModuleName + \"_\" + Reason + \"_\" + HostName).GetHashCode();\n        }\n    }\n\n    public class VFlashModuleVersionIncompatible : VimFault, IEquatable<VFlashModuleVersionIncompatible>\n    {\n        public string ModuleName { get; set; }\n\n        public string VmRequestModuleVersion { get; set; }\n\n        public string HostMinSupportedVerson { get; set; }\n\n        public string HostModuleVersion { get; set; }\n\n        public bool Equals(VFlashModuleVersionIncompatible vFlashModuleVersionIncompatible)\n        {\n            return (vFlashModuleVersionIncompatible != null && this.ModuleName == vFlashModuleVersionIncompatible.ModuleName && this.VmRequestModuleVersion == vFlashModuleVersionIncompatible.VmRequestModuleVersion && this.HostMinSupportedVerson == vFlashModuleVersionIncompatible.HostMinSupportedVerson && this.HostModuleVersion == vFlashModuleVersionIncompatible.HostModuleVersion);\n        }\n\n        public override bool Equals(object vFlashModuleVersionIncompatible)\n        {\n            return Equals(vFlashModuleVersionIncompatible as VFlashModuleVersionIncompatible);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ModuleName + \"_\" + VmRequestModuleVersion + \"_\" + HostMinSupportedVerson + \"_\" + HostModuleVersion).GetHashCode();\n        }\n    }\n\n    public class VIConvert : IEquatable<VIConvert>\n    {\n        public bool Equals(VIConvert vIConvert)\n        {\n            return (vIConvert != null);\n        }\n\n        public override bool Equals(object vIConvert)\n        {\n            return Equals(vIConvert as VIConvert);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class View : ViewBase, IEquatable<View>\n    {\n        public void DestroyView()\n        {\n        }\n\n        public bool Equals(View view)\n        {\n            return (view != null && base.Equals(view));\n        }\n\n        public override bool Equals(object view)\n        {\n            return Equals(view as View);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class ViewBase : IEquatable<ViewBase>\n    {\n        public ManagedObjectReference MoRef { get; set; }\n\n        public VimClient Client { get; set; }\n\n        public void UpdateViewData(string[] properties)\n        {\n        }\n\n        public void UpdateViewData()\n        {\n        }\n\n        public void SetViewData(ObjectContent objectContent, string[] properties)\n        {\n        }\n\n        public object WaitForTask(ManagedObjectReference taskReference)\n        {\n            return default(object);\n        }\n\n        public bool Equals(ViewBase viewBase)\n        {\n            return (viewBase != null && ((this.MoRef == null && viewBase.MoRef == null) || (this.MoRef != null && this.MoRef.Equals(viewBase.MoRef))) && ((this.Client == null && viewBase.Client == null) || (this.Client != null && this.Client.Equals(viewBase.Client))));\n        }\n\n        public override bool Equals(object viewBase)\n        {\n            return Equals(viewBase as ViewBase);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MoRef + \"_\" + Client).GetHashCode();\n        }\n    }\n\n    public class ViewManager : ViewBase, IEquatable<ViewManager>\n    {\n        public ManagedObjectReference[] ViewList { get; set; }\n\n        public ViewManager_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference CreateInventoryView()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateContainerView(ManagedObjectReference container, string[] type, bool recursive)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateListView(ManagedObjectReference[] obj)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateListViewFromView(ManagedObjectReference view)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(ViewManager viewManager)\n        {\n            return (viewManager != null && ((this.ViewList == null && viewManager.ViewList == null) || (this.ViewList != null && viewManager.ViewList != null && Enumerable.SequenceEqual(this.ViewList, viewManager.ViewList))) && ((this.LinkedView == null && viewManager.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(viewManager.LinkedView))));\n        }\n\n        public override bool Equals(object viewManager)\n        {\n            return Equals(viewManager as ViewManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ViewList + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class ViewManager_LinkedView : IEquatable<ViewManager_LinkedView>\n    {\n        public View[] ViewList { get; set; }\n\n        public bool Equals(ViewManager_LinkedView viewManager_LinkedView)\n        {\n            return (viewManager_LinkedView != null && ((this.ViewList == null && viewManager_LinkedView.ViewList == null) || (this.ViewList != null && viewManager_LinkedView.ViewList != null && Enumerable.SequenceEqual(this.ViewList, viewManager_LinkedView.ViewList))));\n        }\n\n        public override bool Equals(object viewManager_LinkedView)\n        {\n            return Equals(viewManager_LinkedView as ViewManager_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ViewList).GetHashCode();\n        }\n    }\n\n    public class VimAccountPasswordChangedEvent : HostEvent, IEquatable<VimAccountPasswordChangedEvent>\n    {\n        public bool Equals(VimAccountPasswordChangedEvent vimAccountPasswordChangedEvent)\n        {\n            return (vimAccountPasswordChangedEvent != null && base.Equals(vimAccountPasswordChangedEvent));\n        }\n\n        public override bool Equals(object vimAccountPasswordChangedEvent)\n        {\n            return Equals(vimAccountPasswordChangedEvent as VimAccountPasswordChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VimClientImpl : VimClient, IEquatable<VimClientImpl>\n    {\n        public VimVersion Version { get; set; }\n\n        public ServiceContent ServiceContent { get; set; }\n\n        public string ServiceUrl { get; set; }\n\n        public int ServiceTimeout { get; set; }\n\n        public bool UseSystemProxy { get; set; }\n\n        public Action<X509Certificate2> CertificateValidationHandler { get; set; }\n\n        public bool IgnoreServerCertificateErrors { get; set; }\n\n        public string SessionSecret { get; set; }\n\n        public string UserAgent { get; set; }\n\n        public object VimService { get; set; }\n\n        public ServiceContent Connect()\n        {\n            return default(ServiceContent);\n        }\n\n        public ServiceContent Connect(string serviceUrl)\n        {\n            return default(ServiceContent);\n        }\n\n        public ServiceContent Connect(string server, CommunicationProtocol? protocol, ushort? port)\n        {\n            return default(ServiceContent);\n        }\n\n        public UserSession Login(string username, string password)\n        {\n            return default(UserSession);\n        }\n\n        public UserSession Login(string serviceUrl, string username, string password)\n        {\n            return default(UserSession);\n        }\n\n        public void Logout()\n        {\n        }\n\n        public UserSession ConnectToSession(string serviceUrl, string soapSessionId)\n        {\n            return default(UserSession);\n        }\n\n        public EntityViewBase FindEntityView(Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, string[] properties)\n        {\n            return default(EntityViewBase);\n        }\n\n        public List<EntityViewBase> FindEntityViews(Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, string[] properties)\n        {\n            return default(List<EntityViewBase>);\n        }\n\n        public List<ViewBase> GetViews(IEnumerable<ManagedObjectReference> moRefs, string[] properties)\n        {\n            return default(List<ViewBase>);\n        }\n\n        public List<ViewBase> GetViews(ObjectContent[] objectContent, string[] properties)\n        {\n            return default(List<ViewBase>);\n        }\n\n        public List<ViewBase> GetViewsByMorefs(IEnumerable<ManagedObjectReference> moRefs, string[] properties)\n        {\n            return default(List<ViewBase>);\n        }\n\n        public ViewBase GetView(ManagedObjectReference moRef, string[] properties)\n        {\n            return default(ViewBase);\n        }\n\n        public void Disconnect()\n        {\n        }\n\n        public void SaveSession(string fileName)\n        {\n        }\n\n        public void LoadSession(string fileName)\n        {\n        }\n\n        public bool IsVimVersionOrHigher(VimVersion version)\n        {\n            return default(bool);\n        }\n\n        public object WaitForTask(ManagedObjectReference taskReference)\n        {\n            return default(object);\n        }\n\n        public bool Equals(VimClientImpl vimClientImpl)\n        {\n            return (vimClientImpl != null && this.Version == vimClientImpl.Version && ((this.ServiceContent == null && vimClientImpl.ServiceContent == null) || (this.ServiceContent != null && this.ServiceContent.Equals(vimClientImpl.ServiceContent))) && this.ServiceUrl == vimClientImpl.ServiceUrl && this.ServiceTimeout == vimClientImpl.ServiceTimeout && this.UseSystemProxy == vimClientImpl.UseSystemProxy && ((this.CertificateValidationHandler == null && vimClientImpl.CertificateValidationHandler == null) || (this.CertificateValidationHandler != null && this.CertificateValidationHandler.Equals(vimClientImpl.CertificateValidationHandler))) && this.IgnoreServerCertificateErrors == vimClientImpl.IgnoreServerCertificateErrors && this.SessionSecret == vimClientImpl.SessionSecret && this.UserAgent == vimClientImpl.UserAgent && ((this.VimService == null && vimClientImpl.VimService == null) || (this.VimService != null && this.VimService.Equals(vimClientImpl.VimService))));\n        }\n\n        public override bool Equals(object vimClientImpl)\n        {\n            return Equals(vimClientImpl as VimClientImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version + \"_\" + ServiceContent + \"_\" + ServiceUrl + \"_\" + ServiceTimeout + \"_\" + UseSystemProxy + \"_\" + CertificateValidationHandler + \"_\" + IgnoreServerCertificateErrors + \"_\" + SessionSecret + \"_\" + UserAgent + \"_\" + VimService).GetHashCode();\n        }\n    }\n\n    public class VimEndpointNotFoundException : VimException, IEquatable<VimEndpointNotFoundException>\n    {\n        public bool Equals(VimEndpointNotFoundException vimEndpointNotFoundException)\n        {\n            return (vimEndpointNotFoundException != null && base.Equals(vimEndpointNotFoundException));\n        }\n\n        public override bool Equals(object vimEndpointNotFoundException)\n        {\n            return Equals(vimEndpointNotFoundException as VimEndpointNotFoundException);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VimException : Exception, IEquatable<VimException>\n    {\n        public MethodFault MethodFault { get; set; }\n\n        public bool Equals(VimException vimException)\n        {\n            return (vimException != null && ((this.MethodFault == null && vimException.MethodFault == null) || (this.MethodFault != null && this.MethodFault.Equals(vimException.MethodFault))));\n        }\n\n        public override bool Equals(object vimException)\n        {\n            return Equals(vimException as VimException);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MethodFault).GetHashCode();\n        }\n    }\n\n    public class VimFault : MethodFault, IEquatable<VimFault>\n    {\n        public bool Equals(VimFault vimFault)\n        {\n            return (vimFault != null && base.Equals(vimFault));\n        }\n\n        public override bool Equals(object vimFault)\n        {\n            return Equals(vimFault as VimFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VimProtocolException : VimException, IEquatable<VimProtocolException>\n    {\n        public bool Equals(VimProtocolException vimProtocolException)\n        {\n            return (vimProtocolException != null && base.Equals(vimProtocolException));\n        }\n\n        public override bool Equals(object vimProtocolException)\n        {\n            return Equals(vimProtocolException as VimProtocolException);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VimSecurityNegotiationException : VimException, IEquatable<VimSecurityNegotiationException>\n    {\n        public bool Equals(VimSecurityNegotiationException vimSecurityNegotiationException)\n        {\n            return (vimSecurityNegotiationException != null && base.Equals(vimSecurityNegotiationException));\n        }\n\n        public override bool Equals(object vimSecurityNegotiationException)\n        {\n            return Equals(vimSecurityNegotiationException as VimSecurityNegotiationException);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VimVasaProvider : DynamicData, IEquatable<VimVasaProvider>\n    {\n        public string Uid { get; set; }\n\n        public string Url { get; set; }\n\n        public string Name { get; set; }\n\n        public string SelfSignedCertificate { get; set; }\n\n        public bool Equals(VimVasaProvider vimVasaProvider)\n        {\n            return (vimVasaProvider != null && this.Uid == vimVasaProvider.Uid && this.Url == vimVasaProvider.Url && this.Name == vimVasaProvider.Name && this.SelfSignedCertificate == vimVasaProvider.SelfSignedCertificate);\n        }\n\n        public override bool Equals(object vimVasaProvider)\n        {\n            return Equals(vimVasaProvider as VimVasaProvider);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Url + \"_\" + Name + \"_\" + SelfSignedCertificate).GetHashCode();\n        }\n    }\n\n    public class VimVasaProviderInfo : DynamicData, IEquatable<VimVasaProviderInfo>\n    {\n        public VimVasaProvider Provider { get; set; }\n\n        public VimVasaProviderStatePerArray[] ArrayState { get; set; }\n\n        public bool Equals(VimVasaProviderInfo vimVasaProviderInfo)\n        {\n            return (vimVasaProviderInfo != null && ((this.Provider == null && vimVasaProviderInfo.Provider == null) || (this.Provider != null && this.Provider.Equals(vimVasaProviderInfo.Provider))) && ((this.ArrayState == null && vimVasaProviderInfo.ArrayState == null) || (this.ArrayState != null && vimVasaProviderInfo.ArrayState != null && Enumerable.SequenceEqual(this.ArrayState, vimVasaProviderInfo.ArrayState))));\n        }\n\n        public override bool Equals(object vimVasaProviderInfo)\n        {\n            return Equals(vimVasaProviderInfo as VimVasaProviderInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Provider + \"_\" + ArrayState).GetHashCode();\n        }\n    }\n\n    public class VimVasaProviderStatePerArray : DynamicData, IEquatable<VimVasaProviderStatePerArray>\n    {\n        public int Priority { get; set; }\n\n        public string ArrayId { get; set; }\n\n        public bool Active { get; set; }\n\n        public bool Equals(VimVasaProviderStatePerArray vimVasaProviderStatePerArray)\n        {\n            return (vimVasaProviderStatePerArray != null && this.Priority == vimVasaProviderStatePerArray.Priority && this.ArrayId == vimVasaProviderStatePerArray.ArrayId && this.Active == vimVasaProviderStatePerArray.Active);\n        }\n\n        public override bool Equals(object vimVasaProviderStatePerArray)\n        {\n            return Equals(vimVasaProviderStatePerArray as VimVasaProviderStatePerArray);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Priority + \"_\" + ArrayId + \"_\" + Active).GetHashCode();\n        }\n    }\n\n    public class VirtualAHCIController : VirtualSATAController, IEquatable<VirtualAHCIController>\n    {\n        public bool Equals(VirtualAHCIController virtualAHCIController)\n        {\n            return (virtualAHCIController != null && base.Equals(virtualAHCIController));\n        }\n\n        public override bool Equals(object virtualAHCIController)\n        {\n            return Equals(virtualAHCIController as VirtualAHCIController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualAHCIControllerOption : VirtualSATAControllerOption, IEquatable<VirtualAHCIControllerOption>\n    {\n        public bool Equals(VirtualAHCIControllerOption virtualAHCIControllerOption)\n        {\n            return (virtualAHCIControllerOption != null && base.Equals(virtualAHCIControllerOption));\n        }\n\n        public override bool Equals(object virtualAHCIControllerOption)\n        {\n            return Equals(virtualAHCIControllerOption as VirtualAHCIControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualApp : ResourcePool, IEquatable<VirtualApp>\n    {\n        public ManagedObjectReference ParentFolder { get; set; }\n\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public ManagedObjectReference[] Network { get; set; }\n\n        public VAppConfigInfo VAppConfig { get; set; }\n\n        public ManagedObjectReference ParentVApp { get; set; }\n\n        public VirtualAppLinkInfo[] ChildLink { get; set; }\n\n        public new VirtualApp_LinkedView LinkedView { get; set; }\n\n        public void UpdateVAppConfig(VAppConfigSpec spec)\n        {\n        }\n\n        public void UpdateLinkedChildren(VirtualAppLinkInfo[] addChangeSet, ManagedObjectReference[] removeSet)\n        {\n        }\n\n        public ManagedObjectReference CloneVApp_Task(string name, ManagedObjectReference target, VAppCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CloneVApp(string name, ManagedObjectReference target, VAppCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference ExportVApp()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference PowerOnVApp_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PowerOnVApp()\n        {\n        }\n\n        public ManagedObjectReference PowerOffVApp_Task(bool force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PowerOffVApp(bool force)\n        {\n        }\n\n        public ManagedObjectReference SuspendVApp_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void SuspendVApp()\n        {\n        }\n\n        public ManagedObjectReference unregisterVApp_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void unregisterVApp()\n        {\n        }\n\n        public bool Equals(VirtualApp virtualApp)\n        {\n            return (virtualApp != null && ((this.ParentFolder == null && virtualApp.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(virtualApp.ParentFolder))) && ((this.Datastore == null && virtualApp.Datastore == null) || (this.Datastore != null && virtualApp.Datastore != null && Enumerable.SequenceEqual(this.Datastore, virtualApp.Datastore))) && ((this.Network == null && virtualApp.Network == null) || (this.Network != null && virtualApp.Network != null && Enumerable.SequenceEqual(this.Network, virtualApp.Network))) && ((this.VAppConfig == null && virtualApp.VAppConfig == null) || (this.VAppConfig != null && this.VAppConfig.Equals(virtualApp.VAppConfig))) && ((this.ParentVApp == null && virtualApp.ParentVApp == null) || (this.ParentVApp != null && this.ParentVApp.Equals(virtualApp.ParentVApp))) && ((this.ChildLink == null && virtualApp.ChildLink == null) || (this.ChildLink != null && virtualApp.ChildLink != null && Enumerable.SequenceEqual(this.ChildLink, virtualApp.ChildLink))) && ((this.LinkedView == null && virtualApp.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualApp.LinkedView))));\n        }\n\n        public override bool Equals(object virtualApp)\n        {\n            return Equals(virtualApp as VirtualApp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentFolder + \"_\" + Datastore + \"_\" + Network + \"_\" + VAppConfig + \"_\" + ParentVApp + \"_\" + ChildLink + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualApp_LinkedView : ResourcePool_LinkedView, IEquatable<VirtualApp_LinkedView>\n    {\n        public Folder ParentFolder { get; set; }\n\n        public Datastore[] Datastore { get; set; }\n\n        public Network[] Network { get; set; }\n\n        public ManagedEntity ParentVApp { get; set; }\n\n        public bool Equals(VirtualApp_LinkedView virtualApp_LinkedView)\n        {\n            return (virtualApp_LinkedView != null && ((this.ParentFolder == null && virtualApp_LinkedView.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(virtualApp_LinkedView.ParentFolder))) && ((this.Datastore == null && virtualApp_LinkedView.Datastore == null) || (this.Datastore != null && virtualApp_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, virtualApp_LinkedView.Datastore))) && ((this.Network == null && virtualApp_LinkedView.Network == null) || (this.Network != null && virtualApp_LinkedView.Network != null && Enumerable.SequenceEqual(this.Network, virtualApp_LinkedView.Network))) && ((this.ParentVApp == null && virtualApp_LinkedView.ParentVApp == null) || (this.ParentVApp != null && this.ParentVApp.Equals(virtualApp_LinkedView.ParentVApp))));\n        }\n\n        public override bool Equals(object virtualApp_LinkedView)\n        {\n            return Equals(virtualApp_LinkedView as VirtualApp_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentFolder + \"_\" + Datastore + \"_\" + Network + \"_\" + ParentVApp).GetHashCode();\n        }\n    }\n\n    public class VirtualAppImportSpec : ImportSpec, IEquatable<VirtualAppImportSpec>\n    {\n        public string Name { get; set; }\n\n        public VAppConfigSpec VAppConfigSpec { get; set; }\n\n        public ResourceConfigSpec ResourcePoolSpec { get; set; }\n\n        public ImportSpec[] Child { get; set; }\n\n        public bool Equals(VirtualAppImportSpec virtualAppImportSpec)\n        {\n            return (virtualAppImportSpec != null && this.Name == virtualAppImportSpec.Name && ((this.VAppConfigSpec == null && virtualAppImportSpec.VAppConfigSpec == null) || (this.VAppConfigSpec != null && this.VAppConfigSpec.Equals(virtualAppImportSpec.VAppConfigSpec))) && ((this.ResourcePoolSpec == null && virtualAppImportSpec.ResourcePoolSpec == null) || (this.ResourcePoolSpec != null && this.ResourcePoolSpec.Equals(virtualAppImportSpec.ResourcePoolSpec))) && ((this.Child == null && virtualAppImportSpec.Child == null) || (this.Child != null && virtualAppImportSpec.Child != null && Enumerable.SequenceEqual(this.Child, virtualAppImportSpec.Child))));\n        }\n\n        public override bool Equals(object virtualAppImportSpec)\n        {\n            return Equals(virtualAppImportSpec as VirtualAppImportSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + VAppConfigSpec + \"_\" + ResourcePoolSpec + \"_\" + Child).GetHashCode();\n        }\n    }\n\n    public class VirtualAppLinkInfo : DynamicData, IEquatable<VirtualAppLinkInfo>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public bool? DestroyWithParent { get; set; }\n\n        public VirtualAppLinkInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualAppLinkInfo virtualAppLinkInfo)\n        {\n            return (virtualAppLinkInfo != null && ((this.Key == null && virtualAppLinkInfo.Key == null) || (this.Key != null && this.Key.Equals(virtualAppLinkInfo.Key))) && ((this.DestroyWithParent == null && virtualAppLinkInfo.DestroyWithParent == null) || (this.DestroyWithParent != null && this.DestroyWithParent.Equals(virtualAppLinkInfo.DestroyWithParent))) && ((this.LinkedView == null && virtualAppLinkInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualAppLinkInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualAppLinkInfo)\n        {\n            return Equals(virtualAppLinkInfo as VirtualAppLinkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + DestroyWithParent + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualAppLinkInfo_LinkedView : IEquatable<VirtualAppLinkInfo_LinkedView>\n    {\n        public ManagedEntity Key { get; set; }\n\n        public bool Equals(VirtualAppLinkInfo_LinkedView virtualAppLinkInfo_LinkedView)\n        {\n            return (virtualAppLinkInfo_LinkedView != null && ((this.Key == null && virtualAppLinkInfo_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(virtualAppLinkInfo_LinkedView.Key))));\n        }\n\n        public override bool Equals(object virtualAppLinkInfo_LinkedView)\n        {\n            return Equals(virtualAppLinkInfo_LinkedView as VirtualAppLinkInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class VirtualAppSummary : ResourcePoolSummary, IEquatable<VirtualAppSummary>\n    {\n        public VAppProductInfo Product { get; set; }\n\n        public VirtualAppVAppState? VAppState { get; set; }\n\n        public bool? Suspended { get; set; }\n\n        public bool? InstallBootRequired { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(VirtualAppSummary virtualAppSummary)\n        {\n            return (virtualAppSummary != null && ((this.Product == null && virtualAppSummary.Product == null) || (this.Product != null && this.Product.Equals(virtualAppSummary.Product))) && ((this.VAppState == null && virtualAppSummary.VAppState == null) || (this.VAppState != null && this.VAppState.Equals(virtualAppSummary.VAppState))) && ((this.Suspended == null && virtualAppSummary.Suspended == null) || (this.Suspended != null && this.Suspended.Equals(virtualAppSummary.Suspended))) && ((this.InstallBootRequired == null && virtualAppSummary.InstallBootRequired == null) || (this.InstallBootRequired != null && this.InstallBootRequired.Equals(virtualAppSummary.InstallBootRequired))) && this.InstanceUuid == virtualAppSummary.InstanceUuid);\n        }\n\n        public override bool Equals(object virtualAppSummary)\n        {\n            return Equals(virtualAppSummary as VirtualAppSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Product + \"_\" + VAppState + \"_\" + Suspended + \"_\" + InstallBootRequired + \"_\" + InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class VirtualBusLogicController : VirtualSCSIController, IEquatable<VirtualBusLogicController>\n    {\n        public bool Equals(VirtualBusLogicController virtualBusLogicController)\n        {\n            return (virtualBusLogicController != null && base.Equals(virtualBusLogicController));\n        }\n\n        public override bool Equals(object virtualBusLogicController)\n        {\n            return Equals(virtualBusLogicController as VirtualBusLogicController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualBusLogicControllerOption : VirtualSCSIControllerOption, IEquatable<VirtualBusLogicControllerOption>\n    {\n        public bool Equals(VirtualBusLogicControllerOption virtualBusLogicControllerOption)\n        {\n            return (virtualBusLogicControllerOption != null && base.Equals(virtualBusLogicControllerOption));\n        }\n\n        public override bool Equals(object virtualBusLogicControllerOption)\n        {\n            return Equals(virtualBusLogicControllerOption as VirtualBusLogicControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdrom : VirtualDevice, IEquatable<VirtualCdrom>\n    {\n        public bool Equals(VirtualCdrom virtualCdrom)\n        {\n            return (virtualCdrom != null && base.Equals(virtualCdrom));\n        }\n\n        public override bool Equals(object virtualCdrom)\n        {\n            return Equals(virtualCdrom as VirtualCdrom);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromAtapiBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualCdromAtapiBackingInfo>\n    {\n        public bool Equals(VirtualCdromAtapiBackingInfo virtualCdromAtapiBackingInfo)\n        {\n            return (virtualCdromAtapiBackingInfo != null && base.Equals(virtualCdromAtapiBackingInfo));\n        }\n\n        public override bool Equals(object virtualCdromAtapiBackingInfo)\n        {\n            return Equals(virtualCdromAtapiBackingInfo as VirtualCdromAtapiBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromAtapiBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualCdromAtapiBackingOption>\n    {\n        public bool Equals(VirtualCdromAtapiBackingOption virtualCdromAtapiBackingOption)\n        {\n            return (virtualCdromAtapiBackingOption != null && base.Equals(virtualCdromAtapiBackingOption));\n        }\n\n        public override bool Equals(object virtualCdromAtapiBackingOption)\n        {\n            return Equals(virtualCdromAtapiBackingOption as VirtualCdromAtapiBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromIsoBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualCdromIsoBackingInfo>\n    {\n        public new VirtualCdromIsoBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualCdromIsoBackingInfo virtualCdromIsoBackingInfo)\n        {\n            return (virtualCdromIsoBackingInfo != null && ((this.LinkedView == null && virtualCdromIsoBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualCdromIsoBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualCdromIsoBackingInfo)\n        {\n            return Equals(virtualCdromIsoBackingInfo as VirtualCdromIsoBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualCdromIsoBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualCdromIsoBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualCdromIsoBackingInfo_LinkedView virtualCdromIsoBackingInfo_LinkedView)\n        {\n            return (virtualCdromIsoBackingInfo_LinkedView != null && base.Equals(virtualCdromIsoBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualCdromIsoBackingInfo_LinkedView)\n        {\n            return Equals(virtualCdromIsoBackingInfo_LinkedView as VirtualCdromIsoBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromIsoBackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualCdromIsoBackingOption>\n    {\n        public bool Equals(VirtualCdromIsoBackingOption virtualCdromIsoBackingOption)\n        {\n            return (virtualCdromIsoBackingOption != null && base.Equals(virtualCdromIsoBackingOption));\n        }\n\n        public override bool Equals(object virtualCdromIsoBackingOption)\n        {\n            return Equals(virtualCdromIsoBackingOption as VirtualCdromIsoBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromOption : VirtualDeviceOption, IEquatable<VirtualCdromOption>\n    {\n        public bool Equals(VirtualCdromOption virtualCdromOption)\n        {\n            return (virtualCdromOption != null && base.Equals(virtualCdromOption));\n        }\n\n        public override bool Equals(object virtualCdromOption)\n        {\n            return Equals(virtualCdromOption as VirtualCdromOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromPassthroughBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualCdromPassthroughBackingInfo>\n    {\n        public bool Exclusive { get; set; }\n\n        public bool Equals(VirtualCdromPassthroughBackingInfo virtualCdromPassthroughBackingInfo)\n        {\n            return (virtualCdromPassthroughBackingInfo != null && this.Exclusive == virtualCdromPassthroughBackingInfo.Exclusive);\n        }\n\n        public override bool Equals(object virtualCdromPassthroughBackingInfo)\n        {\n            return Equals(virtualCdromPassthroughBackingInfo as VirtualCdromPassthroughBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Exclusive).GetHashCode();\n        }\n    }\n\n    public class VirtualCdromPassthroughBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualCdromPassthroughBackingOption>\n    {\n        public BoolOption Exclusive { get; set; }\n\n        public bool Equals(VirtualCdromPassthroughBackingOption virtualCdromPassthroughBackingOption)\n        {\n            return (virtualCdromPassthroughBackingOption != null && ((this.Exclusive == null && virtualCdromPassthroughBackingOption.Exclusive == null) || (this.Exclusive != null && this.Exclusive.Equals(virtualCdromPassthroughBackingOption.Exclusive))));\n        }\n\n        public override bool Equals(object virtualCdromPassthroughBackingOption)\n        {\n            return Equals(virtualCdromPassthroughBackingOption as VirtualCdromPassthroughBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Exclusive).GetHashCode();\n        }\n    }\n\n    public class VirtualCdromRemoteAtapiBackingInfo : VirtualDeviceRemoteDeviceBackingInfo, IEquatable<VirtualCdromRemoteAtapiBackingInfo>\n    {\n        public bool Equals(VirtualCdromRemoteAtapiBackingInfo virtualCdromRemoteAtapiBackingInfo)\n        {\n            return (virtualCdromRemoteAtapiBackingInfo != null && base.Equals(virtualCdromRemoteAtapiBackingInfo));\n        }\n\n        public override bool Equals(object virtualCdromRemoteAtapiBackingInfo)\n        {\n            return Equals(virtualCdromRemoteAtapiBackingInfo as VirtualCdromRemoteAtapiBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromRemoteAtapiBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualCdromRemoteAtapiBackingOption>\n    {\n        public bool Equals(VirtualCdromRemoteAtapiBackingOption virtualCdromRemoteAtapiBackingOption)\n        {\n            return (virtualCdromRemoteAtapiBackingOption != null && base.Equals(virtualCdromRemoteAtapiBackingOption));\n        }\n\n        public override bool Equals(object virtualCdromRemoteAtapiBackingOption)\n        {\n            return Equals(virtualCdromRemoteAtapiBackingOption as VirtualCdromRemoteAtapiBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualCdromRemotePassthroughBackingInfo : VirtualDeviceRemoteDeviceBackingInfo, IEquatable<VirtualCdromRemotePassthroughBackingInfo>\n    {\n        public bool Exclusive { get; set; }\n\n        public bool Equals(VirtualCdromRemotePassthroughBackingInfo virtualCdromRemotePassthroughBackingInfo)\n        {\n            return (virtualCdromRemotePassthroughBackingInfo != null && this.Exclusive == virtualCdromRemotePassthroughBackingInfo.Exclusive);\n        }\n\n        public override bool Equals(object virtualCdromRemotePassthroughBackingInfo)\n        {\n            return Equals(virtualCdromRemotePassthroughBackingInfo as VirtualCdromRemotePassthroughBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Exclusive).GetHashCode();\n        }\n    }\n\n    public class VirtualCdromRemotePassthroughBackingOption : VirtualDeviceRemoteDeviceBackingOption, IEquatable<VirtualCdromRemotePassthroughBackingOption>\n    {\n        public BoolOption Exclusive { get; set; }\n\n        public bool Equals(VirtualCdromRemotePassthroughBackingOption virtualCdromRemotePassthroughBackingOption)\n        {\n            return (virtualCdromRemotePassthroughBackingOption != null && ((this.Exclusive == null && virtualCdromRemotePassthroughBackingOption.Exclusive == null) || (this.Exclusive != null && this.Exclusive.Equals(virtualCdromRemotePassthroughBackingOption.Exclusive))));\n        }\n\n        public override bool Equals(object virtualCdromRemotePassthroughBackingOption)\n        {\n            return Equals(virtualCdromRemotePassthroughBackingOption as VirtualCdromRemotePassthroughBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Exclusive).GetHashCode();\n        }\n    }\n\n    public class VirtualController : VirtualDevice, IEquatable<VirtualController>\n    {\n        public int BusNumber { get; set; }\n\n        public int[] Device { get; set; }\n\n        public bool Equals(VirtualController virtualController)\n        {\n            return (virtualController != null && this.BusNumber == virtualController.BusNumber && ((this.Device == null && virtualController.Device == null) || (this.Device != null && virtualController.Device != null && Enumerable.SequenceEqual(this.Device, virtualController.Device))));\n        }\n\n        public override bool Equals(object virtualController)\n        {\n            return Equals(virtualController as VirtualController);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BusNumber + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class VirtualControllerOption : VirtualDeviceOption, IEquatable<VirtualControllerOption>\n    {\n        public IntOption Devices { get; set; }\n\n        public string[] SupportedDevice { get; set; }\n\n        public bool Equals(VirtualControllerOption virtualControllerOption)\n        {\n            return (virtualControllerOption != null && ((this.Devices == null && virtualControllerOption.Devices == null) || (this.Devices != null && this.Devices.Equals(virtualControllerOption.Devices))) && ((this.SupportedDevice == null && virtualControllerOption.SupportedDevice == null) || (this.SupportedDevice != null && virtualControllerOption.SupportedDevice != null && Enumerable.SequenceEqual(this.SupportedDevice, virtualControllerOption.SupportedDevice))));\n        }\n\n        public override bool Equals(object virtualControllerOption)\n        {\n            return Equals(virtualControllerOption as VirtualControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Devices + \"_\" + SupportedDevice).GetHashCode();\n        }\n    }\n\n    public class VirtualDevice : DynamicData, IEquatable<VirtualDevice>\n    {\n        public int Key { get; set; }\n\n        public Description DeviceInfo { get; set; }\n\n        public VirtualDeviceBackingInfo Backing { get; set; }\n\n        public VirtualDeviceConnectInfo Connectable { get; set; }\n\n        public VirtualDeviceBusSlotInfo SlotInfo { get; set; }\n\n        public int? ControllerKey { get; set; }\n\n        public int? UnitNumber { get; set; }\n\n        public bool Equals(VirtualDevice virtualDevice)\n        {\n            return (virtualDevice != null && this.Key == virtualDevice.Key && ((this.DeviceInfo == null && virtualDevice.DeviceInfo == null) || (this.DeviceInfo != null && this.DeviceInfo.Equals(virtualDevice.DeviceInfo))) && ((this.Backing == null && virtualDevice.Backing == null) || (this.Backing != null && this.Backing.Equals(virtualDevice.Backing))) && ((this.Connectable == null && virtualDevice.Connectable == null) || (this.Connectable != null && this.Connectable.Equals(virtualDevice.Connectable))) && ((this.SlotInfo == null && virtualDevice.SlotInfo == null) || (this.SlotInfo != null && this.SlotInfo.Equals(virtualDevice.SlotInfo))) && ((this.ControllerKey == null && virtualDevice.ControllerKey == null) || (this.ControllerKey != null && this.ControllerKey.Equals(virtualDevice.ControllerKey))) && ((this.UnitNumber == null && virtualDevice.UnitNumber == null) || (this.UnitNumber != null && this.UnitNumber.Equals(virtualDevice.UnitNumber))));\n        }\n\n        public override bool Equals(object virtualDevice)\n        {\n            return Equals(virtualDevice as VirtualDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + DeviceInfo + \"_\" + Backing + \"_\" + Connectable + \"_\" + SlotInfo + \"_\" + ControllerKey + \"_\" + UnitNumber).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceBackingInfo : DynamicData, IEquatable<VirtualDeviceBackingInfo>\n    {\n        public bool Equals(VirtualDeviceBackingInfo virtualDeviceBackingInfo)\n        {\n            return (virtualDeviceBackingInfo != null && base.Equals(virtualDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualDeviceBackingInfo)\n        {\n            return Equals(virtualDeviceBackingInfo as VirtualDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceBackingOption : DynamicData, IEquatable<VirtualDeviceBackingOption>\n    {\n        public string Type { get; set; }\n\n        public bool Equals(VirtualDeviceBackingOption virtualDeviceBackingOption)\n        {\n            return (virtualDeviceBackingOption != null && this.Type == virtualDeviceBackingOption.Type);\n        }\n\n        public override bool Equals(object virtualDeviceBackingOption)\n        {\n            return Equals(virtualDeviceBackingOption as VirtualDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceBusSlotInfo : DynamicData, IEquatable<VirtualDeviceBusSlotInfo>\n    {\n        public bool Equals(VirtualDeviceBusSlotInfo virtualDeviceBusSlotInfo)\n        {\n            return (virtualDeviceBusSlotInfo != null && base.Equals(virtualDeviceBusSlotInfo));\n        }\n\n        public override bool Equals(object virtualDeviceBusSlotInfo)\n        {\n            return Equals(virtualDeviceBusSlotInfo as VirtualDeviceBusSlotInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceBusSlotOption : DynamicData, IEquatable<VirtualDeviceBusSlotOption>\n    {\n        public string Type { get; set; }\n\n        public bool Equals(VirtualDeviceBusSlotOption virtualDeviceBusSlotOption)\n        {\n            return (virtualDeviceBusSlotOption != null && this.Type == virtualDeviceBusSlotOption.Type);\n        }\n\n        public override bool Equals(object virtualDeviceBusSlotOption)\n        {\n            return Equals(virtualDeviceBusSlotOption as VirtualDeviceBusSlotOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceConfigSpec : DynamicData, IEquatable<VirtualDeviceConfigSpec>\n    {\n        public VirtualDeviceConfigSpecOperation? Operation { get; set; }\n\n        public VirtualDeviceConfigSpecFileOperation? FileOperation { get; set; }\n\n        public VirtualDevice Device { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public VirtualDeviceConfigSpecBackingSpec Backing { get; set; }\n\n        public bool Equals(VirtualDeviceConfigSpec virtualDeviceConfigSpec)\n        {\n            return (virtualDeviceConfigSpec != null && ((this.Operation == null && virtualDeviceConfigSpec.Operation == null) || (this.Operation != null && this.Operation.Equals(virtualDeviceConfigSpec.Operation))) && ((this.FileOperation == null && virtualDeviceConfigSpec.FileOperation == null) || (this.FileOperation != null && this.FileOperation.Equals(virtualDeviceConfigSpec.FileOperation))) && ((this.Device == null && virtualDeviceConfigSpec.Device == null) || (this.Device != null && this.Device.Equals(virtualDeviceConfigSpec.Device))) && ((this.Profile == null && virtualDeviceConfigSpec.Profile == null) || (this.Profile != null && virtualDeviceConfigSpec.Profile != null && Enumerable.SequenceEqual(this.Profile, virtualDeviceConfigSpec.Profile))) && ((this.Backing == null && virtualDeviceConfigSpec.Backing == null) || (this.Backing != null && this.Backing.Equals(virtualDeviceConfigSpec.Backing))));\n        }\n\n        public override bool Equals(object virtualDeviceConfigSpec)\n        {\n            return Equals(virtualDeviceConfigSpec as VirtualDeviceConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + FileOperation + \"_\" + Device + \"_\" + Profile + \"_\" + Backing).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceConfigSpecBackingSpec : DynamicData, IEquatable<VirtualDeviceConfigSpecBackingSpec>\n    {\n        public VirtualDeviceConfigSpecBackingSpec Parent { get; set; }\n\n        public CryptoSpec Crypto { get; set; }\n\n        public bool Equals(VirtualDeviceConfigSpecBackingSpec virtualDeviceConfigSpecBackingSpec)\n        {\n            return (virtualDeviceConfigSpecBackingSpec != null && ((this.Parent == null && virtualDeviceConfigSpecBackingSpec.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDeviceConfigSpecBackingSpec.Parent))) && ((this.Crypto == null && virtualDeviceConfigSpecBackingSpec.Crypto == null) || (this.Crypto != null && this.Crypto.Equals(virtualDeviceConfigSpecBackingSpec.Crypto))));\n        }\n\n        public override bool Equals(object virtualDeviceConfigSpecBackingSpec)\n        {\n            return Equals(virtualDeviceConfigSpecBackingSpec as VirtualDeviceConfigSpecBackingSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent + \"_\" + Crypto).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceConnectInfo : DynamicData, IEquatable<VirtualDeviceConnectInfo>\n    {\n        public string MigrateConnect { get; set; }\n\n        public bool StartConnected { get; set; }\n\n        public bool AllowGuestControl { get; set; }\n\n        public bool Connected { get; set; }\n\n        public string Status { get; set; }\n\n        public bool Equals(VirtualDeviceConnectInfo virtualDeviceConnectInfo)\n        {\n            return (virtualDeviceConnectInfo != null && this.MigrateConnect == virtualDeviceConnectInfo.MigrateConnect && this.StartConnected == virtualDeviceConnectInfo.StartConnected && this.AllowGuestControl == virtualDeviceConnectInfo.AllowGuestControl && this.Connected == virtualDeviceConnectInfo.Connected && this.Status == virtualDeviceConnectInfo.Status);\n        }\n\n        public override bool Equals(object virtualDeviceConnectInfo)\n        {\n            return Equals(virtualDeviceConnectInfo as VirtualDeviceConnectInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MigrateConnect + \"_\" + StartConnected + \"_\" + AllowGuestControl + \"_\" + Connected + \"_\" + Status).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceConnectOption : DynamicData, IEquatable<VirtualDeviceConnectOption>\n    {\n        public BoolOption StartConnected { get; set; }\n\n        public BoolOption AllowGuestControl { get; set; }\n\n        public bool Equals(VirtualDeviceConnectOption virtualDeviceConnectOption)\n        {\n            return (virtualDeviceConnectOption != null && ((this.StartConnected == null && virtualDeviceConnectOption.StartConnected == null) || (this.StartConnected != null && this.StartConnected.Equals(virtualDeviceConnectOption.StartConnected))) && ((this.AllowGuestControl == null && virtualDeviceConnectOption.AllowGuestControl == null) || (this.AllowGuestControl != null && this.AllowGuestControl.Equals(virtualDeviceConnectOption.AllowGuestControl))));\n        }\n\n        public override bool Equals(object virtualDeviceConnectOption)\n        {\n            return Equals(virtualDeviceConnectOption as VirtualDeviceConnectOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StartConnected + \"_\" + AllowGuestControl).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceDeviceBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualDeviceDeviceBackingInfo>\n    {\n        public string DeviceName { get; set; }\n\n        public bool? UseAutoDetect { get; set; }\n\n        public bool Equals(VirtualDeviceDeviceBackingInfo virtualDeviceDeviceBackingInfo)\n        {\n            return (virtualDeviceDeviceBackingInfo != null && this.DeviceName == virtualDeviceDeviceBackingInfo.DeviceName && ((this.UseAutoDetect == null && virtualDeviceDeviceBackingInfo.UseAutoDetect == null) || (this.UseAutoDetect != null && this.UseAutoDetect.Equals(virtualDeviceDeviceBackingInfo.UseAutoDetect))));\n        }\n\n        public override bool Equals(object virtualDeviceDeviceBackingInfo)\n        {\n            return Equals(virtualDeviceDeviceBackingInfo as VirtualDeviceDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceName + \"_\" + UseAutoDetect).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceDeviceBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualDeviceDeviceBackingOption>\n    {\n        public BoolOption AutoDetectAvailable { get; set; }\n\n        public bool Equals(VirtualDeviceDeviceBackingOption virtualDeviceDeviceBackingOption)\n        {\n            return (virtualDeviceDeviceBackingOption != null && ((this.AutoDetectAvailable == null && virtualDeviceDeviceBackingOption.AutoDetectAvailable == null) || (this.AutoDetectAvailable != null && this.AutoDetectAvailable.Equals(virtualDeviceDeviceBackingOption.AutoDetectAvailable))));\n        }\n\n        public override bool Equals(object virtualDeviceDeviceBackingOption)\n        {\n            return Equals(virtualDeviceDeviceBackingOption as VirtualDeviceDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoDetectAvailable).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceFileBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualDeviceFileBackingInfo>\n    {\n        public string FileName { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string BackingObjectId { get; set; }\n\n        public VirtualDeviceFileBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDeviceFileBackingInfo virtualDeviceFileBackingInfo)\n        {\n            return (virtualDeviceFileBackingInfo != null && this.FileName == virtualDeviceFileBackingInfo.FileName && ((this.Datastore == null && virtualDeviceFileBackingInfo.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualDeviceFileBackingInfo.Datastore))) && this.BackingObjectId == virtualDeviceFileBackingInfo.BackingObjectId && ((this.LinkedView == null && virtualDeviceFileBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDeviceFileBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDeviceFileBackingInfo)\n        {\n            return Equals(virtualDeviceFileBackingInfo as VirtualDeviceFileBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileName + \"_\" + Datastore + \"_\" + BackingObjectId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceFileBackingInfo_LinkedView : IEquatable<VirtualDeviceFileBackingInfo_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(VirtualDeviceFileBackingInfo_LinkedView virtualDeviceFileBackingInfo_LinkedView)\n        {\n            return (virtualDeviceFileBackingInfo_LinkedView != null && ((this.Datastore == null && virtualDeviceFileBackingInfo_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualDeviceFileBackingInfo_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object virtualDeviceFileBackingInfo_LinkedView)\n        {\n            return Equals(virtualDeviceFileBackingInfo_LinkedView as VirtualDeviceFileBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceFileBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualDeviceFileBackingOption>\n    {\n        public ChoiceOption FileNameExtensions { get; set; }\n\n        public bool Equals(VirtualDeviceFileBackingOption virtualDeviceFileBackingOption)\n        {\n            return (virtualDeviceFileBackingOption != null && ((this.FileNameExtensions == null && virtualDeviceFileBackingOption.FileNameExtensions == null) || (this.FileNameExtensions != null && this.FileNameExtensions.Equals(virtualDeviceFileBackingOption.FileNameExtensions))));\n        }\n\n        public override bool Equals(object virtualDeviceFileBackingOption)\n        {\n            return Equals(virtualDeviceFileBackingOption as VirtualDeviceFileBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileNameExtensions).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceOption : DynamicData, IEquatable<VirtualDeviceOption>\n    {\n        public string Type { get; set; }\n\n        public VirtualDeviceConnectOption ConnectOption { get; set; }\n\n        public VirtualDeviceBusSlotOption BusSlotOption { get; set; }\n\n        public string ControllerType { get; set; }\n\n        public BoolOption AutoAssignController { get; set; }\n\n        public VirtualDeviceBackingOption[] BackingOption { get; set; }\n\n        public int? DefaultBackingOptionIndex { get; set; }\n\n        public string[] LicensingLimit { get; set; }\n\n        public bool Deprecated { get; set; }\n\n        public bool PlugAndPlay { get; set; }\n\n        public bool HotRemoveSupported { get; set; }\n\n        public bool Equals(VirtualDeviceOption virtualDeviceOption)\n        {\n            return (virtualDeviceOption != null && this.Type == virtualDeviceOption.Type && ((this.ConnectOption == null && virtualDeviceOption.ConnectOption == null) || (this.ConnectOption != null && this.ConnectOption.Equals(virtualDeviceOption.ConnectOption))) && ((this.BusSlotOption == null && virtualDeviceOption.BusSlotOption == null) || (this.BusSlotOption != null && this.BusSlotOption.Equals(virtualDeviceOption.BusSlotOption))) && this.ControllerType == virtualDeviceOption.ControllerType && ((this.AutoAssignController == null && virtualDeviceOption.AutoAssignController == null) || (this.AutoAssignController != null && this.AutoAssignController.Equals(virtualDeviceOption.AutoAssignController))) && ((this.BackingOption == null && virtualDeviceOption.BackingOption == null) || (this.BackingOption != null && virtualDeviceOption.BackingOption != null && Enumerable.SequenceEqual(this.BackingOption, virtualDeviceOption.BackingOption))) && ((this.DefaultBackingOptionIndex == null && virtualDeviceOption.DefaultBackingOptionIndex == null) || (this.DefaultBackingOptionIndex != null && this.DefaultBackingOptionIndex.Equals(virtualDeviceOption.DefaultBackingOptionIndex))) && ((this.LicensingLimit == null && virtualDeviceOption.LicensingLimit == null) || (this.LicensingLimit != null && virtualDeviceOption.LicensingLimit != null && Enumerable.SequenceEqual(this.LicensingLimit, virtualDeviceOption.LicensingLimit))) && this.Deprecated == virtualDeviceOption.Deprecated && this.PlugAndPlay == virtualDeviceOption.PlugAndPlay && this.HotRemoveSupported == virtualDeviceOption.HotRemoveSupported);\n        }\n\n        public override bool Equals(object virtualDeviceOption)\n        {\n            return Equals(virtualDeviceOption as VirtualDeviceOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + ConnectOption + \"_\" + BusSlotOption + \"_\" + ControllerType + \"_\" + AutoAssignController + \"_\" + BackingOption + \"_\" + DefaultBackingOptionIndex + \"_\" + LicensingLimit + \"_\" + Deprecated + \"_\" + PlugAndPlay + \"_\" + HotRemoveSupported).GetHashCode();\n        }\n    }\n\n    public class VirtualDevicePciBusSlotInfo : VirtualDeviceBusSlotInfo, IEquatable<VirtualDevicePciBusSlotInfo>\n    {\n        public int PciSlotNumber { get; set; }\n\n        public bool Equals(VirtualDevicePciBusSlotInfo virtualDevicePciBusSlotInfo)\n        {\n            return (virtualDevicePciBusSlotInfo != null && this.PciSlotNumber == virtualDevicePciBusSlotInfo.PciSlotNumber);\n        }\n\n        public override bool Equals(object virtualDevicePciBusSlotInfo)\n        {\n            return Equals(virtualDevicePciBusSlotInfo as VirtualDevicePciBusSlotInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PciSlotNumber).GetHashCode();\n        }\n    }\n\n    public class VirtualDevicePipeBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualDevicePipeBackingInfo>\n    {\n        public string PipeName { get; set; }\n\n        public bool Equals(VirtualDevicePipeBackingInfo virtualDevicePipeBackingInfo)\n        {\n            return (virtualDevicePipeBackingInfo != null && this.PipeName == virtualDevicePipeBackingInfo.PipeName);\n        }\n\n        public override bool Equals(object virtualDevicePipeBackingInfo)\n        {\n            return Equals(virtualDevicePipeBackingInfo as VirtualDevicePipeBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PipeName).GetHashCode();\n        }\n    }\n\n    public class VirtualDevicePipeBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualDevicePipeBackingOption>\n    {\n        public bool Equals(VirtualDevicePipeBackingOption virtualDevicePipeBackingOption)\n        {\n            return (virtualDevicePipeBackingOption != null && base.Equals(virtualDevicePipeBackingOption));\n        }\n\n        public override bool Equals(object virtualDevicePipeBackingOption)\n        {\n            return Equals(virtualDevicePipeBackingOption as VirtualDevicePipeBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceRemoteDeviceBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualDeviceRemoteDeviceBackingInfo>\n    {\n        public string DeviceName { get; set; }\n\n        public bool? UseAutoDetect { get; set; }\n\n        public bool Equals(VirtualDeviceRemoteDeviceBackingInfo virtualDeviceRemoteDeviceBackingInfo)\n        {\n            return (virtualDeviceRemoteDeviceBackingInfo != null && this.DeviceName == virtualDeviceRemoteDeviceBackingInfo.DeviceName && ((this.UseAutoDetect == null && virtualDeviceRemoteDeviceBackingInfo.UseAutoDetect == null) || (this.UseAutoDetect != null && this.UseAutoDetect.Equals(virtualDeviceRemoteDeviceBackingInfo.UseAutoDetect))));\n        }\n\n        public override bool Equals(object virtualDeviceRemoteDeviceBackingInfo)\n        {\n            return Equals(virtualDeviceRemoteDeviceBackingInfo as VirtualDeviceRemoteDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceName + \"_\" + UseAutoDetect).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceRemoteDeviceBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualDeviceRemoteDeviceBackingOption>\n    {\n        public BoolOption AutoDetectAvailable { get; set; }\n\n        public bool Equals(VirtualDeviceRemoteDeviceBackingOption virtualDeviceRemoteDeviceBackingOption)\n        {\n            return (virtualDeviceRemoteDeviceBackingOption != null && ((this.AutoDetectAvailable == null && virtualDeviceRemoteDeviceBackingOption.AutoDetectAvailable == null) || (this.AutoDetectAvailable != null && this.AutoDetectAvailable.Equals(virtualDeviceRemoteDeviceBackingOption.AutoDetectAvailable))));\n        }\n\n        public override bool Equals(object virtualDeviceRemoteDeviceBackingOption)\n        {\n            return Equals(virtualDeviceRemoteDeviceBackingOption as VirtualDeviceRemoteDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoDetectAvailable).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceURIBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualDeviceURIBackingInfo>\n    {\n        public string ServiceURI { get; set; }\n\n        public string Direction { get; set; }\n\n        public string ProxyURI { get; set; }\n\n        public bool Equals(VirtualDeviceURIBackingInfo virtualDeviceURIBackingInfo)\n        {\n            return (virtualDeviceURIBackingInfo != null && this.ServiceURI == virtualDeviceURIBackingInfo.ServiceURI && this.Direction == virtualDeviceURIBackingInfo.Direction && this.ProxyURI == virtualDeviceURIBackingInfo.ProxyURI);\n        }\n\n        public override bool Equals(object virtualDeviceURIBackingInfo)\n        {\n            return Equals(virtualDeviceURIBackingInfo as VirtualDeviceURIBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServiceURI + \"_\" + Direction + \"_\" + ProxyURI).GetHashCode();\n        }\n    }\n\n    public class VirtualDeviceURIBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualDeviceURIBackingOption>\n    {\n        public ChoiceOption Directions { get; set; }\n\n        public bool Equals(VirtualDeviceURIBackingOption virtualDeviceURIBackingOption)\n        {\n            return (virtualDeviceURIBackingOption != null && ((this.Directions == null && virtualDeviceURIBackingOption.Directions == null) || (this.Directions != null && this.Directions.Equals(virtualDeviceURIBackingOption.Directions))));\n        }\n\n        public override bool Equals(object virtualDeviceURIBackingOption)\n        {\n            return Equals(virtualDeviceURIBackingOption as VirtualDeviceURIBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Directions).GetHashCode();\n        }\n    }\n\n    public class VirtualDisk : VirtualDevice, IEquatable<VirtualDisk>\n    {\n        public long CapacityInKB { get; set; }\n\n        public long? CapacityInBytes { get; set; }\n\n        public SharesInfo Shares { get; set; }\n\n        public StorageIOAllocationInfo StorageIOAllocation { get; set; }\n\n        public string DiskObjectId { get; set; }\n\n        public VirtualDiskVFlashCacheConfigInfo VFlashCacheConfigInfo { get; set; }\n\n        public string[] Iofilter { get; set; }\n\n        public ID VDiskId { get; set; }\n\n        public bool? NativeUnmanagedLinkedClone { get; set; }\n\n        public bool Equals(VirtualDisk virtualDisk)\n        {\n            return (virtualDisk != null && this.CapacityInKB == virtualDisk.CapacityInKB && ((this.CapacityInBytes == null && virtualDisk.CapacityInBytes == null) || (this.CapacityInBytes != null && this.CapacityInBytes.Equals(virtualDisk.CapacityInBytes))) && ((this.Shares == null && virtualDisk.Shares == null) || (this.Shares != null && this.Shares.Equals(virtualDisk.Shares))) && ((this.StorageIOAllocation == null && virtualDisk.StorageIOAllocation == null) || (this.StorageIOAllocation != null && this.StorageIOAllocation.Equals(virtualDisk.StorageIOAllocation))) && this.DiskObjectId == virtualDisk.DiskObjectId && ((this.VFlashCacheConfigInfo == null && virtualDisk.VFlashCacheConfigInfo == null) || (this.VFlashCacheConfigInfo != null && this.VFlashCacheConfigInfo.Equals(virtualDisk.VFlashCacheConfigInfo))) && ((this.Iofilter == null && virtualDisk.Iofilter == null) || (this.Iofilter != null && virtualDisk.Iofilter != null && Enumerable.SequenceEqual(this.Iofilter, virtualDisk.Iofilter))) && ((this.VDiskId == null && virtualDisk.VDiskId == null) || (this.VDiskId != null && this.VDiskId.Equals(virtualDisk.VDiskId))) && ((this.NativeUnmanagedLinkedClone == null && virtualDisk.NativeUnmanagedLinkedClone == null) || (this.NativeUnmanagedLinkedClone != null && this.NativeUnmanagedLinkedClone.Equals(virtualDisk.NativeUnmanagedLinkedClone))));\n        }\n\n        public override bool Equals(object virtualDisk)\n        {\n            return Equals(virtualDisk as VirtualDisk);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityInKB + \"_\" + CapacityInBytes + \"_\" + Shares + \"_\" + StorageIOAllocation + \"_\" + DiskObjectId + \"_\" + VFlashCacheConfigInfo + \"_\" + Iofilter + \"_\" + VDiskId + \"_\" + NativeUnmanagedLinkedClone).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskAntiAffinityRuleSpec : ClusterRuleInfo, IEquatable<VirtualDiskAntiAffinityRuleSpec>\n    {\n        public int[] DiskId { get; set; }\n\n        public bool Equals(VirtualDiskAntiAffinityRuleSpec virtualDiskAntiAffinityRuleSpec)\n        {\n            return (virtualDiskAntiAffinityRuleSpec != null && ((this.DiskId == null && virtualDiskAntiAffinityRuleSpec.DiskId == null) || (this.DiskId != null && virtualDiskAntiAffinityRuleSpec.DiskId != null && Enumerable.SequenceEqual(this.DiskId, virtualDiskAntiAffinityRuleSpec.DiskId))));\n        }\n\n        public override bool Equals(object virtualDiskAntiAffinityRuleSpec)\n        {\n            return Equals(virtualDiskAntiAffinityRuleSpec as VirtualDiskAntiAffinityRuleSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskBlocksNotFullyProvisioned : DeviceBackingNotSupported, IEquatable<VirtualDiskBlocksNotFullyProvisioned>\n    {\n        public bool Equals(VirtualDiskBlocksNotFullyProvisioned virtualDiskBlocksNotFullyProvisioned)\n        {\n            return (virtualDiskBlocksNotFullyProvisioned != null && base.Equals(virtualDiskBlocksNotFullyProvisioned));\n        }\n\n        public override bool Equals(object virtualDiskBlocksNotFullyProvisioned)\n        {\n            return Equals(virtualDiskBlocksNotFullyProvisioned as VirtualDiskBlocksNotFullyProvisioned);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskConfigSpec : VirtualDeviceConfigSpec, IEquatable<VirtualDiskConfigSpec>\n    {\n        public string DiskMoveType { get; set; }\n\n        public bool? MigrateCache { get; set; }\n\n        public bool Equals(VirtualDiskConfigSpec virtualDiskConfigSpec)\n        {\n            return (virtualDiskConfigSpec != null && this.DiskMoveType == virtualDiskConfigSpec.DiskMoveType && ((this.MigrateCache == null && virtualDiskConfigSpec.MigrateCache == null) || (this.MigrateCache != null && this.MigrateCache.Equals(virtualDiskConfigSpec.MigrateCache))));\n        }\n\n        public override bool Equals(object virtualDiskConfigSpec)\n        {\n            return Equals(virtualDiskConfigSpec as VirtualDiskConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMoveType + \"_\" + MigrateCache).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskDeltaDiskFormatsSupported : DynamicData, IEquatable<VirtualDiskDeltaDiskFormatsSupported>\n    {\n        public string DatastoreType { get; set; }\n\n        public ChoiceOption DeltaDiskFormat { get; set; }\n\n        public bool Equals(VirtualDiskDeltaDiskFormatsSupported virtualDiskDeltaDiskFormatsSupported)\n        {\n            return (virtualDiskDeltaDiskFormatsSupported != null && this.DatastoreType == virtualDiskDeltaDiskFormatsSupported.DatastoreType && ((this.DeltaDiskFormat == null && virtualDiskDeltaDiskFormatsSupported.DeltaDiskFormat == null) || (this.DeltaDiskFormat != null && this.DeltaDiskFormat.Equals(virtualDiskDeltaDiskFormatsSupported.DeltaDiskFormat))));\n        }\n\n        public override bool Equals(object virtualDiskDeltaDiskFormatsSupported)\n        {\n            return Equals(virtualDiskDeltaDiskFormatsSupported as VirtualDiskDeltaDiskFormatsSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreType + \"_\" + DeltaDiskFormat).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskFlatVer1BackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskFlatVer1BackingInfo>\n    {\n        public string DiskMode { get; set; }\n\n        public bool? Split { get; set; }\n\n        public bool? WriteThrough { get; set; }\n\n        public string ContentId { get; set; }\n\n        public VirtualDiskFlatVer1BackingInfo Parent { get; set; }\n\n        public new VirtualDiskFlatVer1BackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskFlatVer1BackingInfo virtualDiskFlatVer1BackingInfo)\n        {\n            return (virtualDiskFlatVer1BackingInfo != null && this.DiskMode == virtualDiskFlatVer1BackingInfo.DiskMode && ((this.Split == null && virtualDiskFlatVer1BackingInfo.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskFlatVer1BackingInfo.Split))) && ((this.WriteThrough == null && virtualDiskFlatVer1BackingInfo.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskFlatVer1BackingInfo.WriteThrough))) && this.ContentId == virtualDiskFlatVer1BackingInfo.ContentId && ((this.Parent == null && virtualDiskFlatVer1BackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDiskFlatVer1BackingInfo.Parent))) && ((this.LinkedView == null && virtualDiskFlatVer1BackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskFlatVer1BackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskFlatVer1BackingInfo)\n        {\n            return Equals(virtualDiskFlatVer1BackingInfo as VirtualDiskFlatVer1BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + ContentId + \"_\" + Parent + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskFlatVer1BackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskFlatVer1BackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskFlatVer1BackingInfo_LinkedView virtualDiskFlatVer1BackingInfo_LinkedView)\n        {\n            return (virtualDiskFlatVer1BackingInfo_LinkedView != null && base.Equals(virtualDiskFlatVer1BackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskFlatVer1BackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskFlatVer1BackingInfo_LinkedView as VirtualDiskFlatVer1BackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskFlatVer1BackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualDiskFlatVer1BackingOption>\n    {\n        public ChoiceOption DiskMode { get; set; }\n\n        public BoolOption Split { get; set; }\n\n        public BoolOption WriteThrough { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool Equals(VirtualDiskFlatVer1BackingOption virtualDiskFlatVer1BackingOption)\n        {\n            return (virtualDiskFlatVer1BackingOption != null && ((this.DiskMode == null && virtualDiskFlatVer1BackingOption.DiskMode == null) || (this.DiskMode != null && this.DiskMode.Equals(virtualDiskFlatVer1BackingOption.DiskMode))) && ((this.Split == null && virtualDiskFlatVer1BackingOption.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskFlatVer1BackingOption.Split))) && ((this.WriteThrough == null && virtualDiskFlatVer1BackingOption.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskFlatVer1BackingOption.WriteThrough))) && this.Growable == virtualDiskFlatVer1BackingOption.Growable);\n        }\n\n        public override bool Equals(object virtualDiskFlatVer1BackingOption)\n        {\n            return Equals(virtualDiskFlatVer1BackingOption as VirtualDiskFlatVer1BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + Growable).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskFlatVer2BackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskFlatVer2BackingInfo>\n    {\n        public string DiskMode { get; set; }\n\n        public bool? Split { get; set; }\n\n        public bool? WriteThrough { get; set; }\n\n        public bool? ThinProvisioned { get; set; }\n\n        public bool? EagerlyScrub { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string ContentId { get; set; }\n\n        public string ChangeId { get; set; }\n\n        public VirtualDiskFlatVer2BackingInfo Parent { get; set; }\n\n        public string DeltaDiskFormat { get; set; }\n\n        public bool? DigestEnabled { get; set; }\n\n        public int? DeltaGrainSize { get; set; }\n\n        public string DeltaDiskFormatVariant { get; set; }\n\n        public string Sharing { get; set; }\n\n        public CryptoKeyId KeyId { get; set; }\n\n        public new VirtualDiskFlatVer2BackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskFlatVer2BackingInfo virtualDiskFlatVer2BackingInfo)\n        {\n            return (virtualDiskFlatVer2BackingInfo != null && this.DiskMode == virtualDiskFlatVer2BackingInfo.DiskMode && ((this.Split == null && virtualDiskFlatVer2BackingInfo.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskFlatVer2BackingInfo.Split))) && ((this.WriteThrough == null && virtualDiskFlatVer2BackingInfo.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskFlatVer2BackingInfo.WriteThrough))) && ((this.ThinProvisioned == null && virtualDiskFlatVer2BackingInfo.ThinProvisioned == null) || (this.ThinProvisioned != null && this.ThinProvisioned.Equals(virtualDiskFlatVer2BackingInfo.ThinProvisioned))) && ((this.EagerlyScrub == null && virtualDiskFlatVer2BackingInfo.EagerlyScrub == null) || (this.EagerlyScrub != null && this.EagerlyScrub.Equals(virtualDiskFlatVer2BackingInfo.EagerlyScrub))) && this.Uuid == virtualDiskFlatVer2BackingInfo.Uuid && this.ContentId == virtualDiskFlatVer2BackingInfo.ContentId && this.ChangeId == virtualDiskFlatVer2BackingInfo.ChangeId && ((this.Parent == null && virtualDiskFlatVer2BackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDiskFlatVer2BackingInfo.Parent))) && this.DeltaDiskFormat == virtualDiskFlatVer2BackingInfo.DeltaDiskFormat && ((this.DigestEnabled == null && virtualDiskFlatVer2BackingInfo.DigestEnabled == null) || (this.DigestEnabled != null && this.DigestEnabled.Equals(virtualDiskFlatVer2BackingInfo.DigestEnabled))) && ((this.DeltaGrainSize == null && virtualDiskFlatVer2BackingInfo.DeltaGrainSize == null) || (this.DeltaGrainSize != null && this.DeltaGrainSize.Equals(virtualDiskFlatVer2BackingInfo.DeltaGrainSize))) && this.DeltaDiskFormatVariant == virtualDiskFlatVer2BackingInfo.DeltaDiskFormatVariant && this.Sharing == virtualDiskFlatVer2BackingInfo.Sharing && ((this.KeyId == null && virtualDiskFlatVer2BackingInfo.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(virtualDiskFlatVer2BackingInfo.KeyId))) && ((this.LinkedView == null && virtualDiskFlatVer2BackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskFlatVer2BackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskFlatVer2BackingInfo)\n        {\n            return Equals(virtualDiskFlatVer2BackingInfo as VirtualDiskFlatVer2BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + ThinProvisioned + \"_\" + EagerlyScrub + \"_\" + Uuid + \"_\" + ContentId + \"_\" + ChangeId + \"_\" + Parent + \"_\" + DeltaDiskFormat + \"_\" + DigestEnabled + \"_\" + DeltaGrainSize + \"_\" + DeltaDiskFormatVariant + \"_\" + Sharing + \"_\" + KeyId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskFlatVer2BackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskFlatVer2BackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskFlatVer2BackingInfo_LinkedView virtualDiskFlatVer2BackingInfo_LinkedView)\n        {\n            return (virtualDiskFlatVer2BackingInfo_LinkedView != null && base.Equals(virtualDiskFlatVer2BackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskFlatVer2BackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskFlatVer2BackingInfo_LinkedView as VirtualDiskFlatVer2BackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskFlatVer2BackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualDiskFlatVer2BackingOption>\n    {\n        public ChoiceOption DiskMode { get; set; }\n\n        public BoolOption Split { get; set; }\n\n        public BoolOption WriteThrough { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool HotGrowable { get; set; }\n\n        public bool Uuid { get; set; }\n\n        public BoolOption ThinProvisioned { get; set; }\n\n        public BoolOption EagerlyScrub { get; set; }\n\n        public ChoiceOption DeltaDiskFormat { get; set; }\n\n        public VirtualDiskDeltaDiskFormatsSupported[] DeltaDiskFormatsSupported { get; set; }\n\n        public bool Equals(VirtualDiskFlatVer2BackingOption virtualDiskFlatVer2BackingOption)\n        {\n            return (virtualDiskFlatVer2BackingOption != null && ((this.DiskMode == null && virtualDiskFlatVer2BackingOption.DiskMode == null) || (this.DiskMode != null && this.DiskMode.Equals(virtualDiskFlatVer2BackingOption.DiskMode))) && ((this.Split == null && virtualDiskFlatVer2BackingOption.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskFlatVer2BackingOption.Split))) && ((this.WriteThrough == null && virtualDiskFlatVer2BackingOption.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskFlatVer2BackingOption.WriteThrough))) && this.Growable == virtualDiskFlatVer2BackingOption.Growable && this.HotGrowable == virtualDiskFlatVer2BackingOption.HotGrowable && this.Uuid == virtualDiskFlatVer2BackingOption.Uuid && ((this.ThinProvisioned == null && virtualDiskFlatVer2BackingOption.ThinProvisioned == null) || (this.ThinProvisioned != null && this.ThinProvisioned.Equals(virtualDiskFlatVer2BackingOption.ThinProvisioned))) && ((this.EagerlyScrub == null && virtualDiskFlatVer2BackingOption.EagerlyScrub == null) || (this.EagerlyScrub != null && this.EagerlyScrub.Equals(virtualDiskFlatVer2BackingOption.EagerlyScrub))) && ((this.DeltaDiskFormat == null && virtualDiskFlatVer2BackingOption.DeltaDiskFormat == null) || (this.DeltaDiskFormat != null && this.DeltaDiskFormat.Equals(virtualDiskFlatVer2BackingOption.DeltaDiskFormat))) && ((this.DeltaDiskFormatsSupported == null && virtualDiskFlatVer2BackingOption.DeltaDiskFormatsSupported == null) || (this.DeltaDiskFormatsSupported != null && virtualDiskFlatVer2BackingOption.DeltaDiskFormatsSupported != null && Enumerable.SequenceEqual(this.DeltaDiskFormatsSupported, virtualDiskFlatVer2BackingOption.DeltaDiskFormatsSupported))));\n        }\n\n        public override bool Equals(object virtualDiskFlatVer2BackingOption)\n        {\n            return Equals(virtualDiskFlatVer2BackingOption as VirtualDiskFlatVer2BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + Growable + \"_\" + HotGrowable + \"_\" + Uuid + \"_\" + ThinProvisioned + \"_\" + EagerlyScrub + \"_\" + DeltaDiskFormat + \"_\" + DeltaDiskFormatsSupported).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskId : DynamicData, IEquatable<VirtualDiskId>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public int DiskId { get; set; }\n\n        public VirtualDiskId_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskId virtualDiskId)\n        {\n            return (virtualDiskId != null && ((this.Vm == null && virtualDiskId.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualDiskId.Vm))) && this.DiskId == virtualDiskId.DiskId && ((this.LinkedView == null && virtualDiskId.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskId.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskId)\n        {\n            return Equals(virtualDiskId as VirtualDiskId);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + DiskId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskId_LinkedView : IEquatable<VirtualDiskId_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(VirtualDiskId_LinkedView virtualDiskId_LinkedView)\n        {\n            return (virtualDiskId_LinkedView != null && ((this.Vm == null && virtualDiskId_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualDiskId_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object virtualDiskId_LinkedView)\n        {\n            return Equals(virtualDiskId_LinkedView as VirtualDiskId_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskLocalPMemBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskLocalPMemBackingInfo>\n    {\n        public string DiskMode { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string VolumeUUID { get; set; }\n\n        public string ContentId { get; set; }\n\n        public new VirtualDiskLocalPMemBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskLocalPMemBackingInfo virtualDiskLocalPMemBackingInfo)\n        {\n            return (virtualDiskLocalPMemBackingInfo != null && this.DiskMode == virtualDiskLocalPMemBackingInfo.DiskMode && this.Uuid == virtualDiskLocalPMemBackingInfo.Uuid && this.VolumeUUID == virtualDiskLocalPMemBackingInfo.VolumeUUID && this.ContentId == virtualDiskLocalPMemBackingInfo.ContentId && ((this.LinkedView == null && virtualDiskLocalPMemBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskLocalPMemBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskLocalPMemBackingInfo)\n        {\n            return Equals(virtualDiskLocalPMemBackingInfo as VirtualDiskLocalPMemBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Uuid + \"_\" + VolumeUUID + \"_\" + ContentId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskLocalPMemBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskLocalPMemBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskLocalPMemBackingInfo_LinkedView virtualDiskLocalPMemBackingInfo_LinkedView)\n        {\n            return (virtualDiskLocalPMemBackingInfo_LinkedView != null && base.Equals(virtualDiskLocalPMemBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskLocalPMemBackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskLocalPMemBackingInfo_LinkedView as VirtualDiskLocalPMemBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskLocalPMemBackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualDiskLocalPMemBackingOption>\n    {\n        public ChoiceOption DiskMode { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool HotGrowable { get; set; }\n\n        public bool Uuid { get; set; }\n\n        public bool Equals(VirtualDiskLocalPMemBackingOption virtualDiskLocalPMemBackingOption)\n        {\n            return (virtualDiskLocalPMemBackingOption != null && ((this.DiskMode == null && virtualDiskLocalPMemBackingOption.DiskMode == null) || (this.DiskMode != null && this.DiskMode.Equals(virtualDiskLocalPMemBackingOption.DiskMode))) && this.Growable == virtualDiskLocalPMemBackingOption.Growable && this.HotGrowable == virtualDiskLocalPMemBackingOption.HotGrowable && this.Uuid == virtualDiskLocalPMemBackingOption.Uuid);\n        }\n\n        public override bool Equals(object virtualDiskLocalPMemBackingOption)\n        {\n            return Equals(virtualDiskLocalPMemBackingOption as VirtualDiskLocalPMemBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Growable + \"_\" + HotGrowable + \"_\" + Uuid).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskManager : ViewBase, IEquatable<VirtualDiskManager>\n    {\n        public ManagedObjectReference CreateVirtualDisk_Task(string name, ManagedObjectReference datacenter, VirtualDiskSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public string CreateVirtualDisk(string name, ManagedObjectReference datacenter, VirtualDiskSpec spec)\n        {\n            return default(string);\n        }\n\n        public ManagedObjectReference DeleteVirtualDisk_Task(string name, ManagedObjectReference datacenter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DeleteVirtualDisk(string name, ManagedObjectReference datacenter)\n        {\n        }\n\n        public ManagedObjectReference MoveVirtualDisk_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, bool? force, VirtualMachineProfileSpec[] profile)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public string MoveVirtualDisk(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, bool? force, VirtualMachineProfileSpec[] profile)\n        {\n            return default(string);\n        }\n\n        public ManagedObjectReference CopyVirtualDisk_Task(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, VirtualDiskSpec destSpec, bool? force)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public string CopyVirtualDisk(string sourceName, ManagedObjectReference sourceDatacenter, string destName, ManagedObjectReference destDatacenter, VirtualDiskSpec destSpec, bool? force)\n        {\n            return default(string);\n        }\n\n        public ManagedObjectReference ExtendVirtualDisk_Task(string name, ManagedObjectReference datacenter, long newCapacityKb, bool? eagerZero)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ExtendVirtualDisk(string name, ManagedObjectReference datacenter, long newCapacityKb, bool? eagerZero)\n        {\n        }\n\n        public int QueryVirtualDiskFragmentation(string name, ManagedObjectReference datacenter)\n        {\n            return default(int);\n        }\n\n        public ManagedObjectReference DefragmentVirtualDisk_Task(string name, ManagedObjectReference datacenter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DefragmentVirtualDisk(string name, ManagedObjectReference datacenter)\n        {\n        }\n\n        public ManagedObjectReference ShrinkVirtualDisk_Task(string name, ManagedObjectReference datacenter, bool? copy)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ShrinkVirtualDisk(string name, ManagedObjectReference datacenter, bool? copy)\n        {\n        }\n\n        public ManagedObjectReference InflateVirtualDisk_Task(string name, ManagedObjectReference datacenter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void InflateVirtualDisk(string name, ManagedObjectReference datacenter)\n        {\n        }\n\n        public ManagedObjectReference EagerZeroVirtualDisk_Task(string name, ManagedObjectReference datacenter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void EagerZeroVirtualDisk(string name, ManagedObjectReference datacenter)\n        {\n        }\n\n        public ManagedObjectReference ZeroFillVirtualDisk_Task(string name, ManagedObjectReference datacenter)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ZeroFillVirtualDisk(string name, ManagedObjectReference datacenter)\n        {\n        }\n\n        public void SetVirtualDiskUuid(string name, ManagedObjectReference datacenter, string uuid)\n        {\n        }\n\n        public string QueryVirtualDiskUuid(string name, ManagedObjectReference datacenter)\n        {\n            return default(string);\n        }\n\n        public HostDiskDimensionsChs QueryVirtualDiskGeometry(string name, ManagedObjectReference datacenter)\n        {\n            return default(HostDiskDimensionsChs);\n        }\n\n        public void ImportUnmanagedSnapshot(string vdisk, ManagedObjectReference datacenter, string vvolId)\n        {\n        }\n\n        public void ReleaseManagedSnapshot(string vdisk, ManagedObjectReference datacenter)\n        {\n        }\n\n        public bool Equals(VirtualDiskManager virtualDiskManager)\n        {\n            return (virtualDiskManager != null && base.Equals(virtualDiskManager));\n        }\n\n        public override bool Equals(object virtualDiskManager)\n        {\n            return Equals(virtualDiskManager as VirtualDiskManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskModeNotSupported : DeviceNotSupported, IEquatable<VirtualDiskModeNotSupported>\n    {\n        public string Mode { get; set; }\n\n        public bool Equals(VirtualDiskModeNotSupported virtualDiskModeNotSupported)\n        {\n            return (virtualDiskModeNotSupported != null && this.Mode == virtualDiskModeNotSupported.Mode);\n        }\n\n        public override bool Equals(object virtualDiskModeNotSupported)\n        {\n            return Equals(virtualDiskModeNotSupported as VirtualDiskModeNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Mode).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskOption : VirtualDeviceOption, IEquatable<VirtualDiskOption>\n    {\n        public LongOption CapacityInKB { get; set; }\n\n        public StorageIOAllocationOption IoAllocationOption { get; set; }\n\n        public VirtualDiskOptionVFlashCacheConfigOption VFlashCacheConfigOption { get; set; }\n\n        public bool Equals(VirtualDiskOption virtualDiskOption)\n        {\n            return (virtualDiskOption != null && ((this.CapacityInKB == null && virtualDiskOption.CapacityInKB == null) || (this.CapacityInKB != null && this.CapacityInKB.Equals(virtualDiskOption.CapacityInKB))) && ((this.IoAllocationOption == null && virtualDiskOption.IoAllocationOption == null) || (this.IoAllocationOption != null && this.IoAllocationOption.Equals(virtualDiskOption.IoAllocationOption))) && ((this.VFlashCacheConfigOption == null && virtualDiskOption.VFlashCacheConfigOption == null) || (this.VFlashCacheConfigOption != null && this.VFlashCacheConfigOption.Equals(virtualDiskOption.VFlashCacheConfigOption))));\n        }\n\n        public override bool Equals(object virtualDiskOption)\n        {\n            return Equals(virtualDiskOption as VirtualDiskOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityInKB + \"_\" + IoAllocationOption + \"_\" + VFlashCacheConfigOption).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskOptionVFlashCacheConfigOption : DynamicData, IEquatable<VirtualDiskOptionVFlashCacheConfigOption>\n    {\n        public ChoiceOption CacheConsistencyType { get; set; }\n\n        public ChoiceOption CacheMode { get; set; }\n\n        public LongOption ReservationInMB { get; set; }\n\n        public LongOption BlockSizeInKB { get; set; }\n\n        public bool Equals(VirtualDiskOptionVFlashCacheConfigOption virtualDiskOptionVFlashCacheConfigOption)\n        {\n            return (virtualDiskOptionVFlashCacheConfigOption != null && ((this.CacheConsistencyType == null && virtualDiskOptionVFlashCacheConfigOption.CacheConsistencyType == null) || (this.CacheConsistencyType != null && this.CacheConsistencyType.Equals(virtualDiskOptionVFlashCacheConfigOption.CacheConsistencyType))) && ((this.CacheMode == null && virtualDiskOptionVFlashCacheConfigOption.CacheMode == null) || (this.CacheMode != null && this.CacheMode.Equals(virtualDiskOptionVFlashCacheConfigOption.CacheMode))) && ((this.ReservationInMB == null && virtualDiskOptionVFlashCacheConfigOption.ReservationInMB == null) || (this.ReservationInMB != null && this.ReservationInMB.Equals(virtualDiskOptionVFlashCacheConfigOption.ReservationInMB))) && ((this.BlockSizeInKB == null && virtualDiskOptionVFlashCacheConfigOption.BlockSizeInKB == null) || (this.BlockSizeInKB != null && this.BlockSizeInKB.Equals(virtualDiskOptionVFlashCacheConfigOption.BlockSizeInKB))));\n        }\n\n        public override bool Equals(object virtualDiskOptionVFlashCacheConfigOption)\n        {\n            return Equals(virtualDiskOptionVFlashCacheConfigOption as VirtualDiskOptionVFlashCacheConfigOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CacheConsistencyType + \"_\" + CacheMode + \"_\" + ReservationInMB + \"_\" + BlockSizeInKB).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskPartitionedRawDiskVer2BackingInfo : VirtualDiskRawDiskVer2BackingInfo, IEquatable<VirtualDiskPartitionedRawDiskVer2BackingInfo>\n    {\n        public int[] Partition { get; set; }\n\n        public bool Equals(VirtualDiskPartitionedRawDiskVer2BackingInfo virtualDiskPartitionedRawDiskVer2BackingInfo)\n        {\n            return (virtualDiskPartitionedRawDiskVer2BackingInfo != null && ((this.Partition == null && virtualDiskPartitionedRawDiskVer2BackingInfo.Partition == null) || (this.Partition != null && virtualDiskPartitionedRawDiskVer2BackingInfo.Partition != null && Enumerable.SequenceEqual(this.Partition, virtualDiskPartitionedRawDiskVer2BackingInfo.Partition))));\n        }\n\n        public override bool Equals(object virtualDiskPartitionedRawDiskVer2BackingInfo)\n        {\n            return Equals(virtualDiskPartitionedRawDiskVer2BackingInfo as VirtualDiskPartitionedRawDiskVer2BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partition).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskPartitionedRawDiskVer2BackingOption : VirtualDiskRawDiskVer2BackingOption, IEquatable<VirtualDiskPartitionedRawDiskVer2BackingOption>\n    {\n        public bool Equals(VirtualDiskPartitionedRawDiskVer2BackingOption virtualDiskPartitionedRawDiskVer2BackingOption)\n        {\n            return (virtualDiskPartitionedRawDiskVer2BackingOption != null && base.Equals(virtualDiskPartitionedRawDiskVer2BackingOption));\n        }\n\n        public override bool Equals(object virtualDiskPartitionedRawDiskVer2BackingOption)\n        {\n            return Equals(virtualDiskPartitionedRawDiskVer2BackingOption as VirtualDiskPartitionedRawDiskVer2BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskRawDiskMappingVer1BackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskRawDiskMappingVer1BackingInfo>\n    {\n        public string LunUuid { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public string CompatibilityMode { get; set; }\n\n        public string DiskMode { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string ContentId { get; set; }\n\n        public string ChangeId { get; set; }\n\n        public VirtualDiskRawDiskMappingVer1BackingInfo Parent { get; set; }\n\n        public string DeltaDiskFormat { get; set; }\n\n        public int? DeltaGrainSize { get; set; }\n\n        public string Sharing { get; set; }\n\n        public new VirtualDiskRawDiskMappingVer1BackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskRawDiskMappingVer1BackingInfo virtualDiskRawDiskMappingVer1BackingInfo)\n        {\n            return (virtualDiskRawDiskMappingVer1BackingInfo != null && this.LunUuid == virtualDiskRawDiskMappingVer1BackingInfo.LunUuid && this.DeviceName == virtualDiskRawDiskMappingVer1BackingInfo.DeviceName && this.CompatibilityMode == virtualDiskRawDiskMappingVer1BackingInfo.CompatibilityMode && this.DiskMode == virtualDiskRawDiskMappingVer1BackingInfo.DiskMode && this.Uuid == virtualDiskRawDiskMappingVer1BackingInfo.Uuid && this.ContentId == virtualDiskRawDiskMappingVer1BackingInfo.ContentId && this.ChangeId == virtualDiskRawDiskMappingVer1BackingInfo.ChangeId && ((this.Parent == null && virtualDiskRawDiskMappingVer1BackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDiskRawDiskMappingVer1BackingInfo.Parent))) && this.DeltaDiskFormat == virtualDiskRawDiskMappingVer1BackingInfo.DeltaDiskFormat && ((this.DeltaGrainSize == null && virtualDiskRawDiskMappingVer1BackingInfo.DeltaGrainSize == null) || (this.DeltaGrainSize != null && this.DeltaGrainSize.Equals(virtualDiskRawDiskMappingVer1BackingInfo.DeltaGrainSize))) && this.Sharing == virtualDiskRawDiskMappingVer1BackingInfo.Sharing && ((this.LinkedView == null && virtualDiskRawDiskMappingVer1BackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskRawDiskMappingVer1BackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskRawDiskMappingVer1BackingInfo)\n        {\n            return Equals(virtualDiskRawDiskMappingVer1BackingInfo as VirtualDiskRawDiskMappingVer1BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LunUuid + \"_\" + DeviceName + \"_\" + CompatibilityMode + \"_\" + DiskMode + \"_\" + Uuid + \"_\" + ContentId + \"_\" + ChangeId + \"_\" + Parent + \"_\" + DeltaDiskFormat + \"_\" + DeltaGrainSize + \"_\" + Sharing + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskRawDiskMappingVer1BackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskRawDiskMappingVer1BackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskRawDiskMappingVer1BackingInfo_LinkedView virtualDiskRawDiskMappingVer1BackingInfo_LinkedView)\n        {\n            return (virtualDiskRawDiskMappingVer1BackingInfo_LinkedView != null && base.Equals(virtualDiskRawDiskMappingVer1BackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskRawDiskMappingVer1BackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskRawDiskMappingVer1BackingInfo_LinkedView as VirtualDiskRawDiskMappingVer1BackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskRawDiskMappingVer1BackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualDiskRawDiskMappingVer1BackingOption>\n    {\n        public ChoiceOption DescriptorFileNameExtensions { get; set; }\n\n        public ChoiceOption CompatibilityMode { get; set; }\n\n        public ChoiceOption DiskMode { get; set; }\n\n        public bool Uuid { get; set; }\n\n        public bool Equals(VirtualDiskRawDiskMappingVer1BackingOption virtualDiskRawDiskMappingVer1BackingOption)\n        {\n            return (virtualDiskRawDiskMappingVer1BackingOption != null && ((this.DescriptorFileNameExtensions == null && virtualDiskRawDiskMappingVer1BackingOption.DescriptorFileNameExtensions == null) || (this.DescriptorFileNameExtensions != null && this.DescriptorFileNameExtensions.Equals(virtualDiskRawDiskMappingVer1BackingOption.DescriptorFileNameExtensions))) && ((this.CompatibilityMode == null && virtualDiskRawDiskMappingVer1BackingOption.CompatibilityMode == null) || (this.CompatibilityMode != null && this.CompatibilityMode.Equals(virtualDiskRawDiskMappingVer1BackingOption.CompatibilityMode))) && ((this.DiskMode == null && virtualDiskRawDiskMappingVer1BackingOption.DiskMode == null) || (this.DiskMode != null && this.DiskMode.Equals(virtualDiskRawDiskMappingVer1BackingOption.DiskMode))) && this.Uuid == virtualDiskRawDiskMappingVer1BackingOption.Uuid);\n        }\n\n        public override bool Equals(object virtualDiskRawDiskMappingVer1BackingOption)\n        {\n            return Equals(virtualDiskRawDiskMappingVer1BackingOption as VirtualDiskRawDiskMappingVer1BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DescriptorFileNameExtensions + \"_\" + CompatibilityMode + \"_\" + DiskMode + \"_\" + Uuid).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskRawDiskVer2BackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualDiskRawDiskVer2BackingInfo>\n    {\n        public string DescriptorFileName { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string ChangeId { get; set; }\n\n        public string Sharing { get; set; }\n\n        public bool Equals(VirtualDiskRawDiskVer2BackingInfo virtualDiskRawDiskVer2BackingInfo)\n        {\n            return (virtualDiskRawDiskVer2BackingInfo != null && this.DescriptorFileName == virtualDiskRawDiskVer2BackingInfo.DescriptorFileName && this.Uuid == virtualDiskRawDiskVer2BackingInfo.Uuid && this.ChangeId == virtualDiskRawDiskVer2BackingInfo.ChangeId && this.Sharing == virtualDiskRawDiskVer2BackingInfo.Sharing);\n        }\n\n        public override bool Equals(object virtualDiskRawDiskVer2BackingInfo)\n        {\n            return Equals(virtualDiskRawDiskVer2BackingInfo as VirtualDiskRawDiskVer2BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DescriptorFileName + \"_\" + Uuid + \"_\" + ChangeId + \"_\" + Sharing).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskRawDiskVer2BackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualDiskRawDiskVer2BackingOption>\n    {\n        public ChoiceOption DescriptorFileNameExtensions { get; set; }\n\n        public bool Uuid { get; set; }\n\n        public bool Equals(VirtualDiskRawDiskVer2BackingOption virtualDiskRawDiskVer2BackingOption)\n        {\n            return (virtualDiskRawDiskVer2BackingOption != null && ((this.DescriptorFileNameExtensions == null && virtualDiskRawDiskVer2BackingOption.DescriptorFileNameExtensions == null) || (this.DescriptorFileNameExtensions != null && this.DescriptorFileNameExtensions.Equals(virtualDiskRawDiskVer2BackingOption.DescriptorFileNameExtensions))) && this.Uuid == virtualDiskRawDiskVer2BackingOption.Uuid);\n        }\n\n        public override bool Equals(object virtualDiskRawDiskVer2BackingOption)\n        {\n            return Equals(virtualDiskRawDiskVer2BackingOption as VirtualDiskRawDiskVer2BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DescriptorFileNameExtensions + \"_\" + Uuid).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskRuleSpec : ClusterRuleInfo, IEquatable<VirtualDiskRuleSpec>\n    {\n        public string DiskRuleType { get; set; }\n\n        public int[] DiskId { get; set; }\n\n        public bool Equals(VirtualDiskRuleSpec virtualDiskRuleSpec)\n        {\n            return (virtualDiskRuleSpec != null && this.DiskRuleType == virtualDiskRuleSpec.DiskRuleType && ((this.DiskId == null && virtualDiskRuleSpec.DiskId == null) || (this.DiskId != null && virtualDiskRuleSpec.DiskId != null && Enumerable.SequenceEqual(this.DiskId, virtualDiskRuleSpec.DiskId))));\n        }\n\n        public override bool Equals(object virtualDiskRuleSpec)\n        {\n            return Equals(virtualDiskRuleSpec as VirtualDiskRuleSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskRuleType + \"_\" + DiskId).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSeSparseBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskSeSparseBackingInfo>\n    {\n        public string DiskMode { get; set; }\n\n        public bool? WriteThrough { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string ContentId { get; set; }\n\n        public string ChangeId { get; set; }\n\n        public VirtualDiskSeSparseBackingInfo Parent { get; set; }\n\n        public string DeltaDiskFormat { get; set; }\n\n        public bool? DigestEnabled { get; set; }\n\n        public int? GrainSize { get; set; }\n\n        public CryptoKeyId KeyId { get; set; }\n\n        public new VirtualDiskSeSparseBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskSeSparseBackingInfo virtualDiskSeSparseBackingInfo)\n        {\n            return (virtualDiskSeSparseBackingInfo != null && this.DiskMode == virtualDiskSeSparseBackingInfo.DiskMode && ((this.WriteThrough == null && virtualDiskSeSparseBackingInfo.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskSeSparseBackingInfo.WriteThrough))) && this.Uuid == virtualDiskSeSparseBackingInfo.Uuid && this.ContentId == virtualDiskSeSparseBackingInfo.ContentId && this.ChangeId == virtualDiskSeSparseBackingInfo.ChangeId && ((this.Parent == null && virtualDiskSeSparseBackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDiskSeSparseBackingInfo.Parent))) && this.DeltaDiskFormat == virtualDiskSeSparseBackingInfo.DeltaDiskFormat && ((this.DigestEnabled == null && virtualDiskSeSparseBackingInfo.DigestEnabled == null) || (this.DigestEnabled != null && this.DigestEnabled.Equals(virtualDiskSeSparseBackingInfo.DigestEnabled))) && ((this.GrainSize == null && virtualDiskSeSparseBackingInfo.GrainSize == null) || (this.GrainSize != null && this.GrainSize.Equals(virtualDiskSeSparseBackingInfo.GrainSize))) && ((this.KeyId == null && virtualDiskSeSparseBackingInfo.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(virtualDiskSeSparseBackingInfo.KeyId))) && ((this.LinkedView == null && virtualDiskSeSparseBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskSeSparseBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskSeSparseBackingInfo)\n        {\n            return Equals(virtualDiskSeSparseBackingInfo as VirtualDiskSeSparseBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + WriteThrough + \"_\" + Uuid + \"_\" + ContentId + \"_\" + ChangeId + \"_\" + Parent + \"_\" + DeltaDiskFormat + \"_\" + DigestEnabled + \"_\" + GrainSize + \"_\" + KeyId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSeSparseBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskSeSparseBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskSeSparseBackingInfo_LinkedView virtualDiskSeSparseBackingInfo_LinkedView)\n        {\n            return (virtualDiskSeSparseBackingInfo_LinkedView != null && base.Equals(virtualDiskSeSparseBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskSeSparseBackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskSeSparseBackingInfo_LinkedView as VirtualDiskSeSparseBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSeSparseBackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualDiskSeSparseBackingOption>\n    {\n        public ChoiceOption DiskMode { get; set; }\n\n        public BoolOption WriteThrough { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool HotGrowable { get; set; }\n\n        public bool Uuid { get; set; }\n\n        public VirtualDiskDeltaDiskFormatsSupported[] DeltaDiskFormatsSupported { get; set; }\n\n        public bool Equals(VirtualDiskSeSparseBackingOption virtualDiskSeSparseBackingOption)\n        {\n            return (virtualDiskSeSparseBackingOption != null && ((this.DiskMode == null && virtualDiskSeSparseBackingOption.DiskMode == null) || (this.DiskMode != null && this.DiskMode.Equals(virtualDiskSeSparseBackingOption.DiskMode))) && ((this.WriteThrough == null && virtualDiskSeSparseBackingOption.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskSeSparseBackingOption.WriteThrough))) && this.Growable == virtualDiskSeSparseBackingOption.Growable && this.HotGrowable == virtualDiskSeSparseBackingOption.HotGrowable && this.Uuid == virtualDiskSeSparseBackingOption.Uuid && ((this.DeltaDiskFormatsSupported == null && virtualDiskSeSparseBackingOption.DeltaDiskFormatsSupported == null) || (this.DeltaDiskFormatsSupported != null && virtualDiskSeSparseBackingOption.DeltaDiskFormatsSupported != null && Enumerable.SequenceEqual(this.DeltaDiskFormatsSupported, virtualDiskSeSparseBackingOption.DeltaDiskFormatsSupported))));\n        }\n\n        public override bool Equals(object virtualDiskSeSparseBackingOption)\n        {\n            return Equals(virtualDiskSeSparseBackingOption as VirtualDiskSeSparseBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + WriteThrough + \"_\" + Growable + \"_\" + HotGrowable + \"_\" + Uuid + \"_\" + DeltaDiskFormatsSupported).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSparseVer1BackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskSparseVer1BackingInfo>\n    {\n        public string DiskMode { get; set; }\n\n        public bool? Split { get; set; }\n\n        public bool? WriteThrough { get; set; }\n\n        public long? SpaceUsedInKB { get; set; }\n\n        public string ContentId { get; set; }\n\n        public VirtualDiskSparseVer1BackingInfo Parent { get; set; }\n\n        public new VirtualDiskSparseVer1BackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskSparseVer1BackingInfo virtualDiskSparseVer1BackingInfo)\n        {\n            return (virtualDiskSparseVer1BackingInfo != null && this.DiskMode == virtualDiskSparseVer1BackingInfo.DiskMode && ((this.Split == null && virtualDiskSparseVer1BackingInfo.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskSparseVer1BackingInfo.Split))) && ((this.WriteThrough == null && virtualDiskSparseVer1BackingInfo.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskSparseVer1BackingInfo.WriteThrough))) && ((this.SpaceUsedInKB == null && virtualDiskSparseVer1BackingInfo.SpaceUsedInKB == null) || (this.SpaceUsedInKB != null && this.SpaceUsedInKB.Equals(virtualDiskSparseVer1BackingInfo.SpaceUsedInKB))) && this.ContentId == virtualDiskSparseVer1BackingInfo.ContentId && ((this.Parent == null && virtualDiskSparseVer1BackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDiskSparseVer1BackingInfo.Parent))) && ((this.LinkedView == null && virtualDiskSparseVer1BackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskSparseVer1BackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskSparseVer1BackingInfo)\n        {\n            return Equals(virtualDiskSparseVer1BackingInfo as VirtualDiskSparseVer1BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + SpaceUsedInKB + \"_\" + ContentId + \"_\" + Parent + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSparseVer1BackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskSparseVer1BackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskSparseVer1BackingInfo_LinkedView virtualDiskSparseVer1BackingInfo_LinkedView)\n        {\n            return (virtualDiskSparseVer1BackingInfo_LinkedView != null && base.Equals(virtualDiskSparseVer1BackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskSparseVer1BackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskSparseVer1BackingInfo_LinkedView as VirtualDiskSparseVer1BackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSparseVer1BackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualDiskSparseVer1BackingOption>\n    {\n        public ChoiceOption DiskModes { get; set; }\n\n        public BoolOption Split { get; set; }\n\n        public BoolOption WriteThrough { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool Equals(VirtualDiskSparseVer1BackingOption virtualDiskSparseVer1BackingOption)\n        {\n            return (virtualDiskSparseVer1BackingOption != null && ((this.DiskModes == null && virtualDiskSparseVer1BackingOption.DiskModes == null) || (this.DiskModes != null && this.DiskModes.Equals(virtualDiskSparseVer1BackingOption.DiskModes))) && ((this.Split == null && virtualDiskSparseVer1BackingOption.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskSparseVer1BackingOption.Split))) && ((this.WriteThrough == null && virtualDiskSparseVer1BackingOption.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskSparseVer1BackingOption.WriteThrough))) && this.Growable == virtualDiskSparseVer1BackingOption.Growable);\n        }\n\n        public override bool Equals(object virtualDiskSparseVer1BackingOption)\n        {\n            return Equals(virtualDiskSparseVer1BackingOption as VirtualDiskSparseVer1BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskModes + \"_\" + Split + \"_\" + WriteThrough + \"_\" + Growable).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSparseVer2BackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualDiskSparseVer2BackingInfo>\n    {\n        public string DiskMode { get; set; }\n\n        public bool? Split { get; set; }\n\n        public bool? WriteThrough { get; set; }\n\n        public long? SpaceUsedInKB { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string ContentId { get; set; }\n\n        public string ChangeId { get; set; }\n\n        public VirtualDiskSparseVer2BackingInfo Parent { get; set; }\n\n        public CryptoKeyId KeyId { get; set; }\n\n        public new VirtualDiskSparseVer2BackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualDiskSparseVer2BackingInfo virtualDiskSparseVer2BackingInfo)\n        {\n            return (virtualDiskSparseVer2BackingInfo != null && this.DiskMode == virtualDiskSparseVer2BackingInfo.DiskMode && ((this.Split == null && virtualDiskSparseVer2BackingInfo.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskSparseVer2BackingInfo.Split))) && ((this.WriteThrough == null && virtualDiskSparseVer2BackingInfo.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskSparseVer2BackingInfo.WriteThrough))) && ((this.SpaceUsedInKB == null && virtualDiskSparseVer2BackingInfo.SpaceUsedInKB == null) || (this.SpaceUsedInKB != null && this.SpaceUsedInKB.Equals(virtualDiskSparseVer2BackingInfo.SpaceUsedInKB))) && this.Uuid == virtualDiskSparseVer2BackingInfo.Uuid && this.ContentId == virtualDiskSparseVer2BackingInfo.ContentId && this.ChangeId == virtualDiskSparseVer2BackingInfo.ChangeId && ((this.Parent == null && virtualDiskSparseVer2BackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualDiskSparseVer2BackingInfo.Parent))) && ((this.KeyId == null && virtualDiskSparseVer2BackingInfo.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(virtualDiskSparseVer2BackingInfo.KeyId))) && ((this.LinkedView == null && virtualDiskSparseVer2BackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualDiskSparseVer2BackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualDiskSparseVer2BackingInfo)\n        {\n            return Equals(virtualDiskSparseVer2BackingInfo as VirtualDiskSparseVer2BackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + SpaceUsedInKB + \"_\" + Uuid + \"_\" + ContentId + \"_\" + ChangeId + \"_\" + Parent + \"_\" + KeyId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSparseVer2BackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualDiskSparseVer2BackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualDiskSparseVer2BackingInfo_LinkedView virtualDiskSparseVer2BackingInfo_LinkedView)\n        {\n            return (virtualDiskSparseVer2BackingInfo_LinkedView != null && base.Equals(virtualDiskSparseVer2BackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualDiskSparseVer2BackingInfo_LinkedView)\n        {\n            return Equals(virtualDiskSparseVer2BackingInfo_LinkedView as VirtualDiskSparseVer2BackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSparseVer2BackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualDiskSparseVer2BackingOption>\n    {\n        public ChoiceOption DiskMode { get; set; }\n\n        public BoolOption Split { get; set; }\n\n        public BoolOption WriteThrough { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool HotGrowable { get; set; }\n\n        public bool Uuid { get; set; }\n\n        public bool Equals(VirtualDiskSparseVer2BackingOption virtualDiskSparseVer2BackingOption)\n        {\n            return (virtualDiskSparseVer2BackingOption != null && ((this.DiskMode == null && virtualDiskSparseVer2BackingOption.DiskMode == null) || (this.DiskMode != null && this.DiskMode.Equals(virtualDiskSparseVer2BackingOption.DiskMode))) && ((this.Split == null && virtualDiskSparseVer2BackingOption.Split == null) || (this.Split != null && this.Split.Equals(virtualDiskSparseVer2BackingOption.Split))) && ((this.WriteThrough == null && virtualDiskSparseVer2BackingOption.WriteThrough == null) || (this.WriteThrough != null && this.WriteThrough.Equals(virtualDiskSparseVer2BackingOption.WriteThrough))) && this.Growable == virtualDiskSparseVer2BackingOption.Growable && this.HotGrowable == virtualDiskSparseVer2BackingOption.HotGrowable && this.Uuid == virtualDiskSparseVer2BackingOption.Uuid);\n        }\n\n        public override bool Equals(object virtualDiskSparseVer2BackingOption)\n        {\n            return Equals(virtualDiskSparseVer2BackingOption as VirtualDiskSparseVer2BackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskMode + \"_\" + Split + \"_\" + WriteThrough + \"_\" + Growable + \"_\" + HotGrowable + \"_\" + Uuid).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskSpec : DynamicData, IEquatable<VirtualDiskSpec>\n    {\n        public string DiskType { get; set; }\n\n        public string AdapterType { get; set; }\n\n        public bool Equals(VirtualDiskSpec virtualDiskSpec)\n        {\n            return (virtualDiskSpec != null && this.DiskType == virtualDiskSpec.DiskType && this.AdapterType == virtualDiskSpec.AdapterType);\n        }\n\n        public override bool Equals(object virtualDiskSpec)\n        {\n            return Equals(virtualDiskSpec as VirtualDiskSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskType + \"_\" + AdapterType).GetHashCode();\n        }\n    }\n\n    public class VirtualDiskVFlashCacheConfigInfo : DynamicData, IEquatable<VirtualDiskVFlashCacheConfigInfo>\n    {\n        public string VFlashModule { get; set; }\n\n        public long? ReservationInMB { get; set; }\n\n        public string CacheConsistencyType { get; set; }\n\n        public string CacheMode { get; set; }\n\n        public long? BlockSizeInKB { get; set; }\n\n        public bool Equals(VirtualDiskVFlashCacheConfigInfo virtualDiskVFlashCacheConfigInfo)\n        {\n            return (virtualDiskVFlashCacheConfigInfo != null && this.VFlashModule == virtualDiskVFlashCacheConfigInfo.VFlashModule && ((this.ReservationInMB == null && virtualDiskVFlashCacheConfigInfo.ReservationInMB == null) || (this.ReservationInMB != null && this.ReservationInMB.Equals(virtualDiskVFlashCacheConfigInfo.ReservationInMB))) && this.CacheConsistencyType == virtualDiskVFlashCacheConfigInfo.CacheConsistencyType && this.CacheMode == virtualDiskVFlashCacheConfigInfo.CacheMode && ((this.BlockSizeInKB == null && virtualDiskVFlashCacheConfigInfo.BlockSizeInKB == null) || (this.BlockSizeInKB != null && this.BlockSizeInKB.Equals(virtualDiskVFlashCacheConfigInfo.BlockSizeInKB))));\n        }\n\n        public override bool Equals(object virtualDiskVFlashCacheConfigInfo)\n        {\n            return Equals(virtualDiskVFlashCacheConfigInfo as VirtualDiskVFlashCacheConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VFlashModule + \"_\" + ReservationInMB + \"_\" + CacheConsistencyType + \"_\" + CacheMode + \"_\" + BlockSizeInKB).GetHashCode();\n        }\n    }\n\n    public class VirtualE1000 : VirtualEthernetCard, IEquatable<VirtualE1000>\n    {\n        public bool Equals(VirtualE1000 virtualE1000)\n        {\n            return (virtualE1000 != null && base.Equals(virtualE1000));\n        }\n\n        public override bool Equals(object virtualE1000)\n        {\n            return Equals(virtualE1000 as VirtualE1000);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualE1000e : VirtualEthernetCard, IEquatable<VirtualE1000e>\n    {\n        public bool Equals(VirtualE1000e virtualE1000e)\n        {\n            return (virtualE1000e != null && base.Equals(virtualE1000e));\n        }\n\n        public override bool Equals(object virtualE1000e)\n        {\n            return Equals(virtualE1000e as VirtualE1000e);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualE1000eOption : VirtualEthernetCardOption, IEquatable<VirtualE1000eOption>\n    {\n        public bool Equals(VirtualE1000eOption virtualE1000eOption)\n        {\n            return (virtualE1000eOption != null && base.Equals(virtualE1000eOption));\n        }\n\n        public override bool Equals(object virtualE1000eOption)\n        {\n            return Equals(virtualE1000eOption as VirtualE1000eOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualE1000Option : VirtualEthernetCardOption, IEquatable<VirtualE1000Option>\n    {\n        public bool Equals(VirtualE1000Option virtualE1000Option)\n        {\n            return (virtualE1000Option != null && base.Equals(virtualE1000Option));\n        }\n\n        public override bool Equals(object virtualE1000Option)\n        {\n            return Equals(virtualE1000Option as VirtualE1000Option);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEnsoniq1371 : VirtualSoundCard, IEquatable<VirtualEnsoniq1371>\n    {\n        public bool Equals(VirtualEnsoniq1371 virtualEnsoniq1371)\n        {\n            return (virtualEnsoniq1371 != null && base.Equals(virtualEnsoniq1371));\n        }\n\n        public override bool Equals(object virtualEnsoniq1371)\n        {\n            return Equals(virtualEnsoniq1371 as VirtualEnsoniq1371);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEnsoniq1371Option : VirtualSoundCardOption, IEquatable<VirtualEnsoniq1371Option>\n    {\n        public bool Equals(VirtualEnsoniq1371Option virtualEnsoniq1371Option)\n        {\n            return (virtualEnsoniq1371Option != null && base.Equals(virtualEnsoniq1371Option));\n        }\n\n        public override bool Equals(object virtualEnsoniq1371Option)\n        {\n            return Equals(virtualEnsoniq1371Option as VirtualEnsoniq1371Option);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCard : VirtualDevice, IEquatable<VirtualEthernetCard>\n    {\n        public string AddressType { get; set; }\n\n        public string MacAddress { get; set; }\n\n        public bool? WakeOnLanEnabled { get; set; }\n\n        public VirtualEthernetCardResourceAllocation ResourceAllocation { get; set; }\n\n        public string ExternalId { get; set; }\n\n        public bool? UptCompatibilityEnabled { get; set; }\n\n        public bool Equals(VirtualEthernetCard virtualEthernetCard)\n        {\n            return (virtualEthernetCard != null && this.AddressType == virtualEthernetCard.AddressType && this.MacAddress == virtualEthernetCard.MacAddress && ((this.WakeOnLanEnabled == null && virtualEthernetCard.WakeOnLanEnabled == null) || (this.WakeOnLanEnabled != null && this.WakeOnLanEnabled.Equals(virtualEthernetCard.WakeOnLanEnabled))) && ((this.ResourceAllocation == null && virtualEthernetCard.ResourceAllocation == null) || (this.ResourceAllocation != null && this.ResourceAllocation.Equals(virtualEthernetCard.ResourceAllocation))) && this.ExternalId == virtualEthernetCard.ExternalId && ((this.UptCompatibilityEnabled == null && virtualEthernetCard.UptCompatibilityEnabled == null) || (this.UptCompatibilityEnabled != null && this.UptCompatibilityEnabled.Equals(virtualEthernetCard.UptCompatibilityEnabled))));\n        }\n\n        public override bool Equals(object virtualEthernetCard)\n        {\n            return Equals(virtualEthernetCard as VirtualEthernetCard);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AddressType + \"_\" + MacAddress + \"_\" + WakeOnLanEnabled + \"_\" + ResourceAllocation + \"_\" + ExternalId + \"_\" + UptCompatibilityEnabled).GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardDistributedVirtualPortBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualEthernetCardDistributedVirtualPortBackingInfo>\n    {\n        public DistributedVirtualSwitchPortConnection Port { get; set; }\n\n        public bool Equals(VirtualEthernetCardDistributedVirtualPortBackingInfo virtualEthernetCardDistributedVirtualPortBackingInfo)\n        {\n            return (virtualEthernetCardDistributedVirtualPortBackingInfo != null && ((this.Port == null && virtualEthernetCardDistributedVirtualPortBackingInfo.Port == null) || (this.Port != null && this.Port.Equals(virtualEthernetCardDistributedVirtualPortBackingInfo.Port))));\n        }\n\n        public override bool Equals(object virtualEthernetCardDistributedVirtualPortBackingInfo)\n        {\n            return Equals(virtualEthernetCardDistributedVirtualPortBackingInfo as VirtualEthernetCardDistributedVirtualPortBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Port).GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardDVPortBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualEthernetCardDVPortBackingOption>\n    {\n        public bool Equals(VirtualEthernetCardDVPortBackingOption virtualEthernetCardDVPortBackingOption)\n        {\n            return (virtualEthernetCardDVPortBackingOption != null && base.Equals(virtualEthernetCardDVPortBackingOption));\n        }\n\n        public override bool Equals(object virtualEthernetCardDVPortBackingOption)\n        {\n            return Equals(virtualEthernetCardDVPortBackingOption as VirtualEthernetCardDVPortBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardLegacyNetworkBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualEthernetCardLegacyNetworkBackingInfo>\n    {\n        public bool Equals(VirtualEthernetCardLegacyNetworkBackingInfo virtualEthernetCardLegacyNetworkBackingInfo)\n        {\n            return (virtualEthernetCardLegacyNetworkBackingInfo != null && base.Equals(virtualEthernetCardLegacyNetworkBackingInfo));\n        }\n\n        public override bool Equals(object virtualEthernetCardLegacyNetworkBackingInfo)\n        {\n            return Equals(virtualEthernetCardLegacyNetworkBackingInfo as VirtualEthernetCardLegacyNetworkBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardLegacyNetworkBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualEthernetCardLegacyNetworkBackingOption>\n    {\n        public bool Equals(VirtualEthernetCardLegacyNetworkBackingOption virtualEthernetCardLegacyNetworkBackingOption)\n        {\n            return (virtualEthernetCardLegacyNetworkBackingOption != null && base.Equals(virtualEthernetCardLegacyNetworkBackingOption));\n        }\n\n        public override bool Equals(object virtualEthernetCardLegacyNetworkBackingOption)\n        {\n            return Equals(virtualEthernetCardLegacyNetworkBackingOption as VirtualEthernetCardLegacyNetworkBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardNetworkBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualEthernetCardNetworkBackingInfo>\n    {\n        public ManagedObjectReference Network { get; set; }\n\n        public bool? InPassthroughMode { get; set; }\n\n        public VirtualEthernetCardNetworkBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualEthernetCardNetworkBackingInfo virtualEthernetCardNetworkBackingInfo)\n        {\n            return (virtualEthernetCardNetworkBackingInfo != null && ((this.Network == null && virtualEthernetCardNetworkBackingInfo.Network == null) || (this.Network != null && this.Network.Equals(virtualEthernetCardNetworkBackingInfo.Network))) && ((this.InPassthroughMode == null && virtualEthernetCardNetworkBackingInfo.InPassthroughMode == null) || (this.InPassthroughMode != null && this.InPassthroughMode.Equals(virtualEthernetCardNetworkBackingInfo.InPassthroughMode))) && ((this.LinkedView == null && virtualEthernetCardNetworkBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualEthernetCardNetworkBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualEthernetCardNetworkBackingInfo)\n        {\n            return Equals(virtualEthernetCardNetworkBackingInfo as VirtualEthernetCardNetworkBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + InPassthroughMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardNetworkBackingInfo_LinkedView : IEquatable<VirtualEthernetCardNetworkBackingInfo_LinkedView>\n    {\n        public Network Network { get; set; }\n\n        public bool Equals(VirtualEthernetCardNetworkBackingInfo_LinkedView virtualEthernetCardNetworkBackingInfo_LinkedView)\n        {\n            return (virtualEthernetCardNetworkBackingInfo_LinkedView != null && ((this.Network == null && virtualEthernetCardNetworkBackingInfo_LinkedView.Network == null) || (this.Network != null && this.Network.Equals(virtualEthernetCardNetworkBackingInfo_LinkedView.Network))));\n        }\n\n        public override bool Equals(object virtualEthernetCardNetworkBackingInfo_LinkedView)\n        {\n            return Equals(virtualEthernetCardNetworkBackingInfo_LinkedView as VirtualEthernetCardNetworkBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network).GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardNetworkBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualEthernetCardNetworkBackingOption>\n    {\n        public bool Equals(VirtualEthernetCardNetworkBackingOption virtualEthernetCardNetworkBackingOption)\n        {\n            return (virtualEthernetCardNetworkBackingOption != null && base.Equals(virtualEthernetCardNetworkBackingOption));\n        }\n\n        public override bool Equals(object virtualEthernetCardNetworkBackingOption)\n        {\n            return Equals(virtualEthernetCardNetworkBackingOption as VirtualEthernetCardNetworkBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardNotSupported : DeviceNotSupported, IEquatable<VirtualEthernetCardNotSupported>\n    {\n        public bool Equals(VirtualEthernetCardNotSupported virtualEthernetCardNotSupported)\n        {\n            return (virtualEthernetCardNotSupported != null && base.Equals(virtualEthernetCardNotSupported));\n        }\n\n        public override bool Equals(object virtualEthernetCardNotSupported)\n        {\n            return Equals(virtualEthernetCardNotSupported as VirtualEthernetCardNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardOpaqueNetworkBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualEthernetCardOpaqueNetworkBackingInfo>\n    {\n        public string OpaqueNetworkId { get; set; }\n\n        public string OpaqueNetworkType { get; set; }\n\n        public bool Equals(VirtualEthernetCardOpaqueNetworkBackingInfo virtualEthernetCardOpaqueNetworkBackingInfo)\n        {\n            return (virtualEthernetCardOpaqueNetworkBackingInfo != null && this.OpaqueNetworkId == virtualEthernetCardOpaqueNetworkBackingInfo.OpaqueNetworkId && this.OpaqueNetworkType == virtualEthernetCardOpaqueNetworkBackingInfo.OpaqueNetworkType);\n        }\n\n        public override bool Equals(object virtualEthernetCardOpaqueNetworkBackingInfo)\n        {\n            return Equals(virtualEthernetCardOpaqueNetworkBackingInfo as VirtualEthernetCardOpaqueNetworkBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OpaqueNetworkId + \"_\" + OpaqueNetworkType).GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardOpaqueNetworkBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualEthernetCardOpaqueNetworkBackingOption>\n    {\n        public bool Equals(VirtualEthernetCardOpaqueNetworkBackingOption virtualEthernetCardOpaqueNetworkBackingOption)\n        {\n            return (virtualEthernetCardOpaqueNetworkBackingOption != null && base.Equals(virtualEthernetCardOpaqueNetworkBackingOption));\n        }\n\n        public override bool Equals(object virtualEthernetCardOpaqueNetworkBackingOption)\n        {\n            return Equals(virtualEthernetCardOpaqueNetworkBackingOption as VirtualEthernetCardOpaqueNetworkBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardOption : VirtualDeviceOption, IEquatable<VirtualEthernetCardOption>\n    {\n        public ChoiceOption SupportedOUI { get; set; }\n\n        public ChoiceOption MacType { get; set; }\n\n        public BoolOption WakeOnLanEnabled { get; set; }\n\n        public bool VmDirectPathGen2Supported { get; set; }\n\n        public BoolOption UptCompatibilityEnabled { get; set; }\n\n        public bool Equals(VirtualEthernetCardOption virtualEthernetCardOption)\n        {\n            return (virtualEthernetCardOption != null && ((this.SupportedOUI == null && virtualEthernetCardOption.SupportedOUI == null) || (this.SupportedOUI != null && this.SupportedOUI.Equals(virtualEthernetCardOption.SupportedOUI))) && ((this.MacType == null && virtualEthernetCardOption.MacType == null) || (this.MacType != null && this.MacType.Equals(virtualEthernetCardOption.MacType))) && ((this.WakeOnLanEnabled == null && virtualEthernetCardOption.WakeOnLanEnabled == null) || (this.WakeOnLanEnabled != null && this.WakeOnLanEnabled.Equals(virtualEthernetCardOption.WakeOnLanEnabled))) && this.VmDirectPathGen2Supported == virtualEthernetCardOption.VmDirectPathGen2Supported && ((this.UptCompatibilityEnabled == null && virtualEthernetCardOption.UptCompatibilityEnabled == null) || (this.UptCompatibilityEnabled != null && this.UptCompatibilityEnabled.Equals(virtualEthernetCardOption.UptCompatibilityEnabled))));\n        }\n\n        public override bool Equals(object virtualEthernetCardOption)\n        {\n            return Equals(virtualEthernetCardOption as VirtualEthernetCardOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportedOUI + \"_\" + MacType + \"_\" + WakeOnLanEnabled + \"_\" + VmDirectPathGen2Supported + \"_\" + UptCompatibilityEnabled).GetHashCode();\n        }\n    }\n\n    public class VirtualEthernetCardResourceAllocation : DynamicData, IEquatable<VirtualEthernetCardResourceAllocation>\n    {\n        public long? Reservation { get; set; }\n\n        public SharesInfo Share { get; set; }\n\n        public long? Limit { get; set; }\n\n        public bool Equals(VirtualEthernetCardResourceAllocation virtualEthernetCardResourceAllocation)\n        {\n            return (virtualEthernetCardResourceAllocation != null && ((this.Reservation == null && virtualEthernetCardResourceAllocation.Reservation == null) || (this.Reservation != null && this.Reservation.Equals(virtualEthernetCardResourceAllocation.Reservation))) && ((this.Share == null && virtualEthernetCardResourceAllocation.Share == null) || (this.Share != null && this.Share.Equals(virtualEthernetCardResourceAllocation.Share))) && ((this.Limit == null && virtualEthernetCardResourceAllocation.Limit == null) || (this.Limit != null && this.Limit.Equals(virtualEthernetCardResourceAllocation.Limit))));\n        }\n\n        public override bool Equals(object virtualEthernetCardResourceAllocation)\n        {\n            return Equals(virtualEthernetCardResourceAllocation as VirtualEthernetCardResourceAllocation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reservation + \"_\" + Share + \"_\" + Limit).GetHashCode();\n        }\n    }\n\n    public class VirtualFloppy : VirtualDevice, IEquatable<VirtualFloppy>\n    {\n        public bool Equals(VirtualFloppy virtualFloppy)\n        {\n            return (virtualFloppy != null && base.Equals(virtualFloppy));\n        }\n\n        public override bool Equals(object virtualFloppy)\n        {\n            return Equals(virtualFloppy as VirtualFloppy);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualFloppyDeviceBackingInfo>\n    {\n        public bool Equals(VirtualFloppyDeviceBackingInfo virtualFloppyDeviceBackingInfo)\n        {\n            return (virtualFloppyDeviceBackingInfo != null && base.Equals(virtualFloppyDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualFloppyDeviceBackingInfo)\n        {\n            return Equals(virtualFloppyDeviceBackingInfo as VirtualFloppyDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualFloppyDeviceBackingOption>\n    {\n        public bool Equals(VirtualFloppyDeviceBackingOption virtualFloppyDeviceBackingOption)\n        {\n            return (virtualFloppyDeviceBackingOption != null && base.Equals(virtualFloppyDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualFloppyDeviceBackingOption)\n        {\n            return Equals(virtualFloppyDeviceBackingOption as VirtualFloppyDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyImageBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualFloppyImageBackingInfo>\n    {\n        public new VirtualFloppyImageBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualFloppyImageBackingInfo virtualFloppyImageBackingInfo)\n        {\n            return (virtualFloppyImageBackingInfo != null && ((this.LinkedView == null && virtualFloppyImageBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualFloppyImageBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualFloppyImageBackingInfo)\n        {\n            return Equals(virtualFloppyImageBackingInfo as VirtualFloppyImageBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyImageBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualFloppyImageBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualFloppyImageBackingInfo_LinkedView virtualFloppyImageBackingInfo_LinkedView)\n        {\n            return (virtualFloppyImageBackingInfo_LinkedView != null && base.Equals(virtualFloppyImageBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualFloppyImageBackingInfo_LinkedView)\n        {\n            return Equals(virtualFloppyImageBackingInfo_LinkedView as VirtualFloppyImageBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyImageBackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualFloppyImageBackingOption>\n    {\n        public bool Equals(VirtualFloppyImageBackingOption virtualFloppyImageBackingOption)\n        {\n            return (virtualFloppyImageBackingOption != null && base.Equals(virtualFloppyImageBackingOption));\n        }\n\n        public override bool Equals(object virtualFloppyImageBackingOption)\n        {\n            return Equals(virtualFloppyImageBackingOption as VirtualFloppyImageBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyOption : VirtualDeviceOption, IEquatable<VirtualFloppyOption>\n    {\n        public bool Equals(VirtualFloppyOption virtualFloppyOption)\n        {\n            return (virtualFloppyOption != null && base.Equals(virtualFloppyOption));\n        }\n\n        public override bool Equals(object virtualFloppyOption)\n        {\n            return Equals(virtualFloppyOption as VirtualFloppyOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyRemoteDeviceBackingInfo : VirtualDeviceRemoteDeviceBackingInfo, IEquatable<VirtualFloppyRemoteDeviceBackingInfo>\n    {\n        public bool Equals(VirtualFloppyRemoteDeviceBackingInfo virtualFloppyRemoteDeviceBackingInfo)\n        {\n            return (virtualFloppyRemoteDeviceBackingInfo != null && base.Equals(virtualFloppyRemoteDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualFloppyRemoteDeviceBackingInfo)\n        {\n            return Equals(virtualFloppyRemoteDeviceBackingInfo as VirtualFloppyRemoteDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualFloppyRemoteDeviceBackingOption : VirtualDeviceRemoteDeviceBackingOption, IEquatable<VirtualFloppyRemoteDeviceBackingOption>\n    {\n        public bool Equals(VirtualFloppyRemoteDeviceBackingOption virtualFloppyRemoteDeviceBackingOption)\n        {\n            return (virtualFloppyRemoteDeviceBackingOption != null && base.Equals(virtualFloppyRemoteDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualFloppyRemoteDeviceBackingOption)\n        {\n            return Equals(virtualFloppyRemoteDeviceBackingOption as VirtualFloppyRemoteDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualHardware : DynamicData, IEquatable<VirtualHardware>\n    {\n        public int NumCPU { get; set; }\n\n        public int? NumCoresPerSocket { get; set; }\n\n        public int MemoryMB { get; set; }\n\n        public bool? VirtualICH7MPresent { get; set; }\n\n        public bool? VirtualSMCPresent { get; set; }\n\n        public VirtualDevice[] Device { get; set; }\n\n        public bool Equals(VirtualHardware virtualHardware)\n        {\n            return (virtualHardware != null && this.NumCPU == virtualHardware.NumCPU && ((this.NumCoresPerSocket == null && virtualHardware.NumCoresPerSocket == null) || (this.NumCoresPerSocket != null && this.NumCoresPerSocket.Equals(virtualHardware.NumCoresPerSocket))) && this.MemoryMB == virtualHardware.MemoryMB && ((this.VirtualICH7MPresent == null && virtualHardware.VirtualICH7MPresent == null) || (this.VirtualICH7MPresent != null && this.VirtualICH7MPresent.Equals(virtualHardware.VirtualICH7MPresent))) && ((this.VirtualSMCPresent == null && virtualHardware.VirtualSMCPresent == null) || (this.VirtualSMCPresent != null && this.VirtualSMCPresent.Equals(virtualHardware.VirtualSMCPresent))) && ((this.Device == null && virtualHardware.Device == null) || (this.Device != null && virtualHardware.Device != null && Enumerable.SequenceEqual(this.Device, virtualHardware.Device))));\n        }\n\n        public override bool Equals(object virtualHardware)\n        {\n            return Equals(virtualHardware as VirtualHardware);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumCPU + \"_\" + NumCoresPerSocket + \"_\" + MemoryMB + \"_\" + VirtualICH7MPresent + \"_\" + VirtualSMCPresent + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class VirtualHardwareCompatibilityIssue : VmConfigFault, IEquatable<VirtualHardwareCompatibilityIssue>\n    {\n        public bool Equals(VirtualHardwareCompatibilityIssue virtualHardwareCompatibilityIssue)\n        {\n            return (virtualHardwareCompatibilityIssue != null && base.Equals(virtualHardwareCompatibilityIssue));\n        }\n\n        public override bool Equals(object virtualHardwareCompatibilityIssue)\n        {\n            return Equals(virtualHardwareCompatibilityIssue as VirtualHardwareCompatibilityIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualHardwareOption : DynamicData, IEquatable<VirtualHardwareOption>\n    {\n        public int HwVersion { get; set; }\n\n        public VirtualDeviceOption[] VirtualDeviceOption { get; set; }\n\n        public bool DeviceListReadonly { get; set; }\n\n        public int[] NumCPU { get; set; }\n\n        public IntOption NumCoresPerSocket { get; set; }\n\n        public bool NumCpuReadonly { get; set; }\n\n        public LongOption MemoryMB { get; set; }\n\n        public IntOption NumPCIControllers { get; set; }\n\n        public IntOption NumIDEControllers { get; set; }\n\n        public IntOption NumUSBControllers { get; set; }\n\n        public IntOption NumUSBXHCIControllers { get; set; }\n\n        public IntOption NumSIOControllers { get; set; }\n\n        public IntOption NumPS2Controllers { get; set; }\n\n        public string[] LicensingLimit { get; set; }\n\n        public IntOption NumSupportedWwnPorts { get; set; }\n\n        public IntOption NumSupportedWwnNodes { get; set; }\n\n        public ResourceConfigOption ResourceConfigOption { get; set; }\n\n        public IntOption NumNVDIMMControllers { get; set; }\n\n        public IntOption NumTPMDevices { get; set; }\n\n        public bool Equals(VirtualHardwareOption virtualHardwareOption)\n        {\n            return (virtualHardwareOption != null && this.HwVersion == virtualHardwareOption.HwVersion && ((this.VirtualDeviceOption == null && virtualHardwareOption.VirtualDeviceOption == null) || (this.VirtualDeviceOption != null && virtualHardwareOption.VirtualDeviceOption != null && Enumerable.SequenceEqual(this.VirtualDeviceOption, virtualHardwareOption.VirtualDeviceOption))) && this.DeviceListReadonly == virtualHardwareOption.DeviceListReadonly && ((this.NumCPU == null && virtualHardwareOption.NumCPU == null) || (this.NumCPU != null && virtualHardwareOption.NumCPU != null && Enumerable.SequenceEqual(this.NumCPU, virtualHardwareOption.NumCPU))) && ((this.NumCoresPerSocket == null && virtualHardwareOption.NumCoresPerSocket == null) || (this.NumCoresPerSocket != null && this.NumCoresPerSocket.Equals(virtualHardwareOption.NumCoresPerSocket))) && this.NumCpuReadonly == virtualHardwareOption.NumCpuReadonly && ((this.MemoryMB == null && virtualHardwareOption.MemoryMB == null) || (this.MemoryMB != null && this.MemoryMB.Equals(virtualHardwareOption.MemoryMB))) && ((this.NumPCIControllers == null && virtualHardwareOption.NumPCIControllers == null) || (this.NumPCIControllers != null && this.NumPCIControllers.Equals(virtualHardwareOption.NumPCIControllers))) && ((this.NumIDEControllers == null && virtualHardwareOption.NumIDEControllers == null) || (this.NumIDEControllers != null && this.NumIDEControllers.Equals(virtualHardwareOption.NumIDEControllers))) && ((this.NumUSBControllers == null && virtualHardwareOption.NumUSBControllers == null) || (this.NumUSBControllers != null && this.NumUSBControllers.Equals(virtualHardwareOption.NumUSBControllers))) && ((this.NumUSBXHCIControllers == null && virtualHardwareOption.NumUSBXHCIControllers == null) || (this.NumUSBXHCIControllers != null && this.NumUSBXHCIControllers.Equals(virtualHardwareOption.NumUSBXHCIControllers))) && ((this.NumSIOControllers == null && virtualHardwareOption.NumSIOControllers == null) || (this.NumSIOControllers != null && this.NumSIOControllers.Equals(virtualHardwareOption.NumSIOControllers))) && ((this.NumPS2Controllers == null && virtualHardwareOption.NumPS2Controllers == null) || (this.NumPS2Controllers != null && this.NumPS2Controllers.Equals(virtualHardwareOption.NumPS2Controllers))) && ((this.LicensingLimit == null && virtualHardwareOption.LicensingLimit == null) || (this.LicensingLimit != null && virtualHardwareOption.LicensingLimit != null && Enumerable.SequenceEqual(this.LicensingLimit, virtualHardwareOption.LicensingLimit))) && ((this.NumSupportedWwnPorts == null && virtualHardwareOption.NumSupportedWwnPorts == null) || (this.NumSupportedWwnPorts != null && this.NumSupportedWwnPorts.Equals(virtualHardwareOption.NumSupportedWwnPorts))) && ((this.NumSupportedWwnNodes == null && virtualHardwareOption.NumSupportedWwnNodes == null) || (this.NumSupportedWwnNodes != null && this.NumSupportedWwnNodes.Equals(virtualHardwareOption.NumSupportedWwnNodes))) && ((this.ResourceConfigOption == null && virtualHardwareOption.ResourceConfigOption == null) || (this.ResourceConfigOption != null && this.ResourceConfigOption.Equals(virtualHardwareOption.ResourceConfigOption))) && ((this.NumNVDIMMControllers == null && virtualHardwareOption.NumNVDIMMControllers == null) || (this.NumNVDIMMControllers != null && this.NumNVDIMMControllers.Equals(virtualHardwareOption.NumNVDIMMControllers))) && ((this.NumTPMDevices == null && virtualHardwareOption.NumTPMDevices == null) || (this.NumTPMDevices != null && this.NumTPMDevices.Equals(virtualHardwareOption.NumTPMDevices))));\n        }\n\n        public override bool Equals(object virtualHardwareOption)\n        {\n            return Equals(virtualHardwareOption as VirtualHardwareOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HwVersion + \"_\" + VirtualDeviceOption + \"_\" + DeviceListReadonly + \"_\" + NumCPU + \"_\" + NumCoresPerSocket + \"_\" + NumCpuReadonly + \"_\" + MemoryMB + \"_\" + NumPCIControllers + \"_\" + NumIDEControllers + \"_\" + NumUSBControllers + \"_\" + NumUSBXHCIControllers + \"_\" + NumSIOControllers + \"_\" + NumPS2Controllers + \"_\" + LicensingLimit + \"_\" + NumSupportedWwnPorts + \"_\" + NumSupportedWwnNodes + \"_\" + ResourceConfigOption + \"_\" + NumNVDIMMControllers + \"_\" + NumTPMDevices).GetHashCode();\n        }\n    }\n\n    public class VirtualHardwareVersionNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<VirtualHardwareVersionNotSupported>\n    {\n        public string HostName { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public VirtualHardwareVersionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualHardwareVersionNotSupported virtualHardwareVersionNotSupported)\n        {\n            return (virtualHardwareVersionNotSupported != null && this.HostName == virtualHardwareVersionNotSupported.HostName && ((this.Host == null && virtualHardwareVersionNotSupported.Host == null) || (this.Host != null && this.Host.Equals(virtualHardwareVersionNotSupported.Host))) && ((this.LinkedView == null && virtualHardwareVersionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualHardwareVersionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object virtualHardwareVersionNotSupported)\n        {\n            return Equals(virtualHardwareVersionNotSupported as VirtualHardwareVersionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + Host + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualHardwareVersionNotSupported_LinkedView : IEquatable<VirtualHardwareVersionNotSupported_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(VirtualHardwareVersionNotSupported_LinkedView virtualHardwareVersionNotSupported_LinkedView)\n        {\n            return (virtualHardwareVersionNotSupported_LinkedView != null && ((this.Host == null && virtualHardwareVersionNotSupported_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(virtualHardwareVersionNotSupported_LinkedView.Host))));\n        }\n\n        public override bool Equals(object virtualHardwareVersionNotSupported_LinkedView)\n        {\n            return Equals(virtualHardwareVersionNotSupported_LinkedView as VirtualHardwareVersionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class VirtualHdAudioCard : VirtualSoundCard, IEquatable<VirtualHdAudioCard>\n    {\n        public bool Equals(VirtualHdAudioCard virtualHdAudioCard)\n        {\n            return (virtualHdAudioCard != null && base.Equals(virtualHdAudioCard));\n        }\n\n        public override bool Equals(object virtualHdAudioCard)\n        {\n            return Equals(virtualHdAudioCard as VirtualHdAudioCard);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualHdAudioCardOption : VirtualSoundCardOption, IEquatable<VirtualHdAudioCardOption>\n    {\n        public bool Equals(VirtualHdAudioCardOption virtualHdAudioCardOption)\n        {\n            return (virtualHdAudioCardOption != null && base.Equals(virtualHdAudioCardOption));\n        }\n\n        public override bool Equals(object virtualHdAudioCardOption)\n        {\n            return Equals(virtualHdAudioCardOption as VirtualHdAudioCardOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualIDEController : VirtualController, IEquatable<VirtualIDEController>\n    {\n        public bool Equals(VirtualIDEController virtualIDEController)\n        {\n            return (virtualIDEController != null && base.Equals(virtualIDEController));\n        }\n\n        public override bool Equals(object virtualIDEController)\n        {\n            return Equals(virtualIDEController as VirtualIDEController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualIDEControllerOption : VirtualControllerOption, IEquatable<VirtualIDEControllerOption>\n    {\n        public IntOption NumIDEDisks { get; set; }\n\n        public IntOption NumIDECdroms { get; set; }\n\n        public bool Equals(VirtualIDEControllerOption virtualIDEControllerOption)\n        {\n            return (virtualIDEControllerOption != null && ((this.NumIDEDisks == null && virtualIDEControllerOption.NumIDEDisks == null) || (this.NumIDEDisks != null && this.NumIDEDisks.Equals(virtualIDEControllerOption.NumIDEDisks))) && ((this.NumIDECdroms == null && virtualIDEControllerOption.NumIDECdroms == null) || (this.NumIDECdroms != null && this.NumIDECdroms.Equals(virtualIDEControllerOption.NumIDECdroms))));\n        }\n\n        public override bool Equals(object virtualIDEControllerOption)\n        {\n            return Equals(virtualIDEControllerOption as VirtualIDEControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumIDEDisks + \"_\" + NumIDECdroms).GetHashCode();\n        }\n    }\n\n    public class VirtualizationManager : ViewBase, IEquatable<VirtualizationManager>\n    {\n        public bool Equals(VirtualizationManager virtualizationManager)\n        {\n            return (virtualizationManager != null && base.Equals(virtualizationManager));\n        }\n\n        public override bool Equals(object virtualizationManager)\n        {\n            return Equals(virtualizationManager as VirtualizationManager);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualKeyboard : VirtualDevice, IEquatable<VirtualKeyboard>\n    {\n        public bool Equals(VirtualKeyboard virtualKeyboard)\n        {\n            return (virtualKeyboard != null && base.Equals(virtualKeyboard));\n        }\n\n        public override bool Equals(object virtualKeyboard)\n        {\n            return Equals(virtualKeyboard as VirtualKeyboard);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualKeyboardOption : VirtualDeviceOption, IEquatable<VirtualKeyboardOption>\n    {\n        public bool Equals(VirtualKeyboardOption virtualKeyboardOption)\n        {\n            return (virtualKeyboardOption != null && base.Equals(virtualKeyboardOption));\n        }\n\n        public override bool Equals(object virtualKeyboardOption)\n        {\n            return Equals(virtualKeyboardOption as VirtualKeyboardOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualLsiLogicController : VirtualSCSIController, IEquatable<VirtualLsiLogicController>\n    {\n        public bool Equals(VirtualLsiLogicController virtualLsiLogicController)\n        {\n            return (virtualLsiLogicController != null && base.Equals(virtualLsiLogicController));\n        }\n\n        public override bool Equals(object virtualLsiLogicController)\n        {\n            return Equals(virtualLsiLogicController as VirtualLsiLogicController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualLsiLogicControllerOption : VirtualSCSIControllerOption, IEquatable<VirtualLsiLogicControllerOption>\n    {\n        public bool Equals(VirtualLsiLogicControllerOption virtualLsiLogicControllerOption)\n        {\n            return (virtualLsiLogicControllerOption != null && base.Equals(virtualLsiLogicControllerOption));\n        }\n\n        public override bool Equals(object virtualLsiLogicControllerOption)\n        {\n            return Equals(virtualLsiLogicControllerOption as VirtualLsiLogicControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualLsiLogicSASController : VirtualSCSIController, IEquatable<VirtualLsiLogicSASController>\n    {\n        public bool Equals(VirtualLsiLogicSASController virtualLsiLogicSASController)\n        {\n            return (virtualLsiLogicSASController != null && base.Equals(virtualLsiLogicSASController));\n        }\n\n        public override bool Equals(object virtualLsiLogicSASController)\n        {\n            return Equals(virtualLsiLogicSASController as VirtualLsiLogicSASController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualLsiLogicSASControllerOption : VirtualSCSIControllerOption, IEquatable<VirtualLsiLogicSASControllerOption>\n    {\n        public bool Equals(VirtualLsiLogicSASControllerOption virtualLsiLogicSASControllerOption)\n        {\n            return (virtualLsiLogicSASControllerOption != null && base.Equals(virtualLsiLogicSASControllerOption));\n        }\n\n        public override bool Equals(object virtualLsiLogicSASControllerOption)\n        {\n            return Equals(virtualLsiLogicSASControllerOption as VirtualLsiLogicSASControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachine : ManagedEntity, IEquatable<VirtualMachine>\n    {\n        public VirtualMachineCapability Capability { get; set; }\n\n        public VirtualMachineConfigInfo Config { get; set; }\n\n        public VirtualMachineFileLayout Layout { get; set; }\n\n        public VirtualMachineFileLayoutEx LayoutEx { get; set; }\n\n        public VirtualMachineStorageInfo Storage { get; set; }\n\n        public ManagedObjectReference EnvironmentBrowser { get; set; }\n\n        public ManagedObjectReference ResourcePool { get; set; }\n\n        public ManagedObjectReference ParentVApp { get; set; }\n\n        public ResourceConfigSpec ResourceConfig { get; set; }\n\n        public VirtualMachineRuntimeInfo Runtime { get; set; }\n\n        public GuestInfo Guest { get; set; }\n\n        public VirtualMachineSummary Summary { get; set; }\n\n        public ManagedObjectReference[] Datastore { get; set; }\n\n        public ManagedObjectReference[] Network { get; set; }\n\n        public VirtualMachineSnapshotInfo Snapshot { get; set; }\n\n        public ManagedObjectReference[] RootSnapshot { get; set; }\n\n        public ManagedEntityStatus GuestHeartbeatStatus { get; set; }\n\n        public new VirtualMachine_LinkedView LinkedView { get; set; }\n\n        public void RefreshStorageInfo()\n        {\n        }\n\n        public ManagedObjectReference CreateSnapshot_Task(string name, string description, bool memory, bool quiesce)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateSnapshot(string name, string description, bool memory, bool quiesce)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateSnapshotEx_Task(string name, string description, bool memory, VirtualMachineGuestQuiesceSpec quiesceSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CreateSnapshotEx(string name, string description, bool memory, VirtualMachineGuestQuiesceSpec quiesceSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference RevertToCurrentSnapshot_Task(ManagedObjectReference host, bool? suppressPowerOn)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RevertToCurrentSnapshot(ManagedObjectReference host, bool? suppressPowerOn)\n        {\n        }\n\n        public ManagedObjectReference RemoveAllSnapshots_Task(bool? consolidate)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RemoveAllSnapshots(bool? consolidate)\n        {\n        }\n\n        public ManagedObjectReference ConsolidateVMDisks_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ConsolidateVMDisks()\n        {\n        }\n\n        public ManagedObjectReference EstimateStorageForConsolidateSnapshots_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public StorageRequirement[] EstimateStorageForConsolidateSnapshots()\n        {\n            return default(StorageRequirement[]);\n        }\n\n        public ManagedObjectReference ReconfigVM_Task(VirtualMachineConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ReconfigVM(VirtualMachineConfigSpec spec)\n        {\n        }\n\n        public ManagedObjectReference UpgradeVM_Task(string version)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpgradeVM(string version)\n        {\n        }\n\n        public string ExtractOvfEnvironment()\n        {\n            return default(string);\n        }\n\n        public ManagedObjectReference PowerOnVM_Task(ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PowerOnVM(ManagedObjectReference host)\n        {\n        }\n\n        public ManagedObjectReference PowerOffVM_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PowerOffVM()\n        {\n        }\n\n        public ManagedObjectReference SuspendVM_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void SuspendVM()\n        {\n        }\n\n        public ManagedObjectReference ResetVM_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ResetVM()\n        {\n        }\n\n        public void ShutdownGuest()\n        {\n        }\n\n        public void RebootGuest()\n        {\n        }\n\n        public void StandbyGuest()\n        {\n        }\n\n        public void AnswerVM(string questionId, string answerChoice)\n        {\n        }\n\n        public ManagedObjectReference CustomizeVM_Task(CustomizationSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void CustomizeVM(CustomizationSpec spec)\n        {\n        }\n\n        public void CheckCustomizationSpec(CustomizationSpec spec)\n        {\n        }\n\n        public ManagedObjectReference MigrateVM_Task(ManagedObjectReference pool, ManagedObjectReference host, VirtualMachineMovePriority priority, VirtualMachinePowerState? state)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MigrateVM(ManagedObjectReference pool, ManagedObjectReference host, VirtualMachineMovePriority priority, VirtualMachinePowerState? state)\n        {\n        }\n\n        public ManagedObjectReference RelocateVM_Task(VirtualMachineRelocateSpec spec, VirtualMachineMovePriority? priority)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RelocateVM(VirtualMachineRelocateSpec spec, VirtualMachineMovePriority? priority)\n        {\n        }\n\n        public ManagedObjectReference CloneVM_Task(ManagedObjectReference folder, string name, VirtualMachineCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference CloneVM(ManagedObjectReference folder, string name, VirtualMachineCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference InstantClone_Task(VirtualMachineInstantCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference InstantClone(VirtualMachineInstantCloneSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference ExportVm()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MarkAsTemplate()\n        {\n        }\n\n        public void MarkAsVirtualMachine(ManagedObjectReference pool, ManagedObjectReference host)\n        {\n        }\n\n        public void UnregisterVM()\n        {\n        }\n\n        public void ResetGuestInformation()\n        {\n        }\n\n        public void MountToolsInstaller()\n        {\n        }\n\n        public void UnmountToolsInstaller()\n        {\n        }\n\n        public ManagedObjectReference UpgradeTools_Task(string installerOptions)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpgradeTools(string installerOptions)\n        {\n        }\n\n        public VirtualMachineMksTicket AcquireMksTicket()\n        {\n            return default(VirtualMachineMksTicket);\n        }\n\n        public VirtualMachineTicket AcquireTicket(string ticketType)\n        {\n            return default(VirtualMachineTicket);\n        }\n\n        public void SetScreenResolution(int width, int height)\n        {\n        }\n\n        public void DefragmentAllDisks()\n        {\n        }\n\n        public ManagedObjectReference CreateSecondaryVM_Task(ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public FaultToleranceSecondaryOpResult CreateSecondaryVM(ManagedObjectReference host)\n        {\n            return default(FaultToleranceSecondaryOpResult);\n        }\n\n        public ManagedObjectReference CreateSecondaryVMEx_Task(ManagedObjectReference host, FaultToleranceConfigSpec spec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public FaultToleranceSecondaryOpResult CreateSecondaryVMEx(ManagedObjectReference host, FaultToleranceConfigSpec spec)\n        {\n            return default(FaultToleranceSecondaryOpResult);\n        }\n\n        public ManagedObjectReference TurnOffFaultToleranceForVM_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void TurnOffFaultToleranceForVM()\n        {\n        }\n\n        public ManagedObjectReference MakePrimaryVM_Task(ManagedObjectReference vm)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void MakePrimaryVM(ManagedObjectReference vm)\n        {\n        }\n\n        public ManagedObjectReference TerminateFaultTolerantVM_Task(ManagedObjectReference vm)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void TerminateFaultTolerantVM(ManagedObjectReference vm)\n        {\n        }\n\n        public ManagedObjectReference DisableSecondaryVM_Task(ManagedObjectReference vm)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DisableSecondaryVM(ManagedObjectReference vm)\n        {\n        }\n\n        public ManagedObjectReference EnableSecondaryVM_Task(ManagedObjectReference vm, ManagedObjectReference host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public FaultToleranceSecondaryOpResult EnableSecondaryVM(ManagedObjectReference vm, ManagedObjectReference host)\n        {\n            return default(FaultToleranceSecondaryOpResult);\n        }\n\n        public void SetDisplayTopology(VirtualMachineDisplayTopology[] displays)\n        {\n        }\n\n        public ManagedObjectReference StartRecording_Task(string name, string description)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference StartRecording(string name, string description)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public ManagedObjectReference StopRecording_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void StopRecording()\n        {\n        }\n\n        public ManagedObjectReference StartReplaying_Task(ManagedObjectReference replaySnapshot)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void StartReplaying(ManagedObjectReference replaySnapshot)\n        {\n        }\n\n        public ManagedObjectReference StopReplaying_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void StopReplaying()\n        {\n        }\n\n        public ManagedObjectReference PromoteDisks_Task(bool unlink, VirtualDisk[] disks)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void PromoteDisks(bool unlink, VirtualDisk[] disks)\n        {\n        }\n\n        public ManagedObjectReference CreateScreenshot_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public string CreateScreenshot()\n        {\n            return default(string);\n        }\n\n        public int PutUsbScanCodes(UsbScanCodeSpec spec)\n        {\n            return default(int);\n        }\n\n        public DiskChangeInfo QueryChangedDiskAreas(ManagedObjectReference snapshot, int deviceKey, long startOffset, string changeId)\n        {\n            return default(DiskChangeInfo);\n        }\n\n        public string[] QueryUnownedFiles()\n        {\n            return default(string[]);\n        }\n\n        public ManagedObjectReference reloadVirtualMachineFromPath_Task(string configurationPath)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void reloadVirtualMachineFromPath(string configurationPath)\n        {\n        }\n\n        public LocalizedMethodFault[] QueryFaultToleranceCompatibility()\n        {\n            return default(LocalizedMethodFault[]);\n        }\n\n        public LocalizedMethodFault[] QueryFaultToleranceCompatibilityEx(bool? forLegacyFt)\n        {\n            return default(LocalizedMethodFault[]);\n        }\n\n        public void TerminateVM()\n        {\n        }\n\n        public void SendNMI()\n        {\n        }\n\n        public ManagedObjectReference AttachDisk_Task(ID diskId, ManagedObjectReference datastore, int? controllerKey, int? unitNumber)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void AttachDisk(ID diskId, ManagedObjectReference datastore, int? controllerKey, int? unitNumber)\n        {\n        }\n\n        public ManagedObjectReference DetachDisk_Task(ID diskId)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void DetachDisk(ID diskId)\n        {\n        }\n\n        public ManagedObjectReference ApplyEvcModeVM_Task(HostFeatureMask[] mask, bool? completeMasks)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void ApplyEvcModeVM(HostFeatureMask[] mask, bool? completeMasks)\n        {\n        }\n\n        public ManagedObjectReference CryptoUnlock_Task()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void CryptoUnlock()\n        {\n        }\n\n        public bool Equals(VirtualMachine virtualMachine)\n        {\n            return (virtualMachine != null && ((this.Capability == null && virtualMachine.Capability == null) || (this.Capability != null && this.Capability.Equals(virtualMachine.Capability))) && ((this.Config == null && virtualMachine.Config == null) || (this.Config != null && this.Config.Equals(virtualMachine.Config))) && ((this.Layout == null && virtualMachine.Layout == null) || (this.Layout != null && this.Layout.Equals(virtualMachine.Layout))) && ((this.LayoutEx == null && virtualMachine.LayoutEx == null) || (this.LayoutEx != null && this.LayoutEx.Equals(virtualMachine.LayoutEx))) && ((this.Storage == null && virtualMachine.Storage == null) || (this.Storage != null && this.Storage.Equals(virtualMachine.Storage))) && ((this.EnvironmentBrowser == null && virtualMachine.EnvironmentBrowser == null) || (this.EnvironmentBrowser != null && this.EnvironmentBrowser.Equals(virtualMachine.EnvironmentBrowser))) && ((this.ResourcePool == null && virtualMachine.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(virtualMachine.ResourcePool))) && ((this.ParentVApp == null && virtualMachine.ParentVApp == null) || (this.ParentVApp != null && this.ParentVApp.Equals(virtualMachine.ParentVApp))) && ((this.ResourceConfig == null && virtualMachine.ResourceConfig == null) || (this.ResourceConfig != null && this.ResourceConfig.Equals(virtualMachine.ResourceConfig))) && ((this.Runtime == null && virtualMachine.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(virtualMachine.Runtime))) && ((this.Guest == null && virtualMachine.Guest == null) || (this.Guest != null && this.Guest.Equals(virtualMachine.Guest))) && ((this.Summary == null && virtualMachine.Summary == null) || (this.Summary != null && this.Summary.Equals(virtualMachine.Summary))) && ((this.Datastore == null && virtualMachine.Datastore == null) || (this.Datastore != null && virtualMachine.Datastore != null && Enumerable.SequenceEqual(this.Datastore, virtualMachine.Datastore))) && ((this.Network == null && virtualMachine.Network == null) || (this.Network != null && virtualMachine.Network != null && Enumerable.SequenceEqual(this.Network, virtualMachine.Network))) && ((this.Snapshot == null && virtualMachine.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(virtualMachine.Snapshot))) && ((this.RootSnapshot == null && virtualMachine.RootSnapshot == null) || (this.RootSnapshot != null && virtualMachine.RootSnapshot != null && Enumerable.SequenceEqual(this.RootSnapshot, virtualMachine.RootSnapshot))) && this.GuestHeartbeatStatus == virtualMachine.GuestHeartbeatStatus && ((this.LinkedView == null && virtualMachine.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachine.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachine)\n        {\n            return Equals(virtualMachine as VirtualMachine);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capability + \"_\" + Config + \"_\" + Layout + \"_\" + LayoutEx + \"_\" + Storage + \"_\" + EnvironmentBrowser + \"_\" + ResourcePool + \"_\" + ParentVApp + \"_\" + ResourceConfig + \"_\" + Runtime + \"_\" + Guest + \"_\" + Summary + \"_\" + Datastore + \"_\" + Network + \"_\" + Snapshot + \"_\" + RootSnapshot + \"_\" + GuestHeartbeatStatus + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachine_LinkedView : ManagedEntity_LinkedView, IEquatable<VirtualMachine_LinkedView>\n    {\n        public EnvironmentBrowser EnvironmentBrowser { get; set; }\n\n        public ResourcePool ResourcePool { get; set; }\n\n        public ManagedEntity ParentVApp { get; set; }\n\n        public Datastore[] Datastore { get; set; }\n\n        public Network[] Network { get; set; }\n\n        public VirtualMachineSnapshot[] RootSnapshot { get; set; }\n\n        public bool Equals(VirtualMachine_LinkedView virtualMachine_LinkedView)\n        {\n            return (virtualMachine_LinkedView != null && ((this.EnvironmentBrowser == null && virtualMachine_LinkedView.EnvironmentBrowser == null) || (this.EnvironmentBrowser != null && this.EnvironmentBrowser.Equals(virtualMachine_LinkedView.EnvironmentBrowser))) && ((this.ResourcePool == null && virtualMachine_LinkedView.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(virtualMachine_LinkedView.ResourcePool))) && ((this.ParentVApp == null && virtualMachine_LinkedView.ParentVApp == null) || (this.ParentVApp != null && this.ParentVApp.Equals(virtualMachine_LinkedView.ParentVApp))) && ((this.Datastore == null && virtualMachine_LinkedView.Datastore == null) || (this.Datastore != null && virtualMachine_LinkedView.Datastore != null && Enumerable.SequenceEqual(this.Datastore, virtualMachine_LinkedView.Datastore))) && ((this.Network == null && virtualMachine_LinkedView.Network == null) || (this.Network != null && virtualMachine_LinkedView.Network != null && Enumerable.SequenceEqual(this.Network, virtualMachine_LinkedView.Network))) && ((this.RootSnapshot == null && virtualMachine_LinkedView.RootSnapshot == null) || (this.RootSnapshot != null && virtualMachine_LinkedView.RootSnapshot != null && Enumerable.SequenceEqual(this.RootSnapshot, virtualMachine_LinkedView.RootSnapshot))));\n        }\n\n        public override bool Equals(object virtualMachine_LinkedView)\n        {\n            return Equals(virtualMachine_LinkedView as VirtualMachine_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EnvironmentBrowser + \"_\" + ResourcePool + \"_\" + ParentVApp + \"_\" + Datastore + \"_\" + Network + \"_\" + RootSnapshot).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineAffinityInfo : DynamicData, IEquatable<VirtualMachineAffinityInfo>\n    {\n        public int[] AffinitySet { get; set; }\n\n        public bool Equals(VirtualMachineAffinityInfo virtualMachineAffinityInfo)\n        {\n            return (virtualMachineAffinityInfo != null && ((this.AffinitySet == null && virtualMachineAffinityInfo.AffinitySet == null) || (this.AffinitySet != null && virtualMachineAffinityInfo.AffinitySet != null && Enumerable.SequenceEqual(this.AffinitySet, virtualMachineAffinityInfo.AffinitySet))));\n        }\n\n        public override bool Equals(object virtualMachineAffinityInfo)\n        {\n            return Equals(virtualMachineAffinityInfo as VirtualMachineAffinityInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AffinitySet).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineBootOptions : DynamicData, IEquatable<VirtualMachineBootOptions>\n    {\n        public long? BootDelay { get; set; }\n\n        public bool? EnterBIOSSetup { get; set; }\n\n        public bool? EfiSecureBootEnabled { get; set; }\n\n        public bool? BootRetryEnabled { get; set; }\n\n        public long? BootRetryDelay { get; set; }\n\n        public VirtualMachineBootOptionsBootableDevice[] BootOrder { get; set; }\n\n        public string NetworkBootProtocol { get; set; }\n\n        public bool Equals(VirtualMachineBootOptions virtualMachineBootOptions)\n        {\n            return (virtualMachineBootOptions != null && ((this.BootDelay == null && virtualMachineBootOptions.BootDelay == null) || (this.BootDelay != null && this.BootDelay.Equals(virtualMachineBootOptions.BootDelay))) && ((this.EnterBIOSSetup == null && virtualMachineBootOptions.EnterBIOSSetup == null) || (this.EnterBIOSSetup != null && this.EnterBIOSSetup.Equals(virtualMachineBootOptions.EnterBIOSSetup))) && ((this.EfiSecureBootEnabled == null && virtualMachineBootOptions.EfiSecureBootEnabled == null) || (this.EfiSecureBootEnabled != null && this.EfiSecureBootEnabled.Equals(virtualMachineBootOptions.EfiSecureBootEnabled))) && ((this.BootRetryEnabled == null && virtualMachineBootOptions.BootRetryEnabled == null) || (this.BootRetryEnabled != null && this.BootRetryEnabled.Equals(virtualMachineBootOptions.BootRetryEnabled))) && ((this.BootRetryDelay == null && virtualMachineBootOptions.BootRetryDelay == null) || (this.BootRetryDelay != null && this.BootRetryDelay.Equals(virtualMachineBootOptions.BootRetryDelay))) && ((this.BootOrder == null && virtualMachineBootOptions.BootOrder == null) || (this.BootOrder != null && virtualMachineBootOptions.BootOrder != null && Enumerable.SequenceEqual(this.BootOrder, virtualMachineBootOptions.BootOrder))) && this.NetworkBootProtocol == virtualMachineBootOptions.NetworkBootProtocol);\n        }\n\n        public override bool Equals(object virtualMachineBootOptions)\n        {\n            return Equals(virtualMachineBootOptions as VirtualMachineBootOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BootDelay + \"_\" + EnterBIOSSetup + \"_\" + EfiSecureBootEnabled + \"_\" + BootRetryEnabled + \"_\" + BootRetryDelay + \"_\" + BootOrder + \"_\" + NetworkBootProtocol).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineBootOptionsBootableCdromDevice : VirtualMachineBootOptionsBootableDevice, IEquatable<VirtualMachineBootOptionsBootableCdromDevice>\n    {\n        public bool Equals(VirtualMachineBootOptionsBootableCdromDevice virtualMachineBootOptionsBootableCdromDevice)\n        {\n            return (virtualMachineBootOptionsBootableCdromDevice != null && base.Equals(virtualMachineBootOptionsBootableCdromDevice));\n        }\n\n        public override bool Equals(object virtualMachineBootOptionsBootableCdromDevice)\n        {\n            return Equals(virtualMachineBootOptionsBootableCdromDevice as VirtualMachineBootOptionsBootableCdromDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineBootOptionsBootableDevice : DynamicData, IEquatable<VirtualMachineBootOptionsBootableDevice>\n    {\n        public bool Equals(VirtualMachineBootOptionsBootableDevice virtualMachineBootOptionsBootableDevice)\n        {\n            return (virtualMachineBootOptionsBootableDevice != null && base.Equals(virtualMachineBootOptionsBootableDevice));\n        }\n\n        public override bool Equals(object virtualMachineBootOptionsBootableDevice)\n        {\n            return Equals(virtualMachineBootOptionsBootableDevice as VirtualMachineBootOptionsBootableDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineBootOptionsBootableDiskDevice : VirtualMachineBootOptionsBootableDevice, IEquatable<VirtualMachineBootOptionsBootableDiskDevice>\n    {\n        public int DeviceKey { get; set; }\n\n        public bool Equals(VirtualMachineBootOptionsBootableDiskDevice virtualMachineBootOptionsBootableDiskDevice)\n        {\n            return (virtualMachineBootOptionsBootableDiskDevice != null && this.DeviceKey == virtualMachineBootOptionsBootableDiskDevice.DeviceKey);\n        }\n\n        public override bool Equals(object virtualMachineBootOptionsBootableDiskDevice)\n        {\n            return Equals(virtualMachineBootOptionsBootableDiskDevice as VirtualMachineBootOptionsBootableDiskDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceKey).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineBootOptionsBootableEthernetDevice : VirtualMachineBootOptionsBootableDevice, IEquatable<VirtualMachineBootOptionsBootableEthernetDevice>\n    {\n        public int DeviceKey { get; set; }\n\n        public bool Equals(VirtualMachineBootOptionsBootableEthernetDevice virtualMachineBootOptionsBootableEthernetDevice)\n        {\n            return (virtualMachineBootOptionsBootableEthernetDevice != null && this.DeviceKey == virtualMachineBootOptionsBootableEthernetDevice.DeviceKey);\n        }\n\n        public override bool Equals(object virtualMachineBootOptionsBootableEthernetDevice)\n        {\n            return Equals(virtualMachineBootOptionsBootableEthernetDevice as VirtualMachineBootOptionsBootableEthernetDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceKey).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineBootOptionsBootableFloppyDevice : VirtualMachineBootOptionsBootableDevice, IEquatable<VirtualMachineBootOptionsBootableFloppyDevice>\n    {\n        public bool Equals(VirtualMachineBootOptionsBootableFloppyDevice virtualMachineBootOptionsBootableFloppyDevice)\n        {\n            return (virtualMachineBootOptionsBootableFloppyDevice != null && base.Equals(virtualMachineBootOptionsBootableFloppyDevice));\n        }\n\n        public override bool Equals(object virtualMachineBootOptionsBootableFloppyDevice)\n        {\n            return Equals(virtualMachineBootOptionsBootableFloppyDevice as VirtualMachineBootOptionsBootableFloppyDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineCapability : DynamicData, IEquatable<VirtualMachineCapability>\n    {\n        public bool SnapshotOperationsSupported { get; set; }\n\n        public bool MultipleSnapshotsSupported { get; set; }\n\n        public bool SnapshotConfigSupported { get; set; }\n\n        public bool PoweredOffSnapshotsSupported { get; set; }\n\n        public bool MemorySnapshotsSupported { get; set; }\n\n        public bool RevertToSnapshotSupported { get; set; }\n\n        public bool QuiescedSnapshotsSupported { get; set; }\n\n        public bool DisableSnapshotsSupported { get; set; }\n\n        public bool LockSnapshotsSupported { get; set; }\n\n        public bool ConsolePreferencesSupported { get; set; }\n\n        public bool CpuFeatureMaskSupported { get; set; }\n\n        public bool S1AcpiManagementSupported { get; set; }\n\n        public bool SettingScreenResolutionSupported { get; set; }\n\n        public bool ToolsAutoUpdateSupported { get; set; }\n\n        public bool VmNpivWwnSupported { get; set; }\n\n        public bool NpivWwnOnNonRdmVmSupported { get; set; }\n\n        public bool VmNpivWwnDisableSupported { get; set; }\n\n        public bool VmNpivWwnUpdateSupported { get; set; }\n\n        public bool SwapPlacementSupported { get; set; }\n\n        public bool ToolsSyncTimeSupported { get; set; }\n\n        public bool VirtualMmuUsageSupported { get; set; }\n\n        public bool DiskSharesSupported { get; set; }\n\n        public bool BootOptionsSupported { get; set; }\n\n        public bool BootRetryOptionsSupported { get; set; }\n\n        public bool SettingVideoRamSizeSupported { get; set; }\n\n        public bool SettingDisplayTopologySupported { get; set; }\n\n        public bool RecordReplaySupported { get; set; }\n\n        public bool ChangeTrackingSupported { get; set; }\n\n        public bool MultipleCoresPerSocketSupported { get; set; }\n\n        public bool HostBasedReplicationSupported { get; set; }\n\n        public bool GuestAutoLockSupported { get; set; }\n\n        public bool MemoryReservationLockSupported { get; set; }\n\n        public bool FeatureRequirementSupported { get; set; }\n\n        public bool PoweredOnMonitorTypeChangeSupported { get; set; }\n\n        public bool SeSparseDiskSupported { get; set; }\n\n        public bool NestedHVSupported { get; set; }\n\n        public bool VPMCSupported { get; set; }\n\n        public bool? SecureBootSupported { get; set; }\n\n        public bool? PerVmEvcSupported { get; set; }\n\n        public bool? VirtualMmuUsageIgnored { get; set; }\n\n        public bool? VirtualExecUsageIgnored { get; set; }\n\n        public bool? DiskOnlySnapshotOnSuspendedVMSupported { get; set; }\n\n        public bool Equals(VirtualMachineCapability virtualMachineCapability)\n        {\n            return (virtualMachineCapability != null && this.SnapshotOperationsSupported == virtualMachineCapability.SnapshotOperationsSupported && this.MultipleSnapshotsSupported == virtualMachineCapability.MultipleSnapshotsSupported && this.SnapshotConfigSupported == virtualMachineCapability.SnapshotConfigSupported && this.PoweredOffSnapshotsSupported == virtualMachineCapability.PoweredOffSnapshotsSupported && this.MemorySnapshotsSupported == virtualMachineCapability.MemorySnapshotsSupported && this.RevertToSnapshotSupported == virtualMachineCapability.RevertToSnapshotSupported && this.QuiescedSnapshotsSupported == virtualMachineCapability.QuiescedSnapshotsSupported && this.DisableSnapshotsSupported == virtualMachineCapability.DisableSnapshotsSupported && this.LockSnapshotsSupported == virtualMachineCapability.LockSnapshotsSupported && this.ConsolePreferencesSupported == virtualMachineCapability.ConsolePreferencesSupported && this.CpuFeatureMaskSupported == virtualMachineCapability.CpuFeatureMaskSupported && this.S1AcpiManagementSupported == virtualMachineCapability.S1AcpiManagementSupported && this.SettingScreenResolutionSupported == virtualMachineCapability.SettingScreenResolutionSupported && this.ToolsAutoUpdateSupported == virtualMachineCapability.ToolsAutoUpdateSupported && this.VmNpivWwnSupported == virtualMachineCapability.VmNpivWwnSupported && this.NpivWwnOnNonRdmVmSupported == virtualMachineCapability.NpivWwnOnNonRdmVmSupported && this.VmNpivWwnDisableSupported == virtualMachineCapability.VmNpivWwnDisableSupported && this.VmNpivWwnUpdateSupported == virtualMachineCapability.VmNpivWwnUpdateSupported && this.SwapPlacementSupported == virtualMachineCapability.SwapPlacementSupported && this.ToolsSyncTimeSupported == virtualMachineCapability.ToolsSyncTimeSupported && this.VirtualMmuUsageSupported == virtualMachineCapability.VirtualMmuUsageSupported && this.DiskSharesSupported == virtualMachineCapability.DiskSharesSupported && this.BootOptionsSupported == virtualMachineCapability.BootOptionsSupported && this.BootRetryOptionsSupported == virtualMachineCapability.BootRetryOptionsSupported && this.SettingVideoRamSizeSupported == virtualMachineCapability.SettingVideoRamSizeSupported && this.SettingDisplayTopologySupported == virtualMachineCapability.SettingDisplayTopologySupported && this.RecordReplaySupported == virtualMachineCapability.RecordReplaySupported && this.ChangeTrackingSupported == virtualMachineCapability.ChangeTrackingSupported && this.MultipleCoresPerSocketSupported == virtualMachineCapability.MultipleCoresPerSocketSupported && this.HostBasedReplicationSupported == virtualMachineCapability.HostBasedReplicationSupported && this.GuestAutoLockSupported == virtualMachineCapability.GuestAutoLockSupported && this.MemoryReservationLockSupported == virtualMachineCapability.MemoryReservationLockSupported && this.FeatureRequirementSupported == virtualMachineCapability.FeatureRequirementSupported && this.PoweredOnMonitorTypeChangeSupported == virtualMachineCapability.PoweredOnMonitorTypeChangeSupported && this.SeSparseDiskSupported == virtualMachineCapability.SeSparseDiskSupported && this.NestedHVSupported == virtualMachineCapability.NestedHVSupported && this.VPMCSupported == virtualMachineCapability.VPMCSupported && ((this.SecureBootSupported == null && virtualMachineCapability.SecureBootSupported == null) || (this.SecureBootSupported != null && this.SecureBootSupported.Equals(virtualMachineCapability.SecureBootSupported))) && ((this.PerVmEvcSupported == null && virtualMachineCapability.PerVmEvcSupported == null) || (this.PerVmEvcSupported != null && this.PerVmEvcSupported.Equals(virtualMachineCapability.PerVmEvcSupported))) && ((this.VirtualMmuUsageIgnored == null && virtualMachineCapability.VirtualMmuUsageIgnored == null) || (this.VirtualMmuUsageIgnored != null && this.VirtualMmuUsageIgnored.Equals(virtualMachineCapability.VirtualMmuUsageIgnored))) && ((this.VirtualExecUsageIgnored == null && virtualMachineCapability.VirtualExecUsageIgnored == null) || (this.VirtualExecUsageIgnored != null && this.VirtualExecUsageIgnored.Equals(virtualMachineCapability.VirtualExecUsageIgnored))) && ((this.DiskOnlySnapshotOnSuspendedVMSupported == null && virtualMachineCapability.DiskOnlySnapshotOnSuspendedVMSupported == null) || (this.DiskOnlySnapshotOnSuspendedVMSupported != null && this.DiskOnlySnapshotOnSuspendedVMSupported.Equals(virtualMachineCapability.DiskOnlySnapshotOnSuspendedVMSupported))));\n        }\n\n        public override bool Equals(object virtualMachineCapability)\n        {\n            return Equals(virtualMachineCapability as VirtualMachineCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SnapshotOperationsSupported + \"_\" + MultipleSnapshotsSupported + \"_\" + SnapshotConfigSupported + \"_\" + PoweredOffSnapshotsSupported + \"_\" + MemorySnapshotsSupported + \"_\" + RevertToSnapshotSupported + \"_\" + QuiescedSnapshotsSupported + \"_\" + DisableSnapshotsSupported + \"_\" + LockSnapshotsSupported + \"_\" + ConsolePreferencesSupported + \"_\" + CpuFeatureMaskSupported + \"_\" + S1AcpiManagementSupported + \"_\" + SettingScreenResolutionSupported + \"_\" + ToolsAutoUpdateSupported + \"_\" + VmNpivWwnSupported + \"_\" + NpivWwnOnNonRdmVmSupported + \"_\" + VmNpivWwnDisableSupported + \"_\" + VmNpivWwnUpdateSupported + \"_\" + SwapPlacementSupported + \"_\" + ToolsSyncTimeSupported + \"_\" + VirtualMmuUsageSupported + \"_\" + DiskSharesSupported + \"_\" + BootOptionsSupported + \"_\" + BootRetryOptionsSupported + \"_\" + SettingVideoRamSizeSupported + \"_\" + SettingDisplayTopologySupported + \"_\" + RecordReplaySupported + \"_\" + ChangeTrackingSupported + \"_\" + MultipleCoresPerSocketSupported + \"_\" + HostBasedReplicationSupported + \"_\" + GuestAutoLockSupported + \"_\" + MemoryReservationLockSupported + \"_\" + FeatureRequirementSupported + \"_\" + PoweredOnMonitorTypeChangeSupported + \"_\" + SeSparseDiskSupported + \"_\" + NestedHVSupported + \"_\" + VPMCSupported + \"_\" + SecureBootSupported + \"_\" + PerVmEvcSupported + \"_\" + VirtualMmuUsageIgnored + \"_\" + VirtualExecUsageIgnored + \"_\" + DiskOnlySnapshotOnSuspendedVMSupported).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineCdromInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineCdromInfo>\n    {\n        public string Description { get; set; }\n\n        public bool Equals(VirtualMachineCdromInfo virtualMachineCdromInfo)\n        {\n            return (virtualMachineCdromInfo != null && this.Description == virtualMachineCdromInfo.Description);\n        }\n\n        public override bool Equals(object virtualMachineCdromInfo)\n        {\n            return Equals(virtualMachineCdromInfo as VirtualMachineCdromInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineCloneSpec : DynamicData, IEquatable<VirtualMachineCloneSpec>\n    {\n        public VirtualMachineRelocateSpec Location { get; set; }\n\n        public bool Template { get; set; }\n\n        public VirtualMachineConfigSpec Config { get; set; }\n\n        public CustomizationSpec Customization { get; set; }\n\n        public bool PowerOn { get; set; }\n\n        public ManagedObjectReference Snapshot { get; set; }\n\n        public bool? Memory { get; set; }\n\n        public VirtualMachineCloneSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineCloneSpec virtualMachineCloneSpec)\n        {\n            return (virtualMachineCloneSpec != null && ((this.Location == null && virtualMachineCloneSpec.Location == null) || (this.Location != null && this.Location.Equals(virtualMachineCloneSpec.Location))) && this.Template == virtualMachineCloneSpec.Template && ((this.Config == null && virtualMachineCloneSpec.Config == null) || (this.Config != null && this.Config.Equals(virtualMachineCloneSpec.Config))) && ((this.Customization == null && virtualMachineCloneSpec.Customization == null) || (this.Customization != null && this.Customization.Equals(virtualMachineCloneSpec.Customization))) && this.PowerOn == virtualMachineCloneSpec.PowerOn && ((this.Snapshot == null && virtualMachineCloneSpec.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(virtualMachineCloneSpec.Snapshot))) && ((this.Memory == null && virtualMachineCloneSpec.Memory == null) || (this.Memory != null && this.Memory.Equals(virtualMachineCloneSpec.Memory))) && ((this.LinkedView == null && virtualMachineCloneSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineCloneSpec.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineCloneSpec)\n        {\n            return Equals(virtualMachineCloneSpec as VirtualMachineCloneSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Location + \"_\" + Template + \"_\" + Config + \"_\" + Customization + \"_\" + PowerOn + \"_\" + Snapshot + \"_\" + Memory + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineCloneSpec_LinkedView : IEquatable<VirtualMachineCloneSpec_LinkedView>\n    {\n        public VirtualMachineSnapshot Snapshot { get; set; }\n\n        public bool Equals(VirtualMachineCloneSpec_LinkedView virtualMachineCloneSpec_LinkedView)\n        {\n            return (virtualMachineCloneSpec_LinkedView != null && ((this.Snapshot == null && virtualMachineCloneSpec_LinkedView.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(virtualMachineCloneSpec_LinkedView.Snapshot))));\n        }\n\n        public override bool Equals(object virtualMachineCloneSpec_LinkedView)\n        {\n            return Equals(virtualMachineCloneSpec_LinkedView as VirtualMachineCloneSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Snapshot).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineCompatibilityChecker : ViewBase, IEquatable<VirtualMachineCompatibilityChecker>\n    {\n        public ManagedObjectReference CheckCompatibility_Task(ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckCompatibility(ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public ManagedObjectReference CheckVmConfig_Task(VirtualMachineConfigSpec spec, ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckVmConfig(VirtualMachineConfigSpec spec, ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public ManagedObjectReference CheckPowerOn_Task(ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckPowerOn(ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public bool Equals(VirtualMachineCompatibilityChecker virtualMachineCompatibilityChecker)\n        {\n            return (virtualMachineCompatibilityChecker != null && base.Equals(virtualMachineCompatibilityChecker));\n        }\n\n        public override bool Equals(object virtualMachineCompatibilityChecker)\n        {\n            return Equals(virtualMachineCompatibilityChecker as VirtualMachineCompatibilityChecker);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigInfo : DynamicData, IEquatable<VirtualMachineConfigInfo>\n    {\n        public string ChangeVersion { get; set; }\n\n        public DateTime Modified { get; set; }\n\n        public string Name { get; set; }\n\n        public string GuestFullName { get; set; }\n\n        public string Version { get; set; }\n\n        public string Uuid { get; set; }\n\n        public DateTime? CreateDate { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public long[] NpivNodeWorldWideName { get; set; }\n\n        public long[] NpivPortWorldWideName { get; set; }\n\n        public string NpivWorldWideNameType { get; set; }\n\n        public short? NpivDesiredNodeWwns { get; set; }\n\n        public short? NpivDesiredPortWwns { get; set; }\n\n        public bool? NpivTemporaryDisabled { get; set; }\n\n        public bool? NpivOnNonRdmDisks { get; set; }\n\n        public string LocationId { get; set; }\n\n        public bool Template { get; set; }\n\n        public string GuestId { get; set; }\n\n        public string AlternateGuestName { get; set; }\n\n        public string Annotation { get; set; }\n\n        public VirtualMachineFileInfo Files { get; set; }\n\n        public ToolsConfigInfo Tools { get; set; }\n\n        public VirtualMachineFlagInfo Flags { get; set; }\n\n        public VirtualMachineConsolePreferences ConsolePreferences { get; set; }\n\n        public VirtualMachineDefaultPowerOpInfo DefaultPowerOps { get; set; }\n\n        public VirtualHardware Hardware { get; set; }\n\n        public ResourceAllocationInfo CpuAllocation { get; set; }\n\n        public ResourceAllocationInfo MemoryAllocation { get; set; }\n\n        public LatencySensitivity LatencySensitivity { get; set; }\n\n        public bool? MemoryHotAddEnabled { get; set; }\n\n        public bool? CpuHotAddEnabled { get; set; }\n\n        public bool? CpuHotRemoveEnabled { get; set; }\n\n        public long? HotPlugMemoryLimit { get; set; }\n\n        public long? HotPlugMemoryIncrementSize { get; set; }\n\n        public VirtualMachineAffinityInfo CpuAffinity { get; set; }\n\n        public VirtualMachineAffinityInfo MemoryAffinity { get; set; }\n\n        public VirtualMachineNetworkShaperInfo NetworkShaper { get; set; }\n\n        public OptionValue[] ExtraConfig { get; set; }\n\n        public HostCpuIdInfo[] CpuFeatureMask { get; set; }\n\n        public VirtualMachineConfigInfoDatastoreUrlPair[] DatastoreUrl { get; set; }\n\n        public string SwapPlacement { get; set; }\n\n        public VirtualMachineBootOptions BootOptions { get; set; }\n\n        public FaultToleranceConfigInfo FtInfo { get; set; }\n\n        public ReplicationConfigSpec RepConfig { get; set; }\n\n        public VmConfigInfo VAppConfig { get; set; }\n\n        public bool? VAssertsEnabled { get; set; }\n\n        public bool? ChangeTrackingEnabled { get; set; }\n\n        public string Firmware { get; set; }\n\n        public int? MaxMksConnections { get; set; }\n\n        public bool? GuestAutoLockEnabled { get; set; }\n\n        public ManagedByInfo ManagedBy { get; set; }\n\n        public bool? MemoryReservationLockedToMax { get; set; }\n\n        public VirtualMachineConfigInfoOverheadInfo InitialOverhead { get; set; }\n\n        public bool? NestedHVEnabled { get; set; }\n\n        public bool? VPMCEnabled { get; set; }\n\n        public ScheduledHardwareUpgradeInfo ScheduledHardwareUpgradeInfo { get; set; }\n\n        public VirtualMachineForkConfigInfo ForkConfigInfo { get; set; }\n\n        public long? VFlashCacheReservation { get; set; }\n\n        public byte[] VmxConfigChecksum { get; set; }\n\n        public bool? MessageBusTunnelEnabled { get; set; }\n\n        public string VmStorageObjectId { get; set; }\n\n        public string SwapStorageObjectId { get; set; }\n\n        public CryptoKeyId KeyId { get; set; }\n\n        public VirtualMachineGuestIntegrityInfo GuestIntegrityInfo { get; set; }\n\n        public string MigrateEncryption { get; set; }\n\n        public bool Equals(VirtualMachineConfigInfo virtualMachineConfigInfo)\n        {\n            return (virtualMachineConfigInfo != null && this.ChangeVersion == virtualMachineConfigInfo.ChangeVersion && this.Modified == virtualMachineConfigInfo.Modified && this.Name == virtualMachineConfigInfo.Name && this.GuestFullName == virtualMachineConfigInfo.GuestFullName && this.Version == virtualMachineConfigInfo.Version && this.Uuid == virtualMachineConfigInfo.Uuid && ((this.CreateDate == null && virtualMachineConfigInfo.CreateDate == null) || (this.CreateDate != null && this.CreateDate.Equals(virtualMachineConfigInfo.CreateDate))) && this.InstanceUuid == virtualMachineConfigInfo.InstanceUuid && ((this.NpivNodeWorldWideName == null && virtualMachineConfigInfo.NpivNodeWorldWideName == null) || (this.NpivNodeWorldWideName != null && virtualMachineConfigInfo.NpivNodeWorldWideName != null && Enumerable.SequenceEqual(this.NpivNodeWorldWideName, virtualMachineConfigInfo.NpivNodeWorldWideName))) && ((this.NpivPortWorldWideName == null && virtualMachineConfigInfo.NpivPortWorldWideName == null) || (this.NpivPortWorldWideName != null && virtualMachineConfigInfo.NpivPortWorldWideName != null && Enumerable.SequenceEqual(this.NpivPortWorldWideName, virtualMachineConfigInfo.NpivPortWorldWideName))) && this.NpivWorldWideNameType == virtualMachineConfigInfo.NpivWorldWideNameType && ((this.NpivDesiredNodeWwns == null && virtualMachineConfigInfo.NpivDesiredNodeWwns == null) || (this.NpivDesiredNodeWwns != null && this.NpivDesiredNodeWwns.Equals(virtualMachineConfigInfo.NpivDesiredNodeWwns))) && ((this.NpivDesiredPortWwns == null && virtualMachineConfigInfo.NpivDesiredPortWwns == null) || (this.NpivDesiredPortWwns != null && this.NpivDesiredPortWwns.Equals(virtualMachineConfigInfo.NpivDesiredPortWwns))) && ((this.NpivTemporaryDisabled == null && virtualMachineConfigInfo.NpivTemporaryDisabled == null) || (this.NpivTemporaryDisabled != null && this.NpivTemporaryDisabled.Equals(virtualMachineConfigInfo.NpivTemporaryDisabled))) && ((this.NpivOnNonRdmDisks == null && virtualMachineConfigInfo.NpivOnNonRdmDisks == null) || (this.NpivOnNonRdmDisks != null && this.NpivOnNonRdmDisks.Equals(virtualMachineConfigInfo.NpivOnNonRdmDisks))) && this.LocationId == virtualMachineConfigInfo.LocationId && this.Template == virtualMachineConfigInfo.Template && this.GuestId == virtualMachineConfigInfo.GuestId && this.AlternateGuestName == virtualMachineConfigInfo.AlternateGuestName && this.Annotation == virtualMachineConfigInfo.Annotation && ((this.Files == null && virtualMachineConfigInfo.Files == null) || (this.Files != null && this.Files.Equals(virtualMachineConfigInfo.Files))) && ((this.Tools == null && virtualMachineConfigInfo.Tools == null) || (this.Tools != null && this.Tools.Equals(virtualMachineConfigInfo.Tools))) && ((this.Flags == null && virtualMachineConfigInfo.Flags == null) || (this.Flags != null && this.Flags.Equals(virtualMachineConfigInfo.Flags))) && ((this.ConsolePreferences == null && virtualMachineConfigInfo.ConsolePreferences == null) || (this.ConsolePreferences != null && this.ConsolePreferences.Equals(virtualMachineConfigInfo.ConsolePreferences))) && ((this.DefaultPowerOps == null && virtualMachineConfigInfo.DefaultPowerOps == null) || (this.DefaultPowerOps != null && this.DefaultPowerOps.Equals(virtualMachineConfigInfo.DefaultPowerOps))) && ((this.Hardware == null && virtualMachineConfigInfo.Hardware == null) || (this.Hardware != null && this.Hardware.Equals(virtualMachineConfigInfo.Hardware))) && ((this.CpuAllocation == null && virtualMachineConfigInfo.CpuAllocation == null) || (this.CpuAllocation != null && this.CpuAllocation.Equals(virtualMachineConfigInfo.CpuAllocation))) && ((this.MemoryAllocation == null && virtualMachineConfigInfo.MemoryAllocation == null) || (this.MemoryAllocation != null && this.MemoryAllocation.Equals(virtualMachineConfigInfo.MemoryAllocation))) && ((this.LatencySensitivity == null && virtualMachineConfigInfo.LatencySensitivity == null) || (this.LatencySensitivity != null && this.LatencySensitivity.Equals(virtualMachineConfigInfo.LatencySensitivity))) && ((this.MemoryHotAddEnabled == null && virtualMachineConfigInfo.MemoryHotAddEnabled == null) || (this.MemoryHotAddEnabled != null && this.MemoryHotAddEnabled.Equals(virtualMachineConfigInfo.MemoryHotAddEnabled))) && ((this.CpuHotAddEnabled == null && virtualMachineConfigInfo.CpuHotAddEnabled == null) || (this.CpuHotAddEnabled != null && this.CpuHotAddEnabled.Equals(virtualMachineConfigInfo.CpuHotAddEnabled))) && ((this.CpuHotRemoveEnabled == null && virtualMachineConfigInfo.CpuHotRemoveEnabled == null) || (this.CpuHotRemoveEnabled != null && this.CpuHotRemoveEnabled.Equals(virtualMachineConfigInfo.CpuHotRemoveEnabled))) && ((this.HotPlugMemoryLimit == null && virtualMachineConfigInfo.HotPlugMemoryLimit == null) || (this.HotPlugMemoryLimit != null && this.HotPlugMemoryLimit.Equals(virtualMachineConfigInfo.HotPlugMemoryLimit))) && ((this.HotPlugMemoryIncrementSize == null && virtualMachineConfigInfo.HotPlugMemoryIncrementSize == null) || (this.HotPlugMemoryIncrementSize != null && this.HotPlugMemoryIncrementSize.Equals(virtualMachineConfigInfo.HotPlugMemoryIncrementSize))) && ((this.CpuAffinity == null && virtualMachineConfigInfo.CpuAffinity == null) || (this.CpuAffinity != null && this.CpuAffinity.Equals(virtualMachineConfigInfo.CpuAffinity))) && ((this.MemoryAffinity == null && virtualMachineConfigInfo.MemoryAffinity == null) || (this.MemoryAffinity != null && this.MemoryAffinity.Equals(virtualMachineConfigInfo.MemoryAffinity))) && ((this.NetworkShaper == null && virtualMachineConfigInfo.NetworkShaper == null) || (this.NetworkShaper != null && this.NetworkShaper.Equals(virtualMachineConfigInfo.NetworkShaper))) && ((this.ExtraConfig == null && virtualMachineConfigInfo.ExtraConfig == null) || (this.ExtraConfig != null && virtualMachineConfigInfo.ExtraConfig != null && Enumerable.SequenceEqual(this.ExtraConfig, virtualMachineConfigInfo.ExtraConfig))) && ((this.CpuFeatureMask == null && virtualMachineConfigInfo.CpuFeatureMask == null) || (this.CpuFeatureMask != null && virtualMachineConfigInfo.CpuFeatureMask != null && Enumerable.SequenceEqual(this.CpuFeatureMask, virtualMachineConfigInfo.CpuFeatureMask))) && ((this.DatastoreUrl == null && virtualMachineConfigInfo.DatastoreUrl == null) || (this.DatastoreUrl != null && virtualMachineConfigInfo.DatastoreUrl != null && Enumerable.SequenceEqual(this.DatastoreUrl, virtualMachineConfigInfo.DatastoreUrl))) && this.SwapPlacement == virtualMachineConfigInfo.SwapPlacement && ((this.BootOptions == null && virtualMachineConfigInfo.BootOptions == null) || (this.BootOptions != null && this.BootOptions.Equals(virtualMachineConfigInfo.BootOptions))) && ((this.FtInfo == null && virtualMachineConfigInfo.FtInfo == null) || (this.FtInfo != null && this.FtInfo.Equals(virtualMachineConfigInfo.FtInfo))) && ((this.RepConfig == null && virtualMachineConfigInfo.RepConfig == null) || (this.RepConfig != null && this.RepConfig.Equals(virtualMachineConfigInfo.RepConfig))) && ((this.VAppConfig == null && virtualMachineConfigInfo.VAppConfig == null) || (this.VAppConfig != null && this.VAppConfig.Equals(virtualMachineConfigInfo.VAppConfig))) && ((this.VAssertsEnabled == null && virtualMachineConfigInfo.VAssertsEnabled == null) || (this.VAssertsEnabled != null && this.VAssertsEnabled.Equals(virtualMachineConfigInfo.VAssertsEnabled))) && ((this.ChangeTrackingEnabled == null && virtualMachineConfigInfo.ChangeTrackingEnabled == null) || (this.ChangeTrackingEnabled != null && this.ChangeTrackingEnabled.Equals(virtualMachineConfigInfo.ChangeTrackingEnabled))) && this.Firmware == virtualMachineConfigInfo.Firmware && ((this.MaxMksConnections == null && virtualMachineConfigInfo.MaxMksConnections == null) || (this.MaxMksConnections != null && this.MaxMksConnections.Equals(virtualMachineConfigInfo.MaxMksConnections))) && ((this.GuestAutoLockEnabled == null && virtualMachineConfigInfo.GuestAutoLockEnabled == null) || (this.GuestAutoLockEnabled != null && this.GuestAutoLockEnabled.Equals(virtualMachineConfigInfo.GuestAutoLockEnabled))) && ((this.ManagedBy == null && virtualMachineConfigInfo.ManagedBy == null) || (this.ManagedBy != null && this.ManagedBy.Equals(virtualMachineConfigInfo.ManagedBy))) && ((this.MemoryReservationLockedToMax == null && virtualMachineConfigInfo.MemoryReservationLockedToMax == null) || (this.MemoryReservationLockedToMax != null && this.MemoryReservationLockedToMax.Equals(virtualMachineConfigInfo.MemoryReservationLockedToMax))) && ((this.InitialOverhead == null && virtualMachineConfigInfo.InitialOverhead == null) || (this.InitialOverhead != null && this.InitialOverhead.Equals(virtualMachineConfigInfo.InitialOverhead))) && ((this.NestedHVEnabled == null && virtualMachineConfigInfo.NestedHVEnabled == null) || (this.NestedHVEnabled != null && this.NestedHVEnabled.Equals(virtualMachineConfigInfo.NestedHVEnabled))) && ((this.VPMCEnabled == null && virtualMachineConfigInfo.VPMCEnabled == null) || (this.VPMCEnabled != null && this.VPMCEnabled.Equals(virtualMachineConfigInfo.VPMCEnabled))) && ((this.ScheduledHardwareUpgradeInfo == null && virtualMachineConfigInfo.ScheduledHardwareUpgradeInfo == null) || (this.ScheduledHardwareUpgradeInfo != null && this.ScheduledHardwareUpgradeInfo.Equals(virtualMachineConfigInfo.ScheduledHardwareUpgradeInfo))) && ((this.ForkConfigInfo == null && virtualMachineConfigInfo.ForkConfigInfo == null) || (this.ForkConfigInfo != null && this.ForkConfigInfo.Equals(virtualMachineConfigInfo.ForkConfigInfo))) && ((this.VFlashCacheReservation == null && virtualMachineConfigInfo.VFlashCacheReservation == null) || (this.VFlashCacheReservation != null && this.VFlashCacheReservation.Equals(virtualMachineConfigInfo.VFlashCacheReservation))) && ((this.VmxConfigChecksum == null && virtualMachineConfigInfo.VmxConfigChecksum == null) || (this.VmxConfigChecksum != null && virtualMachineConfigInfo.VmxConfigChecksum != null && Enumerable.SequenceEqual(this.VmxConfigChecksum, virtualMachineConfigInfo.VmxConfigChecksum))) && ((this.MessageBusTunnelEnabled == null && virtualMachineConfigInfo.MessageBusTunnelEnabled == null) || (this.MessageBusTunnelEnabled != null && this.MessageBusTunnelEnabled.Equals(virtualMachineConfigInfo.MessageBusTunnelEnabled))) && this.VmStorageObjectId == virtualMachineConfigInfo.VmStorageObjectId && this.SwapStorageObjectId == virtualMachineConfigInfo.SwapStorageObjectId && ((this.KeyId == null && virtualMachineConfigInfo.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(virtualMachineConfigInfo.KeyId))) && ((this.GuestIntegrityInfo == null && virtualMachineConfigInfo.GuestIntegrityInfo == null) || (this.GuestIntegrityInfo != null && this.GuestIntegrityInfo.Equals(virtualMachineConfigInfo.GuestIntegrityInfo))) && this.MigrateEncryption == virtualMachineConfigInfo.MigrateEncryption);\n        }\n\n        public override bool Equals(object virtualMachineConfigInfo)\n        {\n            return Equals(virtualMachineConfigInfo as VirtualMachineConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeVersion + \"_\" + Modified + \"_\" + Name + \"_\" + GuestFullName + \"_\" + Version + \"_\" + Uuid + \"_\" + CreateDate + \"_\" + InstanceUuid + \"_\" + NpivNodeWorldWideName + \"_\" + NpivPortWorldWideName + \"_\" + NpivWorldWideNameType + \"_\" + NpivDesiredNodeWwns + \"_\" + NpivDesiredPortWwns + \"_\" + NpivTemporaryDisabled + \"_\" + NpivOnNonRdmDisks + \"_\" + LocationId + \"_\" + Template + \"_\" + GuestId + \"_\" + AlternateGuestName + \"_\" + Annotation + \"_\" + Files + \"_\" + Tools + \"_\" + Flags + \"_\" + ConsolePreferences + \"_\" + DefaultPowerOps + \"_\" + Hardware + \"_\" + CpuAllocation + \"_\" + MemoryAllocation + \"_\" + LatencySensitivity + \"_\" + MemoryHotAddEnabled + \"_\" + CpuHotAddEnabled + \"_\" + CpuHotRemoveEnabled + \"_\" + HotPlugMemoryLimit + \"_\" + HotPlugMemoryIncrementSize + \"_\" + CpuAffinity + \"_\" + MemoryAffinity + \"_\" + NetworkShaper + \"_\" + ExtraConfig + \"_\" + CpuFeatureMask + \"_\" + DatastoreUrl + \"_\" + SwapPlacement + \"_\" + BootOptions + \"_\" + FtInfo + \"_\" + RepConfig + \"_\" + VAppConfig + \"_\" + VAssertsEnabled + \"_\" + ChangeTrackingEnabled + \"_\" + Firmware + \"_\" + MaxMksConnections + \"_\" + GuestAutoLockEnabled + \"_\" + ManagedBy + \"_\" + MemoryReservationLockedToMax + \"_\" + InitialOverhead + \"_\" + NestedHVEnabled + \"_\" + VPMCEnabled + \"_\" + ScheduledHardwareUpgradeInfo + \"_\" + ForkConfigInfo + \"_\" + VFlashCacheReservation + \"_\" + VmxConfigChecksum + \"_\" + MessageBusTunnelEnabled + \"_\" + VmStorageObjectId + \"_\" + SwapStorageObjectId + \"_\" + KeyId + \"_\" + GuestIntegrityInfo + \"_\" + MigrateEncryption).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigInfoDatastoreUrlPair : DynamicData, IEquatable<VirtualMachineConfigInfoDatastoreUrlPair>\n    {\n        public string Name { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(VirtualMachineConfigInfoDatastoreUrlPair virtualMachineConfigInfoDatastoreUrlPair)\n        {\n            return (virtualMachineConfigInfoDatastoreUrlPair != null && this.Name == virtualMachineConfigInfoDatastoreUrlPair.Name && this.Url == virtualMachineConfigInfoDatastoreUrlPair.Url);\n        }\n\n        public override bool Equals(object virtualMachineConfigInfoDatastoreUrlPair)\n        {\n            return Equals(virtualMachineConfigInfoDatastoreUrlPair as VirtualMachineConfigInfoDatastoreUrlPair);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigInfoOverheadInfo : DynamicData, IEquatable<VirtualMachineConfigInfoOverheadInfo>\n    {\n        public long? InitialMemoryReservation { get; set; }\n\n        public long? InitialSwapReservation { get; set; }\n\n        public bool Equals(VirtualMachineConfigInfoOverheadInfo virtualMachineConfigInfoOverheadInfo)\n        {\n            return (virtualMachineConfigInfoOverheadInfo != null && ((this.InitialMemoryReservation == null && virtualMachineConfigInfoOverheadInfo.InitialMemoryReservation == null) || (this.InitialMemoryReservation != null && this.InitialMemoryReservation.Equals(virtualMachineConfigInfoOverheadInfo.InitialMemoryReservation))) && ((this.InitialSwapReservation == null && virtualMachineConfigInfoOverheadInfo.InitialSwapReservation == null) || (this.InitialSwapReservation != null && this.InitialSwapReservation.Equals(virtualMachineConfigInfoOverheadInfo.InitialSwapReservation))));\n        }\n\n        public override bool Equals(object virtualMachineConfigInfoOverheadInfo)\n        {\n            return Equals(virtualMachineConfigInfoOverheadInfo as VirtualMachineConfigInfoOverheadInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InitialMemoryReservation + \"_\" + InitialSwapReservation).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigOption : DynamicData, IEquatable<VirtualMachineConfigOption>\n    {\n        public string Version { get; set; }\n\n        public string Description { get; set; }\n\n        public GuestOsDescriptor[] GuestOSDescriptor { get; set; }\n\n        public int GuestOSDefaultIndex { get; set; }\n\n        public VirtualHardwareOption HardwareOptions { get; set; }\n\n        public VirtualMachineCapability Capabilities { get; set; }\n\n        public DatastoreOption Datastore { get; set; }\n\n        public VirtualDevice[] DefaultDevice { get; set; }\n\n        public string[] SupportedMonitorType { get; set; }\n\n        public string[] SupportedOvfEnvironmentTransport { get; set; }\n\n        public string[] SupportedOvfInstallTransport { get; set; }\n\n        public VirtualMachinePropertyRelation[] PropertyRelations { get; set; }\n\n        public bool Equals(VirtualMachineConfigOption virtualMachineConfigOption)\n        {\n            return (virtualMachineConfigOption != null && this.Version == virtualMachineConfigOption.Version && this.Description == virtualMachineConfigOption.Description && ((this.GuestOSDescriptor == null && virtualMachineConfigOption.GuestOSDescriptor == null) || (this.GuestOSDescriptor != null && virtualMachineConfigOption.GuestOSDescriptor != null && Enumerable.SequenceEqual(this.GuestOSDescriptor, virtualMachineConfigOption.GuestOSDescriptor))) && this.GuestOSDefaultIndex == virtualMachineConfigOption.GuestOSDefaultIndex && ((this.HardwareOptions == null && virtualMachineConfigOption.HardwareOptions == null) || (this.HardwareOptions != null && this.HardwareOptions.Equals(virtualMachineConfigOption.HardwareOptions))) && ((this.Capabilities == null && virtualMachineConfigOption.Capabilities == null) || (this.Capabilities != null && this.Capabilities.Equals(virtualMachineConfigOption.Capabilities))) && ((this.Datastore == null && virtualMachineConfigOption.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineConfigOption.Datastore))) && ((this.DefaultDevice == null && virtualMachineConfigOption.DefaultDevice == null) || (this.DefaultDevice != null && virtualMachineConfigOption.DefaultDevice != null && Enumerable.SequenceEqual(this.DefaultDevice, virtualMachineConfigOption.DefaultDevice))) && ((this.SupportedMonitorType == null && virtualMachineConfigOption.SupportedMonitorType == null) || (this.SupportedMonitorType != null && virtualMachineConfigOption.SupportedMonitorType != null && Enumerable.SequenceEqual(this.SupportedMonitorType, virtualMachineConfigOption.SupportedMonitorType))) && ((this.SupportedOvfEnvironmentTransport == null && virtualMachineConfigOption.SupportedOvfEnvironmentTransport == null) || (this.SupportedOvfEnvironmentTransport != null && virtualMachineConfigOption.SupportedOvfEnvironmentTransport != null && Enumerable.SequenceEqual(this.SupportedOvfEnvironmentTransport, virtualMachineConfigOption.SupportedOvfEnvironmentTransport))) && ((this.SupportedOvfInstallTransport == null && virtualMachineConfigOption.SupportedOvfInstallTransport == null) || (this.SupportedOvfInstallTransport != null && virtualMachineConfigOption.SupportedOvfInstallTransport != null && Enumerable.SequenceEqual(this.SupportedOvfInstallTransport, virtualMachineConfigOption.SupportedOvfInstallTransport))) && ((this.PropertyRelations == null && virtualMachineConfigOption.PropertyRelations == null) || (this.PropertyRelations != null && virtualMachineConfigOption.PropertyRelations != null && Enumerable.SequenceEqual(this.PropertyRelations, virtualMachineConfigOption.PropertyRelations))));\n        }\n\n        public override bool Equals(object virtualMachineConfigOption)\n        {\n            return Equals(virtualMachineConfigOption as VirtualMachineConfigOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version + \"_\" + Description + \"_\" + GuestOSDescriptor + \"_\" + GuestOSDefaultIndex + \"_\" + HardwareOptions + \"_\" + Capabilities + \"_\" + Datastore + \"_\" + DefaultDevice + \"_\" + SupportedMonitorType + \"_\" + SupportedOvfEnvironmentTransport + \"_\" + SupportedOvfInstallTransport + \"_\" + PropertyRelations).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigOptionDescriptor : DynamicData, IEquatable<VirtualMachineConfigOptionDescriptor>\n    {\n        public string Key { get; set; }\n\n        public string Description { get; set; }\n\n        public ManagedObjectReference[] Host { get; set; }\n\n        public bool CreateSupported { get; set; }\n\n        public bool DefaultConfigOption { get; set; }\n\n        public bool RunSupported { get; set; }\n\n        public bool UpgradeSupported { get; set; }\n\n        public VirtualMachineConfigOptionDescriptor_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineConfigOptionDescriptor virtualMachineConfigOptionDescriptor)\n        {\n            return (virtualMachineConfigOptionDescriptor != null && this.Key == virtualMachineConfigOptionDescriptor.Key && this.Description == virtualMachineConfigOptionDescriptor.Description && ((this.Host == null && virtualMachineConfigOptionDescriptor.Host == null) || (this.Host != null && virtualMachineConfigOptionDescriptor.Host != null && Enumerable.SequenceEqual(this.Host, virtualMachineConfigOptionDescriptor.Host))) && this.CreateSupported == virtualMachineConfigOptionDescriptor.CreateSupported && this.DefaultConfigOption == virtualMachineConfigOptionDescriptor.DefaultConfigOption && this.RunSupported == virtualMachineConfigOptionDescriptor.RunSupported && this.UpgradeSupported == virtualMachineConfigOptionDescriptor.UpgradeSupported && ((this.LinkedView == null && virtualMachineConfigOptionDescriptor.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineConfigOptionDescriptor.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineConfigOptionDescriptor)\n        {\n            return Equals(virtualMachineConfigOptionDescriptor as VirtualMachineConfigOptionDescriptor);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Description + \"_\" + Host + \"_\" + CreateSupported + \"_\" + DefaultConfigOption + \"_\" + RunSupported + \"_\" + UpgradeSupported + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigOptionDescriptor_LinkedView : IEquatable<VirtualMachineConfigOptionDescriptor_LinkedView>\n    {\n        public HostSystem[] Host { get; set; }\n\n        public bool Equals(VirtualMachineConfigOptionDescriptor_LinkedView virtualMachineConfigOptionDescriptor_LinkedView)\n        {\n            return (virtualMachineConfigOptionDescriptor_LinkedView != null && ((this.Host == null && virtualMachineConfigOptionDescriptor_LinkedView.Host == null) || (this.Host != null && virtualMachineConfigOptionDescriptor_LinkedView.Host != null && Enumerable.SequenceEqual(this.Host, virtualMachineConfigOptionDescriptor_LinkedView.Host))));\n        }\n\n        public override bool Equals(object virtualMachineConfigOptionDescriptor_LinkedView)\n        {\n            return Equals(virtualMachineConfigOptionDescriptor_LinkedView as VirtualMachineConfigOptionDescriptor_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigSpec : DynamicData, IEquatable<VirtualMachineConfigSpec>\n    {\n        public string ChangeVersion { get; set; }\n\n        public string Name { get; set; }\n\n        public string Version { get; set; }\n\n        public DateTime? CreateDate { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public long[] NpivNodeWorldWideName { get; set; }\n\n        public long[] NpivPortWorldWideName { get; set; }\n\n        public string NpivWorldWideNameType { get; set; }\n\n        public short? NpivDesiredNodeWwns { get; set; }\n\n        public short? NpivDesiredPortWwns { get; set; }\n\n        public bool? NpivTemporaryDisabled { get; set; }\n\n        public bool? NpivOnNonRdmDisks { get; set; }\n\n        public string NpivWorldWideNameOp { get; set; }\n\n        public string LocationId { get; set; }\n\n        public string GuestId { get; set; }\n\n        public string AlternateGuestName { get; set; }\n\n        public string Annotation { get; set; }\n\n        public VirtualMachineFileInfo Files { get; set; }\n\n        public ToolsConfigInfo Tools { get; set; }\n\n        public VirtualMachineFlagInfo Flags { get; set; }\n\n        public VirtualMachineConsolePreferences ConsolePreferences { get; set; }\n\n        public VirtualMachineDefaultPowerOpInfo PowerOpInfo { get; set; }\n\n        public int? NumCPUs { get; set; }\n\n        public int? NumCoresPerSocket { get; set; }\n\n        public long? MemoryMB { get; set; }\n\n        public bool? MemoryHotAddEnabled { get; set; }\n\n        public bool? CpuHotAddEnabled { get; set; }\n\n        public bool? CpuHotRemoveEnabled { get; set; }\n\n        public bool? VirtualICH7MPresent { get; set; }\n\n        public bool? VirtualSMCPresent { get; set; }\n\n        public VirtualDeviceConfigSpec[] DeviceChange { get; set; }\n\n        public ResourceAllocationInfo CpuAllocation { get; set; }\n\n        public ResourceAllocationInfo MemoryAllocation { get; set; }\n\n        public LatencySensitivity LatencySensitivity { get; set; }\n\n        public VirtualMachineAffinityInfo CpuAffinity { get; set; }\n\n        public VirtualMachineAffinityInfo MemoryAffinity { get; set; }\n\n        public VirtualMachineNetworkShaperInfo NetworkShaper { get; set; }\n\n        public VirtualMachineCpuIdInfoSpec[] CpuFeatureMask { get; set; }\n\n        public OptionValue[] ExtraConfig { get; set; }\n\n        public string SwapPlacement { get; set; }\n\n        public VirtualMachineBootOptions BootOptions { get; set; }\n\n        public VmConfigSpec VAppConfig { get; set; }\n\n        public FaultToleranceConfigInfo FtInfo { get; set; }\n\n        public ReplicationConfigSpec RepConfig { get; set; }\n\n        public bool? VAppConfigRemoved { get; set; }\n\n        public bool? VAssertsEnabled { get; set; }\n\n        public bool? ChangeTrackingEnabled { get; set; }\n\n        public string Firmware { get; set; }\n\n        public int? MaxMksConnections { get; set; }\n\n        public bool? GuestAutoLockEnabled { get; set; }\n\n        public ManagedByInfo ManagedBy { get; set; }\n\n        public bool? MemoryReservationLockedToMax { get; set; }\n\n        public bool? NestedHVEnabled { get; set; }\n\n        public bool? VPMCEnabled { get; set; }\n\n        public ScheduledHardwareUpgradeInfo ScheduledHardwareUpgradeInfo { get; set; }\n\n        public VirtualMachineProfileSpec[] VmProfile { get; set; }\n\n        public bool? MessageBusTunnelEnabled { get; set; }\n\n        public CryptoSpec Crypto { get; set; }\n\n        public string MigrateEncryption { get; set; }\n\n        public bool Equals(VirtualMachineConfigSpec virtualMachineConfigSpec)\n        {\n            return (virtualMachineConfigSpec != null && this.ChangeVersion == virtualMachineConfigSpec.ChangeVersion && this.Name == virtualMachineConfigSpec.Name && this.Version == virtualMachineConfigSpec.Version && ((this.CreateDate == null && virtualMachineConfigSpec.CreateDate == null) || (this.CreateDate != null && this.CreateDate.Equals(virtualMachineConfigSpec.CreateDate))) && this.Uuid == virtualMachineConfigSpec.Uuid && this.InstanceUuid == virtualMachineConfigSpec.InstanceUuid && ((this.NpivNodeWorldWideName == null && virtualMachineConfigSpec.NpivNodeWorldWideName == null) || (this.NpivNodeWorldWideName != null && virtualMachineConfigSpec.NpivNodeWorldWideName != null && Enumerable.SequenceEqual(this.NpivNodeWorldWideName, virtualMachineConfigSpec.NpivNodeWorldWideName))) && ((this.NpivPortWorldWideName == null && virtualMachineConfigSpec.NpivPortWorldWideName == null) || (this.NpivPortWorldWideName != null && virtualMachineConfigSpec.NpivPortWorldWideName != null && Enumerable.SequenceEqual(this.NpivPortWorldWideName, virtualMachineConfigSpec.NpivPortWorldWideName))) && this.NpivWorldWideNameType == virtualMachineConfigSpec.NpivWorldWideNameType && ((this.NpivDesiredNodeWwns == null && virtualMachineConfigSpec.NpivDesiredNodeWwns == null) || (this.NpivDesiredNodeWwns != null && this.NpivDesiredNodeWwns.Equals(virtualMachineConfigSpec.NpivDesiredNodeWwns))) && ((this.NpivDesiredPortWwns == null && virtualMachineConfigSpec.NpivDesiredPortWwns == null) || (this.NpivDesiredPortWwns != null && this.NpivDesiredPortWwns.Equals(virtualMachineConfigSpec.NpivDesiredPortWwns))) && ((this.NpivTemporaryDisabled == null && virtualMachineConfigSpec.NpivTemporaryDisabled == null) || (this.NpivTemporaryDisabled != null && this.NpivTemporaryDisabled.Equals(virtualMachineConfigSpec.NpivTemporaryDisabled))) && ((this.NpivOnNonRdmDisks == null && virtualMachineConfigSpec.NpivOnNonRdmDisks == null) || (this.NpivOnNonRdmDisks != null && this.NpivOnNonRdmDisks.Equals(virtualMachineConfigSpec.NpivOnNonRdmDisks))) && this.NpivWorldWideNameOp == virtualMachineConfigSpec.NpivWorldWideNameOp && this.LocationId == virtualMachineConfigSpec.LocationId && this.GuestId == virtualMachineConfigSpec.GuestId && this.AlternateGuestName == virtualMachineConfigSpec.AlternateGuestName && this.Annotation == virtualMachineConfigSpec.Annotation && ((this.Files == null && virtualMachineConfigSpec.Files == null) || (this.Files != null && this.Files.Equals(virtualMachineConfigSpec.Files))) && ((this.Tools == null && virtualMachineConfigSpec.Tools == null) || (this.Tools != null && this.Tools.Equals(virtualMachineConfigSpec.Tools))) && ((this.Flags == null && virtualMachineConfigSpec.Flags == null) || (this.Flags != null && this.Flags.Equals(virtualMachineConfigSpec.Flags))) && ((this.ConsolePreferences == null && virtualMachineConfigSpec.ConsolePreferences == null) || (this.ConsolePreferences != null && this.ConsolePreferences.Equals(virtualMachineConfigSpec.ConsolePreferences))) && ((this.PowerOpInfo == null && virtualMachineConfigSpec.PowerOpInfo == null) || (this.PowerOpInfo != null && this.PowerOpInfo.Equals(virtualMachineConfigSpec.PowerOpInfo))) && ((this.NumCPUs == null && virtualMachineConfigSpec.NumCPUs == null) || (this.NumCPUs != null && this.NumCPUs.Equals(virtualMachineConfigSpec.NumCPUs))) && ((this.NumCoresPerSocket == null && virtualMachineConfigSpec.NumCoresPerSocket == null) || (this.NumCoresPerSocket != null && this.NumCoresPerSocket.Equals(virtualMachineConfigSpec.NumCoresPerSocket))) && ((this.MemoryMB == null && virtualMachineConfigSpec.MemoryMB == null) || (this.MemoryMB != null && this.MemoryMB.Equals(virtualMachineConfigSpec.MemoryMB))) && ((this.MemoryHotAddEnabled == null && virtualMachineConfigSpec.MemoryHotAddEnabled == null) || (this.MemoryHotAddEnabled != null && this.MemoryHotAddEnabled.Equals(virtualMachineConfigSpec.MemoryHotAddEnabled))) && ((this.CpuHotAddEnabled == null && virtualMachineConfigSpec.CpuHotAddEnabled == null) || (this.CpuHotAddEnabled != null && this.CpuHotAddEnabled.Equals(virtualMachineConfigSpec.CpuHotAddEnabled))) && ((this.CpuHotRemoveEnabled == null && virtualMachineConfigSpec.CpuHotRemoveEnabled == null) || (this.CpuHotRemoveEnabled != null && this.CpuHotRemoveEnabled.Equals(virtualMachineConfigSpec.CpuHotRemoveEnabled))) && ((this.VirtualICH7MPresent == null && virtualMachineConfigSpec.VirtualICH7MPresent == null) || (this.VirtualICH7MPresent != null && this.VirtualICH7MPresent.Equals(virtualMachineConfigSpec.VirtualICH7MPresent))) && ((this.VirtualSMCPresent == null && virtualMachineConfigSpec.VirtualSMCPresent == null) || (this.VirtualSMCPresent != null && this.VirtualSMCPresent.Equals(virtualMachineConfigSpec.VirtualSMCPresent))) && ((this.DeviceChange == null && virtualMachineConfigSpec.DeviceChange == null) || (this.DeviceChange != null && virtualMachineConfigSpec.DeviceChange != null && Enumerable.SequenceEqual(this.DeviceChange, virtualMachineConfigSpec.DeviceChange))) && ((this.CpuAllocation == null && virtualMachineConfigSpec.CpuAllocation == null) || (this.CpuAllocation != null && this.CpuAllocation.Equals(virtualMachineConfigSpec.CpuAllocation))) && ((this.MemoryAllocation == null && virtualMachineConfigSpec.MemoryAllocation == null) || (this.MemoryAllocation != null && this.MemoryAllocation.Equals(virtualMachineConfigSpec.MemoryAllocation))) && ((this.LatencySensitivity == null && virtualMachineConfigSpec.LatencySensitivity == null) || (this.LatencySensitivity != null && this.LatencySensitivity.Equals(virtualMachineConfigSpec.LatencySensitivity))) && ((this.CpuAffinity == null && virtualMachineConfigSpec.CpuAffinity == null) || (this.CpuAffinity != null && this.CpuAffinity.Equals(virtualMachineConfigSpec.CpuAffinity))) && ((this.MemoryAffinity == null && virtualMachineConfigSpec.MemoryAffinity == null) || (this.MemoryAffinity != null && this.MemoryAffinity.Equals(virtualMachineConfigSpec.MemoryAffinity))) && ((this.NetworkShaper == null && virtualMachineConfigSpec.NetworkShaper == null) || (this.NetworkShaper != null && this.NetworkShaper.Equals(virtualMachineConfigSpec.NetworkShaper))) && ((this.CpuFeatureMask == null && virtualMachineConfigSpec.CpuFeatureMask == null) || (this.CpuFeatureMask != null && virtualMachineConfigSpec.CpuFeatureMask != null && Enumerable.SequenceEqual(this.CpuFeatureMask, virtualMachineConfigSpec.CpuFeatureMask))) && ((this.ExtraConfig == null && virtualMachineConfigSpec.ExtraConfig == null) || (this.ExtraConfig != null && virtualMachineConfigSpec.ExtraConfig != null && Enumerable.SequenceEqual(this.ExtraConfig, virtualMachineConfigSpec.ExtraConfig))) && this.SwapPlacement == virtualMachineConfigSpec.SwapPlacement && ((this.BootOptions == null && virtualMachineConfigSpec.BootOptions == null) || (this.BootOptions != null && this.BootOptions.Equals(virtualMachineConfigSpec.BootOptions))) && ((this.VAppConfig == null && virtualMachineConfigSpec.VAppConfig == null) || (this.VAppConfig != null && this.VAppConfig.Equals(virtualMachineConfigSpec.VAppConfig))) && ((this.FtInfo == null && virtualMachineConfigSpec.FtInfo == null) || (this.FtInfo != null && this.FtInfo.Equals(virtualMachineConfigSpec.FtInfo))) && ((this.RepConfig == null && virtualMachineConfigSpec.RepConfig == null) || (this.RepConfig != null && this.RepConfig.Equals(virtualMachineConfigSpec.RepConfig))) && ((this.VAppConfigRemoved == null && virtualMachineConfigSpec.VAppConfigRemoved == null) || (this.VAppConfigRemoved != null && this.VAppConfigRemoved.Equals(virtualMachineConfigSpec.VAppConfigRemoved))) && ((this.VAssertsEnabled == null && virtualMachineConfigSpec.VAssertsEnabled == null) || (this.VAssertsEnabled != null && this.VAssertsEnabled.Equals(virtualMachineConfigSpec.VAssertsEnabled))) && ((this.ChangeTrackingEnabled == null && virtualMachineConfigSpec.ChangeTrackingEnabled == null) || (this.ChangeTrackingEnabled != null && this.ChangeTrackingEnabled.Equals(virtualMachineConfigSpec.ChangeTrackingEnabled))) && this.Firmware == virtualMachineConfigSpec.Firmware && ((this.MaxMksConnections == null && virtualMachineConfigSpec.MaxMksConnections == null) || (this.MaxMksConnections != null && this.MaxMksConnections.Equals(virtualMachineConfigSpec.MaxMksConnections))) && ((this.GuestAutoLockEnabled == null && virtualMachineConfigSpec.GuestAutoLockEnabled == null) || (this.GuestAutoLockEnabled != null && this.GuestAutoLockEnabled.Equals(virtualMachineConfigSpec.GuestAutoLockEnabled))) && ((this.ManagedBy == null && virtualMachineConfigSpec.ManagedBy == null) || (this.ManagedBy != null && this.ManagedBy.Equals(virtualMachineConfigSpec.ManagedBy))) && ((this.MemoryReservationLockedToMax == null && virtualMachineConfigSpec.MemoryReservationLockedToMax == null) || (this.MemoryReservationLockedToMax != null && this.MemoryReservationLockedToMax.Equals(virtualMachineConfigSpec.MemoryReservationLockedToMax))) && ((this.NestedHVEnabled == null && virtualMachineConfigSpec.NestedHVEnabled == null) || (this.NestedHVEnabled != null && this.NestedHVEnabled.Equals(virtualMachineConfigSpec.NestedHVEnabled))) && ((this.VPMCEnabled == null && virtualMachineConfigSpec.VPMCEnabled == null) || (this.VPMCEnabled != null && this.VPMCEnabled.Equals(virtualMachineConfigSpec.VPMCEnabled))) && ((this.ScheduledHardwareUpgradeInfo == null && virtualMachineConfigSpec.ScheduledHardwareUpgradeInfo == null) || (this.ScheduledHardwareUpgradeInfo != null && this.ScheduledHardwareUpgradeInfo.Equals(virtualMachineConfigSpec.ScheduledHardwareUpgradeInfo))) && ((this.VmProfile == null && virtualMachineConfigSpec.VmProfile == null) || (this.VmProfile != null && virtualMachineConfigSpec.VmProfile != null && Enumerable.SequenceEqual(this.VmProfile, virtualMachineConfigSpec.VmProfile))) && ((this.MessageBusTunnelEnabled == null && virtualMachineConfigSpec.MessageBusTunnelEnabled == null) || (this.MessageBusTunnelEnabled != null && this.MessageBusTunnelEnabled.Equals(virtualMachineConfigSpec.MessageBusTunnelEnabled))) && ((this.Crypto == null && virtualMachineConfigSpec.Crypto == null) || (this.Crypto != null && this.Crypto.Equals(virtualMachineConfigSpec.Crypto))) && this.MigrateEncryption == virtualMachineConfigSpec.MigrateEncryption);\n        }\n\n        public override bool Equals(object virtualMachineConfigSpec)\n        {\n            return Equals(virtualMachineConfigSpec as VirtualMachineConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeVersion + \"_\" + Name + \"_\" + Version + \"_\" + CreateDate + \"_\" + Uuid + \"_\" + InstanceUuid + \"_\" + NpivNodeWorldWideName + \"_\" + NpivPortWorldWideName + \"_\" + NpivWorldWideNameType + \"_\" + NpivDesiredNodeWwns + \"_\" + NpivDesiredPortWwns + \"_\" + NpivTemporaryDisabled + \"_\" + NpivOnNonRdmDisks + \"_\" + NpivWorldWideNameOp + \"_\" + LocationId + \"_\" + GuestId + \"_\" + AlternateGuestName + \"_\" + Annotation + \"_\" + Files + \"_\" + Tools + \"_\" + Flags + \"_\" + ConsolePreferences + \"_\" + PowerOpInfo + \"_\" + NumCPUs + \"_\" + NumCoresPerSocket + \"_\" + MemoryMB + \"_\" + MemoryHotAddEnabled + \"_\" + CpuHotAddEnabled + \"_\" + CpuHotRemoveEnabled + \"_\" + VirtualICH7MPresent + \"_\" + VirtualSMCPresent + \"_\" + DeviceChange + \"_\" + CpuAllocation + \"_\" + MemoryAllocation + \"_\" + LatencySensitivity + \"_\" + CpuAffinity + \"_\" + MemoryAffinity + \"_\" + NetworkShaper + \"_\" + CpuFeatureMask + \"_\" + ExtraConfig + \"_\" + SwapPlacement + \"_\" + BootOptions + \"_\" + VAppConfig + \"_\" + FtInfo + \"_\" + RepConfig + \"_\" + VAppConfigRemoved + \"_\" + VAssertsEnabled + \"_\" + ChangeTrackingEnabled + \"_\" + Firmware + \"_\" + MaxMksConnections + \"_\" + GuestAutoLockEnabled + \"_\" + ManagedBy + \"_\" + MemoryReservationLockedToMax + \"_\" + NestedHVEnabled + \"_\" + VPMCEnabled + \"_\" + ScheduledHardwareUpgradeInfo + \"_\" + VmProfile + \"_\" + MessageBusTunnelEnabled + \"_\" + Crypto + \"_\" + MigrateEncryption).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConfigSummary : DynamicData, IEquatable<VirtualMachineConfigSummary>\n    {\n        public string Name { get; set; }\n\n        public bool Template { get; set; }\n\n        public string VmPathName { get; set; }\n\n        public int? MemorySizeMB { get; set; }\n\n        public int? CpuReservation { get; set; }\n\n        public int? MemoryReservation { get; set; }\n\n        public int? NumCpu { get; set; }\n\n        public int? NumEthernetCards { get; set; }\n\n        public int? NumVirtualDisks { get; set; }\n\n        public string Uuid { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public string GuestId { get; set; }\n\n        public string GuestFullName { get; set; }\n\n        public string Annotation { get; set; }\n\n        public VAppProductInfo Product { get; set; }\n\n        public bool? InstallBootRequired { get; set; }\n\n        public FaultToleranceConfigInfo FtInfo { get; set; }\n\n        public ManagedByInfo ManagedBy { get; set; }\n\n        public bool? TpmPresent { get; set; }\n\n        public int? NumVmiopBackings { get; set; }\n\n        public bool Equals(VirtualMachineConfigSummary virtualMachineConfigSummary)\n        {\n            return (virtualMachineConfigSummary != null && this.Name == virtualMachineConfigSummary.Name && this.Template == virtualMachineConfigSummary.Template && this.VmPathName == virtualMachineConfigSummary.VmPathName && ((this.MemorySizeMB == null && virtualMachineConfigSummary.MemorySizeMB == null) || (this.MemorySizeMB != null && this.MemorySizeMB.Equals(virtualMachineConfigSummary.MemorySizeMB))) && ((this.CpuReservation == null && virtualMachineConfigSummary.CpuReservation == null) || (this.CpuReservation != null && this.CpuReservation.Equals(virtualMachineConfigSummary.CpuReservation))) && ((this.MemoryReservation == null && virtualMachineConfigSummary.MemoryReservation == null) || (this.MemoryReservation != null && this.MemoryReservation.Equals(virtualMachineConfigSummary.MemoryReservation))) && ((this.NumCpu == null && virtualMachineConfigSummary.NumCpu == null) || (this.NumCpu != null && this.NumCpu.Equals(virtualMachineConfigSummary.NumCpu))) && ((this.NumEthernetCards == null && virtualMachineConfigSummary.NumEthernetCards == null) || (this.NumEthernetCards != null && this.NumEthernetCards.Equals(virtualMachineConfigSummary.NumEthernetCards))) && ((this.NumVirtualDisks == null && virtualMachineConfigSummary.NumVirtualDisks == null) || (this.NumVirtualDisks != null && this.NumVirtualDisks.Equals(virtualMachineConfigSummary.NumVirtualDisks))) && this.Uuid == virtualMachineConfigSummary.Uuid && this.InstanceUuid == virtualMachineConfigSummary.InstanceUuid && this.GuestId == virtualMachineConfigSummary.GuestId && this.GuestFullName == virtualMachineConfigSummary.GuestFullName && this.Annotation == virtualMachineConfigSummary.Annotation && ((this.Product == null && virtualMachineConfigSummary.Product == null) || (this.Product != null && this.Product.Equals(virtualMachineConfigSummary.Product))) && ((this.InstallBootRequired == null && virtualMachineConfigSummary.InstallBootRequired == null) || (this.InstallBootRequired != null && this.InstallBootRequired.Equals(virtualMachineConfigSummary.InstallBootRequired))) && ((this.FtInfo == null && virtualMachineConfigSummary.FtInfo == null) || (this.FtInfo != null && this.FtInfo.Equals(virtualMachineConfigSummary.FtInfo))) && ((this.ManagedBy == null && virtualMachineConfigSummary.ManagedBy == null) || (this.ManagedBy != null && this.ManagedBy.Equals(virtualMachineConfigSummary.ManagedBy))) && ((this.TpmPresent == null && virtualMachineConfigSummary.TpmPresent == null) || (this.TpmPresent != null && this.TpmPresent.Equals(virtualMachineConfigSummary.TpmPresent))) && ((this.NumVmiopBackings == null && virtualMachineConfigSummary.NumVmiopBackings == null) || (this.NumVmiopBackings != null && this.NumVmiopBackings.Equals(virtualMachineConfigSummary.NumVmiopBackings))));\n        }\n\n        public override bool Equals(object virtualMachineConfigSummary)\n        {\n            return Equals(virtualMachineConfigSummary as VirtualMachineConfigSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Template + \"_\" + VmPathName + \"_\" + MemorySizeMB + \"_\" + CpuReservation + \"_\" + MemoryReservation + \"_\" + NumCpu + \"_\" + NumEthernetCards + \"_\" + NumVirtualDisks + \"_\" + Uuid + \"_\" + InstanceUuid + \"_\" + GuestId + \"_\" + GuestFullName + \"_\" + Annotation + \"_\" + Product + \"_\" + InstallBootRequired + \"_\" + FtInfo + \"_\" + ManagedBy + \"_\" + TpmPresent + \"_\" + NumVmiopBackings).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineConsolePreferences : DynamicData, IEquatable<VirtualMachineConsolePreferences>\n    {\n        public bool? PowerOnWhenOpened { get; set; }\n\n        public bool? EnterFullScreenOnPowerOn { get; set; }\n\n        public bool? CloseOnPowerOffOrSuspend { get; set; }\n\n        public bool Equals(VirtualMachineConsolePreferences virtualMachineConsolePreferences)\n        {\n            return (virtualMachineConsolePreferences != null && ((this.PowerOnWhenOpened == null && virtualMachineConsolePreferences.PowerOnWhenOpened == null) || (this.PowerOnWhenOpened != null && this.PowerOnWhenOpened.Equals(virtualMachineConsolePreferences.PowerOnWhenOpened))) && ((this.EnterFullScreenOnPowerOn == null && virtualMachineConsolePreferences.EnterFullScreenOnPowerOn == null) || (this.EnterFullScreenOnPowerOn != null && this.EnterFullScreenOnPowerOn.Equals(virtualMachineConsolePreferences.EnterFullScreenOnPowerOn))) && ((this.CloseOnPowerOffOrSuspend == null && virtualMachineConsolePreferences.CloseOnPowerOffOrSuspend == null) || (this.CloseOnPowerOffOrSuspend != null && this.CloseOnPowerOffOrSuspend.Equals(virtualMachineConsolePreferences.CloseOnPowerOffOrSuspend))));\n        }\n\n        public override bool Equals(object virtualMachineConsolePreferences)\n        {\n            return Equals(virtualMachineConsolePreferences as VirtualMachineConsolePreferences);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PowerOnWhenOpened + \"_\" + EnterFullScreenOnPowerOn + \"_\" + CloseOnPowerOffOrSuspend).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineCpuIdInfoSpec : ArrayUpdateSpec, IEquatable<VirtualMachineCpuIdInfoSpec>\n    {\n        public HostCpuIdInfo Info { get; set; }\n\n        public bool Equals(VirtualMachineCpuIdInfoSpec virtualMachineCpuIdInfoSpec)\n        {\n            return (virtualMachineCpuIdInfoSpec != null && ((this.Info == null && virtualMachineCpuIdInfoSpec.Info == null) || (this.Info != null && this.Info.Equals(virtualMachineCpuIdInfoSpec.Info))));\n        }\n\n        public override bool Equals(object virtualMachineCpuIdInfoSpec)\n        {\n            return Equals(virtualMachineCpuIdInfoSpec as VirtualMachineCpuIdInfoSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDatastoreInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineDatastoreInfo>\n    {\n        public DatastoreSummary Datastore { get; set; }\n\n        public DatastoreCapability Capability { get; set; }\n\n        public long MaxFileSize { get; set; }\n\n        public long? MaxVirtualDiskCapacity { get; set; }\n\n        public long? MaxPhysicalRDMFileSize { get; set; }\n\n        public long? MaxVirtualRDMFileSize { get; set; }\n\n        public string Mode { get; set; }\n\n        public string VStorageSupport { get; set; }\n\n        public bool Equals(VirtualMachineDatastoreInfo virtualMachineDatastoreInfo)\n        {\n            return (virtualMachineDatastoreInfo != null && ((this.Datastore == null && virtualMachineDatastoreInfo.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineDatastoreInfo.Datastore))) && ((this.Capability == null && virtualMachineDatastoreInfo.Capability == null) || (this.Capability != null && this.Capability.Equals(virtualMachineDatastoreInfo.Capability))) && this.MaxFileSize == virtualMachineDatastoreInfo.MaxFileSize && ((this.MaxVirtualDiskCapacity == null && virtualMachineDatastoreInfo.MaxVirtualDiskCapacity == null) || (this.MaxVirtualDiskCapacity != null && this.MaxVirtualDiskCapacity.Equals(virtualMachineDatastoreInfo.MaxVirtualDiskCapacity))) && ((this.MaxPhysicalRDMFileSize == null && virtualMachineDatastoreInfo.MaxPhysicalRDMFileSize == null) || (this.MaxPhysicalRDMFileSize != null && this.MaxPhysicalRDMFileSize.Equals(virtualMachineDatastoreInfo.MaxPhysicalRDMFileSize))) && ((this.MaxVirtualRDMFileSize == null && virtualMachineDatastoreInfo.MaxVirtualRDMFileSize == null) || (this.MaxVirtualRDMFileSize != null && this.MaxVirtualRDMFileSize.Equals(virtualMachineDatastoreInfo.MaxVirtualRDMFileSize))) && this.Mode == virtualMachineDatastoreInfo.Mode && this.VStorageSupport == virtualMachineDatastoreInfo.VStorageSupport);\n        }\n\n        public override bool Equals(object virtualMachineDatastoreInfo)\n        {\n            return Equals(virtualMachineDatastoreInfo as VirtualMachineDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Capability + \"_\" + MaxFileSize + \"_\" + MaxVirtualDiskCapacity + \"_\" + MaxPhysicalRDMFileSize + \"_\" + MaxVirtualRDMFileSize + \"_\" + Mode + \"_\" + VStorageSupport).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDatastoreVolumeOption : DynamicData, IEquatable<VirtualMachineDatastoreVolumeOption>\n    {\n        public string FileSystemType { get; set; }\n\n        public int? MajorVersion { get; set; }\n\n        public bool Equals(VirtualMachineDatastoreVolumeOption virtualMachineDatastoreVolumeOption)\n        {\n            return (virtualMachineDatastoreVolumeOption != null && this.FileSystemType == virtualMachineDatastoreVolumeOption.FileSystemType && ((this.MajorVersion == null && virtualMachineDatastoreVolumeOption.MajorVersion == null) || (this.MajorVersion != null && this.MajorVersion.Equals(virtualMachineDatastoreVolumeOption.MajorVersion))));\n        }\n\n        public override bool Equals(object virtualMachineDatastoreVolumeOption)\n        {\n            return Equals(virtualMachineDatastoreVolumeOption as VirtualMachineDatastoreVolumeOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileSystemType + \"_\" + MajorVersion).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDefaultPowerOpInfo : DynamicData, IEquatable<VirtualMachineDefaultPowerOpInfo>\n    {\n        public string PowerOffType { get; set; }\n\n        public string SuspendType { get; set; }\n\n        public string ResetType { get; set; }\n\n        public string DefaultPowerOffType { get; set; }\n\n        public string DefaultSuspendType { get; set; }\n\n        public string DefaultResetType { get; set; }\n\n        public string StandbyAction { get; set; }\n\n        public bool Equals(VirtualMachineDefaultPowerOpInfo virtualMachineDefaultPowerOpInfo)\n        {\n            return (virtualMachineDefaultPowerOpInfo != null && this.PowerOffType == virtualMachineDefaultPowerOpInfo.PowerOffType && this.SuspendType == virtualMachineDefaultPowerOpInfo.SuspendType && this.ResetType == virtualMachineDefaultPowerOpInfo.ResetType && this.DefaultPowerOffType == virtualMachineDefaultPowerOpInfo.DefaultPowerOffType && this.DefaultSuspendType == virtualMachineDefaultPowerOpInfo.DefaultSuspendType && this.DefaultResetType == virtualMachineDefaultPowerOpInfo.DefaultResetType && this.StandbyAction == virtualMachineDefaultPowerOpInfo.StandbyAction);\n        }\n\n        public override bool Equals(object virtualMachineDefaultPowerOpInfo)\n        {\n            return Equals(virtualMachineDefaultPowerOpInfo as VirtualMachineDefaultPowerOpInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PowerOffType + \"_\" + SuspendType + \"_\" + ResetType + \"_\" + DefaultPowerOffType + \"_\" + DefaultSuspendType + \"_\" + DefaultResetType + \"_\" + StandbyAction).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDefaultProfileSpec : VirtualMachineProfileSpec, IEquatable<VirtualMachineDefaultProfileSpec>\n    {\n        public bool Equals(VirtualMachineDefaultProfileSpec virtualMachineDefaultProfileSpec)\n        {\n            return (virtualMachineDefaultProfileSpec != null && base.Equals(virtualMachineDefaultProfileSpec));\n        }\n\n        public override bool Equals(object virtualMachineDefaultProfileSpec)\n        {\n            return Equals(virtualMachineDefaultProfileSpec as VirtualMachineDefaultProfileSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDefinedProfileSpec : VirtualMachineProfileSpec, IEquatable<VirtualMachineDefinedProfileSpec>\n    {\n        public string ProfileId { get; set; }\n\n        public ReplicationSpec ReplicationSpec { get; set; }\n\n        public VirtualMachineProfileRawData ProfileData { get; set; }\n\n        public KeyValue[] ProfileParams { get; set; }\n\n        public bool Equals(VirtualMachineDefinedProfileSpec virtualMachineDefinedProfileSpec)\n        {\n            return (virtualMachineDefinedProfileSpec != null && this.ProfileId == virtualMachineDefinedProfileSpec.ProfileId && ((this.ReplicationSpec == null && virtualMachineDefinedProfileSpec.ReplicationSpec == null) || (this.ReplicationSpec != null && this.ReplicationSpec.Equals(virtualMachineDefinedProfileSpec.ReplicationSpec))) && ((this.ProfileData == null && virtualMachineDefinedProfileSpec.ProfileData == null) || (this.ProfileData != null && this.ProfileData.Equals(virtualMachineDefinedProfileSpec.ProfileData))) && ((this.ProfileParams == null && virtualMachineDefinedProfileSpec.ProfileParams == null) || (this.ProfileParams != null && virtualMachineDefinedProfileSpec.ProfileParams != null && Enumerable.SequenceEqual(this.ProfileParams, virtualMachineDefinedProfileSpec.ProfileParams))));\n        }\n\n        public override bool Equals(object virtualMachineDefinedProfileSpec)\n        {\n            return Equals(virtualMachineDefinedProfileSpec as VirtualMachineDefinedProfileSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProfileId + \"_\" + ReplicationSpec + \"_\" + ProfileData + \"_\" + ProfileParams).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDeviceRuntimeInfo : DynamicData, IEquatable<VirtualMachineDeviceRuntimeInfo>\n    {\n        public VirtualMachineDeviceRuntimeInfoDeviceRuntimeState RuntimeState { get; set; }\n\n        public int Key { get; set; }\n\n        public bool Equals(VirtualMachineDeviceRuntimeInfo virtualMachineDeviceRuntimeInfo)\n        {\n            return (virtualMachineDeviceRuntimeInfo != null && ((this.RuntimeState == null && virtualMachineDeviceRuntimeInfo.RuntimeState == null) || (this.RuntimeState != null && this.RuntimeState.Equals(virtualMachineDeviceRuntimeInfo.RuntimeState))) && this.Key == virtualMachineDeviceRuntimeInfo.Key);\n        }\n\n        public override bool Equals(object virtualMachineDeviceRuntimeInfo)\n        {\n            return Equals(virtualMachineDeviceRuntimeInfo as VirtualMachineDeviceRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RuntimeState + \"_\" + Key).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDeviceRuntimeInfoDeviceRuntimeState : DynamicData, IEquatable<VirtualMachineDeviceRuntimeInfoDeviceRuntimeState>\n    {\n        public bool Equals(VirtualMachineDeviceRuntimeInfoDeviceRuntimeState virtualMachineDeviceRuntimeInfoDeviceRuntimeState)\n        {\n            return (virtualMachineDeviceRuntimeInfoDeviceRuntimeState != null && base.Equals(virtualMachineDeviceRuntimeInfoDeviceRuntimeState));\n        }\n\n        public override bool Equals(object virtualMachineDeviceRuntimeInfoDeviceRuntimeState)\n        {\n            return Equals(virtualMachineDeviceRuntimeInfoDeviceRuntimeState as VirtualMachineDeviceRuntimeInfoDeviceRuntimeState);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState : VirtualMachineDeviceRuntimeInfoDeviceRuntimeState, IEquatable<VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState>\n    {\n        public bool VmDirectPathGen2Active { get; set; }\n\n        public string[] VmDirectPathGen2InactiveReasonVm { get; set; }\n\n        public string[] VmDirectPathGen2InactiveReasonOther { get; set; }\n\n        public string VmDirectPathGen2InactiveReasonExtended { get; set; }\n\n        public string ReservationStatus { get; set; }\n\n        public string AttachmentStatus { get; set; }\n\n        public VirtualMachineFeatureRequirement[] FeatureRequirement { get; set; }\n\n        public bool Equals(VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState)\n        {\n            return (virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState != null && this.VmDirectPathGen2Active == virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2Active && ((this.VmDirectPathGen2InactiveReasonVm == null && virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonVm == null) || (this.VmDirectPathGen2InactiveReasonVm != null && virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonVm != null && Enumerable.SequenceEqual(this.VmDirectPathGen2InactiveReasonVm, virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonVm))) && ((this.VmDirectPathGen2InactiveReasonOther == null && virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonOther == null) || (this.VmDirectPathGen2InactiveReasonOther != null && virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonOther != null && Enumerable.SequenceEqual(this.VmDirectPathGen2InactiveReasonOther, virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonOther))) && this.VmDirectPathGen2InactiveReasonExtended == virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.VmDirectPathGen2InactiveReasonExtended && this.ReservationStatus == virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.ReservationStatus && this.AttachmentStatus == virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.AttachmentStatus && ((this.FeatureRequirement == null && virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.FeatureRequirement == null) || (this.FeatureRequirement != null && virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.FeatureRequirement != null && Enumerable.SequenceEqual(this.FeatureRequirement, virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState.FeatureRequirement))));\n        }\n\n        public override bool Equals(object virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState)\n        {\n            return Equals(virtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState as VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmDirectPathGen2Active + \"_\" + VmDirectPathGen2InactiveReasonVm + \"_\" + VmDirectPathGen2InactiveReasonOther + \"_\" + VmDirectPathGen2InactiveReasonExtended + \"_\" + ReservationStatus + \"_\" + AttachmentStatus + \"_\" + FeatureRequirement).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDiskDeviceInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineDiskDeviceInfo>\n    {\n        public long? Capacity { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public VirtualMachineDiskDeviceInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineDiskDeviceInfo virtualMachineDiskDeviceInfo)\n        {\n            return (virtualMachineDiskDeviceInfo != null && ((this.Capacity == null && virtualMachineDiskDeviceInfo.Capacity == null) || (this.Capacity != null && this.Capacity.Equals(virtualMachineDiskDeviceInfo.Capacity))) && ((this.Vm == null && virtualMachineDiskDeviceInfo.Vm == null) || (this.Vm != null && virtualMachineDiskDeviceInfo.Vm != null && Enumerable.SequenceEqual(this.Vm, virtualMachineDiskDeviceInfo.Vm))) && ((this.LinkedView == null && virtualMachineDiskDeviceInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineDiskDeviceInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineDiskDeviceInfo)\n        {\n            return Equals(virtualMachineDiskDeviceInfo as VirtualMachineDiskDeviceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Capacity + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDiskDeviceInfo_LinkedView : IEquatable<VirtualMachineDiskDeviceInfo_LinkedView>\n    {\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(VirtualMachineDiskDeviceInfo_LinkedView virtualMachineDiskDeviceInfo_LinkedView)\n        {\n            return (virtualMachineDiskDeviceInfo_LinkedView != null && ((this.Vm == null && virtualMachineDiskDeviceInfo_LinkedView.Vm == null) || (this.Vm != null && virtualMachineDiskDeviceInfo_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, virtualMachineDiskDeviceInfo_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object virtualMachineDiskDeviceInfo_LinkedView)\n        {\n            return Equals(virtualMachineDiskDeviceInfo_LinkedView as VirtualMachineDiskDeviceInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineDisplayTopology : DynamicData, IEquatable<VirtualMachineDisplayTopology>\n    {\n        public int X { get; set; }\n\n        public int Y { get; set; }\n\n        public int Width { get; set; }\n\n        public int Height { get; set; }\n\n        public bool Equals(VirtualMachineDisplayTopology virtualMachineDisplayTopology)\n        {\n            return (virtualMachineDisplayTopology != null && this.X == virtualMachineDisplayTopology.X && this.Y == virtualMachineDisplayTopology.Y && this.Width == virtualMachineDisplayTopology.Width && this.Height == virtualMachineDisplayTopology.Height);\n        }\n\n        public override bool Equals(object virtualMachineDisplayTopology)\n        {\n            return Equals(virtualMachineDisplayTopology as VirtualMachineDisplayTopology);\n        }\n\n        public override int GetHashCode()\n        {\n            return (X + \"_\" + Y + \"_\" + Width + \"_\" + Height).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineEmptyProfileSpec : VirtualMachineProfileSpec, IEquatable<VirtualMachineEmptyProfileSpec>\n    {\n        public bool Equals(VirtualMachineEmptyProfileSpec virtualMachineEmptyProfileSpec)\n        {\n            return (virtualMachineEmptyProfileSpec != null && base.Equals(virtualMachineEmptyProfileSpec));\n        }\n\n        public override bool Equals(object virtualMachineEmptyProfileSpec)\n        {\n            return Equals(virtualMachineEmptyProfileSpec as VirtualMachineEmptyProfileSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFeatureRequirement : DynamicData, IEquatable<VirtualMachineFeatureRequirement>\n    {\n        public string Key { get; set; }\n\n        public string FeatureName { get; set; }\n\n        public string Value { get; set; }\n\n        public bool Equals(VirtualMachineFeatureRequirement virtualMachineFeatureRequirement)\n        {\n            return (virtualMachineFeatureRequirement != null && this.Key == virtualMachineFeatureRequirement.Key && this.FeatureName == virtualMachineFeatureRequirement.FeatureName && this.Value == virtualMachineFeatureRequirement.Value);\n        }\n\n        public override bool Equals(object virtualMachineFeatureRequirement)\n        {\n            return Equals(virtualMachineFeatureRequirement as VirtualMachineFeatureRequirement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + FeatureName + \"_\" + Value).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileInfo : DynamicData, IEquatable<VirtualMachineFileInfo>\n    {\n        public string VmPathName { get; set; }\n\n        public string SnapshotDirectory { get; set; }\n\n        public string SuspendDirectory { get; set; }\n\n        public string LogDirectory { get; set; }\n\n        public string FtMetadataDirectory { get; set; }\n\n        public bool Equals(VirtualMachineFileInfo virtualMachineFileInfo)\n        {\n            return (virtualMachineFileInfo != null && this.VmPathName == virtualMachineFileInfo.VmPathName && this.SnapshotDirectory == virtualMachineFileInfo.SnapshotDirectory && this.SuspendDirectory == virtualMachineFileInfo.SuspendDirectory && this.LogDirectory == virtualMachineFileInfo.LogDirectory && this.FtMetadataDirectory == virtualMachineFileInfo.FtMetadataDirectory);\n        }\n\n        public override bool Equals(object virtualMachineFileInfo)\n        {\n            return Equals(virtualMachineFileInfo as VirtualMachineFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmPathName + \"_\" + SnapshotDirectory + \"_\" + SuspendDirectory + \"_\" + LogDirectory + \"_\" + FtMetadataDirectory).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayout : DynamicData, IEquatable<VirtualMachineFileLayout>\n    {\n        public string[] ConfigFile { get; set; }\n\n        public string[] LogFile { get; set; }\n\n        public VirtualMachineFileLayoutDiskLayout[] Disk { get; set; }\n\n        public VirtualMachineFileLayoutSnapshotLayout[] Snapshot { get; set; }\n\n        public string SwapFile { get; set; }\n\n        public bool Equals(VirtualMachineFileLayout virtualMachineFileLayout)\n        {\n            return (virtualMachineFileLayout != null && ((this.ConfigFile == null && virtualMachineFileLayout.ConfigFile == null) || (this.ConfigFile != null && virtualMachineFileLayout.ConfigFile != null && Enumerable.SequenceEqual(this.ConfigFile, virtualMachineFileLayout.ConfigFile))) && ((this.LogFile == null && virtualMachineFileLayout.LogFile == null) || (this.LogFile != null && virtualMachineFileLayout.LogFile != null && Enumerable.SequenceEqual(this.LogFile, virtualMachineFileLayout.LogFile))) && ((this.Disk == null && virtualMachineFileLayout.Disk == null) || (this.Disk != null && virtualMachineFileLayout.Disk != null && Enumerable.SequenceEqual(this.Disk, virtualMachineFileLayout.Disk))) && ((this.Snapshot == null && virtualMachineFileLayout.Snapshot == null) || (this.Snapshot != null && virtualMachineFileLayout.Snapshot != null && Enumerable.SequenceEqual(this.Snapshot, virtualMachineFileLayout.Snapshot))) && this.SwapFile == virtualMachineFileLayout.SwapFile);\n        }\n\n        public override bool Equals(object virtualMachineFileLayout)\n        {\n            return Equals(virtualMachineFileLayout as VirtualMachineFileLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigFile + \"_\" + LogFile + \"_\" + Disk + \"_\" + Snapshot + \"_\" + SwapFile).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutDiskLayout : DynamicData, IEquatable<VirtualMachineFileLayoutDiskLayout>\n    {\n        public int Key { get; set; }\n\n        public string[] DiskFile { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutDiskLayout virtualMachineFileLayoutDiskLayout)\n        {\n            return (virtualMachineFileLayoutDiskLayout != null && this.Key == virtualMachineFileLayoutDiskLayout.Key && ((this.DiskFile == null && virtualMachineFileLayoutDiskLayout.DiskFile == null) || (this.DiskFile != null && virtualMachineFileLayoutDiskLayout.DiskFile != null && Enumerable.SequenceEqual(this.DiskFile, virtualMachineFileLayoutDiskLayout.DiskFile))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutDiskLayout)\n        {\n            return Equals(virtualMachineFileLayoutDiskLayout as VirtualMachineFileLayoutDiskLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + DiskFile).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutEx : DynamicData, IEquatable<VirtualMachineFileLayoutEx>\n    {\n        public VirtualMachineFileLayoutExFileInfo[] File { get; set; }\n\n        public VirtualMachineFileLayoutExDiskLayout[] Disk { get; set; }\n\n        public VirtualMachineFileLayoutExSnapshotLayout[] Snapshot { get; set; }\n\n        public DateTime Timestamp { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutEx virtualMachineFileLayoutEx)\n        {\n            return (virtualMachineFileLayoutEx != null && ((this.File == null && virtualMachineFileLayoutEx.File == null) || (this.File != null && virtualMachineFileLayoutEx.File != null && Enumerable.SequenceEqual(this.File, virtualMachineFileLayoutEx.File))) && ((this.Disk == null && virtualMachineFileLayoutEx.Disk == null) || (this.Disk != null && virtualMachineFileLayoutEx.Disk != null && Enumerable.SequenceEqual(this.Disk, virtualMachineFileLayoutEx.Disk))) && ((this.Snapshot == null && virtualMachineFileLayoutEx.Snapshot == null) || (this.Snapshot != null && virtualMachineFileLayoutEx.Snapshot != null && Enumerable.SequenceEqual(this.Snapshot, virtualMachineFileLayoutEx.Snapshot))) && this.Timestamp == virtualMachineFileLayoutEx.Timestamp);\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutEx)\n        {\n            return Equals(virtualMachineFileLayoutEx as VirtualMachineFileLayoutEx);\n        }\n\n        public override int GetHashCode()\n        {\n            return (File + \"_\" + Disk + \"_\" + Snapshot + \"_\" + Timestamp).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutExDiskLayout : DynamicData, IEquatable<VirtualMachineFileLayoutExDiskLayout>\n    {\n        public int Key { get; set; }\n\n        public VirtualMachineFileLayoutExDiskUnit[] Chain { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutExDiskLayout virtualMachineFileLayoutExDiskLayout)\n        {\n            return (virtualMachineFileLayoutExDiskLayout != null && this.Key == virtualMachineFileLayoutExDiskLayout.Key && ((this.Chain == null && virtualMachineFileLayoutExDiskLayout.Chain == null) || (this.Chain != null && virtualMachineFileLayoutExDiskLayout.Chain != null && Enumerable.SequenceEqual(this.Chain, virtualMachineFileLayoutExDiskLayout.Chain))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutExDiskLayout)\n        {\n            return Equals(virtualMachineFileLayoutExDiskLayout as VirtualMachineFileLayoutExDiskLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Chain).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutExDiskUnit : DynamicData, IEquatable<VirtualMachineFileLayoutExDiskUnit>\n    {\n        public int[] FileKey { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutExDiskUnit virtualMachineFileLayoutExDiskUnit)\n        {\n            return (virtualMachineFileLayoutExDiskUnit != null && ((this.FileKey == null && virtualMachineFileLayoutExDiskUnit.FileKey == null) || (this.FileKey != null && virtualMachineFileLayoutExDiskUnit.FileKey != null && Enumerable.SequenceEqual(this.FileKey, virtualMachineFileLayoutExDiskUnit.FileKey))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutExDiskUnit)\n        {\n            return Equals(virtualMachineFileLayoutExDiskUnit as VirtualMachineFileLayoutExDiskUnit);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileKey).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutExFileInfo : DynamicData, IEquatable<VirtualMachineFileLayoutExFileInfo>\n    {\n        public int Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Type { get; set; }\n\n        public long Size { get; set; }\n\n        public long? UniqueSize { get; set; }\n\n        public string BackingObjectId { get; set; }\n\n        public bool? Accessible { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutExFileInfo virtualMachineFileLayoutExFileInfo)\n        {\n            return (virtualMachineFileLayoutExFileInfo != null && this.Key == virtualMachineFileLayoutExFileInfo.Key && this.Name == virtualMachineFileLayoutExFileInfo.Name && this.Type == virtualMachineFileLayoutExFileInfo.Type && this.Size == virtualMachineFileLayoutExFileInfo.Size && ((this.UniqueSize == null && virtualMachineFileLayoutExFileInfo.UniqueSize == null) || (this.UniqueSize != null && this.UniqueSize.Equals(virtualMachineFileLayoutExFileInfo.UniqueSize))) && this.BackingObjectId == virtualMachineFileLayoutExFileInfo.BackingObjectId && ((this.Accessible == null && virtualMachineFileLayoutExFileInfo.Accessible == null) || (this.Accessible != null && this.Accessible.Equals(virtualMachineFileLayoutExFileInfo.Accessible))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutExFileInfo)\n        {\n            return Equals(virtualMachineFileLayoutExFileInfo as VirtualMachineFileLayoutExFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Type + \"_\" + Size + \"_\" + UniqueSize + \"_\" + BackingObjectId + \"_\" + Accessible).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutExSnapshotLayout : DynamicData, IEquatable<VirtualMachineFileLayoutExSnapshotLayout>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public int DataKey { get; set; }\n\n        public int MemoryKey { get; set; }\n\n        public VirtualMachineFileLayoutExDiskLayout[] Disk { get; set; }\n\n        public VirtualMachineFileLayoutExSnapshotLayout_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutExSnapshotLayout virtualMachineFileLayoutExSnapshotLayout)\n        {\n            return (virtualMachineFileLayoutExSnapshotLayout != null && ((this.Key == null && virtualMachineFileLayoutExSnapshotLayout.Key == null) || (this.Key != null && this.Key.Equals(virtualMachineFileLayoutExSnapshotLayout.Key))) && this.DataKey == virtualMachineFileLayoutExSnapshotLayout.DataKey && this.MemoryKey == virtualMachineFileLayoutExSnapshotLayout.MemoryKey && ((this.Disk == null && virtualMachineFileLayoutExSnapshotLayout.Disk == null) || (this.Disk != null && virtualMachineFileLayoutExSnapshotLayout.Disk != null && Enumerable.SequenceEqual(this.Disk, virtualMachineFileLayoutExSnapshotLayout.Disk))) && ((this.LinkedView == null && virtualMachineFileLayoutExSnapshotLayout.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineFileLayoutExSnapshotLayout.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutExSnapshotLayout)\n        {\n            return Equals(virtualMachineFileLayoutExSnapshotLayout as VirtualMachineFileLayoutExSnapshotLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + DataKey + \"_\" + MemoryKey + \"_\" + Disk + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutExSnapshotLayout_LinkedView : IEquatable<VirtualMachineFileLayoutExSnapshotLayout_LinkedView>\n    {\n        public VirtualMachineSnapshot Key { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutExSnapshotLayout_LinkedView virtualMachineFileLayoutExSnapshotLayout_LinkedView)\n        {\n            return (virtualMachineFileLayoutExSnapshotLayout_LinkedView != null && ((this.Key == null && virtualMachineFileLayoutExSnapshotLayout_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(virtualMachineFileLayoutExSnapshotLayout_LinkedView.Key))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutExSnapshotLayout_LinkedView)\n        {\n            return Equals(virtualMachineFileLayoutExSnapshotLayout_LinkedView as VirtualMachineFileLayoutExSnapshotLayout_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutSnapshotLayout : DynamicData, IEquatable<VirtualMachineFileLayoutSnapshotLayout>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public string[] SnapshotFile { get; set; }\n\n        public VirtualMachineFileLayoutSnapshotLayout_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutSnapshotLayout virtualMachineFileLayoutSnapshotLayout)\n        {\n            return (virtualMachineFileLayoutSnapshotLayout != null && ((this.Key == null && virtualMachineFileLayoutSnapshotLayout.Key == null) || (this.Key != null && this.Key.Equals(virtualMachineFileLayoutSnapshotLayout.Key))) && ((this.SnapshotFile == null && virtualMachineFileLayoutSnapshotLayout.SnapshotFile == null) || (this.SnapshotFile != null && virtualMachineFileLayoutSnapshotLayout.SnapshotFile != null && Enumerable.SequenceEqual(this.SnapshotFile, virtualMachineFileLayoutSnapshotLayout.SnapshotFile))) && ((this.LinkedView == null && virtualMachineFileLayoutSnapshotLayout.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineFileLayoutSnapshotLayout.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutSnapshotLayout)\n        {\n            return Equals(virtualMachineFileLayoutSnapshotLayout as VirtualMachineFileLayoutSnapshotLayout);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + SnapshotFile + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFileLayoutSnapshotLayout_LinkedView : IEquatable<VirtualMachineFileLayoutSnapshotLayout_LinkedView>\n    {\n        public VirtualMachineSnapshot Key { get; set; }\n\n        public bool Equals(VirtualMachineFileLayoutSnapshotLayout_LinkedView virtualMachineFileLayoutSnapshotLayout_LinkedView)\n        {\n            return (virtualMachineFileLayoutSnapshotLayout_LinkedView != null && ((this.Key == null && virtualMachineFileLayoutSnapshotLayout_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(virtualMachineFileLayoutSnapshotLayout_LinkedView.Key))));\n        }\n\n        public override bool Equals(object virtualMachineFileLayoutSnapshotLayout_LinkedView)\n        {\n            return Equals(virtualMachineFileLayoutSnapshotLayout_LinkedView as VirtualMachineFileLayoutSnapshotLayout_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFlagInfo : DynamicData, IEquatable<VirtualMachineFlagInfo>\n    {\n        public bool? DisableAcceleration { get; set; }\n\n        public bool? EnableLogging { get; set; }\n\n        public bool? UseToe { get; set; }\n\n        public bool? RunWithDebugInfo { get; set; }\n\n        public string MonitorType { get; set; }\n\n        public string HtSharing { get; set; }\n\n        public bool? SnapshotDisabled { get; set; }\n\n        public bool? SnapshotLocked { get; set; }\n\n        public bool? DiskUuidEnabled { get; set; }\n\n        public string VirtualMmuUsage { get; set; }\n\n        public string VirtualExecUsage { get; set; }\n\n        public string SnapshotPowerOffBehavior { get; set; }\n\n        public bool? RecordReplayEnabled { get; set; }\n\n        public string FaultToleranceType { get; set; }\n\n        public bool? CbrcCacheEnabled { get; set; }\n\n        public bool? VvtdEnabled { get; set; }\n\n        public bool? VbsEnabled { get; set; }\n\n        public bool Equals(VirtualMachineFlagInfo virtualMachineFlagInfo)\n        {\n            return (virtualMachineFlagInfo != null && ((this.DisableAcceleration == null && virtualMachineFlagInfo.DisableAcceleration == null) || (this.DisableAcceleration != null && this.DisableAcceleration.Equals(virtualMachineFlagInfo.DisableAcceleration))) && ((this.EnableLogging == null && virtualMachineFlagInfo.EnableLogging == null) || (this.EnableLogging != null && this.EnableLogging.Equals(virtualMachineFlagInfo.EnableLogging))) && ((this.UseToe == null && virtualMachineFlagInfo.UseToe == null) || (this.UseToe != null && this.UseToe.Equals(virtualMachineFlagInfo.UseToe))) && ((this.RunWithDebugInfo == null && virtualMachineFlagInfo.RunWithDebugInfo == null) || (this.RunWithDebugInfo != null && this.RunWithDebugInfo.Equals(virtualMachineFlagInfo.RunWithDebugInfo))) && this.MonitorType == virtualMachineFlagInfo.MonitorType && this.HtSharing == virtualMachineFlagInfo.HtSharing && ((this.SnapshotDisabled == null && virtualMachineFlagInfo.SnapshotDisabled == null) || (this.SnapshotDisabled != null && this.SnapshotDisabled.Equals(virtualMachineFlagInfo.SnapshotDisabled))) && ((this.SnapshotLocked == null && virtualMachineFlagInfo.SnapshotLocked == null) || (this.SnapshotLocked != null && this.SnapshotLocked.Equals(virtualMachineFlagInfo.SnapshotLocked))) && ((this.DiskUuidEnabled == null && virtualMachineFlagInfo.DiskUuidEnabled == null) || (this.DiskUuidEnabled != null && this.DiskUuidEnabled.Equals(virtualMachineFlagInfo.DiskUuidEnabled))) && this.VirtualMmuUsage == virtualMachineFlagInfo.VirtualMmuUsage && this.VirtualExecUsage == virtualMachineFlagInfo.VirtualExecUsage && this.SnapshotPowerOffBehavior == virtualMachineFlagInfo.SnapshotPowerOffBehavior && ((this.RecordReplayEnabled == null && virtualMachineFlagInfo.RecordReplayEnabled == null) || (this.RecordReplayEnabled != null && this.RecordReplayEnabled.Equals(virtualMachineFlagInfo.RecordReplayEnabled))) && this.FaultToleranceType == virtualMachineFlagInfo.FaultToleranceType && ((this.CbrcCacheEnabled == null && virtualMachineFlagInfo.CbrcCacheEnabled == null) || (this.CbrcCacheEnabled != null && this.CbrcCacheEnabled.Equals(virtualMachineFlagInfo.CbrcCacheEnabled))) && ((this.VvtdEnabled == null && virtualMachineFlagInfo.VvtdEnabled == null) || (this.VvtdEnabled != null && this.VvtdEnabled.Equals(virtualMachineFlagInfo.VvtdEnabled))) && ((this.VbsEnabled == null && virtualMachineFlagInfo.VbsEnabled == null) || (this.VbsEnabled != null && this.VbsEnabled.Equals(virtualMachineFlagInfo.VbsEnabled))));\n        }\n\n        public override bool Equals(object virtualMachineFlagInfo)\n        {\n            return Equals(virtualMachineFlagInfo as VirtualMachineFlagInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DisableAcceleration + \"_\" + EnableLogging + \"_\" + UseToe + \"_\" + RunWithDebugInfo + \"_\" + MonitorType + \"_\" + HtSharing + \"_\" + SnapshotDisabled + \"_\" + SnapshotLocked + \"_\" + DiskUuidEnabled + \"_\" + VirtualMmuUsage + \"_\" + VirtualExecUsage + \"_\" + SnapshotPowerOffBehavior + \"_\" + RecordReplayEnabled + \"_\" + FaultToleranceType + \"_\" + CbrcCacheEnabled + \"_\" + VvtdEnabled + \"_\" + VbsEnabled).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineFloppyInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineFloppyInfo>\n    {\n        public bool Equals(VirtualMachineFloppyInfo virtualMachineFloppyInfo)\n        {\n            return (virtualMachineFloppyInfo != null && base.Equals(virtualMachineFloppyInfo));\n        }\n\n        public override bool Equals(object virtualMachineFloppyInfo)\n        {\n            return Equals(virtualMachineFloppyInfo as VirtualMachineFloppyInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineForkConfigInfo : DynamicData, IEquatable<VirtualMachineForkConfigInfo>\n    {\n        public bool? ParentEnabled { get; set; }\n\n        public string ChildForkGroupId { get; set; }\n\n        public string ParentForkGroupId { get; set; }\n\n        public string ChildType { get; set; }\n\n        public bool Equals(VirtualMachineForkConfigInfo virtualMachineForkConfigInfo)\n        {\n            return (virtualMachineForkConfigInfo != null && ((this.ParentEnabled == null && virtualMachineForkConfigInfo.ParentEnabled == null) || (this.ParentEnabled != null && this.ParentEnabled.Equals(virtualMachineForkConfigInfo.ParentEnabled))) && this.ChildForkGroupId == virtualMachineForkConfigInfo.ChildForkGroupId && this.ParentForkGroupId == virtualMachineForkConfigInfo.ParentForkGroupId && this.ChildType == virtualMachineForkConfigInfo.ChildType);\n        }\n\n        public override bool Equals(object virtualMachineForkConfigInfo)\n        {\n            return Equals(virtualMachineForkConfigInfo as VirtualMachineForkConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentEnabled + \"_\" + ChildForkGroupId + \"_\" + ParentForkGroupId + \"_\" + ChildType).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineGuestIntegrityInfo : DynamicData, IEquatable<VirtualMachineGuestIntegrityInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public bool Equals(VirtualMachineGuestIntegrityInfo virtualMachineGuestIntegrityInfo)\n        {\n            return (virtualMachineGuestIntegrityInfo != null && ((this.Enabled == null && virtualMachineGuestIntegrityInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(virtualMachineGuestIntegrityInfo.Enabled))));\n        }\n\n        public override bool Equals(object virtualMachineGuestIntegrityInfo)\n        {\n            return Equals(virtualMachineGuestIntegrityInfo as VirtualMachineGuestIntegrityInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineGuestQuiesceSpec : DynamicData, IEquatable<VirtualMachineGuestQuiesceSpec>\n    {\n        public int? Timeout { get; set; }\n\n        public bool Equals(VirtualMachineGuestQuiesceSpec virtualMachineGuestQuiesceSpec)\n        {\n            return (virtualMachineGuestQuiesceSpec != null && ((this.Timeout == null && virtualMachineGuestQuiesceSpec.Timeout == null) || (this.Timeout != null && this.Timeout.Equals(virtualMachineGuestQuiesceSpec.Timeout))));\n        }\n\n        public override bool Equals(object virtualMachineGuestQuiesceSpec)\n        {\n            return Equals(virtualMachineGuestQuiesceSpec as VirtualMachineGuestQuiesceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Timeout).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineGuestSummary : DynamicData, IEquatable<VirtualMachineGuestSummary>\n    {\n        public string GuestId { get; set; }\n\n        public string GuestFullName { get; set; }\n\n        public VirtualMachineToolsStatus? ToolsStatus { get; set; }\n\n        public string ToolsVersionStatus { get; set; }\n\n        public string ToolsVersionStatus2 { get; set; }\n\n        public string ToolsRunningStatus { get; set; }\n\n        public string HostName { get; set; }\n\n        public string IpAddress { get; set; }\n\n        public bool Equals(VirtualMachineGuestSummary virtualMachineGuestSummary)\n        {\n            return (virtualMachineGuestSummary != null && this.GuestId == virtualMachineGuestSummary.GuestId && this.GuestFullName == virtualMachineGuestSummary.GuestFullName && ((this.ToolsStatus == null && virtualMachineGuestSummary.ToolsStatus == null) || (this.ToolsStatus != null && this.ToolsStatus.Equals(virtualMachineGuestSummary.ToolsStatus))) && this.ToolsVersionStatus == virtualMachineGuestSummary.ToolsVersionStatus && this.ToolsVersionStatus2 == virtualMachineGuestSummary.ToolsVersionStatus2 && this.ToolsRunningStatus == virtualMachineGuestSummary.ToolsRunningStatus && this.HostName == virtualMachineGuestSummary.HostName && this.IpAddress == virtualMachineGuestSummary.IpAddress);\n        }\n\n        public override bool Equals(object virtualMachineGuestSummary)\n        {\n            return Equals(virtualMachineGuestSummary as VirtualMachineGuestSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GuestId + \"_\" + GuestFullName + \"_\" + ToolsStatus + \"_\" + ToolsVersionStatus + \"_\" + ToolsVersionStatus2 + \"_\" + ToolsRunningStatus + \"_\" + HostName + \"_\" + IpAddress).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineIdeDiskDeviceInfo : VirtualMachineDiskDeviceInfo, IEquatable<VirtualMachineIdeDiskDeviceInfo>\n    {\n        public VirtualMachineIdeDiskDevicePartitionInfo[] PartitionTable { get; set; }\n\n        public new VirtualMachineIdeDiskDeviceInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineIdeDiskDeviceInfo virtualMachineIdeDiskDeviceInfo)\n        {\n            return (virtualMachineIdeDiskDeviceInfo != null && ((this.PartitionTable == null && virtualMachineIdeDiskDeviceInfo.PartitionTable == null) || (this.PartitionTable != null && virtualMachineIdeDiskDeviceInfo.PartitionTable != null && Enumerable.SequenceEqual(this.PartitionTable, virtualMachineIdeDiskDeviceInfo.PartitionTable))) && ((this.LinkedView == null && virtualMachineIdeDiskDeviceInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineIdeDiskDeviceInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineIdeDiskDeviceInfo)\n        {\n            return Equals(virtualMachineIdeDiskDeviceInfo as VirtualMachineIdeDiskDeviceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PartitionTable + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineIdeDiskDeviceInfo_LinkedView : VirtualMachineDiskDeviceInfo_LinkedView, IEquatable<VirtualMachineIdeDiskDeviceInfo_LinkedView>\n    {\n        public bool Equals(VirtualMachineIdeDiskDeviceInfo_LinkedView virtualMachineIdeDiskDeviceInfo_LinkedView)\n        {\n            return (virtualMachineIdeDiskDeviceInfo_LinkedView != null && base.Equals(virtualMachineIdeDiskDeviceInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualMachineIdeDiskDeviceInfo_LinkedView)\n        {\n            return Equals(virtualMachineIdeDiskDeviceInfo_LinkedView as VirtualMachineIdeDiskDeviceInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineIdeDiskDevicePartitionInfo : DynamicData, IEquatable<VirtualMachineIdeDiskDevicePartitionInfo>\n    {\n        public int Id { get; set; }\n\n        public int Capacity { get; set; }\n\n        public bool Equals(VirtualMachineIdeDiskDevicePartitionInfo virtualMachineIdeDiskDevicePartitionInfo)\n        {\n            return (virtualMachineIdeDiskDevicePartitionInfo != null && this.Id == virtualMachineIdeDiskDevicePartitionInfo.Id && this.Capacity == virtualMachineIdeDiskDevicePartitionInfo.Capacity);\n        }\n\n        public override bool Equals(object virtualMachineIdeDiskDevicePartitionInfo)\n        {\n            return Equals(virtualMachineIdeDiskDevicePartitionInfo as VirtualMachineIdeDiskDevicePartitionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Capacity).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineImportSpec : ImportSpec, IEquatable<VirtualMachineImportSpec>\n    {\n        public VirtualMachineConfigSpec ConfigSpec { get; set; }\n\n        public ManagedObjectReference ResPoolEntity { get; set; }\n\n        public VirtualMachineImportSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineImportSpec virtualMachineImportSpec)\n        {\n            return (virtualMachineImportSpec != null && ((this.ConfigSpec == null && virtualMachineImportSpec.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(virtualMachineImportSpec.ConfigSpec))) && ((this.ResPoolEntity == null && virtualMachineImportSpec.ResPoolEntity == null) || (this.ResPoolEntity != null && this.ResPoolEntity.Equals(virtualMachineImportSpec.ResPoolEntity))) && ((this.LinkedView == null && virtualMachineImportSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineImportSpec.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineImportSpec)\n        {\n            return Equals(virtualMachineImportSpec as VirtualMachineImportSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec + \"_\" + ResPoolEntity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineImportSpec_LinkedView : IEquatable<VirtualMachineImportSpec_LinkedView>\n    {\n        public ResourcePool ResPoolEntity { get; set; }\n\n        public bool Equals(VirtualMachineImportSpec_LinkedView virtualMachineImportSpec_LinkedView)\n        {\n            return (virtualMachineImportSpec_LinkedView != null && ((this.ResPoolEntity == null && virtualMachineImportSpec_LinkedView.ResPoolEntity == null) || (this.ResPoolEntity != null && this.ResPoolEntity.Equals(virtualMachineImportSpec_LinkedView.ResPoolEntity))));\n        }\n\n        public override bool Equals(object virtualMachineImportSpec_LinkedView)\n        {\n            return Equals(virtualMachineImportSpec_LinkedView as VirtualMachineImportSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ResPoolEntity).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineInstantCloneSpec : DynamicData, IEquatable<VirtualMachineInstantCloneSpec>\n    {\n        public string Name { get; set; }\n\n        public VirtualMachineRelocateSpec Location { get; set; }\n\n        public OptionValue[] Config { get; set; }\n\n        public string BiosUuid { get; set; }\n\n        public bool Equals(VirtualMachineInstantCloneSpec virtualMachineInstantCloneSpec)\n        {\n            return (virtualMachineInstantCloneSpec != null && this.Name == virtualMachineInstantCloneSpec.Name && ((this.Location == null && virtualMachineInstantCloneSpec.Location == null) || (this.Location != null && this.Location.Equals(virtualMachineInstantCloneSpec.Location))) && ((this.Config == null && virtualMachineInstantCloneSpec.Config == null) || (this.Config != null && virtualMachineInstantCloneSpec.Config != null && Enumerable.SequenceEqual(this.Config, virtualMachineInstantCloneSpec.Config))) && this.BiosUuid == virtualMachineInstantCloneSpec.BiosUuid);\n        }\n\n        public override bool Equals(object virtualMachineInstantCloneSpec)\n        {\n            return Equals(virtualMachineInstantCloneSpec as VirtualMachineInstantCloneSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Location + \"_\" + Config + \"_\" + BiosUuid).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineLegacyNetworkSwitchInfo : DynamicData, IEquatable<VirtualMachineLegacyNetworkSwitchInfo>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(VirtualMachineLegacyNetworkSwitchInfo virtualMachineLegacyNetworkSwitchInfo)\n        {\n            return (virtualMachineLegacyNetworkSwitchInfo != null && this.Name == virtualMachineLegacyNetworkSwitchInfo.Name);\n        }\n\n        public override bool Equals(object virtualMachineLegacyNetworkSwitchInfo)\n        {\n            return Equals(virtualMachineLegacyNetworkSwitchInfo as VirtualMachineLegacyNetworkSwitchInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMemoryReservationInfo : DynamicData, IEquatable<VirtualMachineMemoryReservationInfo>\n    {\n        public long VirtualMachineMin { get; set; }\n\n        public long VirtualMachineMax { get; set; }\n\n        public long VirtualMachineReserved { get; set; }\n\n        public string AllocationPolicy { get; set; }\n\n        public bool Equals(VirtualMachineMemoryReservationInfo virtualMachineMemoryReservationInfo)\n        {\n            return (virtualMachineMemoryReservationInfo != null && this.VirtualMachineMin == virtualMachineMemoryReservationInfo.VirtualMachineMin && this.VirtualMachineMax == virtualMachineMemoryReservationInfo.VirtualMachineMax && this.VirtualMachineReserved == virtualMachineMemoryReservationInfo.VirtualMachineReserved && this.AllocationPolicy == virtualMachineMemoryReservationInfo.AllocationPolicy);\n        }\n\n        public override bool Equals(object virtualMachineMemoryReservationInfo)\n        {\n            return Equals(virtualMachineMemoryReservationInfo as VirtualMachineMemoryReservationInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualMachineMin + \"_\" + VirtualMachineMax + \"_\" + VirtualMachineReserved + \"_\" + AllocationPolicy).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMemoryReservationSpec : DynamicData, IEquatable<VirtualMachineMemoryReservationSpec>\n    {\n        public long? VirtualMachineReserved { get; set; }\n\n        public string AllocationPolicy { get; set; }\n\n        public bool Equals(VirtualMachineMemoryReservationSpec virtualMachineMemoryReservationSpec)\n        {\n            return (virtualMachineMemoryReservationSpec != null && ((this.VirtualMachineReserved == null && virtualMachineMemoryReservationSpec.VirtualMachineReserved == null) || (this.VirtualMachineReserved != null && this.VirtualMachineReserved.Equals(virtualMachineMemoryReservationSpec.VirtualMachineReserved))) && this.AllocationPolicy == virtualMachineMemoryReservationSpec.AllocationPolicy);\n        }\n\n        public override bool Equals(object virtualMachineMemoryReservationSpec)\n        {\n            return Equals(virtualMachineMemoryReservationSpec as VirtualMachineMemoryReservationSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualMachineReserved + \"_\" + AllocationPolicy).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMessage : DynamicData, IEquatable<VirtualMachineMessage>\n    {\n        public string Id { get; set; }\n\n        public object[] Argument { get; set; }\n\n        public string Text { get; set; }\n\n        public bool Equals(VirtualMachineMessage virtualMachineMessage)\n        {\n            return (virtualMachineMessage != null && this.Id == virtualMachineMessage.Id && ((this.Argument == null && virtualMachineMessage.Argument == null) || (this.Argument != null && virtualMachineMessage.Argument != null && Enumerable.SequenceEqual(this.Argument, virtualMachineMessage.Argument))) && this.Text == virtualMachineMessage.Text);\n        }\n\n        public override bool Equals(object virtualMachineMessage)\n        {\n            return Equals(virtualMachineMessage as VirtualMachineMessage);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Argument + \"_\" + Text).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMetadataManagerVmMetadata : DynamicData, IEquatable<VirtualMachineMetadataManagerVmMetadata>\n    {\n        public string VmId { get; set; }\n\n        public string Metadata { get; set; }\n\n        public bool Equals(VirtualMachineMetadataManagerVmMetadata virtualMachineMetadataManagerVmMetadata)\n        {\n            return (virtualMachineMetadataManagerVmMetadata != null && this.VmId == virtualMachineMetadataManagerVmMetadata.VmId && this.Metadata == virtualMachineMetadataManagerVmMetadata.Metadata);\n        }\n\n        public override bool Equals(object virtualMachineMetadataManagerVmMetadata)\n        {\n            return Equals(virtualMachineMetadataManagerVmMetadata as VirtualMachineMetadataManagerVmMetadata);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmId + \"_\" + Metadata).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMetadataManagerVmMetadataInput : DynamicData, IEquatable<VirtualMachineMetadataManagerVmMetadataInput>\n    {\n        public string Operation { get; set; }\n\n        public VirtualMachineMetadataManagerVmMetadata VmMetadata { get; set; }\n\n        public bool Equals(VirtualMachineMetadataManagerVmMetadataInput virtualMachineMetadataManagerVmMetadataInput)\n        {\n            return (virtualMachineMetadataManagerVmMetadataInput != null && this.Operation == virtualMachineMetadataManagerVmMetadataInput.Operation && ((this.VmMetadata == null && virtualMachineMetadataManagerVmMetadataInput.VmMetadata == null) || (this.VmMetadata != null && this.VmMetadata.Equals(virtualMachineMetadataManagerVmMetadataInput.VmMetadata))));\n        }\n\n        public override bool Equals(object virtualMachineMetadataManagerVmMetadataInput)\n        {\n            return Equals(virtualMachineMetadataManagerVmMetadataInput as VirtualMachineMetadataManagerVmMetadataInput);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + VmMetadata).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMetadataManagerVmMetadataOwner : DynamicData, IEquatable<VirtualMachineMetadataManagerVmMetadataOwner>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(VirtualMachineMetadataManagerVmMetadataOwner virtualMachineMetadataManagerVmMetadataOwner)\n        {\n            return (virtualMachineMetadataManagerVmMetadataOwner != null && this.Name == virtualMachineMetadataManagerVmMetadataOwner.Name);\n        }\n\n        public override bool Equals(object virtualMachineMetadataManagerVmMetadataOwner)\n        {\n            return Equals(virtualMachineMetadataManagerVmMetadataOwner as VirtualMachineMetadataManagerVmMetadataOwner);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMetadataManagerVmMetadataResult : DynamicData, IEquatable<VirtualMachineMetadataManagerVmMetadataResult>\n    {\n        public VirtualMachineMetadataManagerVmMetadata VmMetadata { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public bool Equals(VirtualMachineMetadataManagerVmMetadataResult virtualMachineMetadataManagerVmMetadataResult)\n        {\n            return (virtualMachineMetadataManagerVmMetadataResult != null && ((this.VmMetadata == null && virtualMachineMetadataManagerVmMetadataResult.VmMetadata == null) || (this.VmMetadata != null && this.VmMetadata.Equals(virtualMachineMetadataManagerVmMetadataResult.VmMetadata))) && ((this.Error == null && virtualMachineMetadataManagerVmMetadataResult.Error == null) || (this.Error != null && this.Error.Equals(virtualMachineMetadataManagerVmMetadataResult.Error))));\n        }\n\n        public override bool Equals(object virtualMachineMetadataManagerVmMetadataResult)\n        {\n            return Equals(virtualMachineMetadataManagerVmMetadataResult as VirtualMachineMetadataManagerVmMetadataResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmMetadata + \"_\" + Error).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineMksTicket : DynamicData, IEquatable<VirtualMachineMksTicket>\n    {\n        public string Ticket { get; set; }\n\n        public string CfgFile { get; set; }\n\n        public string Host { get; set; }\n\n        public int? Port { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public bool Equals(VirtualMachineMksTicket virtualMachineMksTicket)\n        {\n            return (virtualMachineMksTicket != null && this.Ticket == virtualMachineMksTicket.Ticket && this.CfgFile == virtualMachineMksTicket.CfgFile && this.Host == virtualMachineMksTicket.Host && ((this.Port == null && virtualMachineMksTicket.Port == null) || (this.Port != null && this.Port.Equals(virtualMachineMksTicket.Port))) && this.SslThumbprint == virtualMachineMksTicket.SslThumbprint);\n        }\n\n        public override bool Equals(object virtualMachineMksTicket)\n        {\n            return Equals(virtualMachineMksTicket as VirtualMachineMksTicket);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ticket + \"_\" + CfgFile + \"_\" + Host + \"_\" + Port + \"_\" + SslThumbprint).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineNetworkInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineNetworkInfo>\n    {\n        public NetworkSummary Network { get; set; }\n\n        public string Vswitch { get; set; }\n\n        public bool Equals(VirtualMachineNetworkInfo virtualMachineNetworkInfo)\n        {\n            return (virtualMachineNetworkInfo != null && ((this.Network == null && virtualMachineNetworkInfo.Network == null) || (this.Network != null && this.Network.Equals(virtualMachineNetworkInfo.Network))) && this.Vswitch == virtualMachineNetworkInfo.Vswitch);\n        }\n\n        public override bool Equals(object virtualMachineNetworkInfo)\n        {\n            return Equals(virtualMachineNetworkInfo as VirtualMachineNetworkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + Vswitch).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineNetworkShaperInfo : DynamicData, IEquatable<VirtualMachineNetworkShaperInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public long? PeakBps { get; set; }\n\n        public long? AverageBps { get; set; }\n\n        public long? BurstSize { get; set; }\n\n        public bool Equals(VirtualMachineNetworkShaperInfo virtualMachineNetworkShaperInfo)\n        {\n            return (virtualMachineNetworkShaperInfo != null && ((this.Enabled == null && virtualMachineNetworkShaperInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(virtualMachineNetworkShaperInfo.Enabled))) && ((this.PeakBps == null && virtualMachineNetworkShaperInfo.PeakBps == null) || (this.PeakBps != null && this.PeakBps.Equals(virtualMachineNetworkShaperInfo.PeakBps))) && ((this.AverageBps == null && virtualMachineNetworkShaperInfo.AverageBps == null) || (this.AverageBps != null && this.AverageBps.Equals(virtualMachineNetworkShaperInfo.AverageBps))) && ((this.BurstSize == null && virtualMachineNetworkShaperInfo.BurstSize == null) || (this.BurstSize != null && this.BurstSize.Equals(virtualMachineNetworkShaperInfo.BurstSize))));\n        }\n\n        public override bool Equals(object virtualMachineNetworkShaperInfo)\n        {\n            return Equals(virtualMachineNetworkShaperInfo as VirtualMachineNetworkShaperInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + PeakBps + \"_\" + AverageBps + \"_\" + BurstSize).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineParallelInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineParallelInfo>\n    {\n        public bool Equals(VirtualMachineParallelInfo virtualMachineParallelInfo)\n        {\n            return (virtualMachineParallelInfo != null && base.Equals(virtualMachineParallelInfo));\n        }\n\n        public override bool Equals(object virtualMachineParallelInfo)\n        {\n            return Equals(virtualMachineParallelInfo as VirtualMachineParallelInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachinePciPassthroughInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachinePciPassthroughInfo>\n    {\n        public HostPciDevice PciDevice { get; set; }\n\n        public string SystemId { get; set; }\n\n        public bool Equals(VirtualMachinePciPassthroughInfo virtualMachinePciPassthroughInfo)\n        {\n            return (virtualMachinePciPassthroughInfo != null && ((this.PciDevice == null && virtualMachinePciPassthroughInfo.PciDevice == null) || (this.PciDevice != null && this.PciDevice.Equals(virtualMachinePciPassthroughInfo.PciDevice))) && this.SystemId == virtualMachinePciPassthroughInfo.SystemId);\n        }\n\n        public override bool Equals(object virtualMachinePciPassthroughInfo)\n        {\n            return Equals(virtualMachinePciPassthroughInfo as VirtualMachinePciPassthroughInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PciDevice + \"_\" + SystemId).GetHashCode();\n        }\n    }\n\n    public class VirtualMachinePciSharedGpuPassthroughInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachinePciSharedGpuPassthroughInfo>\n    {\n        public string Vgpu { get; set; }\n\n        public bool Equals(VirtualMachinePciSharedGpuPassthroughInfo virtualMachinePciSharedGpuPassthroughInfo)\n        {\n            return (virtualMachinePciSharedGpuPassthroughInfo != null && this.Vgpu == virtualMachinePciSharedGpuPassthroughInfo.Vgpu);\n        }\n\n        public override bool Equals(object virtualMachinePciSharedGpuPassthroughInfo)\n        {\n            return Equals(virtualMachinePciSharedGpuPassthroughInfo as VirtualMachinePciSharedGpuPassthroughInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vgpu).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineProfileDetails : DynamicData, IEquatable<VirtualMachineProfileDetails>\n    {\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public VirtualMachineProfileDetailsDiskProfileDetails[] DiskProfileDetails { get; set; }\n\n        public bool Equals(VirtualMachineProfileDetails virtualMachineProfileDetails)\n        {\n            return (virtualMachineProfileDetails != null && ((this.Profile == null && virtualMachineProfileDetails.Profile == null) || (this.Profile != null && virtualMachineProfileDetails.Profile != null && Enumerable.SequenceEqual(this.Profile, virtualMachineProfileDetails.Profile))) && ((this.DiskProfileDetails == null && virtualMachineProfileDetails.DiskProfileDetails == null) || (this.DiskProfileDetails != null && virtualMachineProfileDetails.DiskProfileDetails != null && Enumerable.SequenceEqual(this.DiskProfileDetails, virtualMachineProfileDetails.DiskProfileDetails))));\n        }\n\n        public override bool Equals(object virtualMachineProfileDetails)\n        {\n            return Equals(virtualMachineProfileDetails as VirtualMachineProfileDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Profile + \"_\" + DiskProfileDetails).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineProfileDetailsDiskProfileDetails : DynamicData, IEquatable<VirtualMachineProfileDetailsDiskProfileDetails>\n    {\n        public int DiskId { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public bool Equals(VirtualMachineProfileDetailsDiskProfileDetails virtualMachineProfileDetailsDiskProfileDetails)\n        {\n            return (virtualMachineProfileDetailsDiskProfileDetails != null && this.DiskId == virtualMachineProfileDetailsDiskProfileDetails.DiskId && ((this.Profile == null && virtualMachineProfileDetailsDiskProfileDetails.Profile == null) || (this.Profile != null && virtualMachineProfileDetailsDiskProfileDetails.Profile != null && Enumerable.SequenceEqual(this.Profile, virtualMachineProfileDetailsDiskProfileDetails.Profile))));\n        }\n\n        public override bool Equals(object virtualMachineProfileDetailsDiskProfileDetails)\n        {\n            return Equals(virtualMachineProfileDetailsDiskProfileDetails as VirtualMachineProfileDetailsDiskProfileDetails);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId + \"_\" + Profile).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineProfileRawData : DynamicData, IEquatable<VirtualMachineProfileRawData>\n    {\n        public string ExtensionKey { get; set; }\n\n        public string ObjectData { get; set; }\n\n        public bool Equals(VirtualMachineProfileRawData virtualMachineProfileRawData)\n        {\n            return (virtualMachineProfileRawData != null && this.ExtensionKey == virtualMachineProfileRawData.ExtensionKey && this.ObjectData == virtualMachineProfileRawData.ObjectData);\n        }\n\n        public override bool Equals(object virtualMachineProfileRawData)\n        {\n            return Equals(virtualMachineProfileRawData as VirtualMachineProfileRawData);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ExtensionKey + \"_\" + ObjectData).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineProfileSpec : DynamicData, IEquatable<VirtualMachineProfileSpec>\n    {\n        public bool Equals(VirtualMachineProfileSpec virtualMachineProfileSpec)\n        {\n            return (virtualMachineProfileSpec != null && base.Equals(virtualMachineProfileSpec));\n        }\n\n        public override bool Equals(object virtualMachineProfileSpec)\n        {\n            return Equals(virtualMachineProfileSpec as VirtualMachineProfileSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachinePropertyRelation : DynamicData, IEquatable<VirtualMachinePropertyRelation>\n    {\n        public DynamicProperty Key { get; set; }\n\n        public DynamicProperty[] Relations { get; set; }\n\n        public bool Equals(VirtualMachinePropertyRelation virtualMachinePropertyRelation)\n        {\n            return (virtualMachinePropertyRelation != null && ((this.Key == null && virtualMachinePropertyRelation.Key == null) || (this.Key != null && this.Key.Equals(virtualMachinePropertyRelation.Key))) && ((this.Relations == null && virtualMachinePropertyRelation.Relations == null) || (this.Relations != null && virtualMachinePropertyRelation.Relations != null && Enumerable.SequenceEqual(this.Relations, virtualMachinePropertyRelation.Relations))));\n        }\n\n        public override bool Equals(object virtualMachinePropertyRelation)\n        {\n            return Equals(virtualMachinePropertyRelation as VirtualMachinePropertyRelation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Relations).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineProvisioningChecker : ViewBase, IEquatable<VirtualMachineProvisioningChecker>\n    {\n        public ManagedObjectReference QueryVMotionCompatibilityEx_Task(ManagedObjectReference[] vm, ManagedObjectReference[] host)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] QueryVMotionCompatibilityEx(ManagedObjectReference[] vm, ManagedObjectReference[] host)\n        {\n            return default(CheckResult[]);\n        }\n\n        public ManagedObjectReference CheckMigrate_Task(ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, VirtualMachinePowerState? state, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckMigrate(ManagedObjectReference vm, ManagedObjectReference host, ManagedObjectReference pool, VirtualMachinePowerState? state, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public ManagedObjectReference CheckRelocate_Task(ManagedObjectReference vm, VirtualMachineRelocateSpec spec, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckRelocate(ManagedObjectReference vm, VirtualMachineRelocateSpec spec, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public ManagedObjectReference CheckClone_Task(ManagedObjectReference vm, ManagedObjectReference folder, string name, VirtualMachineCloneSpec spec, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckClone(ManagedObjectReference vm, ManagedObjectReference folder, string name, VirtualMachineCloneSpec spec, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public ManagedObjectReference CheckInstantClone_Task(ManagedObjectReference vm, VirtualMachineInstantCloneSpec spec, string[] testType)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public CheckResult[] CheckInstantClone(ManagedObjectReference vm, VirtualMachineInstantCloneSpec spec, string[] testType)\n        {\n            return default(CheckResult[]);\n        }\n\n        public bool Equals(VirtualMachineProvisioningChecker virtualMachineProvisioningChecker)\n        {\n            return (virtualMachineProvisioningChecker != null && base.Equals(virtualMachineProvisioningChecker));\n        }\n\n        public override bool Equals(object virtualMachineProvisioningChecker)\n        {\n            return Equals(virtualMachineProvisioningChecker as VirtualMachineProvisioningChecker);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineQuestionInfo : DynamicData, IEquatable<VirtualMachineQuestionInfo>\n    {\n        public string Id { get; set; }\n\n        public string Text { get; set; }\n\n        public ChoiceOption Choice { get; set; }\n\n        public VirtualMachineMessage[] Message { get; set; }\n\n        public bool Equals(VirtualMachineQuestionInfo virtualMachineQuestionInfo)\n        {\n            return (virtualMachineQuestionInfo != null && this.Id == virtualMachineQuestionInfo.Id && this.Text == virtualMachineQuestionInfo.Text && ((this.Choice == null && virtualMachineQuestionInfo.Choice == null) || (this.Choice != null && this.Choice.Equals(virtualMachineQuestionInfo.Choice))) && ((this.Message == null && virtualMachineQuestionInfo.Message == null) || (this.Message != null && virtualMachineQuestionInfo.Message != null && Enumerable.SequenceEqual(this.Message, virtualMachineQuestionInfo.Message))));\n        }\n\n        public override bool Equals(object virtualMachineQuestionInfo)\n        {\n            return Equals(virtualMachineQuestionInfo as VirtualMachineQuestionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Text + \"_\" + Choice + \"_\" + Message).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineQuickStats : DynamicData, IEquatable<VirtualMachineQuickStats>\n    {\n        public int? OverallCpuUsage { get; set; }\n\n        public int? OverallCpuDemand { get; set; }\n\n        public int? GuestMemoryUsage { get; set; }\n\n        public int? HostMemoryUsage { get; set; }\n\n        public ManagedEntityStatus GuestHeartbeatStatus { get; set; }\n\n        public int? DistributedCpuEntitlement { get; set; }\n\n        public int? DistributedMemoryEntitlement { get; set; }\n\n        public int? StaticCpuEntitlement { get; set; }\n\n        public int? StaticMemoryEntitlement { get; set; }\n\n        public int? PrivateMemory { get; set; }\n\n        public int? SharedMemory { get; set; }\n\n        public int? SwappedMemory { get; set; }\n\n        public int? BalloonedMemory { get; set; }\n\n        public int? ConsumedOverheadMemory { get; set; }\n\n        public int? FtLogBandwidth { get; set; }\n\n        public int? FtSecondaryLatency { get; set; }\n\n        public ManagedEntityStatus? FtLatencyStatus { get; set; }\n\n        public long? CompressedMemory { get; set; }\n\n        public int? UptimeSeconds { get; set; }\n\n        public long? SsdSwappedMemory { get; set; }\n\n        public bool Equals(VirtualMachineQuickStats virtualMachineQuickStats)\n        {\n            return (virtualMachineQuickStats != null && ((this.OverallCpuUsage == null && virtualMachineQuickStats.OverallCpuUsage == null) || (this.OverallCpuUsage != null && this.OverallCpuUsage.Equals(virtualMachineQuickStats.OverallCpuUsage))) && ((this.OverallCpuDemand == null && virtualMachineQuickStats.OverallCpuDemand == null) || (this.OverallCpuDemand != null && this.OverallCpuDemand.Equals(virtualMachineQuickStats.OverallCpuDemand))) && ((this.GuestMemoryUsage == null && virtualMachineQuickStats.GuestMemoryUsage == null) || (this.GuestMemoryUsage != null && this.GuestMemoryUsage.Equals(virtualMachineQuickStats.GuestMemoryUsage))) && ((this.HostMemoryUsage == null && virtualMachineQuickStats.HostMemoryUsage == null) || (this.HostMemoryUsage != null && this.HostMemoryUsage.Equals(virtualMachineQuickStats.HostMemoryUsage))) && this.GuestHeartbeatStatus == virtualMachineQuickStats.GuestHeartbeatStatus && ((this.DistributedCpuEntitlement == null && virtualMachineQuickStats.DistributedCpuEntitlement == null) || (this.DistributedCpuEntitlement != null && this.DistributedCpuEntitlement.Equals(virtualMachineQuickStats.DistributedCpuEntitlement))) && ((this.DistributedMemoryEntitlement == null && virtualMachineQuickStats.DistributedMemoryEntitlement == null) || (this.DistributedMemoryEntitlement != null && this.DistributedMemoryEntitlement.Equals(virtualMachineQuickStats.DistributedMemoryEntitlement))) && ((this.StaticCpuEntitlement == null && virtualMachineQuickStats.StaticCpuEntitlement == null) || (this.StaticCpuEntitlement != null && this.StaticCpuEntitlement.Equals(virtualMachineQuickStats.StaticCpuEntitlement))) && ((this.StaticMemoryEntitlement == null && virtualMachineQuickStats.StaticMemoryEntitlement == null) || (this.StaticMemoryEntitlement != null && this.StaticMemoryEntitlement.Equals(virtualMachineQuickStats.StaticMemoryEntitlement))) && ((this.PrivateMemory == null && virtualMachineQuickStats.PrivateMemory == null) || (this.PrivateMemory != null && this.PrivateMemory.Equals(virtualMachineQuickStats.PrivateMemory))) && ((this.SharedMemory == null && virtualMachineQuickStats.SharedMemory == null) || (this.SharedMemory != null && this.SharedMemory.Equals(virtualMachineQuickStats.SharedMemory))) && ((this.SwappedMemory == null && virtualMachineQuickStats.SwappedMemory == null) || (this.SwappedMemory != null && this.SwappedMemory.Equals(virtualMachineQuickStats.SwappedMemory))) && ((this.BalloonedMemory == null && virtualMachineQuickStats.BalloonedMemory == null) || (this.BalloonedMemory != null && this.BalloonedMemory.Equals(virtualMachineQuickStats.BalloonedMemory))) && ((this.ConsumedOverheadMemory == null && virtualMachineQuickStats.ConsumedOverheadMemory == null) || (this.ConsumedOverheadMemory != null && this.ConsumedOverheadMemory.Equals(virtualMachineQuickStats.ConsumedOverheadMemory))) && ((this.FtLogBandwidth == null && virtualMachineQuickStats.FtLogBandwidth == null) || (this.FtLogBandwidth != null && this.FtLogBandwidth.Equals(virtualMachineQuickStats.FtLogBandwidth))) && ((this.FtSecondaryLatency == null && virtualMachineQuickStats.FtSecondaryLatency == null) || (this.FtSecondaryLatency != null && this.FtSecondaryLatency.Equals(virtualMachineQuickStats.FtSecondaryLatency))) && ((this.FtLatencyStatus == null && virtualMachineQuickStats.FtLatencyStatus == null) || (this.FtLatencyStatus != null && this.FtLatencyStatus.Equals(virtualMachineQuickStats.FtLatencyStatus))) && ((this.CompressedMemory == null && virtualMachineQuickStats.CompressedMemory == null) || (this.CompressedMemory != null && this.CompressedMemory.Equals(virtualMachineQuickStats.CompressedMemory))) && ((this.UptimeSeconds == null && virtualMachineQuickStats.UptimeSeconds == null) || (this.UptimeSeconds != null && this.UptimeSeconds.Equals(virtualMachineQuickStats.UptimeSeconds))) && ((this.SsdSwappedMemory == null && virtualMachineQuickStats.SsdSwappedMemory == null) || (this.SsdSwappedMemory != null && this.SsdSwappedMemory.Equals(virtualMachineQuickStats.SsdSwappedMemory))));\n        }\n\n        public override bool Equals(object virtualMachineQuickStats)\n        {\n            return Equals(virtualMachineQuickStats as VirtualMachineQuickStats);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OverallCpuUsage + \"_\" + OverallCpuDemand + \"_\" + GuestMemoryUsage + \"_\" + HostMemoryUsage + \"_\" + GuestHeartbeatStatus + \"_\" + DistributedCpuEntitlement + \"_\" + DistributedMemoryEntitlement + \"_\" + StaticCpuEntitlement + \"_\" + StaticMemoryEntitlement + \"_\" + PrivateMemory + \"_\" + SharedMemory + \"_\" + SwappedMemory + \"_\" + BalloonedMemory + \"_\" + ConsumedOverheadMemory + \"_\" + FtLogBandwidth + \"_\" + FtSecondaryLatency + \"_\" + FtLatencyStatus + \"_\" + CompressedMemory + \"_\" + UptimeSeconds + \"_\" + SsdSwappedMemory).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRelocateSpec : DynamicData, IEquatable<VirtualMachineRelocateSpec>\n    {\n        public ServiceLocator Service { get; set; }\n\n        public ManagedObjectReference Folder { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string DiskMoveType { get; set; }\n\n        public ManagedObjectReference Pool { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public VirtualMachineRelocateSpecDiskLocator[] Disk { get; set; }\n\n        public VirtualMachineRelocateTransformation? Transform { get; set; }\n\n        public VirtualDeviceConfigSpec[] DeviceChange { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public VirtualMachineRelocateSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineRelocateSpec virtualMachineRelocateSpec)\n        {\n            return (virtualMachineRelocateSpec != null && ((this.Service == null && virtualMachineRelocateSpec.Service == null) || (this.Service != null && this.Service.Equals(virtualMachineRelocateSpec.Service))) && ((this.Folder == null && virtualMachineRelocateSpec.Folder == null) || (this.Folder != null && this.Folder.Equals(virtualMachineRelocateSpec.Folder))) && ((this.Datastore == null && virtualMachineRelocateSpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineRelocateSpec.Datastore))) && this.DiskMoveType == virtualMachineRelocateSpec.DiskMoveType && ((this.Pool == null && virtualMachineRelocateSpec.Pool == null) || (this.Pool != null && this.Pool.Equals(virtualMachineRelocateSpec.Pool))) && ((this.Host == null && virtualMachineRelocateSpec.Host == null) || (this.Host != null && this.Host.Equals(virtualMachineRelocateSpec.Host))) && ((this.Disk == null && virtualMachineRelocateSpec.Disk == null) || (this.Disk != null && virtualMachineRelocateSpec.Disk != null && Enumerable.SequenceEqual(this.Disk, virtualMachineRelocateSpec.Disk))) && ((this.Transform == null && virtualMachineRelocateSpec.Transform == null) || (this.Transform != null && this.Transform.Equals(virtualMachineRelocateSpec.Transform))) && ((this.DeviceChange == null && virtualMachineRelocateSpec.DeviceChange == null) || (this.DeviceChange != null && virtualMachineRelocateSpec.DeviceChange != null && Enumerable.SequenceEqual(this.DeviceChange, virtualMachineRelocateSpec.DeviceChange))) && ((this.Profile == null && virtualMachineRelocateSpec.Profile == null) || (this.Profile != null && virtualMachineRelocateSpec.Profile != null && Enumerable.SequenceEqual(this.Profile, virtualMachineRelocateSpec.Profile))) && ((this.LinkedView == null && virtualMachineRelocateSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineRelocateSpec.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineRelocateSpec)\n        {\n            return Equals(virtualMachineRelocateSpec as VirtualMachineRelocateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Service + \"_\" + Folder + \"_\" + Datastore + \"_\" + DiskMoveType + \"_\" + Pool + \"_\" + Host + \"_\" + Disk + \"_\" + Transform + \"_\" + DeviceChange + \"_\" + Profile + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRelocateSpec_LinkedView : IEquatable<VirtualMachineRelocateSpec_LinkedView>\n    {\n        public Folder Folder { get; set; }\n\n        public Datastore Datastore { get; set; }\n\n        public ResourcePool Pool { get; set; }\n\n        public HostSystem Host { get; set; }\n\n        public bool Equals(VirtualMachineRelocateSpec_LinkedView virtualMachineRelocateSpec_LinkedView)\n        {\n            return (virtualMachineRelocateSpec_LinkedView != null && ((this.Folder == null && virtualMachineRelocateSpec_LinkedView.Folder == null) || (this.Folder != null && this.Folder.Equals(virtualMachineRelocateSpec_LinkedView.Folder))) && ((this.Datastore == null && virtualMachineRelocateSpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineRelocateSpec_LinkedView.Datastore))) && ((this.Pool == null && virtualMachineRelocateSpec_LinkedView.Pool == null) || (this.Pool != null && this.Pool.Equals(virtualMachineRelocateSpec_LinkedView.Pool))) && ((this.Host == null && virtualMachineRelocateSpec_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(virtualMachineRelocateSpec_LinkedView.Host))));\n        }\n\n        public override bool Equals(object virtualMachineRelocateSpec_LinkedView)\n        {\n            return Equals(virtualMachineRelocateSpec_LinkedView as VirtualMachineRelocateSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Folder + \"_\" + Datastore + \"_\" + Pool + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRelocateSpecDiskLocator : DynamicData, IEquatable<VirtualMachineRelocateSpecDiskLocator>\n    {\n        public int DiskId { get; set; }\n\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string DiskMoveType { get; set; }\n\n        public VirtualDeviceBackingInfo DiskBackingInfo { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public VirtualMachineRelocateSpecDiskLocator_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineRelocateSpecDiskLocator virtualMachineRelocateSpecDiskLocator)\n        {\n            return (virtualMachineRelocateSpecDiskLocator != null && this.DiskId == virtualMachineRelocateSpecDiskLocator.DiskId && ((this.Datastore == null && virtualMachineRelocateSpecDiskLocator.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineRelocateSpecDiskLocator.Datastore))) && this.DiskMoveType == virtualMachineRelocateSpecDiskLocator.DiskMoveType && ((this.DiskBackingInfo == null && virtualMachineRelocateSpecDiskLocator.DiskBackingInfo == null) || (this.DiskBackingInfo != null && this.DiskBackingInfo.Equals(virtualMachineRelocateSpecDiskLocator.DiskBackingInfo))) && ((this.Profile == null && virtualMachineRelocateSpecDiskLocator.Profile == null) || (this.Profile != null && virtualMachineRelocateSpecDiskLocator.Profile != null && Enumerable.SequenceEqual(this.Profile, virtualMachineRelocateSpecDiskLocator.Profile))) && ((this.LinkedView == null && virtualMachineRelocateSpecDiskLocator.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineRelocateSpecDiskLocator.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineRelocateSpecDiskLocator)\n        {\n            return Equals(virtualMachineRelocateSpecDiskLocator as VirtualMachineRelocateSpecDiskLocator);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId + \"_\" + Datastore + \"_\" + DiskMoveType + \"_\" + DiskBackingInfo + \"_\" + Profile + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRelocateSpecDiskLocator_LinkedView : IEquatable<VirtualMachineRelocateSpecDiskLocator_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(VirtualMachineRelocateSpecDiskLocator_LinkedView virtualMachineRelocateSpecDiskLocator_LinkedView)\n        {\n            return (virtualMachineRelocateSpecDiskLocator_LinkedView != null && ((this.Datastore == null && virtualMachineRelocateSpecDiskLocator_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineRelocateSpecDiskLocator_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object virtualMachineRelocateSpecDiskLocator_LinkedView)\n        {\n            return Equals(virtualMachineRelocateSpecDiskLocator_LinkedView as VirtualMachineRelocateSpecDiskLocator_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRuntimeInfo : DynamicData, IEquatable<VirtualMachineRuntimeInfo>\n    {\n        public VirtualMachineDeviceRuntimeInfo[] Device { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public VirtualMachineConnectionState ConnectionState { get; set; }\n\n        public VirtualMachinePowerState PowerState { get; set; }\n\n        public VirtualMachineFaultToleranceState FaultToleranceState { get; set; }\n\n        public VirtualMachineRuntimeInfoDasProtectionState DasVmProtection { get; set; }\n\n        public bool ToolsInstallerMounted { get; set; }\n\n        public DateTime? SuspendTime { get; set; }\n\n        public DateTime? BootTime { get; set; }\n\n        public long? SuspendInterval { get; set; }\n\n        public VirtualMachineQuestionInfo Question { get; set; }\n\n        public long? MemoryOverhead { get; set; }\n\n        public int? MaxCpuUsage { get; set; }\n\n        public int? MaxMemoryUsage { get; set; }\n\n        public int NumMksConnections { get; set; }\n\n        public VirtualMachineRecordReplayState RecordReplayState { get; set; }\n\n        public bool? CleanPowerOff { get; set; }\n\n        public string NeedSecondaryReason { get; set; }\n\n        public bool OnlineStandby { get; set; }\n\n        public string MinRequiredEVCModeKey { get; set; }\n\n        public bool ConsolidationNeeded { get; set; }\n\n        public VirtualMachineFeatureRequirement[] OfflineFeatureRequirement { get; set; }\n\n        public VirtualMachineFeatureRequirement[] FeatureRequirement { get; set; }\n\n        public HostFeatureMask[] FeatureMask { get; set; }\n\n        public long? VFlashCacheAllocation { get; set; }\n\n        public bool? Paused { get; set; }\n\n        public bool? SnapshotInBackground { get; set; }\n\n        public bool? QuiescedForkParent { get; set; }\n\n        public bool? InstantCloneFrozen { get; set; }\n\n        public string CryptoState { get; set; }\n\n        public VirtualMachineRuntimeInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineRuntimeInfo virtualMachineRuntimeInfo)\n        {\n            return (virtualMachineRuntimeInfo != null && ((this.Device == null && virtualMachineRuntimeInfo.Device == null) || (this.Device != null && virtualMachineRuntimeInfo.Device != null && Enumerable.SequenceEqual(this.Device, virtualMachineRuntimeInfo.Device))) && ((this.Host == null && virtualMachineRuntimeInfo.Host == null) || (this.Host != null && this.Host.Equals(virtualMachineRuntimeInfo.Host))) && this.ConnectionState == virtualMachineRuntimeInfo.ConnectionState && this.PowerState == virtualMachineRuntimeInfo.PowerState && this.FaultToleranceState == virtualMachineRuntimeInfo.FaultToleranceState && ((this.DasVmProtection == null && virtualMachineRuntimeInfo.DasVmProtection == null) || (this.DasVmProtection != null && this.DasVmProtection.Equals(virtualMachineRuntimeInfo.DasVmProtection))) && this.ToolsInstallerMounted == virtualMachineRuntimeInfo.ToolsInstallerMounted && ((this.SuspendTime == null && virtualMachineRuntimeInfo.SuspendTime == null) || (this.SuspendTime != null && this.SuspendTime.Equals(virtualMachineRuntimeInfo.SuspendTime))) && ((this.BootTime == null && virtualMachineRuntimeInfo.BootTime == null) || (this.BootTime != null && this.BootTime.Equals(virtualMachineRuntimeInfo.BootTime))) && ((this.SuspendInterval == null && virtualMachineRuntimeInfo.SuspendInterval == null) || (this.SuspendInterval != null && this.SuspendInterval.Equals(virtualMachineRuntimeInfo.SuspendInterval))) && ((this.Question == null && virtualMachineRuntimeInfo.Question == null) || (this.Question != null && this.Question.Equals(virtualMachineRuntimeInfo.Question))) && ((this.MemoryOverhead == null && virtualMachineRuntimeInfo.MemoryOverhead == null) || (this.MemoryOverhead != null && this.MemoryOverhead.Equals(virtualMachineRuntimeInfo.MemoryOverhead))) && ((this.MaxCpuUsage == null && virtualMachineRuntimeInfo.MaxCpuUsage == null) || (this.MaxCpuUsage != null && this.MaxCpuUsage.Equals(virtualMachineRuntimeInfo.MaxCpuUsage))) && ((this.MaxMemoryUsage == null && virtualMachineRuntimeInfo.MaxMemoryUsage == null) || (this.MaxMemoryUsage != null && this.MaxMemoryUsage.Equals(virtualMachineRuntimeInfo.MaxMemoryUsage))) && this.NumMksConnections == virtualMachineRuntimeInfo.NumMksConnections && this.RecordReplayState == virtualMachineRuntimeInfo.RecordReplayState && ((this.CleanPowerOff == null && virtualMachineRuntimeInfo.CleanPowerOff == null) || (this.CleanPowerOff != null && this.CleanPowerOff.Equals(virtualMachineRuntimeInfo.CleanPowerOff))) && this.NeedSecondaryReason == virtualMachineRuntimeInfo.NeedSecondaryReason && this.OnlineStandby == virtualMachineRuntimeInfo.OnlineStandby && this.MinRequiredEVCModeKey == virtualMachineRuntimeInfo.MinRequiredEVCModeKey && this.ConsolidationNeeded == virtualMachineRuntimeInfo.ConsolidationNeeded && ((this.OfflineFeatureRequirement == null && virtualMachineRuntimeInfo.OfflineFeatureRequirement == null) || (this.OfflineFeatureRequirement != null && virtualMachineRuntimeInfo.OfflineFeatureRequirement != null && Enumerable.SequenceEqual(this.OfflineFeatureRequirement, virtualMachineRuntimeInfo.OfflineFeatureRequirement))) && ((this.FeatureRequirement == null && virtualMachineRuntimeInfo.FeatureRequirement == null) || (this.FeatureRequirement != null && virtualMachineRuntimeInfo.FeatureRequirement != null && Enumerable.SequenceEqual(this.FeatureRequirement, virtualMachineRuntimeInfo.FeatureRequirement))) && ((this.FeatureMask == null && virtualMachineRuntimeInfo.FeatureMask == null) || (this.FeatureMask != null && virtualMachineRuntimeInfo.FeatureMask != null && Enumerable.SequenceEqual(this.FeatureMask, virtualMachineRuntimeInfo.FeatureMask))) && ((this.VFlashCacheAllocation == null && virtualMachineRuntimeInfo.VFlashCacheAllocation == null) || (this.VFlashCacheAllocation != null && this.VFlashCacheAllocation.Equals(virtualMachineRuntimeInfo.VFlashCacheAllocation))) && ((this.Paused == null && virtualMachineRuntimeInfo.Paused == null) || (this.Paused != null && this.Paused.Equals(virtualMachineRuntimeInfo.Paused))) && ((this.SnapshotInBackground == null && virtualMachineRuntimeInfo.SnapshotInBackground == null) || (this.SnapshotInBackground != null && this.SnapshotInBackground.Equals(virtualMachineRuntimeInfo.SnapshotInBackground))) && ((this.QuiescedForkParent == null && virtualMachineRuntimeInfo.QuiescedForkParent == null) || (this.QuiescedForkParent != null && this.QuiescedForkParent.Equals(virtualMachineRuntimeInfo.QuiescedForkParent))) && ((this.InstantCloneFrozen == null && virtualMachineRuntimeInfo.InstantCloneFrozen == null) || (this.InstantCloneFrozen != null && this.InstantCloneFrozen.Equals(virtualMachineRuntimeInfo.InstantCloneFrozen))) && this.CryptoState == virtualMachineRuntimeInfo.CryptoState && ((this.LinkedView == null && virtualMachineRuntimeInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineRuntimeInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineRuntimeInfo)\n        {\n            return Equals(virtualMachineRuntimeInfo as VirtualMachineRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Host + \"_\" + ConnectionState + \"_\" + PowerState + \"_\" + FaultToleranceState + \"_\" + DasVmProtection + \"_\" + ToolsInstallerMounted + \"_\" + SuspendTime + \"_\" + BootTime + \"_\" + SuspendInterval + \"_\" + Question + \"_\" + MemoryOverhead + \"_\" + MaxCpuUsage + \"_\" + MaxMemoryUsage + \"_\" + NumMksConnections + \"_\" + RecordReplayState + \"_\" + CleanPowerOff + \"_\" + NeedSecondaryReason + \"_\" + OnlineStandby + \"_\" + MinRequiredEVCModeKey + \"_\" + ConsolidationNeeded + \"_\" + OfflineFeatureRequirement + \"_\" + FeatureRequirement + \"_\" + FeatureMask + \"_\" + VFlashCacheAllocation + \"_\" + Paused + \"_\" + SnapshotInBackground + \"_\" + QuiescedForkParent + \"_\" + InstantCloneFrozen + \"_\" + CryptoState + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRuntimeInfo_LinkedView : IEquatable<VirtualMachineRuntimeInfo_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public bool Equals(VirtualMachineRuntimeInfo_LinkedView virtualMachineRuntimeInfo_LinkedView)\n        {\n            return (virtualMachineRuntimeInfo_LinkedView != null && ((this.Host == null && virtualMachineRuntimeInfo_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(virtualMachineRuntimeInfo_LinkedView.Host))));\n        }\n\n        public override bool Equals(object virtualMachineRuntimeInfo_LinkedView)\n        {\n            return Equals(virtualMachineRuntimeInfo_LinkedView as VirtualMachineRuntimeInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineRuntimeInfoDasProtectionState : DynamicData, IEquatable<VirtualMachineRuntimeInfoDasProtectionState>\n    {\n        public bool DasProtected { get; set; }\n\n        public bool Equals(VirtualMachineRuntimeInfoDasProtectionState virtualMachineRuntimeInfoDasProtectionState)\n        {\n            return (virtualMachineRuntimeInfoDasProtectionState != null && this.DasProtected == virtualMachineRuntimeInfoDasProtectionState.DasProtected);\n        }\n\n        public override bool Equals(object virtualMachineRuntimeInfoDasProtectionState)\n        {\n            return Equals(virtualMachineRuntimeInfoDasProtectionState as VirtualMachineRuntimeInfoDasProtectionState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DasProtected).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineScsiDiskDeviceInfo : VirtualMachineDiskDeviceInfo, IEquatable<VirtualMachineScsiDiskDeviceInfo>\n    {\n        public HostScsiDisk Disk { get; set; }\n\n        public string TransportHint { get; set; }\n\n        public int? LunNumber { get; set; }\n\n        public new VirtualMachineScsiDiskDeviceInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineScsiDiskDeviceInfo virtualMachineScsiDiskDeviceInfo)\n        {\n            return (virtualMachineScsiDiskDeviceInfo != null && ((this.Disk == null && virtualMachineScsiDiskDeviceInfo.Disk == null) || (this.Disk != null && this.Disk.Equals(virtualMachineScsiDiskDeviceInfo.Disk))) && this.TransportHint == virtualMachineScsiDiskDeviceInfo.TransportHint && ((this.LunNumber == null && virtualMachineScsiDiskDeviceInfo.LunNumber == null) || (this.LunNumber != null && this.LunNumber.Equals(virtualMachineScsiDiskDeviceInfo.LunNumber))) && ((this.LinkedView == null && virtualMachineScsiDiskDeviceInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineScsiDiskDeviceInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineScsiDiskDeviceInfo)\n        {\n            return Equals(virtualMachineScsiDiskDeviceInfo as VirtualMachineScsiDiskDeviceInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk + \"_\" + TransportHint + \"_\" + LunNumber + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineScsiDiskDeviceInfo_LinkedView : VirtualMachineDiskDeviceInfo_LinkedView, IEquatable<VirtualMachineScsiDiskDeviceInfo_LinkedView>\n    {\n        public bool Equals(VirtualMachineScsiDiskDeviceInfo_LinkedView virtualMachineScsiDiskDeviceInfo_LinkedView)\n        {\n            return (virtualMachineScsiDiskDeviceInfo_LinkedView != null && base.Equals(virtualMachineScsiDiskDeviceInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualMachineScsiDiskDeviceInfo_LinkedView)\n        {\n            return Equals(virtualMachineScsiDiskDeviceInfo_LinkedView as VirtualMachineScsiDiskDeviceInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineScsiPassthroughInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineScsiPassthroughInfo>\n    {\n        public string ScsiClass { get; set; }\n\n        public string Vendor { get; set; }\n\n        public int PhysicalUnitNumber { get; set; }\n\n        public bool Equals(VirtualMachineScsiPassthroughInfo virtualMachineScsiPassthroughInfo)\n        {\n            return (virtualMachineScsiPassthroughInfo != null && this.ScsiClass == virtualMachineScsiPassthroughInfo.ScsiClass && this.Vendor == virtualMachineScsiPassthroughInfo.Vendor && this.PhysicalUnitNumber == virtualMachineScsiPassthroughInfo.PhysicalUnitNumber);\n        }\n\n        public override bool Equals(object virtualMachineScsiPassthroughInfo)\n        {\n            return Equals(virtualMachineScsiPassthroughInfo as VirtualMachineScsiPassthroughInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScsiClass + \"_\" + Vendor + \"_\" + PhysicalUnitNumber).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSerialInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineSerialInfo>\n    {\n        public bool Equals(VirtualMachineSerialInfo virtualMachineSerialInfo)\n        {\n            return (virtualMachineSerialInfo != null && base.Equals(virtualMachineSerialInfo));\n        }\n\n        public override bool Equals(object virtualMachineSerialInfo)\n        {\n            return Equals(virtualMachineSerialInfo as VirtualMachineSerialInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSnapshot : ExtensibleManagedObject, IEquatable<VirtualMachineSnapshot>\n    {\n        public VirtualMachineConfigInfo Config { get; set; }\n\n        public ManagedObjectReference[] ChildSnapshot { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public VirtualMachineSnapshot_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference RevertToSnapshot_Task(ManagedObjectReference host, bool? suppressPowerOn)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RevertToSnapshot(ManagedObjectReference host, bool? suppressPowerOn)\n        {\n        }\n\n        public ManagedObjectReference RemoveSnapshot_Task(bool removeChildren, bool? consolidate)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void RemoveSnapshot(bool removeChildren, bool? consolidate)\n        {\n        }\n\n        public void RenameSnapshot(string name, string description)\n        {\n        }\n\n        public ManagedObjectReference ExportSnapshot()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(VirtualMachineSnapshot virtualMachineSnapshot)\n        {\n            return (virtualMachineSnapshot != null && ((this.Config == null && virtualMachineSnapshot.Config == null) || (this.Config != null && this.Config.Equals(virtualMachineSnapshot.Config))) && ((this.ChildSnapshot == null && virtualMachineSnapshot.ChildSnapshot == null) || (this.ChildSnapshot != null && virtualMachineSnapshot.ChildSnapshot != null && Enumerable.SequenceEqual(this.ChildSnapshot, virtualMachineSnapshot.ChildSnapshot))) && ((this.Vm == null && virtualMachineSnapshot.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualMachineSnapshot.Vm))) && ((this.LinkedView == null && virtualMachineSnapshot.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineSnapshot.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineSnapshot)\n        {\n            return Equals(virtualMachineSnapshot as VirtualMachineSnapshot);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Config + \"_\" + ChildSnapshot + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSnapshot_LinkedView : IEquatable<VirtualMachineSnapshot_LinkedView>\n    {\n        public VirtualMachineSnapshot[] ChildSnapshot { get; set; }\n\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(VirtualMachineSnapshot_LinkedView virtualMachineSnapshot_LinkedView)\n        {\n            return (virtualMachineSnapshot_LinkedView != null && ((this.ChildSnapshot == null && virtualMachineSnapshot_LinkedView.ChildSnapshot == null) || (this.ChildSnapshot != null && virtualMachineSnapshot_LinkedView.ChildSnapshot != null && Enumerable.SequenceEqual(this.ChildSnapshot, virtualMachineSnapshot_LinkedView.ChildSnapshot))) && ((this.Vm == null && virtualMachineSnapshot_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualMachineSnapshot_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object virtualMachineSnapshot_LinkedView)\n        {\n            return Equals(virtualMachineSnapshot_LinkedView as VirtualMachineSnapshot_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChildSnapshot + \"_\" + Vm).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSnapshotInfo : DynamicData, IEquatable<VirtualMachineSnapshotInfo>\n    {\n        public ManagedObjectReference CurrentSnapshot { get; set; }\n\n        public VirtualMachineSnapshotTree[] RootSnapshotList { get; set; }\n\n        public VirtualMachineSnapshotInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineSnapshotInfo virtualMachineSnapshotInfo)\n        {\n            return (virtualMachineSnapshotInfo != null && ((this.CurrentSnapshot == null && virtualMachineSnapshotInfo.CurrentSnapshot == null) || (this.CurrentSnapshot != null && this.CurrentSnapshot.Equals(virtualMachineSnapshotInfo.CurrentSnapshot))) && ((this.RootSnapshotList == null && virtualMachineSnapshotInfo.RootSnapshotList == null) || (this.RootSnapshotList != null && virtualMachineSnapshotInfo.RootSnapshotList != null && Enumerable.SequenceEqual(this.RootSnapshotList, virtualMachineSnapshotInfo.RootSnapshotList))) && ((this.LinkedView == null && virtualMachineSnapshotInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineSnapshotInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineSnapshotInfo)\n        {\n            return Equals(virtualMachineSnapshotInfo as VirtualMachineSnapshotInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentSnapshot + \"_\" + RootSnapshotList + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSnapshotInfo_LinkedView : IEquatable<VirtualMachineSnapshotInfo_LinkedView>\n    {\n        public VirtualMachineSnapshot CurrentSnapshot { get; set; }\n\n        public bool Equals(VirtualMachineSnapshotInfo_LinkedView virtualMachineSnapshotInfo_LinkedView)\n        {\n            return (virtualMachineSnapshotInfo_LinkedView != null && ((this.CurrentSnapshot == null && virtualMachineSnapshotInfo_LinkedView.CurrentSnapshot == null) || (this.CurrentSnapshot != null && this.CurrentSnapshot.Equals(virtualMachineSnapshotInfo_LinkedView.CurrentSnapshot))));\n        }\n\n        public override bool Equals(object virtualMachineSnapshotInfo_LinkedView)\n        {\n            return Equals(virtualMachineSnapshotInfo_LinkedView as VirtualMachineSnapshotInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CurrentSnapshot).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSnapshotTree : DynamicData, IEquatable<VirtualMachineSnapshotTree>\n    {\n        public ManagedObjectReference Snapshot { get; set; }\n\n        public ManagedObjectReference Vm { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public int Id { get; set; }\n\n        public DateTime CreateTime { get; set; }\n\n        public VirtualMachinePowerState State { get; set; }\n\n        public bool Quiesced { get; set; }\n\n        public string BackupManifest { get; set; }\n\n        public VirtualMachineSnapshotTree[] ChildSnapshotList { get; set; }\n\n        public bool? ReplaySupported { get; set; }\n\n        public VirtualMachineSnapshotTree_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineSnapshotTree virtualMachineSnapshotTree)\n        {\n            return (virtualMachineSnapshotTree != null && ((this.Snapshot == null && virtualMachineSnapshotTree.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(virtualMachineSnapshotTree.Snapshot))) && ((this.Vm == null && virtualMachineSnapshotTree.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualMachineSnapshotTree.Vm))) && this.Name == virtualMachineSnapshotTree.Name && this.Description == virtualMachineSnapshotTree.Description && this.Id == virtualMachineSnapshotTree.Id && this.CreateTime == virtualMachineSnapshotTree.CreateTime && this.State == virtualMachineSnapshotTree.State && this.Quiesced == virtualMachineSnapshotTree.Quiesced && this.BackupManifest == virtualMachineSnapshotTree.BackupManifest && ((this.ChildSnapshotList == null && virtualMachineSnapshotTree.ChildSnapshotList == null) || (this.ChildSnapshotList != null && virtualMachineSnapshotTree.ChildSnapshotList != null && Enumerable.SequenceEqual(this.ChildSnapshotList, virtualMachineSnapshotTree.ChildSnapshotList))) && ((this.ReplaySupported == null && virtualMachineSnapshotTree.ReplaySupported == null) || (this.ReplaySupported != null && this.ReplaySupported.Equals(virtualMachineSnapshotTree.ReplaySupported))) && ((this.LinkedView == null && virtualMachineSnapshotTree.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineSnapshotTree.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineSnapshotTree)\n        {\n            return Equals(virtualMachineSnapshotTree as VirtualMachineSnapshotTree);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Snapshot + \"_\" + Vm + \"_\" + Name + \"_\" + Description + \"_\" + Id + \"_\" + CreateTime + \"_\" + State + \"_\" + Quiesced + \"_\" + BackupManifest + \"_\" + ChildSnapshotList + \"_\" + ReplaySupported + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSnapshotTree_LinkedView : IEquatable<VirtualMachineSnapshotTree_LinkedView>\n    {\n        public VirtualMachineSnapshot Snapshot { get; set; }\n\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(VirtualMachineSnapshotTree_LinkedView virtualMachineSnapshotTree_LinkedView)\n        {\n            return (virtualMachineSnapshotTree_LinkedView != null && ((this.Snapshot == null && virtualMachineSnapshotTree_LinkedView.Snapshot == null) || (this.Snapshot != null && this.Snapshot.Equals(virtualMachineSnapshotTree_LinkedView.Snapshot))) && ((this.Vm == null && virtualMachineSnapshotTree_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualMachineSnapshotTree_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object virtualMachineSnapshotTree_LinkedView)\n        {\n            return Equals(virtualMachineSnapshotTree_LinkedView as VirtualMachineSnapshotTree_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Snapshot + \"_\" + Vm).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSoundInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineSoundInfo>\n    {\n        public bool Equals(VirtualMachineSoundInfo virtualMachineSoundInfo)\n        {\n            return (virtualMachineSoundInfo != null && base.Equals(virtualMachineSoundInfo));\n        }\n\n        public override bool Equals(object virtualMachineSoundInfo)\n        {\n            return Equals(virtualMachineSoundInfo as VirtualMachineSoundInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSriovDevicePoolInfo : DynamicData, IEquatable<VirtualMachineSriovDevicePoolInfo>\n    {\n        public string Key { get; set; }\n\n        public bool Equals(VirtualMachineSriovDevicePoolInfo virtualMachineSriovDevicePoolInfo)\n        {\n            return (virtualMachineSriovDevicePoolInfo != null && this.Key == virtualMachineSriovDevicePoolInfo.Key);\n        }\n\n        public override bool Equals(object virtualMachineSriovDevicePoolInfo)\n        {\n            return Equals(virtualMachineSriovDevicePoolInfo as VirtualMachineSriovDevicePoolInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSriovInfo : VirtualMachinePciPassthroughInfo, IEquatable<VirtualMachineSriovInfo>\n    {\n        public bool VirtualFunction { get; set; }\n\n        public string Pnic { get; set; }\n\n        public VirtualMachineSriovDevicePoolInfo DevicePool { get; set; }\n\n        public bool Equals(VirtualMachineSriovInfo virtualMachineSriovInfo)\n        {\n            return (virtualMachineSriovInfo != null && this.VirtualFunction == virtualMachineSriovInfo.VirtualFunction && this.Pnic == virtualMachineSriovInfo.Pnic && ((this.DevicePool == null && virtualMachineSriovInfo.DevicePool == null) || (this.DevicePool != null && this.DevicePool.Equals(virtualMachineSriovInfo.DevicePool))));\n        }\n\n        public override bool Equals(object virtualMachineSriovInfo)\n        {\n            return Equals(virtualMachineSriovInfo as VirtualMachineSriovInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualFunction + \"_\" + Pnic + \"_\" + DevicePool).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSriovNetworkDevicePoolInfo : VirtualMachineSriovDevicePoolInfo, IEquatable<VirtualMachineSriovNetworkDevicePoolInfo>\n    {\n        public string SwitchKey { get; set; }\n\n        public string SwitchUuid { get; set; }\n\n        public bool Equals(VirtualMachineSriovNetworkDevicePoolInfo virtualMachineSriovNetworkDevicePoolInfo)\n        {\n            return (virtualMachineSriovNetworkDevicePoolInfo != null && this.SwitchKey == virtualMachineSriovNetworkDevicePoolInfo.SwitchKey && this.SwitchUuid == virtualMachineSriovNetworkDevicePoolInfo.SwitchUuid);\n        }\n\n        public override bool Equals(object virtualMachineSriovNetworkDevicePoolInfo)\n        {\n            return Equals(virtualMachineSriovNetworkDevicePoolInfo as VirtualMachineSriovNetworkDevicePoolInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SwitchKey + \"_\" + SwitchUuid).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineStorageInfo : DynamicData, IEquatable<VirtualMachineStorageInfo>\n    {\n        public VirtualMachineUsageOnDatastore[] PerDatastoreUsage { get; set; }\n\n        public DateTime Timestamp { get; set; }\n\n        public bool Equals(VirtualMachineStorageInfo virtualMachineStorageInfo)\n        {\n            return (virtualMachineStorageInfo != null && ((this.PerDatastoreUsage == null && virtualMachineStorageInfo.PerDatastoreUsage == null) || (this.PerDatastoreUsage != null && virtualMachineStorageInfo.PerDatastoreUsage != null && Enumerable.SequenceEqual(this.PerDatastoreUsage, virtualMachineStorageInfo.PerDatastoreUsage))) && this.Timestamp == virtualMachineStorageInfo.Timestamp);\n        }\n\n        public override bool Equals(object virtualMachineStorageInfo)\n        {\n            return Equals(virtualMachineStorageInfo as VirtualMachineStorageInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PerDatastoreUsage + \"_\" + Timestamp).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineStorageSummary : DynamicData, IEquatable<VirtualMachineStorageSummary>\n    {\n        public long Committed { get; set; }\n\n        public long Uncommitted { get; set; }\n\n        public long Unshared { get; set; }\n\n        public DateTime Timestamp { get; set; }\n\n        public bool Equals(VirtualMachineStorageSummary virtualMachineStorageSummary)\n        {\n            return (virtualMachineStorageSummary != null && this.Committed == virtualMachineStorageSummary.Committed && this.Uncommitted == virtualMachineStorageSummary.Uncommitted && this.Unshared == virtualMachineStorageSummary.Unshared && this.Timestamp == virtualMachineStorageSummary.Timestamp);\n        }\n\n        public override bool Equals(object virtualMachineStorageSummary)\n        {\n            return Equals(virtualMachineStorageSummary as VirtualMachineStorageSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Committed + \"_\" + Uncommitted + \"_\" + Unshared + \"_\" + Timestamp).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSummary : DynamicData, IEquatable<VirtualMachineSummary>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public VirtualMachineRuntimeInfo Runtime { get; set; }\n\n        public VirtualMachineGuestSummary Guest { get; set; }\n\n        public VirtualMachineConfigSummary Config { get; set; }\n\n        public VirtualMachineStorageSummary Storage { get; set; }\n\n        public VirtualMachineQuickStats QuickStats { get; set; }\n\n        public ManagedEntityStatus OverallStatus { get; set; }\n\n        public CustomFieldValue[] CustomValue { get; set; }\n\n        public VirtualMachineSummary_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineSummary virtualMachineSummary)\n        {\n            return (virtualMachineSummary != null && ((this.Vm == null && virtualMachineSummary.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualMachineSummary.Vm))) && ((this.Runtime == null && virtualMachineSummary.Runtime == null) || (this.Runtime != null && this.Runtime.Equals(virtualMachineSummary.Runtime))) && ((this.Guest == null && virtualMachineSummary.Guest == null) || (this.Guest != null && this.Guest.Equals(virtualMachineSummary.Guest))) && ((this.Config == null && virtualMachineSummary.Config == null) || (this.Config != null && this.Config.Equals(virtualMachineSummary.Config))) && ((this.Storage == null && virtualMachineSummary.Storage == null) || (this.Storage != null && this.Storage.Equals(virtualMachineSummary.Storage))) && ((this.QuickStats == null && virtualMachineSummary.QuickStats == null) || (this.QuickStats != null && this.QuickStats.Equals(virtualMachineSummary.QuickStats))) && this.OverallStatus == virtualMachineSummary.OverallStatus && ((this.CustomValue == null && virtualMachineSummary.CustomValue == null) || (this.CustomValue != null && virtualMachineSummary.CustomValue != null && Enumerable.SequenceEqual(this.CustomValue, virtualMachineSummary.CustomValue))) && ((this.LinkedView == null && virtualMachineSummary.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineSummary.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineSummary)\n        {\n            return Equals(virtualMachineSummary as VirtualMachineSummary);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Runtime + \"_\" + Guest + \"_\" + Config + \"_\" + Storage + \"_\" + QuickStats + \"_\" + OverallStatus + \"_\" + CustomValue + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineSummary_LinkedView : IEquatable<VirtualMachineSummary_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(VirtualMachineSummary_LinkedView virtualMachineSummary_LinkedView)\n        {\n            return (virtualMachineSummary_LinkedView != null && ((this.Vm == null && virtualMachineSummary_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(virtualMachineSummary_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object virtualMachineSummary_LinkedView)\n        {\n            return Equals(virtualMachineSummary_LinkedView as VirtualMachineSummary_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineTargetInfo : DynamicData, IEquatable<VirtualMachineTargetInfo>\n    {\n        public string Name { get; set; }\n\n        public string[] ConfigurationTag { get; set; }\n\n        public bool Equals(VirtualMachineTargetInfo virtualMachineTargetInfo)\n        {\n            return (virtualMachineTargetInfo != null && this.Name == virtualMachineTargetInfo.Name && ((this.ConfigurationTag == null && virtualMachineTargetInfo.ConfigurationTag == null) || (this.ConfigurationTag != null && virtualMachineTargetInfo.ConfigurationTag != null && Enumerable.SequenceEqual(this.ConfigurationTag, virtualMachineTargetInfo.ConfigurationTag))));\n        }\n\n        public override bool Equals(object virtualMachineTargetInfo)\n        {\n            return Equals(virtualMachineTargetInfo as VirtualMachineTargetInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + ConfigurationTag).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineTicket : DynamicData, IEquatable<VirtualMachineTicket>\n    {\n        public string Ticket { get; set; }\n\n        public string CfgFile { get; set; }\n\n        public string Host { get; set; }\n\n        public int? Port { get; set; }\n\n        public string SslThumbprint { get; set; }\n\n        public bool Equals(VirtualMachineTicket virtualMachineTicket)\n        {\n            return (virtualMachineTicket != null && this.Ticket == virtualMachineTicket.Ticket && this.CfgFile == virtualMachineTicket.CfgFile && this.Host == virtualMachineTicket.Host && ((this.Port == null && virtualMachineTicket.Port == null) || (this.Port != null && this.Port.Equals(virtualMachineTicket.Port))) && this.SslThumbprint == virtualMachineTicket.SslThumbprint);\n        }\n\n        public override bool Equals(object virtualMachineTicket)\n        {\n            return Equals(virtualMachineTicket as VirtualMachineTicket);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ticket + \"_\" + CfgFile + \"_\" + Host + \"_\" + Port + \"_\" + SslThumbprint).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineUsageOnDatastore : DynamicData, IEquatable<VirtualMachineUsageOnDatastore>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public long Committed { get; set; }\n\n        public long Uncommitted { get; set; }\n\n        public long Unshared { get; set; }\n\n        public VirtualMachineUsageOnDatastore_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualMachineUsageOnDatastore virtualMachineUsageOnDatastore)\n        {\n            return (virtualMachineUsageOnDatastore != null && ((this.Datastore == null && virtualMachineUsageOnDatastore.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineUsageOnDatastore.Datastore))) && this.Committed == virtualMachineUsageOnDatastore.Committed && this.Uncommitted == virtualMachineUsageOnDatastore.Uncommitted && this.Unshared == virtualMachineUsageOnDatastore.Unshared && ((this.LinkedView == null && virtualMachineUsageOnDatastore.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualMachineUsageOnDatastore.LinkedView))));\n        }\n\n        public override bool Equals(object virtualMachineUsageOnDatastore)\n        {\n            return Equals(virtualMachineUsageOnDatastore as VirtualMachineUsageOnDatastore);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Committed + \"_\" + Uncommitted + \"_\" + Unshared + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineUsageOnDatastore_LinkedView : IEquatable<VirtualMachineUsageOnDatastore_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(VirtualMachineUsageOnDatastore_LinkedView virtualMachineUsageOnDatastore_LinkedView)\n        {\n            return (virtualMachineUsageOnDatastore_LinkedView != null && ((this.Datastore == null && virtualMachineUsageOnDatastore_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(virtualMachineUsageOnDatastore_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object virtualMachineUsageOnDatastore_LinkedView)\n        {\n            return Equals(virtualMachineUsageOnDatastore_LinkedView as VirtualMachineUsageOnDatastore_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineUsbInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineUsbInfo>\n    {\n        public string Description { get; set; }\n\n        public int Vendor { get; set; }\n\n        public int Product { get; set; }\n\n        public string PhysicalPath { get; set; }\n\n        public string[] Family { get; set; }\n\n        public string[] Speed { get; set; }\n\n        public VirtualMachineSummary Summary { get; set; }\n\n        public bool Equals(VirtualMachineUsbInfo virtualMachineUsbInfo)\n        {\n            return (virtualMachineUsbInfo != null && this.Description == virtualMachineUsbInfo.Description && this.Vendor == virtualMachineUsbInfo.Vendor && this.Product == virtualMachineUsbInfo.Product && this.PhysicalPath == virtualMachineUsbInfo.PhysicalPath && ((this.Family == null && virtualMachineUsbInfo.Family == null) || (this.Family != null && virtualMachineUsbInfo.Family != null && Enumerable.SequenceEqual(this.Family, virtualMachineUsbInfo.Family))) && ((this.Speed == null && virtualMachineUsbInfo.Speed == null) || (this.Speed != null && virtualMachineUsbInfo.Speed != null && Enumerable.SequenceEqual(this.Speed, virtualMachineUsbInfo.Speed))) && ((this.Summary == null && virtualMachineUsbInfo.Summary == null) || (this.Summary != null && this.Summary.Equals(virtualMachineUsbInfo.Summary))));\n        }\n\n        public override bool Equals(object virtualMachineUsbInfo)\n        {\n            return Equals(virtualMachineUsbInfo as VirtualMachineUsbInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + Vendor + \"_\" + Product + \"_\" + PhysicalPath + \"_\" + Family + \"_\" + Speed + \"_\" + Summary).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVFlashModuleInfo : VirtualMachineTargetInfo, IEquatable<VirtualMachineVFlashModuleInfo>\n    {\n        public HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption VFlashModule { get; set; }\n\n        public bool Equals(VirtualMachineVFlashModuleInfo virtualMachineVFlashModuleInfo)\n        {\n            return (virtualMachineVFlashModuleInfo != null && ((this.VFlashModule == null && virtualMachineVFlashModuleInfo.VFlashModule == null) || (this.VFlashModule != null && this.VFlashModule.Equals(virtualMachineVFlashModuleInfo.VFlashModule))));\n        }\n\n        public override bool Equals(object virtualMachineVFlashModuleInfo)\n        {\n            return Equals(virtualMachineVFlashModuleInfo as VirtualMachineVFlashModuleInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VFlashModule).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVideoCard : VirtualDevice, IEquatable<VirtualMachineVideoCard>\n    {\n        public long? VideoRamSizeInKB { get; set; }\n\n        public int? NumDisplays { get; set; }\n\n        public bool? UseAutoDetect { get; set; }\n\n        public bool? Enable3DSupport { get; set; }\n\n        public string Use3dRenderer { get; set; }\n\n        public long? GraphicsMemorySizeInKB { get; set; }\n\n        public bool Equals(VirtualMachineVideoCard virtualMachineVideoCard)\n        {\n            return (virtualMachineVideoCard != null && ((this.VideoRamSizeInKB == null && virtualMachineVideoCard.VideoRamSizeInKB == null) || (this.VideoRamSizeInKB != null && this.VideoRamSizeInKB.Equals(virtualMachineVideoCard.VideoRamSizeInKB))) && ((this.NumDisplays == null && virtualMachineVideoCard.NumDisplays == null) || (this.NumDisplays != null && this.NumDisplays.Equals(virtualMachineVideoCard.NumDisplays))) && ((this.UseAutoDetect == null && virtualMachineVideoCard.UseAutoDetect == null) || (this.UseAutoDetect != null && this.UseAutoDetect.Equals(virtualMachineVideoCard.UseAutoDetect))) && ((this.Enable3DSupport == null && virtualMachineVideoCard.Enable3DSupport == null) || (this.Enable3DSupport != null && this.Enable3DSupport.Equals(virtualMachineVideoCard.Enable3DSupport))) && this.Use3dRenderer == virtualMachineVideoCard.Use3dRenderer && ((this.GraphicsMemorySizeInKB == null && virtualMachineVideoCard.GraphicsMemorySizeInKB == null) || (this.GraphicsMemorySizeInKB != null && this.GraphicsMemorySizeInKB.Equals(virtualMachineVideoCard.GraphicsMemorySizeInKB))));\n        }\n\n        public override bool Equals(object virtualMachineVideoCard)\n        {\n            return Equals(virtualMachineVideoCard as VirtualMachineVideoCard);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VideoRamSizeInKB + \"_\" + NumDisplays + \"_\" + UseAutoDetect + \"_\" + Enable3DSupport + \"_\" + Use3dRenderer + \"_\" + GraphicsMemorySizeInKB).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVMCIDevice : VirtualDevice, IEquatable<VirtualMachineVMCIDevice>\n    {\n        public long? Id { get; set; }\n\n        public bool? AllowUnrestrictedCommunication { get; set; }\n\n        public bool? FilterEnable { get; set; }\n\n        public VirtualMachineVMCIDeviceFilterInfo FilterInfo { get; set; }\n\n        public bool Equals(VirtualMachineVMCIDevice virtualMachineVMCIDevice)\n        {\n            return (virtualMachineVMCIDevice != null && ((this.Id == null && virtualMachineVMCIDevice.Id == null) || (this.Id != null && this.Id.Equals(virtualMachineVMCIDevice.Id))) && ((this.AllowUnrestrictedCommunication == null && virtualMachineVMCIDevice.AllowUnrestrictedCommunication == null) || (this.AllowUnrestrictedCommunication != null && this.AllowUnrestrictedCommunication.Equals(virtualMachineVMCIDevice.AllowUnrestrictedCommunication))) && ((this.FilterEnable == null && virtualMachineVMCIDevice.FilterEnable == null) || (this.FilterEnable != null && this.FilterEnable.Equals(virtualMachineVMCIDevice.FilterEnable))) && ((this.FilterInfo == null && virtualMachineVMCIDevice.FilterInfo == null) || (this.FilterInfo != null && this.FilterInfo.Equals(virtualMachineVMCIDevice.FilterInfo))));\n        }\n\n        public override bool Equals(object virtualMachineVMCIDevice)\n        {\n            return Equals(virtualMachineVMCIDevice as VirtualMachineVMCIDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + AllowUnrestrictedCommunication + \"_\" + FilterEnable + \"_\" + FilterInfo).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVMCIDeviceFilterInfo : DynamicData, IEquatable<VirtualMachineVMCIDeviceFilterInfo>\n    {\n        public VirtualMachineVMCIDeviceFilterSpec[] Filters { get; set; }\n\n        public bool Equals(VirtualMachineVMCIDeviceFilterInfo virtualMachineVMCIDeviceFilterInfo)\n        {\n            return (virtualMachineVMCIDeviceFilterInfo != null && ((this.Filters == null && virtualMachineVMCIDeviceFilterInfo.Filters == null) || (this.Filters != null && virtualMachineVMCIDeviceFilterInfo.Filters != null && Enumerable.SequenceEqual(this.Filters, virtualMachineVMCIDeviceFilterInfo.Filters))));\n        }\n\n        public override bool Equals(object virtualMachineVMCIDeviceFilterInfo)\n        {\n            return Equals(virtualMachineVMCIDeviceFilterInfo as VirtualMachineVMCIDeviceFilterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filters).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVMCIDeviceFilterSpec : DynamicData, IEquatable<VirtualMachineVMCIDeviceFilterSpec>\n    {\n        public long Rank { get; set; }\n\n        public string Action { get; set; }\n\n        public string Protocol { get; set; }\n\n        public string Direction { get; set; }\n\n        public long? LowerDstPortBoundary { get; set; }\n\n        public long? UpperDstPortBoundary { get; set; }\n\n        public bool Equals(VirtualMachineVMCIDeviceFilterSpec virtualMachineVMCIDeviceFilterSpec)\n        {\n            return (virtualMachineVMCIDeviceFilterSpec != null && this.Rank == virtualMachineVMCIDeviceFilterSpec.Rank && this.Action == virtualMachineVMCIDeviceFilterSpec.Action && this.Protocol == virtualMachineVMCIDeviceFilterSpec.Protocol && this.Direction == virtualMachineVMCIDeviceFilterSpec.Direction && ((this.LowerDstPortBoundary == null && virtualMachineVMCIDeviceFilterSpec.LowerDstPortBoundary == null) || (this.LowerDstPortBoundary != null && this.LowerDstPortBoundary.Equals(virtualMachineVMCIDeviceFilterSpec.LowerDstPortBoundary))) && ((this.UpperDstPortBoundary == null && virtualMachineVMCIDeviceFilterSpec.UpperDstPortBoundary == null) || (this.UpperDstPortBoundary != null && this.UpperDstPortBoundary.Equals(virtualMachineVMCIDeviceFilterSpec.UpperDstPortBoundary))));\n        }\n\n        public override bool Equals(object virtualMachineVMCIDeviceFilterSpec)\n        {\n            return Equals(virtualMachineVMCIDeviceFilterSpec as VirtualMachineVMCIDeviceFilterSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Rank + \"_\" + Action + \"_\" + Protocol + \"_\" + Direction + \"_\" + LowerDstPortBoundary + \"_\" + UpperDstPortBoundary).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVMCIDeviceOption : VirtualDeviceOption, IEquatable<VirtualMachineVMCIDeviceOption>\n    {\n        public BoolOption AllowUnrestrictedCommunication { get; set; }\n\n        public VirtualMachineVMCIDeviceOptionFilterSpecOption FilterSpecOption { get; set; }\n\n        public BoolOption FilterSupported { get; set; }\n\n        public bool Equals(VirtualMachineVMCIDeviceOption virtualMachineVMCIDeviceOption)\n        {\n            return (virtualMachineVMCIDeviceOption != null && ((this.AllowUnrestrictedCommunication == null && virtualMachineVMCIDeviceOption.AllowUnrestrictedCommunication == null) || (this.AllowUnrestrictedCommunication != null && this.AllowUnrestrictedCommunication.Equals(virtualMachineVMCIDeviceOption.AllowUnrestrictedCommunication))) && ((this.FilterSpecOption == null && virtualMachineVMCIDeviceOption.FilterSpecOption == null) || (this.FilterSpecOption != null && this.FilterSpecOption.Equals(virtualMachineVMCIDeviceOption.FilterSpecOption))) && ((this.FilterSupported == null && virtualMachineVMCIDeviceOption.FilterSupported == null) || (this.FilterSupported != null && this.FilterSupported.Equals(virtualMachineVMCIDeviceOption.FilterSupported))));\n        }\n\n        public override bool Equals(object virtualMachineVMCIDeviceOption)\n        {\n            return Equals(virtualMachineVMCIDeviceOption as VirtualMachineVMCIDeviceOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowUnrestrictedCommunication + \"_\" + FilterSpecOption + \"_\" + FilterSupported).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVMCIDeviceOptionFilterSpecOption : DynamicData, IEquatable<VirtualMachineVMCIDeviceOptionFilterSpecOption>\n    {\n        public ChoiceOption Action { get; set; }\n\n        public ChoiceOption Protocol { get; set; }\n\n        public ChoiceOption Direction { get; set; }\n\n        public LongOption LowerDstPortBoundary { get; set; }\n\n        public LongOption UpperDstPortBoundary { get; set; }\n\n        public bool Equals(VirtualMachineVMCIDeviceOptionFilterSpecOption virtualMachineVMCIDeviceOptionFilterSpecOption)\n        {\n            return (virtualMachineVMCIDeviceOptionFilterSpecOption != null && ((this.Action == null && virtualMachineVMCIDeviceOptionFilterSpecOption.Action == null) || (this.Action != null && this.Action.Equals(virtualMachineVMCIDeviceOptionFilterSpecOption.Action))) && ((this.Protocol == null && virtualMachineVMCIDeviceOptionFilterSpecOption.Protocol == null) || (this.Protocol != null && this.Protocol.Equals(virtualMachineVMCIDeviceOptionFilterSpecOption.Protocol))) && ((this.Direction == null && virtualMachineVMCIDeviceOptionFilterSpecOption.Direction == null) || (this.Direction != null && this.Direction.Equals(virtualMachineVMCIDeviceOptionFilterSpecOption.Direction))) && ((this.LowerDstPortBoundary == null && virtualMachineVMCIDeviceOptionFilterSpecOption.LowerDstPortBoundary == null) || (this.LowerDstPortBoundary != null && this.LowerDstPortBoundary.Equals(virtualMachineVMCIDeviceOptionFilterSpecOption.LowerDstPortBoundary))) && ((this.UpperDstPortBoundary == null && virtualMachineVMCIDeviceOptionFilterSpecOption.UpperDstPortBoundary == null) || (this.UpperDstPortBoundary != null && this.UpperDstPortBoundary.Equals(virtualMachineVMCIDeviceOptionFilterSpecOption.UpperDstPortBoundary))));\n        }\n\n        public override bool Equals(object virtualMachineVMCIDeviceOptionFilterSpecOption)\n        {\n            return Equals(virtualMachineVMCIDeviceOptionFilterSpecOption as VirtualMachineVMCIDeviceOptionFilterSpecOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Action + \"_\" + Protocol + \"_\" + Direction + \"_\" + LowerDstPortBoundary + \"_\" + UpperDstPortBoundary).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineVMIROM : VirtualDevice, IEquatable<VirtualMachineVMIROM>\n    {\n        public bool Equals(VirtualMachineVMIROM virtualMachineVMIROM)\n        {\n            return (virtualMachineVMIROM != null && base.Equals(virtualMachineVMIROM));\n        }\n\n        public override bool Equals(object virtualMachineVMIROM)\n        {\n            return Equals(virtualMachineVMIROM as VirtualMachineVMIROM);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualMachineWindowsQuiesceSpec : VirtualMachineGuestQuiesceSpec, IEquatable<VirtualMachineWindowsQuiesceSpec>\n    {\n        public int? VssBackupType { get; set; }\n\n        public bool? VssBootableSystemState { get; set; }\n\n        public bool? VssPartialFileSupport { get; set; }\n\n        public string VssBackupContext { get; set; }\n\n        public bool Equals(VirtualMachineWindowsQuiesceSpec virtualMachineWindowsQuiesceSpec)\n        {\n            return (virtualMachineWindowsQuiesceSpec != null && ((this.VssBackupType == null && virtualMachineWindowsQuiesceSpec.VssBackupType == null) || (this.VssBackupType != null && this.VssBackupType.Equals(virtualMachineWindowsQuiesceSpec.VssBackupType))) && ((this.VssBootableSystemState == null && virtualMachineWindowsQuiesceSpec.VssBootableSystemState == null) || (this.VssBootableSystemState != null && this.VssBootableSystemState.Equals(virtualMachineWindowsQuiesceSpec.VssBootableSystemState))) && ((this.VssPartialFileSupport == null && virtualMachineWindowsQuiesceSpec.VssPartialFileSupport == null) || (this.VssPartialFileSupport != null && this.VssPartialFileSupport.Equals(virtualMachineWindowsQuiesceSpec.VssPartialFileSupport))) && this.VssBackupContext == virtualMachineWindowsQuiesceSpec.VssBackupContext);\n        }\n\n        public override bool Equals(object virtualMachineWindowsQuiesceSpec)\n        {\n            return Equals(virtualMachineWindowsQuiesceSpec as VirtualMachineWindowsQuiesceSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VssBackupType + \"_\" + VssBootableSystemState + \"_\" + VssPartialFileSupport + \"_\" + VssBackupContext).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineWipeResult : DynamicData, IEquatable<VirtualMachineWipeResult>\n    {\n        public int DiskId { get; set; }\n\n        public long ShrinkableDiskSpace { get; set; }\n\n        public bool Equals(VirtualMachineWipeResult virtualMachineWipeResult)\n        {\n            return (virtualMachineWipeResult != null && this.DiskId == virtualMachineWipeResult.DiskId && this.ShrinkableDiskSpace == virtualMachineWipeResult.ShrinkableDiskSpace);\n        }\n\n        public override bool Equals(object virtualMachineWipeResult)\n        {\n            return Equals(virtualMachineWipeResult as VirtualMachineWipeResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId + \"_\" + ShrinkableDiskSpace).GetHashCode();\n        }\n    }\n\n    public class VirtualNicManagerNetConfig : DynamicData, IEquatable<VirtualNicManagerNetConfig>\n    {\n        public string NicType { get; set; }\n\n        public bool MultiSelectAllowed { get; set; }\n\n        public HostVirtualNic[] CandidateVnic { get; set; }\n\n        public string[] SelectedVnic { get; set; }\n\n        public bool Equals(VirtualNicManagerNetConfig virtualNicManagerNetConfig)\n        {\n            return (virtualNicManagerNetConfig != null && this.NicType == virtualNicManagerNetConfig.NicType && this.MultiSelectAllowed == virtualNicManagerNetConfig.MultiSelectAllowed && ((this.CandidateVnic == null && virtualNicManagerNetConfig.CandidateVnic == null) || (this.CandidateVnic != null && virtualNicManagerNetConfig.CandidateVnic != null && Enumerable.SequenceEqual(this.CandidateVnic, virtualNicManagerNetConfig.CandidateVnic))) && ((this.SelectedVnic == null && virtualNicManagerNetConfig.SelectedVnic == null) || (this.SelectedVnic != null && virtualNicManagerNetConfig.SelectedVnic != null && Enumerable.SequenceEqual(this.SelectedVnic, virtualNicManagerNetConfig.SelectedVnic))));\n        }\n\n        public override bool Equals(object virtualNicManagerNetConfig)\n        {\n            return Equals(virtualNicManagerNetConfig as VirtualNicManagerNetConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NicType + \"_\" + MultiSelectAllowed + \"_\" + CandidateVnic + \"_\" + SelectedVnic).GetHashCode();\n        }\n    }\n\n    public class VirtualNVDIMM : VirtualDevice, IEquatable<VirtualNVDIMM>\n    {\n        public long CapacityInMB { get; set; }\n\n        public bool Equals(VirtualNVDIMM virtualNVDIMM)\n        {\n            return (virtualNVDIMM != null && this.CapacityInMB == virtualNVDIMM.CapacityInMB);\n        }\n\n        public override bool Equals(object virtualNVDIMM)\n        {\n            return Equals(virtualNVDIMM as VirtualNVDIMM);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityInMB).GetHashCode();\n        }\n    }\n\n    public class VirtualNVDIMMBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualNVDIMMBackingInfo>\n    {\n        public VirtualNVDIMMBackingInfo Parent { get; set; }\n\n        public string ChangeId { get; set; }\n\n        public new VirtualNVDIMMBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualNVDIMMBackingInfo virtualNVDIMMBackingInfo)\n        {\n            return (virtualNVDIMMBackingInfo != null && ((this.Parent == null && virtualNVDIMMBackingInfo.Parent == null) || (this.Parent != null && this.Parent.Equals(virtualNVDIMMBackingInfo.Parent))) && this.ChangeId == virtualNVDIMMBackingInfo.ChangeId && ((this.LinkedView == null && virtualNVDIMMBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualNVDIMMBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualNVDIMMBackingInfo)\n        {\n            return Equals(virtualNVDIMMBackingInfo as VirtualNVDIMMBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Parent + \"_\" + ChangeId + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualNVDIMMBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualNVDIMMBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualNVDIMMBackingInfo_LinkedView virtualNVDIMMBackingInfo_LinkedView)\n        {\n            return (virtualNVDIMMBackingInfo_LinkedView != null && base.Equals(virtualNVDIMMBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualNVDIMMBackingInfo_LinkedView)\n        {\n            return Equals(virtualNVDIMMBackingInfo_LinkedView as VirtualNVDIMMBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualNVDIMMController : VirtualController, IEquatable<VirtualNVDIMMController>\n    {\n        public bool Equals(VirtualNVDIMMController virtualNVDIMMController)\n        {\n            return (virtualNVDIMMController != null && base.Equals(virtualNVDIMMController));\n        }\n\n        public override bool Equals(object virtualNVDIMMController)\n        {\n            return Equals(virtualNVDIMMController as VirtualNVDIMMController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualNVDIMMControllerOption : VirtualControllerOption, IEquatable<VirtualNVDIMMControllerOption>\n    {\n        public IntOption NumNVDIMMControllers { get; set; }\n\n        public bool Equals(VirtualNVDIMMControllerOption virtualNVDIMMControllerOption)\n        {\n            return (virtualNVDIMMControllerOption != null && ((this.NumNVDIMMControllers == null && virtualNVDIMMControllerOption.NumNVDIMMControllers == null) || (this.NumNVDIMMControllers != null && this.NumNVDIMMControllers.Equals(virtualNVDIMMControllerOption.NumNVDIMMControllers))));\n        }\n\n        public override bool Equals(object virtualNVDIMMControllerOption)\n        {\n            return Equals(virtualNVDIMMControllerOption as VirtualNVDIMMControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumNVDIMMControllers).GetHashCode();\n        }\n    }\n\n    public class VirtualNVDIMMOption : VirtualDeviceOption, IEquatable<VirtualNVDIMMOption>\n    {\n        public LongOption CapacityInMB { get; set; }\n\n        public bool Growable { get; set; }\n\n        public bool HotGrowable { get; set; }\n\n        public long GranularityInMB { get; set; }\n\n        public bool Equals(VirtualNVDIMMOption virtualNVDIMMOption)\n        {\n            return (virtualNVDIMMOption != null && ((this.CapacityInMB == null && virtualNVDIMMOption.CapacityInMB == null) || (this.CapacityInMB != null && this.CapacityInMB.Equals(virtualNVDIMMOption.CapacityInMB))) && this.Growable == virtualNVDIMMOption.Growable && this.HotGrowable == virtualNVDIMMOption.HotGrowable && this.GranularityInMB == virtualNVDIMMOption.GranularityInMB);\n        }\n\n        public override bool Equals(object virtualNVDIMMOption)\n        {\n            return Equals(virtualNVDIMMOption as VirtualNVDIMMOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityInMB + \"_\" + Growable + \"_\" + HotGrowable + \"_\" + GranularityInMB).GetHashCode();\n        }\n    }\n\n    public class VirtualNVMEController : VirtualController, IEquatable<VirtualNVMEController>\n    {\n        public bool Equals(VirtualNVMEController virtualNVMEController)\n        {\n            return (virtualNVMEController != null && base.Equals(virtualNVMEController));\n        }\n\n        public override bool Equals(object virtualNVMEController)\n        {\n            return Equals(virtualNVMEController as VirtualNVMEController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualNVMEControllerOption : VirtualControllerOption, IEquatable<VirtualNVMEControllerOption>\n    {\n        public IntOption NumNVMEDisks { get; set; }\n\n        public bool Equals(VirtualNVMEControllerOption virtualNVMEControllerOption)\n        {\n            return (virtualNVMEControllerOption != null && ((this.NumNVMEDisks == null && virtualNVMEControllerOption.NumNVMEDisks == null) || (this.NumNVMEDisks != null && this.NumNVMEDisks.Equals(virtualNVMEControllerOption.NumNVMEDisks))));\n        }\n\n        public override bool Equals(object virtualNVMEControllerOption)\n        {\n            return Equals(virtualNVMEControllerOption as VirtualNVMEControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumNVMEDisks).GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPort : VirtualDevice, IEquatable<VirtualParallelPort>\n    {\n        public bool Equals(VirtualParallelPort virtualParallelPort)\n        {\n            return (virtualParallelPort != null && base.Equals(virtualParallelPort));\n        }\n\n        public override bool Equals(object virtualParallelPort)\n        {\n            return Equals(virtualParallelPort as VirtualParallelPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPortDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualParallelPortDeviceBackingInfo>\n    {\n        public bool Equals(VirtualParallelPortDeviceBackingInfo virtualParallelPortDeviceBackingInfo)\n        {\n            return (virtualParallelPortDeviceBackingInfo != null && base.Equals(virtualParallelPortDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualParallelPortDeviceBackingInfo)\n        {\n            return Equals(virtualParallelPortDeviceBackingInfo as VirtualParallelPortDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPortDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualParallelPortDeviceBackingOption>\n    {\n        public bool Equals(VirtualParallelPortDeviceBackingOption virtualParallelPortDeviceBackingOption)\n        {\n            return (virtualParallelPortDeviceBackingOption != null && base.Equals(virtualParallelPortDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualParallelPortDeviceBackingOption)\n        {\n            return Equals(virtualParallelPortDeviceBackingOption as VirtualParallelPortDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPortFileBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualParallelPortFileBackingInfo>\n    {\n        public new VirtualParallelPortFileBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualParallelPortFileBackingInfo virtualParallelPortFileBackingInfo)\n        {\n            return (virtualParallelPortFileBackingInfo != null && ((this.LinkedView == null && virtualParallelPortFileBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualParallelPortFileBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualParallelPortFileBackingInfo)\n        {\n            return Equals(virtualParallelPortFileBackingInfo as VirtualParallelPortFileBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPortFileBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualParallelPortFileBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualParallelPortFileBackingInfo_LinkedView virtualParallelPortFileBackingInfo_LinkedView)\n        {\n            return (virtualParallelPortFileBackingInfo_LinkedView != null && base.Equals(virtualParallelPortFileBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualParallelPortFileBackingInfo_LinkedView)\n        {\n            return Equals(virtualParallelPortFileBackingInfo_LinkedView as VirtualParallelPortFileBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPortFileBackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualParallelPortFileBackingOption>\n    {\n        public bool Equals(VirtualParallelPortFileBackingOption virtualParallelPortFileBackingOption)\n        {\n            return (virtualParallelPortFileBackingOption != null && base.Equals(virtualParallelPortFileBackingOption));\n        }\n\n        public override bool Equals(object virtualParallelPortFileBackingOption)\n        {\n            return Equals(virtualParallelPortFileBackingOption as VirtualParallelPortFileBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualParallelPortOption : VirtualDeviceOption, IEquatable<VirtualParallelPortOption>\n    {\n        public bool Equals(VirtualParallelPortOption virtualParallelPortOption)\n        {\n            return (virtualParallelPortOption != null && base.Equals(virtualParallelPortOption));\n        }\n\n        public override bool Equals(object virtualParallelPortOption)\n        {\n            return Equals(virtualParallelPortOption as VirtualParallelPortOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIController : VirtualController, IEquatable<VirtualPCIController>\n    {\n        public bool Equals(VirtualPCIController virtualPCIController)\n        {\n            return (virtualPCIController != null && base.Equals(virtualPCIController));\n        }\n\n        public override bool Equals(object virtualPCIController)\n        {\n            return Equals(virtualPCIController as VirtualPCIController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIControllerOption : VirtualControllerOption, IEquatable<VirtualPCIControllerOption>\n    {\n        public IntOption NumSCSIControllers { get; set; }\n\n        public IntOption NumEthernetCards { get; set; }\n\n        public IntOption NumVideoCards { get; set; }\n\n        public IntOption NumSoundCards { get; set; }\n\n        public IntOption NumVmiRoms { get; set; }\n\n        public IntOption NumVmciDevices { get; set; }\n\n        public IntOption NumPCIPassthroughDevices { get; set; }\n\n        public IntOption NumSasSCSIControllers { get; set; }\n\n        public IntOption NumVmxnet3EthernetCards { get; set; }\n\n        public IntOption NumParaVirtualSCSIControllers { get; set; }\n\n        public IntOption NumSATAControllers { get; set; }\n\n        public IntOption NumNVMEControllers { get; set; }\n\n        public IntOption NumVmxnet3VrdmaEthernetCards { get; set; }\n\n        public bool Equals(VirtualPCIControllerOption virtualPCIControllerOption)\n        {\n            return (virtualPCIControllerOption != null && ((this.NumSCSIControllers == null && virtualPCIControllerOption.NumSCSIControllers == null) || (this.NumSCSIControllers != null && this.NumSCSIControllers.Equals(virtualPCIControllerOption.NumSCSIControllers))) && ((this.NumEthernetCards == null && virtualPCIControllerOption.NumEthernetCards == null) || (this.NumEthernetCards != null && this.NumEthernetCards.Equals(virtualPCIControllerOption.NumEthernetCards))) && ((this.NumVideoCards == null && virtualPCIControllerOption.NumVideoCards == null) || (this.NumVideoCards != null && this.NumVideoCards.Equals(virtualPCIControllerOption.NumVideoCards))) && ((this.NumSoundCards == null && virtualPCIControllerOption.NumSoundCards == null) || (this.NumSoundCards != null && this.NumSoundCards.Equals(virtualPCIControllerOption.NumSoundCards))) && ((this.NumVmiRoms == null && virtualPCIControllerOption.NumVmiRoms == null) || (this.NumVmiRoms != null && this.NumVmiRoms.Equals(virtualPCIControllerOption.NumVmiRoms))) && ((this.NumVmciDevices == null && virtualPCIControllerOption.NumVmciDevices == null) || (this.NumVmciDevices != null && this.NumVmciDevices.Equals(virtualPCIControllerOption.NumVmciDevices))) && ((this.NumPCIPassthroughDevices == null && virtualPCIControllerOption.NumPCIPassthroughDevices == null) || (this.NumPCIPassthroughDevices != null && this.NumPCIPassthroughDevices.Equals(virtualPCIControllerOption.NumPCIPassthroughDevices))) && ((this.NumSasSCSIControllers == null && virtualPCIControllerOption.NumSasSCSIControllers == null) || (this.NumSasSCSIControllers != null && this.NumSasSCSIControllers.Equals(virtualPCIControllerOption.NumSasSCSIControllers))) && ((this.NumVmxnet3EthernetCards == null && virtualPCIControllerOption.NumVmxnet3EthernetCards == null) || (this.NumVmxnet3EthernetCards != null && this.NumVmxnet3EthernetCards.Equals(virtualPCIControllerOption.NumVmxnet3EthernetCards))) && ((this.NumParaVirtualSCSIControllers == null && virtualPCIControllerOption.NumParaVirtualSCSIControllers == null) || (this.NumParaVirtualSCSIControllers != null && this.NumParaVirtualSCSIControllers.Equals(virtualPCIControllerOption.NumParaVirtualSCSIControllers))) && ((this.NumSATAControllers == null && virtualPCIControllerOption.NumSATAControllers == null) || (this.NumSATAControllers != null && this.NumSATAControllers.Equals(virtualPCIControllerOption.NumSATAControllers))) && ((this.NumNVMEControllers == null && virtualPCIControllerOption.NumNVMEControllers == null) || (this.NumNVMEControllers != null && this.NumNVMEControllers.Equals(virtualPCIControllerOption.NumNVMEControllers))) && ((this.NumVmxnet3VrdmaEthernetCards == null && virtualPCIControllerOption.NumVmxnet3VrdmaEthernetCards == null) || (this.NumVmxnet3VrdmaEthernetCards != null && this.NumVmxnet3VrdmaEthernetCards.Equals(virtualPCIControllerOption.NumVmxnet3VrdmaEthernetCards))));\n        }\n\n        public override bool Equals(object virtualPCIControllerOption)\n        {\n            return Equals(virtualPCIControllerOption as VirtualPCIControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumSCSIControllers + \"_\" + NumEthernetCards + \"_\" + NumVideoCards + \"_\" + NumSoundCards + \"_\" + NumVmiRoms + \"_\" + NumVmciDevices + \"_\" + NumPCIPassthroughDevices + \"_\" + NumSasSCSIControllers + \"_\" + NumVmxnet3EthernetCards + \"_\" + NumParaVirtualSCSIControllers + \"_\" + NumSATAControllers + \"_\" + NumNVMEControllers + \"_\" + NumVmxnet3VrdmaEthernetCards).GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthrough : VirtualDevice, IEquatable<VirtualPCIPassthrough>\n    {\n        public bool Equals(VirtualPCIPassthrough virtualPCIPassthrough)\n        {\n            return (virtualPCIPassthrough != null && base.Equals(virtualPCIPassthrough));\n        }\n\n        public override bool Equals(object virtualPCIPassthrough)\n        {\n            return Equals(virtualPCIPassthrough as VirtualPCIPassthrough);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualPCIPassthroughDeviceBackingInfo>\n    {\n        public string Id { get; set; }\n\n        public string DeviceId { get; set; }\n\n        public string SystemId { get; set; }\n\n        public short VendorId { get; set; }\n\n        public bool Equals(VirtualPCIPassthroughDeviceBackingInfo virtualPCIPassthroughDeviceBackingInfo)\n        {\n            return (virtualPCIPassthroughDeviceBackingInfo != null && this.Id == virtualPCIPassthroughDeviceBackingInfo.Id && this.DeviceId == virtualPCIPassthroughDeviceBackingInfo.DeviceId && this.SystemId == virtualPCIPassthroughDeviceBackingInfo.SystemId && this.VendorId == virtualPCIPassthroughDeviceBackingInfo.VendorId);\n        }\n\n        public override bool Equals(object virtualPCIPassthroughDeviceBackingInfo)\n        {\n            return Equals(virtualPCIPassthroughDeviceBackingInfo as VirtualPCIPassthroughDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + DeviceId + \"_\" + SystemId + \"_\" + VendorId).GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualPCIPassthroughDeviceBackingOption>\n    {\n        public bool Equals(VirtualPCIPassthroughDeviceBackingOption virtualPCIPassthroughDeviceBackingOption)\n        {\n            return (virtualPCIPassthroughDeviceBackingOption != null && base.Equals(virtualPCIPassthroughDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualPCIPassthroughDeviceBackingOption)\n        {\n            return Equals(virtualPCIPassthroughDeviceBackingOption as VirtualPCIPassthroughDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughOption : VirtualDeviceOption, IEquatable<VirtualPCIPassthroughOption>\n    {\n        public bool Equals(VirtualPCIPassthroughOption virtualPCIPassthroughOption)\n        {\n            return (virtualPCIPassthroughOption != null && base.Equals(virtualPCIPassthroughOption));\n        }\n\n        public override bool Equals(object virtualPCIPassthroughOption)\n        {\n            return Equals(virtualPCIPassthroughOption as VirtualPCIPassthroughOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughPluginBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualPCIPassthroughPluginBackingInfo>\n    {\n        public bool Equals(VirtualPCIPassthroughPluginBackingInfo virtualPCIPassthroughPluginBackingInfo)\n        {\n            return (virtualPCIPassthroughPluginBackingInfo != null && base.Equals(virtualPCIPassthroughPluginBackingInfo));\n        }\n\n        public override bool Equals(object virtualPCIPassthroughPluginBackingInfo)\n        {\n            return Equals(virtualPCIPassthroughPluginBackingInfo as VirtualPCIPassthroughPluginBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughPluginBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualPCIPassthroughPluginBackingOption>\n    {\n        public bool Equals(VirtualPCIPassthroughPluginBackingOption virtualPCIPassthroughPluginBackingOption)\n        {\n            return (virtualPCIPassthroughPluginBackingOption != null && base.Equals(virtualPCIPassthroughPluginBackingOption));\n        }\n\n        public override bool Equals(object virtualPCIPassthroughPluginBackingOption)\n        {\n            return Equals(virtualPCIPassthroughPluginBackingOption as VirtualPCIPassthroughPluginBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughVmiopBackingInfo : VirtualPCIPassthroughPluginBackingInfo, IEquatable<VirtualPCIPassthroughVmiopBackingInfo>\n    {\n        public string Vgpu { get; set; }\n\n        public bool Equals(VirtualPCIPassthroughVmiopBackingInfo virtualPCIPassthroughVmiopBackingInfo)\n        {\n            return (virtualPCIPassthroughVmiopBackingInfo != null && this.Vgpu == virtualPCIPassthroughVmiopBackingInfo.Vgpu);\n        }\n\n        public override bool Equals(object virtualPCIPassthroughVmiopBackingInfo)\n        {\n            return Equals(virtualPCIPassthroughVmiopBackingInfo as VirtualPCIPassthroughVmiopBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vgpu).GetHashCode();\n        }\n    }\n\n    public class VirtualPCIPassthroughVmiopBackingOption : VirtualPCIPassthroughPluginBackingOption, IEquatable<VirtualPCIPassthroughVmiopBackingOption>\n    {\n        public StringOption Vgpu { get; set; }\n\n        public int MaxInstances { get; set; }\n\n        public bool Equals(VirtualPCIPassthroughVmiopBackingOption virtualPCIPassthroughVmiopBackingOption)\n        {\n            return (virtualPCIPassthroughVmiopBackingOption != null && ((this.Vgpu == null && virtualPCIPassthroughVmiopBackingOption.Vgpu == null) || (this.Vgpu != null && this.Vgpu.Equals(virtualPCIPassthroughVmiopBackingOption.Vgpu))) && this.MaxInstances == virtualPCIPassthroughVmiopBackingOption.MaxInstances);\n        }\n\n        public override bool Equals(object virtualPCIPassthroughVmiopBackingOption)\n        {\n            return Equals(virtualPCIPassthroughVmiopBackingOption as VirtualPCIPassthroughVmiopBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vgpu + \"_\" + MaxInstances).GetHashCode();\n        }\n    }\n\n    public class VirtualPCNet32 : VirtualEthernetCard, IEquatable<VirtualPCNet32>\n    {\n        public bool Equals(VirtualPCNet32 virtualPCNet32)\n        {\n            return (virtualPCNet32 != null && base.Equals(virtualPCNet32));\n        }\n\n        public override bool Equals(object virtualPCNet32)\n        {\n            return Equals(virtualPCNet32 as VirtualPCNet32);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPCNet32Option : VirtualEthernetCardOption, IEquatable<VirtualPCNet32Option>\n    {\n        public bool SupportsMorphing { get; set; }\n\n        public bool Equals(VirtualPCNet32Option virtualPCNet32Option)\n        {\n            return (virtualPCNet32Option != null && this.SupportsMorphing == virtualPCNet32Option.SupportsMorphing);\n        }\n\n        public override bool Equals(object virtualPCNet32Option)\n        {\n            return Equals(virtualPCNet32Option as VirtualPCNet32Option);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportsMorphing).GetHashCode();\n        }\n    }\n\n    public class VirtualPointingDevice : VirtualDevice, IEquatable<VirtualPointingDevice>\n    {\n        public bool Equals(VirtualPointingDevice virtualPointingDevice)\n        {\n            return (virtualPointingDevice != null && base.Equals(virtualPointingDevice));\n        }\n\n        public override bool Equals(object virtualPointingDevice)\n        {\n            return Equals(virtualPointingDevice as VirtualPointingDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPointingDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualPointingDeviceBackingOption>\n    {\n        public ChoiceOption HostPointingDevice { get; set; }\n\n        public bool Equals(VirtualPointingDeviceBackingOption virtualPointingDeviceBackingOption)\n        {\n            return (virtualPointingDeviceBackingOption != null && ((this.HostPointingDevice == null && virtualPointingDeviceBackingOption.HostPointingDevice == null) || (this.HostPointingDevice != null && this.HostPointingDevice.Equals(virtualPointingDeviceBackingOption.HostPointingDevice))));\n        }\n\n        public override bool Equals(object virtualPointingDeviceBackingOption)\n        {\n            return Equals(virtualPointingDeviceBackingOption as VirtualPointingDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostPointingDevice).GetHashCode();\n        }\n    }\n\n    public class VirtualPointingDeviceDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualPointingDeviceDeviceBackingInfo>\n    {\n        public string HostPointingDevice { get; set; }\n\n        public bool Equals(VirtualPointingDeviceDeviceBackingInfo virtualPointingDeviceDeviceBackingInfo)\n        {\n            return (virtualPointingDeviceDeviceBackingInfo != null && this.HostPointingDevice == virtualPointingDeviceDeviceBackingInfo.HostPointingDevice);\n        }\n\n        public override bool Equals(object virtualPointingDeviceDeviceBackingInfo)\n        {\n            return Equals(virtualPointingDeviceDeviceBackingInfo as VirtualPointingDeviceDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostPointingDevice).GetHashCode();\n        }\n    }\n\n    public class VirtualPointingDeviceOption : VirtualDeviceOption, IEquatable<VirtualPointingDeviceOption>\n    {\n        public bool Equals(VirtualPointingDeviceOption virtualPointingDeviceOption)\n        {\n            return (virtualPointingDeviceOption != null && base.Equals(virtualPointingDeviceOption));\n        }\n\n        public override bool Equals(object virtualPointingDeviceOption)\n        {\n            return Equals(virtualPointingDeviceOption as VirtualPointingDeviceOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPS2Controller : VirtualController, IEquatable<VirtualPS2Controller>\n    {\n        public bool Equals(VirtualPS2Controller virtualPS2Controller)\n        {\n            return (virtualPS2Controller != null && base.Equals(virtualPS2Controller));\n        }\n\n        public override bool Equals(object virtualPS2Controller)\n        {\n            return Equals(virtualPS2Controller as VirtualPS2Controller);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualPS2ControllerOption : VirtualControllerOption, IEquatable<VirtualPS2ControllerOption>\n    {\n        public IntOption NumKeyboards { get; set; }\n\n        public IntOption NumPointingDevices { get; set; }\n\n        public bool Equals(VirtualPS2ControllerOption virtualPS2ControllerOption)\n        {\n            return (virtualPS2ControllerOption != null && ((this.NumKeyboards == null && virtualPS2ControllerOption.NumKeyboards == null) || (this.NumKeyboards != null && this.NumKeyboards.Equals(virtualPS2ControllerOption.NumKeyboards))) && ((this.NumPointingDevices == null && virtualPS2ControllerOption.NumPointingDevices == null) || (this.NumPointingDevices != null && this.NumPointingDevices.Equals(virtualPS2ControllerOption.NumPointingDevices))));\n        }\n\n        public override bool Equals(object virtualPS2ControllerOption)\n        {\n            return Equals(virtualPS2ControllerOption as VirtualPS2ControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumKeyboards + \"_\" + NumPointingDevices).GetHashCode();\n        }\n    }\n\n    public class VirtualSATAController : VirtualController, IEquatable<VirtualSATAController>\n    {\n        public bool Equals(VirtualSATAController virtualSATAController)\n        {\n            return (virtualSATAController != null && base.Equals(virtualSATAController));\n        }\n\n        public override bool Equals(object virtualSATAController)\n        {\n            return Equals(virtualSATAController as VirtualSATAController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSATAControllerOption : VirtualControllerOption, IEquatable<VirtualSATAControllerOption>\n    {\n        public IntOption NumSATADisks { get; set; }\n\n        public IntOption NumSATACdroms { get; set; }\n\n        public bool Equals(VirtualSATAControllerOption virtualSATAControllerOption)\n        {\n            return (virtualSATAControllerOption != null && ((this.NumSATADisks == null && virtualSATAControllerOption.NumSATADisks == null) || (this.NumSATADisks != null && this.NumSATADisks.Equals(virtualSATAControllerOption.NumSATADisks))) && ((this.NumSATACdroms == null && virtualSATAControllerOption.NumSATACdroms == null) || (this.NumSATACdroms != null && this.NumSATACdroms.Equals(virtualSATAControllerOption.NumSATACdroms))));\n        }\n\n        public override bool Equals(object virtualSATAControllerOption)\n        {\n            return Equals(virtualSATAControllerOption as VirtualSATAControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumSATADisks + \"_\" + NumSATACdroms).GetHashCode();\n        }\n    }\n\n    public class VirtualSCSIController : VirtualController, IEquatable<VirtualSCSIController>\n    {\n        public bool? HotAddRemove { get; set; }\n\n        public VirtualSCSISharing SharedBus { get; set; }\n\n        public int? ScsiCtlrUnitNumber { get; set; }\n\n        public bool Equals(VirtualSCSIController virtualSCSIController)\n        {\n            return (virtualSCSIController != null && ((this.HotAddRemove == null && virtualSCSIController.HotAddRemove == null) || (this.HotAddRemove != null && this.HotAddRemove.Equals(virtualSCSIController.HotAddRemove))) && this.SharedBus == virtualSCSIController.SharedBus && ((this.ScsiCtlrUnitNumber == null && virtualSCSIController.ScsiCtlrUnitNumber == null) || (this.ScsiCtlrUnitNumber != null && this.ScsiCtlrUnitNumber.Equals(virtualSCSIController.ScsiCtlrUnitNumber))));\n        }\n\n        public override bool Equals(object virtualSCSIController)\n        {\n            return Equals(virtualSCSIController as VirtualSCSIController);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HotAddRemove + \"_\" + SharedBus + \"_\" + ScsiCtlrUnitNumber).GetHashCode();\n        }\n    }\n\n    public class VirtualSCSIControllerOption : VirtualControllerOption, IEquatable<VirtualSCSIControllerOption>\n    {\n        public IntOption NumSCSIDisks { get; set; }\n\n        public IntOption NumSCSICdroms { get; set; }\n\n        public IntOption NumSCSIPassthrough { get; set; }\n\n        public VirtualSCSISharing[] Sharing { get; set; }\n\n        public int DefaultSharedIndex { get; set; }\n\n        public BoolOption HotAddRemove { get; set; }\n\n        public int ScsiCtlrUnitNumber { get; set; }\n\n        public bool Equals(VirtualSCSIControllerOption virtualSCSIControllerOption)\n        {\n            return (virtualSCSIControllerOption != null && ((this.NumSCSIDisks == null && virtualSCSIControllerOption.NumSCSIDisks == null) || (this.NumSCSIDisks != null && this.NumSCSIDisks.Equals(virtualSCSIControllerOption.NumSCSIDisks))) && ((this.NumSCSICdroms == null && virtualSCSIControllerOption.NumSCSICdroms == null) || (this.NumSCSICdroms != null && this.NumSCSICdroms.Equals(virtualSCSIControllerOption.NumSCSICdroms))) && ((this.NumSCSIPassthrough == null && virtualSCSIControllerOption.NumSCSIPassthrough == null) || (this.NumSCSIPassthrough != null && this.NumSCSIPassthrough.Equals(virtualSCSIControllerOption.NumSCSIPassthrough))) && ((this.Sharing == null && virtualSCSIControllerOption.Sharing == null) || (this.Sharing != null && virtualSCSIControllerOption.Sharing != null && Enumerable.SequenceEqual(this.Sharing, virtualSCSIControllerOption.Sharing))) && this.DefaultSharedIndex == virtualSCSIControllerOption.DefaultSharedIndex && ((this.HotAddRemove == null && virtualSCSIControllerOption.HotAddRemove == null) || (this.HotAddRemove != null && this.HotAddRemove.Equals(virtualSCSIControllerOption.HotAddRemove))) && this.ScsiCtlrUnitNumber == virtualSCSIControllerOption.ScsiCtlrUnitNumber);\n        }\n\n        public override bool Equals(object virtualSCSIControllerOption)\n        {\n            return Equals(virtualSCSIControllerOption as VirtualSCSIControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumSCSIDisks + \"_\" + NumSCSICdroms + \"_\" + NumSCSIPassthrough + \"_\" + Sharing + \"_\" + DefaultSharedIndex + \"_\" + HotAddRemove + \"_\" + ScsiCtlrUnitNumber).GetHashCode();\n        }\n    }\n\n    public class VirtualSCSIPassthrough : VirtualDevice, IEquatable<VirtualSCSIPassthrough>\n    {\n        public bool Equals(VirtualSCSIPassthrough virtualSCSIPassthrough)\n        {\n            return (virtualSCSIPassthrough != null && base.Equals(virtualSCSIPassthrough));\n        }\n\n        public override bool Equals(object virtualSCSIPassthrough)\n        {\n            return Equals(virtualSCSIPassthrough as VirtualSCSIPassthrough);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSCSIPassthroughDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualSCSIPassthroughDeviceBackingInfo>\n    {\n        public bool Equals(VirtualSCSIPassthroughDeviceBackingInfo virtualSCSIPassthroughDeviceBackingInfo)\n        {\n            return (virtualSCSIPassthroughDeviceBackingInfo != null && base.Equals(virtualSCSIPassthroughDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualSCSIPassthroughDeviceBackingInfo)\n        {\n            return Equals(virtualSCSIPassthroughDeviceBackingInfo as VirtualSCSIPassthroughDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSCSIPassthroughDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualSCSIPassthroughDeviceBackingOption>\n    {\n        public bool Equals(VirtualSCSIPassthroughDeviceBackingOption virtualSCSIPassthroughDeviceBackingOption)\n        {\n            return (virtualSCSIPassthroughDeviceBackingOption != null && base.Equals(virtualSCSIPassthroughDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualSCSIPassthroughDeviceBackingOption)\n        {\n            return Equals(virtualSCSIPassthroughDeviceBackingOption as VirtualSCSIPassthroughDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSCSIPassthroughOption : VirtualDeviceOption, IEquatable<VirtualSCSIPassthroughOption>\n    {\n        public bool Equals(VirtualSCSIPassthroughOption virtualSCSIPassthroughOption)\n        {\n            return (virtualSCSIPassthroughOption != null && base.Equals(virtualSCSIPassthroughOption));\n        }\n\n        public override bool Equals(object virtualSCSIPassthroughOption)\n        {\n            return Equals(virtualSCSIPassthroughOption as VirtualSCSIPassthroughOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPort : VirtualDevice, IEquatable<VirtualSerialPort>\n    {\n        public bool YieldOnPoll { get; set; }\n\n        public bool Equals(VirtualSerialPort virtualSerialPort)\n        {\n            return (virtualSerialPort != null && this.YieldOnPoll == virtualSerialPort.YieldOnPoll);\n        }\n\n        public override bool Equals(object virtualSerialPort)\n        {\n            return Equals(virtualSerialPort as VirtualSerialPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return (YieldOnPoll).GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualSerialPortDeviceBackingInfo>\n    {\n        public bool Equals(VirtualSerialPortDeviceBackingInfo virtualSerialPortDeviceBackingInfo)\n        {\n            return (virtualSerialPortDeviceBackingInfo != null && base.Equals(virtualSerialPortDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualSerialPortDeviceBackingInfo)\n        {\n            return Equals(virtualSerialPortDeviceBackingInfo as VirtualSerialPortDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualSerialPortDeviceBackingOption>\n    {\n        public bool Equals(VirtualSerialPortDeviceBackingOption virtualSerialPortDeviceBackingOption)\n        {\n            return (virtualSerialPortDeviceBackingOption != null && base.Equals(virtualSerialPortDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualSerialPortDeviceBackingOption)\n        {\n            return Equals(virtualSerialPortDeviceBackingOption as VirtualSerialPortDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortFileBackingInfo : VirtualDeviceFileBackingInfo, IEquatable<VirtualSerialPortFileBackingInfo>\n    {\n        public new VirtualSerialPortFileBackingInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VirtualSerialPortFileBackingInfo virtualSerialPortFileBackingInfo)\n        {\n            return (virtualSerialPortFileBackingInfo != null && ((this.LinkedView == null && virtualSerialPortFileBackingInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(virtualSerialPortFileBackingInfo.LinkedView))));\n        }\n\n        public override bool Equals(object virtualSerialPortFileBackingInfo)\n        {\n            return Equals(virtualSerialPortFileBackingInfo as VirtualSerialPortFileBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortFileBackingInfo_LinkedView : VirtualDeviceFileBackingInfo_LinkedView, IEquatable<VirtualSerialPortFileBackingInfo_LinkedView>\n    {\n        public bool Equals(VirtualSerialPortFileBackingInfo_LinkedView virtualSerialPortFileBackingInfo_LinkedView)\n        {\n            return (virtualSerialPortFileBackingInfo_LinkedView != null && base.Equals(virtualSerialPortFileBackingInfo_LinkedView));\n        }\n\n        public override bool Equals(object virtualSerialPortFileBackingInfo_LinkedView)\n        {\n            return Equals(virtualSerialPortFileBackingInfo_LinkedView as VirtualSerialPortFileBackingInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortFileBackingOption : VirtualDeviceFileBackingOption, IEquatable<VirtualSerialPortFileBackingOption>\n    {\n        public bool Equals(VirtualSerialPortFileBackingOption virtualSerialPortFileBackingOption)\n        {\n            return (virtualSerialPortFileBackingOption != null && base.Equals(virtualSerialPortFileBackingOption));\n        }\n\n        public override bool Equals(object virtualSerialPortFileBackingOption)\n        {\n            return Equals(virtualSerialPortFileBackingOption as VirtualSerialPortFileBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortOption : VirtualDeviceOption, IEquatable<VirtualSerialPortOption>\n    {\n        public BoolOption YieldOnPoll { get; set; }\n\n        public bool Equals(VirtualSerialPortOption virtualSerialPortOption)\n        {\n            return (virtualSerialPortOption != null && ((this.YieldOnPoll == null && virtualSerialPortOption.YieldOnPoll == null) || (this.YieldOnPoll != null && this.YieldOnPoll.Equals(virtualSerialPortOption.YieldOnPoll))));\n        }\n\n        public override bool Equals(object virtualSerialPortOption)\n        {\n            return Equals(virtualSerialPortOption as VirtualSerialPortOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (YieldOnPoll).GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortPipeBackingInfo : VirtualDevicePipeBackingInfo, IEquatable<VirtualSerialPortPipeBackingInfo>\n    {\n        public string Endpoint { get; set; }\n\n        public bool? NoRxLoss { get; set; }\n\n        public bool Equals(VirtualSerialPortPipeBackingInfo virtualSerialPortPipeBackingInfo)\n        {\n            return (virtualSerialPortPipeBackingInfo != null && this.Endpoint == virtualSerialPortPipeBackingInfo.Endpoint && ((this.NoRxLoss == null && virtualSerialPortPipeBackingInfo.NoRxLoss == null) || (this.NoRxLoss != null && this.NoRxLoss.Equals(virtualSerialPortPipeBackingInfo.NoRxLoss))));\n        }\n\n        public override bool Equals(object virtualSerialPortPipeBackingInfo)\n        {\n            return Equals(virtualSerialPortPipeBackingInfo as VirtualSerialPortPipeBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Endpoint + \"_\" + NoRxLoss).GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortPipeBackingOption : VirtualDevicePipeBackingOption, IEquatable<VirtualSerialPortPipeBackingOption>\n    {\n        public ChoiceOption Endpoint { get; set; }\n\n        public BoolOption NoRxLoss { get; set; }\n\n        public bool Equals(VirtualSerialPortPipeBackingOption virtualSerialPortPipeBackingOption)\n        {\n            return (virtualSerialPortPipeBackingOption != null && ((this.Endpoint == null && virtualSerialPortPipeBackingOption.Endpoint == null) || (this.Endpoint != null && this.Endpoint.Equals(virtualSerialPortPipeBackingOption.Endpoint))) && ((this.NoRxLoss == null && virtualSerialPortPipeBackingOption.NoRxLoss == null) || (this.NoRxLoss != null && this.NoRxLoss.Equals(virtualSerialPortPipeBackingOption.NoRxLoss))));\n        }\n\n        public override bool Equals(object virtualSerialPortPipeBackingOption)\n        {\n            return Equals(virtualSerialPortPipeBackingOption as VirtualSerialPortPipeBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Endpoint + \"_\" + NoRxLoss).GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortThinPrintBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualSerialPortThinPrintBackingInfo>\n    {\n        public bool Equals(VirtualSerialPortThinPrintBackingInfo virtualSerialPortThinPrintBackingInfo)\n        {\n            return (virtualSerialPortThinPrintBackingInfo != null && base.Equals(virtualSerialPortThinPrintBackingInfo));\n        }\n\n        public override bool Equals(object virtualSerialPortThinPrintBackingInfo)\n        {\n            return Equals(virtualSerialPortThinPrintBackingInfo as VirtualSerialPortThinPrintBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortThinPrintBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualSerialPortThinPrintBackingOption>\n    {\n        public bool Equals(VirtualSerialPortThinPrintBackingOption virtualSerialPortThinPrintBackingOption)\n        {\n            return (virtualSerialPortThinPrintBackingOption != null && base.Equals(virtualSerialPortThinPrintBackingOption));\n        }\n\n        public override bool Equals(object virtualSerialPortThinPrintBackingOption)\n        {\n            return Equals(virtualSerialPortThinPrintBackingOption as VirtualSerialPortThinPrintBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortURIBackingInfo : VirtualDeviceURIBackingInfo, IEquatable<VirtualSerialPortURIBackingInfo>\n    {\n        public bool Equals(VirtualSerialPortURIBackingInfo virtualSerialPortURIBackingInfo)\n        {\n            return (virtualSerialPortURIBackingInfo != null && base.Equals(virtualSerialPortURIBackingInfo));\n        }\n\n        public override bool Equals(object virtualSerialPortURIBackingInfo)\n        {\n            return Equals(virtualSerialPortURIBackingInfo as VirtualSerialPortURIBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSerialPortURIBackingOption : VirtualDeviceURIBackingOption, IEquatable<VirtualSerialPortURIBackingOption>\n    {\n        public bool Equals(VirtualSerialPortURIBackingOption virtualSerialPortURIBackingOption)\n        {\n            return (virtualSerialPortURIBackingOption != null && base.Equals(virtualSerialPortURIBackingOption));\n        }\n\n        public override bool Equals(object virtualSerialPortURIBackingOption)\n        {\n            return Equals(virtualSerialPortURIBackingOption as VirtualSerialPortURIBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSIOController : VirtualController, IEquatable<VirtualSIOController>\n    {\n        public bool Equals(VirtualSIOController virtualSIOController)\n        {\n            return (virtualSIOController != null && base.Equals(virtualSIOController));\n        }\n\n        public override bool Equals(object virtualSIOController)\n        {\n            return Equals(virtualSIOController as VirtualSIOController);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSIOControllerOption : VirtualControllerOption, IEquatable<VirtualSIOControllerOption>\n    {\n        public IntOption NumFloppyDrives { get; set; }\n\n        public IntOption NumSerialPorts { get; set; }\n\n        public IntOption NumParallelPorts { get; set; }\n\n        public bool Equals(VirtualSIOControllerOption virtualSIOControllerOption)\n        {\n            return (virtualSIOControllerOption != null && ((this.NumFloppyDrives == null && virtualSIOControllerOption.NumFloppyDrives == null) || (this.NumFloppyDrives != null && this.NumFloppyDrives.Equals(virtualSIOControllerOption.NumFloppyDrives))) && ((this.NumSerialPorts == null && virtualSIOControllerOption.NumSerialPorts == null) || (this.NumSerialPorts != null && this.NumSerialPorts.Equals(virtualSIOControllerOption.NumSerialPorts))) && ((this.NumParallelPorts == null && virtualSIOControllerOption.NumParallelPorts == null) || (this.NumParallelPorts != null && this.NumParallelPorts.Equals(virtualSIOControllerOption.NumParallelPorts))));\n        }\n\n        public override bool Equals(object virtualSIOControllerOption)\n        {\n            return Equals(virtualSIOControllerOption as VirtualSIOControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NumFloppyDrives + \"_\" + NumSerialPorts + \"_\" + NumParallelPorts).GetHashCode();\n        }\n    }\n\n    public class VirtualSoundBlaster16 : VirtualSoundCard, IEquatable<VirtualSoundBlaster16>\n    {\n        public bool Equals(VirtualSoundBlaster16 virtualSoundBlaster16)\n        {\n            return (virtualSoundBlaster16 != null && base.Equals(virtualSoundBlaster16));\n        }\n\n        public override bool Equals(object virtualSoundBlaster16)\n        {\n            return Equals(virtualSoundBlaster16 as VirtualSoundBlaster16);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSoundBlaster16Option : VirtualSoundCardOption, IEquatable<VirtualSoundBlaster16Option>\n    {\n        public bool Equals(VirtualSoundBlaster16Option virtualSoundBlaster16Option)\n        {\n            return (virtualSoundBlaster16Option != null && base.Equals(virtualSoundBlaster16Option));\n        }\n\n        public override bool Equals(object virtualSoundBlaster16Option)\n        {\n            return Equals(virtualSoundBlaster16Option as VirtualSoundBlaster16Option);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSoundCard : VirtualDevice, IEquatable<VirtualSoundCard>\n    {\n        public bool Equals(VirtualSoundCard virtualSoundCard)\n        {\n            return (virtualSoundCard != null && base.Equals(virtualSoundCard));\n        }\n\n        public override bool Equals(object virtualSoundCard)\n        {\n            return Equals(virtualSoundCard as VirtualSoundCard);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSoundCardDeviceBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualSoundCardDeviceBackingInfo>\n    {\n        public bool Equals(VirtualSoundCardDeviceBackingInfo virtualSoundCardDeviceBackingInfo)\n        {\n            return (virtualSoundCardDeviceBackingInfo != null && base.Equals(virtualSoundCardDeviceBackingInfo));\n        }\n\n        public override bool Equals(object virtualSoundCardDeviceBackingInfo)\n        {\n            return Equals(virtualSoundCardDeviceBackingInfo as VirtualSoundCardDeviceBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSoundCardDeviceBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualSoundCardDeviceBackingOption>\n    {\n        public bool Equals(VirtualSoundCardDeviceBackingOption virtualSoundCardDeviceBackingOption)\n        {\n            return (virtualSoundCardDeviceBackingOption != null && base.Equals(virtualSoundCardDeviceBackingOption));\n        }\n\n        public override bool Equals(object virtualSoundCardDeviceBackingOption)\n        {\n            return Equals(virtualSoundCardDeviceBackingOption as VirtualSoundCardDeviceBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSoundCardOption : VirtualDeviceOption, IEquatable<VirtualSoundCardOption>\n    {\n        public bool Equals(VirtualSoundCardOption virtualSoundCardOption)\n        {\n            return (virtualSoundCardOption != null && base.Equals(virtualSoundCardOption));\n        }\n\n        public override bool Equals(object virtualSoundCardOption)\n        {\n            return Equals(virtualSoundCardOption as VirtualSoundCardOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSriovEthernetCard : VirtualEthernetCard, IEquatable<VirtualSriovEthernetCard>\n    {\n        public bool? AllowGuestOSMtuChange { get; set; }\n\n        public VirtualSriovEthernetCardSriovBackingInfo SriovBacking { get; set; }\n\n        public bool Equals(VirtualSriovEthernetCard virtualSriovEthernetCard)\n        {\n            return (virtualSriovEthernetCard != null && ((this.AllowGuestOSMtuChange == null && virtualSriovEthernetCard.AllowGuestOSMtuChange == null) || (this.AllowGuestOSMtuChange != null && this.AllowGuestOSMtuChange.Equals(virtualSriovEthernetCard.AllowGuestOSMtuChange))) && ((this.SriovBacking == null && virtualSriovEthernetCard.SriovBacking == null) || (this.SriovBacking != null && this.SriovBacking.Equals(virtualSriovEthernetCard.SriovBacking))));\n        }\n\n        public override bool Equals(object virtualSriovEthernetCard)\n        {\n            return Equals(virtualSriovEthernetCard as VirtualSriovEthernetCard);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowGuestOSMtuChange + \"_\" + SriovBacking).GetHashCode();\n        }\n    }\n\n    public class VirtualSriovEthernetCardOption : VirtualEthernetCardOption, IEquatable<VirtualSriovEthernetCardOption>\n    {\n        public bool Equals(VirtualSriovEthernetCardOption virtualSriovEthernetCardOption)\n        {\n            return (virtualSriovEthernetCardOption != null && base.Equals(virtualSriovEthernetCardOption));\n        }\n\n        public override bool Equals(object virtualSriovEthernetCardOption)\n        {\n            return Equals(virtualSriovEthernetCardOption as VirtualSriovEthernetCardOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSriovEthernetCardSriovBackingInfo : VirtualDeviceBackingInfo, IEquatable<VirtualSriovEthernetCardSriovBackingInfo>\n    {\n        public VirtualPCIPassthroughDeviceBackingInfo PhysicalFunctionBacking { get; set; }\n\n        public VirtualPCIPassthroughDeviceBackingInfo VirtualFunctionBacking { get; set; }\n\n        public int? VirtualFunctionIndex { get; set; }\n\n        public bool Equals(VirtualSriovEthernetCardSriovBackingInfo virtualSriovEthernetCardSriovBackingInfo)\n        {\n            return (virtualSriovEthernetCardSriovBackingInfo != null && ((this.PhysicalFunctionBacking == null && virtualSriovEthernetCardSriovBackingInfo.PhysicalFunctionBacking == null) || (this.PhysicalFunctionBacking != null && this.PhysicalFunctionBacking.Equals(virtualSriovEthernetCardSriovBackingInfo.PhysicalFunctionBacking))) && ((this.VirtualFunctionBacking == null && virtualSriovEthernetCardSriovBackingInfo.VirtualFunctionBacking == null) || (this.VirtualFunctionBacking != null && this.VirtualFunctionBacking.Equals(virtualSriovEthernetCardSriovBackingInfo.VirtualFunctionBacking))) && ((this.VirtualFunctionIndex == null && virtualSriovEthernetCardSriovBackingInfo.VirtualFunctionIndex == null) || (this.VirtualFunctionIndex != null && this.VirtualFunctionIndex.Equals(virtualSriovEthernetCardSriovBackingInfo.VirtualFunctionIndex))));\n        }\n\n        public override bool Equals(object virtualSriovEthernetCardSriovBackingInfo)\n        {\n            return Equals(virtualSriovEthernetCardSriovBackingInfo as VirtualSriovEthernetCardSriovBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PhysicalFunctionBacking + \"_\" + VirtualFunctionBacking + \"_\" + VirtualFunctionIndex).GetHashCode();\n        }\n    }\n\n    public class VirtualSriovEthernetCardSriovBackingOption : VirtualDeviceBackingOption, IEquatable<VirtualSriovEthernetCardSriovBackingOption>\n    {\n        public bool Equals(VirtualSriovEthernetCardSriovBackingOption virtualSriovEthernetCardSriovBackingOption)\n        {\n            return (virtualSriovEthernetCardSriovBackingOption != null && base.Equals(virtualSriovEthernetCardSriovBackingOption));\n        }\n\n        public override bool Equals(object virtualSriovEthernetCardSriovBackingOption)\n        {\n            return Equals(virtualSriovEthernetCardSriovBackingOption as VirtualSriovEthernetCardSriovBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualSwitchProfile : ApplyProfile, IEquatable<VirtualSwitchProfile>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public LinkProfile Link { get; set; }\n\n        public NumPortsProfile NumPorts { get; set; }\n\n        public NetworkPolicyProfile NetworkPolicy { get; set; }\n\n        public bool Equals(VirtualSwitchProfile virtualSwitchProfile)\n        {\n            return (virtualSwitchProfile != null && this.Key == virtualSwitchProfile.Key && this.Name == virtualSwitchProfile.Name && ((this.Link == null && virtualSwitchProfile.Link == null) || (this.Link != null && this.Link.Equals(virtualSwitchProfile.Link))) && ((this.NumPorts == null && virtualSwitchProfile.NumPorts == null) || (this.NumPorts != null && this.NumPorts.Equals(virtualSwitchProfile.NumPorts))) && ((this.NetworkPolicy == null && virtualSwitchProfile.NetworkPolicy == null) || (this.NetworkPolicy != null && this.NetworkPolicy.Equals(virtualSwitchProfile.NetworkPolicy))));\n        }\n\n        public override bool Equals(object virtualSwitchProfile)\n        {\n            return Equals(virtualSwitchProfile as VirtualSwitchProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Link + \"_\" + NumPorts + \"_\" + NetworkPolicy).GetHashCode();\n        }\n    }\n\n    public class VirtualSwitchSelectionProfile : ApplyProfile, IEquatable<VirtualSwitchSelectionProfile>\n    {\n        public bool Equals(VirtualSwitchSelectionProfile virtualSwitchSelectionProfile)\n        {\n            return (virtualSwitchSelectionProfile != null && base.Equals(virtualSwitchSelectionProfile));\n        }\n\n        public override bool Equals(object virtualSwitchSelectionProfile)\n        {\n            return Equals(virtualSwitchSelectionProfile as VirtualSwitchSelectionProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualTPM : VirtualDevice, IEquatable<VirtualTPM>\n    {\n        public byte[][] EndorsementKeyCertificateSigningRequest { get; set; }\n\n        public byte[][] EndorsementKeyCertificate { get; set; }\n\n        public bool Equals(VirtualTPM virtualTPM)\n        {\n            return (virtualTPM != null && ((this.EndorsementKeyCertificateSigningRequest == null && virtualTPM.EndorsementKeyCertificateSigningRequest == null) || (this.EndorsementKeyCertificateSigningRequest != null && virtualTPM.EndorsementKeyCertificateSigningRequest != null && Enumerable.SequenceEqual(this.EndorsementKeyCertificateSigningRequest, virtualTPM.EndorsementKeyCertificateSigningRequest))) && ((this.EndorsementKeyCertificate == null && virtualTPM.EndorsementKeyCertificate == null) || (this.EndorsementKeyCertificate != null && virtualTPM.EndorsementKeyCertificate != null && Enumerable.SequenceEqual(this.EndorsementKeyCertificate, virtualTPM.EndorsementKeyCertificate))));\n        }\n\n        public override bool Equals(object virtualTPM)\n        {\n            return Equals(virtualTPM as VirtualTPM);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EndorsementKeyCertificateSigningRequest + \"_\" + EndorsementKeyCertificate).GetHashCode();\n        }\n    }\n\n    public class VirtualTPMOption : VirtualDeviceOption, IEquatable<VirtualTPMOption>\n    {\n        public string[] SupportedFirmware { get; set; }\n\n        public bool Equals(VirtualTPMOption virtualTPMOption)\n        {\n            return (virtualTPMOption != null && ((this.SupportedFirmware == null && virtualTPMOption.SupportedFirmware == null) || (this.SupportedFirmware != null && virtualTPMOption.SupportedFirmware != null && Enumerable.SequenceEqual(this.SupportedFirmware, virtualTPMOption.SupportedFirmware))));\n        }\n\n        public override bool Equals(object virtualTPMOption)\n        {\n            return Equals(virtualTPMOption as VirtualTPMOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SupportedFirmware).GetHashCode();\n        }\n    }\n\n    public class VirtualUSB : VirtualDevice, IEquatable<VirtualUSB>\n    {\n        public bool Connected { get; set; }\n\n        public int? Vendor { get; set; }\n\n        public int? Product { get; set; }\n\n        public string[] Family { get; set; }\n\n        public string[] Speed { get; set; }\n\n        public bool Equals(VirtualUSB virtualUSB)\n        {\n            return (virtualUSB != null && this.Connected == virtualUSB.Connected && ((this.Vendor == null && virtualUSB.Vendor == null) || (this.Vendor != null && this.Vendor.Equals(virtualUSB.Vendor))) && ((this.Product == null && virtualUSB.Product == null) || (this.Product != null && this.Product.Equals(virtualUSB.Product))) && ((this.Family == null && virtualUSB.Family == null) || (this.Family != null && virtualUSB.Family != null && Enumerable.SequenceEqual(this.Family, virtualUSB.Family))) && ((this.Speed == null && virtualUSB.Speed == null) || (this.Speed != null && virtualUSB.Speed != null && Enumerable.SequenceEqual(this.Speed, virtualUSB.Speed))));\n        }\n\n        public override bool Equals(object virtualUSB)\n        {\n            return Equals(virtualUSB as VirtualUSB);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Connected + \"_\" + Vendor + \"_\" + Product + \"_\" + Family + \"_\" + Speed).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBController : VirtualController, IEquatable<VirtualUSBController>\n    {\n        public bool? AutoConnectDevices { get; set; }\n\n        public bool? EhciEnabled { get; set; }\n\n        public bool Equals(VirtualUSBController virtualUSBController)\n        {\n            return (virtualUSBController != null && ((this.AutoConnectDevices == null && virtualUSBController.AutoConnectDevices == null) || (this.AutoConnectDevices != null && this.AutoConnectDevices.Equals(virtualUSBController.AutoConnectDevices))) && ((this.EhciEnabled == null && virtualUSBController.EhciEnabled == null) || (this.EhciEnabled != null && this.EhciEnabled.Equals(virtualUSBController.EhciEnabled))));\n        }\n\n        public override bool Equals(object virtualUSBController)\n        {\n            return Equals(virtualUSBController as VirtualUSBController);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoConnectDevices + \"_\" + EhciEnabled).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBControllerOption : VirtualControllerOption, IEquatable<VirtualUSBControllerOption>\n    {\n        public BoolOption AutoConnectDevices { get; set; }\n\n        public BoolOption EhciSupported { get; set; }\n\n        public string[] SupportedSpeeds { get; set; }\n\n        public bool Equals(VirtualUSBControllerOption virtualUSBControllerOption)\n        {\n            return (virtualUSBControllerOption != null && ((this.AutoConnectDevices == null && virtualUSBControllerOption.AutoConnectDevices == null) || (this.AutoConnectDevices != null && this.AutoConnectDevices.Equals(virtualUSBControllerOption.AutoConnectDevices))) && ((this.EhciSupported == null && virtualUSBControllerOption.EhciSupported == null) || (this.EhciSupported != null && this.EhciSupported.Equals(virtualUSBControllerOption.EhciSupported))) && ((this.SupportedSpeeds == null && virtualUSBControllerOption.SupportedSpeeds == null) || (this.SupportedSpeeds != null && virtualUSBControllerOption.SupportedSpeeds != null && Enumerable.SequenceEqual(this.SupportedSpeeds, virtualUSBControllerOption.SupportedSpeeds))));\n        }\n\n        public override bool Equals(object virtualUSBControllerOption)\n        {\n            return Equals(virtualUSBControllerOption as VirtualUSBControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoConnectDevices + \"_\" + EhciSupported + \"_\" + SupportedSpeeds).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBControllerPciBusSlotInfo : VirtualDevicePciBusSlotInfo, IEquatable<VirtualUSBControllerPciBusSlotInfo>\n    {\n        public int? EhciPciSlotNumber { get; set; }\n\n        public bool Equals(VirtualUSBControllerPciBusSlotInfo virtualUSBControllerPciBusSlotInfo)\n        {\n            return (virtualUSBControllerPciBusSlotInfo != null && ((this.EhciPciSlotNumber == null && virtualUSBControllerPciBusSlotInfo.EhciPciSlotNumber == null) || (this.EhciPciSlotNumber != null && this.EhciPciSlotNumber.Equals(virtualUSBControllerPciBusSlotInfo.EhciPciSlotNumber))));\n        }\n\n        public override bool Equals(object virtualUSBControllerPciBusSlotInfo)\n        {\n            return Equals(virtualUSBControllerPciBusSlotInfo as VirtualUSBControllerPciBusSlotInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EhciPciSlotNumber).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBOption : VirtualDeviceOption, IEquatable<VirtualUSBOption>\n    {\n        public bool Equals(VirtualUSBOption virtualUSBOption)\n        {\n            return (virtualUSBOption != null && base.Equals(virtualUSBOption));\n        }\n\n        public override bool Equals(object virtualUSBOption)\n        {\n            return Equals(virtualUSBOption as VirtualUSBOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualUSBRemoteClientBackingInfo : VirtualDeviceRemoteDeviceBackingInfo, IEquatable<VirtualUSBRemoteClientBackingInfo>\n    {\n        public string Hostname { get; set; }\n\n        public bool Equals(VirtualUSBRemoteClientBackingInfo virtualUSBRemoteClientBackingInfo)\n        {\n            return (virtualUSBRemoteClientBackingInfo != null && this.Hostname == virtualUSBRemoteClientBackingInfo.Hostname);\n        }\n\n        public override bool Equals(object virtualUSBRemoteClientBackingInfo)\n        {\n            return Equals(virtualUSBRemoteClientBackingInfo as VirtualUSBRemoteClientBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hostname).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBRemoteClientBackingOption : VirtualDeviceRemoteDeviceBackingOption, IEquatable<VirtualUSBRemoteClientBackingOption>\n    {\n        public bool Equals(VirtualUSBRemoteClientBackingOption virtualUSBRemoteClientBackingOption)\n        {\n            return (virtualUSBRemoteClientBackingOption != null && base.Equals(virtualUSBRemoteClientBackingOption));\n        }\n\n        public override bool Equals(object virtualUSBRemoteClientBackingOption)\n        {\n            return Equals(virtualUSBRemoteClientBackingOption as VirtualUSBRemoteClientBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualUSBRemoteHostBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualUSBRemoteHostBackingInfo>\n    {\n        public string Hostname { get; set; }\n\n        public bool Equals(VirtualUSBRemoteHostBackingInfo virtualUSBRemoteHostBackingInfo)\n        {\n            return (virtualUSBRemoteHostBackingInfo != null && this.Hostname == virtualUSBRemoteHostBackingInfo.Hostname);\n        }\n\n        public override bool Equals(object virtualUSBRemoteHostBackingInfo)\n        {\n            return Equals(virtualUSBRemoteHostBackingInfo as VirtualUSBRemoteHostBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hostname).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBRemoteHostBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualUSBRemoteHostBackingOption>\n    {\n        public bool Equals(VirtualUSBRemoteHostBackingOption virtualUSBRemoteHostBackingOption)\n        {\n            return (virtualUSBRemoteHostBackingOption != null && base.Equals(virtualUSBRemoteHostBackingOption));\n        }\n\n        public override bool Equals(object virtualUSBRemoteHostBackingOption)\n        {\n            return Equals(virtualUSBRemoteHostBackingOption as VirtualUSBRemoteHostBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualUSBUSBBackingInfo : VirtualDeviceDeviceBackingInfo, IEquatable<VirtualUSBUSBBackingInfo>\n    {\n        public bool Equals(VirtualUSBUSBBackingInfo virtualUSBUSBBackingInfo)\n        {\n            return (virtualUSBUSBBackingInfo != null && base.Equals(virtualUSBUSBBackingInfo));\n        }\n\n        public override bool Equals(object virtualUSBUSBBackingInfo)\n        {\n            return Equals(virtualUSBUSBBackingInfo as VirtualUSBUSBBackingInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualUSBUSBBackingOption : VirtualDeviceDeviceBackingOption, IEquatable<VirtualUSBUSBBackingOption>\n    {\n        public bool Equals(VirtualUSBUSBBackingOption virtualUSBUSBBackingOption)\n        {\n            return (virtualUSBUSBBackingOption != null && base.Equals(virtualUSBUSBBackingOption));\n        }\n\n        public override bool Equals(object virtualUSBUSBBackingOption)\n        {\n            return Equals(virtualUSBUSBBackingOption as VirtualUSBUSBBackingOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualUSBXHCIController : VirtualController, IEquatable<VirtualUSBXHCIController>\n    {\n        public bool? AutoConnectDevices { get; set; }\n\n        public bool Equals(VirtualUSBXHCIController virtualUSBXHCIController)\n        {\n            return (virtualUSBXHCIController != null && ((this.AutoConnectDevices == null && virtualUSBXHCIController.AutoConnectDevices == null) || (this.AutoConnectDevices != null && this.AutoConnectDevices.Equals(virtualUSBXHCIController.AutoConnectDevices))));\n        }\n\n        public override bool Equals(object virtualUSBXHCIController)\n        {\n            return Equals(virtualUSBXHCIController as VirtualUSBXHCIController);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoConnectDevices).GetHashCode();\n        }\n    }\n\n    public class VirtualUSBXHCIControllerOption : VirtualControllerOption, IEquatable<VirtualUSBXHCIControllerOption>\n    {\n        public BoolOption AutoConnectDevices { get; set; }\n\n        public string[] SupportedSpeeds { get; set; }\n\n        public bool Equals(VirtualUSBXHCIControllerOption virtualUSBXHCIControllerOption)\n        {\n            return (virtualUSBXHCIControllerOption != null && ((this.AutoConnectDevices == null && virtualUSBXHCIControllerOption.AutoConnectDevices == null) || (this.AutoConnectDevices != null && this.AutoConnectDevices.Equals(virtualUSBXHCIControllerOption.AutoConnectDevices))) && ((this.SupportedSpeeds == null && virtualUSBXHCIControllerOption.SupportedSpeeds == null) || (this.SupportedSpeeds != null && virtualUSBXHCIControllerOption.SupportedSpeeds != null && Enumerable.SequenceEqual(this.SupportedSpeeds, virtualUSBXHCIControllerOption.SupportedSpeeds))));\n        }\n\n        public override bool Equals(object virtualUSBXHCIControllerOption)\n        {\n            return Equals(virtualUSBXHCIControllerOption as VirtualUSBXHCIControllerOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoConnectDevices + \"_\" + SupportedSpeeds).GetHashCode();\n        }\n    }\n\n    public class VirtualVideoCardOption : VirtualDeviceOption, IEquatable<VirtualVideoCardOption>\n    {\n        public LongOption VideoRamSizeInKB { get; set; }\n\n        public IntOption NumDisplays { get; set; }\n\n        public BoolOption UseAutoDetect { get; set; }\n\n        public BoolOption Support3D { get; set; }\n\n        public BoolOption Use3dRendererSupported { get; set; }\n\n        public LongOption GraphicsMemorySizeInKB { get; set; }\n\n        public BoolOption GraphicsMemorySizeSupported { get; set; }\n\n        public bool Equals(VirtualVideoCardOption virtualVideoCardOption)\n        {\n            return (virtualVideoCardOption != null && ((this.VideoRamSizeInKB == null && virtualVideoCardOption.VideoRamSizeInKB == null) || (this.VideoRamSizeInKB != null && this.VideoRamSizeInKB.Equals(virtualVideoCardOption.VideoRamSizeInKB))) && ((this.NumDisplays == null && virtualVideoCardOption.NumDisplays == null) || (this.NumDisplays != null && this.NumDisplays.Equals(virtualVideoCardOption.NumDisplays))) && ((this.UseAutoDetect == null && virtualVideoCardOption.UseAutoDetect == null) || (this.UseAutoDetect != null && this.UseAutoDetect.Equals(virtualVideoCardOption.UseAutoDetect))) && ((this.Support3D == null && virtualVideoCardOption.Support3D == null) || (this.Support3D != null && this.Support3D.Equals(virtualVideoCardOption.Support3D))) && ((this.Use3dRendererSupported == null && virtualVideoCardOption.Use3dRendererSupported == null) || (this.Use3dRendererSupported != null && this.Use3dRendererSupported.Equals(virtualVideoCardOption.Use3dRendererSupported))) && ((this.GraphicsMemorySizeInKB == null && virtualVideoCardOption.GraphicsMemorySizeInKB == null) || (this.GraphicsMemorySizeInKB != null && this.GraphicsMemorySizeInKB.Equals(virtualVideoCardOption.GraphicsMemorySizeInKB))) && ((this.GraphicsMemorySizeSupported == null && virtualVideoCardOption.GraphicsMemorySizeSupported == null) || (this.GraphicsMemorySizeSupported != null && this.GraphicsMemorySizeSupported.Equals(virtualVideoCardOption.GraphicsMemorySizeSupported))));\n        }\n\n        public override bool Equals(object virtualVideoCardOption)\n        {\n            return Equals(virtualVideoCardOption as VirtualVideoCardOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VideoRamSizeInKB + \"_\" + NumDisplays + \"_\" + UseAutoDetect + \"_\" + Support3D + \"_\" + Use3dRendererSupported + \"_\" + GraphicsMemorySizeInKB + \"_\" + GraphicsMemorySizeSupported).GetHashCode();\n        }\n    }\n\n    public class VirtualVMIROMOption : VirtualDeviceOption, IEquatable<VirtualVMIROMOption>\n    {\n        public bool Equals(VirtualVMIROMOption virtualVMIROMOption)\n        {\n            return (virtualVMIROMOption != null && base.Equals(virtualVMIROMOption));\n        }\n\n        public override bool Equals(object virtualVMIROMOption)\n        {\n            return Equals(virtualVMIROMOption as VirtualVMIROMOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet : VirtualEthernetCard, IEquatable<VirtualVmxnet>\n    {\n        public bool Equals(VirtualVmxnet virtualVmxnet)\n        {\n            return (virtualVmxnet != null && base.Equals(virtualVmxnet));\n        }\n\n        public override bool Equals(object virtualVmxnet)\n        {\n            return Equals(virtualVmxnet as VirtualVmxnet);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet2 : VirtualVmxnet, IEquatable<VirtualVmxnet2>\n    {\n        public bool Equals(VirtualVmxnet2 virtualVmxnet2)\n        {\n            return (virtualVmxnet2 != null && base.Equals(virtualVmxnet2));\n        }\n\n        public override bool Equals(object virtualVmxnet2)\n        {\n            return Equals(virtualVmxnet2 as VirtualVmxnet2);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet2Option : VirtualVmxnetOption, IEquatable<VirtualVmxnet2Option>\n    {\n        public bool Equals(VirtualVmxnet2Option virtualVmxnet2Option)\n        {\n            return (virtualVmxnet2Option != null && base.Equals(virtualVmxnet2Option));\n        }\n\n        public override bool Equals(object virtualVmxnet2Option)\n        {\n            return Equals(virtualVmxnet2Option as VirtualVmxnet2Option);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet3 : VirtualVmxnet, IEquatable<VirtualVmxnet3>\n    {\n        public bool Equals(VirtualVmxnet3 virtualVmxnet3)\n        {\n            return (virtualVmxnet3 != null && base.Equals(virtualVmxnet3));\n        }\n\n        public override bool Equals(object virtualVmxnet3)\n        {\n            return Equals(virtualVmxnet3 as VirtualVmxnet3);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet3Option : VirtualVmxnetOption, IEquatable<VirtualVmxnet3Option>\n    {\n        public bool Equals(VirtualVmxnet3Option virtualVmxnet3Option)\n        {\n            return (virtualVmxnet3Option != null && base.Equals(virtualVmxnet3Option));\n        }\n\n        public override bool Equals(object virtualVmxnet3Option)\n        {\n            return Equals(virtualVmxnet3Option as VirtualVmxnet3Option);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet3Vrdma : VirtualVmxnet3, IEquatable<VirtualVmxnet3Vrdma>\n    {\n        public string DeviceProtocol { get; set; }\n\n        public bool Equals(VirtualVmxnet3Vrdma virtualVmxnet3Vrdma)\n        {\n            return (virtualVmxnet3Vrdma != null && this.DeviceProtocol == virtualVmxnet3Vrdma.DeviceProtocol);\n        }\n\n        public override bool Equals(object virtualVmxnet3Vrdma)\n        {\n            return Equals(virtualVmxnet3Vrdma as VirtualVmxnet3Vrdma);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceProtocol).GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnet3VrdmaOption : VirtualVmxnet3Option, IEquatable<VirtualVmxnet3VrdmaOption>\n    {\n        public ChoiceOption DeviceProtocol { get; set; }\n\n        public bool Equals(VirtualVmxnet3VrdmaOption virtualVmxnet3VrdmaOption)\n        {\n            return (virtualVmxnet3VrdmaOption != null && ((this.DeviceProtocol == null && virtualVmxnet3VrdmaOption.DeviceProtocol == null) || (this.DeviceProtocol != null && this.DeviceProtocol.Equals(virtualVmxnet3VrdmaOption.DeviceProtocol))));\n        }\n\n        public override bool Equals(object virtualVmxnet3VrdmaOption)\n        {\n            return Equals(virtualVmxnet3VrdmaOption as VirtualVmxnet3VrdmaOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceProtocol).GetHashCode();\n        }\n    }\n\n    public class VirtualVmxnetOption : VirtualEthernetCardOption, IEquatable<VirtualVmxnetOption>\n    {\n        public bool Equals(VirtualVmxnetOption virtualVmxnetOption)\n        {\n            return (virtualVmxnetOption != null && base.Equals(virtualVmxnetOption));\n        }\n\n        public override bool Equals(object virtualVmxnetOption)\n        {\n            return Equals(virtualVmxnetOption as VirtualVmxnetOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VlanProfile : ApplyProfile, IEquatable<VlanProfile>\n    {\n        public bool Equals(VlanProfile vlanProfile)\n        {\n            return (vlanProfile != null && base.Equals(vlanProfile));\n        }\n\n        public override bool Equals(object vlanProfile)\n        {\n            return Equals(vlanProfile as VlanProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmAcquiredMksTicketEvent : VmEvent, IEquatable<VmAcquiredMksTicketEvent>\n    {\n        public bool Equals(VmAcquiredMksTicketEvent vmAcquiredMksTicketEvent)\n        {\n            return (vmAcquiredMksTicketEvent != null && base.Equals(vmAcquiredMksTicketEvent));\n        }\n\n        public override bool Equals(object vmAcquiredMksTicketEvent)\n        {\n            return Equals(vmAcquiredMksTicketEvent as VmAcquiredMksTicketEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmAcquiredTicketEvent : VmEvent, IEquatable<VmAcquiredTicketEvent>\n    {\n        public string TicketType { get; set; }\n\n        public bool Equals(VmAcquiredTicketEvent vmAcquiredTicketEvent)\n        {\n            return (vmAcquiredTicketEvent != null && this.TicketType == vmAcquiredTicketEvent.TicketType);\n        }\n\n        public override bool Equals(object vmAcquiredTicketEvent)\n        {\n            return Equals(vmAcquiredTicketEvent as VmAcquiredTicketEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TicketType).GetHashCode();\n        }\n    }\n\n    public class VmAlreadyExistsInDatacenter : InvalidFolder, IEquatable<VmAlreadyExistsInDatacenter>\n    {\n        public ManagedObjectReference Host { get; set; }\n\n        public string Hostname { get; set; }\n\n        public ManagedObjectReference[] Vm { get; set; }\n\n        public new VmAlreadyExistsInDatacenter_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VmAlreadyExistsInDatacenter vmAlreadyExistsInDatacenter)\n        {\n            return (vmAlreadyExistsInDatacenter != null && ((this.Host == null && vmAlreadyExistsInDatacenter.Host == null) || (this.Host != null && this.Host.Equals(vmAlreadyExistsInDatacenter.Host))) && this.Hostname == vmAlreadyExistsInDatacenter.Hostname && ((this.Vm == null && vmAlreadyExistsInDatacenter.Vm == null) || (this.Vm != null && vmAlreadyExistsInDatacenter.Vm != null && Enumerable.SequenceEqual(this.Vm, vmAlreadyExistsInDatacenter.Vm))) && ((this.LinkedView == null && vmAlreadyExistsInDatacenter.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmAlreadyExistsInDatacenter.LinkedView))));\n        }\n\n        public override bool Equals(object vmAlreadyExistsInDatacenter)\n        {\n            return Equals(vmAlreadyExistsInDatacenter as VmAlreadyExistsInDatacenter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Hostname + \"_\" + Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmAlreadyExistsInDatacenter_LinkedView : InvalidFolder_LinkedView, IEquatable<VmAlreadyExistsInDatacenter_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public VirtualMachine[] Vm { get; set; }\n\n        public bool Equals(VmAlreadyExistsInDatacenter_LinkedView vmAlreadyExistsInDatacenter_LinkedView)\n        {\n            return (vmAlreadyExistsInDatacenter_LinkedView != null && ((this.Host == null && vmAlreadyExistsInDatacenter_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(vmAlreadyExistsInDatacenter_LinkedView.Host))) && ((this.Vm == null && vmAlreadyExistsInDatacenter_LinkedView.Vm == null) || (this.Vm != null && vmAlreadyExistsInDatacenter_LinkedView.Vm != null && Enumerable.SequenceEqual(this.Vm, vmAlreadyExistsInDatacenter_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object vmAlreadyExistsInDatacenter_LinkedView)\n        {\n            return Equals(vmAlreadyExistsInDatacenter_LinkedView as VmAlreadyExistsInDatacenter_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Vm).GetHashCode();\n        }\n    }\n\n    public class VmAutoRenameEvent : VmEvent, IEquatable<VmAutoRenameEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(VmAutoRenameEvent vmAutoRenameEvent)\n        {\n            return (vmAutoRenameEvent != null && this.OldName == vmAutoRenameEvent.OldName && this.NewName == vmAutoRenameEvent.NewName);\n        }\n\n        public override bool Equals(object vmAutoRenameEvent)\n        {\n            return Equals(vmAutoRenameEvent as VmAutoRenameEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class VmBeingClonedEvent : VmCloneEvent, IEquatable<VmBeingClonedEvent>\n    {\n        public FolderEventArgument DestFolder { get; set; }\n\n        public string DestName { get; set; }\n\n        public HostEventArgument DestHost { get; set; }\n\n        public bool Equals(VmBeingClonedEvent vmBeingClonedEvent)\n        {\n            return (vmBeingClonedEvent != null && ((this.DestFolder == null && vmBeingClonedEvent.DestFolder == null) || (this.DestFolder != null && this.DestFolder.Equals(vmBeingClonedEvent.DestFolder))) && this.DestName == vmBeingClonedEvent.DestName && ((this.DestHost == null && vmBeingClonedEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmBeingClonedEvent.DestHost))));\n        }\n\n        public override bool Equals(object vmBeingClonedEvent)\n        {\n            return Equals(vmBeingClonedEvent as VmBeingClonedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestFolder + \"_\" + DestName + \"_\" + DestHost).GetHashCode();\n        }\n    }\n\n    public class VmBeingClonedNoFolderEvent : VmCloneEvent, IEquatable<VmBeingClonedNoFolderEvent>\n    {\n        public string DestName { get; set; }\n\n        public HostEventArgument DestHost { get; set; }\n\n        public bool Equals(VmBeingClonedNoFolderEvent vmBeingClonedNoFolderEvent)\n        {\n            return (vmBeingClonedNoFolderEvent != null && this.DestName == vmBeingClonedNoFolderEvent.DestName && ((this.DestHost == null && vmBeingClonedNoFolderEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmBeingClonedNoFolderEvent.DestHost))));\n        }\n\n        public override bool Equals(object vmBeingClonedNoFolderEvent)\n        {\n            return Equals(vmBeingClonedNoFolderEvent as VmBeingClonedNoFolderEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestName + \"_\" + DestHost).GetHashCode();\n        }\n    }\n\n    public class VmBeingCreatedEvent : VmEvent, IEquatable<VmBeingCreatedEvent>\n    {\n        public VirtualMachineConfigSpec ConfigSpec { get; set; }\n\n        public bool Equals(VmBeingCreatedEvent vmBeingCreatedEvent)\n        {\n            return (vmBeingCreatedEvent != null && ((this.ConfigSpec == null && vmBeingCreatedEvent.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(vmBeingCreatedEvent.ConfigSpec))));\n        }\n\n        public override bool Equals(object vmBeingCreatedEvent)\n        {\n            return Equals(vmBeingCreatedEvent as VmBeingCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec).GetHashCode();\n        }\n    }\n\n    public class VmBeingDeployedEvent : VmEvent, IEquatable<VmBeingDeployedEvent>\n    {\n        public VmEventArgument SrcTemplate { get; set; }\n\n        public bool Equals(VmBeingDeployedEvent vmBeingDeployedEvent)\n        {\n            return (vmBeingDeployedEvent != null && ((this.SrcTemplate == null && vmBeingDeployedEvent.SrcTemplate == null) || (this.SrcTemplate != null && this.SrcTemplate.Equals(vmBeingDeployedEvent.SrcTemplate))));\n        }\n\n        public override bool Equals(object vmBeingDeployedEvent)\n        {\n            return Equals(vmBeingDeployedEvent as VmBeingDeployedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SrcTemplate).GetHashCode();\n        }\n    }\n\n    public class VmBeingHotMigratedEvent : VmEvent, IEquatable<VmBeingHotMigratedEvent>\n    {\n        public HostEventArgument DestHost { get; set; }\n\n        public DatacenterEventArgument DestDatacenter { get; set; }\n\n        public DatastoreEventArgument DestDatastore { get; set; }\n\n        public bool Equals(VmBeingHotMigratedEvent vmBeingHotMigratedEvent)\n        {\n            return (vmBeingHotMigratedEvent != null && ((this.DestHost == null && vmBeingHotMigratedEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmBeingHotMigratedEvent.DestHost))) && ((this.DestDatacenter == null && vmBeingHotMigratedEvent.DestDatacenter == null) || (this.DestDatacenter != null && this.DestDatacenter.Equals(vmBeingHotMigratedEvent.DestDatacenter))) && ((this.DestDatastore == null && vmBeingHotMigratedEvent.DestDatastore == null) || (this.DestDatastore != null && this.DestDatastore.Equals(vmBeingHotMigratedEvent.DestDatastore))));\n        }\n\n        public override bool Equals(object vmBeingHotMigratedEvent)\n        {\n            return Equals(vmBeingHotMigratedEvent as VmBeingHotMigratedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestHost + \"_\" + DestDatacenter + \"_\" + DestDatastore).GetHashCode();\n        }\n    }\n\n    public class VmBeingMigratedEvent : VmEvent, IEquatable<VmBeingMigratedEvent>\n    {\n        public HostEventArgument DestHost { get; set; }\n\n        public DatacenterEventArgument DestDatacenter { get; set; }\n\n        public DatastoreEventArgument DestDatastore { get; set; }\n\n        public bool Equals(VmBeingMigratedEvent vmBeingMigratedEvent)\n        {\n            return (vmBeingMigratedEvent != null && ((this.DestHost == null && vmBeingMigratedEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmBeingMigratedEvent.DestHost))) && ((this.DestDatacenter == null && vmBeingMigratedEvent.DestDatacenter == null) || (this.DestDatacenter != null && this.DestDatacenter.Equals(vmBeingMigratedEvent.DestDatacenter))) && ((this.DestDatastore == null && vmBeingMigratedEvent.DestDatastore == null) || (this.DestDatastore != null && this.DestDatastore.Equals(vmBeingMigratedEvent.DestDatastore))));\n        }\n\n        public override bool Equals(object vmBeingMigratedEvent)\n        {\n            return Equals(vmBeingMigratedEvent as VmBeingMigratedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestHost + \"_\" + DestDatacenter + \"_\" + DestDatastore).GetHashCode();\n        }\n    }\n\n    public class VmBeingRelocatedEvent : VmRelocateSpecEvent, IEquatable<VmBeingRelocatedEvent>\n    {\n        public HostEventArgument DestHost { get; set; }\n\n        public DatacenterEventArgument DestDatacenter { get; set; }\n\n        public DatastoreEventArgument DestDatastore { get; set; }\n\n        public bool Equals(VmBeingRelocatedEvent vmBeingRelocatedEvent)\n        {\n            return (vmBeingRelocatedEvent != null && ((this.DestHost == null && vmBeingRelocatedEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmBeingRelocatedEvent.DestHost))) && ((this.DestDatacenter == null && vmBeingRelocatedEvent.DestDatacenter == null) || (this.DestDatacenter != null && this.DestDatacenter.Equals(vmBeingRelocatedEvent.DestDatacenter))) && ((this.DestDatastore == null && vmBeingRelocatedEvent.DestDatastore == null) || (this.DestDatastore != null && this.DestDatastore.Equals(vmBeingRelocatedEvent.DestDatastore))));\n        }\n\n        public override bool Equals(object vmBeingRelocatedEvent)\n        {\n            return Equals(vmBeingRelocatedEvent as VmBeingRelocatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestHost + \"_\" + DestDatacenter + \"_\" + DestDatastore).GetHashCode();\n        }\n    }\n\n    public class VmClonedEvent : VmCloneEvent, IEquatable<VmClonedEvent>\n    {\n        public VmEventArgument SourceVm { get; set; }\n\n        public bool Equals(VmClonedEvent vmClonedEvent)\n        {\n            return (vmClonedEvent != null && ((this.SourceVm == null && vmClonedEvent.SourceVm == null) || (this.SourceVm != null && this.SourceVm.Equals(vmClonedEvent.SourceVm))));\n        }\n\n        public override bool Equals(object vmClonedEvent)\n        {\n            return Equals(vmClonedEvent as VmClonedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceVm).GetHashCode();\n        }\n    }\n\n    public class VmCloneEvent : VmEvent, IEquatable<VmCloneEvent>\n    {\n        public bool Equals(VmCloneEvent vmCloneEvent)\n        {\n            return (vmCloneEvent != null && base.Equals(vmCloneEvent));\n        }\n\n        public override bool Equals(object vmCloneEvent)\n        {\n            return Equals(vmCloneEvent as VmCloneEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmCloneFailedEvent : VmCloneEvent, IEquatable<VmCloneFailedEvent>\n    {\n        public FolderEventArgument DestFolder { get; set; }\n\n        public string DestName { get; set; }\n\n        public HostEventArgument DestHost { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmCloneFailedEvent vmCloneFailedEvent)\n        {\n            return (vmCloneFailedEvent != null && ((this.DestFolder == null && vmCloneFailedEvent.DestFolder == null) || (this.DestFolder != null && this.DestFolder.Equals(vmCloneFailedEvent.DestFolder))) && this.DestName == vmCloneFailedEvent.DestName && ((this.DestHost == null && vmCloneFailedEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmCloneFailedEvent.DestHost))) && ((this.Reason == null && vmCloneFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmCloneFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object vmCloneFailedEvent)\n        {\n            return Equals(vmCloneFailedEvent as VmCloneFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestFolder + \"_\" + DestName + \"_\" + DestHost + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class VmConfigFault : VimFault, IEquatable<VmConfigFault>\n    {\n        public bool Equals(VmConfigFault vmConfigFault)\n        {\n            return (vmConfigFault != null && base.Equals(vmConfigFault));\n        }\n\n        public override bool Equals(object vmConfigFault)\n        {\n            return Equals(vmConfigFault as VmConfigFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmConfigFileEncryptionInfo : DynamicData, IEquatable<VmConfigFileEncryptionInfo>\n    {\n        public CryptoKeyId KeyId { get; set; }\n\n        public bool Equals(VmConfigFileEncryptionInfo vmConfigFileEncryptionInfo)\n        {\n            return (vmConfigFileEncryptionInfo != null && ((this.KeyId == null && vmConfigFileEncryptionInfo.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(vmConfigFileEncryptionInfo.KeyId))));\n        }\n\n        public override bool Equals(object vmConfigFileEncryptionInfo)\n        {\n            return Equals(vmConfigFileEncryptionInfo as VmConfigFileEncryptionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyId).GetHashCode();\n        }\n    }\n\n    public class VmConfigFileInfo : FileInfo, IEquatable<VmConfigFileInfo>\n    {\n        public int? ConfigVersion { get; set; }\n\n        public VmConfigFileEncryptionInfo Encryption { get; set; }\n\n        public bool Equals(VmConfigFileInfo vmConfigFileInfo)\n        {\n            return (vmConfigFileInfo != null && ((this.ConfigVersion == null && vmConfigFileInfo.ConfigVersion == null) || (this.ConfigVersion != null && this.ConfigVersion.Equals(vmConfigFileInfo.ConfigVersion))) && ((this.Encryption == null && vmConfigFileInfo.Encryption == null) || (this.Encryption != null && this.Encryption.Equals(vmConfigFileInfo.Encryption))));\n        }\n\n        public override bool Equals(object vmConfigFileInfo)\n        {\n            return Equals(vmConfigFileInfo as VmConfigFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigVersion + \"_\" + Encryption).GetHashCode();\n        }\n    }\n\n    public class VmConfigFileQuery : FileQuery, IEquatable<VmConfigFileQuery>\n    {\n        public VmConfigFileQueryFilter Filter { get; set; }\n\n        public VmConfigFileQueryFlags Details { get; set; }\n\n        public bool Equals(VmConfigFileQuery vmConfigFileQuery)\n        {\n            return (vmConfigFileQuery != null && ((this.Filter == null && vmConfigFileQuery.Filter == null) || (this.Filter != null && this.Filter.Equals(vmConfigFileQuery.Filter))) && ((this.Details == null && vmConfigFileQuery.Details == null) || (this.Details != null && this.Details.Equals(vmConfigFileQuery.Details))));\n        }\n\n        public override bool Equals(object vmConfigFileQuery)\n        {\n            return Equals(vmConfigFileQuery as VmConfigFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter + \"_\" + Details).GetHashCode();\n        }\n    }\n\n    public class VmConfigFileQueryFilter : DynamicData, IEquatable<VmConfigFileQueryFilter>\n    {\n        public int[] MatchConfigVersion { get; set; }\n\n        public bool? Encrypted { get; set; }\n\n        public bool Equals(VmConfigFileQueryFilter vmConfigFileQueryFilter)\n        {\n            return (vmConfigFileQueryFilter != null && ((this.MatchConfigVersion == null && vmConfigFileQueryFilter.MatchConfigVersion == null) || (this.MatchConfigVersion != null && vmConfigFileQueryFilter.MatchConfigVersion != null && Enumerable.SequenceEqual(this.MatchConfigVersion, vmConfigFileQueryFilter.MatchConfigVersion))) && ((this.Encrypted == null && vmConfigFileQueryFilter.Encrypted == null) || (this.Encrypted != null && this.Encrypted.Equals(vmConfigFileQueryFilter.Encrypted))));\n        }\n\n        public override bool Equals(object vmConfigFileQueryFilter)\n        {\n            return Equals(vmConfigFileQueryFilter as VmConfigFileQueryFilter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MatchConfigVersion + \"_\" + Encrypted).GetHashCode();\n        }\n    }\n\n    public class VmConfigFileQueryFlags : DynamicData, IEquatable<VmConfigFileQueryFlags>\n    {\n        public bool ConfigVersion { get; set; }\n\n        public bool? Encryption { get; set; }\n\n        public bool Equals(VmConfigFileQueryFlags vmConfigFileQueryFlags)\n        {\n            return (vmConfigFileQueryFlags != null && this.ConfigVersion == vmConfigFileQueryFlags.ConfigVersion && ((this.Encryption == null && vmConfigFileQueryFlags.Encryption == null) || (this.Encryption != null && this.Encryption.Equals(vmConfigFileQueryFlags.Encryption))));\n        }\n\n        public override bool Equals(object vmConfigFileQueryFlags)\n        {\n            return Equals(vmConfigFileQueryFlags as VmConfigFileQueryFlags);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigVersion + \"_\" + Encryption).GetHashCode();\n        }\n    }\n\n    public class VmConfigIncompatibleForFaultTolerance : VmConfigFault, IEquatable<VmConfigIncompatibleForFaultTolerance>\n    {\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(VmConfigIncompatibleForFaultTolerance vmConfigIncompatibleForFaultTolerance)\n        {\n            return (vmConfigIncompatibleForFaultTolerance != null && ((this.Fault == null && vmConfigIncompatibleForFaultTolerance.Fault == null) || (this.Fault != null && this.Fault.Equals(vmConfigIncompatibleForFaultTolerance.Fault))));\n        }\n\n        public override bool Equals(object vmConfigIncompatibleForFaultTolerance)\n        {\n            return Equals(vmConfigIncompatibleForFaultTolerance as VmConfigIncompatibleForFaultTolerance);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault).GetHashCode();\n        }\n    }\n\n    public class VmConfigIncompatibleForRecordReplay : VmConfigFault, IEquatable<VmConfigIncompatibleForRecordReplay>\n    {\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(VmConfigIncompatibleForRecordReplay vmConfigIncompatibleForRecordReplay)\n        {\n            return (vmConfigIncompatibleForRecordReplay != null && ((this.Fault == null && vmConfigIncompatibleForRecordReplay.Fault == null) || (this.Fault != null && this.Fault.Equals(vmConfigIncompatibleForRecordReplay.Fault))));\n        }\n\n        public override bool Equals(object vmConfigIncompatibleForRecordReplay)\n        {\n            return Equals(vmConfigIncompatibleForRecordReplay as VmConfigIncompatibleForRecordReplay);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Fault).GetHashCode();\n        }\n    }\n\n    public class VmConfigInfo : DynamicData, IEquatable<VmConfigInfo>\n    {\n        public VAppProductInfo[] Product { get; set; }\n\n        public VAppPropertyInfo[] Property { get; set; }\n\n        public VAppIPAssignmentInfo IpAssignment { get; set; }\n\n        public string[] Eula { get; set; }\n\n        public VAppOvfSectionInfo[] OvfSection { get; set; }\n\n        public string[] OvfEnvironmentTransport { get; set; }\n\n        public bool InstallBootRequired { get; set; }\n\n        public int InstallBootStopDelay { get; set; }\n\n        public bool Equals(VmConfigInfo vmConfigInfo)\n        {\n            return (vmConfigInfo != null && ((this.Product == null && vmConfigInfo.Product == null) || (this.Product != null && vmConfigInfo.Product != null && Enumerable.SequenceEqual(this.Product, vmConfigInfo.Product))) && ((this.Property == null && vmConfigInfo.Property == null) || (this.Property != null && vmConfigInfo.Property != null && Enumerable.SequenceEqual(this.Property, vmConfigInfo.Property))) && ((this.IpAssignment == null && vmConfigInfo.IpAssignment == null) || (this.IpAssignment != null && this.IpAssignment.Equals(vmConfigInfo.IpAssignment))) && ((this.Eula == null && vmConfigInfo.Eula == null) || (this.Eula != null && vmConfigInfo.Eula != null && Enumerable.SequenceEqual(this.Eula, vmConfigInfo.Eula))) && ((this.OvfSection == null && vmConfigInfo.OvfSection == null) || (this.OvfSection != null && vmConfigInfo.OvfSection != null && Enumerable.SequenceEqual(this.OvfSection, vmConfigInfo.OvfSection))) && ((this.OvfEnvironmentTransport == null && vmConfigInfo.OvfEnvironmentTransport == null) || (this.OvfEnvironmentTransport != null && vmConfigInfo.OvfEnvironmentTransport != null && Enumerable.SequenceEqual(this.OvfEnvironmentTransport, vmConfigInfo.OvfEnvironmentTransport))) && this.InstallBootRequired == vmConfigInfo.InstallBootRequired && this.InstallBootStopDelay == vmConfigInfo.InstallBootStopDelay);\n        }\n\n        public override bool Equals(object vmConfigInfo)\n        {\n            return Equals(vmConfigInfo as VmConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Product + \"_\" + Property + \"_\" + IpAssignment + \"_\" + Eula + \"_\" + OvfSection + \"_\" + OvfEnvironmentTransport + \"_\" + InstallBootRequired + \"_\" + InstallBootStopDelay).GetHashCode();\n        }\n    }\n\n    public class VmConfigMissingEvent : VmEvent, IEquatable<VmConfigMissingEvent>\n    {\n        public bool Equals(VmConfigMissingEvent vmConfigMissingEvent)\n        {\n            return (vmConfigMissingEvent != null && base.Equals(vmConfigMissingEvent));\n        }\n\n        public override bool Equals(object vmConfigMissingEvent)\n        {\n            return Equals(vmConfigMissingEvent as VmConfigMissingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmConfigSpec : DynamicData, IEquatable<VmConfigSpec>\n    {\n        public VAppProductSpec[] Product { get; set; }\n\n        public VAppPropertySpec[] Property { get; set; }\n\n        public VAppIPAssignmentInfo IpAssignment { get; set; }\n\n        public string[] Eula { get; set; }\n\n        public VAppOvfSectionSpec[] OvfSection { get; set; }\n\n        public string[] OvfEnvironmentTransport { get; set; }\n\n        public bool? InstallBootRequired { get; set; }\n\n        public int? InstallBootStopDelay { get; set; }\n\n        public bool Equals(VmConfigSpec vmConfigSpec)\n        {\n            return (vmConfigSpec != null && ((this.Product == null && vmConfigSpec.Product == null) || (this.Product != null && vmConfigSpec.Product != null && Enumerable.SequenceEqual(this.Product, vmConfigSpec.Product))) && ((this.Property == null && vmConfigSpec.Property == null) || (this.Property != null && vmConfigSpec.Property != null && Enumerable.SequenceEqual(this.Property, vmConfigSpec.Property))) && ((this.IpAssignment == null && vmConfigSpec.IpAssignment == null) || (this.IpAssignment != null && this.IpAssignment.Equals(vmConfigSpec.IpAssignment))) && ((this.Eula == null && vmConfigSpec.Eula == null) || (this.Eula != null && vmConfigSpec.Eula != null && Enumerable.SequenceEqual(this.Eula, vmConfigSpec.Eula))) && ((this.OvfSection == null && vmConfigSpec.OvfSection == null) || (this.OvfSection != null && vmConfigSpec.OvfSection != null && Enumerable.SequenceEqual(this.OvfSection, vmConfigSpec.OvfSection))) && ((this.OvfEnvironmentTransport == null && vmConfigSpec.OvfEnvironmentTransport == null) || (this.OvfEnvironmentTransport != null && vmConfigSpec.OvfEnvironmentTransport != null && Enumerable.SequenceEqual(this.OvfEnvironmentTransport, vmConfigSpec.OvfEnvironmentTransport))) && ((this.InstallBootRequired == null && vmConfigSpec.InstallBootRequired == null) || (this.InstallBootRequired != null && this.InstallBootRequired.Equals(vmConfigSpec.InstallBootRequired))) && ((this.InstallBootStopDelay == null && vmConfigSpec.InstallBootStopDelay == null) || (this.InstallBootStopDelay != null && this.InstallBootStopDelay.Equals(vmConfigSpec.InstallBootStopDelay))));\n        }\n\n        public override bool Equals(object vmConfigSpec)\n        {\n            return Equals(vmConfigSpec as VmConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Product + \"_\" + Property + \"_\" + IpAssignment + \"_\" + Eula + \"_\" + OvfSection + \"_\" + OvfEnvironmentTransport + \"_\" + InstallBootRequired + \"_\" + InstallBootStopDelay).GetHashCode();\n        }\n    }\n\n    public class VmConnectedEvent : VmEvent, IEquatable<VmConnectedEvent>\n    {\n        public bool Equals(VmConnectedEvent vmConnectedEvent)\n        {\n            return (vmConnectedEvent != null && base.Equals(vmConnectedEvent));\n        }\n\n        public override bool Equals(object vmConnectedEvent)\n        {\n            return Equals(vmConnectedEvent as VmConnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmCreatedEvent : VmEvent, IEquatable<VmCreatedEvent>\n    {\n        public bool Equals(VmCreatedEvent vmCreatedEvent)\n        {\n            return (vmCreatedEvent != null && base.Equals(vmCreatedEvent));\n        }\n\n        public override bool Equals(object vmCreatedEvent)\n        {\n            return Equals(vmCreatedEvent as VmCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDasBeingResetEvent : VmEvent, IEquatable<VmDasBeingResetEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(VmDasBeingResetEvent vmDasBeingResetEvent)\n        {\n            return (vmDasBeingResetEvent != null && this.Reason == vmDasBeingResetEvent.Reason);\n        }\n\n        public override bool Equals(object vmDasBeingResetEvent)\n        {\n            return Equals(vmDasBeingResetEvent as VmDasBeingResetEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmDasBeingResetWithScreenshotEvent : VmDasBeingResetEvent, IEquatable<VmDasBeingResetWithScreenshotEvent>\n    {\n        public string ScreenshotFilePath { get; set; }\n\n        public bool Equals(VmDasBeingResetWithScreenshotEvent vmDasBeingResetWithScreenshotEvent)\n        {\n            return (vmDasBeingResetWithScreenshotEvent != null && this.ScreenshotFilePath == vmDasBeingResetWithScreenshotEvent.ScreenshotFilePath);\n        }\n\n        public override bool Equals(object vmDasBeingResetWithScreenshotEvent)\n        {\n            return Equals(vmDasBeingResetWithScreenshotEvent as VmDasBeingResetWithScreenshotEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScreenshotFilePath).GetHashCode();\n        }\n    }\n\n    public class VmDasResetFailedEvent : VmEvent, IEquatable<VmDasResetFailedEvent>\n    {\n        public bool Equals(VmDasResetFailedEvent vmDasResetFailedEvent)\n        {\n            return (vmDasResetFailedEvent != null && base.Equals(vmDasResetFailedEvent));\n        }\n\n        public override bool Equals(object vmDasResetFailedEvent)\n        {\n            return Equals(vmDasResetFailedEvent as VmDasResetFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDasUpdateErrorEvent : VmEvent, IEquatable<VmDasUpdateErrorEvent>\n    {\n        public bool Equals(VmDasUpdateErrorEvent vmDasUpdateErrorEvent)\n        {\n            return (vmDasUpdateErrorEvent != null && base.Equals(vmDasUpdateErrorEvent));\n        }\n\n        public override bool Equals(object vmDasUpdateErrorEvent)\n        {\n            return Equals(vmDasUpdateErrorEvent as VmDasUpdateErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDasUpdateOkEvent : VmEvent, IEquatable<VmDasUpdateOkEvent>\n    {\n        public bool Equals(VmDasUpdateOkEvent vmDasUpdateOkEvent)\n        {\n            return (vmDasUpdateOkEvent != null && base.Equals(vmDasUpdateOkEvent));\n        }\n\n        public override bool Equals(object vmDasUpdateOkEvent)\n        {\n            return Equals(vmDasUpdateOkEvent as VmDasUpdateOkEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDateRolledBackEvent : VmEvent, IEquatable<VmDateRolledBackEvent>\n    {\n        public bool Equals(VmDateRolledBackEvent vmDateRolledBackEvent)\n        {\n            return (vmDateRolledBackEvent != null && base.Equals(vmDateRolledBackEvent));\n        }\n\n        public override bool Equals(object vmDateRolledBackEvent)\n        {\n            return Equals(vmDateRolledBackEvent as VmDateRolledBackEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDeployedEvent : VmEvent, IEquatable<VmDeployedEvent>\n    {\n        public VmEventArgument SrcTemplate { get; set; }\n\n        public bool Equals(VmDeployedEvent vmDeployedEvent)\n        {\n            return (vmDeployedEvent != null && ((this.SrcTemplate == null && vmDeployedEvent.SrcTemplate == null) || (this.SrcTemplate != null && this.SrcTemplate.Equals(vmDeployedEvent.SrcTemplate))));\n        }\n\n        public override bool Equals(object vmDeployedEvent)\n        {\n            return Equals(vmDeployedEvent as VmDeployedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SrcTemplate).GetHashCode();\n        }\n    }\n\n    public class VmDeployFailedEvent : VmEvent, IEquatable<VmDeployFailedEvent>\n    {\n        public EntityEventArgument DestDatastore { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmDeployFailedEvent vmDeployFailedEvent)\n        {\n            return (vmDeployFailedEvent != null && ((this.DestDatastore == null && vmDeployFailedEvent.DestDatastore == null) || (this.DestDatastore != null && this.DestDatastore.Equals(vmDeployFailedEvent.DestDatastore))) && ((this.Reason == null && vmDeployFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmDeployFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object vmDeployFailedEvent)\n        {\n            return Equals(vmDeployFailedEvent as VmDeployFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestDatastore + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class VmDisconnectedEvent : VmEvent, IEquatable<VmDisconnectedEvent>\n    {\n        public bool Equals(VmDisconnectedEvent vmDisconnectedEvent)\n        {\n            return (vmDisconnectedEvent != null && base.Equals(vmDisconnectedEvent));\n        }\n\n        public override bool Equals(object vmDisconnectedEvent)\n        {\n            return Equals(vmDisconnectedEvent as VmDisconnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDiscoveredEvent : VmEvent, IEquatable<VmDiscoveredEvent>\n    {\n        public bool Equals(VmDiscoveredEvent vmDiscoveredEvent)\n        {\n            return (vmDiscoveredEvent != null && base.Equals(vmDiscoveredEvent));\n        }\n\n        public override bool Equals(object vmDiscoveredEvent)\n        {\n            return Equals(vmDiscoveredEvent as VmDiscoveredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmDiskFailedEvent : VmEvent, IEquatable<VmDiskFailedEvent>\n    {\n        public string Disk { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmDiskFailedEvent vmDiskFailedEvent)\n        {\n            return (vmDiskFailedEvent != null && this.Disk == vmDiskFailedEvent.Disk && ((this.Reason == null && vmDiskFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmDiskFailedEvent.Reason))));\n        }\n\n        public override bool Equals(object vmDiskFailedEvent)\n        {\n            return Equals(vmDiskFailedEvent as VmDiskFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk + \"_\" + Reason).GetHashCode();\n        }\n    }\n\n    public class VmDiskFileEncryptionInfo : DynamicData, IEquatable<VmDiskFileEncryptionInfo>\n    {\n        public CryptoKeyId KeyId { get; set; }\n\n        public bool Equals(VmDiskFileEncryptionInfo vmDiskFileEncryptionInfo)\n        {\n            return (vmDiskFileEncryptionInfo != null && ((this.KeyId == null && vmDiskFileEncryptionInfo.KeyId == null) || (this.KeyId != null && this.KeyId.Equals(vmDiskFileEncryptionInfo.KeyId))));\n        }\n\n        public override bool Equals(object vmDiskFileEncryptionInfo)\n        {\n            return Equals(vmDiskFileEncryptionInfo as VmDiskFileEncryptionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeyId).GetHashCode();\n        }\n    }\n\n    public class VmDiskFileInfo : FileInfo, IEquatable<VmDiskFileInfo>\n    {\n        public string DiskType { get; set; }\n\n        public long? CapacityKb { get; set; }\n\n        public int? HardwareVersion { get; set; }\n\n        public string ControllerType { get; set; }\n\n        public string[] DiskExtents { get; set; }\n\n        public bool? Thin { get; set; }\n\n        public VmDiskFileEncryptionInfo Encryption { get; set; }\n\n        public bool Equals(VmDiskFileInfo vmDiskFileInfo)\n        {\n            return (vmDiskFileInfo != null && this.DiskType == vmDiskFileInfo.DiskType && ((this.CapacityKb == null && vmDiskFileInfo.CapacityKb == null) || (this.CapacityKb != null && this.CapacityKb.Equals(vmDiskFileInfo.CapacityKb))) && ((this.HardwareVersion == null && vmDiskFileInfo.HardwareVersion == null) || (this.HardwareVersion != null && this.HardwareVersion.Equals(vmDiskFileInfo.HardwareVersion))) && this.ControllerType == vmDiskFileInfo.ControllerType && ((this.DiskExtents == null && vmDiskFileInfo.DiskExtents == null) || (this.DiskExtents != null && vmDiskFileInfo.DiskExtents != null && Enumerable.SequenceEqual(this.DiskExtents, vmDiskFileInfo.DiskExtents))) && ((this.Thin == null && vmDiskFileInfo.Thin == null) || (this.Thin != null && this.Thin.Equals(vmDiskFileInfo.Thin))) && ((this.Encryption == null && vmDiskFileInfo.Encryption == null) || (this.Encryption != null && this.Encryption.Equals(vmDiskFileInfo.Encryption))));\n        }\n\n        public override bool Equals(object vmDiskFileInfo)\n        {\n            return Equals(vmDiskFileInfo as VmDiskFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskType + \"_\" + CapacityKb + \"_\" + HardwareVersion + \"_\" + ControllerType + \"_\" + DiskExtents + \"_\" + Thin + \"_\" + Encryption).GetHashCode();\n        }\n    }\n\n    public class VmDiskFileQuery : FileQuery, IEquatable<VmDiskFileQuery>\n    {\n        public VmDiskFileQueryFilter Filter { get; set; }\n\n        public VmDiskFileQueryFlags Details { get; set; }\n\n        public bool Equals(VmDiskFileQuery vmDiskFileQuery)\n        {\n            return (vmDiskFileQuery != null && ((this.Filter == null && vmDiskFileQuery.Filter == null) || (this.Filter != null && this.Filter.Equals(vmDiskFileQuery.Filter))) && ((this.Details == null && vmDiskFileQuery.Details == null) || (this.Details != null && this.Details.Equals(vmDiskFileQuery.Details))));\n        }\n\n        public override bool Equals(object vmDiskFileQuery)\n        {\n            return Equals(vmDiskFileQuery as VmDiskFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Filter + \"_\" + Details).GetHashCode();\n        }\n    }\n\n    public class VmDiskFileQueryFilter : DynamicData, IEquatable<VmDiskFileQueryFilter>\n    {\n        public string[] DiskType { get; set; }\n\n        public int[] MatchHardwareVersion { get; set; }\n\n        public string[] ControllerType { get; set; }\n\n        public bool? Thin { get; set; }\n\n        public bool? Encrypted { get; set; }\n\n        public bool Equals(VmDiskFileQueryFilter vmDiskFileQueryFilter)\n        {\n            return (vmDiskFileQueryFilter != null && ((this.DiskType == null && vmDiskFileQueryFilter.DiskType == null) || (this.DiskType != null && vmDiskFileQueryFilter.DiskType != null && Enumerable.SequenceEqual(this.DiskType, vmDiskFileQueryFilter.DiskType))) && ((this.MatchHardwareVersion == null && vmDiskFileQueryFilter.MatchHardwareVersion == null) || (this.MatchHardwareVersion != null && vmDiskFileQueryFilter.MatchHardwareVersion != null && Enumerable.SequenceEqual(this.MatchHardwareVersion, vmDiskFileQueryFilter.MatchHardwareVersion))) && ((this.ControllerType == null && vmDiskFileQueryFilter.ControllerType == null) || (this.ControllerType != null && vmDiskFileQueryFilter.ControllerType != null && Enumerable.SequenceEqual(this.ControllerType, vmDiskFileQueryFilter.ControllerType))) && ((this.Thin == null && vmDiskFileQueryFilter.Thin == null) || (this.Thin != null && this.Thin.Equals(vmDiskFileQueryFilter.Thin))) && ((this.Encrypted == null && vmDiskFileQueryFilter.Encrypted == null) || (this.Encrypted != null && this.Encrypted.Equals(vmDiskFileQueryFilter.Encrypted))));\n        }\n\n        public override bool Equals(object vmDiskFileQueryFilter)\n        {\n            return Equals(vmDiskFileQueryFilter as VmDiskFileQueryFilter);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskType + \"_\" + MatchHardwareVersion + \"_\" + ControllerType + \"_\" + Thin + \"_\" + Encrypted).GetHashCode();\n        }\n    }\n\n    public class VmDiskFileQueryFlags : DynamicData, IEquatable<VmDiskFileQueryFlags>\n    {\n        public bool DiskType { get; set; }\n\n        public bool CapacityKb { get; set; }\n\n        public bool HardwareVersion { get; set; }\n\n        public bool? ControllerType { get; set; }\n\n        public bool? DiskExtents { get; set; }\n\n        public bool? Thin { get; set; }\n\n        public bool? Encryption { get; set; }\n\n        public bool Equals(VmDiskFileQueryFlags vmDiskFileQueryFlags)\n        {\n            return (vmDiskFileQueryFlags != null && this.DiskType == vmDiskFileQueryFlags.DiskType && this.CapacityKb == vmDiskFileQueryFlags.CapacityKb && this.HardwareVersion == vmDiskFileQueryFlags.HardwareVersion && ((this.ControllerType == null && vmDiskFileQueryFlags.ControllerType == null) || (this.ControllerType != null && this.ControllerType.Equals(vmDiskFileQueryFlags.ControllerType))) && ((this.DiskExtents == null && vmDiskFileQueryFlags.DiskExtents == null) || (this.DiskExtents != null && this.DiskExtents.Equals(vmDiskFileQueryFlags.DiskExtents))) && ((this.Thin == null && vmDiskFileQueryFlags.Thin == null) || (this.Thin != null && this.Thin.Equals(vmDiskFileQueryFlags.Thin))) && ((this.Encryption == null && vmDiskFileQueryFlags.Encryption == null) || (this.Encryption != null && this.Encryption.Equals(vmDiskFileQueryFlags.Encryption))));\n        }\n\n        public override bool Equals(object vmDiskFileQueryFlags)\n        {\n            return Equals(vmDiskFileQueryFlags as VmDiskFileQueryFlags);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskType + \"_\" + CapacityKb + \"_\" + HardwareVersion + \"_\" + ControllerType + \"_\" + DiskExtents + \"_\" + Thin + \"_\" + Encryption).GetHashCode();\n        }\n    }\n\n    public class VmEmigratingEvent : VmEvent, IEquatable<VmEmigratingEvent>\n    {\n        public bool Equals(VmEmigratingEvent vmEmigratingEvent)\n        {\n            return (vmEmigratingEvent != null && base.Equals(vmEmigratingEvent));\n        }\n\n        public override bool Equals(object vmEmigratingEvent)\n        {\n            return Equals(vmEmigratingEvent as VmEmigratingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmEndRecordingEvent : VmEvent, IEquatable<VmEndRecordingEvent>\n    {\n        public bool Equals(VmEndRecordingEvent vmEndRecordingEvent)\n        {\n            return (vmEndRecordingEvent != null && base.Equals(vmEndRecordingEvent));\n        }\n\n        public override bool Equals(object vmEndRecordingEvent)\n        {\n            return Equals(vmEndRecordingEvent as VmEndRecordingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmEndReplayingEvent : VmEvent, IEquatable<VmEndReplayingEvent>\n    {\n        public bool Equals(VmEndReplayingEvent vmEndReplayingEvent)\n        {\n            return (vmEndReplayingEvent != null && base.Equals(vmEndReplayingEvent));\n        }\n\n        public override bool Equals(object vmEndReplayingEvent)\n        {\n            return Equals(vmEndReplayingEvent as VmEndReplayingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmEvent : Event, IEquatable<VmEvent>\n    {\n        public bool Template { get; set; }\n\n        public bool Equals(VmEvent vmEvent)\n        {\n            return (vmEvent != null && this.Template == vmEvent.Template);\n        }\n\n        public override bool Equals(object vmEvent)\n        {\n            return Equals(vmEvent as VmEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Template).GetHashCode();\n        }\n    }\n\n    public class VmEventArgument : EntityEventArgument, IEquatable<VmEventArgument>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public VmEventArgument_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VmEventArgument vmEventArgument)\n        {\n            return (vmEventArgument != null && ((this.Vm == null && vmEventArgument.Vm == null) || (this.Vm != null && this.Vm.Equals(vmEventArgument.Vm))) && ((this.LinkedView == null && vmEventArgument.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmEventArgument.LinkedView))));\n        }\n\n        public override bool Equals(object vmEventArgument)\n        {\n            return Equals(vmEventArgument as VmEventArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmEventArgument_LinkedView : IEquatable<VmEventArgument_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public bool Equals(VmEventArgument_LinkedView vmEventArgument_LinkedView)\n        {\n            return (vmEventArgument_LinkedView != null && ((this.Vm == null && vmEventArgument_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(vmEventArgument_LinkedView.Vm))));\n        }\n\n        public override bool Equals(object vmEventArgument_LinkedView)\n        {\n            return Equals(vmEventArgument_LinkedView as VmEventArgument_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm).GetHashCode();\n        }\n    }\n\n    public class VmFailedMigrateEvent : VmEvent, IEquatable<VmFailedMigrateEvent>\n    {\n        public HostEventArgument DestHost { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public DatacenterEventArgument DestDatacenter { get; set; }\n\n        public DatastoreEventArgument DestDatastore { get; set; }\n\n        public bool Equals(VmFailedMigrateEvent vmFailedMigrateEvent)\n        {\n            return (vmFailedMigrateEvent != null && ((this.DestHost == null && vmFailedMigrateEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmFailedMigrateEvent.DestHost))) && ((this.Reason == null && vmFailedMigrateEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedMigrateEvent.Reason))) && ((this.DestDatacenter == null && vmFailedMigrateEvent.DestDatacenter == null) || (this.DestDatacenter != null && this.DestDatacenter.Equals(vmFailedMigrateEvent.DestDatacenter))) && ((this.DestDatastore == null && vmFailedMigrateEvent.DestDatastore == null) || (this.DestDatastore != null && this.DestDatastore.Equals(vmFailedMigrateEvent.DestDatastore))));\n        }\n\n        public override bool Equals(object vmFailedMigrateEvent)\n        {\n            return Equals(vmFailedMigrateEvent as VmFailedMigrateEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestHost + \"_\" + Reason + \"_\" + DestDatacenter + \"_\" + DestDatastore).GetHashCode();\n        }\n    }\n\n    public class VmFailedRelayoutEvent : VmEvent, IEquatable<VmFailedRelayoutEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedRelayoutEvent vmFailedRelayoutEvent)\n        {\n            return (vmFailedRelayoutEvent != null && ((this.Reason == null && vmFailedRelayoutEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedRelayoutEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedRelayoutEvent)\n        {\n            return Equals(vmFailedRelayoutEvent as VmFailedRelayoutEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedRelayoutOnVmfs2DatastoreEvent : VmEvent, IEquatable<VmFailedRelayoutOnVmfs2DatastoreEvent>\n    {\n        public bool Equals(VmFailedRelayoutOnVmfs2DatastoreEvent vmFailedRelayoutOnVmfs2DatastoreEvent)\n        {\n            return (vmFailedRelayoutOnVmfs2DatastoreEvent != null && base.Equals(vmFailedRelayoutOnVmfs2DatastoreEvent));\n        }\n\n        public override bool Equals(object vmFailedRelayoutOnVmfs2DatastoreEvent)\n        {\n            return Equals(vmFailedRelayoutOnVmfs2DatastoreEvent as VmFailedRelayoutOnVmfs2DatastoreEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmFailedStartingSecondaryEvent : VmEvent, IEquatable<VmFailedStartingSecondaryEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(VmFailedStartingSecondaryEvent vmFailedStartingSecondaryEvent)\n        {\n            return (vmFailedStartingSecondaryEvent != null && this.Reason == vmFailedStartingSecondaryEvent.Reason);\n        }\n\n        public override bool Equals(object vmFailedStartingSecondaryEvent)\n        {\n            return Equals(vmFailedStartingSecondaryEvent as VmFailedStartingSecondaryEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToPowerOffEvent : VmEvent, IEquatable<VmFailedToPowerOffEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToPowerOffEvent vmFailedToPowerOffEvent)\n        {\n            return (vmFailedToPowerOffEvent != null && ((this.Reason == null && vmFailedToPowerOffEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToPowerOffEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToPowerOffEvent)\n        {\n            return Equals(vmFailedToPowerOffEvent as VmFailedToPowerOffEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToPowerOnEvent : VmEvent, IEquatable<VmFailedToPowerOnEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToPowerOnEvent vmFailedToPowerOnEvent)\n        {\n            return (vmFailedToPowerOnEvent != null && ((this.Reason == null && vmFailedToPowerOnEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToPowerOnEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToPowerOnEvent)\n        {\n            return Equals(vmFailedToPowerOnEvent as VmFailedToPowerOnEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToRebootGuestEvent : VmEvent, IEquatable<VmFailedToRebootGuestEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToRebootGuestEvent vmFailedToRebootGuestEvent)\n        {\n            return (vmFailedToRebootGuestEvent != null && ((this.Reason == null && vmFailedToRebootGuestEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToRebootGuestEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToRebootGuestEvent)\n        {\n            return Equals(vmFailedToRebootGuestEvent as VmFailedToRebootGuestEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToResetEvent : VmEvent, IEquatable<VmFailedToResetEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToResetEvent vmFailedToResetEvent)\n        {\n            return (vmFailedToResetEvent != null && ((this.Reason == null && vmFailedToResetEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToResetEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToResetEvent)\n        {\n            return Equals(vmFailedToResetEvent as VmFailedToResetEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToShutdownGuestEvent : VmEvent, IEquatable<VmFailedToShutdownGuestEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToShutdownGuestEvent vmFailedToShutdownGuestEvent)\n        {\n            return (vmFailedToShutdownGuestEvent != null && ((this.Reason == null && vmFailedToShutdownGuestEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToShutdownGuestEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToShutdownGuestEvent)\n        {\n            return Equals(vmFailedToShutdownGuestEvent as VmFailedToShutdownGuestEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToStandbyGuestEvent : VmEvent, IEquatable<VmFailedToStandbyGuestEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToStandbyGuestEvent vmFailedToStandbyGuestEvent)\n        {\n            return (vmFailedToStandbyGuestEvent != null && ((this.Reason == null && vmFailedToStandbyGuestEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToStandbyGuestEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToStandbyGuestEvent)\n        {\n            return Equals(vmFailedToStandbyGuestEvent as VmFailedToStandbyGuestEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedToSuspendEvent : VmEvent, IEquatable<VmFailedToSuspendEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailedToSuspendEvent vmFailedToSuspendEvent)\n        {\n            return (vmFailedToSuspendEvent != null && ((this.Reason == null && vmFailedToSuspendEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailedToSuspendEvent.Reason))));\n        }\n\n        public override bool Equals(object vmFailedToSuspendEvent)\n        {\n            return Equals(vmFailedToSuspendEvent as VmFailedToSuspendEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFailedUpdatingSecondaryConfig : VmEvent, IEquatable<VmFailedUpdatingSecondaryConfig>\n    {\n        public bool Equals(VmFailedUpdatingSecondaryConfig vmFailedUpdatingSecondaryConfig)\n        {\n            return (vmFailedUpdatingSecondaryConfig != null && base.Equals(vmFailedUpdatingSecondaryConfig));\n        }\n\n        public override bool Equals(object vmFailedUpdatingSecondaryConfig)\n        {\n            return Equals(vmFailedUpdatingSecondaryConfig as VmFailedUpdatingSecondaryConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmFailoverFailed : VmEvent, IEquatable<VmFailoverFailed>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmFailoverFailed vmFailoverFailed)\n        {\n            return (vmFailoverFailed != null && ((this.Reason == null && vmFailoverFailed.Reason == null) || (this.Reason != null && this.Reason.Equals(vmFailoverFailed.Reason))));\n        }\n\n        public override bool Equals(object vmFailoverFailed)\n        {\n            return Equals(vmFailoverFailed as VmFailoverFailed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceConfigIssue : VmFaultToleranceIssue, IEquatable<VmFaultToleranceConfigIssue>\n    {\n        public string Reason { get; set; }\n\n        public string EntityName { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public VmFaultToleranceConfigIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VmFaultToleranceConfigIssue vmFaultToleranceConfigIssue)\n        {\n            return (vmFaultToleranceConfigIssue != null && this.Reason == vmFaultToleranceConfigIssue.Reason && this.EntityName == vmFaultToleranceConfigIssue.EntityName && ((this.Entity == null && vmFaultToleranceConfigIssue.Entity == null) || (this.Entity != null && this.Entity.Equals(vmFaultToleranceConfigIssue.Entity))) && ((this.LinkedView == null && vmFaultToleranceConfigIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmFaultToleranceConfigIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vmFaultToleranceConfigIssue)\n        {\n            return Equals(vmFaultToleranceConfigIssue as VmFaultToleranceConfigIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason + \"_\" + EntityName + \"_\" + Entity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceConfigIssue_LinkedView : IEquatable<VmFaultToleranceConfigIssue_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(VmFaultToleranceConfigIssue_LinkedView vmFaultToleranceConfigIssue_LinkedView)\n        {\n            return (vmFaultToleranceConfigIssue_LinkedView != null && ((this.Entity == null && vmFaultToleranceConfigIssue_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(vmFaultToleranceConfigIssue_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object vmFaultToleranceConfigIssue_LinkedView)\n        {\n            return Equals(vmFaultToleranceConfigIssue_LinkedView as VmFaultToleranceConfigIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceConfigIssueWrapper : VmFaultToleranceIssue, IEquatable<VmFaultToleranceConfigIssueWrapper>\n    {\n        public string EntityName { get; set; }\n\n        public ManagedObjectReference Entity { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public VmFaultToleranceConfigIssueWrapper_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VmFaultToleranceConfigIssueWrapper vmFaultToleranceConfigIssueWrapper)\n        {\n            return (vmFaultToleranceConfigIssueWrapper != null && this.EntityName == vmFaultToleranceConfigIssueWrapper.EntityName && ((this.Entity == null && vmFaultToleranceConfigIssueWrapper.Entity == null) || (this.Entity != null && this.Entity.Equals(vmFaultToleranceConfigIssueWrapper.Entity))) && ((this.Error == null && vmFaultToleranceConfigIssueWrapper.Error == null) || (this.Error != null && this.Error.Equals(vmFaultToleranceConfigIssueWrapper.Error))) && ((this.LinkedView == null && vmFaultToleranceConfigIssueWrapper.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmFaultToleranceConfigIssueWrapper.LinkedView))));\n        }\n\n        public override bool Equals(object vmFaultToleranceConfigIssueWrapper)\n        {\n            return Equals(vmFaultToleranceConfigIssueWrapper as VmFaultToleranceConfigIssueWrapper);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityName + \"_\" + Entity + \"_\" + Error + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceConfigIssueWrapper_LinkedView : IEquatable<VmFaultToleranceConfigIssueWrapper_LinkedView>\n    {\n        public ManagedEntity Entity { get; set; }\n\n        public bool Equals(VmFaultToleranceConfigIssueWrapper_LinkedView vmFaultToleranceConfigIssueWrapper_LinkedView)\n        {\n            return (vmFaultToleranceConfigIssueWrapper_LinkedView != null && ((this.Entity == null && vmFaultToleranceConfigIssueWrapper_LinkedView.Entity == null) || (this.Entity != null && this.Entity.Equals(vmFaultToleranceConfigIssueWrapper_LinkedView.Entity))));\n        }\n\n        public override bool Equals(object vmFaultToleranceConfigIssueWrapper_LinkedView)\n        {\n            return Equals(vmFaultToleranceConfigIssueWrapper_LinkedView as VmFaultToleranceConfigIssueWrapper_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceInvalidFileBacking : VmFaultToleranceIssue, IEquatable<VmFaultToleranceInvalidFileBacking>\n    {\n        public string BackingType { get; set; }\n\n        public string BackingFilename { get; set; }\n\n        public bool Equals(VmFaultToleranceInvalidFileBacking vmFaultToleranceInvalidFileBacking)\n        {\n            return (vmFaultToleranceInvalidFileBacking != null && this.BackingType == vmFaultToleranceInvalidFileBacking.BackingType && this.BackingFilename == vmFaultToleranceInvalidFileBacking.BackingFilename);\n        }\n\n        public override bool Equals(object vmFaultToleranceInvalidFileBacking)\n        {\n            return Equals(vmFaultToleranceInvalidFileBacking as VmFaultToleranceInvalidFileBacking);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BackingType + \"_\" + BackingFilename).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceIssue : VimFault, IEquatable<VmFaultToleranceIssue>\n    {\n        public bool Equals(VmFaultToleranceIssue vmFaultToleranceIssue)\n        {\n            return (vmFaultToleranceIssue != null && base.Equals(vmFaultToleranceIssue));\n        }\n\n        public override bool Equals(object vmFaultToleranceIssue)\n        {\n            return Equals(vmFaultToleranceIssue as VmFaultToleranceIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceOpIssuesList : VmFaultToleranceIssue, IEquatable<VmFaultToleranceOpIssuesList>\n    {\n        public LocalizedMethodFault[] Errors { get; set; }\n\n        public LocalizedMethodFault[] Warnings { get; set; }\n\n        public bool Equals(VmFaultToleranceOpIssuesList vmFaultToleranceOpIssuesList)\n        {\n            return (vmFaultToleranceOpIssuesList != null && ((this.Errors == null && vmFaultToleranceOpIssuesList.Errors == null) || (this.Errors != null && vmFaultToleranceOpIssuesList.Errors != null && Enumerable.SequenceEqual(this.Errors, vmFaultToleranceOpIssuesList.Errors))) && ((this.Warnings == null && vmFaultToleranceOpIssuesList.Warnings == null) || (this.Warnings != null && vmFaultToleranceOpIssuesList.Warnings != null && Enumerable.SequenceEqual(this.Warnings, vmFaultToleranceOpIssuesList.Warnings))));\n        }\n\n        public override bool Equals(object vmFaultToleranceOpIssuesList)\n        {\n            return Equals(vmFaultToleranceOpIssuesList as VmFaultToleranceOpIssuesList);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Errors + \"_\" + Warnings).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceStateChangedEvent : VmEvent, IEquatable<VmFaultToleranceStateChangedEvent>\n    {\n        public VirtualMachineFaultToleranceState OldState { get; set; }\n\n        public VirtualMachineFaultToleranceState NewState { get; set; }\n\n        public bool Equals(VmFaultToleranceStateChangedEvent vmFaultToleranceStateChangedEvent)\n        {\n            return (vmFaultToleranceStateChangedEvent != null && this.OldState == vmFaultToleranceStateChangedEvent.OldState && this.NewState == vmFaultToleranceStateChangedEvent.NewState);\n        }\n\n        public override bool Equals(object vmFaultToleranceStateChangedEvent)\n        {\n            return Equals(vmFaultToleranceStateChangedEvent as VmFaultToleranceStateChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldState + \"_\" + NewState).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceTooManyFtVcpusOnHost : InsufficientResourcesFault, IEquatable<VmFaultToleranceTooManyFtVcpusOnHost>\n    {\n        public string HostName { get; set; }\n\n        public int MaxNumFtVcpus { get; set; }\n\n        public bool Equals(VmFaultToleranceTooManyFtVcpusOnHost vmFaultToleranceTooManyFtVcpusOnHost)\n        {\n            return (vmFaultToleranceTooManyFtVcpusOnHost != null && this.HostName == vmFaultToleranceTooManyFtVcpusOnHost.HostName && this.MaxNumFtVcpus == vmFaultToleranceTooManyFtVcpusOnHost.MaxNumFtVcpus);\n        }\n\n        public override bool Equals(object vmFaultToleranceTooManyFtVcpusOnHost)\n        {\n            return Equals(vmFaultToleranceTooManyFtVcpusOnHost as VmFaultToleranceTooManyFtVcpusOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + MaxNumFtVcpus).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceTooManyVMsOnHost : InsufficientResourcesFault, IEquatable<VmFaultToleranceTooManyVMsOnHost>\n    {\n        public string HostName { get; set; }\n\n        public int MaxNumFtVms { get; set; }\n\n        public bool Equals(VmFaultToleranceTooManyVMsOnHost vmFaultToleranceTooManyVMsOnHost)\n        {\n            return (vmFaultToleranceTooManyVMsOnHost != null && this.HostName == vmFaultToleranceTooManyVMsOnHost.HostName && this.MaxNumFtVms == vmFaultToleranceTooManyVMsOnHost.MaxNumFtVms);\n        }\n\n        public override bool Equals(object vmFaultToleranceTooManyVMsOnHost)\n        {\n            return Equals(vmFaultToleranceTooManyVMsOnHost as VmFaultToleranceTooManyVMsOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + MaxNumFtVms).GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceTurnedOffEvent : VmEvent, IEquatable<VmFaultToleranceTurnedOffEvent>\n    {\n        public bool Equals(VmFaultToleranceTurnedOffEvent vmFaultToleranceTurnedOffEvent)\n        {\n            return (vmFaultToleranceTurnedOffEvent != null && base.Equals(vmFaultToleranceTurnedOffEvent));\n        }\n\n        public override bool Equals(object vmFaultToleranceTurnedOffEvent)\n        {\n            return Equals(vmFaultToleranceTurnedOffEvent as VmFaultToleranceTurnedOffEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmFaultToleranceVmTerminatedEvent : VmEvent, IEquatable<VmFaultToleranceVmTerminatedEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(VmFaultToleranceVmTerminatedEvent vmFaultToleranceVmTerminatedEvent)\n        {\n            return (vmFaultToleranceVmTerminatedEvent != null && this.Reason == vmFaultToleranceVmTerminatedEvent.Reason);\n        }\n\n        public override bool Equals(object vmFaultToleranceVmTerminatedEvent)\n        {\n            return Equals(vmFaultToleranceVmTerminatedEvent as VmFaultToleranceVmTerminatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmfsAlreadyMounted : VmfsMountFault, IEquatable<VmfsAlreadyMounted>\n    {\n        public bool Equals(VmfsAlreadyMounted vmfsAlreadyMounted)\n        {\n            return (vmfsAlreadyMounted != null && base.Equals(vmfsAlreadyMounted));\n        }\n\n        public override bool Equals(object vmfsAlreadyMounted)\n        {\n            return Equals(vmfsAlreadyMounted as VmfsAlreadyMounted);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmfsAmbiguousMount : VmfsMountFault, IEquatable<VmfsAmbiguousMount>\n    {\n        public bool Equals(VmfsAmbiguousMount vmfsAmbiguousMount)\n        {\n            return (vmfsAmbiguousMount != null && base.Equals(vmfsAmbiguousMount));\n        }\n\n        public override bool Equals(object vmfsAmbiguousMount)\n        {\n            return Equals(vmfsAmbiguousMount as VmfsAmbiguousMount);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmfsConfigOption : DynamicData, IEquatable<VmfsConfigOption>\n    {\n        public int BlockSizeOption { get; set; }\n\n        public int[] UnmapGranularityOption { get; set; }\n\n        public LongOption UnmapBandwidthFixedValue { get; set; }\n\n        public LongOption UnmapBandwidthDynamicMin { get; set; }\n\n        public LongOption UnmapBandwidthDynamicMax { get; set; }\n\n        public long? UnmapBandwidthIncrement { get; set; }\n\n        public bool Equals(VmfsConfigOption vmfsConfigOption)\n        {\n            return (vmfsConfigOption != null && this.BlockSizeOption == vmfsConfigOption.BlockSizeOption && ((this.UnmapGranularityOption == null && vmfsConfigOption.UnmapGranularityOption == null) || (this.UnmapGranularityOption != null && vmfsConfigOption.UnmapGranularityOption != null && Enumerable.SequenceEqual(this.UnmapGranularityOption, vmfsConfigOption.UnmapGranularityOption))) && ((this.UnmapBandwidthFixedValue == null && vmfsConfigOption.UnmapBandwidthFixedValue == null) || (this.UnmapBandwidthFixedValue != null && this.UnmapBandwidthFixedValue.Equals(vmfsConfigOption.UnmapBandwidthFixedValue))) && ((this.UnmapBandwidthDynamicMin == null && vmfsConfigOption.UnmapBandwidthDynamicMin == null) || (this.UnmapBandwidthDynamicMin != null && this.UnmapBandwidthDynamicMin.Equals(vmfsConfigOption.UnmapBandwidthDynamicMin))) && ((this.UnmapBandwidthDynamicMax == null && vmfsConfigOption.UnmapBandwidthDynamicMax == null) || (this.UnmapBandwidthDynamicMax != null && this.UnmapBandwidthDynamicMax.Equals(vmfsConfigOption.UnmapBandwidthDynamicMax))) && ((this.UnmapBandwidthIncrement == null && vmfsConfigOption.UnmapBandwidthIncrement == null) || (this.UnmapBandwidthIncrement != null && this.UnmapBandwidthIncrement.Equals(vmfsConfigOption.UnmapBandwidthIncrement))));\n        }\n\n        public override bool Equals(object vmfsConfigOption)\n        {\n            return Equals(vmfsConfigOption as VmfsConfigOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BlockSizeOption + \"_\" + UnmapGranularityOption + \"_\" + UnmapBandwidthFixedValue + \"_\" + UnmapBandwidthDynamicMin + \"_\" + UnmapBandwidthDynamicMax + \"_\" + UnmapBandwidthIncrement).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreAllExtentOption : VmfsDatastoreSingleExtentOption, IEquatable<VmfsDatastoreAllExtentOption>\n    {\n        public bool Equals(VmfsDatastoreAllExtentOption vmfsDatastoreAllExtentOption)\n        {\n            return (vmfsDatastoreAllExtentOption != null && base.Equals(vmfsDatastoreAllExtentOption));\n        }\n\n        public override bool Equals(object vmfsDatastoreAllExtentOption)\n        {\n            return Equals(vmfsDatastoreAllExtentOption as VmfsDatastoreAllExtentOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreBaseOption : DynamicData, IEquatable<VmfsDatastoreBaseOption>\n    {\n        public HostDiskPartitionLayout Layout { get; set; }\n\n        public bool? PartitionFormatChange { get; set; }\n\n        public bool Equals(VmfsDatastoreBaseOption vmfsDatastoreBaseOption)\n        {\n            return (vmfsDatastoreBaseOption != null && ((this.Layout == null && vmfsDatastoreBaseOption.Layout == null) || (this.Layout != null && this.Layout.Equals(vmfsDatastoreBaseOption.Layout))) && ((this.PartitionFormatChange == null && vmfsDatastoreBaseOption.PartitionFormatChange == null) || (this.PartitionFormatChange != null && this.PartitionFormatChange.Equals(vmfsDatastoreBaseOption.PartitionFormatChange))));\n        }\n\n        public override bool Equals(object vmfsDatastoreBaseOption)\n        {\n            return Equals(vmfsDatastoreBaseOption as VmfsDatastoreBaseOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Layout + \"_\" + PartitionFormatChange).GetHashCode();\n        }\n    }\n\n    public class VMFSDatastoreCreatedEvent : HostEvent, IEquatable<VMFSDatastoreCreatedEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public string DatastoreUrl { get; set; }\n\n        public bool Equals(VMFSDatastoreCreatedEvent vMFSDatastoreCreatedEvent)\n        {\n            return (vMFSDatastoreCreatedEvent != null && ((this.Datastore == null && vMFSDatastoreCreatedEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vMFSDatastoreCreatedEvent.Datastore))) && this.DatastoreUrl == vMFSDatastoreCreatedEvent.DatastoreUrl);\n        }\n\n        public override bool Equals(object vMFSDatastoreCreatedEvent)\n        {\n            return Equals(vMFSDatastoreCreatedEvent as VMFSDatastoreCreatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + DatastoreUrl).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreCreateSpec : VmfsDatastoreSpec, IEquatable<VmfsDatastoreCreateSpec>\n    {\n        public HostDiskPartitionSpec Partition { get; set; }\n\n        public HostVmfsSpec Vmfs { get; set; }\n\n        public HostScsiDiskPartition[] Extent { get; set; }\n\n        public bool Equals(VmfsDatastoreCreateSpec vmfsDatastoreCreateSpec)\n        {\n            return (vmfsDatastoreCreateSpec != null && ((this.Partition == null && vmfsDatastoreCreateSpec.Partition == null) || (this.Partition != null && this.Partition.Equals(vmfsDatastoreCreateSpec.Partition))) && ((this.Vmfs == null && vmfsDatastoreCreateSpec.Vmfs == null) || (this.Vmfs != null && this.Vmfs.Equals(vmfsDatastoreCreateSpec.Vmfs))) && ((this.Extent == null && vmfsDatastoreCreateSpec.Extent == null) || (this.Extent != null && vmfsDatastoreCreateSpec.Extent != null && Enumerable.SequenceEqual(this.Extent, vmfsDatastoreCreateSpec.Extent))));\n        }\n\n        public override bool Equals(object vmfsDatastoreCreateSpec)\n        {\n            return Equals(vmfsDatastoreCreateSpec as VmfsDatastoreCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partition + \"_\" + Vmfs + \"_\" + Extent).GetHashCode();\n        }\n    }\n\n    public class VMFSDatastoreExpandedEvent : HostEvent, IEquatable<VMFSDatastoreExpandedEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public bool Equals(VMFSDatastoreExpandedEvent vMFSDatastoreExpandedEvent)\n        {\n            return (vMFSDatastoreExpandedEvent != null && ((this.Datastore == null && vMFSDatastoreExpandedEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vMFSDatastoreExpandedEvent.Datastore))));\n        }\n\n        public override bool Equals(object vMFSDatastoreExpandedEvent)\n        {\n            return Equals(vMFSDatastoreExpandedEvent as VMFSDatastoreExpandedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreExpandSpec : VmfsDatastoreSpec, IEquatable<VmfsDatastoreExpandSpec>\n    {\n        public HostDiskPartitionSpec Partition { get; set; }\n\n        public HostScsiDiskPartition Extent { get; set; }\n\n        public bool Equals(VmfsDatastoreExpandSpec vmfsDatastoreExpandSpec)\n        {\n            return (vmfsDatastoreExpandSpec != null && ((this.Partition == null && vmfsDatastoreExpandSpec.Partition == null) || (this.Partition != null && this.Partition.Equals(vmfsDatastoreExpandSpec.Partition))) && ((this.Extent == null && vmfsDatastoreExpandSpec.Extent == null) || (this.Extent != null && this.Extent.Equals(vmfsDatastoreExpandSpec.Extent))));\n        }\n\n        public override bool Equals(object vmfsDatastoreExpandSpec)\n        {\n            return Equals(vmfsDatastoreExpandSpec as VmfsDatastoreExpandSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partition + \"_\" + Extent).GetHashCode();\n        }\n    }\n\n    public class VMFSDatastoreExtendedEvent : HostEvent, IEquatable<VMFSDatastoreExtendedEvent>\n    {\n        public DatastoreEventArgument Datastore { get; set; }\n\n        public bool Equals(VMFSDatastoreExtendedEvent vMFSDatastoreExtendedEvent)\n        {\n            return (vMFSDatastoreExtendedEvent != null && ((this.Datastore == null && vMFSDatastoreExtendedEvent.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vMFSDatastoreExtendedEvent.Datastore))));\n        }\n\n        public override bool Equals(object vMFSDatastoreExtendedEvent)\n        {\n            return Equals(vMFSDatastoreExtendedEvent as VMFSDatastoreExtendedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreExtendSpec : VmfsDatastoreSpec, IEquatable<VmfsDatastoreExtendSpec>\n    {\n        public HostDiskPartitionSpec Partition { get; set; }\n\n        public HostScsiDiskPartition[] Extent { get; set; }\n\n        public bool Equals(VmfsDatastoreExtendSpec vmfsDatastoreExtendSpec)\n        {\n            return (vmfsDatastoreExtendSpec != null && ((this.Partition == null && vmfsDatastoreExtendSpec.Partition == null) || (this.Partition != null && this.Partition.Equals(vmfsDatastoreExtendSpec.Partition))) && ((this.Extent == null && vmfsDatastoreExtendSpec.Extent == null) || (this.Extent != null && vmfsDatastoreExtendSpec.Extent != null && Enumerable.SequenceEqual(this.Extent, vmfsDatastoreExtendSpec.Extent))));\n        }\n\n        public override bool Equals(object vmfsDatastoreExtendSpec)\n        {\n            return Equals(vmfsDatastoreExtendSpec as VmfsDatastoreExtendSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partition + \"_\" + Extent).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreInfo : DatastoreInfo, IEquatable<VmfsDatastoreInfo>\n    {\n        public long MaxPhysicalRDMFileSize { get; set; }\n\n        public long MaxVirtualRDMFileSize { get; set; }\n\n        public HostVmfsVolume Vmfs { get; set; }\n\n        public bool Equals(VmfsDatastoreInfo vmfsDatastoreInfo)\n        {\n            return (vmfsDatastoreInfo != null && this.MaxPhysicalRDMFileSize == vmfsDatastoreInfo.MaxPhysicalRDMFileSize && this.MaxVirtualRDMFileSize == vmfsDatastoreInfo.MaxVirtualRDMFileSize && ((this.Vmfs == null && vmfsDatastoreInfo.Vmfs == null) || (this.Vmfs != null && this.Vmfs.Equals(vmfsDatastoreInfo.Vmfs))));\n        }\n\n        public override bool Equals(object vmfsDatastoreInfo)\n        {\n            return Equals(vmfsDatastoreInfo as VmfsDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxPhysicalRDMFileSize + \"_\" + MaxVirtualRDMFileSize + \"_\" + Vmfs).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreMultipleExtentOption : VmfsDatastoreBaseOption, IEquatable<VmfsDatastoreMultipleExtentOption>\n    {\n        public HostDiskPartitionBlockRange[] VmfsExtent { get; set; }\n\n        public bool Equals(VmfsDatastoreMultipleExtentOption vmfsDatastoreMultipleExtentOption)\n        {\n            return (vmfsDatastoreMultipleExtentOption != null && ((this.VmfsExtent == null && vmfsDatastoreMultipleExtentOption.VmfsExtent == null) || (this.VmfsExtent != null && vmfsDatastoreMultipleExtentOption.VmfsExtent != null && Enumerable.SequenceEqual(this.VmfsExtent, vmfsDatastoreMultipleExtentOption.VmfsExtent))));\n        }\n\n        public override bool Equals(object vmfsDatastoreMultipleExtentOption)\n        {\n            return Equals(vmfsDatastoreMultipleExtentOption as VmfsDatastoreMultipleExtentOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmfsExtent).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreOption : DynamicData, IEquatable<VmfsDatastoreOption>\n    {\n        public VmfsDatastoreBaseOption Info { get; set; }\n\n        public VmfsDatastoreSpec Spec { get; set; }\n\n        public bool Equals(VmfsDatastoreOption vmfsDatastoreOption)\n        {\n            return (vmfsDatastoreOption != null && ((this.Info == null && vmfsDatastoreOption.Info == null) || (this.Info != null && this.Info.Equals(vmfsDatastoreOption.Info))) && ((this.Spec == null && vmfsDatastoreOption.Spec == null) || (this.Spec != null && this.Spec.Equals(vmfsDatastoreOption.Spec))));\n        }\n\n        public override bool Equals(object vmfsDatastoreOption)\n        {\n            return Equals(vmfsDatastoreOption as VmfsDatastoreOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Info + \"_\" + Spec).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreSingleExtentOption : VmfsDatastoreBaseOption, IEquatable<VmfsDatastoreSingleExtentOption>\n    {\n        public HostDiskPartitionBlockRange VmfsExtent { get; set; }\n\n        public bool Equals(VmfsDatastoreSingleExtentOption vmfsDatastoreSingleExtentOption)\n        {\n            return (vmfsDatastoreSingleExtentOption != null && ((this.VmfsExtent == null && vmfsDatastoreSingleExtentOption.VmfsExtent == null) || (this.VmfsExtent != null && this.VmfsExtent.Equals(vmfsDatastoreSingleExtentOption.VmfsExtent))));\n        }\n\n        public override bool Equals(object vmfsDatastoreSingleExtentOption)\n        {\n            return Equals(vmfsDatastoreSingleExtentOption as VmfsDatastoreSingleExtentOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmfsExtent).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreSpec : DynamicData, IEquatable<VmfsDatastoreSpec>\n    {\n        public string DiskUuid { get; set; }\n\n        public bool Equals(VmfsDatastoreSpec vmfsDatastoreSpec)\n        {\n            return (vmfsDatastoreSpec != null && this.DiskUuid == vmfsDatastoreSpec.DiskUuid);\n        }\n\n        public override bool Equals(object vmfsDatastoreSpec)\n        {\n            return Equals(vmfsDatastoreSpec as VmfsDatastoreSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskUuid).GetHashCode();\n        }\n    }\n\n    public class VmfsMountFault : HostConfigFault, IEquatable<VmfsMountFault>\n    {\n        public string Uuid { get; set; }\n\n        public bool Equals(VmfsMountFault vmfsMountFault)\n        {\n            return (vmfsMountFault != null && this.Uuid == vmfsMountFault.Uuid);\n        }\n\n        public override bool Equals(object vmfsMountFault)\n        {\n            return Equals(vmfsMountFault as VmfsMountFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid).GetHashCode();\n        }\n    }\n\n    public class VmfsUnmapBandwidthSpec : DynamicData, IEquatable<VmfsUnmapBandwidthSpec>\n    {\n        public string Policy { get; set; }\n\n        public long FixedValue { get; set; }\n\n        public long DynamicMin { get; set; }\n\n        public long DynamicMax { get; set; }\n\n        public bool Equals(VmfsUnmapBandwidthSpec vmfsUnmapBandwidthSpec)\n        {\n            return (vmfsUnmapBandwidthSpec != null && this.Policy == vmfsUnmapBandwidthSpec.Policy && this.FixedValue == vmfsUnmapBandwidthSpec.FixedValue && this.DynamicMin == vmfsUnmapBandwidthSpec.DynamicMin && this.DynamicMax == vmfsUnmapBandwidthSpec.DynamicMax);\n        }\n\n        public override bool Equals(object vmfsUnmapBandwidthSpec)\n        {\n            return Equals(vmfsUnmapBandwidthSpec as VmfsUnmapBandwidthSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy + \"_\" + FixedValue + \"_\" + DynamicMin + \"_\" + DynamicMax).GetHashCode();\n        }\n    }\n\n    public class VmGuestOSCrashedEvent : VmEvent, IEquatable<VmGuestOSCrashedEvent>\n    {\n        public bool Equals(VmGuestOSCrashedEvent vmGuestOSCrashedEvent)\n        {\n            return (vmGuestOSCrashedEvent != null && base.Equals(vmGuestOSCrashedEvent));\n        }\n\n        public override bool Equals(object vmGuestOSCrashedEvent)\n        {\n            return Equals(vmGuestOSCrashedEvent as VmGuestOSCrashedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmGuestRebootEvent : VmEvent, IEquatable<VmGuestRebootEvent>\n    {\n        public bool Equals(VmGuestRebootEvent vmGuestRebootEvent)\n        {\n            return (vmGuestRebootEvent != null && base.Equals(vmGuestRebootEvent));\n        }\n\n        public override bool Equals(object vmGuestRebootEvent)\n        {\n            return Equals(vmGuestRebootEvent as VmGuestRebootEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmGuestShutdownEvent : VmEvent, IEquatable<VmGuestShutdownEvent>\n    {\n        public bool Equals(VmGuestShutdownEvent vmGuestShutdownEvent)\n        {\n            return (vmGuestShutdownEvent != null && base.Equals(vmGuestShutdownEvent));\n        }\n\n        public override bool Equals(object vmGuestShutdownEvent)\n        {\n            return Equals(vmGuestShutdownEvent as VmGuestShutdownEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmGuestStandbyEvent : VmEvent, IEquatable<VmGuestStandbyEvent>\n    {\n        public bool Equals(VmGuestStandbyEvent vmGuestStandbyEvent)\n        {\n            return (vmGuestStandbyEvent != null && base.Equals(vmGuestStandbyEvent));\n        }\n\n        public override bool Equals(object vmGuestStandbyEvent)\n        {\n            return Equals(vmGuestStandbyEvent as VmGuestStandbyEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmHealthMonitoringStateChangedEvent : ClusterEvent, IEquatable<VmHealthMonitoringStateChangedEvent>\n    {\n        public string State { get; set; }\n\n        public string PrevState { get; set; }\n\n        public bool Equals(VmHealthMonitoringStateChangedEvent vmHealthMonitoringStateChangedEvent)\n        {\n            return (vmHealthMonitoringStateChangedEvent != null && this.State == vmHealthMonitoringStateChangedEvent.State && this.PrevState == vmHealthMonitoringStateChangedEvent.PrevState);\n        }\n\n        public override bool Equals(object vmHealthMonitoringStateChangedEvent)\n        {\n            return Equals(vmHealthMonitoringStateChangedEvent as VmHealthMonitoringStateChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + PrevState).GetHashCode();\n        }\n    }\n\n    public class VmHostAffinityRuleViolation : VmConfigFault, IEquatable<VmHostAffinityRuleViolation>\n    {\n        public string VmName { get; set; }\n\n        public string HostName { get; set; }\n\n        public bool Equals(VmHostAffinityRuleViolation vmHostAffinityRuleViolation)\n        {\n            return (vmHostAffinityRuleViolation != null && this.VmName == vmHostAffinityRuleViolation.VmName && this.HostName == vmHostAffinityRuleViolation.HostName);\n        }\n\n        public override bool Equals(object vmHostAffinityRuleViolation)\n        {\n            return Equals(vmHostAffinityRuleViolation as VmHostAffinityRuleViolation);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmName + \"_\" + HostName).GetHashCode();\n        }\n    }\n\n    public class VMINotSupported : DeviceNotSupported, IEquatable<VMINotSupported>\n    {\n        public bool Equals(VMINotSupported vMINotSupported)\n        {\n            return (vMINotSupported != null && base.Equals(vMINotSupported));\n        }\n\n        public override bool Equals(object vMINotSupported)\n        {\n            return Equals(vMINotSupported as VMINotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmInstanceUuidAssignedEvent : VmEvent, IEquatable<VmInstanceUuidAssignedEvent>\n    {\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(VmInstanceUuidAssignedEvent vmInstanceUuidAssignedEvent)\n        {\n            return (vmInstanceUuidAssignedEvent != null && this.InstanceUuid == vmInstanceUuidAssignedEvent.InstanceUuid);\n        }\n\n        public override bool Equals(object vmInstanceUuidAssignedEvent)\n        {\n            return Equals(vmInstanceUuidAssignedEvent as VmInstanceUuidAssignedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class VmInstanceUuidChangedEvent : VmEvent, IEquatable<VmInstanceUuidChangedEvent>\n    {\n        public string OldInstanceUuid { get; set; }\n\n        public string NewInstanceUuid { get; set; }\n\n        public bool Equals(VmInstanceUuidChangedEvent vmInstanceUuidChangedEvent)\n        {\n            return (vmInstanceUuidChangedEvent != null && this.OldInstanceUuid == vmInstanceUuidChangedEvent.OldInstanceUuid && this.NewInstanceUuid == vmInstanceUuidChangedEvent.NewInstanceUuid);\n        }\n\n        public override bool Equals(object vmInstanceUuidChangedEvent)\n        {\n            return Equals(vmInstanceUuidChangedEvent as VmInstanceUuidChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldInstanceUuid + \"_\" + NewInstanceUuid).GetHashCode();\n        }\n    }\n\n    public class VmInstanceUuidConflictEvent : VmEvent, IEquatable<VmInstanceUuidConflictEvent>\n    {\n        public VmEventArgument ConflictedVm { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public bool Equals(VmInstanceUuidConflictEvent vmInstanceUuidConflictEvent)\n        {\n            return (vmInstanceUuidConflictEvent != null && ((this.ConflictedVm == null && vmInstanceUuidConflictEvent.ConflictedVm == null) || (this.ConflictedVm != null && this.ConflictedVm.Equals(vmInstanceUuidConflictEvent.ConflictedVm))) && this.InstanceUuid == vmInstanceUuidConflictEvent.InstanceUuid);\n        }\n\n        public override bool Equals(object vmInstanceUuidConflictEvent)\n        {\n            return Equals(vmInstanceUuidConflictEvent as VmInstanceUuidConflictEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictedVm + \"_\" + InstanceUuid).GetHashCode();\n        }\n    }\n\n    public class VmLimitLicense : NotEnoughLicenses, IEquatable<VmLimitLicense>\n    {\n        public int Limit { get; set; }\n\n        public bool Equals(VmLimitLicense vmLimitLicense)\n        {\n            return (vmLimitLicense != null && this.Limit == vmLimitLicense.Limit);\n        }\n\n        public override bool Equals(object vmLimitLicense)\n        {\n            return Equals(vmLimitLicense as VmLimitLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Limit).GetHashCode();\n        }\n    }\n\n    public class VmLogFileInfo : FileInfo, IEquatable<VmLogFileInfo>\n    {\n        public bool Equals(VmLogFileInfo vmLogFileInfo)\n        {\n            return (vmLogFileInfo != null && base.Equals(vmLogFileInfo));\n        }\n\n        public override bool Equals(object vmLogFileInfo)\n        {\n            return Equals(vmLogFileInfo as VmLogFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmLogFileQuery : FileQuery, IEquatable<VmLogFileQuery>\n    {\n        public bool Equals(VmLogFileQuery vmLogFileQuery)\n        {\n            return (vmLogFileQuery != null && base.Equals(vmLogFileQuery));\n        }\n\n        public override bool Equals(object vmLogFileQuery)\n        {\n            return Equals(vmLogFileQuery as VmLogFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmMacAssignedEvent : VmEvent, IEquatable<VmMacAssignedEvent>\n    {\n        public string Adapter { get; set; }\n\n        public string Mac { get; set; }\n\n        public bool Equals(VmMacAssignedEvent vmMacAssignedEvent)\n        {\n            return (vmMacAssignedEvent != null && this.Adapter == vmMacAssignedEvent.Adapter && this.Mac == vmMacAssignedEvent.Mac);\n        }\n\n        public override bool Equals(object vmMacAssignedEvent)\n        {\n            return Equals(vmMacAssignedEvent as VmMacAssignedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Adapter + \"_\" + Mac).GetHashCode();\n        }\n    }\n\n    public class VmMacChangedEvent : VmEvent, IEquatable<VmMacChangedEvent>\n    {\n        public string Adapter { get; set; }\n\n        public string OldMac { get; set; }\n\n        public string NewMac { get; set; }\n\n        public bool Equals(VmMacChangedEvent vmMacChangedEvent)\n        {\n            return (vmMacChangedEvent != null && this.Adapter == vmMacChangedEvent.Adapter && this.OldMac == vmMacChangedEvent.OldMac && this.NewMac == vmMacChangedEvent.NewMac);\n        }\n\n        public override bool Equals(object vmMacChangedEvent)\n        {\n            return Equals(vmMacChangedEvent as VmMacChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Adapter + \"_\" + OldMac + \"_\" + NewMac).GetHashCode();\n        }\n    }\n\n    public class VmMacConflictEvent : VmEvent, IEquatable<VmMacConflictEvent>\n    {\n        public VmEventArgument ConflictedVm { get; set; }\n\n        public string Mac { get; set; }\n\n        public bool Equals(VmMacConflictEvent vmMacConflictEvent)\n        {\n            return (vmMacConflictEvent != null && ((this.ConflictedVm == null && vmMacConflictEvent.ConflictedVm == null) || (this.ConflictedVm != null && this.ConflictedVm.Equals(vmMacConflictEvent.ConflictedVm))) && this.Mac == vmMacConflictEvent.Mac);\n        }\n\n        public override bool Equals(object vmMacConflictEvent)\n        {\n            return Equals(vmMacConflictEvent as VmMacConflictEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictedVm + \"_\" + Mac).GetHashCode();\n        }\n    }\n\n    public class VmMaxFTRestartCountReached : VmEvent, IEquatable<VmMaxFTRestartCountReached>\n    {\n        public bool Equals(VmMaxFTRestartCountReached vmMaxFTRestartCountReached)\n        {\n            return (vmMaxFTRestartCountReached != null && base.Equals(vmMaxFTRestartCountReached));\n        }\n\n        public override bool Equals(object vmMaxFTRestartCountReached)\n        {\n            return Equals(vmMaxFTRestartCountReached as VmMaxFTRestartCountReached);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmMaxRestartCountReached : VmEvent, IEquatable<VmMaxRestartCountReached>\n    {\n        public bool Equals(VmMaxRestartCountReached vmMaxRestartCountReached)\n        {\n            return (vmMaxRestartCountReached != null && base.Equals(vmMaxRestartCountReached));\n        }\n\n        public override bool Equals(object vmMaxRestartCountReached)\n        {\n            return Equals(vmMaxRestartCountReached as VmMaxRestartCountReached);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmMessageErrorEvent : VmEvent, IEquatable<VmMessageErrorEvent>\n    {\n        public string Message { get; set; }\n\n        public VirtualMachineMessage[] MessageInfo { get; set; }\n\n        public bool Equals(VmMessageErrorEvent vmMessageErrorEvent)\n        {\n            return (vmMessageErrorEvent != null && this.Message == vmMessageErrorEvent.Message && ((this.MessageInfo == null && vmMessageErrorEvent.MessageInfo == null) || (this.MessageInfo != null && vmMessageErrorEvent.MessageInfo != null && Enumerable.SequenceEqual(this.MessageInfo, vmMessageErrorEvent.MessageInfo))));\n        }\n\n        public override bool Equals(object vmMessageErrorEvent)\n        {\n            return Equals(vmMessageErrorEvent as VmMessageErrorEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message + \"_\" + MessageInfo).GetHashCode();\n        }\n    }\n\n    public class VmMessageEvent : VmEvent, IEquatable<VmMessageEvent>\n    {\n        public string Message { get; set; }\n\n        public VirtualMachineMessage[] MessageInfo { get; set; }\n\n        public bool Equals(VmMessageEvent vmMessageEvent)\n        {\n            return (vmMessageEvent != null && this.Message == vmMessageEvent.Message && ((this.MessageInfo == null && vmMessageEvent.MessageInfo == null) || (this.MessageInfo != null && vmMessageEvent.MessageInfo != null && Enumerable.SequenceEqual(this.MessageInfo, vmMessageEvent.MessageInfo))));\n        }\n\n        public override bool Equals(object vmMessageEvent)\n        {\n            return Equals(vmMessageEvent as VmMessageEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message + \"_\" + MessageInfo).GetHashCode();\n        }\n    }\n\n    public class VmMessageWarningEvent : VmEvent, IEquatable<VmMessageWarningEvent>\n    {\n        public string Message { get; set; }\n\n        public VirtualMachineMessage[] MessageInfo { get; set; }\n\n        public bool Equals(VmMessageWarningEvent vmMessageWarningEvent)\n        {\n            return (vmMessageWarningEvent != null && this.Message == vmMessageWarningEvent.Message && ((this.MessageInfo == null && vmMessageWarningEvent.MessageInfo == null) || (this.MessageInfo != null && vmMessageWarningEvent.MessageInfo != null && Enumerable.SequenceEqual(this.MessageInfo, vmMessageWarningEvent.MessageInfo))));\n        }\n\n        public override bool Equals(object vmMessageWarningEvent)\n        {\n            return Equals(vmMessageWarningEvent as VmMessageWarningEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Message + \"_\" + MessageInfo).GetHashCode();\n        }\n    }\n\n    public class VmMetadataManagerFault : VimFault, IEquatable<VmMetadataManagerFault>\n    {\n        public bool Equals(VmMetadataManagerFault vmMetadataManagerFault)\n        {\n            return (vmMetadataManagerFault != null && base.Equals(vmMetadataManagerFault));\n        }\n\n        public override bool Equals(object vmMetadataManagerFault)\n        {\n            return Equals(vmMetadataManagerFault as VmMetadataManagerFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmMigratedEvent : VmEvent, IEquatable<VmMigratedEvent>\n    {\n        public HostEventArgument SourceHost { get; set; }\n\n        public DatacenterEventArgument SourceDatacenter { get; set; }\n\n        public DatastoreEventArgument SourceDatastore { get; set; }\n\n        public bool Equals(VmMigratedEvent vmMigratedEvent)\n        {\n            return (vmMigratedEvent != null && ((this.SourceHost == null && vmMigratedEvent.SourceHost == null) || (this.SourceHost != null && this.SourceHost.Equals(vmMigratedEvent.SourceHost))) && ((this.SourceDatacenter == null && vmMigratedEvent.SourceDatacenter == null) || (this.SourceDatacenter != null && this.SourceDatacenter.Equals(vmMigratedEvent.SourceDatacenter))) && ((this.SourceDatastore == null && vmMigratedEvent.SourceDatastore == null) || (this.SourceDatastore != null && this.SourceDatastore.Equals(vmMigratedEvent.SourceDatastore))));\n        }\n\n        public override bool Equals(object vmMigratedEvent)\n        {\n            return Equals(vmMigratedEvent as VmMigratedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceHost + \"_\" + SourceDatacenter + \"_\" + SourceDatastore).GetHashCode();\n        }\n    }\n\n    public class VmMonitorIncompatibleForFaultTolerance : VimFault, IEquatable<VmMonitorIncompatibleForFaultTolerance>\n    {\n        public bool Equals(VmMonitorIncompatibleForFaultTolerance vmMonitorIncompatibleForFaultTolerance)\n        {\n            return (vmMonitorIncompatibleForFaultTolerance != null && base.Equals(vmMonitorIncompatibleForFaultTolerance));\n        }\n\n        public override bool Equals(object vmMonitorIncompatibleForFaultTolerance)\n        {\n            return Equals(vmMonitorIncompatibleForFaultTolerance as VmMonitorIncompatibleForFaultTolerance);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmNoCompatibleHostForSecondaryEvent : VmEvent, IEquatable<VmNoCompatibleHostForSecondaryEvent>\n    {\n        public bool Equals(VmNoCompatibleHostForSecondaryEvent vmNoCompatibleHostForSecondaryEvent)\n        {\n            return (vmNoCompatibleHostForSecondaryEvent != null && base.Equals(vmNoCompatibleHostForSecondaryEvent));\n        }\n\n        public override bool Equals(object vmNoCompatibleHostForSecondaryEvent)\n        {\n            return Equals(vmNoCompatibleHostForSecondaryEvent as VmNoCompatibleHostForSecondaryEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmNoNetworkAccessEvent : VmEvent, IEquatable<VmNoNetworkAccessEvent>\n    {\n        public HostEventArgument DestHost { get; set; }\n\n        public bool Equals(VmNoNetworkAccessEvent vmNoNetworkAccessEvent)\n        {\n            return (vmNoNetworkAccessEvent != null && ((this.DestHost == null && vmNoNetworkAccessEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmNoNetworkAccessEvent.DestHost))));\n        }\n\n        public override bool Equals(object vmNoNetworkAccessEvent)\n        {\n            return Equals(vmNoNetworkAccessEvent as VmNoNetworkAccessEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestHost).GetHashCode();\n        }\n    }\n\n    public class VmNvramFileInfo : FileInfo, IEquatable<VmNvramFileInfo>\n    {\n        public bool Equals(VmNvramFileInfo vmNvramFileInfo)\n        {\n            return (vmNvramFileInfo != null && base.Equals(vmNvramFileInfo));\n        }\n\n        public override bool Equals(object vmNvramFileInfo)\n        {\n            return Equals(vmNvramFileInfo as VmNvramFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmNvramFileQuery : FileQuery, IEquatable<VmNvramFileQuery>\n    {\n        public bool Equals(VmNvramFileQuery vmNvramFileQuery)\n        {\n            return (vmNvramFileQuery != null && base.Equals(vmNvramFileQuery));\n        }\n\n        public override bool Equals(object vmNvramFileQuery)\n        {\n            return Equals(vmNvramFileQuery as VmNvramFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMOnConflictDVPort : CannotAccessNetwork, IEquatable<VMOnConflictDVPort>\n    {\n        public new VMOnConflictDVPort_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMOnConflictDVPort vMOnConflictDVPort)\n        {\n            return (vMOnConflictDVPort != null && ((this.LinkedView == null && vMOnConflictDVPort.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMOnConflictDVPort.LinkedView))));\n        }\n\n        public override bool Equals(object vMOnConflictDVPort)\n        {\n            return Equals(vMOnConflictDVPort as VMOnConflictDVPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMOnConflictDVPort_LinkedView : CannotAccessNetwork_LinkedView, IEquatable<VMOnConflictDVPort_LinkedView>\n    {\n        public bool Equals(VMOnConflictDVPort_LinkedView vMOnConflictDVPort_LinkedView)\n        {\n            return (vMOnConflictDVPort_LinkedView != null && base.Equals(vMOnConflictDVPort_LinkedView));\n        }\n\n        public override bool Equals(object vMOnConflictDVPort_LinkedView)\n        {\n            return Equals(vMOnConflictDVPort_LinkedView as VMOnConflictDVPort_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMOnVirtualIntranet : CannotAccessNetwork, IEquatable<VMOnVirtualIntranet>\n    {\n        public new VMOnVirtualIntranet_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMOnVirtualIntranet vMOnVirtualIntranet)\n        {\n            return (vMOnVirtualIntranet != null && ((this.LinkedView == null && vMOnVirtualIntranet.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMOnVirtualIntranet.LinkedView))));\n        }\n\n        public override bool Equals(object vMOnVirtualIntranet)\n        {\n            return Equals(vMOnVirtualIntranet as VMOnVirtualIntranet);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMOnVirtualIntranet_LinkedView : CannotAccessNetwork_LinkedView, IEquatable<VMOnVirtualIntranet_LinkedView>\n    {\n        public bool Equals(VMOnVirtualIntranet_LinkedView vMOnVirtualIntranet_LinkedView)\n        {\n            return (vMOnVirtualIntranet_LinkedView != null && base.Equals(vMOnVirtualIntranet_LinkedView));\n        }\n\n        public override bool Equals(object vMOnVirtualIntranet_LinkedView)\n        {\n            return Equals(vMOnVirtualIntranet_LinkedView as VMOnVirtualIntranet_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmOrphanedEvent : VmEvent, IEquatable<VmOrphanedEvent>\n    {\n        public bool Equals(VmOrphanedEvent vmOrphanedEvent)\n        {\n            return (vmOrphanedEvent != null && base.Equals(vmOrphanedEvent));\n        }\n\n        public override bool Equals(object vmOrphanedEvent)\n        {\n            return Equals(vmOrphanedEvent as VmOrphanedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionAcrossNetworkNotSupported : MigrationFeatureNotSupported, IEquatable<VMotionAcrossNetworkNotSupported>\n    {\n        public new VMotionAcrossNetworkNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionAcrossNetworkNotSupported vMotionAcrossNetworkNotSupported)\n        {\n            return (vMotionAcrossNetworkNotSupported != null && ((this.LinkedView == null && vMotionAcrossNetworkNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionAcrossNetworkNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionAcrossNetworkNotSupported)\n        {\n            return Equals(vMotionAcrossNetworkNotSupported as VMotionAcrossNetworkNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionAcrossNetworkNotSupported_LinkedView : MigrationFeatureNotSupported_LinkedView, IEquatable<VMotionAcrossNetworkNotSupported_LinkedView>\n    {\n        public bool Equals(VMotionAcrossNetworkNotSupported_LinkedView vMotionAcrossNetworkNotSupported_LinkedView)\n        {\n            return (vMotionAcrossNetworkNotSupported_LinkedView != null && base.Equals(vMotionAcrossNetworkNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object vMotionAcrossNetworkNotSupported_LinkedView)\n        {\n            return Equals(vMotionAcrossNetworkNotSupported_LinkedView as VMotionAcrossNetworkNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionInterfaceIssue : MigrationFault, IEquatable<VMotionInterfaceIssue>\n    {\n        public bool AtSourceHost { get; set; }\n\n        public string FailedHost { get; set; }\n\n        public ManagedObjectReference FailedHostEntity { get; set; }\n\n        public VMotionInterfaceIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionInterfaceIssue vMotionInterfaceIssue)\n        {\n            return (vMotionInterfaceIssue != null && this.AtSourceHost == vMotionInterfaceIssue.AtSourceHost && this.FailedHost == vMotionInterfaceIssue.FailedHost && ((this.FailedHostEntity == null && vMotionInterfaceIssue.FailedHostEntity == null) || (this.FailedHostEntity != null && this.FailedHostEntity.Equals(vMotionInterfaceIssue.FailedHostEntity))) && ((this.LinkedView == null && vMotionInterfaceIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionInterfaceIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionInterfaceIssue)\n        {\n            return Equals(vMotionInterfaceIssue as VMotionInterfaceIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AtSourceHost + \"_\" + FailedHost + \"_\" + FailedHostEntity + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionInterfaceIssue_LinkedView : IEquatable<VMotionInterfaceIssue_LinkedView>\n    {\n        public HostSystem FailedHostEntity { get; set; }\n\n        public bool Equals(VMotionInterfaceIssue_LinkedView vMotionInterfaceIssue_LinkedView)\n        {\n            return (vMotionInterfaceIssue_LinkedView != null && ((this.FailedHostEntity == null && vMotionInterfaceIssue_LinkedView.FailedHostEntity == null) || (this.FailedHostEntity != null && this.FailedHostEntity.Equals(vMotionInterfaceIssue_LinkedView.FailedHostEntity))));\n        }\n\n        public override bool Equals(object vMotionInterfaceIssue_LinkedView)\n        {\n            return Equals(vMotionInterfaceIssue_LinkedView as VMotionInterfaceIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FailedHostEntity).GetHashCode();\n        }\n    }\n\n    public class VmotionInterfaceNotEnabled : HostPowerOpFailed, IEquatable<VmotionInterfaceNotEnabled>\n    {\n        public bool Equals(VmotionInterfaceNotEnabled vmotionInterfaceNotEnabled)\n        {\n            return (vmotionInterfaceNotEnabled != null && base.Equals(vmotionInterfaceNotEnabled));\n        }\n\n        public override bool Equals(object vmotionInterfaceNotEnabled)\n        {\n            return Equals(vmotionInterfaceNotEnabled as VmotionInterfaceNotEnabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionLicenseExpiredEvent : LicenseEvent, IEquatable<VMotionLicenseExpiredEvent>\n    {\n        public bool Equals(VMotionLicenseExpiredEvent vMotionLicenseExpiredEvent)\n        {\n            return (vMotionLicenseExpiredEvent != null && base.Equals(vMotionLicenseExpiredEvent));\n        }\n\n        public override bool Equals(object vMotionLicenseExpiredEvent)\n        {\n            return Equals(vMotionLicenseExpiredEvent as VMotionLicenseExpiredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionLinkCapacityLow : VMotionInterfaceIssue, IEquatable<VMotionLinkCapacityLow>\n    {\n        public string Network { get; set; }\n\n        public new VMotionLinkCapacityLow_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionLinkCapacityLow vMotionLinkCapacityLow)\n        {\n            return (vMotionLinkCapacityLow != null && this.Network == vMotionLinkCapacityLow.Network && ((this.LinkedView == null && vMotionLinkCapacityLow.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionLinkCapacityLow.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionLinkCapacityLow)\n        {\n            return Equals(vMotionLinkCapacityLow as VMotionLinkCapacityLow);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionLinkCapacityLow_LinkedView : VMotionInterfaceIssue_LinkedView, IEquatable<VMotionLinkCapacityLow_LinkedView>\n    {\n        public bool Equals(VMotionLinkCapacityLow_LinkedView vMotionLinkCapacityLow_LinkedView)\n        {\n            return (vMotionLinkCapacityLow_LinkedView != null && base.Equals(vMotionLinkCapacityLow_LinkedView));\n        }\n\n        public override bool Equals(object vMotionLinkCapacityLow_LinkedView)\n        {\n            return Equals(vMotionLinkCapacityLow_LinkedView as VMotionLinkCapacityLow_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionLinkDown : VMotionInterfaceIssue, IEquatable<VMotionLinkDown>\n    {\n        public string Network { get; set; }\n\n        public new VMotionLinkDown_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionLinkDown vMotionLinkDown)\n        {\n            return (vMotionLinkDown != null && this.Network == vMotionLinkDown.Network && ((this.LinkedView == null && vMotionLinkDown.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionLinkDown.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionLinkDown)\n        {\n            return Equals(vMotionLinkDown as VMotionLinkDown);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Network + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionLinkDown_LinkedView : VMotionInterfaceIssue_LinkedView, IEquatable<VMotionLinkDown_LinkedView>\n    {\n        public bool Equals(VMotionLinkDown_LinkedView vMotionLinkDown_LinkedView)\n        {\n            return (vMotionLinkDown_LinkedView != null && base.Equals(vMotionLinkDown_LinkedView));\n        }\n\n        public override bool Equals(object vMotionLinkDown_LinkedView)\n        {\n            return Equals(vMotionLinkDown_LinkedView as VMotionLinkDown_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionNotConfigured : VMotionInterfaceIssue, IEquatable<VMotionNotConfigured>\n    {\n        public new VMotionNotConfigured_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionNotConfigured vMotionNotConfigured)\n        {\n            return (vMotionNotConfigured != null && ((this.LinkedView == null && vMotionNotConfigured.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionNotConfigured.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionNotConfigured)\n        {\n            return Equals(vMotionNotConfigured as VMotionNotConfigured);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionNotConfigured_LinkedView : VMotionInterfaceIssue_LinkedView, IEquatable<VMotionNotConfigured_LinkedView>\n    {\n        public bool Equals(VMotionNotConfigured_LinkedView vMotionNotConfigured_LinkedView)\n        {\n            return (vMotionNotConfigured_LinkedView != null && base.Equals(vMotionNotConfigured_LinkedView));\n        }\n\n        public override bool Equals(object vMotionNotConfigured_LinkedView)\n        {\n            return Equals(vMotionNotConfigured_LinkedView as VMotionNotConfigured_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionNotLicensed : VMotionInterfaceIssue, IEquatable<VMotionNotLicensed>\n    {\n        public new VMotionNotLicensed_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionNotLicensed vMotionNotLicensed)\n        {\n            return (vMotionNotLicensed != null && ((this.LinkedView == null && vMotionNotLicensed.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionNotLicensed.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionNotLicensed)\n        {\n            return Equals(vMotionNotLicensed as VMotionNotLicensed);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionNotLicensed_LinkedView : VMotionInterfaceIssue_LinkedView, IEquatable<VMotionNotLicensed_LinkedView>\n    {\n        public bool Equals(VMotionNotLicensed_LinkedView vMotionNotLicensed_LinkedView)\n        {\n            return (vMotionNotLicensed_LinkedView != null && base.Equals(vMotionNotLicensed_LinkedView));\n        }\n\n        public override bool Equals(object vMotionNotLicensed_LinkedView)\n        {\n            return Equals(vMotionNotLicensed_LinkedView as VMotionNotLicensed_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionNotSupported : VMotionInterfaceIssue, IEquatable<VMotionNotSupported>\n    {\n        public new VMotionNotSupported_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMotionNotSupported vMotionNotSupported)\n        {\n            return (vMotionNotSupported != null && ((this.LinkedView == null && vMotionNotSupported.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMotionNotSupported.LinkedView))));\n        }\n\n        public override bool Equals(object vMotionNotSupported)\n        {\n            return Equals(vMotionNotSupported as VMotionNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMotionNotSupported_LinkedView : VMotionInterfaceIssue_LinkedView, IEquatable<VMotionNotSupported_LinkedView>\n    {\n        public bool Equals(VMotionNotSupported_LinkedView vMotionNotSupported_LinkedView)\n        {\n            return (vMotionNotSupported_LinkedView != null && base.Equals(vMotionNotSupported_LinkedView));\n        }\n\n        public override bool Equals(object vMotionNotSupported_LinkedView)\n        {\n            return Equals(vMotionNotSupported_LinkedView as VMotionNotSupported_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMotionProtocolIncompatible : MigrationFault, IEquatable<VMotionProtocolIncompatible>\n    {\n        public bool Equals(VMotionProtocolIncompatible vMotionProtocolIncompatible)\n        {\n            return (vMotionProtocolIncompatible != null && base.Equals(vMotionProtocolIncompatible));\n        }\n\n        public override bool Equals(object vMotionProtocolIncompatible)\n        {\n            return Equals(vMotionProtocolIncompatible as VMotionProtocolIncompatible);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmPodConfigForPlacement : DynamicData, IEquatable<VmPodConfigForPlacement>\n    {\n        public ManagedObjectReference StoragePod { get; set; }\n\n        public PodDiskLocator[] Disk { get; set; }\n\n        public StorageDrsVmConfigInfo VmConfig { get; set; }\n\n        public ClusterRuleInfo[] InterVmRule { get; set; }\n\n        public VmPodConfigForPlacement_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VmPodConfigForPlacement vmPodConfigForPlacement)\n        {\n            return (vmPodConfigForPlacement != null && ((this.StoragePod == null && vmPodConfigForPlacement.StoragePod == null) || (this.StoragePod != null && this.StoragePod.Equals(vmPodConfigForPlacement.StoragePod))) && ((this.Disk == null && vmPodConfigForPlacement.Disk == null) || (this.Disk != null && vmPodConfigForPlacement.Disk != null && Enumerable.SequenceEqual(this.Disk, vmPodConfigForPlacement.Disk))) && ((this.VmConfig == null && vmPodConfigForPlacement.VmConfig == null) || (this.VmConfig != null && this.VmConfig.Equals(vmPodConfigForPlacement.VmConfig))) && ((this.InterVmRule == null && vmPodConfigForPlacement.InterVmRule == null) || (this.InterVmRule != null && vmPodConfigForPlacement.InterVmRule != null && Enumerable.SequenceEqual(this.InterVmRule, vmPodConfigForPlacement.InterVmRule))) && ((this.LinkedView == null && vmPodConfigForPlacement.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmPodConfigForPlacement.LinkedView))));\n        }\n\n        public override bool Equals(object vmPodConfigForPlacement)\n        {\n            return Equals(vmPodConfigForPlacement as VmPodConfigForPlacement);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StoragePod + \"_\" + Disk + \"_\" + VmConfig + \"_\" + InterVmRule + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmPodConfigForPlacement_LinkedView : IEquatable<VmPodConfigForPlacement_LinkedView>\n    {\n        public StoragePod StoragePod { get; set; }\n\n        public bool Equals(VmPodConfigForPlacement_LinkedView vmPodConfigForPlacement_LinkedView)\n        {\n            return (vmPodConfigForPlacement_LinkedView != null && ((this.StoragePod == null && vmPodConfigForPlacement_LinkedView.StoragePod == null) || (this.StoragePod != null && this.StoragePod.Equals(vmPodConfigForPlacement_LinkedView.StoragePod))));\n        }\n\n        public override bool Equals(object vmPodConfigForPlacement_LinkedView)\n        {\n            return Equals(vmPodConfigForPlacement_LinkedView as VmPodConfigForPlacement_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (StoragePod).GetHashCode();\n        }\n    }\n\n    public class VmPortGroupProfile : PortGroupProfile, IEquatable<VmPortGroupProfile>\n    {\n        public bool Equals(VmPortGroupProfile vmPortGroupProfile)\n        {\n            return (vmPortGroupProfile != null && base.Equals(vmPortGroupProfile));\n        }\n\n        public override bool Equals(object vmPortGroupProfile)\n        {\n            return Equals(vmPortGroupProfile as VmPortGroupProfile);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmPoweredOffEvent : VmEvent, IEquatable<VmPoweredOffEvent>\n    {\n        public bool Equals(VmPoweredOffEvent vmPoweredOffEvent)\n        {\n            return (vmPoweredOffEvent != null && base.Equals(vmPoweredOffEvent));\n        }\n\n        public override bool Equals(object vmPoweredOffEvent)\n        {\n            return Equals(vmPoweredOffEvent as VmPoweredOffEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmPoweredOnEvent : VmEvent, IEquatable<VmPoweredOnEvent>\n    {\n        public bool Equals(VmPoweredOnEvent vmPoweredOnEvent)\n        {\n            return (vmPoweredOnEvent != null && base.Equals(vmPoweredOnEvent));\n        }\n\n        public override bool Equals(object vmPoweredOnEvent)\n        {\n            return Equals(vmPoweredOnEvent as VmPoweredOnEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmPoweringOnWithCustomizedDVPortEvent : VmEvent, IEquatable<VmPoweringOnWithCustomizedDVPortEvent>\n    {\n        public VnicPortArgument[] Vnic { get; set; }\n\n        public bool Equals(VmPoweringOnWithCustomizedDVPortEvent vmPoweringOnWithCustomizedDVPortEvent)\n        {\n            return (vmPoweringOnWithCustomizedDVPortEvent != null && ((this.Vnic == null && vmPoweringOnWithCustomizedDVPortEvent.Vnic == null) || (this.Vnic != null && vmPoweringOnWithCustomizedDVPortEvent.Vnic != null && Enumerable.SequenceEqual(this.Vnic, vmPoweringOnWithCustomizedDVPortEvent.Vnic))));\n        }\n\n        public override bool Equals(object vmPoweringOnWithCustomizedDVPortEvent)\n        {\n            return Equals(vmPoweringOnWithCustomizedDVPortEvent as VmPoweringOnWithCustomizedDVPortEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vnic).GetHashCode();\n        }\n    }\n\n    public class VmPowerOffOnIsolationEvent : VmPoweredOffEvent, IEquatable<VmPowerOffOnIsolationEvent>\n    {\n        public HostEventArgument IsolatedHost { get; set; }\n\n        public bool Equals(VmPowerOffOnIsolationEvent vmPowerOffOnIsolationEvent)\n        {\n            return (vmPowerOffOnIsolationEvent != null && ((this.IsolatedHost == null && vmPowerOffOnIsolationEvent.IsolatedHost == null) || (this.IsolatedHost != null && this.IsolatedHost.Equals(vmPowerOffOnIsolationEvent.IsolatedHost))));\n        }\n\n        public override bool Equals(object vmPowerOffOnIsolationEvent)\n        {\n            return Equals(vmPowerOffOnIsolationEvent as VmPowerOffOnIsolationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsolatedHost).GetHashCode();\n        }\n    }\n\n    public class VmPowerOnDisabled : InvalidState, IEquatable<VmPowerOnDisabled>\n    {\n        public bool Equals(VmPowerOnDisabled vmPowerOnDisabled)\n        {\n            return (vmPowerOnDisabled != null && base.Equals(vmPowerOnDisabled));\n        }\n\n        public override bool Equals(object vmPowerOnDisabled)\n        {\n            return Equals(vmPowerOnDisabled as VmPowerOnDisabled);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmPrimaryFailoverEvent : VmEvent, IEquatable<VmPrimaryFailoverEvent>\n    {\n        public string Reason { get; set; }\n\n        public bool Equals(VmPrimaryFailoverEvent vmPrimaryFailoverEvent)\n        {\n            return (vmPrimaryFailoverEvent != null && this.Reason == vmPrimaryFailoverEvent.Reason);\n        }\n\n        public override bool Equals(object vmPrimaryFailoverEvent)\n        {\n            return Equals(vmPrimaryFailoverEvent as VmPrimaryFailoverEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmReconfiguredEvent : VmEvent, IEquatable<VmReconfiguredEvent>\n    {\n        public VirtualMachineConfigSpec ConfigSpec { get; set; }\n\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(VmReconfiguredEvent vmReconfiguredEvent)\n        {\n            return (vmReconfiguredEvent != null && ((this.ConfigSpec == null && vmReconfiguredEvent.ConfigSpec == null) || (this.ConfigSpec != null && this.ConfigSpec.Equals(vmReconfiguredEvent.ConfigSpec))) && ((this.ConfigChanges == null && vmReconfiguredEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(vmReconfiguredEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object vmReconfiguredEvent)\n        {\n            return Equals(vmReconfiguredEvent as VmReconfiguredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigSpec + \"_\" + ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class VmRegisteredEvent : VmEvent, IEquatable<VmRegisteredEvent>\n    {\n        public bool Equals(VmRegisteredEvent vmRegisteredEvent)\n        {\n            return (vmRegisteredEvent != null && base.Equals(vmRegisteredEvent));\n        }\n\n        public override bool Equals(object vmRegisteredEvent)\n        {\n            return Equals(vmRegisteredEvent as VmRegisteredEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmRelayoutSuccessfulEvent : VmEvent, IEquatable<VmRelayoutSuccessfulEvent>\n    {\n        public bool Equals(VmRelayoutSuccessfulEvent vmRelayoutSuccessfulEvent)\n        {\n            return (vmRelayoutSuccessfulEvent != null && base.Equals(vmRelayoutSuccessfulEvent));\n        }\n\n        public override bool Equals(object vmRelayoutSuccessfulEvent)\n        {\n            return Equals(vmRelayoutSuccessfulEvent as VmRelayoutSuccessfulEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmRelayoutUpToDateEvent : VmEvent, IEquatable<VmRelayoutUpToDateEvent>\n    {\n        public bool Equals(VmRelayoutUpToDateEvent vmRelayoutUpToDateEvent)\n        {\n            return (vmRelayoutUpToDateEvent != null && base.Equals(vmRelayoutUpToDateEvent));\n        }\n\n        public override bool Equals(object vmRelayoutUpToDateEvent)\n        {\n            return Equals(vmRelayoutUpToDateEvent as VmRelayoutUpToDateEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmReloadFromPathEvent : VmEvent, IEquatable<VmReloadFromPathEvent>\n    {\n        public string ConfigPath { get; set; }\n\n        public bool Equals(VmReloadFromPathEvent vmReloadFromPathEvent)\n        {\n            return (vmReloadFromPathEvent != null && this.ConfigPath == vmReloadFromPathEvent.ConfigPath);\n        }\n\n        public override bool Equals(object vmReloadFromPathEvent)\n        {\n            return Equals(vmReloadFromPathEvent as VmReloadFromPathEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigPath).GetHashCode();\n        }\n    }\n\n    public class VmReloadFromPathFailedEvent : VmEvent, IEquatable<VmReloadFromPathFailedEvent>\n    {\n        public string ConfigPath { get; set; }\n\n        public bool Equals(VmReloadFromPathFailedEvent vmReloadFromPathFailedEvent)\n        {\n            return (vmReloadFromPathFailedEvent != null && this.ConfigPath == vmReloadFromPathFailedEvent.ConfigPath);\n        }\n\n        public override bool Equals(object vmReloadFromPathFailedEvent)\n        {\n            return Equals(vmReloadFromPathFailedEvent as VmReloadFromPathFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigPath).GetHashCode();\n        }\n    }\n\n    public class VmRelocatedEvent : VmRelocateSpecEvent, IEquatable<VmRelocatedEvent>\n    {\n        public HostEventArgument SourceHost { get; set; }\n\n        public DatacenterEventArgument SourceDatacenter { get; set; }\n\n        public DatastoreEventArgument SourceDatastore { get; set; }\n\n        public bool Equals(VmRelocatedEvent vmRelocatedEvent)\n        {\n            return (vmRelocatedEvent != null && ((this.SourceHost == null && vmRelocatedEvent.SourceHost == null) || (this.SourceHost != null && this.SourceHost.Equals(vmRelocatedEvent.SourceHost))) && ((this.SourceDatacenter == null && vmRelocatedEvent.SourceDatacenter == null) || (this.SourceDatacenter != null && this.SourceDatacenter.Equals(vmRelocatedEvent.SourceDatacenter))) && ((this.SourceDatastore == null && vmRelocatedEvent.SourceDatastore == null) || (this.SourceDatastore != null && this.SourceDatastore.Equals(vmRelocatedEvent.SourceDatastore))));\n        }\n\n        public override bool Equals(object vmRelocatedEvent)\n        {\n            return Equals(vmRelocatedEvent as VmRelocatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceHost + \"_\" + SourceDatacenter + \"_\" + SourceDatastore).GetHashCode();\n        }\n    }\n\n    public class VmRelocateFailedEvent : VmRelocateSpecEvent, IEquatable<VmRelocateFailedEvent>\n    {\n        public HostEventArgument DestHost { get; set; }\n\n        public LocalizedMethodFault Reason { get; set; }\n\n        public DatacenterEventArgument DestDatacenter { get; set; }\n\n        public DatastoreEventArgument DestDatastore { get; set; }\n\n        public bool Equals(VmRelocateFailedEvent vmRelocateFailedEvent)\n        {\n            return (vmRelocateFailedEvent != null && ((this.DestHost == null && vmRelocateFailedEvent.DestHost == null) || (this.DestHost != null && this.DestHost.Equals(vmRelocateFailedEvent.DestHost))) && ((this.Reason == null && vmRelocateFailedEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmRelocateFailedEvent.Reason))) && ((this.DestDatacenter == null && vmRelocateFailedEvent.DestDatacenter == null) || (this.DestDatacenter != null && this.DestDatacenter.Equals(vmRelocateFailedEvent.DestDatacenter))) && ((this.DestDatastore == null && vmRelocateFailedEvent.DestDatastore == null) || (this.DestDatastore != null && this.DestDatastore.Equals(vmRelocateFailedEvent.DestDatastore))));\n        }\n\n        public override bool Equals(object vmRelocateFailedEvent)\n        {\n            return Equals(vmRelocateFailedEvent as VmRelocateFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DestHost + \"_\" + Reason + \"_\" + DestDatacenter + \"_\" + DestDatastore).GetHashCode();\n        }\n    }\n\n    public class VmRelocateSpecEvent : VmEvent, IEquatable<VmRelocateSpecEvent>\n    {\n        public bool Equals(VmRelocateSpecEvent vmRelocateSpecEvent)\n        {\n            return (vmRelocateSpecEvent != null && base.Equals(vmRelocateSpecEvent));\n        }\n\n        public override bool Equals(object vmRelocateSpecEvent)\n        {\n            return Equals(vmRelocateSpecEvent as VmRelocateSpecEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmRemoteConsoleConnectedEvent : VmEvent, IEquatable<VmRemoteConsoleConnectedEvent>\n    {\n        public bool Equals(VmRemoteConsoleConnectedEvent vmRemoteConsoleConnectedEvent)\n        {\n            return (vmRemoteConsoleConnectedEvent != null && base.Equals(vmRemoteConsoleConnectedEvent));\n        }\n\n        public override bool Equals(object vmRemoteConsoleConnectedEvent)\n        {\n            return Equals(vmRemoteConsoleConnectedEvent as VmRemoteConsoleConnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmRemoteConsoleDisconnectedEvent : VmEvent, IEquatable<VmRemoteConsoleDisconnectedEvent>\n    {\n        public bool Equals(VmRemoteConsoleDisconnectedEvent vmRemoteConsoleDisconnectedEvent)\n        {\n            return (vmRemoteConsoleDisconnectedEvent != null && base.Equals(vmRemoteConsoleDisconnectedEvent));\n        }\n\n        public override bool Equals(object vmRemoteConsoleDisconnectedEvent)\n        {\n            return Equals(vmRemoteConsoleDisconnectedEvent as VmRemoteConsoleDisconnectedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmRemovedEvent : VmEvent, IEquatable<VmRemovedEvent>\n    {\n        public bool Equals(VmRemovedEvent vmRemovedEvent)\n        {\n            return (vmRemovedEvent != null && base.Equals(vmRemovedEvent));\n        }\n\n        public override bool Equals(object vmRemovedEvent)\n        {\n            return Equals(vmRemovedEvent as VmRemovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmRenamedEvent : VmEvent, IEquatable<VmRenamedEvent>\n    {\n        public string OldName { get; set; }\n\n        public string NewName { get; set; }\n\n        public bool Equals(VmRenamedEvent vmRenamedEvent)\n        {\n            return (vmRenamedEvent != null && this.OldName == vmRenamedEvent.OldName && this.NewName == vmRenamedEvent.NewName);\n        }\n\n        public override bool Equals(object vmRenamedEvent)\n        {\n            return Equals(vmRenamedEvent as VmRenamedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldName + \"_\" + NewName).GetHashCode();\n        }\n    }\n\n    public class VmRequirementsExceedCurrentEVCModeEvent : VmEvent, IEquatable<VmRequirementsExceedCurrentEVCModeEvent>\n    {\n        public bool Equals(VmRequirementsExceedCurrentEVCModeEvent vmRequirementsExceedCurrentEVCModeEvent)\n        {\n            return (vmRequirementsExceedCurrentEVCModeEvent != null && base.Equals(vmRequirementsExceedCurrentEVCModeEvent));\n        }\n\n        public override bool Equals(object vmRequirementsExceedCurrentEVCModeEvent)\n        {\n            return Equals(vmRequirementsExceedCurrentEVCModeEvent as VmRequirementsExceedCurrentEVCModeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmResettingEvent : VmEvent, IEquatable<VmResettingEvent>\n    {\n        public bool Equals(VmResettingEvent vmResettingEvent)\n        {\n            return (vmResettingEvent != null && base.Equals(vmResettingEvent));\n        }\n\n        public override bool Equals(object vmResettingEvent)\n        {\n            return Equals(vmResettingEvent as VmResettingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmResourcePoolMovedEvent : VmEvent, IEquatable<VmResourcePoolMovedEvent>\n    {\n        public ResourcePoolEventArgument OldParent { get; set; }\n\n        public ResourcePoolEventArgument NewParent { get; set; }\n\n        public bool Equals(VmResourcePoolMovedEvent vmResourcePoolMovedEvent)\n        {\n            return (vmResourcePoolMovedEvent != null && ((this.OldParent == null && vmResourcePoolMovedEvent.OldParent == null) || (this.OldParent != null && this.OldParent.Equals(vmResourcePoolMovedEvent.OldParent))) && ((this.NewParent == null && vmResourcePoolMovedEvent.NewParent == null) || (this.NewParent != null && this.NewParent.Equals(vmResourcePoolMovedEvent.NewParent))));\n        }\n\n        public override bool Equals(object vmResourcePoolMovedEvent)\n        {\n            return Equals(vmResourcePoolMovedEvent as VmResourcePoolMovedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldParent + \"_\" + NewParent).GetHashCode();\n        }\n    }\n\n    public class VmResourceReallocatedEvent : VmEvent, IEquatable<VmResourceReallocatedEvent>\n    {\n        public ChangesInfoEventArgument ConfigChanges { get; set; }\n\n        public bool Equals(VmResourceReallocatedEvent vmResourceReallocatedEvent)\n        {\n            return (vmResourceReallocatedEvent != null && ((this.ConfigChanges == null && vmResourceReallocatedEvent.ConfigChanges == null) || (this.ConfigChanges != null && this.ConfigChanges.Equals(vmResourceReallocatedEvent.ConfigChanges))));\n        }\n\n        public override bool Equals(object vmResourceReallocatedEvent)\n        {\n            return Equals(vmResourceReallocatedEvent as VmResourceReallocatedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConfigChanges).GetHashCode();\n        }\n    }\n\n    public class VmRestartedOnAlternateHostEvent : VmPoweredOnEvent, IEquatable<VmRestartedOnAlternateHostEvent>\n    {\n        public HostEventArgument SourceHost { get; set; }\n\n        public bool Equals(VmRestartedOnAlternateHostEvent vmRestartedOnAlternateHostEvent)\n        {\n            return (vmRestartedOnAlternateHostEvent != null && ((this.SourceHost == null && vmRestartedOnAlternateHostEvent.SourceHost == null) || (this.SourceHost != null && this.SourceHost.Equals(vmRestartedOnAlternateHostEvent.SourceHost))));\n        }\n\n        public override bool Equals(object vmRestartedOnAlternateHostEvent)\n        {\n            return Equals(vmRestartedOnAlternateHostEvent as VmRestartedOnAlternateHostEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceHost).GetHashCode();\n        }\n    }\n\n    public class VmResumingEvent : VmEvent, IEquatable<VmResumingEvent>\n    {\n        public bool Equals(VmResumingEvent vmResumingEvent)\n        {\n            return (vmResumingEvent != null && base.Equals(vmResumingEvent));\n        }\n\n        public override bool Equals(object vmResumingEvent)\n        {\n            return Equals(vmResumingEvent as VmResumingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSecondaryAddedEvent : VmEvent, IEquatable<VmSecondaryAddedEvent>\n    {\n        public bool Equals(VmSecondaryAddedEvent vmSecondaryAddedEvent)\n        {\n            return (vmSecondaryAddedEvent != null && base.Equals(vmSecondaryAddedEvent));\n        }\n\n        public override bool Equals(object vmSecondaryAddedEvent)\n        {\n            return Equals(vmSecondaryAddedEvent as VmSecondaryAddedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSecondaryDisabledBySystemEvent : VmEvent, IEquatable<VmSecondaryDisabledBySystemEvent>\n    {\n        public LocalizedMethodFault Reason { get; set; }\n\n        public bool Equals(VmSecondaryDisabledBySystemEvent vmSecondaryDisabledBySystemEvent)\n        {\n            return (vmSecondaryDisabledBySystemEvent != null && ((this.Reason == null && vmSecondaryDisabledBySystemEvent.Reason == null) || (this.Reason != null && this.Reason.Equals(vmSecondaryDisabledBySystemEvent.Reason))));\n        }\n\n        public override bool Equals(object vmSecondaryDisabledBySystemEvent)\n        {\n            return Equals(vmSecondaryDisabledBySystemEvent as VmSecondaryDisabledBySystemEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Reason).GetHashCode();\n        }\n    }\n\n    public class VmSecondaryDisabledEvent : VmEvent, IEquatable<VmSecondaryDisabledEvent>\n    {\n        public bool Equals(VmSecondaryDisabledEvent vmSecondaryDisabledEvent)\n        {\n            return (vmSecondaryDisabledEvent != null && base.Equals(vmSecondaryDisabledEvent));\n        }\n\n        public override bool Equals(object vmSecondaryDisabledEvent)\n        {\n            return Equals(vmSecondaryDisabledEvent as VmSecondaryDisabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSecondaryEnabledEvent : VmEvent, IEquatable<VmSecondaryEnabledEvent>\n    {\n        public bool Equals(VmSecondaryEnabledEvent vmSecondaryEnabledEvent)\n        {\n            return (vmSecondaryEnabledEvent != null && base.Equals(vmSecondaryEnabledEvent));\n        }\n\n        public override bool Equals(object vmSecondaryEnabledEvent)\n        {\n            return Equals(vmSecondaryEnabledEvent as VmSecondaryEnabledEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSecondaryStartedEvent : VmEvent, IEquatable<VmSecondaryStartedEvent>\n    {\n        public bool Equals(VmSecondaryStartedEvent vmSecondaryStartedEvent)\n        {\n            return (vmSecondaryStartedEvent != null && base.Equals(vmSecondaryStartedEvent));\n        }\n\n        public override bool Equals(object vmSecondaryStartedEvent)\n        {\n            return Equals(vmSecondaryStartedEvent as VmSecondaryStartedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmShutdownOnIsolationEvent : VmPoweredOffEvent, IEquatable<VmShutdownOnIsolationEvent>\n    {\n        public HostEventArgument IsolatedHost { get; set; }\n\n        public string ShutdownResult { get; set; }\n\n        public bool Equals(VmShutdownOnIsolationEvent vmShutdownOnIsolationEvent)\n        {\n            return (vmShutdownOnIsolationEvent != null && ((this.IsolatedHost == null && vmShutdownOnIsolationEvent.IsolatedHost == null) || (this.IsolatedHost != null && this.IsolatedHost.Equals(vmShutdownOnIsolationEvent.IsolatedHost))) && this.ShutdownResult == vmShutdownOnIsolationEvent.ShutdownResult);\n        }\n\n        public override bool Equals(object vmShutdownOnIsolationEvent)\n        {\n            return Equals(vmShutdownOnIsolationEvent as VmShutdownOnIsolationEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsolatedHost + \"_\" + ShutdownResult).GetHashCode();\n        }\n    }\n\n    public class VmSmpFaultToleranceTooManyVMsOnHost : InsufficientResourcesFault, IEquatable<VmSmpFaultToleranceTooManyVMsOnHost>\n    {\n        public string HostName { get; set; }\n\n        public int MaxNumSmpFtVms { get; set; }\n\n        public bool Equals(VmSmpFaultToleranceTooManyVMsOnHost vmSmpFaultToleranceTooManyVMsOnHost)\n        {\n            return (vmSmpFaultToleranceTooManyVMsOnHost != null && this.HostName == vmSmpFaultToleranceTooManyVMsOnHost.HostName && this.MaxNumSmpFtVms == vmSmpFaultToleranceTooManyVMsOnHost.MaxNumSmpFtVms);\n        }\n\n        public override bool Equals(object vmSmpFaultToleranceTooManyVMsOnHost)\n        {\n            return Equals(vmSmpFaultToleranceTooManyVMsOnHost as VmSmpFaultToleranceTooManyVMsOnHost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostName + \"_\" + MaxNumSmpFtVms).GetHashCode();\n        }\n    }\n\n    public class VmSnapshotFileInfo : FileInfo, IEquatable<VmSnapshotFileInfo>\n    {\n        public bool Equals(VmSnapshotFileInfo vmSnapshotFileInfo)\n        {\n            return (vmSnapshotFileInfo != null && base.Equals(vmSnapshotFileInfo));\n        }\n\n        public override bool Equals(object vmSnapshotFileInfo)\n        {\n            return Equals(vmSnapshotFileInfo as VmSnapshotFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSnapshotFileQuery : FileQuery, IEquatable<VmSnapshotFileQuery>\n    {\n        public bool Equals(VmSnapshotFileQuery vmSnapshotFileQuery)\n        {\n            return (vmSnapshotFileQuery != null && base.Equals(vmSnapshotFileQuery));\n        }\n\n        public override bool Equals(object vmSnapshotFileQuery)\n        {\n            return Equals(vmSnapshotFileQuery as VmSnapshotFileQuery);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmStartingEvent : VmEvent, IEquatable<VmStartingEvent>\n    {\n        public bool Equals(VmStartingEvent vmStartingEvent)\n        {\n            return (vmStartingEvent != null && base.Equals(vmStartingEvent));\n        }\n\n        public override bool Equals(object vmStartingEvent)\n        {\n            return Equals(vmStartingEvent as VmStartingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmStartingSecondaryEvent : VmEvent, IEquatable<VmStartingSecondaryEvent>\n    {\n        public bool Equals(VmStartingSecondaryEvent vmStartingSecondaryEvent)\n        {\n            return (vmStartingSecondaryEvent != null && base.Equals(vmStartingSecondaryEvent));\n        }\n\n        public override bool Equals(object vmStartingSecondaryEvent)\n        {\n            return Equals(vmStartingSecondaryEvent as VmStartingSecondaryEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmStartRecordingEvent : VmEvent, IEquatable<VmStartRecordingEvent>\n    {\n        public bool Equals(VmStartRecordingEvent vmStartRecordingEvent)\n        {\n            return (vmStartRecordingEvent != null && base.Equals(vmStartRecordingEvent));\n        }\n\n        public override bool Equals(object vmStartRecordingEvent)\n        {\n            return Equals(vmStartRecordingEvent as VmStartRecordingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmStartReplayingEvent : VmEvent, IEquatable<VmStartReplayingEvent>\n    {\n        public bool Equals(VmStartReplayingEvent vmStartReplayingEvent)\n        {\n            return (vmStartReplayingEvent != null && base.Equals(vmStartReplayingEvent));\n        }\n\n        public override bool Equals(object vmStartReplayingEvent)\n        {\n            return Equals(vmStartReplayingEvent as VmStartReplayingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmStaticMacConflictEvent : VmEvent, IEquatable<VmStaticMacConflictEvent>\n    {\n        public VmEventArgument ConflictedVm { get; set; }\n\n        public string Mac { get; set; }\n\n        public bool Equals(VmStaticMacConflictEvent vmStaticMacConflictEvent)\n        {\n            return (vmStaticMacConflictEvent != null && ((this.ConflictedVm == null && vmStaticMacConflictEvent.ConflictedVm == null) || (this.ConflictedVm != null && this.ConflictedVm.Equals(vmStaticMacConflictEvent.ConflictedVm))) && this.Mac == vmStaticMacConflictEvent.Mac);\n        }\n\n        public override bool Equals(object vmStaticMacConflictEvent)\n        {\n            return Equals(vmStaticMacConflictEvent as VmStaticMacConflictEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictedVm + \"_\" + Mac).GetHashCode();\n        }\n    }\n\n    public class VmStoppingEvent : VmEvent, IEquatable<VmStoppingEvent>\n    {\n        public bool Equals(VmStoppingEvent vmStoppingEvent)\n        {\n            return (vmStoppingEvent != null && base.Equals(vmStoppingEvent));\n        }\n\n        public override bool Equals(object vmStoppingEvent)\n        {\n            return Equals(vmStoppingEvent as VmStoppingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSuspendedEvent : VmEvent, IEquatable<VmSuspendedEvent>\n    {\n        public bool Equals(VmSuspendedEvent vmSuspendedEvent)\n        {\n            return (vmSuspendedEvent != null && base.Equals(vmSuspendedEvent));\n        }\n\n        public override bool Equals(object vmSuspendedEvent)\n        {\n            return Equals(vmSuspendedEvent as VmSuspendedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmSuspendingEvent : VmEvent, IEquatable<VmSuspendingEvent>\n    {\n        public bool Equals(VmSuspendingEvent vmSuspendingEvent)\n        {\n            return (vmSuspendingEvent != null && base.Equals(vmSuspendingEvent));\n        }\n\n        public override bool Equals(object vmSuspendingEvent)\n        {\n            return Equals(vmSuspendingEvent as VmSuspendingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmTimedoutStartingSecondaryEvent : VmEvent, IEquatable<VmTimedoutStartingSecondaryEvent>\n    {\n        public long? Timeout { get; set; }\n\n        public bool Equals(VmTimedoutStartingSecondaryEvent vmTimedoutStartingSecondaryEvent)\n        {\n            return (vmTimedoutStartingSecondaryEvent != null && ((this.Timeout == null && vmTimedoutStartingSecondaryEvent.Timeout == null) || (this.Timeout != null && this.Timeout.Equals(vmTimedoutStartingSecondaryEvent.Timeout))));\n        }\n\n        public override bool Equals(object vmTimedoutStartingSecondaryEvent)\n        {\n            return Equals(vmTimedoutStartingSecondaryEvent as VmTimedoutStartingSecondaryEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Timeout).GetHashCode();\n        }\n    }\n\n    public class VmToolsUpgradeFault : VimFault, IEquatable<VmToolsUpgradeFault>\n    {\n        public bool Equals(VmToolsUpgradeFault vmToolsUpgradeFault)\n        {\n            return (vmToolsUpgradeFault != null && base.Equals(vmToolsUpgradeFault));\n        }\n\n        public override bool Equals(object vmToolsUpgradeFault)\n        {\n            return Equals(vmToolsUpgradeFault as VmToolsUpgradeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmUnsupportedStartingEvent : VmStartingEvent, IEquatable<VmUnsupportedStartingEvent>\n    {\n        public string GuestId { get; set; }\n\n        public bool Equals(VmUnsupportedStartingEvent vmUnsupportedStartingEvent)\n        {\n            return (vmUnsupportedStartingEvent != null && this.GuestId == vmUnsupportedStartingEvent.GuestId);\n        }\n\n        public override bool Equals(object vmUnsupportedStartingEvent)\n        {\n            return Equals(vmUnsupportedStartingEvent as VmUnsupportedStartingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (GuestId).GetHashCode();\n        }\n    }\n\n    public class VmUpgradeCompleteEvent : VmEvent, IEquatable<VmUpgradeCompleteEvent>\n    {\n        public string Version { get; set; }\n\n        public bool Equals(VmUpgradeCompleteEvent vmUpgradeCompleteEvent)\n        {\n            return (vmUpgradeCompleteEvent != null && this.Version == vmUpgradeCompleteEvent.Version);\n        }\n\n        public override bool Equals(object vmUpgradeCompleteEvent)\n        {\n            return Equals(vmUpgradeCompleteEvent as VmUpgradeCompleteEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version).GetHashCode();\n        }\n    }\n\n    public class VmUpgradeFailedEvent : VmEvent, IEquatable<VmUpgradeFailedEvent>\n    {\n        public bool Equals(VmUpgradeFailedEvent vmUpgradeFailedEvent)\n        {\n            return (vmUpgradeFailedEvent != null && base.Equals(vmUpgradeFailedEvent));\n        }\n\n        public override bool Equals(object vmUpgradeFailedEvent)\n        {\n            return Equals(vmUpgradeFailedEvent as VmUpgradeFailedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmUpgradingEvent : VmEvent, IEquatable<VmUpgradingEvent>\n    {\n        public string Version { get; set; }\n\n        public bool Equals(VmUpgradingEvent vmUpgradingEvent)\n        {\n            return (vmUpgradingEvent != null && this.Version == vmUpgradingEvent.Version);\n        }\n\n        public override bool Equals(object vmUpgradingEvent)\n        {\n            return Equals(vmUpgradingEvent as VmUpgradingEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Version).GetHashCode();\n        }\n    }\n\n    public class VmUuidAssignedEvent : VmEvent, IEquatable<VmUuidAssignedEvent>\n    {\n        public string Uuid { get; set; }\n\n        public bool Equals(VmUuidAssignedEvent vmUuidAssignedEvent)\n        {\n            return (vmUuidAssignedEvent != null && this.Uuid == vmUuidAssignedEvent.Uuid);\n        }\n\n        public override bool Equals(object vmUuidAssignedEvent)\n        {\n            return Equals(vmUuidAssignedEvent as VmUuidAssignedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid).GetHashCode();\n        }\n    }\n\n    public class VmUuidChangedEvent : VmEvent, IEquatable<VmUuidChangedEvent>\n    {\n        public string OldUuid { get; set; }\n\n        public string NewUuid { get; set; }\n\n        public bool Equals(VmUuidChangedEvent vmUuidChangedEvent)\n        {\n            return (vmUuidChangedEvent != null && this.OldUuid == vmUuidChangedEvent.OldUuid && this.NewUuid == vmUuidChangedEvent.NewUuid);\n        }\n\n        public override bool Equals(object vmUuidChangedEvent)\n        {\n            return Equals(vmUuidChangedEvent as VmUuidChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldUuid + \"_\" + NewUuid).GetHashCode();\n        }\n    }\n\n    public class VmUuidConflictEvent : VmEvent, IEquatable<VmUuidConflictEvent>\n    {\n        public VmEventArgument ConflictedVm { get; set; }\n\n        public string Uuid { get; set; }\n\n        public bool Equals(VmUuidConflictEvent vmUuidConflictEvent)\n        {\n            return (vmUuidConflictEvent != null && ((this.ConflictedVm == null && vmUuidConflictEvent.ConflictedVm == null) || (this.ConflictedVm != null && this.ConflictedVm.Equals(vmUuidConflictEvent.ConflictedVm))) && this.Uuid == vmUuidConflictEvent.Uuid);\n        }\n\n        public override bool Equals(object vmUuidConflictEvent)\n        {\n            return Equals(vmUuidConflictEvent as VmUuidConflictEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictedVm + \"_\" + Uuid).GetHashCode();\n        }\n    }\n\n    public class VmValidateMaxDevice : VimFault, IEquatable<VmValidateMaxDevice>\n    {\n        public string Device { get; set; }\n\n        public int Max { get; set; }\n\n        public int Count { get; set; }\n\n        public bool Equals(VmValidateMaxDevice vmValidateMaxDevice)\n        {\n            return (vmValidateMaxDevice != null && this.Device == vmValidateMaxDevice.Device && this.Max == vmValidateMaxDevice.Max && this.Count == vmValidateMaxDevice.Count);\n        }\n\n        public override bool Equals(object vmValidateMaxDevice)\n        {\n            return Equals(vmValidateMaxDevice as VmValidateMaxDevice);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Max + \"_\" + Count).GetHashCode();\n        }\n    }\n\n    public class VmVnicPoolReservationViolationClearEvent : DvsEvent, IEquatable<VmVnicPoolReservationViolationClearEvent>\n    {\n        public string VmVnicResourcePoolKey { get; set; }\n\n        public string VmVnicResourcePoolName { get; set; }\n\n        public bool Equals(VmVnicPoolReservationViolationClearEvent vmVnicPoolReservationViolationClearEvent)\n        {\n            return (vmVnicPoolReservationViolationClearEvent != null && this.VmVnicResourcePoolKey == vmVnicPoolReservationViolationClearEvent.VmVnicResourcePoolKey && this.VmVnicResourcePoolName == vmVnicPoolReservationViolationClearEvent.VmVnicResourcePoolName);\n        }\n\n        public override bool Equals(object vmVnicPoolReservationViolationClearEvent)\n        {\n            return Equals(vmVnicPoolReservationViolationClearEvent as VmVnicPoolReservationViolationClearEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmVnicResourcePoolKey + \"_\" + VmVnicResourcePoolName).GetHashCode();\n        }\n    }\n\n    public class VmVnicPoolReservationViolationRaiseEvent : DvsEvent, IEquatable<VmVnicPoolReservationViolationRaiseEvent>\n    {\n        public string VmVnicResourcePoolKey { get; set; }\n\n        public string VmVnicResourcePoolName { get; set; }\n\n        public bool Equals(VmVnicPoolReservationViolationRaiseEvent vmVnicPoolReservationViolationRaiseEvent)\n        {\n            return (vmVnicPoolReservationViolationRaiseEvent != null && this.VmVnicResourcePoolKey == vmVnicPoolReservationViolationRaiseEvent.VmVnicResourcePoolKey && this.VmVnicResourcePoolName == vmVnicPoolReservationViolationRaiseEvent.VmVnicResourcePoolName);\n        }\n\n        public override bool Equals(object vmVnicPoolReservationViolationRaiseEvent)\n        {\n            return Equals(vmVnicPoolReservationViolationRaiseEvent as VmVnicPoolReservationViolationRaiseEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmVnicResourcePoolKey + \"_\" + VmVnicResourcePoolName).GetHashCode();\n        }\n    }\n\n    public class VmwareDistributedVirtualSwitch : DistributedVirtualSwitch, IEquatable<VmwareDistributedVirtualSwitch>\n    {\n        public new VmwareDistributedVirtualSwitch_LinkedView LinkedView { get; set; }\n\n        public ManagedObjectReference UpdateDVSLacpGroupConfig_Task(VMwareDvsLacpGroupSpec[] lacpGroupSpec)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public void UpdateDVSLacpGroupConfig(VMwareDvsLacpGroupSpec[] lacpGroupSpec)\n        {\n        }\n\n        public bool Equals(VmwareDistributedVirtualSwitch vmwareDistributedVirtualSwitch)\n        {\n            return (vmwareDistributedVirtualSwitch != null && ((this.LinkedView == null && vmwareDistributedVirtualSwitch.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmwareDistributedVirtualSwitch.LinkedView))));\n        }\n\n        public override bool Equals(object vmwareDistributedVirtualSwitch)\n        {\n            return Equals(vmwareDistributedVirtualSwitch as VmwareDistributedVirtualSwitch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmwareDistributedVirtualSwitch_LinkedView : DistributedVirtualSwitch_LinkedView, IEquatable<VmwareDistributedVirtualSwitch_LinkedView>\n    {\n        public bool Equals(VmwareDistributedVirtualSwitch_LinkedView vmwareDistributedVirtualSwitch_LinkedView)\n        {\n            return (vmwareDistributedVirtualSwitch_LinkedView != null && base.Equals(vmwareDistributedVirtualSwitch_LinkedView));\n        }\n\n        public override bool Equals(object vmwareDistributedVirtualSwitch_LinkedView)\n        {\n            return Equals(vmwareDistributedVirtualSwitch_LinkedView as VmwareDistributedVirtualSwitch_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VmwareDistributedVirtualSwitchPvlanSpec : VmwareDistributedVirtualSwitchVlanSpec, IEquatable<VmwareDistributedVirtualSwitchPvlanSpec>\n    {\n        public int PvlanId { get; set; }\n\n        public bool Equals(VmwareDistributedVirtualSwitchPvlanSpec vmwareDistributedVirtualSwitchPvlanSpec)\n        {\n            return (vmwareDistributedVirtualSwitchPvlanSpec != null && this.PvlanId == vmwareDistributedVirtualSwitchPvlanSpec.PvlanId);\n        }\n\n        public override bool Equals(object vmwareDistributedVirtualSwitchPvlanSpec)\n        {\n            return Equals(vmwareDistributedVirtualSwitchPvlanSpec as VmwareDistributedVirtualSwitchPvlanSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PvlanId).GetHashCode();\n        }\n    }\n\n    public class VmwareDistributedVirtualSwitchTrunkVlanSpec : VmwareDistributedVirtualSwitchVlanSpec, IEquatable<VmwareDistributedVirtualSwitchTrunkVlanSpec>\n    {\n        public NumericRange[] VlanId { get; set; }\n\n        public bool Equals(VmwareDistributedVirtualSwitchTrunkVlanSpec vmwareDistributedVirtualSwitchTrunkVlanSpec)\n        {\n            return (vmwareDistributedVirtualSwitchTrunkVlanSpec != null && ((this.VlanId == null && vmwareDistributedVirtualSwitchTrunkVlanSpec.VlanId == null) || (this.VlanId != null && vmwareDistributedVirtualSwitchTrunkVlanSpec.VlanId != null && Enumerable.SequenceEqual(this.VlanId, vmwareDistributedVirtualSwitchTrunkVlanSpec.VlanId))));\n        }\n\n        public override bool Equals(object vmwareDistributedVirtualSwitchTrunkVlanSpec)\n        {\n            return Equals(vmwareDistributedVirtualSwitchTrunkVlanSpec as VmwareDistributedVirtualSwitchTrunkVlanSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanId).GetHashCode();\n        }\n    }\n\n    public class VmwareDistributedVirtualSwitchVlanIdSpec : VmwareDistributedVirtualSwitchVlanSpec, IEquatable<VmwareDistributedVirtualSwitchVlanIdSpec>\n    {\n        public int VlanId { get; set; }\n\n        public bool Equals(VmwareDistributedVirtualSwitchVlanIdSpec vmwareDistributedVirtualSwitchVlanIdSpec)\n        {\n            return (vmwareDistributedVirtualSwitchVlanIdSpec != null && this.VlanId == vmwareDistributedVirtualSwitchVlanIdSpec.VlanId);\n        }\n\n        public override bool Equals(object vmwareDistributedVirtualSwitchVlanIdSpec)\n        {\n            return Equals(vmwareDistributedVirtualSwitchVlanIdSpec as VmwareDistributedVirtualSwitchVlanIdSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanId).GetHashCode();\n        }\n    }\n\n    public class VmwareDistributedVirtualSwitchVlanSpec : InheritablePolicy, IEquatable<VmwareDistributedVirtualSwitchVlanSpec>\n    {\n        public bool Equals(VmwareDistributedVirtualSwitchVlanSpec vmwareDistributedVirtualSwitchVlanSpec)\n        {\n            return (vmwareDistributedVirtualSwitchVlanSpec != null && base.Equals(vmwareDistributedVirtualSwitchVlanSpec));\n        }\n\n        public override bool Equals(object vmwareDistributedVirtualSwitchVlanSpec)\n        {\n            return Equals(vmwareDistributedVirtualSwitchVlanSpec as VmwareDistributedVirtualSwitchVlanSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMwareDVSConfigInfo : DVSConfigInfo, IEquatable<VMwareDVSConfigInfo>\n    {\n        public VMwareVspanSession[] VspanSession { get; set; }\n\n        public VMwareDVSPvlanMapEntry[] PvlanConfig { get; set; }\n\n        public int MaxMtu { get; set; }\n\n        public LinkDiscoveryProtocolConfig LinkDiscoveryProtocolConfig { get; set; }\n\n        public VMwareIpfixConfig IpfixConfig { get; set; }\n\n        public VMwareDvsLacpGroupConfig[] LacpGroupConfig { get; set; }\n\n        public string LacpApiVersion { get; set; }\n\n        public string MulticastFilteringMode { get; set; }\n\n        public new VMwareDVSConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMwareDVSConfigInfo vMwareDVSConfigInfo)\n        {\n            return (vMwareDVSConfigInfo != null && ((this.VspanSession == null && vMwareDVSConfigInfo.VspanSession == null) || (this.VspanSession != null && vMwareDVSConfigInfo.VspanSession != null && Enumerable.SequenceEqual(this.VspanSession, vMwareDVSConfigInfo.VspanSession))) && ((this.PvlanConfig == null && vMwareDVSConfigInfo.PvlanConfig == null) || (this.PvlanConfig != null && vMwareDVSConfigInfo.PvlanConfig != null && Enumerable.SequenceEqual(this.PvlanConfig, vMwareDVSConfigInfo.PvlanConfig))) && this.MaxMtu == vMwareDVSConfigInfo.MaxMtu && ((this.LinkDiscoveryProtocolConfig == null && vMwareDVSConfigInfo.LinkDiscoveryProtocolConfig == null) || (this.LinkDiscoveryProtocolConfig != null && this.LinkDiscoveryProtocolConfig.Equals(vMwareDVSConfigInfo.LinkDiscoveryProtocolConfig))) && ((this.IpfixConfig == null && vMwareDVSConfigInfo.IpfixConfig == null) || (this.IpfixConfig != null && this.IpfixConfig.Equals(vMwareDVSConfigInfo.IpfixConfig))) && ((this.LacpGroupConfig == null && vMwareDVSConfigInfo.LacpGroupConfig == null) || (this.LacpGroupConfig != null && vMwareDVSConfigInfo.LacpGroupConfig != null && Enumerable.SequenceEqual(this.LacpGroupConfig, vMwareDVSConfigInfo.LacpGroupConfig))) && this.LacpApiVersion == vMwareDVSConfigInfo.LacpApiVersion && this.MulticastFilteringMode == vMwareDVSConfigInfo.MulticastFilteringMode && ((this.LinkedView == null && vMwareDVSConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMwareDVSConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object vMwareDVSConfigInfo)\n        {\n            return Equals(vMwareDVSConfigInfo as VMwareDVSConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSession + \"_\" + PvlanConfig + \"_\" + MaxMtu + \"_\" + LinkDiscoveryProtocolConfig + \"_\" + IpfixConfig + \"_\" + LacpGroupConfig + \"_\" + LacpApiVersion + \"_\" + MulticastFilteringMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSConfigInfo_LinkedView : DVSConfigInfo_LinkedView, IEquatable<VMwareDVSConfigInfo_LinkedView>\n    {\n        public bool Equals(VMwareDVSConfigInfo_LinkedView vMwareDVSConfigInfo_LinkedView)\n        {\n            return (vMwareDVSConfigInfo_LinkedView != null && base.Equals(vMwareDVSConfigInfo_LinkedView));\n        }\n\n        public override bool Equals(object vMwareDVSConfigInfo_LinkedView)\n        {\n            return Equals(vMwareDVSConfigInfo_LinkedView as VMwareDVSConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMwareDVSConfigSpec : DVSConfigSpec, IEquatable<VMwareDVSConfigSpec>\n    {\n        public VMwareDVSPvlanConfigSpec[] PvlanConfigSpec { get; set; }\n\n        public VMwareDVSVspanConfigSpec[] VspanConfigSpec { get; set; }\n\n        public int? MaxMtu { get; set; }\n\n        public LinkDiscoveryProtocolConfig LinkDiscoveryProtocolConfig { get; set; }\n\n        public VMwareIpfixConfig IpfixConfig { get; set; }\n\n        public string LacpApiVersion { get; set; }\n\n        public string MulticastFilteringMode { get; set; }\n\n        public new VMwareDVSConfigSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VMwareDVSConfigSpec vMwareDVSConfigSpec)\n        {\n            return (vMwareDVSConfigSpec != null && ((this.PvlanConfigSpec == null && vMwareDVSConfigSpec.PvlanConfigSpec == null) || (this.PvlanConfigSpec != null && vMwareDVSConfigSpec.PvlanConfigSpec != null && Enumerable.SequenceEqual(this.PvlanConfigSpec, vMwareDVSConfigSpec.PvlanConfigSpec))) && ((this.VspanConfigSpec == null && vMwareDVSConfigSpec.VspanConfigSpec == null) || (this.VspanConfigSpec != null && vMwareDVSConfigSpec.VspanConfigSpec != null && Enumerable.SequenceEqual(this.VspanConfigSpec, vMwareDVSConfigSpec.VspanConfigSpec))) && ((this.MaxMtu == null && vMwareDVSConfigSpec.MaxMtu == null) || (this.MaxMtu != null && this.MaxMtu.Equals(vMwareDVSConfigSpec.MaxMtu))) && ((this.LinkDiscoveryProtocolConfig == null && vMwareDVSConfigSpec.LinkDiscoveryProtocolConfig == null) || (this.LinkDiscoveryProtocolConfig != null && this.LinkDiscoveryProtocolConfig.Equals(vMwareDVSConfigSpec.LinkDiscoveryProtocolConfig))) && ((this.IpfixConfig == null && vMwareDVSConfigSpec.IpfixConfig == null) || (this.IpfixConfig != null && this.IpfixConfig.Equals(vMwareDVSConfigSpec.IpfixConfig))) && this.LacpApiVersion == vMwareDVSConfigSpec.LacpApiVersion && this.MulticastFilteringMode == vMwareDVSConfigSpec.MulticastFilteringMode && ((this.LinkedView == null && vMwareDVSConfigSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vMwareDVSConfigSpec.LinkedView))));\n        }\n\n        public override bool Equals(object vMwareDVSConfigSpec)\n        {\n            return Equals(vMwareDVSConfigSpec as VMwareDVSConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PvlanConfigSpec + \"_\" + VspanConfigSpec + \"_\" + MaxMtu + \"_\" + LinkDiscoveryProtocolConfig + \"_\" + IpfixConfig + \"_\" + LacpApiVersion + \"_\" + MulticastFilteringMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSConfigSpec_LinkedView : DVSConfigSpec_LinkedView, IEquatable<VMwareDVSConfigSpec_LinkedView>\n    {\n        public bool Equals(VMwareDVSConfigSpec_LinkedView vMwareDVSConfigSpec_LinkedView)\n        {\n            return (vMwareDVSConfigSpec_LinkedView != null && base.Equals(vMwareDVSConfigSpec_LinkedView));\n        }\n\n        public override bool Equals(object vMwareDVSConfigSpec_LinkedView)\n        {\n            return Equals(vMwareDVSConfigSpec_LinkedView as VMwareDVSConfigSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMwareDVSFeatureCapability : DVSFeatureCapability, IEquatable<VMwareDVSFeatureCapability>\n    {\n        public bool? VspanSupported { get; set; }\n\n        public bool? LldpSupported { get; set; }\n\n        public bool? IpfixSupported { get; set; }\n\n        public VMwareDvsIpfixCapability IpfixCapability { get; set; }\n\n        public bool? MulticastSnoopingSupported { get; set; }\n\n        public VMwareDVSVspanCapability VspanCapability { get; set; }\n\n        public VMwareDvsLacpCapability LacpCapability { get; set; }\n\n        public bool Equals(VMwareDVSFeatureCapability vMwareDVSFeatureCapability)\n        {\n            return (vMwareDVSFeatureCapability != null && ((this.VspanSupported == null && vMwareDVSFeatureCapability.VspanSupported == null) || (this.VspanSupported != null && this.VspanSupported.Equals(vMwareDVSFeatureCapability.VspanSupported))) && ((this.LldpSupported == null && vMwareDVSFeatureCapability.LldpSupported == null) || (this.LldpSupported != null && this.LldpSupported.Equals(vMwareDVSFeatureCapability.LldpSupported))) && ((this.IpfixSupported == null && vMwareDVSFeatureCapability.IpfixSupported == null) || (this.IpfixSupported != null && this.IpfixSupported.Equals(vMwareDVSFeatureCapability.IpfixSupported))) && ((this.IpfixCapability == null && vMwareDVSFeatureCapability.IpfixCapability == null) || (this.IpfixCapability != null && this.IpfixCapability.Equals(vMwareDVSFeatureCapability.IpfixCapability))) && ((this.MulticastSnoopingSupported == null && vMwareDVSFeatureCapability.MulticastSnoopingSupported == null) || (this.MulticastSnoopingSupported != null && this.MulticastSnoopingSupported.Equals(vMwareDVSFeatureCapability.MulticastSnoopingSupported))) && ((this.VspanCapability == null && vMwareDVSFeatureCapability.VspanCapability == null) || (this.VspanCapability != null && this.VspanCapability.Equals(vMwareDVSFeatureCapability.VspanCapability))) && ((this.LacpCapability == null && vMwareDVSFeatureCapability.LacpCapability == null) || (this.LacpCapability != null && this.LacpCapability.Equals(vMwareDVSFeatureCapability.LacpCapability))));\n        }\n\n        public override bool Equals(object vMwareDVSFeatureCapability)\n        {\n            return Equals(vMwareDVSFeatureCapability as VMwareDVSFeatureCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSupported + \"_\" + LldpSupported + \"_\" + IpfixSupported + \"_\" + IpfixCapability + \"_\" + MulticastSnoopingSupported + \"_\" + VspanCapability + \"_\" + LacpCapability).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSHealthCheckCapability : DVSHealthCheckCapability, IEquatable<VMwareDVSHealthCheckCapability>\n    {\n        public bool VlanMtuSupported { get; set; }\n\n        public bool TeamingSupported { get; set; }\n\n        public bool Equals(VMwareDVSHealthCheckCapability vMwareDVSHealthCheckCapability)\n        {\n            return (vMwareDVSHealthCheckCapability != null && this.VlanMtuSupported == vMwareDVSHealthCheckCapability.VlanMtuSupported && this.TeamingSupported == vMwareDVSHealthCheckCapability.TeamingSupported);\n        }\n\n        public override bool Equals(object vMwareDVSHealthCheckCapability)\n        {\n            return Equals(vMwareDVSHealthCheckCapability as VMwareDVSHealthCheckCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanMtuSupported + \"_\" + TeamingSupported).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSHealthCheckConfig : DVSHealthCheckConfig, IEquatable<VMwareDVSHealthCheckConfig>\n    {\n        public bool Equals(VMwareDVSHealthCheckConfig vMwareDVSHealthCheckConfig)\n        {\n            return (vMwareDVSHealthCheckConfig != null && base.Equals(vMwareDVSHealthCheckConfig));\n        }\n\n        public override bool Equals(object vMwareDVSHealthCheckConfig)\n        {\n            return Equals(vMwareDVSHealthCheckConfig as VMwareDVSHealthCheckConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMwareDvsIpfixCapability : DynamicData, IEquatable<VMwareDvsIpfixCapability>\n    {\n        public bool? IpfixSupported { get; set; }\n\n        public bool? Ipv6ForIpfixSupported { get; set; }\n\n        public bool? ObservationDomainIdSupported { get; set; }\n\n        public bool Equals(VMwareDvsIpfixCapability vMwareDvsIpfixCapability)\n        {\n            return (vMwareDvsIpfixCapability != null && ((this.IpfixSupported == null && vMwareDvsIpfixCapability.IpfixSupported == null) || (this.IpfixSupported != null && this.IpfixSupported.Equals(vMwareDvsIpfixCapability.IpfixSupported))) && ((this.Ipv6ForIpfixSupported == null && vMwareDvsIpfixCapability.Ipv6ForIpfixSupported == null) || (this.Ipv6ForIpfixSupported != null && this.Ipv6ForIpfixSupported.Equals(vMwareDvsIpfixCapability.Ipv6ForIpfixSupported))) && ((this.ObservationDomainIdSupported == null && vMwareDvsIpfixCapability.ObservationDomainIdSupported == null) || (this.ObservationDomainIdSupported != null && this.ObservationDomainIdSupported.Equals(vMwareDvsIpfixCapability.ObservationDomainIdSupported))));\n        }\n\n        public override bool Equals(object vMwareDvsIpfixCapability)\n        {\n            return Equals(vMwareDvsIpfixCapability as VMwareDvsIpfixCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpfixSupported + \"_\" + Ipv6ForIpfixSupported + \"_\" + ObservationDomainIdSupported).GetHashCode();\n        }\n    }\n\n    public class VMwareDvsLacpCapability : DynamicData, IEquatable<VMwareDvsLacpCapability>\n    {\n        public bool? LacpSupported { get; set; }\n\n        public bool? MultiLacpGroupSupported { get; set; }\n\n        public bool Equals(VMwareDvsLacpCapability vMwareDvsLacpCapability)\n        {\n            return (vMwareDvsLacpCapability != null && ((this.LacpSupported == null && vMwareDvsLacpCapability.LacpSupported == null) || (this.LacpSupported != null && this.LacpSupported.Equals(vMwareDvsLacpCapability.LacpSupported))) && ((this.MultiLacpGroupSupported == null && vMwareDvsLacpCapability.MultiLacpGroupSupported == null) || (this.MultiLacpGroupSupported != null && this.MultiLacpGroupSupported.Equals(vMwareDvsLacpCapability.MultiLacpGroupSupported))));\n        }\n\n        public override bool Equals(object vMwareDvsLacpCapability)\n        {\n            return Equals(vMwareDvsLacpCapability as VMwareDvsLacpCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LacpSupported + \"_\" + MultiLacpGroupSupported).GetHashCode();\n        }\n    }\n\n    public class VMwareDvsLacpGroupConfig : DynamicData, IEquatable<VMwareDvsLacpGroupConfig>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Mode { get; set; }\n\n        public int? UplinkNum { get; set; }\n\n        public string LoadbalanceAlgorithm { get; set; }\n\n        public VMwareDvsLagVlanConfig Vlan { get; set; }\n\n        public VMwareDvsLagIpfixConfig Ipfix { get; set; }\n\n        public string[] UplinkName { get; set; }\n\n        public string[] UplinkPortKey { get; set; }\n\n        public bool Equals(VMwareDvsLacpGroupConfig vMwareDvsLacpGroupConfig)\n        {\n            return (vMwareDvsLacpGroupConfig != null && this.Key == vMwareDvsLacpGroupConfig.Key && this.Name == vMwareDvsLacpGroupConfig.Name && this.Mode == vMwareDvsLacpGroupConfig.Mode && ((this.UplinkNum == null && vMwareDvsLacpGroupConfig.UplinkNum == null) || (this.UplinkNum != null && this.UplinkNum.Equals(vMwareDvsLacpGroupConfig.UplinkNum))) && this.LoadbalanceAlgorithm == vMwareDvsLacpGroupConfig.LoadbalanceAlgorithm && ((this.Vlan == null && vMwareDvsLacpGroupConfig.Vlan == null) || (this.Vlan != null && this.Vlan.Equals(vMwareDvsLacpGroupConfig.Vlan))) && ((this.Ipfix == null && vMwareDvsLacpGroupConfig.Ipfix == null) || (this.Ipfix != null && this.Ipfix.Equals(vMwareDvsLacpGroupConfig.Ipfix))) && ((this.UplinkName == null && vMwareDvsLacpGroupConfig.UplinkName == null) || (this.UplinkName != null && vMwareDvsLacpGroupConfig.UplinkName != null && Enumerable.SequenceEqual(this.UplinkName, vMwareDvsLacpGroupConfig.UplinkName))) && ((this.UplinkPortKey == null && vMwareDvsLacpGroupConfig.UplinkPortKey == null) || (this.UplinkPortKey != null && vMwareDvsLacpGroupConfig.UplinkPortKey != null && Enumerable.SequenceEqual(this.UplinkPortKey, vMwareDvsLacpGroupConfig.UplinkPortKey))));\n        }\n\n        public override bool Equals(object vMwareDvsLacpGroupConfig)\n        {\n            return Equals(vMwareDvsLacpGroupConfig as VMwareDvsLacpGroupConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Mode + \"_\" + UplinkNum + \"_\" + LoadbalanceAlgorithm + \"_\" + Vlan + \"_\" + Ipfix + \"_\" + UplinkName + \"_\" + UplinkPortKey).GetHashCode();\n        }\n    }\n\n    public class VMwareDvsLacpGroupSpec : DynamicData, IEquatable<VMwareDvsLacpGroupSpec>\n    {\n        public VMwareDvsLacpGroupConfig LacpGroupConfig { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(VMwareDvsLacpGroupSpec vMwareDvsLacpGroupSpec)\n        {\n            return (vMwareDvsLacpGroupSpec != null && ((this.LacpGroupConfig == null && vMwareDvsLacpGroupSpec.LacpGroupConfig == null) || (this.LacpGroupConfig != null && this.LacpGroupConfig.Equals(vMwareDvsLacpGroupSpec.LacpGroupConfig))) && this.Operation == vMwareDvsLacpGroupSpec.Operation);\n        }\n\n        public override bool Equals(object vMwareDvsLacpGroupSpec)\n        {\n            return Equals(vMwareDvsLacpGroupSpec as VMwareDvsLacpGroupSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LacpGroupConfig + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class VMwareDvsLagIpfixConfig : DynamicData, IEquatable<VMwareDvsLagIpfixConfig>\n    {\n        public bool? IpfixEnabled { get; set; }\n\n        public bool Equals(VMwareDvsLagIpfixConfig vMwareDvsLagIpfixConfig)\n        {\n            return (vMwareDvsLagIpfixConfig != null && ((this.IpfixEnabled == null && vMwareDvsLagIpfixConfig.IpfixEnabled == null) || (this.IpfixEnabled != null && this.IpfixEnabled.Equals(vMwareDvsLagIpfixConfig.IpfixEnabled))));\n        }\n\n        public override bool Equals(object vMwareDvsLagIpfixConfig)\n        {\n            return Equals(vMwareDvsLagIpfixConfig as VMwareDvsLagIpfixConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpfixEnabled).GetHashCode();\n        }\n    }\n\n    public class VMwareDvsLagVlanConfig : DynamicData, IEquatable<VMwareDvsLagVlanConfig>\n    {\n        public NumericRange[] VlanId { get; set; }\n\n        public bool Equals(VMwareDvsLagVlanConfig vMwareDvsLagVlanConfig)\n        {\n            return (vMwareDvsLagVlanConfig != null && ((this.VlanId == null && vMwareDvsLagVlanConfig.VlanId == null) || (this.VlanId != null && vMwareDvsLagVlanConfig.VlanId != null && Enumerable.SequenceEqual(this.VlanId, vMwareDvsLagVlanConfig.VlanId))));\n        }\n\n        public override bool Equals(object vMwareDvsLagVlanConfig)\n        {\n            return Equals(vMwareDvsLagVlanConfig as VMwareDvsLagVlanConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanId).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSMtuHealthCheckResult : HostMemberUplinkHealthCheckResult, IEquatable<VMwareDVSMtuHealthCheckResult>\n    {\n        public bool MtuMismatch { get; set; }\n\n        public NumericRange[] VlanSupportSwitchMtu { get; set; }\n\n        public NumericRange[] VlanNotSupportSwitchMtu { get; set; }\n\n        public bool Equals(VMwareDVSMtuHealthCheckResult vMwareDVSMtuHealthCheckResult)\n        {\n            return (vMwareDVSMtuHealthCheckResult != null && this.MtuMismatch == vMwareDVSMtuHealthCheckResult.MtuMismatch && ((this.VlanSupportSwitchMtu == null && vMwareDVSMtuHealthCheckResult.VlanSupportSwitchMtu == null) || (this.VlanSupportSwitchMtu != null && vMwareDVSMtuHealthCheckResult.VlanSupportSwitchMtu != null && Enumerable.SequenceEqual(this.VlanSupportSwitchMtu, vMwareDVSMtuHealthCheckResult.VlanSupportSwitchMtu))) && ((this.VlanNotSupportSwitchMtu == null && vMwareDVSMtuHealthCheckResult.VlanNotSupportSwitchMtu == null) || (this.VlanNotSupportSwitchMtu != null && vMwareDVSMtuHealthCheckResult.VlanNotSupportSwitchMtu != null && Enumerable.SequenceEqual(this.VlanNotSupportSwitchMtu, vMwareDVSMtuHealthCheckResult.VlanNotSupportSwitchMtu))));\n        }\n\n        public override bool Equals(object vMwareDVSMtuHealthCheckResult)\n        {\n            return Equals(vMwareDVSMtuHealthCheckResult as VMwareDVSMtuHealthCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MtuMismatch + \"_\" + VlanSupportSwitchMtu + \"_\" + VlanNotSupportSwitchMtu).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSPortgroupPolicy : DVPortgroupPolicy, IEquatable<VMwareDVSPortgroupPolicy>\n    {\n        public bool VlanOverrideAllowed { get; set; }\n\n        public bool UplinkTeamingOverrideAllowed { get; set; }\n\n        public bool SecurityPolicyOverrideAllowed { get; set; }\n\n        public bool? IpfixOverrideAllowed { get; set; }\n\n        public bool? MacManagementOverrideAllowed { get; set; }\n\n        public bool Equals(VMwareDVSPortgroupPolicy vMwareDVSPortgroupPolicy)\n        {\n            return (vMwareDVSPortgroupPolicy != null && this.VlanOverrideAllowed == vMwareDVSPortgroupPolicy.VlanOverrideAllowed && this.UplinkTeamingOverrideAllowed == vMwareDVSPortgroupPolicy.UplinkTeamingOverrideAllowed && this.SecurityPolicyOverrideAllowed == vMwareDVSPortgroupPolicy.SecurityPolicyOverrideAllowed && ((this.IpfixOverrideAllowed == null && vMwareDVSPortgroupPolicy.IpfixOverrideAllowed == null) || (this.IpfixOverrideAllowed != null && this.IpfixOverrideAllowed.Equals(vMwareDVSPortgroupPolicy.IpfixOverrideAllowed))) && ((this.MacManagementOverrideAllowed == null && vMwareDVSPortgroupPolicy.MacManagementOverrideAllowed == null) || (this.MacManagementOverrideAllowed != null && this.MacManagementOverrideAllowed.Equals(vMwareDVSPortgroupPolicy.MacManagementOverrideAllowed))));\n        }\n\n        public override bool Equals(object vMwareDVSPortgroupPolicy)\n        {\n            return Equals(vMwareDVSPortgroupPolicy as VMwareDVSPortgroupPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanOverrideAllowed + \"_\" + UplinkTeamingOverrideAllowed + \"_\" + SecurityPolicyOverrideAllowed + \"_\" + IpfixOverrideAllowed + \"_\" + MacManagementOverrideAllowed).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSPortSetting : DVPortSetting, IEquatable<VMwareDVSPortSetting>\n    {\n        public VmwareDistributedVirtualSwitchVlanSpec Vlan { get; set; }\n\n        public IntPolicy QosTag { get; set; }\n\n        public VmwareUplinkPortTeamingPolicy UplinkTeamingPolicy { get; set; }\n\n        public DVSSecurityPolicy SecurityPolicy { get; set; }\n\n        public BoolPolicy IpfixEnabled { get; set; }\n\n        public BoolPolicy TxUplink { get; set; }\n\n        public VMwareUplinkLacpPolicy LacpPolicy { get; set; }\n\n        public DVSMacManagementPolicy MacManagementPolicy { get; set; }\n\n        public bool Equals(VMwareDVSPortSetting vMwareDVSPortSetting)\n        {\n            return (vMwareDVSPortSetting != null && ((this.Vlan == null && vMwareDVSPortSetting.Vlan == null) || (this.Vlan != null && this.Vlan.Equals(vMwareDVSPortSetting.Vlan))) && ((this.QosTag == null && vMwareDVSPortSetting.QosTag == null) || (this.QosTag != null && this.QosTag.Equals(vMwareDVSPortSetting.QosTag))) && ((this.UplinkTeamingPolicy == null && vMwareDVSPortSetting.UplinkTeamingPolicy == null) || (this.UplinkTeamingPolicy != null && this.UplinkTeamingPolicy.Equals(vMwareDVSPortSetting.UplinkTeamingPolicy))) && ((this.SecurityPolicy == null && vMwareDVSPortSetting.SecurityPolicy == null) || (this.SecurityPolicy != null && this.SecurityPolicy.Equals(vMwareDVSPortSetting.SecurityPolicy))) && ((this.IpfixEnabled == null && vMwareDVSPortSetting.IpfixEnabled == null) || (this.IpfixEnabled != null && this.IpfixEnabled.Equals(vMwareDVSPortSetting.IpfixEnabled))) && ((this.TxUplink == null && vMwareDVSPortSetting.TxUplink == null) || (this.TxUplink != null && this.TxUplink.Equals(vMwareDVSPortSetting.TxUplink))) && ((this.LacpPolicy == null && vMwareDVSPortSetting.LacpPolicy == null) || (this.LacpPolicy != null && this.LacpPolicy.Equals(vMwareDVSPortSetting.LacpPolicy))) && ((this.MacManagementPolicy == null && vMwareDVSPortSetting.MacManagementPolicy == null) || (this.MacManagementPolicy != null && this.MacManagementPolicy.Equals(vMwareDVSPortSetting.MacManagementPolicy))));\n        }\n\n        public override bool Equals(object vMwareDVSPortSetting)\n        {\n            return Equals(vMwareDVSPortSetting as VMwareDVSPortSetting);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vlan + \"_\" + QosTag + \"_\" + UplinkTeamingPolicy + \"_\" + SecurityPolicy + \"_\" + IpfixEnabled + \"_\" + TxUplink + \"_\" + LacpPolicy + \"_\" + MacManagementPolicy).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSPvlanConfigSpec : DynamicData, IEquatable<VMwareDVSPvlanConfigSpec>\n    {\n        public VMwareDVSPvlanMapEntry PvlanEntry { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(VMwareDVSPvlanConfigSpec vMwareDVSPvlanConfigSpec)\n        {\n            return (vMwareDVSPvlanConfigSpec != null && ((this.PvlanEntry == null && vMwareDVSPvlanConfigSpec.PvlanEntry == null) || (this.PvlanEntry != null && this.PvlanEntry.Equals(vMwareDVSPvlanConfigSpec.PvlanEntry))) && this.Operation == vMwareDVSPvlanConfigSpec.Operation);\n        }\n\n        public override bool Equals(object vMwareDVSPvlanConfigSpec)\n        {\n            return Equals(vMwareDVSPvlanConfigSpec as VMwareDVSPvlanConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PvlanEntry + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSPvlanMapEntry : DynamicData, IEquatable<VMwareDVSPvlanMapEntry>\n    {\n        public int PrimaryVlanId { get; set; }\n\n        public int SecondaryVlanId { get; set; }\n\n        public string PvlanType { get; set; }\n\n        public bool Equals(VMwareDVSPvlanMapEntry vMwareDVSPvlanMapEntry)\n        {\n            return (vMwareDVSPvlanMapEntry != null && this.PrimaryVlanId == vMwareDVSPvlanMapEntry.PrimaryVlanId && this.SecondaryVlanId == vMwareDVSPvlanMapEntry.SecondaryVlanId && this.PvlanType == vMwareDVSPvlanMapEntry.PvlanType);\n        }\n\n        public override bool Equals(object vMwareDVSPvlanMapEntry)\n        {\n            return Equals(vMwareDVSPvlanMapEntry as VMwareDVSPvlanMapEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrimaryVlanId + \"_\" + SecondaryVlanId + \"_\" + PvlanType).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSTeamingHealthCheckConfig : VMwareDVSHealthCheckConfig, IEquatable<VMwareDVSTeamingHealthCheckConfig>\n    {\n        public bool Equals(VMwareDVSTeamingHealthCheckConfig vMwareDVSTeamingHealthCheckConfig)\n        {\n            return (vMwareDVSTeamingHealthCheckConfig != null && base.Equals(vMwareDVSTeamingHealthCheckConfig));\n        }\n\n        public override bool Equals(object vMwareDVSTeamingHealthCheckConfig)\n        {\n            return Equals(vMwareDVSTeamingHealthCheckConfig as VMwareDVSTeamingHealthCheckConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMwareDVSTeamingHealthCheckResult : HostMemberHealthCheckResult, IEquatable<VMwareDVSTeamingHealthCheckResult>\n    {\n        public string TeamingStatus { get; set; }\n\n        public bool Equals(VMwareDVSTeamingHealthCheckResult vMwareDVSTeamingHealthCheckResult)\n        {\n            return (vMwareDVSTeamingHealthCheckResult != null && this.TeamingStatus == vMwareDVSTeamingHealthCheckResult.TeamingStatus);\n        }\n\n        public override bool Equals(object vMwareDVSTeamingHealthCheckResult)\n        {\n            return Equals(vMwareDVSTeamingHealthCheckResult as VMwareDVSTeamingHealthCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TeamingStatus).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSVlanHealthCheckResult : HostMemberUplinkHealthCheckResult, IEquatable<VMwareDVSVlanHealthCheckResult>\n    {\n        public NumericRange[] TrunkedVlan { get; set; }\n\n        public NumericRange[] UntrunkedVlan { get; set; }\n\n        public bool Equals(VMwareDVSVlanHealthCheckResult vMwareDVSVlanHealthCheckResult)\n        {\n            return (vMwareDVSVlanHealthCheckResult != null && ((this.TrunkedVlan == null && vMwareDVSVlanHealthCheckResult.TrunkedVlan == null) || (this.TrunkedVlan != null && vMwareDVSVlanHealthCheckResult.TrunkedVlan != null && Enumerable.SequenceEqual(this.TrunkedVlan, vMwareDVSVlanHealthCheckResult.TrunkedVlan))) && ((this.UntrunkedVlan == null && vMwareDVSVlanHealthCheckResult.UntrunkedVlan == null) || (this.UntrunkedVlan != null && vMwareDVSVlanHealthCheckResult.UntrunkedVlan != null && Enumerable.SequenceEqual(this.UntrunkedVlan, vMwareDVSVlanHealthCheckResult.UntrunkedVlan))));\n        }\n\n        public override bool Equals(object vMwareDVSVlanHealthCheckResult)\n        {\n            return Equals(vMwareDVSVlanHealthCheckResult as VMwareDVSVlanHealthCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TrunkedVlan + \"_\" + UntrunkedVlan).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSVlanMtuHealthCheckConfig : VMwareDVSHealthCheckConfig, IEquatable<VMwareDVSVlanMtuHealthCheckConfig>\n    {\n        public bool Equals(VMwareDVSVlanMtuHealthCheckConfig vMwareDVSVlanMtuHealthCheckConfig)\n        {\n            return (vMwareDVSVlanMtuHealthCheckConfig != null && base.Equals(vMwareDVSVlanMtuHealthCheckConfig));\n        }\n\n        public override bool Equals(object vMwareDVSVlanMtuHealthCheckConfig)\n        {\n            return Equals(vMwareDVSVlanMtuHealthCheckConfig as VMwareDVSVlanMtuHealthCheckConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VMwareDVSVspanCapability : DynamicData, IEquatable<VMwareDVSVspanCapability>\n    {\n        public bool MixedDestSupported { get; set; }\n\n        public bool DvportSupported { get; set; }\n\n        public bool RemoteSourceSupported { get; set; }\n\n        public bool RemoteDestSupported { get; set; }\n\n        public bool EncapRemoteSourceSupported { get; set; }\n\n        public bool? ErspanProtocolSupported { get; set; }\n\n        public bool? MirrorNetstackSupported { get; set; }\n\n        public bool Equals(VMwareDVSVspanCapability vMwareDVSVspanCapability)\n        {\n            return (vMwareDVSVspanCapability != null && this.MixedDestSupported == vMwareDVSVspanCapability.MixedDestSupported && this.DvportSupported == vMwareDVSVspanCapability.DvportSupported && this.RemoteSourceSupported == vMwareDVSVspanCapability.RemoteSourceSupported && this.RemoteDestSupported == vMwareDVSVspanCapability.RemoteDestSupported && this.EncapRemoteSourceSupported == vMwareDVSVspanCapability.EncapRemoteSourceSupported && ((this.ErspanProtocolSupported == null && vMwareDVSVspanCapability.ErspanProtocolSupported == null) || (this.ErspanProtocolSupported != null && this.ErspanProtocolSupported.Equals(vMwareDVSVspanCapability.ErspanProtocolSupported))) && ((this.MirrorNetstackSupported == null && vMwareDVSVspanCapability.MirrorNetstackSupported == null) || (this.MirrorNetstackSupported != null && this.MirrorNetstackSupported.Equals(vMwareDVSVspanCapability.MirrorNetstackSupported))));\n        }\n\n        public override bool Equals(object vMwareDVSVspanCapability)\n        {\n            return Equals(vMwareDVSVspanCapability as VMwareDVSVspanCapability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MixedDestSupported + \"_\" + DvportSupported + \"_\" + RemoteSourceSupported + \"_\" + RemoteDestSupported + \"_\" + EncapRemoteSourceSupported + \"_\" + ErspanProtocolSupported + \"_\" + MirrorNetstackSupported).GetHashCode();\n        }\n    }\n\n    public class VMwareDVSVspanConfigSpec : DynamicData, IEquatable<VMwareDVSVspanConfigSpec>\n    {\n        public VMwareVspanSession VspanSession { get; set; }\n\n        public string Operation { get; set; }\n\n        public bool Equals(VMwareDVSVspanConfigSpec vMwareDVSVspanConfigSpec)\n        {\n            return (vMwareDVSVspanConfigSpec != null && ((this.VspanSession == null && vMwareDVSVspanConfigSpec.VspanSession == null) || (this.VspanSession != null && this.VspanSession.Equals(vMwareDVSVspanConfigSpec.VspanSession))) && this.Operation == vMwareDVSVspanConfigSpec.Operation);\n        }\n\n        public override bool Equals(object vMwareDVSVspanConfigSpec)\n        {\n            return Equals(vMwareDVSVspanConfigSpec as VMwareDVSVspanConfigSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSession + \"_\" + Operation).GetHashCode();\n        }\n    }\n\n    public class VMwareIpfixConfig : DynamicData, IEquatable<VMwareIpfixConfig>\n    {\n        public string CollectorIpAddress { get; set; }\n\n        public int? CollectorPort { get; set; }\n\n        public long? ObservationDomainId { get; set; }\n\n        public int ActiveFlowTimeout { get; set; }\n\n        public int IdleFlowTimeout { get; set; }\n\n        public int SamplingRate { get; set; }\n\n        public bool InternalFlowsOnly { get; set; }\n\n        public bool Equals(VMwareIpfixConfig vMwareIpfixConfig)\n        {\n            return (vMwareIpfixConfig != null && this.CollectorIpAddress == vMwareIpfixConfig.CollectorIpAddress && ((this.CollectorPort == null && vMwareIpfixConfig.CollectorPort == null) || (this.CollectorPort != null && this.CollectorPort.Equals(vMwareIpfixConfig.CollectorPort))) && ((this.ObservationDomainId == null && vMwareIpfixConfig.ObservationDomainId == null) || (this.ObservationDomainId != null && this.ObservationDomainId.Equals(vMwareIpfixConfig.ObservationDomainId))) && this.ActiveFlowTimeout == vMwareIpfixConfig.ActiveFlowTimeout && this.IdleFlowTimeout == vMwareIpfixConfig.IdleFlowTimeout && this.SamplingRate == vMwareIpfixConfig.SamplingRate && this.InternalFlowsOnly == vMwareIpfixConfig.InternalFlowsOnly);\n        }\n\n        public override bool Equals(object vMwareIpfixConfig)\n        {\n            return Equals(vMwareIpfixConfig as VMwareIpfixConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CollectorIpAddress + \"_\" + CollectorPort + \"_\" + ObservationDomainId + \"_\" + ActiveFlowTimeout + \"_\" + IdleFlowTimeout + \"_\" + SamplingRate + \"_\" + InternalFlowsOnly).GetHashCode();\n        }\n    }\n\n    public class VMwareUplinkLacpPolicy : InheritablePolicy, IEquatable<VMwareUplinkLacpPolicy>\n    {\n        public BoolPolicy Enable { get; set; }\n\n        public StringPolicy Mode { get; set; }\n\n        public bool Equals(VMwareUplinkLacpPolicy vMwareUplinkLacpPolicy)\n        {\n            return (vMwareUplinkLacpPolicy != null && ((this.Enable == null && vMwareUplinkLacpPolicy.Enable == null) || (this.Enable != null && this.Enable.Equals(vMwareUplinkLacpPolicy.Enable))) && ((this.Mode == null && vMwareUplinkLacpPolicy.Mode == null) || (this.Mode != null && this.Mode.Equals(vMwareUplinkLacpPolicy.Mode))));\n        }\n\n        public override bool Equals(object vMwareUplinkLacpPolicy)\n        {\n            return Equals(vMwareUplinkLacpPolicy as VMwareUplinkLacpPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enable + \"_\" + Mode).GetHashCode();\n        }\n    }\n\n    public class VMwareUplinkPortOrderPolicy : InheritablePolicy, IEquatable<VMwareUplinkPortOrderPolicy>\n    {\n        public string[] ActiveUplinkPort { get; set; }\n\n        public string[] StandbyUplinkPort { get; set; }\n\n        public bool Equals(VMwareUplinkPortOrderPolicy vMwareUplinkPortOrderPolicy)\n        {\n            return (vMwareUplinkPortOrderPolicy != null && ((this.ActiveUplinkPort == null && vMwareUplinkPortOrderPolicy.ActiveUplinkPort == null) || (this.ActiveUplinkPort != null && vMwareUplinkPortOrderPolicy.ActiveUplinkPort != null && Enumerable.SequenceEqual(this.ActiveUplinkPort, vMwareUplinkPortOrderPolicy.ActiveUplinkPort))) && ((this.StandbyUplinkPort == null && vMwareUplinkPortOrderPolicy.StandbyUplinkPort == null) || (this.StandbyUplinkPort != null && vMwareUplinkPortOrderPolicy.StandbyUplinkPort != null && Enumerable.SequenceEqual(this.StandbyUplinkPort, vMwareUplinkPortOrderPolicy.StandbyUplinkPort))));\n        }\n\n        public override bool Equals(object vMwareUplinkPortOrderPolicy)\n        {\n            return Equals(vMwareUplinkPortOrderPolicy as VMwareUplinkPortOrderPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActiveUplinkPort + \"_\" + StandbyUplinkPort).GetHashCode();\n        }\n    }\n\n    public class VmwareUplinkPortTeamingPolicy : InheritablePolicy, IEquatable<VmwareUplinkPortTeamingPolicy>\n    {\n        public StringPolicy Policy { get; set; }\n\n        public BoolPolicy ReversePolicy { get; set; }\n\n        public BoolPolicy NotifySwitches { get; set; }\n\n        public BoolPolicy RollingOrder { get; set; }\n\n        public DVSFailureCriteria FailureCriteria { get; set; }\n\n        public VMwareUplinkPortOrderPolicy UplinkPortOrder { get; set; }\n\n        public bool Equals(VmwareUplinkPortTeamingPolicy vmwareUplinkPortTeamingPolicy)\n        {\n            return (vmwareUplinkPortTeamingPolicy != null && ((this.Policy == null && vmwareUplinkPortTeamingPolicy.Policy == null) || (this.Policy != null && this.Policy.Equals(vmwareUplinkPortTeamingPolicy.Policy))) && ((this.ReversePolicy == null && vmwareUplinkPortTeamingPolicy.ReversePolicy == null) || (this.ReversePolicy != null && this.ReversePolicy.Equals(vmwareUplinkPortTeamingPolicy.ReversePolicy))) && ((this.NotifySwitches == null && vmwareUplinkPortTeamingPolicy.NotifySwitches == null) || (this.NotifySwitches != null && this.NotifySwitches.Equals(vmwareUplinkPortTeamingPolicy.NotifySwitches))) && ((this.RollingOrder == null && vmwareUplinkPortTeamingPolicy.RollingOrder == null) || (this.RollingOrder != null && this.RollingOrder.Equals(vmwareUplinkPortTeamingPolicy.RollingOrder))) && ((this.FailureCriteria == null && vmwareUplinkPortTeamingPolicy.FailureCriteria == null) || (this.FailureCriteria != null && this.FailureCriteria.Equals(vmwareUplinkPortTeamingPolicy.FailureCriteria))) && ((this.UplinkPortOrder == null && vmwareUplinkPortTeamingPolicy.UplinkPortOrder == null) || (this.UplinkPortOrder != null && this.UplinkPortOrder.Equals(vmwareUplinkPortTeamingPolicy.UplinkPortOrder))));\n        }\n\n        public override bool Equals(object vmwareUplinkPortTeamingPolicy)\n        {\n            return Equals(vmwareUplinkPortTeamingPolicy as VmwareUplinkPortTeamingPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Policy + \"_\" + ReversePolicy + \"_\" + NotifySwitches + \"_\" + RollingOrder + \"_\" + FailureCriteria + \"_\" + UplinkPortOrder).GetHashCode();\n        }\n    }\n\n    public class VMwareVspanPort : DynamicData, IEquatable<VMwareVspanPort>\n    {\n        public string[] PortKey { get; set; }\n\n        public string[] UplinkPortName { get; set; }\n\n        public string[] WildcardPortConnecteeType { get; set; }\n\n        public int[] Vlans { get; set; }\n\n        public string[] IpAddress { get; set; }\n\n        public bool Equals(VMwareVspanPort vMwareVspanPort)\n        {\n            return (vMwareVspanPort != null && ((this.PortKey == null && vMwareVspanPort.PortKey == null) || (this.PortKey != null && vMwareVspanPort.PortKey != null && Enumerable.SequenceEqual(this.PortKey, vMwareVspanPort.PortKey))) && ((this.UplinkPortName == null && vMwareVspanPort.UplinkPortName == null) || (this.UplinkPortName != null && vMwareVspanPort.UplinkPortName != null && Enumerable.SequenceEqual(this.UplinkPortName, vMwareVspanPort.UplinkPortName))) && ((this.WildcardPortConnecteeType == null && vMwareVspanPort.WildcardPortConnecteeType == null) || (this.WildcardPortConnecteeType != null && vMwareVspanPort.WildcardPortConnecteeType != null && Enumerable.SequenceEqual(this.WildcardPortConnecteeType, vMwareVspanPort.WildcardPortConnecteeType))) && ((this.Vlans == null && vMwareVspanPort.Vlans == null) || (this.Vlans != null && vMwareVspanPort.Vlans != null && Enumerable.SequenceEqual(this.Vlans, vMwareVspanPort.Vlans))) && ((this.IpAddress == null && vMwareVspanPort.IpAddress == null) || (this.IpAddress != null && vMwareVspanPort.IpAddress != null && Enumerable.SequenceEqual(this.IpAddress, vMwareVspanPort.IpAddress))));\n        }\n\n        public override bool Equals(object vMwareVspanPort)\n        {\n            return Equals(vMwareVspanPort as VMwareVspanPort);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey + \"_\" + UplinkPortName + \"_\" + WildcardPortConnecteeType + \"_\" + Vlans + \"_\" + IpAddress).GetHashCode();\n        }\n    }\n\n    public class VMwareVspanSession : DynamicData, IEquatable<VMwareVspanSession>\n    {\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public VMwareVspanPort SourcePortTransmitted { get; set; }\n\n        public VMwareVspanPort SourcePortReceived { get; set; }\n\n        public VMwareVspanPort DestinationPort { get; set; }\n\n        public int? EncapsulationVlanId { get; set; }\n\n        public bool StripOriginalVlan { get; set; }\n\n        public int? MirroredPacketLength { get; set; }\n\n        public bool NormalTrafficAllowed { get; set; }\n\n        public string SessionType { get; set; }\n\n        public int? SamplingRate { get; set; }\n\n        public string EncapType { get; set; }\n\n        public int? ErspanId { get; set; }\n\n        public int? ErspanCOS { get; set; }\n\n        public bool? ErspanGraNanosec { get; set; }\n\n        public string Netstack { get; set; }\n\n        public bool Equals(VMwareVspanSession vMwareVspanSession)\n        {\n            return (vMwareVspanSession != null && this.Key == vMwareVspanSession.Key && this.Name == vMwareVspanSession.Name && this.Description == vMwareVspanSession.Description && this.Enabled == vMwareVspanSession.Enabled && ((this.SourcePortTransmitted == null && vMwareVspanSession.SourcePortTransmitted == null) || (this.SourcePortTransmitted != null && this.SourcePortTransmitted.Equals(vMwareVspanSession.SourcePortTransmitted))) && ((this.SourcePortReceived == null && vMwareVspanSession.SourcePortReceived == null) || (this.SourcePortReceived != null && this.SourcePortReceived.Equals(vMwareVspanSession.SourcePortReceived))) && ((this.DestinationPort == null && vMwareVspanSession.DestinationPort == null) || (this.DestinationPort != null && this.DestinationPort.Equals(vMwareVspanSession.DestinationPort))) && ((this.EncapsulationVlanId == null && vMwareVspanSession.EncapsulationVlanId == null) || (this.EncapsulationVlanId != null && this.EncapsulationVlanId.Equals(vMwareVspanSession.EncapsulationVlanId))) && this.StripOriginalVlan == vMwareVspanSession.StripOriginalVlan && ((this.MirroredPacketLength == null && vMwareVspanSession.MirroredPacketLength == null) || (this.MirroredPacketLength != null && this.MirroredPacketLength.Equals(vMwareVspanSession.MirroredPacketLength))) && this.NormalTrafficAllowed == vMwareVspanSession.NormalTrafficAllowed && this.SessionType == vMwareVspanSession.SessionType && ((this.SamplingRate == null && vMwareVspanSession.SamplingRate == null) || (this.SamplingRate != null && this.SamplingRate.Equals(vMwareVspanSession.SamplingRate))) && this.EncapType == vMwareVspanSession.EncapType && ((this.ErspanId == null && vMwareVspanSession.ErspanId == null) || (this.ErspanId != null && this.ErspanId.Equals(vMwareVspanSession.ErspanId))) && ((this.ErspanCOS == null && vMwareVspanSession.ErspanCOS == null) || (this.ErspanCOS != null && this.ErspanCOS.Equals(vMwareVspanSession.ErspanCOS))) && ((this.ErspanGraNanosec == null && vMwareVspanSession.ErspanGraNanosec == null) || (this.ErspanGraNanosec != null && this.ErspanGraNanosec.Equals(vMwareVspanSession.ErspanGraNanosec))) && this.Netstack == vMwareVspanSession.Netstack);\n        }\n\n        public override bool Equals(object vMwareVspanSession)\n        {\n            return Equals(vMwareVspanSession as VMwareVspanSession);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Name + \"_\" + Description + \"_\" + Enabled + \"_\" + SourcePortTransmitted + \"_\" + SourcePortReceived + \"_\" + DestinationPort + \"_\" + EncapsulationVlanId + \"_\" + StripOriginalVlan + \"_\" + MirroredPacketLength + \"_\" + NormalTrafficAllowed + \"_\" + SessionType + \"_\" + SamplingRate + \"_\" + EncapType + \"_\" + ErspanId + \"_\" + ErspanCOS + \"_\" + ErspanGraNanosec + \"_\" + Netstack).GetHashCode();\n        }\n    }\n\n    public class VmWwnAssignedEvent : VmEvent, IEquatable<VmWwnAssignedEvent>\n    {\n        public long[] NodeWwns { get; set; }\n\n        public long[] PortWwns { get; set; }\n\n        public bool Equals(VmWwnAssignedEvent vmWwnAssignedEvent)\n        {\n            return (vmWwnAssignedEvent != null && ((this.NodeWwns == null && vmWwnAssignedEvent.NodeWwns == null) || (this.NodeWwns != null && vmWwnAssignedEvent.NodeWwns != null && Enumerable.SequenceEqual(this.NodeWwns, vmWwnAssignedEvent.NodeWwns))) && ((this.PortWwns == null && vmWwnAssignedEvent.PortWwns == null) || (this.PortWwns != null && vmWwnAssignedEvent.PortWwns != null && Enumerable.SequenceEqual(this.PortWwns, vmWwnAssignedEvent.PortWwns))));\n        }\n\n        public override bool Equals(object vmWwnAssignedEvent)\n        {\n            return Equals(vmWwnAssignedEvent as VmWwnAssignedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NodeWwns + \"_\" + PortWwns).GetHashCode();\n        }\n    }\n\n    public class VmWwnChangedEvent : VmEvent, IEquatable<VmWwnChangedEvent>\n    {\n        public long[] OldNodeWwns { get; set; }\n\n        public long[] OldPortWwns { get; set; }\n\n        public long[] NewNodeWwns { get; set; }\n\n        public long[] NewPortWwns { get; set; }\n\n        public bool Equals(VmWwnChangedEvent vmWwnChangedEvent)\n        {\n            return (vmWwnChangedEvent != null && ((this.OldNodeWwns == null && vmWwnChangedEvent.OldNodeWwns == null) || (this.OldNodeWwns != null && vmWwnChangedEvent.OldNodeWwns != null && Enumerable.SequenceEqual(this.OldNodeWwns, vmWwnChangedEvent.OldNodeWwns))) && ((this.OldPortWwns == null && vmWwnChangedEvent.OldPortWwns == null) || (this.OldPortWwns != null && vmWwnChangedEvent.OldPortWwns != null && Enumerable.SequenceEqual(this.OldPortWwns, vmWwnChangedEvent.OldPortWwns))) && ((this.NewNodeWwns == null && vmWwnChangedEvent.NewNodeWwns == null) || (this.NewNodeWwns != null && vmWwnChangedEvent.NewNodeWwns != null && Enumerable.SequenceEqual(this.NewNodeWwns, vmWwnChangedEvent.NewNodeWwns))) && ((this.NewPortWwns == null && vmWwnChangedEvent.NewPortWwns == null) || (this.NewPortWwns != null && vmWwnChangedEvent.NewPortWwns != null && Enumerable.SequenceEqual(this.NewPortWwns, vmWwnChangedEvent.NewPortWwns))));\n        }\n\n        public override bool Equals(object vmWwnChangedEvent)\n        {\n            return Equals(vmWwnChangedEvent as VmWwnChangedEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OldNodeWwns + \"_\" + OldPortWwns + \"_\" + NewNodeWwns + \"_\" + NewPortWwns).GetHashCode();\n        }\n    }\n\n    public class VmWwnConflict : InvalidVmConfig, IEquatable<VmWwnConflict>\n    {\n        public ManagedObjectReference Vm { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public string Name { get; set; }\n\n        public long? Wwn { get; set; }\n\n        public VmWwnConflict_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VmWwnConflict vmWwnConflict)\n        {\n            return (vmWwnConflict != null && ((this.Vm == null && vmWwnConflict.Vm == null) || (this.Vm != null && this.Vm.Equals(vmWwnConflict.Vm))) && ((this.Host == null && vmWwnConflict.Host == null) || (this.Host != null && this.Host.Equals(vmWwnConflict.Host))) && this.Name == vmWwnConflict.Name && ((this.Wwn == null && vmWwnConflict.Wwn == null) || (this.Wwn != null && this.Wwn.Equals(vmWwnConflict.Wwn))) && ((this.LinkedView == null && vmWwnConflict.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vmWwnConflict.LinkedView))));\n        }\n\n        public override bool Equals(object vmWwnConflict)\n        {\n            return Equals(vmWwnConflict as VmWwnConflict);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Host + \"_\" + Name + \"_\" + Wwn + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VmWwnConflict_LinkedView : IEquatable<VmWwnConflict_LinkedView>\n    {\n        public VirtualMachine Vm { get; set; }\n\n        public HostSystem Host { get; set; }\n\n        public bool Equals(VmWwnConflict_LinkedView vmWwnConflict_LinkedView)\n        {\n            return (vmWwnConflict_LinkedView != null && ((this.Vm == null && vmWwnConflict_LinkedView.Vm == null) || (this.Vm != null && this.Vm.Equals(vmWwnConflict_LinkedView.Vm))) && ((this.Host == null && vmWwnConflict_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(vmWwnConflict_LinkedView.Host))));\n        }\n\n        public override bool Equals(object vmWwnConflict_LinkedView)\n        {\n            return Equals(vmWwnConflict_LinkedView as VmWwnConflict_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vm + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class VmWwnConflictEvent : VmEvent, IEquatable<VmWwnConflictEvent>\n    {\n        public VmEventArgument[] ConflictedVms { get; set; }\n\n        public HostEventArgument[] ConflictedHosts { get; set; }\n\n        public long Wwn { get; set; }\n\n        public bool Equals(VmWwnConflictEvent vmWwnConflictEvent)\n        {\n            return (vmWwnConflictEvent != null && ((this.ConflictedVms == null && vmWwnConflictEvent.ConflictedVms == null) || (this.ConflictedVms != null && vmWwnConflictEvent.ConflictedVms != null && Enumerable.SequenceEqual(this.ConflictedVms, vmWwnConflictEvent.ConflictedVms))) && ((this.ConflictedHosts == null && vmWwnConflictEvent.ConflictedHosts == null) || (this.ConflictedHosts != null && vmWwnConflictEvent.ConflictedHosts != null && Enumerable.SequenceEqual(this.ConflictedHosts, vmWwnConflictEvent.ConflictedHosts))) && this.Wwn == vmWwnConflictEvent.Wwn);\n        }\n\n        public override bool Equals(object vmWwnConflictEvent)\n        {\n            return Equals(vmWwnConflictEvent as VmWwnConflictEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ConflictedVms + \"_\" + ConflictedHosts + \"_\" + Wwn).GetHashCode();\n        }\n    }\n\n    public class VnicPortArgument : DynamicData, IEquatable<VnicPortArgument>\n    {\n        public string Vnic { get; set; }\n\n        public DistributedVirtualSwitchPortConnection Port { get; set; }\n\n        public bool Equals(VnicPortArgument vnicPortArgument)\n        {\n            return (vnicPortArgument != null && this.Vnic == vnicPortArgument.Vnic && ((this.Port == null && vnicPortArgument.Port == null) || (this.Port != null && this.Port.Equals(vnicPortArgument.Port))));\n        }\n\n        public override bool Equals(object vnicPortArgument)\n        {\n            return Equals(vnicPortArgument as VnicPortArgument);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Vnic + \"_\" + Port).GetHashCode();\n        }\n    }\n\n    public class VolumeEditorError : CustomizationFault, IEquatable<VolumeEditorError>\n    {\n        public bool Equals(VolumeEditorError volumeEditorError)\n        {\n            return (volumeEditorError != null && base.Equals(volumeEditorError));\n        }\n\n        public override bool Equals(object volumeEditorError)\n        {\n            return Equals(volumeEditorError as VolumeEditorError);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VramLimitLicense : NotEnoughLicenses, IEquatable<VramLimitLicense>\n    {\n        public int Limit { get; set; }\n\n        public bool Equals(VramLimitLicense vramLimitLicense)\n        {\n            return (vramLimitLicense != null && this.Limit == vramLimitLicense.Limit);\n        }\n\n        public override bool Equals(object vramLimitLicense)\n        {\n            return Equals(vramLimitLicense as VramLimitLicense);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Limit).GetHashCode();\n        }\n    }\n\n    public class VsanClusterConfigInfo : DynamicData, IEquatable<VsanClusterConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public VsanClusterConfigInfoHostDefaultInfo DefaultConfig { get; set; }\n\n        public bool Equals(VsanClusterConfigInfo vsanClusterConfigInfo)\n        {\n            return (vsanClusterConfigInfo != null && ((this.Enabled == null && vsanClusterConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(vsanClusterConfigInfo.Enabled))) && ((this.DefaultConfig == null && vsanClusterConfigInfo.DefaultConfig == null) || (this.DefaultConfig != null && this.DefaultConfig.Equals(vsanClusterConfigInfo.DefaultConfig))));\n        }\n\n        public override bool Equals(object vsanClusterConfigInfo)\n        {\n            return Equals(vsanClusterConfigInfo as VsanClusterConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + DefaultConfig).GetHashCode();\n        }\n    }\n\n    public class VsanClusterConfigInfoHostDefaultInfo : DynamicData, IEquatable<VsanClusterConfigInfoHostDefaultInfo>\n    {\n        public string Uuid { get; set; }\n\n        public bool? AutoClaimStorage { get; set; }\n\n        public bool? ChecksumEnabled { get; set; }\n\n        public bool Equals(VsanClusterConfigInfoHostDefaultInfo vsanClusterConfigInfoHostDefaultInfo)\n        {\n            return (vsanClusterConfigInfoHostDefaultInfo != null && this.Uuid == vsanClusterConfigInfoHostDefaultInfo.Uuid && ((this.AutoClaimStorage == null && vsanClusterConfigInfoHostDefaultInfo.AutoClaimStorage == null) || (this.AutoClaimStorage != null && this.AutoClaimStorage.Equals(vsanClusterConfigInfoHostDefaultInfo.AutoClaimStorage))) && ((this.ChecksumEnabled == null && vsanClusterConfigInfoHostDefaultInfo.ChecksumEnabled == null) || (this.ChecksumEnabled != null && this.ChecksumEnabled.Equals(vsanClusterConfigInfoHostDefaultInfo.ChecksumEnabled))));\n        }\n\n        public override bool Equals(object vsanClusterConfigInfoHostDefaultInfo)\n        {\n            return Equals(vsanClusterConfigInfoHostDefaultInfo as VsanClusterConfigInfoHostDefaultInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + AutoClaimStorage + \"_\" + ChecksumEnabled).GetHashCode();\n        }\n    }\n\n    public class VsanClusterUuidMismatch : CannotMoveVsanEnabledHost, IEquatable<VsanClusterUuidMismatch>\n    {\n        public string HostClusterUuid { get; set; }\n\n        public string DestinationClusterUuid { get; set; }\n\n        public bool Equals(VsanClusterUuidMismatch vsanClusterUuidMismatch)\n        {\n            return (vsanClusterUuidMismatch != null && this.HostClusterUuid == vsanClusterUuidMismatch.HostClusterUuid && this.DestinationClusterUuid == vsanClusterUuidMismatch.DestinationClusterUuid);\n        }\n\n        public override bool Equals(object vsanClusterUuidMismatch)\n        {\n            return Equals(vsanClusterUuidMismatch as VsanClusterUuidMismatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostClusterUuid + \"_\" + DestinationClusterUuid).GetHashCode();\n        }\n    }\n\n    public class VsanDiskFault : VsanFault, IEquatable<VsanDiskFault>\n    {\n        public string Device { get; set; }\n\n        public bool Equals(VsanDiskFault vsanDiskFault)\n        {\n            return (vsanDiskFault != null && this.Device == vsanDiskFault.Device);\n        }\n\n        public override bool Equals(object vsanDiskFault)\n        {\n            return Equals(vsanDiskFault as VsanDiskFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device).GetHashCode();\n        }\n    }\n\n    public class VsanFault : VimFault, IEquatable<VsanFault>\n    {\n        public bool Equals(VsanFault vsanFault)\n        {\n            return (vsanFault != null && base.Equals(vsanFault));\n        }\n\n        public override bool Equals(object vsanFault)\n        {\n            return Equals(vsanFault as VsanFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VsanHostClusterStatus : DynamicData, IEquatable<VsanHostClusterStatus>\n    {\n        public string Uuid { get; set; }\n\n        public string NodeUuid { get; set; }\n\n        public string Health { get; set; }\n\n        public VsanHostClusterStatusState NodeState { get; set; }\n\n        public string[] MemberUuid { get; set; }\n\n        public bool Equals(VsanHostClusterStatus vsanHostClusterStatus)\n        {\n            return (vsanHostClusterStatus != null && this.Uuid == vsanHostClusterStatus.Uuid && this.NodeUuid == vsanHostClusterStatus.NodeUuid && this.Health == vsanHostClusterStatus.Health && ((this.NodeState == null && vsanHostClusterStatus.NodeState == null) || (this.NodeState != null && this.NodeState.Equals(vsanHostClusterStatus.NodeState))) && ((this.MemberUuid == null && vsanHostClusterStatus.MemberUuid == null) || (this.MemberUuid != null && vsanHostClusterStatus.MemberUuid != null && Enumerable.SequenceEqual(this.MemberUuid, vsanHostClusterStatus.MemberUuid))));\n        }\n\n        public override bool Equals(object vsanHostClusterStatus)\n        {\n            return Equals(vsanHostClusterStatus as VsanHostClusterStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + NodeUuid + \"_\" + Health + \"_\" + NodeState + \"_\" + MemberUuid).GetHashCode();\n        }\n    }\n\n    public class VsanHostClusterStatusState : DynamicData, IEquatable<VsanHostClusterStatusState>\n    {\n        public string State { get; set; }\n\n        public VsanHostClusterStatusStateCompletionEstimate Completion { get; set; }\n\n        public bool Equals(VsanHostClusterStatusState vsanHostClusterStatusState)\n        {\n            return (vsanHostClusterStatusState != null && this.State == vsanHostClusterStatusState.State && ((this.Completion == null && vsanHostClusterStatusState.Completion == null) || (this.Completion != null && this.Completion.Equals(vsanHostClusterStatusState.Completion))));\n        }\n\n        public override bool Equals(object vsanHostClusterStatusState)\n        {\n            return Equals(vsanHostClusterStatusState as VsanHostClusterStatusState);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + Completion).GetHashCode();\n        }\n    }\n\n    public class VsanHostClusterStatusStateCompletionEstimate : DynamicData, IEquatable<VsanHostClusterStatusStateCompletionEstimate>\n    {\n        public DateTime? CompleteTime { get; set; }\n\n        public int? PercentComplete { get; set; }\n\n        public bool Equals(VsanHostClusterStatusStateCompletionEstimate vsanHostClusterStatusStateCompletionEstimate)\n        {\n            return (vsanHostClusterStatusStateCompletionEstimate != null && ((this.CompleteTime == null && vsanHostClusterStatusStateCompletionEstimate.CompleteTime == null) || (this.CompleteTime != null && this.CompleteTime.Equals(vsanHostClusterStatusStateCompletionEstimate.CompleteTime))) && ((this.PercentComplete == null && vsanHostClusterStatusStateCompletionEstimate.PercentComplete == null) || (this.PercentComplete != null && this.PercentComplete.Equals(vsanHostClusterStatusStateCompletionEstimate.PercentComplete))));\n        }\n\n        public override bool Equals(object vsanHostClusterStatusStateCompletionEstimate)\n        {\n            return Equals(vsanHostClusterStatusStateCompletionEstimate as VsanHostClusterStatusStateCompletionEstimate);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CompleteTime + \"_\" + PercentComplete).GetHashCode();\n        }\n    }\n\n    public class VsanHostConfigInfo : DynamicData, IEquatable<VsanHostConfigInfo>\n    {\n        public bool? Enabled { get; set; }\n\n        public ManagedObjectReference HostSystem { get; set; }\n\n        public VsanHostConfigInfoClusterInfo ClusterInfo { get; set; }\n\n        public VsanHostConfigInfoStorageInfo StorageInfo { get; set; }\n\n        public VsanHostConfigInfoNetworkInfo NetworkInfo { get; set; }\n\n        public VsanHostFaultDomainInfo FaultDomainInfo { get; set; }\n\n        public VsanHostConfigInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanHostConfigInfo vsanHostConfigInfo)\n        {\n            return (vsanHostConfigInfo != null && ((this.Enabled == null && vsanHostConfigInfo.Enabled == null) || (this.Enabled != null && this.Enabled.Equals(vsanHostConfigInfo.Enabled))) && ((this.HostSystem == null && vsanHostConfigInfo.HostSystem == null) || (this.HostSystem != null && this.HostSystem.Equals(vsanHostConfigInfo.HostSystem))) && ((this.ClusterInfo == null && vsanHostConfigInfo.ClusterInfo == null) || (this.ClusterInfo != null && this.ClusterInfo.Equals(vsanHostConfigInfo.ClusterInfo))) && ((this.StorageInfo == null && vsanHostConfigInfo.StorageInfo == null) || (this.StorageInfo != null && this.StorageInfo.Equals(vsanHostConfigInfo.StorageInfo))) && ((this.NetworkInfo == null && vsanHostConfigInfo.NetworkInfo == null) || (this.NetworkInfo != null && this.NetworkInfo.Equals(vsanHostConfigInfo.NetworkInfo))) && ((this.FaultDomainInfo == null && vsanHostConfigInfo.FaultDomainInfo == null) || (this.FaultDomainInfo != null && this.FaultDomainInfo.Equals(vsanHostConfigInfo.FaultDomainInfo))) && ((this.LinkedView == null && vsanHostConfigInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanHostConfigInfo.LinkedView))));\n        }\n\n        public override bool Equals(object vsanHostConfigInfo)\n        {\n            return Equals(vsanHostConfigInfo as VsanHostConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + HostSystem + \"_\" + ClusterInfo + \"_\" + StorageInfo + \"_\" + NetworkInfo + \"_\" + FaultDomainInfo + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanHostConfigInfo_LinkedView : IEquatable<VsanHostConfigInfo_LinkedView>\n    {\n        public HostSystem HostSystem { get; set; }\n\n        public bool Equals(VsanHostConfigInfo_LinkedView vsanHostConfigInfo_LinkedView)\n        {\n            return (vsanHostConfigInfo_LinkedView != null && ((this.HostSystem == null && vsanHostConfigInfo_LinkedView.HostSystem == null) || (this.HostSystem != null && this.HostSystem.Equals(vsanHostConfigInfo_LinkedView.HostSystem))));\n        }\n\n        public override bool Equals(object vsanHostConfigInfo_LinkedView)\n        {\n            return Equals(vsanHostConfigInfo_LinkedView as VsanHostConfigInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostSystem).GetHashCode();\n        }\n    }\n\n    public class VsanHostConfigInfoClusterInfo : DynamicData, IEquatable<VsanHostConfigInfoClusterInfo>\n    {\n        public string Uuid { get; set; }\n\n        public string NodeUuid { get; set; }\n\n        public bool Equals(VsanHostConfigInfoClusterInfo vsanHostConfigInfoClusterInfo)\n        {\n            return (vsanHostConfigInfoClusterInfo != null && this.Uuid == vsanHostConfigInfoClusterInfo.Uuid && this.NodeUuid == vsanHostConfigInfoClusterInfo.NodeUuid);\n        }\n\n        public override bool Equals(object vsanHostConfigInfoClusterInfo)\n        {\n            return Equals(vsanHostConfigInfoClusterInfo as VsanHostConfigInfoClusterInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + NodeUuid).GetHashCode();\n        }\n    }\n\n    public class VsanHostConfigInfoNetworkInfo : DynamicData, IEquatable<VsanHostConfigInfoNetworkInfo>\n    {\n        public VsanHostConfigInfoNetworkInfoPortConfig[] Port { get; set; }\n\n        public bool Equals(VsanHostConfigInfoNetworkInfo vsanHostConfigInfoNetworkInfo)\n        {\n            return (vsanHostConfigInfoNetworkInfo != null && ((this.Port == null && vsanHostConfigInfoNetworkInfo.Port == null) || (this.Port != null && vsanHostConfigInfoNetworkInfo.Port != null && Enumerable.SequenceEqual(this.Port, vsanHostConfigInfoNetworkInfo.Port))));\n        }\n\n        public override bool Equals(object vsanHostConfigInfoNetworkInfo)\n        {\n            return Equals(vsanHostConfigInfoNetworkInfo as VsanHostConfigInfoNetworkInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Port).GetHashCode();\n        }\n    }\n\n    public class VsanHostConfigInfoNetworkInfoPortConfig : DynamicData, IEquatable<VsanHostConfigInfoNetworkInfoPortConfig>\n    {\n        public VsanHostIpConfig IpConfig { get; set; }\n\n        public string Device { get; set; }\n\n        public bool Equals(VsanHostConfigInfoNetworkInfoPortConfig vsanHostConfigInfoNetworkInfoPortConfig)\n        {\n            return (vsanHostConfigInfoNetworkInfoPortConfig != null && ((this.IpConfig == null && vsanHostConfigInfoNetworkInfoPortConfig.IpConfig == null) || (this.IpConfig != null && this.IpConfig.Equals(vsanHostConfigInfoNetworkInfoPortConfig.IpConfig))) && this.Device == vsanHostConfigInfoNetworkInfoPortConfig.Device);\n        }\n\n        public override bool Equals(object vsanHostConfigInfoNetworkInfoPortConfig)\n        {\n            return Equals(vsanHostConfigInfoNetworkInfoPortConfig as VsanHostConfigInfoNetworkInfoPortConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpConfig + \"_\" + Device).GetHashCode();\n        }\n    }\n\n    public class VsanHostConfigInfoStorageInfo : DynamicData, IEquatable<VsanHostConfigInfoStorageInfo>\n    {\n        public bool? AutoClaimStorage { get; set; }\n\n        public VsanHostDiskMapping[] DiskMapping { get; set; }\n\n        public VsanHostDiskMapInfo[] DiskMapInfo { get; set; }\n\n        public bool? ChecksumEnabled { get; set; }\n\n        public bool Equals(VsanHostConfigInfoStorageInfo vsanHostConfigInfoStorageInfo)\n        {\n            return (vsanHostConfigInfoStorageInfo != null && ((this.AutoClaimStorage == null && vsanHostConfigInfoStorageInfo.AutoClaimStorage == null) || (this.AutoClaimStorage != null && this.AutoClaimStorage.Equals(vsanHostConfigInfoStorageInfo.AutoClaimStorage))) && ((this.DiskMapping == null && vsanHostConfigInfoStorageInfo.DiskMapping == null) || (this.DiskMapping != null && vsanHostConfigInfoStorageInfo.DiskMapping != null && Enumerable.SequenceEqual(this.DiskMapping, vsanHostConfigInfoStorageInfo.DiskMapping))) && ((this.DiskMapInfo == null && vsanHostConfigInfoStorageInfo.DiskMapInfo == null) || (this.DiskMapInfo != null && vsanHostConfigInfoStorageInfo.DiskMapInfo != null && Enumerable.SequenceEqual(this.DiskMapInfo, vsanHostConfigInfoStorageInfo.DiskMapInfo))) && ((this.ChecksumEnabled == null && vsanHostConfigInfoStorageInfo.ChecksumEnabled == null) || (this.ChecksumEnabled != null && this.ChecksumEnabled.Equals(vsanHostConfigInfoStorageInfo.ChecksumEnabled))));\n        }\n\n        public override bool Equals(object vsanHostConfigInfoStorageInfo)\n        {\n            return Equals(vsanHostConfigInfoStorageInfo as VsanHostConfigInfoStorageInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AutoClaimStorage + \"_\" + DiskMapping + \"_\" + DiskMapInfo + \"_\" + ChecksumEnabled).GetHashCode();\n        }\n    }\n\n    public class VsanHostDecommissionMode : DynamicData, IEquatable<VsanHostDecommissionMode>\n    {\n        public string ObjectAction { get; set; }\n\n        public bool Equals(VsanHostDecommissionMode vsanHostDecommissionMode)\n        {\n            return (vsanHostDecommissionMode != null && this.ObjectAction == vsanHostDecommissionMode.ObjectAction);\n        }\n\n        public override bool Equals(object vsanHostDecommissionMode)\n        {\n            return Equals(vsanHostDecommissionMode as VsanHostDecommissionMode);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ObjectAction).GetHashCode();\n        }\n    }\n\n    public class VsanHostDiskMapInfo : DynamicData, IEquatable<VsanHostDiskMapInfo>\n    {\n        public VsanHostDiskMapping Mapping { get; set; }\n\n        public bool Mounted { get; set; }\n\n        public bool Equals(VsanHostDiskMapInfo vsanHostDiskMapInfo)\n        {\n            return (vsanHostDiskMapInfo != null && ((this.Mapping == null && vsanHostDiskMapInfo.Mapping == null) || (this.Mapping != null && this.Mapping.Equals(vsanHostDiskMapInfo.Mapping))) && this.Mounted == vsanHostDiskMapInfo.Mounted);\n        }\n\n        public override bool Equals(object vsanHostDiskMapInfo)\n        {\n            return Equals(vsanHostDiskMapInfo as VsanHostDiskMapInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Mapping + \"_\" + Mounted).GetHashCode();\n        }\n    }\n\n    public class VsanHostDiskMapping : DynamicData, IEquatable<VsanHostDiskMapping>\n    {\n        public HostScsiDisk Ssd { get; set; }\n\n        public HostScsiDisk[] NonSsd { get; set; }\n\n        public bool Equals(VsanHostDiskMapping vsanHostDiskMapping)\n        {\n            return (vsanHostDiskMapping != null && ((this.Ssd == null && vsanHostDiskMapping.Ssd == null) || (this.Ssd != null && this.Ssd.Equals(vsanHostDiskMapping.Ssd))) && ((this.NonSsd == null && vsanHostDiskMapping.NonSsd == null) || (this.NonSsd != null && vsanHostDiskMapping.NonSsd != null && Enumerable.SequenceEqual(this.NonSsd, vsanHostDiskMapping.NonSsd))));\n        }\n\n        public override bool Equals(object vsanHostDiskMapping)\n        {\n            return Equals(vsanHostDiskMapping as VsanHostDiskMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Ssd + \"_\" + NonSsd).GetHashCode();\n        }\n    }\n\n    public class VsanHostDiskMapResult : DynamicData, IEquatable<VsanHostDiskMapResult>\n    {\n        public VsanHostDiskMapping Mapping { get; set; }\n\n        public VsanHostDiskResult[] DiskResult { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public bool Equals(VsanHostDiskMapResult vsanHostDiskMapResult)\n        {\n            return (vsanHostDiskMapResult != null && ((this.Mapping == null && vsanHostDiskMapResult.Mapping == null) || (this.Mapping != null && this.Mapping.Equals(vsanHostDiskMapResult.Mapping))) && ((this.DiskResult == null && vsanHostDiskMapResult.DiskResult == null) || (this.DiskResult != null && vsanHostDiskMapResult.DiskResult != null && Enumerable.SequenceEqual(this.DiskResult, vsanHostDiskMapResult.DiskResult))) && ((this.Error == null && vsanHostDiskMapResult.Error == null) || (this.Error != null && this.Error.Equals(vsanHostDiskMapResult.Error))));\n        }\n\n        public override bool Equals(object vsanHostDiskMapResult)\n        {\n            return Equals(vsanHostDiskMapResult as VsanHostDiskMapResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Mapping + \"_\" + DiskResult + \"_\" + Error).GetHashCode();\n        }\n    }\n\n    public class VsanHostDiskResult : DynamicData, IEquatable<VsanHostDiskResult>\n    {\n        public HostScsiDisk Disk { get; set; }\n\n        public string State { get; set; }\n\n        public string VsanUuid { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public bool? Degraded { get; set; }\n\n        public bool Equals(VsanHostDiskResult vsanHostDiskResult)\n        {\n            return (vsanHostDiskResult != null && ((this.Disk == null && vsanHostDiskResult.Disk == null) || (this.Disk != null && this.Disk.Equals(vsanHostDiskResult.Disk))) && this.State == vsanHostDiskResult.State && this.VsanUuid == vsanHostDiskResult.VsanUuid && ((this.Error == null && vsanHostDiskResult.Error == null) || (this.Error != null && this.Error.Equals(vsanHostDiskResult.Error))) && ((this.Degraded == null && vsanHostDiskResult.Degraded == null) || (this.Degraded != null && this.Degraded.Equals(vsanHostDiskResult.Degraded))));\n        }\n\n        public override bool Equals(object vsanHostDiskResult)\n        {\n            return Equals(vsanHostDiskResult as VsanHostDiskResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disk + \"_\" + State + \"_\" + VsanUuid + \"_\" + Error + \"_\" + Degraded).GetHashCode();\n        }\n    }\n\n    public class VsanHostFaultDomainInfo : DynamicData, IEquatable<VsanHostFaultDomainInfo>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(VsanHostFaultDomainInfo vsanHostFaultDomainInfo)\n        {\n            return (vsanHostFaultDomainInfo != null && this.Name == vsanHostFaultDomainInfo.Name);\n        }\n\n        public override bool Equals(object vsanHostFaultDomainInfo)\n        {\n            return Equals(vsanHostFaultDomainInfo as VsanHostFaultDomainInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class VsanHostIpConfig : DynamicData, IEquatable<VsanHostIpConfig>\n    {\n        public string UpstreamIpAddress { get; set; }\n\n        public string DownstreamIpAddress { get; set; }\n\n        public bool Equals(VsanHostIpConfig vsanHostIpConfig)\n        {\n            return (vsanHostIpConfig != null && this.UpstreamIpAddress == vsanHostIpConfig.UpstreamIpAddress && this.DownstreamIpAddress == vsanHostIpConfig.DownstreamIpAddress);\n        }\n\n        public override bool Equals(object vsanHostIpConfig)\n        {\n            return Equals(vsanHostIpConfig as VsanHostIpConfig);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UpstreamIpAddress + \"_\" + DownstreamIpAddress).GetHashCode();\n        }\n    }\n\n    public class VsanHostMembershipInfo : DynamicData, IEquatable<VsanHostMembershipInfo>\n    {\n        public string NodeUuid { get; set; }\n\n        public string Hostname { get; set; }\n\n        public bool Equals(VsanHostMembershipInfo vsanHostMembershipInfo)\n        {\n            return (vsanHostMembershipInfo != null && this.NodeUuid == vsanHostMembershipInfo.NodeUuid && this.Hostname == vsanHostMembershipInfo.Hostname);\n        }\n\n        public override bool Equals(object vsanHostMembershipInfo)\n        {\n            return Equals(vsanHostMembershipInfo as VsanHostMembershipInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NodeUuid + \"_\" + Hostname).GetHashCode();\n        }\n    }\n\n    public class VsanHostRuntimeInfo : DynamicData, IEquatable<VsanHostRuntimeInfo>\n    {\n        public VsanHostMembershipInfo[] MembershipList { get; set; }\n\n        public VsanHostRuntimeInfoDiskIssue[] DiskIssues { get; set; }\n\n        public int? AccessGenNo { get; set; }\n\n        public bool Equals(VsanHostRuntimeInfo vsanHostRuntimeInfo)\n        {\n            return (vsanHostRuntimeInfo != null && ((this.MembershipList == null && vsanHostRuntimeInfo.MembershipList == null) || (this.MembershipList != null && vsanHostRuntimeInfo.MembershipList != null && Enumerable.SequenceEqual(this.MembershipList, vsanHostRuntimeInfo.MembershipList))) && ((this.DiskIssues == null && vsanHostRuntimeInfo.DiskIssues == null) || (this.DiskIssues != null && vsanHostRuntimeInfo.DiskIssues != null && Enumerable.SequenceEqual(this.DiskIssues, vsanHostRuntimeInfo.DiskIssues))) && ((this.AccessGenNo == null && vsanHostRuntimeInfo.AccessGenNo == null) || (this.AccessGenNo != null && this.AccessGenNo.Equals(vsanHostRuntimeInfo.AccessGenNo))));\n        }\n\n        public override bool Equals(object vsanHostRuntimeInfo)\n        {\n            return Equals(vsanHostRuntimeInfo as VsanHostRuntimeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MembershipList + \"_\" + DiskIssues + \"_\" + AccessGenNo).GetHashCode();\n        }\n    }\n\n    public class VsanHostRuntimeInfoDiskIssue : DynamicData, IEquatable<VsanHostRuntimeInfoDiskIssue>\n    {\n        public string DiskId { get; set; }\n\n        public string Issue { get; set; }\n\n        public bool Equals(VsanHostRuntimeInfoDiskIssue vsanHostRuntimeInfoDiskIssue)\n        {\n            return (vsanHostRuntimeInfoDiskIssue != null && this.DiskId == vsanHostRuntimeInfoDiskIssue.DiskId && this.Issue == vsanHostRuntimeInfoDiskIssue.Issue);\n        }\n\n        public override bool Equals(object vsanHostRuntimeInfoDiskIssue)\n        {\n            return Equals(vsanHostRuntimeInfoDiskIssue as VsanHostRuntimeInfoDiskIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DiskId + \"_\" + Issue).GetHashCode();\n        }\n    }\n\n    public class VsanHostVsanDiskInfo : DynamicData, IEquatable<VsanHostVsanDiskInfo>\n    {\n        public string VsanUuid { get; set; }\n\n        public int FormatVersion { get; set; }\n\n        public bool Equals(VsanHostVsanDiskInfo vsanHostVsanDiskInfo)\n        {\n            return (vsanHostVsanDiskInfo != null && this.VsanUuid == vsanHostVsanDiskInfo.VsanUuid && this.FormatVersion == vsanHostVsanDiskInfo.FormatVersion);\n        }\n\n        public override bool Equals(object vsanHostVsanDiskInfo)\n        {\n            return Equals(vsanHostVsanDiskInfo as VsanHostVsanDiskInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VsanUuid + \"_\" + FormatVersion).GetHashCode();\n        }\n    }\n\n    public class VsanIncompatibleDiskMapping : VsanDiskFault, IEquatable<VsanIncompatibleDiskMapping>\n    {\n        public bool Equals(VsanIncompatibleDiskMapping vsanIncompatibleDiskMapping)\n        {\n            return (vsanIncompatibleDiskMapping != null && base.Equals(vsanIncompatibleDiskMapping));\n        }\n\n        public override bool Equals(object vsanIncompatibleDiskMapping)\n        {\n            return Equals(vsanIncompatibleDiskMapping as VsanIncompatibleDiskMapping);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VsanNewPolicyBatch : DynamicData, IEquatable<VsanNewPolicyBatch>\n    {\n        public long[] Size { get; set; }\n\n        public string Policy { get; set; }\n\n        public bool Equals(VsanNewPolicyBatch vsanNewPolicyBatch)\n        {\n            return (vsanNewPolicyBatch != null && ((this.Size == null && vsanNewPolicyBatch.Size == null) || (this.Size != null && vsanNewPolicyBatch.Size != null && Enumerable.SequenceEqual(this.Size, vsanNewPolicyBatch.Size))) && this.Policy == vsanNewPolicyBatch.Policy);\n        }\n\n        public override bool Equals(object vsanNewPolicyBatch)\n        {\n            return Equals(vsanNewPolicyBatch as VsanNewPolicyBatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Size + \"_\" + Policy).GetHashCode();\n        }\n    }\n\n    public class VsanPolicyChangeBatch : DynamicData, IEquatable<VsanPolicyChangeBatch>\n    {\n        public string[] Uuid { get; set; }\n\n        public string Policy { get; set; }\n\n        public bool Equals(VsanPolicyChangeBatch vsanPolicyChangeBatch)\n        {\n            return (vsanPolicyChangeBatch != null && ((this.Uuid == null && vsanPolicyChangeBatch.Uuid == null) || (this.Uuid != null && vsanPolicyChangeBatch.Uuid != null && Enumerable.SequenceEqual(this.Uuid, vsanPolicyChangeBatch.Uuid))) && this.Policy == vsanPolicyChangeBatch.Policy);\n        }\n\n        public override bool Equals(object vsanPolicyChangeBatch)\n        {\n            return Equals(vsanPolicyChangeBatch as VsanPolicyChangeBatch);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + Policy).GetHashCode();\n        }\n    }\n\n    public class VsanPolicyCost : DynamicData, IEquatable<VsanPolicyCost>\n    {\n        public long? ChangeDataSize { get; set; }\n\n        public long? CurrentDataSize { get; set; }\n\n        public long? TempDataSize { get; set; }\n\n        public long? CopyDataSize { get; set; }\n\n        public long? ChangeFlashReadCacheSize { get; set; }\n\n        public long? CurrentFlashReadCacheSize { get; set; }\n\n        public float? CurrentDiskSpaceToAddressSpaceRatio { get; set; }\n\n        public float? DiskSpaceToAddressSpaceRatio { get; set; }\n\n        public bool Equals(VsanPolicyCost vsanPolicyCost)\n        {\n            return (vsanPolicyCost != null && ((this.ChangeDataSize == null && vsanPolicyCost.ChangeDataSize == null) || (this.ChangeDataSize != null && this.ChangeDataSize.Equals(vsanPolicyCost.ChangeDataSize))) && ((this.CurrentDataSize == null && vsanPolicyCost.CurrentDataSize == null) || (this.CurrentDataSize != null && this.CurrentDataSize.Equals(vsanPolicyCost.CurrentDataSize))) && ((this.TempDataSize == null && vsanPolicyCost.TempDataSize == null) || (this.TempDataSize != null && this.TempDataSize.Equals(vsanPolicyCost.TempDataSize))) && ((this.CopyDataSize == null && vsanPolicyCost.CopyDataSize == null) || (this.CopyDataSize != null && this.CopyDataSize.Equals(vsanPolicyCost.CopyDataSize))) && ((this.ChangeFlashReadCacheSize == null && vsanPolicyCost.ChangeFlashReadCacheSize == null) || (this.ChangeFlashReadCacheSize != null && this.ChangeFlashReadCacheSize.Equals(vsanPolicyCost.ChangeFlashReadCacheSize))) && ((this.CurrentFlashReadCacheSize == null && vsanPolicyCost.CurrentFlashReadCacheSize == null) || (this.CurrentFlashReadCacheSize != null && this.CurrentFlashReadCacheSize.Equals(vsanPolicyCost.CurrentFlashReadCacheSize))) && ((this.CurrentDiskSpaceToAddressSpaceRatio == null && vsanPolicyCost.CurrentDiskSpaceToAddressSpaceRatio == null) || (this.CurrentDiskSpaceToAddressSpaceRatio != null && this.CurrentDiskSpaceToAddressSpaceRatio.Equals(vsanPolicyCost.CurrentDiskSpaceToAddressSpaceRatio))) && ((this.DiskSpaceToAddressSpaceRatio == null && vsanPolicyCost.DiskSpaceToAddressSpaceRatio == null) || (this.DiskSpaceToAddressSpaceRatio != null && this.DiskSpaceToAddressSpaceRatio.Equals(vsanPolicyCost.DiskSpaceToAddressSpaceRatio))));\n        }\n\n        public override bool Equals(object vsanPolicyCost)\n        {\n            return Equals(vsanPolicyCost as VsanPolicyCost);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChangeDataSize + \"_\" + CurrentDataSize + \"_\" + TempDataSize + \"_\" + CopyDataSize + \"_\" + ChangeFlashReadCacheSize + \"_\" + CurrentFlashReadCacheSize + \"_\" + CurrentDiskSpaceToAddressSpaceRatio + \"_\" + DiskSpaceToAddressSpaceRatio).GetHashCode();\n        }\n    }\n\n    public class VsanPolicySatisfiability : DynamicData, IEquatable<VsanPolicySatisfiability>\n    {\n        public string Uuid { get; set; }\n\n        public bool IsSatisfiable { get; set; }\n\n        public LocalizableMessage Reason { get; set; }\n\n        public VsanPolicyCost Cost { get; set; }\n\n        public bool Equals(VsanPolicySatisfiability vsanPolicySatisfiability)\n        {\n            return (vsanPolicySatisfiability != null && this.Uuid == vsanPolicySatisfiability.Uuid && this.IsSatisfiable == vsanPolicySatisfiability.IsSatisfiable && ((this.Reason == null && vsanPolicySatisfiability.Reason == null) || (this.Reason != null && this.Reason.Equals(vsanPolicySatisfiability.Reason))) && ((this.Cost == null && vsanPolicySatisfiability.Cost == null) || (this.Cost != null && this.Cost.Equals(vsanPolicySatisfiability.Cost))));\n        }\n\n        public override bool Equals(object vsanPolicySatisfiability)\n        {\n            return Equals(vsanPolicySatisfiability as VsanPolicySatisfiability);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuid + \"_\" + IsSatisfiable + \"_\" + Reason + \"_\" + Cost).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystem : ViewBase, IEquatable<VsanUpgradeSystem>\n    {\n        public VsanUpgradeSystemPreflightCheckResult PerformVsanUpgradePreflightCheck(ManagedObjectReference cluster, bool? downgradeFormat)\n        {\n            return default(VsanUpgradeSystemPreflightCheckResult);\n        }\n\n        public VsanUpgradeSystemUpgradeStatus QueryVsanUpgradeStatus(ManagedObjectReference cluster)\n        {\n            return default(VsanUpgradeSystemUpgradeStatus);\n        }\n\n        public ManagedObjectReference PerformVsanUpgrade_Task(ManagedObjectReference cluster, bool? performObjectUpgrade, bool? downgradeFormat, bool? allowReducedRedundancy, ManagedObjectReference[] excludeHosts)\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public VsanUpgradeSystemUpgradeStatus PerformVsanUpgrade(ManagedObjectReference cluster, bool? performObjectUpgrade, bool? downgradeFormat, bool? allowReducedRedundancy, ManagedObjectReference[] excludeHosts)\n        {\n            return default(VsanUpgradeSystemUpgradeStatus);\n        }\n\n        public bool Equals(VsanUpgradeSystem vsanUpgradeSystem)\n        {\n            return (vsanUpgradeSystem != null && base.Equals(vsanUpgradeSystem));\n        }\n\n        public override bool Equals(object vsanUpgradeSystem)\n        {\n            return Equals(vsanUpgradeSystem as VsanUpgradeSystem);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemAPIBrokenIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemAPIBrokenIssue>\n    {\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public VsanUpgradeSystemAPIBrokenIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemAPIBrokenIssue vsanUpgradeSystemAPIBrokenIssue)\n        {\n            return (vsanUpgradeSystemAPIBrokenIssue != null && ((this.Hosts == null && vsanUpgradeSystemAPIBrokenIssue.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemAPIBrokenIssue.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemAPIBrokenIssue.Hosts))) && ((this.LinkedView == null && vsanUpgradeSystemAPIBrokenIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemAPIBrokenIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemAPIBrokenIssue)\n        {\n            return Equals(vsanUpgradeSystemAPIBrokenIssue as VsanUpgradeSystemAPIBrokenIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemAPIBrokenIssue_LinkedView : IEquatable<VsanUpgradeSystemAPIBrokenIssue_LinkedView>\n    {\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(VsanUpgradeSystemAPIBrokenIssue_LinkedView vsanUpgradeSystemAPIBrokenIssue_LinkedView)\n        {\n            return (vsanUpgradeSystemAPIBrokenIssue_LinkedView != null && ((this.Hosts == null && vsanUpgradeSystemAPIBrokenIssue_LinkedView.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemAPIBrokenIssue_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemAPIBrokenIssue_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemAPIBrokenIssue_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemAPIBrokenIssue_LinkedView as VsanUpgradeSystemAPIBrokenIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemAutoClaimEnabledOnHostsIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemAutoClaimEnabledOnHostsIssue>\n    {\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public VsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemAutoClaimEnabledOnHostsIssue vsanUpgradeSystemAutoClaimEnabledOnHostsIssue)\n        {\n            return (vsanUpgradeSystemAutoClaimEnabledOnHostsIssue != null && ((this.Hosts == null && vsanUpgradeSystemAutoClaimEnabledOnHostsIssue.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemAutoClaimEnabledOnHostsIssue.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemAutoClaimEnabledOnHostsIssue.Hosts))) && ((this.LinkedView == null && vsanUpgradeSystemAutoClaimEnabledOnHostsIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemAutoClaimEnabledOnHostsIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemAutoClaimEnabledOnHostsIssue)\n        {\n            return Equals(vsanUpgradeSystemAutoClaimEnabledOnHostsIssue as VsanUpgradeSystemAutoClaimEnabledOnHostsIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView : IEquatable<VsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView>\n    {\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(VsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView)\n        {\n            return (vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView != null && ((this.Hosts == null && vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView as VsanUpgradeSystemAutoClaimEnabledOnHostsIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemHostsDisconnectedIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemHostsDisconnectedIssue>\n    {\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public VsanUpgradeSystemHostsDisconnectedIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemHostsDisconnectedIssue vsanUpgradeSystemHostsDisconnectedIssue)\n        {\n            return (vsanUpgradeSystemHostsDisconnectedIssue != null && ((this.Hosts == null && vsanUpgradeSystemHostsDisconnectedIssue.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemHostsDisconnectedIssue.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemHostsDisconnectedIssue.Hosts))) && ((this.LinkedView == null && vsanUpgradeSystemHostsDisconnectedIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemHostsDisconnectedIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemHostsDisconnectedIssue)\n        {\n            return Equals(vsanUpgradeSystemHostsDisconnectedIssue as VsanUpgradeSystemHostsDisconnectedIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemHostsDisconnectedIssue_LinkedView : IEquatable<VsanUpgradeSystemHostsDisconnectedIssue_LinkedView>\n    {\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(VsanUpgradeSystemHostsDisconnectedIssue_LinkedView vsanUpgradeSystemHostsDisconnectedIssue_LinkedView)\n        {\n            return (vsanUpgradeSystemHostsDisconnectedIssue_LinkedView != null && ((this.Hosts == null && vsanUpgradeSystemHostsDisconnectedIssue_LinkedView.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemHostsDisconnectedIssue_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemHostsDisconnectedIssue_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemHostsDisconnectedIssue_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemHostsDisconnectedIssue_LinkedView as VsanUpgradeSystemHostsDisconnectedIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemMissingHostsInClusterIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemMissingHostsInClusterIssue>\n    {\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public VsanUpgradeSystemMissingHostsInClusterIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemMissingHostsInClusterIssue vsanUpgradeSystemMissingHostsInClusterIssue)\n        {\n            return (vsanUpgradeSystemMissingHostsInClusterIssue != null && ((this.Hosts == null && vsanUpgradeSystemMissingHostsInClusterIssue.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemMissingHostsInClusterIssue.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemMissingHostsInClusterIssue.Hosts))) && ((this.LinkedView == null && vsanUpgradeSystemMissingHostsInClusterIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemMissingHostsInClusterIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemMissingHostsInClusterIssue)\n        {\n            return Equals(vsanUpgradeSystemMissingHostsInClusterIssue as VsanUpgradeSystemMissingHostsInClusterIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemMissingHostsInClusterIssue_LinkedView : IEquatable<VsanUpgradeSystemMissingHostsInClusterIssue_LinkedView>\n    {\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(VsanUpgradeSystemMissingHostsInClusterIssue_LinkedView vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView)\n        {\n            return (vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView != null && ((this.Hosts == null && vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemMissingHostsInClusterIssue_LinkedView as VsanUpgradeSystemMissingHostsInClusterIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemNetworkPartitionInfo : DynamicData, IEquatable<VsanUpgradeSystemNetworkPartitionInfo>\n    {\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public VsanUpgradeSystemNetworkPartitionInfo_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemNetworkPartitionInfo vsanUpgradeSystemNetworkPartitionInfo)\n        {\n            return (vsanUpgradeSystemNetworkPartitionInfo != null && ((this.Hosts == null && vsanUpgradeSystemNetworkPartitionInfo.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemNetworkPartitionInfo.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemNetworkPartitionInfo.Hosts))) && ((this.LinkedView == null && vsanUpgradeSystemNetworkPartitionInfo.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemNetworkPartitionInfo.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemNetworkPartitionInfo)\n        {\n            return Equals(vsanUpgradeSystemNetworkPartitionInfo as VsanUpgradeSystemNetworkPartitionInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemNetworkPartitionInfo_LinkedView : IEquatable<VsanUpgradeSystemNetworkPartitionInfo_LinkedView>\n    {\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(VsanUpgradeSystemNetworkPartitionInfo_LinkedView vsanUpgradeSystemNetworkPartitionInfo_LinkedView)\n        {\n            return (vsanUpgradeSystemNetworkPartitionInfo_LinkedView != null && ((this.Hosts == null && vsanUpgradeSystemNetworkPartitionInfo_LinkedView.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemNetworkPartitionInfo_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemNetworkPartitionInfo_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemNetworkPartitionInfo_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemNetworkPartitionInfo_LinkedView as VsanUpgradeSystemNetworkPartitionInfo_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemNetworkPartitionIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemNetworkPartitionIssue>\n    {\n        public VsanUpgradeSystemNetworkPartitionInfo[] Partitions { get; set; }\n\n        public bool Equals(VsanUpgradeSystemNetworkPartitionIssue vsanUpgradeSystemNetworkPartitionIssue)\n        {\n            return (vsanUpgradeSystemNetworkPartitionIssue != null && ((this.Partitions == null && vsanUpgradeSystemNetworkPartitionIssue.Partitions == null) || (this.Partitions != null && vsanUpgradeSystemNetworkPartitionIssue.Partitions != null && Enumerable.SequenceEqual(this.Partitions, vsanUpgradeSystemNetworkPartitionIssue.Partitions))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemNetworkPartitionIssue)\n        {\n            return Equals(vsanUpgradeSystemNetworkPartitionIssue as VsanUpgradeSystemNetworkPartitionIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Partitions).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemNotEnoughFreeCapacityIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemNotEnoughFreeCapacityIssue>\n    {\n        public bool ReducedRedundancyUpgradePossible { get; set; }\n\n        public bool Equals(VsanUpgradeSystemNotEnoughFreeCapacityIssue vsanUpgradeSystemNotEnoughFreeCapacityIssue)\n        {\n            return (vsanUpgradeSystemNotEnoughFreeCapacityIssue != null && this.ReducedRedundancyUpgradePossible == vsanUpgradeSystemNotEnoughFreeCapacityIssue.ReducedRedundancyUpgradePossible);\n        }\n\n        public override bool Equals(object vsanUpgradeSystemNotEnoughFreeCapacityIssue)\n        {\n            return Equals(vsanUpgradeSystemNotEnoughFreeCapacityIssue as VsanUpgradeSystemNotEnoughFreeCapacityIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ReducedRedundancyUpgradePossible).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemPreflightCheckIssue : DynamicData, IEquatable<VsanUpgradeSystemPreflightCheckIssue>\n    {\n        public string Msg { get; set; }\n\n        public bool Equals(VsanUpgradeSystemPreflightCheckIssue vsanUpgradeSystemPreflightCheckIssue)\n        {\n            return (vsanUpgradeSystemPreflightCheckIssue != null && this.Msg == vsanUpgradeSystemPreflightCheckIssue.Msg);\n        }\n\n        public override bool Equals(object vsanUpgradeSystemPreflightCheckIssue)\n        {\n            return Equals(vsanUpgradeSystemPreflightCheckIssue as VsanUpgradeSystemPreflightCheckIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Msg).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemPreflightCheckResult : DynamicData, IEquatable<VsanUpgradeSystemPreflightCheckResult>\n    {\n        public VsanUpgradeSystemPreflightCheckIssue[] Issues { get; set; }\n\n        public VsanHostDiskMapping DiskMappingToRestore { get; set; }\n\n        public bool Equals(VsanUpgradeSystemPreflightCheckResult vsanUpgradeSystemPreflightCheckResult)\n        {\n            return (vsanUpgradeSystemPreflightCheckResult != null && ((this.Issues == null && vsanUpgradeSystemPreflightCheckResult.Issues == null) || (this.Issues != null && vsanUpgradeSystemPreflightCheckResult.Issues != null && Enumerable.SequenceEqual(this.Issues, vsanUpgradeSystemPreflightCheckResult.Issues))) && ((this.DiskMappingToRestore == null && vsanUpgradeSystemPreflightCheckResult.DiskMappingToRestore == null) || (this.DiskMappingToRestore != null && this.DiskMappingToRestore.Equals(vsanUpgradeSystemPreflightCheckResult.DiskMappingToRestore))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemPreflightCheckResult)\n        {\n            return Equals(vsanUpgradeSystemPreflightCheckResult as VsanUpgradeSystemPreflightCheckResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Issues + \"_\" + DiskMappingToRestore).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemRogueHostsInClusterIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemRogueHostsInClusterIssue>\n    {\n        public string[] Uuids { get; set; }\n\n        public bool Equals(VsanUpgradeSystemRogueHostsInClusterIssue vsanUpgradeSystemRogueHostsInClusterIssue)\n        {\n            return (vsanUpgradeSystemRogueHostsInClusterIssue != null && ((this.Uuids == null && vsanUpgradeSystemRogueHostsInClusterIssue.Uuids == null) || (this.Uuids != null && vsanUpgradeSystemRogueHostsInClusterIssue.Uuids != null && Enumerable.SequenceEqual(this.Uuids, vsanUpgradeSystemRogueHostsInClusterIssue.Uuids))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemRogueHostsInClusterIssue)\n        {\n            return Equals(vsanUpgradeSystemRogueHostsInClusterIssue as VsanUpgradeSystemRogueHostsInClusterIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuids).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeHistoryDiskGroupOp : VsanUpgradeSystemUpgradeHistoryItem, IEquatable<VsanUpgradeSystemUpgradeHistoryDiskGroupOp>\n    {\n        public string Operation { get; set; }\n\n        public VsanHostDiskMapping DiskMapping { get; set; }\n\n        public new VsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemUpgradeHistoryDiskGroupOp vsanUpgradeSystemUpgradeHistoryDiskGroupOp)\n        {\n            return (vsanUpgradeSystemUpgradeHistoryDiskGroupOp != null && this.Operation == vsanUpgradeSystemUpgradeHistoryDiskGroupOp.Operation && ((this.DiskMapping == null && vsanUpgradeSystemUpgradeHistoryDiskGroupOp.DiskMapping == null) || (this.DiskMapping != null && this.DiskMapping.Equals(vsanUpgradeSystemUpgradeHistoryDiskGroupOp.DiskMapping))) && ((this.LinkedView == null && vsanUpgradeSystemUpgradeHistoryDiskGroupOp.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemUpgradeHistoryDiskGroupOp.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeHistoryDiskGroupOp)\n        {\n            return Equals(vsanUpgradeSystemUpgradeHistoryDiskGroupOp as VsanUpgradeSystemUpgradeHistoryDiskGroupOp);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Operation + \"_\" + DiskMapping + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView : VsanUpgradeSystemUpgradeHistoryItem_LinkedView, IEquatable<VsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView>\n    {\n        public bool Equals(VsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView vsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView)\n        {\n            return (vsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView != null && base.Equals(vsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView as VsanUpgradeSystemUpgradeHistoryDiskGroupOp_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeHistoryItem : DynamicData, IEquatable<VsanUpgradeSystemUpgradeHistoryItem>\n    {\n        public VsanUpgradeSystemUpgradeHistoryItem_LinkedView LinkedView { get; set; }\n\n        public DateTime Timestamp { get; set; }\n\n        public ManagedObjectReference Host { get; set; }\n\n        public string Message { get; set; }\n\n        public ManagedObjectReference Task { get; set; }\n\n        public bool Equals(VsanUpgradeSystemUpgradeHistoryItem vsanUpgradeSystemUpgradeHistoryItem)\n        {\n            return (vsanUpgradeSystemUpgradeHistoryItem != null && ((this.LinkedView == null && vsanUpgradeSystemUpgradeHistoryItem.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemUpgradeHistoryItem.LinkedView))) && this.Timestamp == vsanUpgradeSystemUpgradeHistoryItem.Timestamp && ((this.Host == null && vsanUpgradeSystemUpgradeHistoryItem.Host == null) || (this.Host != null && this.Host.Equals(vsanUpgradeSystemUpgradeHistoryItem.Host))) && this.Message == vsanUpgradeSystemUpgradeHistoryItem.Message && ((this.Task == null && vsanUpgradeSystemUpgradeHistoryItem.Task == null) || (this.Task != null && this.Task.Equals(vsanUpgradeSystemUpgradeHistoryItem.Task))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeHistoryItem)\n        {\n            return Equals(vsanUpgradeSystemUpgradeHistoryItem as VsanUpgradeSystemUpgradeHistoryItem);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LinkedView + \"_\" + Timestamp + \"_\" + Host + \"_\" + Message + \"_\" + Task).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeHistoryItem_LinkedView : IEquatable<VsanUpgradeSystemUpgradeHistoryItem_LinkedView>\n    {\n        public HostSystem Host { get; set; }\n\n        public Task Task { get; set; }\n\n        public bool Equals(VsanUpgradeSystemUpgradeHistoryItem_LinkedView vsanUpgradeSystemUpgradeHistoryItem_LinkedView)\n        {\n            return (vsanUpgradeSystemUpgradeHistoryItem_LinkedView != null && ((this.Host == null && vsanUpgradeSystemUpgradeHistoryItem_LinkedView.Host == null) || (this.Host != null && this.Host.Equals(vsanUpgradeSystemUpgradeHistoryItem_LinkedView.Host))) && ((this.Task == null && vsanUpgradeSystemUpgradeHistoryItem_LinkedView.Task == null) || (this.Task != null && this.Task.Equals(vsanUpgradeSystemUpgradeHistoryItem_LinkedView.Task))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeHistoryItem_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemUpgradeHistoryItem_LinkedView as VsanUpgradeSystemUpgradeHistoryItem_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Task).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeHistoryPreflightFail : VsanUpgradeSystemUpgradeHistoryItem, IEquatable<VsanUpgradeSystemUpgradeHistoryPreflightFail>\n    {\n        public VsanUpgradeSystemPreflightCheckResult PreflightResult { get; set; }\n\n        public new VsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemUpgradeHistoryPreflightFail vsanUpgradeSystemUpgradeHistoryPreflightFail)\n        {\n            return (vsanUpgradeSystemUpgradeHistoryPreflightFail != null && ((this.PreflightResult == null && vsanUpgradeSystemUpgradeHistoryPreflightFail.PreflightResult == null) || (this.PreflightResult != null && this.PreflightResult.Equals(vsanUpgradeSystemUpgradeHistoryPreflightFail.PreflightResult))) && ((this.LinkedView == null && vsanUpgradeSystemUpgradeHistoryPreflightFail.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemUpgradeHistoryPreflightFail.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeHistoryPreflightFail)\n        {\n            return Equals(vsanUpgradeSystemUpgradeHistoryPreflightFail as VsanUpgradeSystemUpgradeHistoryPreflightFail);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PreflightResult + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView : VsanUpgradeSystemUpgradeHistoryItem_LinkedView, IEquatable<VsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView>\n    {\n        public bool Equals(VsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView vsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView)\n        {\n            return (vsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView != null && base.Equals(vsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView as VsanUpgradeSystemUpgradeHistoryPreflightFail_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemUpgradeStatus : DynamicData, IEquatable<VsanUpgradeSystemUpgradeStatus>\n    {\n        public bool InProgress { get; set; }\n\n        public VsanUpgradeSystemUpgradeHistoryItem[] History { get; set; }\n\n        public bool? Aborted { get; set; }\n\n        public bool? Completed { get; set; }\n\n        public int? Progress { get; set; }\n\n        public bool Equals(VsanUpgradeSystemUpgradeStatus vsanUpgradeSystemUpgradeStatus)\n        {\n            return (vsanUpgradeSystemUpgradeStatus != null && this.InProgress == vsanUpgradeSystemUpgradeStatus.InProgress && ((this.History == null && vsanUpgradeSystemUpgradeStatus.History == null) || (this.History != null && vsanUpgradeSystemUpgradeStatus.History != null && Enumerable.SequenceEqual(this.History, vsanUpgradeSystemUpgradeStatus.History))) && ((this.Aborted == null && vsanUpgradeSystemUpgradeStatus.Aborted == null) || (this.Aborted != null && this.Aborted.Equals(vsanUpgradeSystemUpgradeStatus.Aborted))) && ((this.Completed == null && vsanUpgradeSystemUpgradeStatus.Completed == null) || (this.Completed != null && this.Completed.Equals(vsanUpgradeSystemUpgradeStatus.Completed))) && ((this.Progress == null && vsanUpgradeSystemUpgradeStatus.Progress == null) || (this.Progress != null && this.Progress.Equals(vsanUpgradeSystemUpgradeStatus.Progress))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemUpgradeStatus)\n        {\n            return Equals(vsanUpgradeSystemUpgradeStatus as VsanUpgradeSystemUpgradeStatus);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InProgress + \"_\" + History + \"_\" + Aborted + \"_\" + Completed + \"_\" + Progress).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue>\n    {\n        public string[] Uuids { get; set; }\n\n        public bool Equals(VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue)\n        {\n            return (vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue != null && ((this.Uuids == null && vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue.Uuids == null) || (this.Uuids != null && vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue.Uuids != null && Enumerable.SequenceEqual(this.Uuids, vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue.Uuids))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue)\n        {\n            return Equals(vsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue as VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uuids).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemWrongEsxVersionIssue : VsanUpgradeSystemPreflightCheckIssue, IEquatable<VsanUpgradeSystemWrongEsxVersionIssue>\n    {\n        public ManagedObjectReference[] Hosts { get; set; }\n\n        public VsanUpgradeSystemWrongEsxVersionIssue_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VsanUpgradeSystemWrongEsxVersionIssue vsanUpgradeSystemWrongEsxVersionIssue)\n        {\n            return (vsanUpgradeSystemWrongEsxVersionIssue != null && ((this.Hosts == null && vsanUpgradeSystemWrongEsxVersionIssue.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemWrongEsxVersionIssue.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemWrongEsxVersionIssue.Hosts))) && ((this.LinkedView == null && vsanUpgradeSystemWrongEsxVersionIssue.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vsanUpgradeSystemWrongEsxVersionIssue.LinkedView))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemWrongEsxVersionIssue)\n        {\n            return Equals(vsanUpgradeSystemWrongEsxVersionIssue as VsanUpgradeSystemWrongEsxVersionIssue);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VsanUpgradeSystemWrongEsxVersionIssue_LinkedView : IEquatable<VsanUpgradeSystemWrongEsxVersionIssue_LinkedView>\n    {\n        public HostSystem[] Hosts { get; set; }\n\n        public bool Equals(VsanUpgradeSystemWrongEsxVersionIssue_LinkedView vsanUpgradeSystemWrongEsxVersionIssue_LinkedView)\n        {\n            return (vsanUpgradeSystemWrongEsxVersionIssue_LinkedView != null && ((this.Hosts == null && vsanUpgradeSystemWrongEsxVersionIssue_LinkedView.Hosts == null) || (this.Hosts != null && vsanUpgradeSystemWrongEsxVersionIssue_LinkedView.Hosts != null && Enumerable.SequenceEqual(this.Hosts, vsanUpgradeSystemWrongEsxVersionIssue_LinkedView.Hosts))));\n        }\n\n        public override bool Equals(object vsanUpgradeSystemWrongEsxVersionIssue_LinkedView)\n        {\n            return Equals(vsanUpgradeSystemWrongEsxVersionIssue_LinkedView as VsanUpgradeSystemWrongEsxVersionIssue_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Hosts).GetHashCode();\n        }\n    }\n\n    public class VslmCloneSpec : VslmMigrateSpec, IEquatable<VslmCloneSpec>\n    {\n        public string Name { get; set; }\n\n        public bool? KeepAfterDeleteVm { get; set; }\n\n        public bool Equals(VslmCloneSpec vslmCloneSpec)\n        {\n            return (vslmCloneSpec != null && this.Name == vslmCloneSpec.Name && ((this.KeepAfterDeleteVm == null && vslmCloneSpec.KeepAfterDeleteVm == null) || (this.KeepAfterDeleteVm != null && this.KeepAfterDeleteVm.Equals(vslmCloneSpec.KeepAfterDeleteVm))));\n        }\n\n        public override bool Equals(object vslmCloneSpec)\n        {\n            return Equals(vslmCloneSpec as VslmCloneSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + KeepAfterDeleteVm).GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpec : DynamicData, IEquatable<VslmCreateSpec>\n    {\n        public string Name { get; set; }\n\n        public bool? KeepAfterDeleteVm { get; set; }\n\n        public VslmCreateSpecBackingSpec BackingSpec { get; set; }\n\n        public long CapacityInMB { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public bool Equals(VslmCreateSpec vslmCreateSpec)\n        {\n            return (vslmCreateSpec != null && this.Name == vslmCreateSpec.Name && ((this.KeepAfterDeleteVm == null && vslmCreateSpec.KeepAfterDeleteVm == null) || (this.KeepAfterDeleteVm != null && this.KeepAfterDeleteVm.Equals(vslmCreateSpec.KeepAfterDeleteVm))) && ((this.BackingSpec == null && vslmCreateSpec.BackingSpec == null) || (this.BackingSpec != null && this.BackingSpec.Equals(vslmCreateSpec.BackingSpec))) && this.CapacityInMB == vslmCreateSpec.CapacityInMB && ((this.Profile == null && vslmCreateSpec.Profile == null) || (this.Profile != null && vslmCreateSpec.Profile != null && Enumerable.SequenceEqual(this.Profile, vslmCreateSpec.Profile))));\n        }\n\n        public override bool Equals(object vslmCreateSpec)\n        {\n            return Equals(vslmCreateSpec as VslmCreateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + KeepAfterDeleteVm + \"_\" + BackingSpec + \"_\" + CapacityInMB + \"_\" + Profile).GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpecBackingSpec : DynamicData, IEquatable<VslmCreateSpecBackingSpec>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public string Path { get; set; }\n\n        public VslmCreateSpecBackingSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VslmCreateSpecBackingSpec vslmCreateSpecBackingSpec)\n        {\n            return (vslmCreateSpecBackingSpec != null && ((this.Datastore == null && vslmCreateSpecBackingSpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vslmCreateSpecBackingSpec.Datastore))) && this.Path == vslmCreateSpecBackingSpec.Path && ((this.LinkedView == null && vslmCreateSpecBackingSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vslmCreateSpecBackingSpec.LinkedView))));\n        }\n\n        public override bool Equals(object vslmCreateSpecBackingSpec)\n        {\n            return Equals(vslmCreateSpecBackingSpec as VslmCreateSpecBackingSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Path + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpecBackingSpec_LinkedView : IEquatable<VslmCreateSpecBackingSpec_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(VslmCreateSpecBackingSpec_LinkedView vslmCreateSpecBackingSpec_LinkedView)\n        {\n            return (vslmCreateSpecBackingSpec_LinkedView != null && ((this.Datastore == null && vslmCreateSpecBackingSpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vslmCreateSpecBackingSpec_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object vslmCreateSpecBackingSpec_LinkedView)\n        {\n            return Equals(vslmCreateSpecBackingSpec_LinkedView as VslmCreateSpecBackingSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpecDiskFileBackingSpec : VslmCreateSpecBackingSpec, IEquatable<VslmCreateSpecDiskFileBackingSpec>\n    {\n        public string ProvisioningType { get; set; }\n\n        public new VslmCreateSpecDiskFileBackingSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VslmCreateSpecDiskFileBackingSpec vslmCreateSpecDiskFileBackingSpec)\n        {\n            return (vslmCreateSpecDiskFileBackingSpec != null && this.ProvisioningType == vslmCreateSpecDiskFileBackingSpec.ProvisioningType && ((this.LinkedView == null && vslmCreateSpecDiskFileBackingSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vslmCreateSpecDiskFileBackingSpec.LinkedView))));\n        }\n\n        public override bool Equals(object vslmCreateSpecDiskFileBackingSpec)\n        {\n            return Equals(vslmCreateSpecDiskFileBackingSpec as VslmCreateSpecDiskFileBackingSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ProvisioningType + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpecDiskFileBackingSpec_LinkedView : VslmCreateSpecBackingSpec_LinkedView, IEquatable<VslmCreateSpecDiskFileBackingSpec_LinkedView>\n    {\n        public bool Equals(VslmCreateSpecDiskFileBackingSpec_LinkedView vslmCreateSpecDiskFileBackingSpec_LinkedView)\n        {\n            return (vslmCreateSpecDiskFileBackingSpec_LinkedView != null && base.Equals(vslmCreateSpecDiskFileBackingSpec_LinkedView));\n        }\n\n        public override bool Equals(object vslmCreateSpecDiskFileBackingSpec_LinkedView)\n        {\n            return Equals(vslmCreateSpecDiskFileBackingSpec_LinkedView as VslmCreateSpecDiskFileBackingSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpecRawDiskMappingBackingSpec : VslmCreateSpecBackingSpec, IEquatable<VslmCreateSpecRawDiskMappingBackingSpec>\n    {\n        public string LunUuid { get; set; }\n\n        public string CompatibilityMode { get; set; }\n\n        public new VslmCreateSpecRawDiskMappingBackingSpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VslmCreateSpecRawDiskMappingBackingSpec vslmCreateSpecRawDiskMappingBackingSpec)\n        {\n            return (vslmCreateSpecRawDiskMappingBackingSpec != null && this.LunUuid == vslmCreateSpecRawDiskMappingBackingSpec.LunUuid && this.CompatibilityMode == vslmCreateSpecRawDiskMappingBackingSpec.CompatibilityMode && ((this.LinkedView == null && vslmCreateSpecRawDiskMappingBackingSpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vslmCreateSpecRawDiskMappingBackingSpec.LinkedView))));\n        }\n\n        public override bool Equals(object vslmCreateSpecRawDiskMappingBackingSpec)\n        {\n            return Equals(vslmCreateSpecRawDiskMappingBackingSpec as VslmCreateSpecRawDiskMappingBackingSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (LunUuid + \"_\" + CompatibilityMode + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VslmCreateSpecRawDiskMappingBackingSpec_LinkedView : VslmCreateSpecBackingSpec_LinkedView, IEquatable<VslmCreateSpecRawDiskMappingBackingSpec_LinkedView>\n    {\n        public bool Equals(VslmCreateSpecRawDiskMappingBackingSpec_LinkedView vslmCreateSpecRawDiskMappingBackingSpec_LinkedView)\n        {\n            return (vslmCreateSpecRawDiskMappingBackingSpec_LinkedView != null && base.Equals(vslmCreateSpecRawDiskMappingBackingSpec_LinkedView));\n        }\n\n        public override bool Equals(object vslmCreateSpecRawDiskMappingBackingSpec_LinkedView)\n        {\n            return Equals(vslmCreateSpecRawDiskMappingBackingSpec_LinkedView as VslmCreateSpecRawDiskMappingBackingSpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class vslmInfrastructureObjectPolicy : DynamicData, IEquatable<vslmInfrastructureObjectPolicy>\n    {\n        public string Name { get; set; }\n\n        public string BackingObjectId { get; set; }\n\n        public string ProfileId { get; set; }\n\n        public LocalizedMethodFault Error { get; set; }\n\n        public bool Equals(vslmInfrastructureObjectPolicy vslmInfrastructureObjectPolicy)\n        {\n            return (vslmInfrastructureObjectPolicy != null && this.Name == vslmInfrastructureObjectPolicy.Name && this.BackingObjectId == vslmInfrastructureObjectPolicy.BackingObjectId && this.ProfileId == vslmInfrastructureObjectPolicy.ProfileId && ((this.Error == null && vslmInfrastructureObjectPolicy.Error == null) || (this.Error != null && this.Error.Equals(vslmInfrastructureObjectPolicy.Error))));\n        }\n\n        public override bool Equals(object vslmInfrastructureObjectPolicy)\n        {\n            return Equals(vslmInfrastructureObjectPolicy as vslmInfrastructureObjectPolicy);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + BackingObjectId + \"_\" + ProfileId + \"_\" + Error).GetHashCode();\n        }\n    }\n\n    public class vslmInfrastructureObjectPolicySpec : DynamicData, IEquatable<vslmInfrastructureObjectPolicySpec>\n    {\n        public ManagedObjectReference Datastore { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public vslmInfrastructureObjectPolicySpec_LinkedView LinkedView { get; set; }\n\n        public bool Equals(vslmInfrastructureObjectPolicySpec vslmInfrastructureObjectPolicySpec)\n        {\n            return (vslmInfrastructureObjectPolicySpec != null && ((this.Datastore == null && vslmInfrastructureObjectPolicySpec.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vslmInfrastructureObjectPolicySpec.Datastore))) && ((this.Profile == null && vslmInfrastructureObjectPolicySpec.Profile == null) || (this.Profile != null && vslmInfrastructureObjectPolicySpec.Profile != null && Enumerable.SequenceEqual(this.Profile, vslmInfrastructureObjectPolicySpec.Profile))) && ((this.LinkedView == null && vslmInfrastructureObjectPolicySpec.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vslmInfrastructureObjectPolicySpec.LinkedView))));\n        }\n\n        public override bool Equals(object vslmInfrastructureObjectPolicySpec)\n        {\n            return Equals(vslmInfrastructureObjectPolicySpec as vslmInfrastructureObjectPolicySpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore + \"_\" + Profile + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class vslmInfrastructureObjectPolicySpec_LinkedView : IEquatable<vslmInfrastructureObjectPolicySpec_LinkedView>\n    {\n        public Datastore Datastore { get; set; }\n\n        public bool Equals(vslmInfrastructureObjectPolicySpec_LinkedView vslmInfrastructureObjectPolicySpec_LinkedView)\n        {\n            return (vslmInfrastructureObjectPolicySpec_LinkedView != null && ((this.Datastore == null && vslmInfrastructureObjectPolicySpec_LinkedView.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(vslmInfrastructureObjectPolicySpec_LinkedView.Datastore))));\n        }\n\n        public override bool Equals(object vslmInfrastructureObjectPolicySpec_LinkedView)\n        {\n            return Equals(vslmInfrastructureObjectPolicySpec_LinkedView as vslmInfrastructureObjectPolicySpec_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Datastore).GetHashCode();\n        }\n    }\n\n    public class VslmMigrateSpec : DynamicData, IEquatable<VslmMigrateSpec>\n    {\n        public VslmCreateSpecBackingSpec BackingSpec { get; set; }\n\n        public VirtualMachineProfileSpec[] Profile { get; set; }\n\n        public bool? Consolidate { get; set; }\n\n        public bool Equals(VslmMigrateSpec vslmMigrateSpec)\n        {\n            return (vslmMigrateSpec != null && ((this.BackingSpec == null && vslmMigrateSpec.BackingSpec == null) || (this.BackingSpec != null && this.BackingSpec.Equals(vslmMigrateSpec.BackingSpec))) && ((this.Profile == null && vslmMigrateSpec.Profile == null) || (this.Profile != null && vslmMigrateSpec.Profile != null && Enumerable.SequenceEqual(this.Profile, vslmMigrateSpec.Profile))) && ((this.Consolidate == null && vslmMigrateSpec.Consolidate == null) || (this.Consolidate != null && this.Consolidate.Equals(vslmMigrateSpec.Consolidate))));\n        }\n\n        public override bool Equals(object vslmMigrateSpec)\n        {\n            return Equals(vslmMigrateSpec as VslmMigrateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BackingSpec + \"_\" + Profile + \"_\" + Consolidate).GetHashCode();\n        }\n    }\n\n    public class VslmRelocateSpec : VslmMigrateSpec, IEquatable<VslmRelocateSpec>\n    {\n        public bool Equals(VslmRelocateSpec vslmRelocateSpec)\n        {\n            return (vslmRelocateSpec != null && base.Equals(vslmRelocateSpec));\n        }\n\n        public override bool Equals(object vslmRelocateSpec)\n        {\n            return Equals(vslmRelocateSpec as VslmRelocateSpec);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VslmTagEntry : DynamicData, IEquatable<VslmTagEntry>\n    {\n        public string TagName { get; set; }\n\n        public string ParentCategoryName { get; set; }\n\n        public bool Equals(VslmTagEntry vslmTagEntry)\n        {\n            return (vslmTagEntry != null && this.TagName == vslmTagEntry.TagName && this.ParentCategoryName == vslmTagEntry.ParentCategoryName);\n        }\n\n        public override bool Equals(object vslmTagEntry)\n        {\n            return Equals(vslmTagEntry as VslmTagEntry);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TagName + \"_\" + ParentCategoryName).GetHashCode();\n        }\n    }\n\n    public class VspanDestPortConflict : DvsFault, IEquatable<VspanDestPortConflict>\n    {\n        public string VspanSessionKey1 { get; set; }\n\n        public string VspanSessionKey2 { get; set; }\n\n        public string PortKey { get; set; }\n\n        public bool Equals(VspanDestPortConflict vspanDestPortConflict)\n        {\n            return (vspanDestPortConflict != null && this.VspanSessionKey1 == vspanDestPortConflict.VspanSessionKey1 && this.VspanSessionKey2 == vspanDestPortConflict.VspanSessionKey2 && this.PortKey == vspanDestPortConflict.PortKey);\n        }\n\n        public override bool Equals(object vspanDestPortConflict)\n        {\n            return Equals(vspanDestPortConflict as VspanDestPortConflict);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSessionKey1 + \"_\" + VspanSessionKey2 + \"_\" + PortKey).GetHashCode();\n        }\n    }\n\n    public class VspanPortConflict : DvsFault, IEquatable<VspanPortConflict>\n    {\n        public string VspanSessionKey1 { get; set; }\n\n        public string VspanSessionKey2 { get; set; }\n\n        public string PortKey { get; set; }\n\n        public bool Equals(VspanPortConflict vspanPortConflict)\n        {\n            return (vspanPortConflict != null && this.VspanSessionKey1 == vspanPortConflict.VspanSessionKey1 && this.VspanSessionKey2 == vspanPortConflict.VspanSessionKey2 && this.PortKey == vspanPortConflict.PortKey);\n        }\n\n        public override bool Equals(object vspanPortConflict)\n        {\n            return Equals(vspanPortConflict as VspanPortConflict);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSessionKey1 + \"_\" + VspanSessionKey2 + \"_\" + PortKey).GetHashCode();\n        }\n    }\n\n    public class VspanPortgroupPromiscChangeFault : DvsFault, IEquatable<VspanPortgroupPromiscChangeFault>\n    {\n        public string PortgroupName { get; set; }\n\n        public bool Equals(VspanPortgroupPromiscChangeFault vspanPortgroupPromiscChangeFault)\n        {\n            return (vspanPortgroupPromiscChangeFault != null && this.PortgroupName == vspanPortgroupPromiscChangeFault.PortgroupName);\n        }\n\n        public override bool Equals(object vspanPortgroupPromiscChangeFault)\n        {\n            return Equals(vspanPortgroupPromiscChangeFault as VspanPortgroupPromiscChangeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortgroupName).GetHashCode();\n        }\n    }\n\n    public class VspanPortgroupTypeChangeFault : DvsFault, IEquatable<VspanPortgroupTypeChangeFault>\n    {\n        public string PortgroupName { get; set; }\n\n        public bool Equals(VspanPortgroupTypeChangeFault vspanPortgroupTypeChangeFault)\n        {\n            return (vspanPortgroupTypeChangeFault != null && this.PortgroupName == vspanPortgroupTypeChangeFault.PortgroupName);\n        }\n\n        public override bool Equals(object vspanPortgroupTypeChangeFault)\n        {\n            return Equals(vspanPortgroupTypeChangeFault as VspanPortgroupTypeChangeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortgroupName).GetHashCode();\n        }\n    }\n\n    public class VspanPortMoveFault : DvsFault, IEquatable<VspanPortMoveFault>\n    {\n        public string SrcPortgroupName { get; set; }\n\n        public string DestPortgroupName { get; set; }\n\n        public string PortKey { get; set; }\n\n        public bool Equals(VspanPortMoveFault vspanPortMoveFault)\n        {\n            return (vspanPortMoveFault != null && this.SrcPortgroupName == vspanPortMoveFault.SrcPortgroupName && this.DestPortgroupName == vspanPortMoveFault.DestPortgroupName && this.PortKey == vspanPortMoveFault.PortKey);\n        }\n\n        public override bool Equals(object vspanPortMoveFault)\n        {\n            return Equals(vspanPortMoveFault as VspanPortMoveFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SrcPortgroupName + \"_\" + DestPortgroupName + \"_\" + PortKey).GetHashCode();\n        }\n    }\n\n    public class VspanPortPromiscChangeFault : DvsFault, IEquatable<VspanPortPromiscChangeFault>\n    {\n        public string PortKey { get; set; }\n\n        public bool Equals(VspanPortPromiscChangeFault vspanPortPromiscChangeFault)\n        {\n            return (vspanPortPromiscChangeFault != null && this.PortKey == vspanPortPromiscChangeFault.PortKey);\n        }\n\n        public override bool Equals(object vspanPortPromiscChangeFault)\n        {\n            return Equals(vspanPortPromiscChangeFault as VspanPortPromiscChangeFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortKey).GetHashCode();\n        }\n    }\n\n    public class VspanPromiscuousPortNotSupported : DvsFault, IEquatable<VspanPromiscuousPortNotSupported>\n    {\n        public string VspanSessionKey { get; set; }\n\n        public string PortKey { get; set; }\n\n        public bool Equals(VspanPromiscuousPortNotSupported vspanPromiscuousPortNotSupported)\n        {\n            return (vspanPromiscuousPortNotSupported != null && this.VspanSessionKey == vspanPromiscuousPortNotSupported.VspanSessionKey && this.PortKey == vspanPromiscuousPortNotSupported.PortKey);\n        }\n\n        public override bool Equals(object vspanPromiscuousPortNotSupported)\n        {\n            return Equals(vspanPromiscuousPortNotSupported as VspanPromiscuousPortNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSessionKey + \"_\" + PortKey).GetHashCode();\n        }\n    }\n\n    public class VspanSameSessionPortConflict : DvsFault, IEquatable<VspanSameSessionPortConflict>\n    {\n        public string VspanSessionKey { get; set; }\n\n        public string PortKey { get; set; }\n\n        public bool Equals(VspanSameSessionPortConflict vspanSameSessionPortConflict)\n        {\n            return (vspanSameSessionPortConflict != null && this.VspanSessionKey == vspanSameSessionPortConflict.VspanSessionKey && this.PortKey == vspanSameSessionPortConflict.PortKey);\n        }\n\n        public override bool Equals(object vspanSameSessionPortConflict)\n        {\n            return Equals(vspanSameSessionPortConflict as VspanSameSessionPortConflict);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VspanSessionKey + \"_\" + PortKey).GetHashCode();\n        }\n    }\n\n    public class VStorageObject : DynamicData, IEquatable<VStorageObject>\n    {\n        public VStorageObjectConfigInfo Config { get; set; }\n\n        public bool Equals(VStorageObject vStorageObject)\n        {\n            return (vStorageObject != null && ((this.Config == null && vStorageObject.Config == null) || (this.Config != null && this.Config.Equals(vStorageObject.Config))));\n        }\n\n        public override bool Equals(object vStorageObject)\n        {\n            return Equals(vStorageObject as VStorageObject);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Config).GetHashCode();\n        }\n    }\n\n    public class VStorageObjectAssociations : DynamicData, IEquatable<VStorageObjectAssociations>\n    {\n        public ID Id { get; set; }\n\n        public VStorageObjectAssociationsVmDiskAssociations[] VmDiskAssociations { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(VStorageObjectAssociations vStorageObjectAssociations)\n        {\n            return (vStorageObjectAssociations != null && ((this.Id == null && vStorageObjectAssociations.Id == null) || (this.Id != null && this.Id.Equals(vStorageObjectAssociations.Id))) && ((this.VmDiskAssociations == null && vStorageObjectAssociations.VmDiskAssociations == null) || (this.VmDiskAssociations != null && vStorageObjectAssociations.VmDiskAssociations != null && Enumerable.SequenceEqual(this.VmDiskAssociations, vStorageObjectAssociations.VmDiskAssociations))) && ((this.Fault == null && vStorageObjectAssociations.Fault == null) || (this.Fault != null && this.Fault.Equals(vStorageObjectAssociations.Fault))));\n        }\n\n        public override bool Equals(object vStorageObjectAssociations)\n        {\n            return Equals(vStorageObjectAssociations as VStorageObjectAssociations);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + VmDiskAssociations + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class VStorageObjectAssociationsVmDiskAssociations : DynamicData, IEquatable<VStorageObjectAssociationsVmDiskAssociations>\n    {\n        public string VmId { get; set; }\n\n        public int DiskKey { get; set; }\n\n        public bool Equals(VStorageObjectAssociationsVmDiskAssociations vStorageObjectAssociationsVmDiskAssociations)\n        {\n            return (vStorageObjectAssociationsVmDiskAssociations != null && this.VmId == vStorageObjectAssociationsVmDiskAssociations.VmId && this.DiskKey == vStorageObjectAssociationsVmDiskAssociations.DiskKey);\n        }\n\n        public override bool Equals(object vStorageObjectAssociationsVmDiskAssociations)\n        {\n            return Equals(vStorageObjectAssociationsVmDiskAssociations as VStorageObjectAssociationsVmDiskAssociations);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmId + \"_\" + DiskKey).GetHashCode();\n        }\n    }\n\n    public class VStorageObjectConfigInfo : BaseConfigInfo, IEquatable<VStorageObjectConfigInfo>\n    {\n        public long CapacityInMB { get; set; }\n\n        public string[] ConsumptionType { get; set; }\n\n        public ID[] ConsumerId { get; set; }\n\n        public bool Equals(VStorageObjectConfigInfo vStorageObjectConfigInfo)\n        {\n            return (vStorageObjectConfigInfo != null && this.CapacityInMB == vStorageObjectConfigInfo.CapacityInMB && ((this.ConsumptionType == null && vStorageObjectConfigInfo.ConsumptionType == null) || (this.ConsumptionType != null && vStorageObjectConfigInfo.ConsumptionType != null && Enumerable.SequenceEqual(this.ConsumptionType, vStorageObjectConfigInfo.ConsumptionType))) && ((this.ConsumerId == null && vStorageObjectConfigInfo.ConsumerId == null) || (this.ConsumerId != null && vStorageObjectConfigInfo.ConsumerId != null && Enumerable.SequenceEqual(this.ConsumerId, vStorageObjectConfigInfo.ConsumerId))));\n        }\n\n        public override bool Equals(object vStorageObjectConfigInfo)\n        {\n            return Equals(vStorageObjectConfigInfo as VStorageObjectConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityInMB + \"_\" + ConsumptionType + \"_\" + ConsumerId).GetHashCode();\n        }\n    }\n\n    public class VStorageObjectManagerBase : ViewBase, IEquatable<VStorageObjectManagerBase>\n    {\n        public bool Equals(VStorageObjectManagerBase vStorageObjectManagerBase)\n        {\n            return (vStorageObjectManagerBase != null && base.Equals(vStorageObjectManagerBase));\n        }\n\n        public override bool Equals(object vStorageObjectManagerBase)\n        {\n            return Equals(vStorageObjectManagerBase as VStorageObjectManagerBase);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class VStorageObjectSnapshotInfo : DynamicData, IEquatable<VStorageObjectSnapshotInfo>\n    {\n        public VStorageObjectSnapshotInfoVStorageObjectSnapshot[] Snapshots { get; set; }\n\n        public bool Equals(VStorageObjectSnapshotInfo vStorageObjectSnapshotInfo)\n        {\n            return (vStorageObjectSnapshotInfo != null && ((this.Snapshots == null && vStorageObjectSnapshotInfo.Snapshots == null) || (this.Snapshots != null && vStorageObjectSnapshotInfo.Snapshots != null && Enumerable.SequenceEqual(this.Snapshots, vStorageObjectSnapshotInfo.Snapshots))));\n        }\n\n        public override bool Equals(object vStorageObjectSnapshotInfo)\n        {\n            return Equals(vStorageObjectSnapshotInfo as VStorageObjectSnapshotInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Snapshots).GetHashCode();\n        }\n    }\n\n    public class VStorageObjectSnapshotInfoVStorageObjectSnapshot : DynamicData, IEquatable<VStorageObjectSnapshotInfoVStorageObjectSnapshot>\n    {\n        public ID Id { get; set; }\n\n        public string BackingObjectId { get; set; }\n\n        public DateTime CreateTime { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Equals(VStorageObjectSnapshotInfoVStorageObjectSnapshot vStorageObjectSnapshotInfoVStorageObjectSnapshot)\n        {\n            return (vStorageObjectSnapshotInfoVStorageObjectSnapshot != null && ((this.Id == null && vStorageObjectSnapshotInfoVStorageObjectSnapshot.Id == null) || (this.Id != null && this.Id.Equals(vStorageObjectSnapshotInfoVStorageObjectSnapshot.Id))) && this.BackingObjectId == vStorageObjectSnapshotInfoVStorageObjectSnapshot.BackingObjectId && this.CreateTime == vStorageObjectSnapshotInfoVStorageObjectSnapshot.CreateTime && this.Description == vStorageObjectSnapshotInfoVStorageObjectSnapshot.Description);\n        }\n\n        public override bool Equals(object vStorageObjectSnapshotInfoVStorageObjectSnapshot)\n        {\n            return Equals(vStorageObjectSnapshotInfoVStorageObjectSnapshot as VStorageObjectSnapshotInfoVStorageObjectSnapshot);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + BackingObjectId + \"_\" + CreateTime + \"_\" + Description).GetHashCode();\n        }\n    }\n\n    public class VStorageObjectStateInfo : DynamicData, IEquatable<VStorageObjectStateInfo>\n    {\n        public bool? Tentative { get; set; }\n\n        public bool Equals(VStorageObjectStateInfo vStorageObjectStateInfo)\n        {\n            return (vStorageObjectStateInfo != null && ((this.Tentative == null && vStorageObjectStateInfo.Tentative == null) || (this.Tentative != null && this.Tentative.Equals(vStorageObjectStateInfo.Tentative))));\n        }\n\n        public override bool Equals(object vStorageObjectStateInfo)\n        {\n            return Equals(vStorageObjectStateInfo as VStorageObjectStateInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Tentative).GetHashCode();\n        }\n    }\n\n    public class VvolDatastoreInfo : DatastoreInfo, IEquatable<VvolDatastoreInfo>\n    {\n        public HostVvolVolume VvolDS { get; set; }\n\n        public bool Equals(VvolDatastoreInfo vvolDatastoreInfo)\n        {\n            return (vvolDatastoreInfo != null && ((this.VvolDS == null && vvolDatastoreInfo.VvolDS == null) || (this.VvolDS != null && this.VvolDS.Equals(vvolDatastoreInfo.VvolDS))));\n        }\n\n        public override bool Equals(object vvolDatastoreInfo)\n        {\n            return Equals(vvolDatastoreInfo as VvolDatastoreInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VvolDS).GetHashCode();\n        }\n    }\n\n    public class VVolHostPE : DynamicData, IEquatable<VVolHostPE>\n    {\n        public ManagedObjectReference Key { get; set; }\n\n        public HostProtocolEndpoint[] ProtocolEndpoint { get; set; }\n\n        public VVolHostPE_LinkedView LinkedView { get; set; }\n\n        public bool Equals(VVolHostPE vVolHostPE)\n        {\n            return (vVolHostPE != null && ((this.Key == null && vVolHostPE.Key == null) || (this.Key != null && this.Key.Equals(vVolHostPE.Key))) && ((this.ProtocolEndpoint == null && vVolHostPE.ProtocolEndpoint == null) || (this.ProtocolEndpoint != null && vVolHostPE.ProtocolEndpoint != null && Enumerable.SequenceEqual(this.ProtocolEndpoint, vVolHostPE.ProtocolEndpoint))) && ((this.LinkedView == null && vVolHostPE.LinkedView == null) || (this.LinkedView != null && this.LinkedView.Equals(vVolHostPE.LinkedView))));\n        }\n\n        public override bool Equals(object vVolHostPE)\n        {\n            return Equals(vVolHostPE as VVolHostPE);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + ProtocolEndpoint + \"_\" + LinkedView).GetHashCode();\n        }\n    }\n\n    public class VVolHostPE_LinkedView : IEquatable<VVolHostPE_LinkedView>\n    {\n        public HostSystem Key { get; set; }\n\n        public bool Equals(VVolHostPE_LinkedView vVolHostPE_LinkedView)\n        {\n            return (vVolHostPE_LinkedView != null && ((this.Key == null && vVolHostPE_LinkedView.Key == null) || (this.Key != null && this.Key.Equals(vVolHostPE_LinkedView.Key))));\n        }\n\n        public override bool Equals(object vVolHostPE_LinkedView)\n        {\n            return Equals(vVolHostPE_LinkedView as VVolHostPE_LinkedView);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key).GetHashCode();\n        }\n    }\n\n    public class VVolVmConfigFileUpdateResult : DynamicData, IEquatable<VVolVmConfigFileUpdateResult>\n    {\n        public KeyValue[] SucceededVmConfigFile { get; set; }\n\n        public VVolVmConfigFileUpdateResultFailedVmConfigFileInfo[] FailedVmConfigFile { get; set; }\n\n        public bool Equals(VVolVmConfigFileUpdateResult vVolVmConfigFileUpdateResult)\n        {\n            return (vVolVmConfigFileUpdateResult != null && ((this.SucceededVmConfigFile == null && vVolVmConfigFileUpdateResult.SucceededVmConfigFile == null) || (this.SucceededVmConfigFile != null && vVolVmConfigFileUpdateResult.SucceededVmConfigFile != null && Enumerable.SequenceEqual(this.SucceededVmConfigFile, vVolVmConfigFileUpdateResult.SucceededVmConfigFile))) && ((this.FailedVmConfigFile == null && vVolVmConfigFileUpdateResult.FailedVmConfigFile == null) || (this.FailedVmConfigFile != null && vVolVmConfigFileUpdateResult.FailedVmConfigFile != null && Enumerable.SequenceEqual(this.FailedVmConfigFile, vVolVmConfigFileUpdateResult.FailedVmConfigFile))));\n        }\n\n        public override bool Equals(object vVolVmConfigFileUpdateResult)\n        {\n            return Equals(vVolVmConfigFileUpdateResult as VVolVmConfigFileUpdateResult);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SucceededVmConfigFile + \"_\" + FailedVmConfigFile).GetHashCode();\n        }\n    }\n\n    public class VVolVmConfigFileUpdateResultFailedVmConfigFileInfo : DynamicData, IEquatable<VVolVmConfigFileUpdateResultFailedVmConfigFileInfo>\n    {\n        public string TargetConfigVVolId { get; set; }\n\n        public LocalizedMethodFault Fault { get; set; }\n\n        public bool Equals(VVolVmConfigFileUpdateResultFailedVmConfigFileInfo vVolVmConfigFileUpdateResultFailedVmConfigFileInfo)\n        {\n            return (vVolVmConfigFileUpdateResultFailedVmConfigFileInfo != null && this.TargetConfigVVolId == vVolVmConfigFileUpdateResultFailedVmConfigFileInfo.TargetConfigVVolId && ((this.Fault == null && vVolVmConfigFileUpdateResultFailedVmConfigFileInfo.Fault == null) || (this.Fault != null && this.Fault.Equals(vVolVmConfigFileUpdateResultFailedVmConfigFileInfo.Fault))));\n        }\n\n        public override bool Equals(object vVolVmConfigFileUpdateResultFailedVmConfigFileInfo)\n        {\n            return Equals(vVolVmConfigFileUpdateResultFailedVmConfigFileInfo as VVolVmConfigFileUpdateResultFailedVmConfigFileInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (TargetConfigVVolId + \"_\" + Fault).GetHashCode();\n        }\n    }\n\n    public class WaitOptions : DynamicData, IEquatable<WaitOptions>\n    {\n        public int? MaxWaitSeconds { get; set; }\n\n        public int? MaxObjectUpdates { get; set; }\n\n        public bool Equals(WaitOptions waitOptions)\n        {\n            return (waitOptions != null && ((this.MaxWaitSeconds == null && waitOptions.MaxWaitSeconds == null) || (this.MaxWaitSeconds != null && this.MaxWaitSeconds.Equals(waitOptions.MaxWaitSeconds))) && ((this.MaxObjectUpdates == null && waitOptions.MaxObjectUpdates == null) || (this.MaxObjectUpdates != null && this.MaxObjectUpdates.Equals(waitOptions.MaxObjectUpdates))));\n        }\n\n        public override bool Equals(object waitOptions)\n        {\n            return Equals(waitOptions as WaitOptions);\n        }\n\n        public override int GetHashCode()\n        {\n            return (MaxWaitSeconds + \"_\" + MaxObjectUpdates).GetHashCode();\n        }\n    }\n\n    public class WakeOnLanNotSupported : VirtualHardwareCompatibilityIssue, IEquatable<WakeOnLanNotSupported>\n    {\n        public bool Equals(WakeOnLanNotSupported wakeOnLanNotSupported)\n        {\n            return (wakeOnLanNotSupported != null && base.Equals(wakeOnLanNotSupported));\n        }\n\n        public override bool Equals(object wakeOnLanNotSupported)\n        {\n            return Equals(wakeOnLanNotSupported as WakeOnLanNotSupported);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class WakeOnLanNotSupportedByVmotionNIC : HostPowerOpFailed, IEquatable<WakeOnLanNotSupportedByVmotionNIC>\n    {\n        public bool Equals(WakeOnLanNotSupportedByVmotionNIC wakeOnLanNotSupportedByVmotionNIC)\n        {\n            return (wakeOnLanNotSupportedByVmotionNIC != null && base.Equals(wakeOnLanNotSupportedByVmotionNIC));\n        }\n\n        public override bool Equals(object wakeOnLanNotSupportedByVmotionNIC)\n        {\n            return Equals(wakeOnLanNotSupportedByVmotionNIC as WakeOnLanNotSupportedByVmotionNIC);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class WarningUpgradeEvent : UpgradeEvent, IEquatable<WarningUpgradeEvent>\n    {\n        public bool Equals(WarningUpgradeEvent warningUpgradeEvent)\n        {\n            return (warningUpgradeEvent != null && base.Equals(warningUpgradeEvent));\n        }\n\n        public override bool Equals(object warningUpgradeEvent)\n        {\n            return Equals(warningUpgradeEvent as WarningUpgradeEvent);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class WeeklyTaskScheduler : DailyTaskScheduler, IEquatable<WeeklyTaskScheduler>\n    {\n        public bool Sunday { get; set; }\n\n        public bool Monday { get; set; }\n\n        public bool Tuesday { get; set; }\n\n        public bool Wednesday { get; set; }\n\n        public bool Thursday { get; set; }\n\n        public bool Friday { get; set; }\n\n        public bool Saturday { get; set; }\n\n        public bool Equals(WeeklyTaskScheduler weeklyTaskScheduler)\n        {\n            return (weeklyTaskScheduler != null && this.Sunday == weeklyTaskScheduler.Sunday && this.Monday == weeklyTaskScheduler.Monday && this.Tuesday == weeklyTaskScheduler.Tuesday && this.Wednesday == weeklyTaskScheduler.Wednesday && this.Thursday == weeklyTaskScheduler.Thursday && this.Friday == weeklyTaskScheduler.Friday && this.Saturday == weeklyTaskScheduler.Saturday);\n        }\n\n        public override bool Equals(object weeklyTaskScheduler)\n        {\n            return Equals(weeklyTaskScheduler as WeeklyTaskScheduler);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Sunday + \"_\" + Monday + \"_\" + Tuesday + \"_\" + Wednesday + \"_\" + Thursday + \"_\" + Friday + \"_\" + Saturday).GetHashCode();\n        }\n    }\n\n    public class WillLoseHAProtection : MigrationFault, IEquatable<WillLoseHAProtection>\n    {\n        public string Resolution { get; set; }\n\n        public bool Equals(WillLoseHAProtection willLoseHAProtection)\n        {\n            return (willLoseHAProtection != null && this.Resolution == willLoseHAProtection.Resolution);\n        }\n\n        public override bool Equals(object willLoseHAProtection)\n        {\n            return Equals(willLoseHAProtection as WillLoseHAProtection);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Resolution).GetHashCode();\n        }\n    }\n\n    public class WillModifyConfigCpuRequirements : MigrationFault, IEquatable<WillModifyConfigCpuRequirements>\n    {\n        public bool Equals(WillModifyConfigCpuRequirements willModifyConfigCpuRequirements)\n        {\n            return (willModifyConfigCpuRequirements != null && base.Equals(willModifyConfigCpuRequirements));\n        }\n\n        public override bool Equals(object willModifyConfigCpuRequirements)\n        {\n            return Equals(willModifyConfigCpuRequirements as WillModifyConfigCpuRequirements);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class WillResetSnapshotDirectory : MigrationFault, IEquatable<WillResetSnapshotDirectory>\n    {\n        public bool Equals(WillResetSnapshotDirectory willResetSnapshotDirectory)\n        {\n            return (willResetSnapshotDirectory != null && base.Equals(willResetSnapshotDirectory));\n        }\n\n        public override bool Equals(object willResetSnapshotDirectory)\n        {\n            return Equals(willResetSnapshotDirectory as WillResetSnapshotDirectory);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class WinNetBIOSConfigInfo : NetBIOSConfigInfo, IEquatable<WinNetBIOSConfigInfo>\n    {\n        public string PrimaryWINS { get; set; }\n\n        public string SecondaryWINS { get; set; }\n\n        public bool Equals(WinNetBIOSConfigInfo winNetBIOSConfigInfo)\n        {\n            return (winNetBIOSConfigInfo != null && this.PrimaryWINS == winNetBIOSConfigInfo.PrimaryWINS && this.SecondaryWINS == winNetBIOSConfigInfo.SecondaryWINS);\n        }\n\n        public override bool Equals(object winNetBIOSConfigInfo)\n        {\n            return Equals(winNetBIOSConfigInfo as WinNetBIOSConfigInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PrimaryWINS + \"_\" + SecondaryWINS).GetHashCode();\n        }\n    }\n\n    public class WipeDiskFault : VimFault, IEquatable<WipeDiskFault>\n    {\n        public bool Equals(WipeDiskFault wipeDiskFault)\n        {\n            return (wipeDiskFault != null && base.Equals(wipeDiskFault));\n        }\n\n        public override bool Equals(object wipeDiskFault)\n        {\n            return Equals(wipeDiskFault as WipeDiskFault);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class WitnessNodeInfo : DynamicData, IEquatable<WitnessNodeInfo>\n    {\n        public CustomizationIPSettings IpSettings { get; set; }\n\n        public string BiosUuid { get; set; }\n\n        public bool Equals(WitnessNodeInfo witnessNodeInfo)\n        {\n            return (witnessNodeInfo != null && ((this.IpSettings == null && witnessNodeInfo.IpSettings == null) || (this.IpSettings != null && this.IpSettings.Equals(witnessNodeInfo.IpSettings))) && this.BiosUuid == witnessNodeInfo.BiosUuid);\n        }\n\n        public override bool Equals(object witnessNodeInfo)\n        {\n            return Equals(witnessNodeInfo as WitnessNodeInfo);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IpSettings + \"_\" + BiosUuid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.Sdk.Types.V1\n{\n    using System;\n\n    public interface NamedObject\n    {\n        string Name { get; }\n    }\n\n    public interface SnapinVersion\n    {\n        string Name { get; set; }\n\n        int Major { get; set; }\n\n        int Minor { get; set; }\n\n        int Build { get; set; }\n\n        int Revision { get; set; }\n\n        string UserFriendlyVersion { get; set; }\n\n        string Description { get; set; }\n    }\n\n    public interface Task : VIObject\n    {\n        TaskState State { get; set; }\n\n        bool IsCancelable { get; set; }\n\n        float PercentComplete { get; set; }\n\n        DateTime StartTime { get; set; }\n\n        DateTime? FinishTime { get; set; }\n\n        string ObjectId { get; set; }\n\n        object Result { get; set; }\n\n        string Description { get; set; }\n    }\n\n    public interface VIConnection : VIObject\n    {\n        Uri ServiceUri { get; }\n\n        string SessionSecret { get; }\n\n        string User { get; }\n\n        bool IsConnected { get; }\n    }\n\n    public interface VIObject : VIObjectCore, NamedObject\n    {\n        string Id { get; }\n\n        new string Name { get; }\n    }\n\n    public interface VIObjectCore\n    {\n        string Uid { get; }\n    }\n\n    public enum TaskState\n    {\n        Queued,\n        Running,\n        Success,\n        Error,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.Storage.Impl.V1.Encryption\n{\n    using System;\n    using VMware.VimAutomation.ViCore.Types.V1.Security;\n\n    public class KmsClusterImpl : KmsCluster, IEquatable<KmsClusterImpl>\n    {\n        public string Uid { get; set; }\n\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public bool UseAsDefaultKeyProvider { get; set; }\n\n        public string ClientCertificate { get; set; }\n\n        public DateTime? ClientCertificateExpiryDate { get; set; }\n\n        public KmipCertificateInfo ClientCertificateInfo { get; set; }\n\n        public bool Equals(KmsClusterImpl kmsClusterImpl)\n        {\n            return (kmsClusterImpl != null && this.Uid == kmsClusterImpl.Uid && this.Id == kmsClusterImpl.Id && this.Name == kmsClusterImpl.Name && this.UseAsDefaultKeyProvider == kmsClusterImpl.UseAsDefaultKeyProvider && this.ClientCertificate == kmsClusterImpl.ClientCertificate && this.ClientCertificateExpiryDate == kmsClusterImpl.ClientCertificateExpiryDate && ((this.ClientCertificateInfo == null && kmsClusterImpl.ClientCertificateInfo == null) || (this.ClientCertificateInfo != null && this.ClientCertificateInfo.Equals(kmsClusterImpl.ClientCertificateInfo))));\n        }\n\n        public override bool Equals(object kmsClusterImpl)\n        {\n            return this.Equals(kmsClusterImpl as KmsClusterImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Id + \"_\" + Name + \"_\" + UseAsDefaultKeyProvider + \"_\" + ClientCertificate + \"_\" + ClientCertificateExpiryDate + \"_\" + ClientCertificateInfo).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.Storage.Impl.V1.Nfs\n{\n    using System;\n    using VMware.VimAutomation.Storage.Types.V1.Nfs;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class NfsUserImpl : NfsUser, IEquatable<NfsUserImpl>\n    {\n        public string Username { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public bool Equals(NfsUserImpl nfsUserImpl)\n        {\n            return (nfsUserImpl != null && this.Username == nfsUserImpl.Username && ((this.VMHost == null && nfsUserImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(nfsUserImpl.VMHost))));\n        }\n\n        public override bool Equals(object nfsUserImpl)\n        {\n            return Equals(nfsUserImpl as NfsUserImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Username + \"_\" + VMHost).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.Storage.Types.V1.Nfs\n{\n\tusing VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n\tpublic interface NfsUser\n\t{\n\t    string Username { get; set; }\n\n\t    VMHost VMHost { get; set; }\n\t}\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1\n{\n    using System;\n    using System.IO;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Alarm;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface Action : VIObjectCore\n    {\n        ActionType ActionType { get; set; }\n    }\n\n    public interface AdvancedOption\n    {\n    }\n\n    public interface AdvancedSetting : VIObject\n    {\n        object Value { get; set; }\n\n        VIObject Entity { get; set; }\n\n        string Description { get; set; }\n\n        AdvancedSettingType? Type { get; set; }\n    }\n\n    public interface Description\n    {\n        string Label { get; set; }\n\n        string Summary { get; set; }\n    }\n\n    public interface DiagnosticBundle\n    {\n        string Url { get; set; }\n\n        VMHost Host { get; set; }\n\n        FileInfo Data { get; set; }\n    }\n\n    public interface ExtensionData\n    {\n        object ExtensionData { get; set; }\n    }\n\n    public interface IPv6Address\n    {\n        string Address { get; set; }\n\n        int PrefixLength { get; set; }\n    }\n\n    public interface Log\n    {\n        string Key { get; set; }\n\n        string SourceEntityId { get; set; }\n\n        VIObject SourceEntity { get; set; }\n\n        int StartLineNum { get; set; }\n\n        int LastLineNum { get; set; }\n\n        string[] Entries { get; set; }\n\n        VIServer Server { get; set; }\n\n        VMHost Host { get; set; }\n    }\n\n    public interface LogDescriptor : ExtensionData, VIObjectCore\n    {\n        string SourceEntityId { get; set; }\n\n        string Creator { get; set; }\n\n        string Filename { get; set; }\n\n        string Format { get; set; }\n\n        Description Info { get; set; }\n\n        string Key { get; set; }\n\n        string MimeType { get; set; }\n    }\n\n    public interface PowerCLIConfiguration\n    {\n        ProxyPolicy? ProxyPolicy { get; set; }\n\n        DefaultVIServerMode? DefaultVIServerMode { get; set; }\n\n        BadCertificateAction? InvalidCertificateAction { get; set; }\n\n        bool? ParticipateInCEIP { get; set; }\n\n        ProxyPolicy? CEIPDataTransferProxyPolicy { get; set; }\n\n        bool? DisplayDeprecationWarnings { get; set; }\n\n        int? WebOperationTimeoutSeconds { get; set; }\n\n        string VMConsoleWindowBrowser { get; set; }\n\n        ConfigurationScope Scope { get; set; }\n    }\n\n    public interface PowerCLIVersion\n    {\n        int Major { get; set; }\n\n        int Minor { get; set; }\n\n        int Build { get; set; }\n\n        int Revision { get; set; }\n\n        string Copyright { get; set; }\n\n        string Company { get; set; }\n\n        string UserFriendlyVersion { get; set; }\n\n        SnapinVersion[] SnapinVersions { get; set; }\n    }\n\n    public interface Task : VMware.VimAutomation.Sdk.Types.V1.Task, ExtensionData\n    {\n    }\n\n    public interface Versionable\n    {\n        string Id { get; set; }\n\n        ulong Version { get; set; }\n    }\n\n    public interface VICredentialStoreItem\n    {\n        string Host { get; set; }\n\n        string User { get; set; }\n\n        string Password { get; set; }\n\n        string File { get; set; }\n    }\n\n    public interface ViewBaseMirroredObject\n    {\n        object GetVIView(string[] properties);\n    }\n\n    public interface VIProperty\n    {\n        string Name { get; set; }\n\n        string RetrievingType { get; set; }\n\n        string DeclaringType { get; set; }\n\n        string Value { get; set; }\n    }\n\n    public interface VIServer : VIConnection, ExtensionData\n    {\n        int Port { get; set; }\n\n        string SessionId { get; set; }\n\n        string Version { get; set; }\n\n        string Build { get; set; }\n\n        string ProductLine { get; set; }\n\n        string InstanceUuid { get; set; }\n\n        int RefCount { get; set; }\n    }\n\n    public enum AdvancedSettingType\n    {\n        ClusterHA,\n        VM,\n        ClusterDRS,\n        VMHost,\n        DatastoreClusterSDRS,\n        VIServer\n    }\n\n    public enum AggregationFunction\n    {\n        SUM,\n        AVG,\n        AVERAGE,\n        MIN,\n        MAX,\n        UNIQUE,\n        COUNT\n    }\n\n    public enum BadCertificateAction\n    {\n        Fail,\n        Prompt,\n        Warn,\n        Ignore,\n        Unset\n    }\n\n    public enum Cardinality\n    {\n        Single,\n        Multiple\n    }\n\n    public enum ConfigurationScope\n    {\n        Session,\n        User,\n        AllUsers\n    }\n\n    public enum DefaultVIServerMode\n    {\n        Single,\n        Multiple\n    }\n\n    public enum EventCategory\n    {\n        Error,\n        Info,\n        Warning\n    }\n\n    public enum IPVersion\n    {\n        IPv4,\n        IPv6\n    }\n\n    public enum ProxyPolicy\n    {\n        NoProxy,\n        UseSystemProxy\n    }\n\n    public enum ScriptType\n    {\n        Powershell,\n        Bat,\n        Bash\n    }\n\n    public enum SharesLevel\n    {\n        Custom,\n        High,\n        Low,\n        Normal\n    }\n\n    public enum VAppStorageFormat\n    {\n        Ovf,\n        Ova\n    }\n\n    public enum VMotionPriority\n    {\n        Standard,\n        High\n    }\n\n    public enum VMSwapfilePolicy\n    {\n        WithVM,\n        Inherit,\n        InHostDatastore\n    }\n\n    public class NamedIPEndPoint : IEquatable<NamedIPEndPoint>\n    {\n        public string Host { get; set; }\n\n        public int? Port { get; set; }\n\n        public bool Equals(NamedIPEndPoint namedIPEndPoint)\n        {\n            return (namedIPEndPoint != null && this.Host == namedIPEndPoint.Host && ((this.Port == null && namedIPEndPoint.Port == null) || (this.Port != null && this.Port.Equals(namedIPEndPoint.Port))));\n        }\n\n        public override bool Equals(object namedIPEndPoint)\n        {\n            return Equals(namedIPEndPoint as NamedIPEndPoint);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Host + \"_\" + Port).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Alarm\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface AlarmAction : VMware.VimAutomation.ViCore.Types.V1.Action\n    {\n        AlarmDefinition AlarmDefinition { get; set; }\n\n        AlarmActionTrigger[] Trigger { get; set; }\n    }\n\n    public interface AlarmActionTrigger : VIObjectCore\n    {\n        InventoryItemStatus StartStatus { get; set; }\n\n        InventoryItemStatus EndStatus { get; set; }\n\n        bool Repeat { get; set; }\n\n        AlarmAction AlarmAction { get; set; }\n    }\n\n    public interface AlarmDefinition : VIObject, ExtensionData\n    {\n        VIObject Entity { get; set; }\n\n        string Description { get; set; }\n\n        bool Enabled { get; set; }\n\n        int ActionRepeatMinutes { get; set; }\n    }\n\n    public interface EmailAction : AlarmAction\n    {\n        string Body { get; set; }\n\n        string[] Cc { get; set; }\n\n        string[] To { get; set; }\n\n        string Subject { get; set; }\n    }\n\n    public interface ScriptAction : AlarmAction\n    {\n        string ScriptFilePath { get; set; }\n    }\n\n    public interface SnmpAction : AlarmAction\n    {\n    }\n\n    public enum ActionType\n    {\n        SendEmail,\n        ExecuteScript,\n        SendSNMP\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface Annotation : VIObjectCore\n    {\n        string AnnotatedEntityId { get; set; }\n\n        InventoryItem AnnotatedEntity { get; set; }\n\n        string Name { get; set; }\n\n        string Value { get; set; }\n    }\n\n    public interface CustomAttribute : NamedObject, VIObjectCore\n    {\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n\n        CustomAttributeTargetType? TargetType { get; set; }\n    }\n\n    public enum CustomAttributeTargetType\n    {\n        VirtualMachine,\n        ResourcePool,\n        Folder,\n        VMHost,\n        Cluster,\n        Datacenter\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Cluster\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface DrsClusterGroup : NamedObject, VIObjectCore, ExtensionData\n    {\n        VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster Cluster { get; set; }\n    }\n\n    public interface DrsClusterVMGroup : DrsClusterGroup\n    {\n        VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[] Member { get; set; }\n\n        DrsClusterGroupType GroupType { get; set; }\n    }\n\n    public interface DrsClusterVMHostGroup : DrsClusterGroup\n    {\n        VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[] Member { get; set; }\n\n        DrsClusterGroupType GroupType { get; set; }\n    }\n\n    public interface DrsRecommendation : VIObjectCore, ExtensionData\n    {\n        int Priority { get; set; }\n\n        string Recommendation { get; set; }\n\n        string Reason { get; set; }\n\n        string ClusterId { get; set; }\n\n        VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster Cluster { get; set; }\n\n        string TargetId { get; set; }\n\n        VIObject Target { get; set; }\n    }\n\n    public interface DrsRule : ResourceSchedulingRule\n    {\n        string ClusterId { get; set; }\n\n        string ClusterUid { get; set; }\n\n        int Key { get; set; }\n\n        VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster Cluster { get; set; }\n\n        string Uid { get; set; }\n    }\n\n    public interface DrsVMAffinityRule : DrsRule\n    {\n        bool KeepTogether { get; set; }\n\n        string[] VMIds { get; set; }\n    }\n\n    public interface DrsVMAntiAffinityRule : DrsRule\n    {\n        bool KeepTogether { get; set; }\n\n        string[] VMIds { get; set; }\n    }\n\n    public interface DrsVMHostAffinityRule : DrsRule\n    {\n        string[] VMIds { get; set; }\n\n        string[] AffineHostIds { get; set; }\n\n        string[] AntiAffineHostIds { get; set; }\n    }\n\n    public interface DrsVMHostRule : VIObjectCore, ExtensionData, NamedObject\n    {\n        bool Enabled { get; set; }\n\n        VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster Cluster { get; set; }\n\n        DrsVMHostRuleType Type { get; set; }\n\n        DrsClusterVMGroup VMGroup { get; set; }\n\n        DrsClusterVMHostGroup VMHostGroup { get; set; }\n    }\n\n    public interface ResourceSchedulingRule : ExtensionData, NamedObject\n    {\n        bool Enabled { get; set; }\n\n        bool Mandatory { get; set; }\n\n        ResourceSchedulingRuleType Type { get; set; }\n    }\n\n    public enum DrsAutomationLevel\n    {\n        Disabled,\n        FullyAutomated,\n        Manual,\n        PartiallyAutomated,\n        AsSpecifiedByCluster\n    }\n\n    public enum DrsClusterGroupType\n    {\n        All,\n        VMGroup,\n        VMHostGroup\n    }\n\n    public enum DrsMode\n    {\n        FullyAutomated,\n        Manual,\n        PartiallyAutomated\n    }\n\n    public enum DrsVMHostRuleType\n    {\n        MustRunOn,\n        ShouldRunOn,\n        MustNotRunOn,\n        ShouldNotRunOn\n    }\n\n    public enum HAIsolationResponse\n    {\n        AsSpecifiedByCluster,\n        PowerOff,\n        DoNothing,\n        Shutdown\n    }\n\n    public enum HARestartPriority\n    {\n        Disabled,\n        Low,\n        Medium,\n        High,\n        ClusterRestartPriority,\n        Lowest,\n        Highest\n    }\n\n    public enum ResourceSchedulingRuleType\n    {\n        VMAntiAffinity,\n        VMAffinity,\n        VMHostAffinity\n    }\n\n    public enum SetDrsClusterGroupOperationType\n    {\n        AddItems,\n        RemoveItems\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.ContentLibrary\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n\n    public interface ContentLibrary : NamedObject\n    {\n    }\n\n    public interface ContentLibraryItem : VIObject\n    {\n        decimal SizeGB { get; set; }\n\n        string Description { get; set; }\n\n        DateTime CreationTime { get; set; }\n\n        DateTime LastWriteTime { get; set; }\n\n        string ItemType { get; set; }\n\n        ContentLibrary ContentLibrary { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Cluster;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n\n    public interface Datastore : StorageResource, ExtensionData\n    {\n        string DatacenterId { get; set; }\n\n        Datacenter Datacenter { get; set; }\n\n        string ParentFolderId { get; set; }\n\n        Folder ParentFolder { get; set; }\n\n        string DatastoreBrowserPath { get; set; }\n\n        decimal FreeSpaceMB { get; set; }\n\n        decimal CapacityMB { get; set; }\n\n        bool Accessible { get; set; }\n\n        string Type { get; set; }\n\n        bool StorageIOControlEnabled { get; set; }\n\n        int? CongestionThresholdMillisecond { get; set; }\n\n        DatastoreState State { get; set; }\n    }\n\n    public interface DatastoreCluster : StorageResource, ExtensionData, DatastoreRelatedObjectBase\n    {\n        DrsAutomationLevel SdrsAutomationLevel { get; set; }\n\n        bool IOLoadBalanceEnabled { get; set; }\n\n        int? IOLatencyThresholdMillisecond { get; set; }\n\n        int? SpaceUtilizationThresholdPercent { get; set; }\n    }\n\n    public interface DatastoreFile : DatastoreItem\n    {\n        long? Length { get; set; }\n    }\n\n    public interface DatastoreFolder : DatastoreItem\n    {\n    }\n\n    public interface DatastoreItem : VIObjectCore\n    {\n        string DatastoreId { get; set; }\n\n        Datastore Datastore { get; set; }\n\n        string Name { get; set; }\n\n        string FolderPath { get; set; }\n\n        string DatastoreFullPath { get; set; }\n\n        string FullName { get; set; }\n\n        DatastoreItemType ItemType { get; set; }\n\n        DateTime? LastWriteTime { get; set; }\n\n        void SetFullName(string value);\n    }\n\n    public interface DatastoreUser\n    {\n        string[] DatastoreIdList { get; set; }\n    }\n\n    public interface DatastoreVMDiskFile : DatastoreFile\n    {\n        long? CapacityKb { get; set; }\n\n        string ControllerType { get; set; }\n\n        DiskType DiskType { get; set; }\n\n        string[] DiskExtents { get; set; }\n    }\n\n    public interface NasDatastore : Datastore\n    {\n        string[] RemoteHost { get; set; }\n\n        string RemotePath { get; set; }\n\n        string UserName { get; set; }\n\n        AuthenticationMethod AuthenticationMethod { get; set; }\n\n        string FileSystemVersion { get; set; }\n    }\n\n    public interface StorageResource : VIObject\n    {\n        decimal CapacityGB { get; set; }\n\n        decimal FreeSpaceGB { get; set; }\n    }\n\n    public interface VmfsDatastore : Datastore\n    {\n        string FileSystemVersion { get; set; }\n    }\n\n    public enum AuthenticationMethod\n    {\n        NotSpecified,\n        AUTH_SYS,\n        Kerberos\n    }\n\n    public enum DatastoreItemType\n    {\n        File,\n        Folder,\n        FloppyImageFile,\n        IsoImageFile,\n        VmConfigFile,\n        VmDiskFile,\n        VmLogFile,\n        VmNvramFile,\n        VmSnapshotFile,\n        HiddenFile\n    }\n\n    public enum DatastoreState\n    {\n        Available,\n        Maintenance,\n        EnteringMaintenance,\n        Unavailable\n    }\n\n    public class SdrsVMAntiAffinityRule : AdvancedOption, IEquatable<SdrsVMAntiAffinityRule>\n    {\n        public VirtualMachine[] VM { get; set; }\n\n        public bool Equals(SdrsVMAntiAffinityRule sdrsVMAntiAffinityRule)\n        {\n            return (sdrsVMAntiAffinityRule != null && ((this.VM == null && sdrsVMAntiAffinityRule.VM == null) || (this.VM != null && sdrsVMAntiAffinityRule.VM != null && Enumerable.SequenceEqual(this.VM, sdrsVMAntiAffinityRule.VM))));\n        }\n\n        public override bool Equals(object sdrsVMAntiAffinityRule)\n        {\n            return Equals(sdrsVMAntiAffinityRule as SdrsVMAntiAffinityRule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VM).GetHashCode();\n        }\n    }\n\n    public class SdrsVMDiskAntiAffinityRule : AdvancedOption, IEquatable<SdrsVMDiskAntiAffinityRule>\n    {\n        public HardDisk[] Disks { get; set; }\n\n        public string[] DiskIdentifier { get; set; }\n\n        public bool Equals(SdrsVMDiskAntiAffinityRule sdrsVMDiskAntiAffinityRule)\n        {\n            return (sdrsVMDiskAntiAffinityRule != null && ((this.Disks == null && sdrsVMDiskAntiAffinityRule.Disks == null) || (this.Disks != null && sdrsVMDiskAntiAffinityRule.Disks != null && Enumerable.SequenceEqual(this.Disks, sdrsVMDiskAntiAffinityRule.Disks))) && ((this.DiskIdentifier == null && sdrsVMDiskAntiAffinityRule.DiskIdentifier == null) || (this.DiskIdentifier != null && sdrsVMDiskAntiAffinityRule.DiskIdentifier != null && Enumerable.SequenceEqual(this.DiskIdentifier, sdrsVMDiskAntiAffinityRule.DiskIdentifier))));\n        }\n\n        public override bool Equals(object sdrsVMDiskAntiAffinityRule)\n        {\n            return Equals(sdrsVMDiskAntiAffinityRule as SdrsVMDiskAntiAffinityRule);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Disks + \"_\" + DiskIdentifier).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.EsxCli\n{\n    using System;\n    using System.Collections;\n    using System.Collections.Generic;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface DynamicManagedObject\n    {\n        string Id { get; set; }\n\n        object InvokeOperation(string name, IDictionary parameters);\n    }\n\n    public interface DynamicTypeManager : DynamicManagedObject\n    {\n        MoInstanceDescriptor[] QueryMoInstances(string id);\n        IDictionary<string, object> QueryTypeInfo(string typeSubstring);\n        DynamicManagedObject CreateDynamicManagedObject(string id);\n    }\n\n    public interface EsxCli : VIObjectCore\n    {\n        VMHost VMHost { get; set; }\n\n        DynamicTypeManager TypeManager { get; set; }\n    }\n\n    public interface EsxCliElement : VIObjectCore\n    {\n        string Id { get; set; }\n\n        string Name { get; set; }\n\n        string FullName { get; set; }\n\n        EsxCliHelp help();\n        EsxCliMethodHelp help(string methodName);\n    }\n\n    public interface EsxCliHelp\n    {\n        string DisplayName { get; set; }\n\n        string FullDisplayName { get; set; }\n\n        string Name { get; set; }\n\n        string Help { get; set; }\n\n        List<EsxCliHelp> ChildElement { get; set; }\n\n        List<EsxCliMethodHelp> Method { get; set; }\n    }\n\n    public interface EsxCliMethodHelp\n    {\n        string DisplayName { get; set; }\n\n        string FullDisplayName { get; set; }\n\n        string Name { get; set; }\n\n        string Help { get; set; }\n\n        EsxCliParameterHelp Ret { get; set; }\n\n        EsxCliParameterHelp[] Param { get; set; }\n\n        IDictionary Hints { get; set; }\n    }\n\n    public interface EsxCliObject\n    {\n    }\n\n    public interface EsxCliParameterHelp\n    {\n        string DisplayName { get; set; }\n\n        string MethodFullDisplayName { get; set; }\n\n        string Name { get; set; }\n\n        string Help { get; set; }\n\n        string[] Constraint { get; set; }\n\n        string Default { get; set; }\n\n        string[] Aliases { get; set; }\n    }\n\n    public interface MoInstanceDescriptor\n    {\n        string Id { get; set; }\n\n        string Type { get; set; }\n    }\n\n    public class EsxCliNamedArgumentCollection : Dictionary<string, object>, IEquatable<EsxCliNamedArgumentCollection>\n    {\n        public bool Equals(EsxCliNamedArgumentCollection esxCliNamedArgumentCollection)\n        {\n            return (esxCliNamedArgumentCollection != null && base.Equals(esxCliNamedArgumentCollection));\n        }\n\n        public override bool Equals(object esxCliNamedArgumentCollection)\n        {\n            return Equals(esxCliNamedArgumentCollection as EsxCliNamedArgumentCollection);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.EsxTop\n{\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public interface Counter\n    {\n        VIServer Server { get; set; }\n\n        string Name { get; set; }\n\n        string Uid { get; set; }\n\n        CounterInfoField[] Fields { get; set; }\n    }\n\n    public interface CounterInfoField\n    {\n        string Name { get; set; }\n\n        string Type { get; set; }\n    }\n\n    public interface CounterValue\n    {\n        VIServer Server { get; set; }\n\n        string Counter { get; set; }\n    }\n\n    public interface DynamicData\n    {\n    }\n\n    public interface TopologyInfo\n    {\n        VIServer Server { get; set; }\n\n        string Topology { get; set; }\n\n        string Uid { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host\n{\n    using System;\n    using System.IO;\n    using System.Net;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface HostFirmware : ExtensionData\n    {\n        string UploadUrl { get; set; }\n\n        VMHost Host { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string Uid { get; set; }\n    }\n\n    public interface HostFirmwareBundle\n    {\n        string Url { get; set; }\n\n        FileInfo Data { get; set; }\n\n        VMHost Host { get; set; }\n    }\n\n    public interface HostService : VIObjectCore, ExtensionData\n    {\n        string Key { get; set; }\n\n        string Label { get; set; }\n\n        string Policy { get; set; }\n\n        bool Required { get; set; }\n\n        bool Running { get; set; }\n\n        bool Uninstallable { get; set; }\n\n        string[] Ruleset { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n    }\n\n    public interface TrapTarget : VIObjectCore\n    {\n        string Community { get; set; }\n\n        string HostName { get; set; }\n\n        int Port { get; set; }\n    }\n\n    public interface VMHostAuthentication\n    {\n        VMHost VMHost { get; set; }\n\n        string Domain { get; set; }\n\n        string[] TrustedDomains { get; set; }\n\n        DomainMembershipStatus? DomainMembershipStatus { get; set; }\n    }\n\n    public interface VMHostDiagnosticPartition : VIObjectCore, ExtensionData\n    {\n        string HostId { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string CanonicalName { get; set; }\n\n        string DiagnosticType { get; set; }\n\n        int SlotCount { get; set; }\n\n        string StorageType { get; set; }\n\n        bool Active { get; set; }\n    }\n\n    public interface VMHostFirewallDefaultPolicy : VIObjectCore, ExtensionData\n    {\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        bool IncomingEnabled { get; set; }\n\n        bool OutgoingEnabled { get; set; }\n    }\n\n    public interface VMHostFirewallException : VIObjectCore, ExtensionData\n    {\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string Name { get; set; }\n\n        bool Enabled { get; set; }\n\n        string IncomingPorts { get; set; }\n\n        string OutgoingPorts { get; set; }\n\n        string Protocols { get; set; }\n\n        bool? ServiceRunning { get; set; }\n    }\n\n    public interface VMHostHardware : VIObjectCore\n    {\n        VMHost VMHost { get; set; }\n\n        string Manufacturer { get; set; }\n\n        string Model { get; set; }\n\n        string SerialNumber { get; set; }\n\n        string AssetTag { get; set; }\n\n        string BiosVersion { get; set; }\n\n        string CpuModel { get; set; }\n\n        int CpuCount { get; set; }\n\n        int CpuCoreCountTotal { get; set; }\n\n        int MhzPerCpu { get; set; }\n\n        int MemorySlotCount { get; set; }\n\n        VMHostMemoryModule[] MemoryModules { get; set; }\n\n        VMHostPowerSupply[] PowerSupplies { get; set; }\n\n        int NicCount { get; set; }\n    }\n\n    public interface VMHostMemoryModule\n    {\n        string Name { get; set; }\n\n        decimal CapacityGB { get; set; }\n\n        string Manufacturer { get; set; }\n\n        string Model { get; set; }\n\n        string SerialNumber { get; set; }\n    }\n\n    public interface VmHostModule : VIObjectCore\n    {\n        VMHost VMHost { get; set; }\n\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n\n        string Name { get; set; }\n\n        string Options { get; set; }\n    }\n\n    public interface VMHostPatch : VIObjectCore\n    {\n        string Id { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        DateTime? InstallDate { get; set; }\n\n        string Description { get; set; }\n    }\n\n    public interface VMHostPatchResult : VIObjectCore\n    {\n        string Id { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        bool IsApplicable { get; set; }\n\n        bool IsInstalled { get; set; }\n\n        bool NeedsReconnect { get; set; }\n\n        bool NeedsRestart { get; set; }\n    }\n\n    public interface VMHostPciDevice : VIObject\n    {\n        VMHost VMHost { get; set; }\n\n        string DeviceName { get; set; }\n\n        string VendorName { get; set; }\n\n        PciDeviceClass DeviceClass { get; set; }\n\n        short DeviceId { get; set; }\n\n        short SubDeviceId { get; set; }\n\n        short ClassId { get; set; }\n\n        short VendorId { get; set; }\n\n        short SubVendorId { get; set; }\n    }\n\n    public interface VMHostPowerSupply\n    {\n        string Name { get; set; }\n\n        int HealthState { get; set; }\n\n        string HealthStateText { get; set; }\n\n        int OperationalStatus { get; set; }\n\n        string OperationalStatusText { get; set; }\n    }\n\n    public interface VMHostRoute : VIObjectCore, ExtensionData\n    {\n        IPAddress Destination { get; set; }\n\n        IPAddress Gateway { get; set; }\n\n        int PrefixLength { get; set; }\n\n        IPVersion IPVersion { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n    }\n\n    public interface VmHostSnmp : VIObjectCore, ExtensionData\n    {\n        bool Enabled { get; set; }\n\n        int Port { get; set; }\n\n        string[] ReadOnlyCommunities { get; set; }\n\n        string VmHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        TrapTarget[] TrapTargets { get; set; }\n    }\n\n    public interface VMHostTimeZone : VIObjectCore, NamedObject\n    {\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string Description { get; set; }\n\n        int GmtOffset { get; set; }\n\n        string Key { get; set; }\n    }\n\n    public enum DomainMembershipStatus\n    {\n        ClientTrustBroken,\n        InconsistentTrust,\n        NoServers,\n        Ok,\n        OtherProblem,\n        ServerTrustBroken,\n        Unknown\n    }\n\n    public enum HostServicePolicy\n    {\n        Automatic,\n        On,\n        Off\n    }\n\n    public enum PciDeviceClass\n    {\n        NotSpecified,\n        UnclassifiedDevice,\n        MassStorageController,\n        NetworkController,\n        DisplayController,\n        MultimediaController,\n        MemoryController,\n        Bridge,\n        CommunicationController,\n        GenericSystemPeripheral,\n        InputDeviceController,\n        DockingStation,\n        Processor,\n        SerialBusController,\n        WirelessController,\n        IntelligentController,\n        SatelliteCommunicationsController,\n        EncryptionController,\n        SignalProcessingController,\n        ProcessingAccelerators,\n        NonEssentialInstrumentation,\n        Unknown\n    }\n\n    public enum VMHostPowerState\n    {\n        PoweredOff,\n        PoweredOn,\n        StandBy,\n        Unknown\n    }\n\n    public enum VMHostState\n    {\n        Connected,\n        Disconnected,\n        NotResponding,\n        Maintenance\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.Account\n{\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.PermissionManagement;\n\n    public interface HostAccount : VIAccount, ExtensionData\n    {\n        string ServerId { get; set; }\n    }\n\n    public interface HostGroupAccount : VIUserAccount, HostAccount\n    {\n        string[] Users { get; set; }\n    }\n\n    public interface HostUserAccount : VIUserAccount, HostAccount\n    {\n        string[] Groups { get; set; }\n\n        new string Description { get; set; }\n\n        bool ShellAccessEnabled { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.Networking\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n\n    public interface DistributedPortGroup : VirtualPortGroupBase, VIObject\n    {\n        string Notes { get; set; }\n\n        Datacenter Datacenter { get; set; }\n\n        DistributedPortGroupPortBinding PortBinding { get; set; }\n\n        int NumPorts { get; set; }\n    }\n\n    public interface DistributedSwitch : VirtualSwitchBase, VIObject\n    {\n        string Notes { get; set; }\n\n        Datacenter Datacenter { get; set; }\n    }\n\n    public interface NicTeamingPolicy : VIObjectCore, ExtensionData\n    {\n        LoadBalancingPolicy LoadBalancingPolicy { get; set; }\n\n        NetworkFailoverDetectionPolicy NetworkFailoverDetectionPolicy { get; set; }\n\n        bool NotifySwitches { get; set; }\n\n        bool FailbackEnabled { get; set; }\n\n        string[] ActiveNic { get; set; }\n\n        string[] StandbyNic { get; set; }\n\n        string[] UnusedNic { get; set; }\n\n        bool CheckBeacon { get; set; }\n\n        string VmHostId { get; set; }\n    }\n\n    public interface NicTeamingVirtualPortGroupPolicy : NicTeamingPolicy\n    {\n        string VirtualPortGroupId { get; set; }\n\n        VirtualPortGroup VirtualPortGroup { get; set; }\n\n        bool IsLoadBalancingInherited { get; set; }\n\n        bool IsNetworkFailoverDetectionInherited { get; set; }\n\n        bool IsNotifySwitchesInherited { get; set; }\n\n        bool IsFailbackInherited { get; set; }\n\n        bool IsFailoverOrderInherited { get; set; }\n\n        bool IsCheckBeaconInherited { get; set; }\n    }\n\n    public interface NicTeamingVirtualSwitchPolicy : NicTeamingPolicy\n    {\n        string VirtualSwitchId { get; set; }\n\n        VirtualSwitch VirtualSwitch { get; set; }\n\n        int? BeaconInterval { get; set; }\n    }\n\n    public interface PortGroupPort\n    {\n        string Key { get; set; }\n\n        string[] Mac { get; set; }\n\n        string Type { get; set; }\n    }\n\n    public interface SecurityPolicy : VIObjectCore, ExtensionData\n    {\n        bool AllowPromiscuous { get; set; }\n\n        bool ForgedTransmits { get; set; }\n\n        bool MacChanges { get; set; }\n    }\n\n    public interface VirtualPortGroup : VirtualPortGroupBase, VirtualSwitchRelatedObject\n    {\n        PortGroupPort[] Port { get; set; }\n\n        int VLanId { get; set; }\n\n        string VirtualSwitchName { get; set; }\n\n        string VMHostId { get; set; }\n\n        string VirtualSwitchId { get; set; }\n    }\n\n    public interface VirtualPortGroupBase : VIObjectCore, NamedObject, ExtensionData\n    {\n        string Key { get; set; }\n\n        VirtualSwitchBase VirtualSwitch { get; set; }\n    }\n\n    public interface VirtualPortgroupSecurityPolicy : SecurityPolicy\n    {\n        VirtualPortGroup VirtualPortGroup { get; set; }\n\n        bool AllowPromiscuousInherited { get; set; }\n\n        bool ForgedTransmitsInherited { get; set; }\n\n        bool MacChangesInherited { get; set; }\n    }\n\n    public interface VirtualSwitch : VirtualSwitchBase\n    {\n        int NumPortsAvailable { get; set; }\n\n        string[] Nic { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n    }\n\n    public interface VirtualSwitchBase : VIObjectCore, NamedObject, ExtensionData\n    {\n        int NumPorts { get; set; }\n\n        string Key { get; set; }\n\n        int? Mtu { get; set; }\n    }\n\n    public interface VirtualSwitchSecurityPolicy : SecurityPolicy\n    {\n        VirtualSwitch VirtualSwitch { get; set; }\n    }\n\n    public interface VMHostNetworkInfo : VIObject, ExtensionData\n    {\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string VMKernelGateway { get; set; }\n\n        string VMKernelGatewayDevice { get; set; }\n\n        string ConsoleGateway { get; set; }\n\n        string ConsoleGatewayDevice { get; set; }\n\n        string[] DnsAddress { get; set; }\n\n        bool DnsFromDhcp { get; set; }\n\n        string DomainName { get; set; }\n\n        string HostName { get; set; }\n\n        string[] SearchDomain { get; set; }\n\n        VirtualSwitch[] VirtualSwitch { get; set; }\n\n        PhysicalNic[] PhysicalNic { get; set; }\n\n        HostVirtualNic[] ConsoleNic { get; set; }\n\n        HostVirtualNic[] VirtualNic { get; set; }\n\n        string DnsDhcpDevice { get; set; }\n\n        bool? IPv6Enabled { get; set; }\n\n        string ConsoleV6Gateway { get; set; }\n\n        string ConsoleV6GatewayDevice { get; set; }\n\n        string VMKernelV6Gateway { get; set; }\n\n        string VMKernelV6GatewayDevice { get; set; }\n\n        object ExtensionData2 { get; set; }\n    }\n\n    public enum DistributedPortGroupPortBinding\n    {\n        Static,\n        Dynamic,\n        Ephemeral,\n        Unknown\n    }\n\n    public enum LoadBalancingPolicy\n    {\n        LoadBalanceIP,\n        LoadBalanceLoadBased,\n        LoadBalanceSrcMac,\n        LoadBalanceSrcId,\n        ExplicitFailover,\n        Unknown\n    }\n\n    public enum NetworkFailoverDetectionPolicy\n    {\n        LinkStatus,\n        BeaconProbing,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface HostConsoleVirtualNic : HostVirtualNic\n    {\n        IPv6Address[] IPv6 { get; set; }\n\n        bool? AutomaticIPv6 { get; set; }\n\n        bool? IPv6ThroughDhcp { get; set; }\n\n        bool? IPv6Enabled { get; set; }\n    }\n\n    public interface HostNic : VIObjectCore, NamedObject, ExtensionData\n    {\n        string Id { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string DeviceName { get; set; }\n\n        string Mac { get; set; }\n\n        bool DhcpEnabled { get; set; }\n\n        string IP { get; set; }\n\n        string SubnetMask { get; set; }\n    }\n\n    public interface HostVirtualNic : HostNic\n    {\n        string PortGroupName { get; set; }\n    }\n\n    public interface HostVMKernelVirtualNic : HostVirtualNic\n    {\n        bool VMotionEnabled { get; set; }\n\n        bool? FaultToleranceLoggingEnabled { get; set; }\n\n        IPv6Address[] IPv6 { get; set; }\n\n        bool? AutomaticIPv6 { get; set; }\n\n        bool? IPv6ThroughDhcp { get; set; }\n\n        bool? IPv6Enabled { get; set; }\n\n        int? Mtu { get; set; }\n\n        bool? ManagementTrafficEnabled { get; set; }\n\n        bool? VsanTrafficEnabled { get; set; }\n    }\n\n    public interface PhysicalNic : HostNic\n    {\n        long BitRatePerSec { get; set; }\n\n        bool FullDuplex { get; set; }\n\n        bool? WakeOnLanSupported { get; set; }\n    }\n\n    public enum HostVirtualNicType\n    {\n        ConsoleNic,\n        VirtualNic\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.Profile\n{\n    using System.Security;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface VMHostProfile : VIObject, ExtensionData\n    {\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n\n        string Description { get; set; }\n\n        string ReferenceHostId { get; set; }\n\n        VMHost ReferenceHost { get; set; }\n    }\n\n    public interface VMHostProfileImageCacheConfiguration : VIObjectCore\n    {\n        VMHostProfileInstallationDevice InstallationDevice { get; set; }\n\n        VMHostProfileInstallationType InstallationType { get; set; }\n\n        string DiskArguments { get; set; }\n\n        bool? IgnoreSsd { get; set; }\n\n        bool? OverwriteVmfs { get; set; }\n\n        VMHostProfile HostProfile { get; set; }\n    }\n\n    public interface VMHostProfileIncompliance : VIObjectCore, ExtensionData\n    {\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string VMHostProfileId { get; set; }\n\n        VMHostProfile VMHostProfile { get; set; }\n\n        VMHostProfileIncomplianceElement[] IncomplianceElementList { get; set; }\n    }\n\n    public interface VMHostProfileIncomplianceElement : VIObjectCore\n    {\n        string PropertyName { get; set; }\n\n        string Description { get; set; }\n    }\n\n    public interface VMHostProfileInput\n    {\n        string Key { get; set; }\n\n        VMHostProfileInputType Type { get; set; }\n    }\n\n    public interface VMHostProfileStorageDeviceConfiguration : VIObjectCore\n    {\n        string DeviceName { get; set; }\n\n        bool IsSharedClusterwide { get; set; }\n\n        bool IsPerenniallyReserved { get; set; }\n\n        bool DeviceStateOn { get; set; }\n\n        int QueueFullThreshold { get; set; }\n\n        int QueueFullSampleSize { get; set; }\n\n        int NumReqOutstanding { get; set; }\n\n        string PspName { get; set; }\n\n        string ConfigInfo { get; set; }\n\n        VMHostProfile HostProfile { get; set; }\n    }\n\n    public interface VMHostProfileUserConfiguration : VIObjectCore\n    {\n        string UserName { get; set; }\n\n        string Role { get; set; }\n\n        string Description { get; set; }\n\n        VMHostProfilePasswordPolicy PasswordPolicy { get; set; }\n\n        SecureString Password { get; set; }\n\n        VMHostProfile HostProfile { get; set; }\n    }\n\n    public interface VMHostProfileVmPortGroupConfiguration : VIObjectCore\n    {\n        string PortGroupName { get; set; }\n\n        string VSwitchName { get; set; }\n\n        int VLanId { get; set; }\n\n        VMHostProfile HostProfile { get; set; }\n    }\n\n    public enum VMHostProfileComplianceStatus\n    {\n        Compliant,\n        NonCompliant,\n        Unknown\n    }\n\n    public enum VMHostProfileInputType\n    {\n        Required,\n        Inapplicable\n    }\n\n    public enum VMHostProfileInstallationDevice\n    {\n        None,\n        Disk,\n        Usb\n    }\n\n    public enum VMHostProfileInstallationType\n    {\n        StatelessCaching,\n        StatefulInstall,\n        Default\n    }\n\n    public enum VMHostProfilePasswordPolicy\n    {\n        Default,\n        UserInput,\n        Fixed\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.Storage\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface FibreChannelHba : Hba\n    {\n        long NodeWorldWideName { get; set; }\n\n        FibreChannelPortType PortType { get; set; }\n\n        long PortWorldWideName { get; set; }\n\n        long Speed { get; set; }\n    }\n\n    public interface Hba : VIObjectCore, NamedObject, ExtensionData\n    {\n        string Device { get; set; }\n\n        string Key { get; set; }\n\n        string Model { get; set; }\n\n        string Pci { get; set; }\n\n        string Driver { get; set; }\n\n        int Bus { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        string Status { get; set; }\n\n        HbaType Type { get; set; }\n\n        string[] ScsiLunUids { get; set; }\n    }\n\n    public interface HostFileSystemVolumeInfo : VIObjectCore\n    {\n        string AccessMode { get; set; }\n\n        string Path { get; set; }\n\n        long Capacity { get; set; }\n\n        decimal CapacityGB { get; set; }\n\n        string Name { get; set; }\n\n        string Type { get; set; }\n    }\n\n    public interface IScsiHba : Hba\n    {\n        IScsiHbaAuthenticationCapability AuthenticationCapability { get; set; }\n\n        IScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        int? CurrentSpeedMb { get; set; }\n\n        string IScsiAlias { get; set; }\n\n        string IScsiName { get; set; }\n\n        bool IsSoftwareBased { get; set; }\n\n        int? MaxSpeedMb { get; set; }\n    }\n\n    public interface IScsiHbaAuthenticationCapability : VIObjectCore\n    {\n        bool Chap { get; set; }\n\n        bool Krb5 { get; set; }\n\n        bool? MutualChap { get; set; }\n\n        bool Spkm { get; set; }\n\n        bool Srp { get; set; }\n\n        bool? TargetChap { get; set; }\n\n        bool? TargetMutualChap { get; set; }\n    }\n\n    public interface IScsiHbaAuthenticationProperties : VIObjectCore\n    {\n        ChapType? ChapType { get; set; }\n\n        bool? ChapInherited { get; set; }\n\n        string ChapName { get; set; }\n\n        bool? MutualChapEnabled { get; set; }\n\n        bool? MutualChapInherited { get; set; }\n\n        string MutualChapName { get; set; }\n    }\n\n    public interface IScsiHbaSendTarget : IScsiHbaTarget\n    {\n    }\n\n    public interface IScsiHbaStaticTarget : IScsiHbaTarget\n    {\n        string IScsiName { get; set; }\n    }\n\n    public interface IScsiHbaTarget : VIObjectCore, NamedObject, ExtensionData\n    {\n        string Address { get; set; }\n\n        int? Port { get; set; }\n\n        string IScsiHbaKey { get; set; }\n\n        IScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        IScsiHbaTargetType Type { get; set; }\n\n        string IScsiHbaName { get; set; }\n    }\n\n    public interface VMHostDisk : VIObjectCore, ExtensionData\n    {\n        string Id { get; set; }\n\n        string DeviceName { get; set; }\n\n        long Cylinders { get; set; }\n\n        int Heads { get; set; }\n\n        int Sectors { get; set; }\n\n        long TotalSectors { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        ScsiLun ScsiLun { get; set; }\n    }\n\n    public interface VMHostDiskPartition : VIObjectCore, ExtensionData\n    {\n        string Id { get; set; }\n\n        int PartitionNumber { get; set; }\n\n        sbyte Attributes { get; set; }\n\n        bool Logical { get; set; }\n\n        long StartSector { get; set; }\n\n        long EndSector { get; set; }\n\n        VMHostDiskPartitionType Type { get; set; }\n\n        VMHostDisk VMHostDisk { get; set; }\n    }\n\n    public interface VMHostStorageInfo : VIObject, ExtensionData\n    {\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        HostFileSystemVolumeInfo[] FileSystemVolumeInfo { get; set; }\n\n        bool SoftwareIScsiEnabled { get; set; }\n\n        ScsiLun[] ScsiLun { get; set; }\n    }\n\n    public enum ChapType\n    {\n        Prohibited,\n        Discouraged,\n        Preferred,\n        Required\n    }\n\n    public enum FibreChannelPortType\n    {\n        Fabric,\n        Loop,\n        PointToPoint,\n        Unknown\n    }\n\n    public enum HbaType\n    {\n        Block,\n        FibreChannel,\n        IScsi,\n        ParallelScsi\n    }\n\n    public enum IScsiHbaTargetType\n    {\n        Static,\n        Send\n    }\n\n    public enum VMHostDiskPartitionType\n    {\n        None,\n        Extended,\n        LinuxNative,\n        LinuxSwap,\n        Ntfs,\n        Vmfs,\n        VmkDiagnostic,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface ScsiLun : VIObjectCore, ExtensionData\n    {\n        string Id { get; set; }\n\n        string CanonicalName { get; set; }\n\n        string RuntimeName { get; set; }\n\n        string Key { get; set; }\n\n        string LunType { get; set; }\n\n        string Model { get; set; }\n\n        string SerialNumber { get; set; }\n\n        string Vendor { get; set; }\n\n        string ConsoleDeviceName { get; set; }\n\n        long? CapacityMB { get; set; }\n\n        decimal? CapacityGB { get; set; }\n\n        ScsiLunMultipathPolicy MultipathPolicy { get; set; }\n\n        int? CommandsToSwitchPath { get; set; }\n\n        int? BlocksToSwitchPath { get; set; }\n\n        string HostId { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        bool IsLocal { get; set; }\n\n        bool? IsSsd { get; set; }\n\n        ScsiDiskVsanStatus VsanStatus { get; set; }\n    }\n\n    public interface ScsiLunPath : VIObjectCore, ExtensionData, NamedObject\n    {\n        string ScsiLunId { get; set; }\n\n        ScsiLun ScsiLun { get; set; }\n\n        new string Name { get; set; }\n\n        string LunPath { get; set; }\n\n        string SanId { get; set; }\n\n        ScsiLunPathState State { get; set; }\n\n        bool Preferred { get; set; }\n\n        string ScsiCanonicalName { get; set; }\n    }\n\n    public enum ScsiDiskVsanStatus\n    {\n        Unknown,\n        Eligible,\n        Ineligible,\n        InUse\n    }\n\n    public enum ScsiLunMultipathPolicy\n    {\n        Fixed,\n        MostRecentlyUsed,\n        RoundRobin,\n        Unknown\n    }\n\n    public enum ScsiLunPathState\n    {\n        Active,\n        Dead,\n        Disabled,\n        Standby,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface StartPolicy : ExtensionData\n    {\n        int StartDelay { get; set; }\n\n        VmStopAction StopAction { get; set; }\n\n        int StopDelay { get; set; }\n\n        bool WaitForHeartbeat { get; set; }\n    }\n\n    public interface VMHostStartPolicy : StartPolicy, VIObjectCore\n    {\n        bool Enabled { get; set; }\n    }\n\n    public interface VMStartPolicy : StartPolicy, VIObjectCore\n    {\n        string VirtualMachineId { get; set; }\n\n        string VMId { get; set; }\n\n        VirtualMachine VM { get; set; }\n\n        VmStartAction StartAction { get; set; }\n\n        int? StartOrder { get; set; }\n    }\n\n    public enum VmStartAction\n    {\n        None,\n        PowerOn\n    }\n\n    public enum VmStopAction\n    {\n        None,\n        Suspend,\n        PowerOff,\n        GuestShutdown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Inventory\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Cluster;\n    using VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement;\n    using VMware.VimAutomation.ViCore.Types.V1.Host;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Storage;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n    using VMware.VimAutomation.ViCore.Types.V1.VM;\n    using VMware.VimAutomation.ViCore.Types.V1.VM.Guest;\n    using VMware.VimAutomation.ViCore.Types.V1.Vsan;\n\n    public interface Cluster : VIContainer, DatastoreRelatedObjectBase\n    {\n        string ParentId { get; set; }\n\n        Folder ParentFolder { get; set; }\n\n        bool HAEnabled { get; set; }\n\n        bool HAAdmissionControlEnabled { get; set; }\n\n        int HAFailoverLevel { get; set; }\n\n        HARestartPriority? HARestartPriority { get; set; }\n\n        HAIsolationResponse? HAIsolationResponse { get; set; }\n\n        VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        bool DrsEnabled { get; set; }\n\n        DrsMode DrsMode { get; set; }\n\n        DrsAutomationLevel DrsAutomationLevel { get; set; }\n\n        int? HATotalSlots { get; set; }\n\n        int? HAUsedSlots { get; set; }\n\n        int? HAAvailableSlots { get; set; }\n\n        int? HASlotCpuMHz { get; set; }\n\n        int? HASlotMemoryMb { get; set; }\n\n        decimal? HASlotMemoryGB { get; set; }\n\n        int? HASlotNumVCpus { get; set; }\n\n        bool? VsanEnabled { get; set; }\n\n        VsanDiskClaimMode? VsanDiskClaimMode { get; set; }\n\n        string EVCMode { get; set; }\n    }\n\n    public interface Datacenter : FolderContainer, DatastoreRelatedObjectBase\n    {\n        string ParentFolderId { get; set; }\n\n        Folder ParentFolder { get; set; }\n    }\n\n    public interface Folder : FolderContainer, DatastoreRelatedObjectBase\n    {\n        string ParentId { get; set; }\n\n        InventoryItem Parent { get; set; }\n\n        bool IsChildTypeVm { get; set; }\n\n        bool IsChildTypeComputeResource { get; set; }\n\n        bool IsChildTypeDatacenter { get; set; }\n\n        bool IsChildTypeDatastore { get; set; }\n\n        FolderType Type { get; set; }\n    }\n\n    public interface FolderContainer : VIContainer\n    {\n    }\n\n    public interface InventoryItem : VIObject, ExtensionData\n    {\n    }\n\n    public interface ResourcePool : VIContainer\n    {\n        string ParentId { get; set; }\n\n        InventoryItem Parent { get; set; }\n\n        SharesLevel CpuSharesLevel { get; set; }\n\n        int NumCpuShares { get; set; }\n\n        long CpuReservationMHz { get; set; }\n\n        bool CpuExpandableReservation { get; set; }\n\n        long CpuLimitMHz { get; set; }\n\n        SharesLevel MemSharesLevel { get; set; }\n\n        int NumMemShares { get; set; }\n\n        decimal MemReservationMB { get; set; }\n\n        decimal MemReservationGB { get; set; }\n\n        bool MemExpandableReservation { get; set; }\n\n        decimal MemLimitMB { get; set; }\n\n        decimal MemLimitGB { get; set; }\n    }\n\n    public interface Template : InventoryItem, DatastoreUser\n    {\n    }\n\n    public interface VApp : VIContainer\n    {\n        string ParentId { get; set; }\n\n        InventoryItem Parent { get; set; }\n\n        VAppStatus Status { get; set; }\n\n        int NumCpuShares { get; set; }\n\n        long CpuReservationMhz { get; set; }\n\n        bool CpuExpandableReservation { get; set; }\n\n        long CpuLimitMhz { get; set; }\n\n        SharesLevel CpuSharesLevel { get; set; }\n\n        int NumMemShares { get; set; }\n\n        long MemReservationMB { get; set; }\n\n        decimal MemReservationGB { get; set; }\n\n        bool MemExpandableReservation { get; set; }\n\n        long MemLimitMB { get; set; }\n\n        decimal MemLimitGB { get; set; }\n\n        SharesLevel MemSharesLevel { get; set; }\n    }\n\n    public interface VIContainer : InventoryItem\n    {\n    }\n\n    public interface VirtualMachine : InventoryItem, DatastoreUser, DatastoreRelatedObjectBase\n    {\n        PowerState PowerState { get; set; }\n\n        string Notes { get; set; }\n\n        VMGuest Guest { get; set; }\n\n        int NumCpu { get; set; }\n\n        int CoresPerSocket { get; set; }\n\n        decimal MemoryMB { get; set; }\n\n        decimal MemoryGB { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n\n        VApp VApp { get; set; }\n\n        string FolderId { get; set; }\n\n        Folder Folder { get; set; }\n\n        string ResourcePoolId { get; set; }\n\n        ResourcePool ResourcePool { get; set; }\n\n        HARestartPriority? HARestartPriority { get; set; }\n\n        HAIsolationResponse? HAIsolationResponse { get; set; }\n\n        DrsAutomationLevel? DrsAutomationLevel { get; set; }\n\n        VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        VMResourceConfiguration VMResourceConfiguration { get; set; }\n\n        VMVersion Version { get; set; }\n\n        string HardwareVersion { get; set; }\n\n        string PersistentId { get; set; }\n\n        string GuestId { get; set; }\n\n        decimal UsedSpaceGB { get; set; }\n\n        decimal ProvisionedSpaceGB { get; set; }\n    }\n\n    public interface VMHost : VIContainer, DatastoreUser, DatastoreRelatedObjectBase\n    {\n        string ParentId { get; set; }\n\n        VMHostState State { get; set; }\n\n        VMHostPowerState PowerState { get; set; }\n\n        string VMSwapfileDatastoreId { get; set; }\n\n        VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        VMHostTimeZone TimeZone { get; set; }\n\n        string Version { get; set; }\n\n        string Build { get; set; }\n\n        InventoryItem Parent { get; set; }\n\n        Datastore VMSwapfileDatastore { get; set; }\n\n        VMHostStorageInfo StorageInfo { get; set; }\n\n        VMHostNetworkInfo NetworkInfo { get; set; }\n\n        VMHostDiagnosticPartition DiagnosticPartition { get; set; }\n\n        VMHostFirewallDefaultPolicy FirewallDefaultPolicy { get; set; }\n\n        bool IsStandalone { get; set; }\n\n        VMHostState ConnectionState { get; set; }\n\n        string Manufacturer { get; set; }\n\n        string Model { get; set; }\n\n        int NumCpu { get; set; }\n\n        int CpuTotalMhz { get; set; }\n\n        int CpuUsageMhz { get; set; }\n\n        string LicenseKey { get; set; }\n\n        decimal MemoryTotalMB { get; set; }\n\n        decimal MemoryTotalGB { get; set; }\n\n        decimal MemoryUsageMB { get; set; }\n\n        decimal MemoryUsageGB { get; set; }\n\n        string ProcessorType { get; set; }\n\n        bool HyperthreadingActive { get; set; }\n\n        string MaxEVCMode { get; set; }\n    }\n\n    public enum FolderType\n    {\n        VM,\n        HostAndCluster,\n        Datastore,\n        Network,\n        Datacenter\n    }\n\n    public enum InventoryItemStatus\n    {\n        Green,\n        Yellow,\n        Red\n    }\n\n    public enum PowerState\n    {\n        PoweredOff,\n        PoweredOn,\n        Suspended\n    }\n\n    public enum VAppStatus\n    {\n        Started,\n        Starting,\n        Stopped,\n        Stopping\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.OSCustomization\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public interface OSCustomizationNicMapping : VIObjectCore, ExtensionData\n    {\n        string SpecId { get; set; }\n\n        OSCustomizationSpec Spec { get; set; }\n\n        string NetworkAdapterMac { get; set; }\n\n        int Position { get; set; }\n\n        OSCustomizationIPMode IPMode { get; set; }\n\n        string IPAddress { get; set; }\n\n        string SubnetMask { get; set; }\n\n        string DefaultGateway { get; set; }\n\n        string AlternateGateway { get; set; }\n    }\n\n    public interface OSCustomizationSpec : VIObject, ExtensionData\n    {\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n\n        string AdminPassword { get; set; }\n\n        int? AutoLogonCount { get; set; }\n\n        bool? ChangeSid { get; set; }\n\n        bool? DeleteAccounts { get; set; }\n\n        string Description { get; set; }\n\n        string[] DnsServer { get; set; }\n\n        string[] DnsSuffix { get; set; }\n\n        string Domain { get; set; }\n\n        string DomainAdminPassword { get; set; }\n\n        string DomainAdminUsername { get; set; }\n\n        string DomainPassword { get; set; }\n\n        string DomainUsername { get; set; }\n\n        string FullName { get; set; }\n\n        string[] GuiRunOnce { get; set; }\n\n        DateTime? LastUpdate { get; set; }\n\n        string NamingPrefix { get; set; }\n\n        NamingScheme? NamingScheme { get; set; }\n\n        string OrgName { get; set; }\n\n        OSType? OSType { get; set; }\n\n        string ProductKey { get; set; }\n\n        string TimeZone { get; set; }\n\n        string Workgroup { get; set; }\n\n        LicenseMode? LicenseMode { get; set; }\n\n        int? LicenseMaxConnections { get; set; }\n\n        OSCustomizationSpecType Type { get; set; }\n\n        sbyte[] EncryptionKey { get; set; }\n    }\n\n    public enum LicenseMode\n    {\n        PerSeat,\n        PerServer,\n        NotSpecified\n    }\n\n    public enum NamingScheme\n    {\n        Custom,\n        Fixed,\n        Prefix,\n        Vm\n    }\n\n    public enum OSCustomizationIPMode\n    {\n        UseDhcp,\n        PromptUser,\n        UseVCApplication,\n        UseStaticIP\n    }\n\n    public enum OSCustomizationSpecType\n    {\n        NonPersistent,\n        Persistent\n    }\n\n    public enum OSType\n    {\n        Windows,\n        Linux\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Ovf\n{\n    using System.Collections;\n\n    public interface OvfConfiguration\n    {\n        string Source { get; set; }\n\n        Hashtable ToHashTable();\n    }\n\n    public interface OvfProperty\n    {\n        string Key { get; set; }\n\n        object Value { get; set; }\n\n        object DefaultValue { get; set; }\n\n        string OvfTypeDescription { get; set; }\n\n        string Description { get; set; }\n\n        string GetPropertyPath();\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.PermissionManagement\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public interface Permission : VIObjectCore, ExtensionData\n    {\n        string EntityId { get; set; }\n\n        VIObject Entity { get; set; }\n\n        string Role { get; set; }\n\n        string Principal { get; set; }\n\n        bool Propagate { get; set; }\n\n        bool IsGroup { get; set; }\n    }\n\n    public interface Privilege : VIObjectCore, NamedObject, ExtensionData\n    {\n        string Description { get; set; }\n\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n\n        string Id { get; set; }\n    }\n\n    public interface PrivilegeGroup : Privilege\n    {\n        string[] PrivilegeList { get; set; }\n    }\n\n    public interface PrivilegeItem : Privilege\n    {\n        bool AppliedOnParent { get; set; }\n\n        string ParentGroupId { get; set; }\n\n        PrivilegeGroup ParentGroup { get; set; }\n    }\n\n    public interface Role : VIObjectCore, NamedObject, ExtensionData\n    {\n        int Id { get; set; }\n\n        string Description { get; set; }\n\n        bool IsSystem { get; set; }\n\n        string[] PrivilegeList { get; set; }\n\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n    }\n\n    public interface VIAccount : VIObjectCore, NamedObject, ExtensionData\n    {\n        string Id { get; set; }\n\n        VIServer Server { get; set; }\n\n        string Domain { get; set; }\n\n        string Description { get; set; }\n    }\n\n    public interface VIGroupAccount : VIAccount\n    {\n    }\n\n    public interface VIUserAccount : VIAccount\n    {\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.RelatedObject\n{\n    using System.Collections.Generic;\n\n    public interface ClusterRelatedObject : ClusterRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster> ToCuster();\n    }\n\n    public interface ClusterRelatedObjectBase\n    {\n    }\n\n    public interface DatacenterRelatedObject : DatacenterRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter> ToDatacenter();\n    }\n\n    public interface DatacenterRelatedObjectBase\n    {\n    }\n\n    public interface DatastoreClusterRelatedObject : DatastoreClusterRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.DatastoreCluster> ToDatastoreCluster();\n    }\n\n    public interface DatastoreClusterRelatedObjectBase\n    {\n    }\n\n    public interface DatastoreRelatedObject : DatastoreRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore> ToDatastore();\n    }\n\n    public interface DatastoreRelatedObjectBase\n    {\n    }\n\n    public interface FolderRelatedObject : FolderRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder> ToFolder();\n    }\n\n    public interface FolderRelatedObjectBase\n    {\n    }\n\n    public interface HardDiskRelatedObject : HardDiskRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk> ToHardDisk();\n    }\n\n    public interface HardDiskRelatedObjectBase\n    {\n    }\n\n    public interface NetworkAdapterRelatedObjectBase\n    {\n    }\n\n    public interface ResourcePoolRelatedObject : ResourcePoolRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool> ToResourcePool();\n    }\n\n    public interface ResourcePoolRelatedObjectBase\n    {\n    }\n\n    public interface VirtualPortGroupRelatedObject : VirtualPortGroupRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroupBase> ToVirtualPortGroup();\n    }\n\n    public interface VirtualPortGroupRelatedObjectBase\n    {\n    }\n\n    public interface VirtualSwitchRelatedObject : VirtualSwitchRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitchBase> ToVirtualSwitch();\n    }\n\n    public interface VirtualSwitchRelatedObjectBase\n    {\n    }\n\n    public interface VMHostRelatedObject : VMHostRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost> ToVMHost();\n    }\n\n    public interface VMHostRelatedObjectBase\n    {\n    }\n\n    public interface VmRelatedObject : VmRelatedObjectBase\n    {\n        IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine> ToVirtualMachine();\n    }\n\n    public interface VmRelatedObjectBase\n    {\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Security\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n\n    public interface KmipCertificateInfo\n    {\n        string Subject { get; set; }\n\n        string Issuer { get; set; }\n\n        string SerialNumber { get; set; }\n\n        DateTime StartDate { get; set; }\n\n        DateTime ExpiryDate { get; set; }\n\n        string Fingerprint { get; set; }\n\n        DateTime CheckTime { get; set; }\n    }\n\n    public interface KmsCluster : VIObject\n    {\n        bool UseAsDefaultKeyProvider { get; set; }\n\n        string ClientCertificate { get; set; }\n\n        DateTime? ClientCertificateExpiryDate { get; set; }\n\n        KmipCertificateInfo ClientCertificateInfo { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Stat\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public interface FloatSample\n    {\n        float Value { get; set; }\n    }\n\n    public interface LongSample\n    {\n        long Value { get; set; }\n    }\n\n    public interface Sample : VIObjectCore\n    {\n        DateTime Timestamp { get; set; }\n\n        string MetricId { get; set; }\n\n        string Description { get; set; }\n\n        string Unit { get; set; }\n\n        VIObject Entity { get; set; }\n\n        string EntityId { get; set; }\n\n        int IntervalSecs { get; set; }\n\n        string Instance { get; set; }\n    }\n\n    public interface StatInterval : VIObjectCore, NamedObject, ExtensionData\n    {\n        string ServerId { get; set; }\n\n        VIServer Server { get; set; }\n\n        int SamplingPeriodSecs { get; set; }\n\n        int StorageTimeSecs { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Storage\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public interface ReplicationGroup : VIObject, AdvancedOption\n    {\n    }\n\n    public interface StoragePolicy : VIObject, AdvancedOption\n    {\n    }\n\n    public enum StoragePolicyTargetType\n    {\n        VmHomeAndHardDisks,\n        VmHome\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Storage.VDisk\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n\n    public interface FlatVDisk : VDisk\n    {\n        VDiskStorageFormat StorageFormat { get; set; }\n    }\n\n    public interface RawVDisk : VDisk\n    {\n        string DeviceName { get; set; }\n    }\n\n    public interface VDisk : VIObject, ExtensionData\n    {\n        string Filename { get; set; }\n\n        DiskType DiskType { get; set; }\n\n        Datastore Datastore { get; set; }\n\n        decimal CapacityGB { get; set; }\n    }\n\n    public enum VDiskStorageFormat\n    {\n        Thick,\n        Thin,\n        EagerZeroedThick,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Tagging\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public interface Tag : VIObject\n    {\n        TagCategory Category { get; set; }\n\n        string Description { get; set; }\n    }\n\n    public interface TagAssignment : VIObjectCore\n    {\n        Tag Tag { get; set; }\n\n        VIObjectCore Entity { get; set; }\n    }\n\n    public interface TagCategory : VIObject\n    {\n        string Description { get; set; }\n\n        Cardinality Cardinality { get; set; }\n\n        string[] EntityType { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.VirtualDevice\n{\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n\n    public interface CDDrive : VirtualDevice\n    {\n        string IsoPath { get; set; }\n\n        string HostDevice { get; set; }\n\n        string RemoteDevice { get; set; }\n    }\n\n    public interface ConnectInfo\n    {\n        bool? AllowGuestControl { get; set; }\n\n        bool? Connected { get; set; }\n\n        bool? StartConnected { get; set; }\n    }\n\n    public interface FlatHardDisk : HardDisk\n    {\n        VirtualDiskStorageFormat StorageFormat { get; set; }\n    }\n\n    public interface FloppyDrive : VirtualDevice\n    {\n        string FloppyImagePath { get; set; }\n\n        string HostDevice { get; set; }\n\n        string RemoteDevice { get; set; }\n    }\n\n    public interface HardDisk : VirtualDevice, DatastoreRelatedObjectBase\n    {\n        PersistencePolicy Persistence { get; set; }\n\n        DiskType DiskType { get; set; }\n\n        string Filename { get; set; }\n\n        long CapacityKB { get; set; }\n\n        decimal CapacityGB { get; set; }\n    }\n\n    public interface NetworkAdapter : VirtualDevice\n    {\n        string MacAddress { get; set; }\n\n        bool WakeOnLanEnabled { get; set; }\n\n        string NetworkName { get; set; }\n\n        VirtualNetworkAdapterType Type { get; set; }\n    }\n\n    public interface PassThroughDevice : VIObjectCore, ExtensionData, NamedObject\n    {\n        int? Key { get; set; }\n\n        new string Name { get; set; }\n\n        string VendorName { get; set; }\n\n        string VMId { get; set; }\n\n        VirtualMachine VM { get; set; }\n\n        string VMHostId { get; set; }\n\n        VMHost VMHost { get; set; }\n    }\n\n    public interface PciPassthroughDevice : PassThroughDevice\n    {\n        int DeviceId { get; set; }\n\n        int VendorId { get; set; }\n\n        int ClassId { get; set; }\n\n        int Bus { get; set; }\n\n        int Slot { get; set; }\n\n        int Function { get; set; }\n\n        PciPassthroughDeviceState State { get; set; }\n    }\n\n    public interface RawHardDisk : HardDisk\n    {\n        string DeviceName { get; set; }\n\n        string ScsiCanonicalName { get; set; }\n    }\n\n    public interface ScsiController : VirtualDevice\n    {\n        ScsiBusSharingMode BusSharingMode { get; set; }\n\n        ScsiControllerType Type { get; set; }\n\n        int UnitNumber { get; set; }\n    }\n\n    public interface ScsiPassthroughDevice : PassThroughDevice\n    {\n        int ControllerKey { get; set; }\n\n        int UnitNumber { get; set; }\n\n        string Class { get; set; }\n    }\n\n    public interface UsbDevice : VirtualDevice\n    {\n    }\n\n    public interface VirtualDevice : VIObject, ExtensionData\n    {\n        string ParentId { get; set; }\n\n        VIObject Parent { get; set; }\n\n        ConnectInfo ConnectionState { get; set; }\n    }\n\n    public enum DiskType\n    {\n        RawVirtual,\n        RawPhysical,\n        Flat,\n        Unknown\n    }\n\n    public enum PassthroughDeviceType\n    {\n        Pci,\n        Scsi\n    }\n\n    public enum PciPassthroughDeviceState\n    {\n        Enabled,\n        Active,\n        NeedsHostReboot\n    }\n\n    public enum PersistencePolicy\n    {\n        Persistent,\n        NonPersistent,\n        Undoable,\n        IndependentPersistent,\n        IndependentNonPersistent,\n        Unknown\n    }\n\n    public enum ScsiBusSharingMode\n    {\n        NoSharing,\n        Physical,\n        Virtual\n    }\n\n    public enum ScsiControllerType\n    {\n        Default,\n        ParaVirtual,\n        VirtualBusLogic,\n        VirtualLsiLogic,\n        VirtualLsiLogicSAS\n    }\n\n    public enum VirtualDiskStorageFormat\n    {\n        Thin2GB,\n        Thick,\n        Thick2GB,\n        Thin,\n        EagerZeroedThick\n    }\n\n    public enum VirtualNetworkAdapterType\n    {\n        Unknown,\n        E1000,\n        E1000e,\n        Flexible,\n        Vmxnet,\n        EnhancedVmxnet,\n        Vmxnet3\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.VM\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public interface RemoteConsoleVM : VIObject\n    {\n    }\n\n    public interface Snapshot : VIObject, ExtensionData\n    {\n        string Description { get; set; }\n\n        DateTime Created { get; set; }\n\n        bool Quiesced { get; set; }\n\n        PowerState PowerState { get; set; }\n\n        VirtualMachine VM { get; set; }\n\n        string VMId { get; set; }\n\n        Snapshot Parent { get; set; }\n\n        string ParentSnapshotId { get; set; }\n\n        Snapshot ParentSnapshot { get; set; }\n\n        Snapshot[] Children { get; set; }\n\n        decimal SizeMB { get; set; }\n\n        decimal? SizeGB { get; set; }\n\n        bool IsCurrent { get; set; }\n\n        bool IsReplaySupported { get; set; }\n    }\n\n    public interface VMDiskResourceConfiguration\n    {\n        int Key { get; set; }\n\n        int NumDiskShares { get; set; }\n\n        SharesLevel DiskSharesLevel { get; set; }\n\n        long? DiskLimitIOPerSecond { get; set; }\n    }\n\n    public interface VMQuestion : VIObjectCore, ExtensionData\n    {\n        string VMId { get; set; }\n\n        VirtualMachine VM { get; set; }\n\n        string QuestionId { get; set; }\n\n        string Text { get; set; }\n\n        VMQuestionOption[] Options { get; set; }\n\n        VMQuestionOption DefaultOption { get; set; }\n    }\n\n    public interface VMQuestionOption\n    {\n        string QuestionId { get; set; }\n\n        VMQuestion Question { get; set; }\n\n        string OptionId { get; set; }\n\n        string Label { get; set; }\n\n        string Summary { get; set; }\n    }\n\n    public interface VMResourceConfiguration : VIObjectCore\n    {\n        string VirtualMachineId { get; set; }\n\n        VirtualMachine VM { get; set; }\n\n        string VMId { get; set; }\n\n        int NumCpuShares { get; set; }\n\n        long CpuReservationMhz { get; set; }\n\n        long? CpuLimitMhz { get; set; }\n\n        SharesLevel CpuSharesLevel { get; set; }\n\n        int NumMemShares { get; set; }\n\n        long MemReservationMB { get; set; }\n\n        decimal MemReservationGB { get; set; }\n\n        long? MemLimitMB { get; set; }\n\n        decimal? MemLimitGB { get; set; }\n\n        SharesLevel MemSharesLevel { get; set; }\n\n        VMDiskResourceConfiguration[] DiskResourceConfiguration { get; set; }\n\n        HTCoreSharing HTCoreSharing { get; set; }\n\n        CpuAffinity CpuAffinity { get; set; }\n\n        int[] CpuAffinityList { get; set; }\n    }\n\n    public enum CpuAffinity\n    {\n        NoAffinity,\n        Cpu0,\n        Cpu1,\n        Cpu2,\n        Cpu3,\n        Cpu4,\n        Cpu5,\n        Cpu6,\n        Cpu7,\n        Cpu8,\n        Cpu9,\n        Cpu10,\n        Cpu11,\n        Cpu12,\n        Cpu13,\n        Cpu14,\n        Cpu15,\n        Cpu16,\n        Cpu17,\n        Cpu18,\n        Cpu19,\n        Cpu20,\n        Cpu21,\n        Cpu22,\n        Cpu23,\n        Cpu24,\n        Cpu25,\n        Cpu26,\n        Cpu27,\n        Cpu28,\n        Cpu29,\n        Cpu30,\n        Cpu31,\n        Cpu32,\n        Cpu33,\n        Cpu34,\n        Cpu35,\n        Cpu36,\n        Cpu37,\n        Cpu38,\n        Cpu39,\n        Cpu40,\n        Cpu41,\n        Cpu42,\n        Cpu43,\n        Cpu44,\n        Cpu45,\n        Cpu46,\n        Cpu47,\n        Cpu48,\n        Cpu49,\n        Cpu50,\n        Cpu51,\n        Cpu52,\n        Cpu53,\n        Cpu54,\n        Cpu55,\n        Cpu56,\n        Cpu57,\n        Cpu58,\n        Cpu59,\n        Cpu60,\n        Cpu61,\n        Cpu62,\n        Cpu63\n    }\n\n    public enum HTCoreSharing\n    {\n        Any,\n        None,\n        Internal\n    }\n\n    public enum VMVersion\n    {\n        Unknown,\n        V4,\n        V7,\n        V8,\n        V9,\n        V10,\n        V11,\n        V12,\n        V13,\n        V14\n    }\n\n    public class VFlashCacheMigrationOption : AdvancedOption, IEquatable<VFlashCacheMigrationOption>\n    {\n        public bool Equals(VFlashCacheMigrationOption vFlashCacheMigrationOption)\n        {\n            return (vFlashCacheMigrationOption != null);\n        }\n\n        public override bool Equals(object vFlashCacheMigrationOption)\n        {\n            return Equals(vFlashCacheMigrationOption as VFlashCacheMigrationOption);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.VM.Guest\n{\n    using System;\n    using System.Globalization;\n    using System.Text;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n\n    public interface DiskInfo\n    {\n        string Path { get; set; }\n\n        long Capacity { get; set; }\n\n        long FreeSpace { get; set; }\n\n        decimal CapacityGB { get; set; }\n\n        decimal FreeSpaceGB { get; set; }\n    }\n\n    public interface NicInfo\n    {\n        bool Connected { get; set; }\n\n        NetworkAdapter Device { get; set; }\n\n        string[] IPAddress { get; set; }\n\n        string MacAddress { get; set; }\n\n        string NetworkName { get; set; }\n    }\n\n    public interface VMGuest : VIObjectCore, ExtensionData\n    {\n        string OSFullName { get; set; }\n\n        string[] IPAddress { get; set; }\n\n        GuestState State { get; set; }\n\n        DiskInfo[] Disks { get; set; }\n\n        string HostName { get; set; }\n\n        NicInfo[] Nics { get; set; }\n\n        string VmId { get; set; }\n\n        VirtualMachine VM { get; set; }\n\n        string VmUid { get; set; }\n\n        string VmName { get; set; }\n\n        string GuestFamily { get; set; }\n\n        string GuestId { get; set; }\n\n        string ConfiguredGuestId { get; set; }\n\n        string RuntimeGuestId { get; set; }\n\n        string ToolsVersion { get; set; }\n    }\n\n    public interface VMScriptResult : VIObjectCore\n    {\n        VirtualMachine VM { get; set; }\n\n        int ExitCode { get; set; }\n\n        string ScriptOutput { get; set; }\n\n        int Length { get; set; }\n\n        char Item { get; set; }\n\n        bool Contains(string value);\n        void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count);\n        bool EndsWith(string value);\n        bool EndsWith(string value, StringComparison comparisonType);\n        bool EndsWith(string value, bool ignoreCase, CultureInfo culture);\n        bool Equals(object obj);\n        bool Equals(string value, StringComparison comparisonType);\n        int GetHashCode();\n        int IndexOf(char value, int startIndex, int count);\n        int IndexOf(char value);\n        int IndexOf(string value);\n        int IndexOf(char value, int startIndex);\n        int IndexOf(string value, int startIndex);\n        int IndexOf(string value, StringComparison comparisonType);\n        int IndexOf(string value, int startIndex, int count);\n        int IndexOf(string value, int startIndex, StringComparison comparisonType);\n        int IndexOf(string value, int startIndex, int count, StringComparison comparisonType);\n        int IndexOfAny(char[] anyOf);\n        int IndexOfAny(char[] anyOf, int startIndex);\n        int IndexOfAny(char[] anyOf, int startIndex, int count);\n        string Insert(int startIndex, string value);\n        bool IsNormalized();\n        bool IsNormalized(NormalizationForm normalizationForm);\n        int LastIndexOf(char value);\n        int LastIndexOf(string value);\n        int LastIndexOf(char value, int startIndex);\n        int LastIndexOf(string value, int startIndex);\n        int LastIndexOf(string value, StringComparison comparisonType);\n        int LastIndexOf(string value, int startIndex, int count);\n        int LastIndexOf(string value, int startIndex, StringComparison comparisonType);\n        int LastIndexOf(string value, int startIndex, int count, StringComparison comparisonType);\n        int LastIndexOf(char value, int startIndex, int count);\n        int LastIndexOfAny(char[] anyOf);\n        int LastIndexOfAny(char[] anyOf, int startIndex);\n        int LastIndexOfAny(char[] anyOf, int startIndex, int count);\n        string Normalize();\n        string Normalize(NormalizationForm normalizationForm);\n        string PadLeft(int totalWidth);\n        string PadLeft(int totalWidth, char paddingChar);\n        string PadRight(int totalWidth);\n        string PadRight(int totalWidth, char paddingChar);\n        string Remove(int startIndex);\n        string Remove(int startIndex, int count);\n        string Replace(char oldChar, char newChar);\n        string Replace(string oldValue, string newValue);\n        string[] Split(char[] separator);\n        string[] Split(char[] separator, int count);\n        string[] Split(char[] separator, StringSplitOptions options);\n        string[] Split(string[] separator, StringSplitOptions options);\n        string[] Split(char[] separator, int count, StringSplitOptions options);\n        string[] Split(string[] separator, int count, StringSplitOptions options);\n        bool StartsWith(string value);\n        bool StartsWith(string value, StringComparison comparisonType);\n        bool StartsWith(string value, bool ignoreCase, CultureInfo culture);\n        string Substring(int startIndex);\n        string Substring(int startIndex, int length);\n        char[] ToCharArray();\n        char[] ToCharArray(int startIndex, int length);\n        string ToLower();\n        string ToLower(CultureInfo culture);\n        string ToLowerInvariant();\n        string ToString();\n        string ToUpper();\n        string ToUpper(CultureInfo culture);\n        string ToUpperInvariant();\n        string Trim();\n        string Trim(char[] trimChars);\n        string TrimEnd(char[] trimChars);\n        string TrimStart(char[] trimChars);\n    }\n\n    public enum GuestState\n    {\n        NotRunning,\n        Resetting,\n        Running,\n        ShuttingDown,\n        Standby,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Types.V1.Vsan\n{\n    public enum VsanDataMigrationMode\n    {\n        Full,\n        EnsureAccessibility,\n        NoDataMigration\n    }\n\n    public enum VsanDiskClaimMode\n    {\n        Manual,\n        Automatic,\n        Unknown\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1\n{\n    using System;\n    using System.Collections.Generic;\n    using System.ComponentModel;\n    using System.IO;\n    using System.Linq;\n    using System.Runtime.Serialization;\n    using System.Security;\n    using VMware.Vim;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n\n    public class AdvancedSettingImpl : AdvancedSetting, IEquatable<AdvancedSettingImpl>\n    {\n        public string Uid { get; set; }\n\n        public object Value { get; set; }\n\n        public string Description { get; set; }\n\n        public AdvancedSettingType? Type { get; set; }\n\n        public VIObject Entity { get; set; }\n\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(AdvancedSettingImpl advancedSettingImpl)\n        {\n            return (advancedSettingImpl != null && this.Uid == advancedSettingImpl.Uid && ((this.Value == null && advancedSettingImpl.Value == null) || (this.Value != null && this.Value.Equals(advancedSettingImpl.Value))) && this.Description == advancedSettingImpl.Description && this.Type == advancedSettingImpl.Type && ((this.Entity == null && advancedSettingImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(advancedSettingImpl.Entity))) && this.Id == advancedSettingImpl.Id && this.Name == advancedSettingImpl.Name);\n        }\n\n        public override bool Equals(object advancedSettingImpl)\n        {\n            return this.Equals(advancedSettingImpl as AdvancedSettingImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Value + \"_\" + Description + \"_\" + Type + \"_\" + Entity + \"_\" + Id + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class ConnectInfoImpl : ConnectInfo, IEquatable<ConnectInfoImpl>\n    {\n        public bool? AllowGuestControl { get; set; }\n\n        public bool? Connected { get; set; }\n\n        public bool? StartConnected { get; set; }\n\n        public bool Equals(ConnectInfoImpl connectInfoImpl)\n        {\n            return (connectInfoImpl != null && ((this.AllowGuestControl == null && connectInfoImpl.AllowGuestControl == null) || (this.AllowGuestControl != null && this.AllowGuestControl.Equals(connectInfoImpl.AllowGuestControl))) && ((this.Connected == null && connectInfoImpl.Connected == null) || (this.Connected != null && this.Connected.Equals(connectInfoImpl.Connected))) && ((this.StartConnected == null && connectInfoImpl.StartConnected == null) || (this.StartConnected != null && this.StartConnected.Equals(connectInfoImpl.StartConnected))));\n        }\n\n        public override bool Equals(object connectInfoImpl)\n        {\n            return Equals(connectInfoImpl as ConnectInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowGuestControl + \"_\" + Connected + \"_\" + StartConnected).GetHashCode();\n        }\n    }\n\n    public class DescriptionImpl : VMware.VimAutomation.ViCore.Types.V1.Description, IEquatable<DescriptionImpl>\n    {\n        public string Label { get; set; }\n\n        public string Summary { get; set; }\n\n        public bool Equals(DescriptionImpl descriptionImpl)\n        {\n            return (descriptionImpl != null && this.Label == descriptionImpl.Label && this.Summary == descriptionImpl.Summary);\n        }\n\n        public override bool Equals(object descriptionImpl)\n        {\n            return Equals(descriptionImpl as DescriptionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Label + \"_\" + Summary).GetHashCode();\n        }\n    }\n\n    public class ElementInfoImpl : IEquatable<ElementInfoImpl>\n    {\n        public string Type { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Optional { get; set; }\n\n        public bool Equals(ElementInfoImpl elementInfoImpl)\n        {\n            return (elementInfoImpl != null && this.Type == elementInfoImpl.Type && this.Name == elementInfoImpl.Name && this.Optional == elementInfoImpl.Optional);\n        }\n\n        public override bool Equals(object elementInfoImpl)\n        {\n            return Equals(elementInfoImpl as ElementInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Name + \"_\" + Optional).GetHashCode();\n        }\n    }\n\n    public class IPv6AddressImpl : IPv6Address, IEquatable<IPv6AddressImpl>\n    {\n        public string Address { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public bool Equals(IPv6AddressImpl iPv6AddressImpl)\n        {\n            return (iPv6AddressImpl != null && this.Address == iPv6AddressImpl.Address && this.PrefixLength == iPv6AddressImpl.PrefixLength);\n        }\n\n        public override bool Equals(object iPv6AddressImpl)\n        {\n            return Equals(iPv6AddressImpl as IPv6AddressImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Address + \"_\" + PrefixLength).GetHashCode();\n        }\n    }\n\n    public class LogDescriptorImpl : LogDescriptor, IEquatable<LogDescriptorImpl>\n    {\n        public string SourceEntityId { get; set; }\n\n        public string Creator { get; set; }\n\n        public string Filename { get; set; }\n\n        public string Format { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Description Info { get; set; }\n\n        public string Key { get; set; }\n\n        public string MimeType { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(LogDescriptorImpl logDescriptorImpl)\n        {\n            return (logDescriptorImpl != null && this.SourceEntityId == logDescriptorImpl.SourceEntityId && this.Creator == logDescriptorImpl.Creator && this.Filename == logDescriptorImpl.Filename && this.Format == logDescriptorImpl.Format && ((this.Info == null && logDescriptorImpl.Info == null) || (this.Info != null && this.Info.Equals(logDescriptorImpl.Info))) && this.Key == logDescriptorImpl.Key && this.MimeType == logDescriptorImpl.MimeType && ((this.ExtensionData == null && logDescriptorImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(logDescriptorImpl.ExtensionData))) && this.Uid == logDescriptorImpl.Uid);\n        }\n\n        public override bool Equals(object logDescriptorImpl)\n        {\n            return Equals(logDescriptorImpl as LogDescriptorImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SourceEntityId + \"_\" + Creator + \"_\" + Filename + \"_\" + Format + \"_\" + Info + \"_\" + Key + \"_\" + MimeType + \"_\" + ExtensionData + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class PartialObjectImpl : VIObjectImpl, IEquatable<PartialObjectImpl>\n    {\n        public Type Type { get; set; }\n\n        public bool Equals(PartialObjectImpl partialObjectImpl)\n        {\n            return (partialObjectImpl != null && ((this.Type == null && partialObjectImpl.Type == null) || (this.Type != null && this.Type.Equals(partialObjectImpl.Type))) && this.Id == partialObjectImpl.Id && this.Name == partialObjectImpl.Name && this.Uid == partialObjectImpl.Uid);\n        }\n\n        public override bool Equals(object partialObjectImpl)\n        {\n            return Equals(partialObjectImpl as PartialObjectImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Type + \"_\" + Id + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class PowerCLIConfigurationImpl : PowerCLIConfiguration, IEquatable<PowerCLIConfigurationImpl>\n    {\n        public DefaultVIServerMode? DefaultVIServerMode { get; set; }\n\n        public ProxyPolicy? ProxyPolicy { get; set; }\n\n        public bool? ParticipateInCEIP { get; set; }\n\n        public ProxyPolicy? CEIPDataTransferProxyPolicy { get; set; }\n\n        public bool? DisplayDeprecationWarnings { get; set; }\n\n        public BadCertificateAction? InvalidCertificateAction { get; set; }\n\n        public int? WebOperationTimeoutSeconds { get; set; }\n\n        public string VMConsoleWindowBrowser { get; set; }\n\n        public ConfigurationScope Scope { get; set; }\n\n        public bool Equals(PowerCLIConfigurationImpl powerCLIConfigurationImpl)\n        {\n            return (powerCLIConfigurationImpl != null && ((this.DefaultVIServerMode == null && powerCLIConfigurationImpl.DefaultVIServerMode == null) || (this.DefaultVIServerMode != null && this.DefaultVIServerMode.Equals(powerCLIConfigurationImpl.DefaultVIServerMode))) && ((this.ProxyPolicy == null && powerCLIConfigurationImpl.ProxyPolicy == null) || (this.ProxyPolicy != null && this.ProxyPolicy.Equals(powerCLIConfigurationImpl.ProxyPolicy))) && ((this.ParticipateInCEIP == null && powerCLIConfigurationImpl.ParticipateInCEIP == null) || (this.ParticipateInCEIP != null && this.ParticipateInCEIP.Equals(powerCLIConfigurationImpl.ParticipateInCEIP))) && ((this.CEIPDataTransferProxyPolicy == null && powerCLIConfigurationImpl.CEIPDataTransferProxyPolicy == null) || (this.CEIPDataTransferProxyPolicy != null && this.CEIPDataTransferProxyPolicy.Equals(powerCLIConfigurationImpl.CEIPDataTransferProxyPolicy))) && ((this.DisplayDeprecationWarnings == null && powerCLIConfigurationImpl.DisplayDeprecationWarnings == null) || (this.DisplayDeprecationWarnings != null && this.DisplayDeprecationWarnings.Equals(powerCLIConfigurationImpl.DisplayDeprecationWarnings))) && ((this.InvalidCertificateAction == null && powerCLIConfigurationImpl.InvalidCertificateAction == null) || (this.InvalidCertificateAction != null && this.InvalidCertificateAction.Equals(powerCLIConfigurationImpl.InvalidCertificateAction))) && ((this.WebOperationTimeoutSeconds == null && powerCLIConfigurationImpl.WebOperationTimeoutSeconds == null) || (this.WebOperationTimeoutSeconds != null && this.WebOperationTimeoutSeconds.Equals(powerCLIConfigurationImpl.WebOperationTimeoutSeconds))) && this.VMConsoleWindowBrowser == powerCLIConfigurationImpl.VMConsoleWindowBrowser && this.Scope == powerCLIConfigurationImpl.Scope);\n        }\n\n        public override bool Equals(object powerCLIConfigurationImpl)\n        {\n            return Equals(powerCLIConfigurationImpl as PowerCLIConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DefaultVIServerMode + \"_\" + ProxyPolicy + \"_\" + ParticipateInCEIP + \"_\" + CEIPDataTransferProxyPolicy + \"_\" + DisplayDeprecationWarnings + \"_\" + InvalidCertificateAction + \"_\" + WebOperationTimeoutSeconds + \"_\" + VMConsoleWindowBrowser + \"_\" + Scope).GetHashCode();\n        }\n    }\n\n    public class PowerCLIVersionImpl : PowerCLIVersion, IEquatable<PowerCLIVersionImpl>\n    {\n        public int Major { get; set; }\n\n        public int Minor { get; set; }\n\n        public int Build { get; set; }\n\n        public int Revision { get; set; }\n\n        public string Copyright { get; set; }\n\n        public string Company { get; set; }\n\n        public string UserFriendlyVersion { get; set; }\n\n        public SnapinVersion[] SnapinVersions { get; set; }\n\n        public bool Equals(PowerCLIVersionImpl powerCLIVersionImpl)\n        {\n            return (powerCLIVersionImpl != null && this.Major == powerCLIVersionImpl.Major && this.Minor == powerCLIVersionImpl.Minor && this.Build == powerCLIVersionImpl.Build && this.Revision == powerCLIVersionImpl.Revision && this.Copyright == powerCLIVersionImpl.Copyright && this.Company == powerCLIVersionImpl.Company && this.UserFriendlyVersion == powerCLIVersionImpl.UserFriendlyVersion && ((this.SnapinVersions == null && powerCLIVersionImpl.SnapinVersions == null) || (this.SnapinVersions != null && powerCLIVersionImpl.SnapinVersions != null && Enumerable.SequenceEqual(this.SnapinVersions, powerCLIVersionImpl.SnapinVersions))));\n        }\n\n        public override bool Equals(object powerCLIVersionImpl)\n        {\n            return Equals(powerCLIVersionImpl as PowerCLIVersionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Major + \"_\" + Minor + \"_\" + Build + \"_\" + Revision + \"_\" + Copyright + \"_\" + Company + \"_\" + UserFriendlyVersion + \"_\" + SnapinVersions).GetHashCode();\n        }\n    }\n\n    public class VimExtensionServerInfoImpl : IEquatable<VimExtensionServerInfoImpl>\n    {\n        public string[] AdminEmail { get; set; }\n\n        public string Company { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Description Description { get; set; }\n\n        public string Type { get; set; }\n\n        public string Url { get; set; }\n\n        public bool Equals(VimExtensionServerInfoImpl vimExtensionServerInfoImpl)\n        {\n            return (vimExtensionServerInfoImpl != null && ((this.AdminEmail == null && vimExtensionServerInfoImpl.AdminEmail == null) || (this.AdminEmail != null && vimExtensionServerInfoImpl.AdminEmail != null && Enumerable.SequenceEqual(this.AdminEmail, vimExtensionServerInfoImpl.AdminEmail))) && this.Company == vimExtensionServerInfoImpl.Company && ((this.Description == null && vimExtensionServerInfoImpl.Description == null) || (this.Description != null && this.Description.Equals(vimExtensionServerInfoImpl.Description))) && this.Type == vimExtensionServerInfoImpl.Type && this.Url == vimExtensionServerInfoImpl.Url);\n        }\n\n        public override bool Equals(object vimExtensionServerInfoImpl)\n        {\n            return Equals(vimExtensionServerInfoImpl as VimExtensionServerInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AdminEmail + \"_\" + Company + \"_\" + Description + \"_\" + Type + \"_\" + Url).GetHashCode();\n        }\n    }\n\n    public class VIObjectImpl : VIObject, IEquatable<VIObjectImpl>\n    {\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VIObjectImpl vIObjectImpl)\n        {\n            return (vIObjectImpl != null && this.Id == vIObjectImpl.Id && this.Name == vIObjectImpl.Name && this.Uid == vIObjectImpl.Uid);\n        }\n\n        public override bool Equals(object vIObjectImpl)\n        {\n            return Equals(vIObjectImpl as VIObjectImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VIServerImpl : VIServer, IEquatable<VIServerImpl>\n    {\n        public bool IsConnected { get; set; }\n\n        public string Id { get; set; }\n\n        public Uri ServiceUri { get; set; }\n\n        public string SessionSecret { get; set; }\n\n        public string Name { get; set; }\n\n        public int Port { get; set; }\n\n        public string SessionId { get; set; }\n\n        public string User { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Version { get; set; }\n\n        public string Build { get; set; }\n\n        public string ProductLine { get; set; }\n\n        public string InstanceUuid { get; set; }\n\n        public int RefCount { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VIServerImpl vIServerImpl)\n        {\n            return (vIServerImpl != null && this.IsConnected == vIServerImpl.IsConnected && this.Id == vIServerImpl.Id && ((this.ServiceUri == null && vIServerImpl.ServiceUri == null) || (this.ServiceUri != null && this.ServiceUri.Equals(vIServerImpl.ServiceUri))) && this.SessionSecret == vIServerImpl.SessionSecret && this.Name == vIServerImpl.Name && this.Port == vIServerImpl.Port && this.SessionId == vIServerImpl.SessionId && this.User == vIServerImpl.User && this.Uid == vIServerImpl.Uid && this.Version == vIServerImpl.Version && this.Build == vIServerImpl.Build && this.ProductLine == vIServerImpl.ProductLine && this.InstanceUuid == vIServerImpl.InstanceUuid && this.RefCount == vIServerImpl.RefCount && ((this.ExtensionData == null && vIServerImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vIServerImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vIServerImpl)\n        {\n            return Equals(vIServerImpl as VIServerImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IsConnected + \"_\" + Id + \"_\" + ServiceUri + \"_\" + SessionSecret + \"_\" + Name + \"_\" + Port + \"_\" + SessionId + \"_\" + User + \"_\" + Uid + \"_\" + Version + \"_\" + Build + \"_\" + ProductLine + \"_\" + InstanceUuid + \"_\" + RefCount + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Alarm\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Alarm;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public abstract class AlarmActionImpl : AlarmAction, IEquatable<AlarmActionImpl>\n    {\n        public ActionType ActionType { get; set; }\n\n        public AlarmDefinition AlarmDefinition { get; set; }\n\n        public AlarmActionTrigger[] Trigger { get; set; }\n\n        public string Uid { get; set; }\n\n        public ulong AlarmVersion { get; set; }\n\n        public bool Equals(AlarmActionImpl alarmActionImpl)\n        {\n            return (alarmActionImpl != null && this.ActionType == alarmActionImpl.ActionType && ((this.AlarmDefinition == null && alarmActionImpl.AlarmDefinition == null) || (this.AlarmDefinition != null && this.AlarmDefinition.Equals(alarmActionImpl.AlarmDefinition))) && ((this.Trigger == null && alarmActionImpl.Trigger == null) || (this.Trigger != null && alarmActionImpl.Trigger != null && Enumerable.SequenceEqual(this.Trigger, alarmActionImpl.Trigger))) && this.Uid == alarmActionImpl.Uid && this.AlarmVersion == alarmActionImpl.AlarmVersion);\n        }\n\n        public override bool Equals(object alarmActionImpl)\n        {\n            return Equals(alarmActionImpl as AlarmActionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ActionType + \"_\" + AlarmDefinition + \"_\" + Trigger + \"_\" + Uid + \"_\" + AlarmVersion).GetHashCode();\n        }\n    }\n\n    public class AlarmActionTriggerImpl : AlarmActionTrigger, IEquatable<AlarmActionTriggerImpl>\n    {\n        public string Uid { get; set; }\n\n        public InventoryItemStatus StartStatus { get; set; }\n\n        public InventoryItemStatus EndStatus { get; set; }\n\n        public bool Repeat { get; set; }\n\n        public AlarmAction AlarmAction { get; set; }\n\n        public ulong AlarmVersion { get; set; }\n\n        public bool Equals(AlarmActionTriggerImpl alarmActionTriggerImpl)\n        {\n            return (alarmActionTriggerImpl != null && this.Uid == alarmActionTriggerImpl.Uid && this.StartStatus == alarmActionTriggerImpl.StartStatus && this.EndStatus == alarmActionTriggerImpl.EndStatus && this.Repeat == alarmActionTriggerImpl.Repeat && ((this.AlarmAction == null && alarmActionTriggerImpl.AlarmAction == null) || (this.AlarmAction != null && this.AlarmAction.Equals(alarmActionTriggerImpl.AlarmAction))) && this.AlarmVersion == alarmActionTriggerImpl.AlarmVersion);\n        }\n\n        public override bool Equals(object alarmActionTriggerImpl)\n        {\n            return Equals(alarmActionTriggerImpl as AlarmActionTriggerImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + StartStatus + \"_\" + EndStatus + \"_\" + Repeat + \"_\" + AlarmAction + \"_\" + AlarmVersion).GetHashCode();\n        }\n    }\n\n    public class AlarmDefinitionImpl : AlarmDefinition, IEquatable<AlarmDefinitionImpl>\n    {\n        public VIObject Entity { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public int ActionRepeatMinutes { get; set; }\n\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(AlarmDefinitionImpl alarmDefinitionImpl)\n        {\n            return (alarmDefinitionImpl != null && ((this.Entity == null && alarmDefinitionImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(alarmDefinitionImpl.Entity))) && this.Description == alarmDefinitionImpl.Description && this.Enabled == alarmDefinitionImpl.Enabled && this.Name == alarmDefinitionImpl.Name && ((this.ExtensionData == null && alarmDefinitionImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(alarmDefinitionImpl.ExtensionData))) && this.ActionRepeatMinutes == alarmDefinitionImpl.ActionRepeatMinutes && this.Id == alarmDefinitionImpl.Id && this.Uid == alarmDefinitionImpl.Uid);\n        }\n\n        public override bool Equals(object alarmDefinitionImpl)\n        {\n            return Equals(alarmDefinitionImpl as AlarmDefinitionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Entity + \"_\" + Description + \"_\" + Enabled + \"_\" + Name + \"_\" + ExtensionData + \"_\" + ActionRepeatMinutes + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class EmailActionImpl : AlarmActionImpl, EmailAction, IEquatable<EmailActionImpl>\n    {\n        public string Body { get; set; }\n\n        public string[] Cc { get; set; }\n\n        public string[] To { get; set; }\n\n        public string Subject { get; set; }\n\n        public bool Equals(EmailActionImpl emailActionImpl)\n        {\n            return (emailActionImpl != null && this.Body == emailActionImpl.Body && ((this.Cc == null && emailActionImpl.Cc == null) || (this.Cc != null && emailActionImpl.Cc != null && Enumerable.SequenceEqual(this.Cc, emailActionImpl.Cc))) && ((this.To == null && emailActionImpl.To == null) || (this.To != null && emailActionImpl.To != null && Enumerable.SequenceEqual(this.To, emailActionImpl.To))) && this.Subject == emailActionImpl.Subject && this.AlarmVersion == emailActionImpl.AlarmVersion && this.Uid == emailActionImpl.Uid && ((this.AlarmDefinition == null && emailActionImpl.AlarmDefinition == null) || (this.AlarmDefinition != null && this.AlarmDefinition.Equals(emailActionImpl.AlarmDefinition))) && ((this.Trigger == null && emailActionImpl.Trigger == null) || (this.Trigger != null && emailActionImpl.Trigger != null && Enumerable.SequenceEqual(this.Trigger, emailActionImpl.Trigger))) && this.ActionType == emailActionImpl.ActionType);\n        }\n\n        public override bool Equals(object emailActionImpl)\n        {\n            return Equals(emailActionImpl as EmailActionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Body + \"_\" + Cc + \"_\" + To + \"_\" + Subject + \"_\" + AlarmVersion + \"_\" + Uid + \"_\" + AlarmDefinition + \"_\" + Trigger + \"_\" + ActionType).GetHashCode();\n        }\n    }\n\n    public class ScriptActionImpl : AlarmActionImpl, ScriptAction, IEquatable<ScriptActionImpl>\n    {\n        public string ScriptFilePath { get; set; }\n\n        public bool Equals(ScriptActionImpl scriptActionImpl)\n        {\n            return (scriptActionImpl != null && this.ScriptFilePath == scriptActionImpl.ScriptFilePath && this.AlarmVersion == scriptActionImpl.AlarmVersion && this.Uid == scriptActionImpl.Uid && ((this.AlarmDefinition == null && scriptActionImpl.AlarmDefinition == null) || (this.AlarmDefinition != null && this.AlarmDefinition.Equals(scriptActionImpl.AlarmDefinition))) && ((this.Trigger == null && scriptActionImpl.Trigger == null) || (this.Trigger != null && scriptActionImpl.Trigger != null && Enumerable.SequenceEqual(this.Trigger, scriptActionImpl.Trigger))) && this.ActionType == scriptActionImpl.ActionType);\n        }\n\n        public override bool Equals(object scriptActionImpl)\n        {\n            return Equals(scriptActionImpl as ScriptActionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ScriptFilePath + \"_\" + AlarmVersion + \"_\" + Uid + \"_\" + AlarmDefinition + \"_\" + Trigger + \"_\" + ActionType).GetHashCode();\n        }\n    }\n\n    public class SnmpActionImpl : AlarmActionImpl, SnmpAction, IEquatable<SnmpActionImpl>\n    {\n        public bool Equals(SnmpActionImpl snmpActionImpl)\n        {\n            return (snmpActionImpl != null && this.AlarmVersion == snmpActionImpl.AlarmVersion && this.Uid == snmpActionImpl.Uid && ((this.AlarmDefinition == null && snmpActionImpl.AlarmDefinition == null) || (this.AlarmDefinition != null && this.AlarmDefinition.Equals(snmpActionImpl.AlarmDefinition))) && ((this.Trigger == null && snmpActionImpl.Trigger == null) || (this.Trigger != null && snmpActionImpl.Trigger != null && Enumerable.SequenceEqual(this.Trigger, snmpActionImpl.Trigger))) && this.ActionType == snmpActionImpl.ActionType);\n        }\n\n        public override bool Equals(object snmpActionImpl)\n        {\n            return Equals(snmpActionImpl as SnmpActionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AlarmVersion + \"_\" + Uid + \"_\" + AlarmDefinition + \"_\" + Trigger + \"_\" + ActionType).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.AnnotationManagement\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class AnnotationImpl : Annotation, IEquatable<AnnotationImpl>\n    {\n        public string AnnotatedEntityId { get; set; }\n\n        public InventoryItem AnnotatedEntity { get; set; }\n\n        public string Name { get; set; }\n\n        public string Value { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(AnnotationImpl annotationImpl)\n        {\n            return (annotationImpl != null && this.AnnotatedEntityId == annotationImpl.AnnotatedEntityId && ((this.AnnotatedEntity == null && annotationImpl.AnnotatedEntity == null) || (this.AnnotatedEntity != null && this.AnnotatedEntity.Equals(annotationImpl.AnnotatedEntity))) && this.Name == annotationImpl.Name && this.Value == annotationImpl.Value && this.Uid == annotationImpl.Uid);\n        }\n\n        public override bool Equals(object annotationImpl)\n        {\n            return Equals(annotationImpl as AnnotationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AnnotatedEntityId + \"_\" + AnnotatedEntity + \"_\" + Name + \"_\" + Value + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class CustomAttributeImpl : CustomAttribute, IEquatable<CustomAttributeImpl>\n    {\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public int Key { get; set; }\n\n        public string Name { get; set; }\n\n        public CustomAttributeTargetType? TargetType { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(CustomAttributeImpl customAttributeImpl)\n        {\n            return (customAttributeImpl != null && this.ServerId == customAttributeImpl.ServerId && ((this.Server == null && customAttributeImpl.Server == null) || (this.Server != null && this.Server.Equals(customAttributeImpl.Server))) && this.Key == customAttributeImpl.Key && this.Name == customAttributeImpl.Name && this.TargetType == customAttributeImpl.TargetType && this.Uid == customAttributeImpl.Uid);\n        }\n\n        public override bool Equals(object customAttributeImpl)\n        {\n            return Equals(customAttributeImpl as CustomAttributeImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerId + \"_\" + Server + \"_\" + Key + \"_\" + Name + \"_\" + TargetType + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Cluster\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Cluster;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public abstract class DrsClusterGroupImpl : DrsClusterGroup, IEquatable<DrsClusterGroupImpl>\n    {\n        public string Name { get; set; }\n\n        public DrsClusterGroupType GroupType { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Uid { get; set; }\n\n        public Cluster Cluster { get; set; }\n\n        public bool Equals(DrsClusterGroupImpl drsClusterGroupImpl)\n        {\n            return (drsClusterGroupImpl != null && this.Name == drsClusterGroupImpl.Name && this.GroupType == drsClusterGroupImpl.GroupType && ((this.ExtensionData == null && drsClusterGroupImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsClusterGroupImpl.ExtensionData))) && this.Uid == drsClusterGroupImpl.Uid && ((this.Cluster == null && drsClusterGroupImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsClusterGroupImpl.Cluster))));\n        }\n\n        public override bool Equals(object drsClusterGroupImpl)\n        {\n            return Equals(drsClusterGroupImpl as DrsClusterGroupImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + GroupType + \"_\" + ExtensionData + \"_\" + Uid + \"_\" + Cluster).GetHashCode();\n        }\n    }\n\n    public class DrsClusterVMGroupImpl : DrsClusterGroupImpl, DrsClusterVMGroup, IEquatable<DrsClusterVMGroupImpl>\n    {\n        public VirtualMachine[] Member { get; set; }\n\n        public bool Equals(DrsClusterVMGroupImpl drsClusterVMGroupImpl)\n        {\n            return (drsClusterVMGroupImpl != null && ((this.Member == null && drsClusterVMGroupImpl.Member == null) || (this.Member != null && drsClusterVMGroupImpl.Member != null && Enumerable.SequenceEqual(this.Member, drsClusterVMGroupImpl.Member))) && this.Uid == drsClusterVMGroupImpl.Uid && this.Name == drsClusterVMGroupImpl.Name && ((this.Cluster == null && drsClusterVMGroupImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsClusterVMGroupImpl.Cluster))) && ((this.ExtensionData == null && drsClusterVMGroupImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsClusterVMGroupImpl.ExtensionData))) && this.GroupType == drsClusterVMGroupImpl.GroupType);\n        }\n\n        public override bool Equals(object drsClusterVMGroupImpl)\n        {\n            return Equals(drsClusterVMGroupImpl as DrsClusterVMGroupImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Member + \"_\" + Uid + \"_\" + Name + \"_\" + Cluster + \"_\" + ExtensionData + \"_\" + GroupType).GetHashCode();\n        }\n    }\n\n    public class DrsClusterVMHostGroupImpl : DrsClusterGroupImpl, DrsClusterVMHostGroup, IEquatable<DrsClusterVMHostGroupImpl>\n    {\n        public VMHost[] Member { get; set; }\n\n        public bool Equals(DrsClusterVMHostGroupImpl drsClusterVMHostGroupImpl)\n        {\n            return (drsClusterVMHostGroupImpl != null && ((this.Member == null && drsClusterVMHostGroupImpl.Member == null) || (this.Member != null && drsClusterVMHostGroupImpl.Member != null && Enumerable.SequenceEqual(this.Member, drsClusterVMHostGroupImpl.Member))) && this.Uid == drsClusterVMHostGroupImpl.Uid && this.Name == drsClusterVMHostGroupImpl.Name && ((this.Cluster == null && drsClusterVMHostGroupImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsClusterVMHostGroupImpl.Cluster))) && ((this.ExtensionData == null && drsClusterVMHostGroupImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsClusterVMHostGroupImpl.ExtensionData))) && this.GroupType == drsClusterVMHostGroupImpl.GroupType);\n        }\n\n        public override bool Equals(object drsClusterVMHostGroupImpl)\n        {\n            return Equals(drsClusterVMHostGroupImpl as DrsClusterVMHostGroupImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Member + \"_\" + Uid + \"_\" + Name + \"_\" + Cluster + \"_\" + ExtensionData + \"_\" + GroupType).GetHashCode();\n        }\n    }\n\n    public class DrsRecommendationImpl : DrsRecommendation, IEquatable<DrsRecommendationImpl>\n    {\n        public string Key { get; set; }\n\n        public int Priority { get; set; }\n\n        public string Recommendation { get; set; }\n\n        public string Reason { get; set; }\n\n        public string ClusterId { get; set; }\n\n        public Cluster Cluster { get; set; }\n\n        public string TargetId { get; set; }\n\n        public VIObject Target { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(DrsRecommendationImpl drsRecommendationImpl)\n        {\n            return (drsRecommendationImpl != null && this.Key == drsRecommendationImpl.Key && this.Priority == drsRecommendationImpl.Priority && this.Recommendation == drsRecommendationImpl.Recommendation && this.Reason == drsRecommendationImpl.Reason && this.ClusterId == drsRecommendationImpl.ClusterId && ((this.Cluster == null && drsRecommendationImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsRecommendationImpl.Cluster))) && this.TargetId == drsRecommendationImpl.TargetId && ((this.Target == null && drsRecommendationImpl.Target == null) || (this.Target != null && this.Target.Equals(drsRecommendationImpl.Target))) && this.Uid == drsRecommendationImpl.Uid && ((this.ExtensionData == null && drsRecommendationImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsRecommendationImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object drsRecommendationImpl)\n        {\n            return Equals(drsRecommendationImpl as DrsRecommendationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Priority + \"_\" + Recommendation + \"_\" + Reason + \"_\" + ClusterId + \"_\" + Cluster + \"_\" + TargetId + \"_\" + Target + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public abstract class DrsRuleImpl : ResourceSchedulingRuleImpl, DrsRule, IEquatable<DrsRuleImpl>\n    {\n        public int Key { get; set; }\n\n        public string Uid { get; set; }\n\n        public Cluster Cluster { get; set; }\n\n        public string ClusterId { get; set; }\n\n        public string ClusterUid { get; set; }\n\n        public bool Equals(DrsRuleImpl drsRuleImpl)\n        {\n            return (drsRuleImpl != null && this.Key == drsRuleImpl.Key && this.Uid == drsRuleImpl.Uid && ((this.Cluster == null && drsRuleImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsRuleImpl.Cluster))) && this.ClusterId == drsRuleImpl.ClusterId && this.ClusterUid == drsRuleImpl.ClusterUid && this.Enabled == drsRuleImpl.Enabled && this.Mandatory == drsRuleImpl.Mandatory && this.Type == drsRuleImpl.Type && ((this.ExtensionData == null && drsRuleImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsRuleImpl.ExtensionData))) && this.Name == drsRuleImpl.Name);\n        }\n\n        public override bool Equals(object drsRuleImpl)\n        {\n            return Equals(drsRuleImpl as DrsRuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Uid + \"_\" + Cluster + \"_\" + ClusterId + \"_\" + ClusterUid + \"_\" + Enabled + \"_\" + Mandatory + \"_\" + Type + \"_\" + ExtensionData + \"_\" + Name).GetHashCode();\n        }\n    }\n\n    public class DrsVMAffinityRuleImpl : DrsRuleImpl, DrsVMAffinityRule, IEquatable<DrsVMAffinityRuleImpl>\n    {\n        public bool KeepTogether { get; set; }\n\n        public string[] VMIds { get; set; }\n\n        public bool Equals(DrsVMAffinityRuleImpl drsVMAffinityRuleImpl)\n        {\n            return (drsVMAffinityRuleImpl != null && this.KeepTogether == drsVMAffinityRuleImpl.KeepTogether && ((this.VMIds == null && drsVMAffinityRuleImpl.VMIds == null) || (this.VMIds != null && drsVMAffinityRuleImpl.VMIds != null && Enumerable.SequenceEqual(this.VMIds, drsVMAffinityRuleImpl.VMIds))) && this.Enabled == drsVMAffinityRuleImpl.Enabled && this.Mandatory == drsVMAffinityRuleImpl.Mandatory && this.Type == drsVMAffinityRuleImpl.Type && ((this.ExtensionData == null && drsVMAffinityRuleImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsVMAffinityRuleImpl.ExtensionData))) && this.Name == drsVMAffinityRuleImpl.Name && this.Uid == drsVMAffinityRuleImpl.Uid && this.ClusterId == drsVMAffinityRuleImpl.ClusterId && this.ClusterUid == drsVMAffinityRuleImpl.ClusterUid && this.Key == drsVMAffinityRuleImpl.Key && ((this.Cluster == null && drsVMAffinityRuleImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsVMAffinityRuleImpl.Cluster))));\n        }\n\n        public override bool Equals(object drsVMAffinityRuleImpl)\n        {\n            return Equals(drsVMAffinityRuleImpl as DrsVMAffinityRuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (KeepTogether + \"_\" + VMIds + \"_\" + Enabled + \"_\" + Mandatory + \"_\" + Type + \"_\" + ExtensionData + \"_\" + Name + \"_\" + Uid + \"_\" + ClusterId + \"_\" + ClusterUid + \"_\" + Key + \"_\" + Cluster).GetHashCode();\n        }\n    }\n\n    public class DrsVMAntiAffinityRuleImpl : DrsRuleImpl, DrsVMAntiAffinityRule, IEquatable<DrsVMAntiAffinityRuleImpl>\n    {\n        public string[] VMIds { get; set; }\n\n        public bool KeepTogether { get; set; }\n\n        public bool Equals(DrsVMAntiAffinityRuleImpl drsVMAntiAffinityRuleImpl)\n        {\n            return (drsVMAntiAffinityRuleImpl != null && ((this.VMIds == null && drsVMAntiAffinityRuleImpl.VMIds == null) || (this.VMIds != null && drsVMAntiAffinityRuleImpl.VMIds != null && Enumerable.SequenceEqual(this.VMIds, drsVMAntiAffinityRuleImpl.VMIds))) && this.KeepTogether == drsVMAntiAffinityRuleImpl.KeepTogether && this.Enabled == drsVMAntiAffinityRuleImpl.Enabled && this.Mandatory == drsVMAntiAffinityRuleImpl.Mandatory && this.Type == drsVMAntiAffinityRuleImpl.Type && ((this.ExtensionData == null && drsVMAntiAffinityRuleImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsVMAntiAffinityRuleImpl.ExtensionData))) && this.Name == drsVMAntiAffinityRuleImpl.Name && this.Uid == drsVMAntiAffinityRuleImpl.Uid && this.ClusterId == drsVMAntiAffinityRuleImpl.ClusterId && this.ClusterUid == drsVMAntiAffinityRuleImpl.ClusterUid && this.Key == drsVMAntiAffinityRuleImpl.Key && ((this.Cluster == null && drsVMAntiAffinityRuleImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsVMAntiAffinityRuleImpl.Cluster))));\n        }\n\n        public override bool Equals(object drsVMAntiAffinityRuleImpl)\n        {\n            return Equals(drsVMAntiAffinityRuleImpl as DrsVMAntiAffinityRuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMIds + \"_\" + KeepTogether + \"_\" + Enabled + \"_\" + Mandatory + \"_\" + Type + \"_\" + ExtensionData + \"_\" + Name + \"_\" + Uid + \"_\" + ClusterId + \"_\" + ClusterUid + \"_\" + Key + \"_\" + Cluster).GetHashCode();\n        }\n    }\n\n    public class DrsVMHostAffinityRuleImpl : DrsRuleImpl, DrsVMHostAffinityRule, IEquatable<DrsVMHostAffinityRuleImpl>\n    {\n        public string[] VMIds { get; set; }\n\n        public string[] AffineHostIds { get; set; }\n\n        public string[] AntiAffineHostIds { get; set; }\n\n        public bool Equals(DrsVMHostAffinityRuleImpl drsVMHostAffinityRuleImpl)\n        {\n            return (drsVMHostAffinityRuleImpl != null && ((this.VMIds == null && drsVMHostAffinityRuleImpl.VMIds == null) || (this.VMIds != null && drsVMHostAffinityRuleImpl.VMIds != null && Enumerable.SequenceEqual(this.VMIds, drsVMHostAffinityRuleImpl.VMIds))) && ((this.AffineHostIds == null && drsVMHostAffinityRuleImpl.AffineHostIds == null) || (this.AffineHostIds != null && drsVMHostAffinityRuleImpl.AffineHostIds != null && Enumerable.SequenceEqual(this.AffineHostIds, drsVMHostAffinityRuleImpl.AffineHostIds))) && ((this.AntiAffineHostIds == null && drsVMHostAffinityRuleImpl.AntiAffineHostIds == null) || (this.AntiAffineHostIds != null && drsVMHostAffinityRuleImpl.AntiAffineHostIds != null && Enumerable.SequenceEqual(this.AntiAffineHostIds, drsVMHostAffinityRuleImpl.AntiAffineHostIds))) && this.Enabled == drsVMHostAffinityRuleImpl.Enabled && this.Mandatory == drsVMHostAffinityRuleImpl.Mandatory && this.Type == drsVMHostAffinityRuleImpl.Type && ((this.ExtensionData == null && drsVMHostAffinityRuleImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(drsVMHostAffinityRuleImpl.ExtensionData))) && this.Name == drsVMHostAffinityRuleImpl.Name && this.Uid == drsVMHostAffinityRuleImpl.Uid && this.ClusterId == drsVMHostAffinityRuleImpl.ClusterId && this.ClusterUid == drsVMHostAffinityRuleImpl.ClusterUid && this.Key == drsVMHostAffinityRuleImpl.Key && ((this.Cluster == null && drsVMHostAffinityRuleImpl.Cluster == null) || (this.Cluster != null && this.Cluster.Equals(drsVMHostAffinityRuleImpl.Cluster))));\n        }\n\n        public override bool Equals(object drsVMHostAffinityRuleImpl)\n        {\n            return Equals(drsVMHostAffinityRuleImpl as DrsVMHostAffinityRuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMIds + \"_\" + AffineHostIds + \"_\" + AntiAffineHostIds + \"_\" + Enabled + \"_\" + Mandatory + \"_\" + Type + \"_\" + ExtensionData + \"_\" + Name + \"_\" + Uid + \"_\" + ClusterId + \"_\" + ClusterUid + \"_\" + Key + \"_\" + Cluster).GetHashCode();\n        }\n    }\n\n    public abstract class ResourceSchedulingRuleImpl : ResourceSchedulingRule, IEquatable<ResourceSchedulingRuleImpl>\n    {\n        public string Name { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public bool Mandatory { get; set; }\n\n        public ResourceSchedulingRuleType Type { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(ResourceSchedulingRuleImpl resourceSchedulingRuleImpl)\n        {\n            return (resourceSchedulingRuleImpl != null && this.Name == resourceSchedulingRuleImpl.Name && this.Enabled == resourceSchedulingRuleImpl.Enabled && this.Mandatory == resourceSchedulingRuleImpl.Mandatory && this.Type == resourceSchedulingRuleImpl.Type && ((this.ExtensionData == null && resourceSchedulingRuleImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(resourceSchedulingRuleImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object resourceSchedulingRuleImpl)\n        {\n            return Equals(resourceSchedulingRuleImpl as ResourceSchedulingRuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Enabled + \"_\" + Mandatory + \"_\" + Type + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.ContentLibrary\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.ContentLibrary;\n\n    public class ContentLibraryImpl : ContentLibrary, IEquatable<ContentLibraryImpl>\n    {\n        public string Name { get; set; }\n\n        public bool Equals(ContentLibraryImpl contentLibraryImpl)\n        {\n            return (contentLibraryImpl != null && this.Name == contentLibraryImpl.Name);\n        }\n\n        public override bool Equals(object contentLibraryImpl)\n        {\n            return Equals(contentLibraryImpl as ContentLibraryImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class ContentLibraryItemImpl : ContentLibraryItem, IEquatable<ContentLibraryItemImpl>\n    {\n        public decimal SizeGB { get; set; }\n\n        public string Description { get; set; }\n\n        public DateTime CreationTime { get; set; }\n\n        public DateTime LastWriteTime { get; set; }\n\n        public string ItemType { get; set; }\n\n        public ContentLibrary ContentLibrary { get; set; }\n\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(ContentLibraryItemImpl contentLibraryItemImpl)\n        {\n            return (contentLibraryItemImpl != null && this.SizeGB == contentLibraryItemImpl.SizeGB && this.Description == contentLibraryItemImpl.Description && this.CreationTime == contentLibraryItemImpl.CreationTime && this.LastWriteTime == contentLibraryItemImpl.LastWriteTime && this.ItemType == contentLibraryItemImpl.ItemType && ((this.ContentLibrary == null && contentLibraryItemImpl.ContentLibrary == null) || (this.ContentLibrary != null && this.ContentLibrary.Equals(contentLibraryItemImpl.ContentLibrary))) && this.Id == contentLibraryItemImpl.Id && this.Name == contentLibraryItemImpl.Name && this.Uid == contentLibraryItemImpl.Uid);\n        }\n\n        public override bool Equals(object contentLibraryItemImpl)\n        {\n            return Equals(contentLibraryItemImpl as ContentLibraryItemImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (SizeGB + \"_\" + Description + \"_\" + CreationTime + \"_\" + LastWriteTime + \"_\" + ItemType + \"_\" + ContentLibrary + \"_\" + Id + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Cluster;\n    using VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n\n    public class DatastoreClusterImpl : StorageResourceImpl, DatastoreCluster, IEquatable<DatastoreClusterImpl>\n    {\n        public DrsAutomationLevel SdrsAutomationLevel { get; set; }\n\n        public bool IOLoadBalanceEnabled { get; set; }\n\n        public int? IOLatencyThresholdMillisecond { get; set; }\n\n        public int? SpaceUtilizationThresholdPercent { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(DatastoreClusterImpl datastoreClusterImpl)\n        {\n            return (datastoreClusterImpl != null && this.Uid == datastoreClusterImpl.Uid && this.Id == datastoreClusterImpl.Id && this.Name == datastoreClusterImpl.Name && this.SdrsAutomationLevel == datastoreClusterImpl.SdrsAutomationLevel && this.IOLoadBalanceEnabled == datastoreClusterImpl.IOLoadBalanceEnabled && this.IOLatencyThresholdMillisecond == datastoreClusterImpl.IOLatencyThresholdMillisecond && this.SpaceUtilizationThresholdPercent == datastoreClusterImpl.SpaceUtilizationThresholdPercent && ((this.ExtensionData == null && datastoreClusterImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(datastoreClusterImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object datastoreClusterImpl)\n        {\n            return Equals(datastoreClusterImpl as DatastoreClusterImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Id + \"_\" + Name + \"_\" + SdrsAutomationLevel + \"_\" + IOLoadBalanceEnabled + \"_\" + IOLatencyThresholdMillisecond + \"_\" + SpaceUtilizationThresholdPercent + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class DatastoreFileImpl : DatastoreItemImpl, DatastoreFile, IEquatable<DatastoreFileImpl>\n    {\n        public long? Length { get; set; }\n\n        public bool Equals(DatastoreFileImpl datastoreFileImpl)\n        {\n            return (datastoreFileImpl != null && ((this.Length == null && datastoreFileImpl.Length == null) || (this.Length != null && this.Length.Equals(datastoreFileImpl.Length))) && this.DatastoreId == datastoreFileImpl.DatastoreId && ((this.Datastore == null && datastoreFileImpl.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreFileImpl.Datastore))) && this.Name == datastoreFileImpl.Name && this.FolderPath == datastoreFileImpl.FolderPath && this.DatastoreFullPath == datastoreFileImpl.DatastoreFullPath && this.FullName == datastoreFileImpl.FullName && this.ItemType == datastoreFileImpl.ItemType && ((this.LastWriteTime == null && datastoreFileImpl.LastWriteTime == null) || (this.LastWriteTime != null && this.LastWriteTime.Equals(datastoreFileImpl.LastWriteTime))) && this.Uid == datastoreFileImpl.Uid);\n        }\n\n        public override bool Equals(object datastoreFileImpl)\n        {\n            return Equals(datastoreFileImpl as DatastoreFileImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Length + \"_\" + DatastoreId + \"_\" + Datastore + \"_\" + Name + \"_\" + FolderPath + \"_\" + DatastoreFullPath + \"_\" + FullName + \"_\" + ItemType + \"_\" + LastWriteTime + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class DatastoreFolderImpl : DatastoreItemImpl, DatastoreFolder, IEquatable<DatastoreFolderImpl>\n    {\n        public bool Equals(DatastoreFolderImpl datastoreFolderImpl)\n        {\n            return (datastoreFolderImpl != null && this.DatastoreId == datastoreFolderImpl.DatastoreId && ((this.Datastore == null && datastoreFolderImpl.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreFolderImpl.Datastore))) && this.Name == datastoreFolderImpl.Name && this.FolderPath == datastoreFolderImpl.FolderPath && this.DatastoreFullPath == datastoreFolderImpl.DatastoreFullPath && this.FullName == datastoreFolderImpl.FullName && this.ItemType == datastoreFolderImpl.ItemType && ((this.LastWriteTime == null && datastoreFolderImpl.LastWriteTime == null) || (this.LastWriteTime != null && this.LastWriteTime.Equals(datastoreFolderImpl.LastWriteTime))) && this.Uid == datastoreFolderImpl.Uid);\n        }\n\n        public override bool Equals(object datastoreFolderImpl)\n        {\n            return Equals(datastoreFolderImpl as DatastoreFolderImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreId + \"_\" + Datastore + \"_\" + Name + \"_\" + FolderPath + \"_\" + DatastoreFullPath + \"_\" + FullName + \"_\" + ItemType + \"_\" + LastWriteTime + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class DatastoreImpl : StorageResourceImpl, Datastore, IEquatable<DatastoreImpl>\n    {\n        public string DatacenterId { get; set; }\n\n        public Datacenter Datacenter { get; set; }\n\n        public string ParentFolderId { get; set; }\n\n        public Folder ParentFolder { get; set; }\n\n        public string DatastoreBrowserPath { get; set; }\n\n        public decimal FreeSpaceMB { get; set; }\n\n        public decimal CapacityMB { get; set; }\n\n        public bool Accessible { get; set; }\n\n        public string Type { get; set; }\n\n        public bool StorageIOControlEnabled { get; set; }\n\n        public int? CongestionThresholdMillisecond { get; set; }\n\n        public DatastoreState State { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(DatastoreImpl datastoreImpl)\n        {\n            return (datastoreImpl != null && this.DatacenterId == datastoreImpl.DatacenterId && ((this.Datacenter == null && datastoreImpl.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(datastoreImpl.Datacenter))) && this.ParentFolderId == datastoreImpl.ParentFolderId && ((this.ParentFolder == null && datastoreImpl.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(datastoreImpl.ParentFolder))) && this.DatastoreBrowserPath == datastoreImpl.DatastoreBrowserPath && this.FreeSpaceMB == datastoreImpl.FreeSpaceMB && this.CapacityMB == datastoreImpl.CapacityMB && this.Accessible == datastoreImpl.Accessible && this.Type == datastoreImpl.Type && this.StorageIOControlEnabled == datastoreImpl.StorageIOControlEnabled && ((this.CongestionThresholdMillisecond == null && datastoreImpl.CongestionThresholdMillisecond == null) || (this.CongestionThresholdMillisecond != null && this.CongestionThresholdMillisecond.Equals(datastoreImpl.CongestionThresholdMillisecond))) && this.State == datastoreImpl.State && ((this.ExtensionData == null && datastoreImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(datastoreImpl.ExtensionData))) && this.Id == datastoreImpl.Id && this.Name == datastoreImpl.Name && this.Uid == datastoreImpl.Uid && this.CapacityGB == datastoreImpl.CapacityGB && this.FreeSpaceGB == datastoreImpl.FreeSpaceGB);\n        }\n\n        public override bool Equals(object datastoreImpl)\n        {\n            return Equals(datastoreImpl as DatastoreImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatacenterId + \"_\" + Datacenter + \"_\" + ParentFolderId + \"_\" + ParentFolder + \"_\" + DatastoreBrowserPath + \"_\" + FreeSpaceMB + \"_\" + CapacityMB + \"_\" + Accessible + \"_\" + Type + \"_\" + StorageIOControlEnabled + \"_\" + CongestionThresholdMillisecond + \"_\" + State + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + CapacityGB + \"_\" + FreeSpaceGB).GetHashCode();\n        }\n    }\n\n    public class DatastoreItemImpl : DatastoreItem, IEquatable<DatastoreItemImpl>\n    {\n        public string DatastoreId { get; set; }\n\n        public Datastore Datastore { get; set; }\n\n        public string Name { get; set; }\n\n        public string FolderPath { get; set; }\n\n        public string DatastoreFullPath { get; set; }\n\n        public string FullName { get; set; }\n\n        public DatastoreItemType ItemType { get; set; }\n\n        public DateTime? LastWriteTime { get; set; }\n\n        public string Uid { get; set; }\n\n        public void SetFullName(string value)\n        {\n        }\n\n        public bool Equals(DatastoreItemImpl datastoreItemImpl)\n        {\n            return (datastoreItemImpl != null && this.DatastoreId == datastoreItemImpl.DatastoreId && ((this.Datastore == null && datastoreItemImpl.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreItemImpl.Datastore))) && this.Name == datastoreItemImpl.Name && this.FolderPath == datastoreItemImpl.FolderPath && this.DatastoreFullPath == datastoreItemImpl.DatastoreFullPath && this.FullName == datastoreItemImpl.FullName && this.ItemType == datastoreItemImpl.ItemType && ((this.LastWriteTime == null && datastoreItemImpl.LastWriteTime == null) || (this.LastWriteTime != null && this.LastWriteTime.Equals(datastoreItemImpl.LastWriteTime))) && this.Uid == datastoreItemImpl.Uid);\n        }\n\n        public override bool Equals(object datastoreItemImpl)\n        {\n            return Equals(datastoreItemImpl as DatastoreItemImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreId + \"_\" + Datastore + \"_\" + Name + \"_\" + FolderPath + \"_\" + DatastoreFullPath + \"_\" + FullName + \"_\" + ItemType + \"_\" + LastWriteTime + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class DatastoreRootFolderImpl : DatastoreFolderImpl, DatastoreFolder, IEquatable<DatastoreRootFolderImpl>\n    {\n        public bool Equals(DatastoreRootFolderImpl datastoreRootFolderImpl)\n        {\n            return (datastoreRootFolderImpl != null && this.DatastoreId == datastoreRootFolderImpl.DatastoreId && ((this.Datastore == null && datastoreRootFolderImpl.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreRootFolderImpl.Datastore))) && this.Name == datastoreRootFolderImpl.Name && this.FolderPath == datastoreRootFolderImpl.FolderPath && this.DatastoreFullPath == datastoreRootFolderImpl.DatastoreFullPath && this.FullName == datastoreRootFolderImpl.FullName && this.ItemType == datastoreRootFolderImpl.ItemType && ((this.LastWriteTime == null && datastoreRootFolderImpl.LastWriteTime == null) || (this.LastWriteTime != null && this.LastWriteTime.Equals(datastoreRootFolderImpl.LastWriteTime))) && this.Uid == datastoreRootFolderImpl.Uid);\n        }\n\n        public override bool Equals(object datastoreRootFolderImpl)\n        {\n            return Equals(datastoreRootFolderImpl as DatastoreRootFolderImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DatastoreId + \"_\" + Datastore + \"_\" + Name + \"_\" + FolderPath + \"_\" + DatastoreFullPath + \"_\" + FullName + \"_\" + ItemType + \"_\" + LastWriteTime + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class DatastoreVMDiskFileImpl : DatastoreFileImpl, DatastoreVMDiskFile, IEquatable<DatastoreVMDiskFileImpl>\n    {\n        public long? CapacityKb { get; set; }\n\n        public string ControllerType { get; set; }\n\n        public DiskType DiskType { get; set; }\n\n        public string[] DiskExtents { get; set; }\n\n        public bool Equals(DatastoreVMDiskFileImpl datastoreVMDiskFileImpl)\n        {\n            return (datastoreVMDiskFileImpl != null && ((this.CapacityKb == null && datastoreVMDiskFileImpl.CapacityKb == null) || (this.CapacityKb != null && this.CapacityKb.Equals(datastoreVMDiskFileImpl.CapacityKb))) && this.ControllerType == datastoreVMDiskFileImpl.ControllerType && this.DiskType == datastoreVMDiskFileImpl.DiskType && ((this.DiskExtents == null && datastoreVMDiskFileImpl.DiskExtents == null) || (this.DiskExtents != null && datastoreVMDiskFileImpl.DiskExtents != null && Enumerable.SequenceEqual(this.DiskExtents, datastoreVMDiskFileImpl.DiskExtents))) && this.DatastoreId == datastoreVMDiskFileImpl.DatastoreId && ((this.Datastore == null && datastoreVMDiskFileImpl.Datastore == null) || (this.Datastore != null && this.Datastore.Equals(datastoreVMDiskFileImpl.Datastore))) && this.Name == datastoreVMDiskFileImpl.Name && this.FolderPath == datastoreVMDiskFileImpl.FolderPath && this.DatastoreFullPath == datastoreVMDiskFileImpl.DatastoreFullPath && this.FullName == datastoreVMDiskFileImpl.FullName && this.ItemType == datastoreVMDiskFileImpl.ItemType && ((this.LastWriteTime == null && datastoreVMDiskFileImpl.LastWriteTime == null) || (this.LastWriteTime != null && this.LastWriteTime.Equals(datastoreVMDiskFileImpl.LastWriteTime))) && this.Uid == datastoreVMDiskFileImpl.Uid && ((this.Length == null && datastoreVMDiskFileImpl.Length == null) || (this.Length != null && this.Length.Equals(datastoreVMDiskFileImpl.Length))));\n        }\n\n        public override bool Equals(object datastoreVMDiskFileImpl)\n        {\n            return Equals(datastoreVMDiskFileImpl as DatastoreVMDiskFileImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (CapacityKb + \"_\" + ControllerType + \"_\" + DiskType + \"_\" + DiskExtents + \"_\" + DatastoreId + \"_\" + Datastore + \"_\" + Name + \"_\" + FolderPath + \"_\" + DatastoreFullPath + \"_\" + FullName + \"_\" + ItemType + \"_\" + LastWriteTime + \"_\" + Uid + \"_\" + Length).GetHashCode();\n        }\n    }\n\n    public class NasDatastoreImpl : DatastoreImpl, NasDatastore, IEquatable<NasDatastoreImpl>\n    {\n        public string[] RemoteHost { get; set; }\n\n        public string RemotePath { get; set; }\n\n        public string UserName { get; set; }\n\n        public AuthenticationMethod AuthenticationMethod { get; set; }\n\n        public string FileSystemVersion { get; set; }\n\n        public bool Equals(NasDatastoreImpl nasDatastoreImpl)\n        {\n            return (nasDatastoreImpl != null && ((this.RemoteHost == null && nasDatastoreImpl.RemoteHost == null) || (this.RemoteHost != null && nasDatastoreImpl.RemoteHost != null && Enumerable.SequenceEqual(this.RemoteHost, nasDatastoreImpl.RemoteHost))) && this.RemotePath == nasDatastoreImpl.RemotePath && this.UserName == nasDatastoreImpl.UserName && this.AuthenticationMethod == nasDatastoreImpl.AuthenticationMethod && this.FileSystemVersion == nasDatastoreImpl.FileSystemVersion && this.Id == nasDatastoreImpl.Id && this.Name == nasDatastoreImpl.Name && this.Uid == nasDatastoreImpl.Uid && this.CapacityGB == nasDatastoreImpl.CapacityGB && this.FreeSpaceGB == nasDatastoreImpl.FreeSpaceGB && this.DatacenterId == nasDatastoreImpl.DatacenterId && ((this.Datacenter == null && nasDatastoreImpl.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(nasDatastoreImpl.Datacenter))) && this.ParentFolderId == nasDatastoreImpl.ParentFolderId && ((this.ParentFolder == null && nasDatastoreImpl.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(nasDatastoreImpl.ParentFolder))) && this.DatastoreBrowserPath == nasDatastoreImpl.DatastoreBrowserPath && this.FreeSpaceMB == nasDatastoreImpl.FreeSpaceMB && this.CapacityMB == nasDatastoreImpl.CapacityMB && this.Accessible == nasDatastoreImpl.Accessible && this.Type == nasDatastoreImpl.Type && this.StorageIOControlEnabled == nasDatastoreImpl.StorageIOControlEnabled && ((this.CongestionThresholdMillisecond == null && nasDatastoreImpl.CongestionThresholdMillisecond == null) || (this.CongestionThresholdMillisecond != null && this.CongestionThresholdMillisecond.Equals(nasDatastoreImpl.CongestionThresholdMillisecond))) && this.State == nasDatastoreImpl.State && ((this.ExtensionData == null && nasDatastoreImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(nasDatastoreImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object nasDatastoreImpl)\n        {\n            return Equals(nasDatastoreImpl as NasDatastoreImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (RemoteHost + \"_\" + RemotePath + \"_\" + UserName + \"_\" + AuthenticationMethod + \"_\" + FileSystemVersion + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + CapacityGB + \"_\" + FreeSpaceGB + \"_\" + DatacenterId + \"_\" + Datacenter + \"_\" + ParentFolderId + \"_\" + ParentFolder + \"_\" + DatastoreBrowserPath + \"_\" + FreeSpaceMB + \"_\" + CapacityMB + \"_\" + Accessible + \"_\" + Type + \"_\" + StorageIOControlEnabled + \"_\" + CongestionThresholdMillisecond + \"_\" + State + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class StorageResourceImpl : StorageResource, IEquatable<StorageResourceImpl>\n    {\n        public string Name { get; set; }\n\n        public decimal CapacityGB { get; set; }\n\n        public decimal FreeSpaceGB { get; set; }\n\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(StorageResourceImpl storageResourceImpl)\n        {\n            return (storageResourceImpl != null && this.CapacityGB == storageResourceImpl.CapacityGB && this.FreeSpaceGB == storageResourceImpl.FreeSpaceGB && this.Name == storageResourceImpl.Name && this.Id == storageResourceImpl.Id && this.Uid == storageResourceImpl.Uid);\n        }\n\n        public override bool Equals(object storageResourceImpl)\n        {\n            return Equals(storageResourceImpl as StorageResourceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + CapacityGB + \"_\" + FreeSpaceGB + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VmfsDatastoreImpl : DatastoreImpl, VmfsDatastore, IEquatable<VmfsDatastoreImpl>\n    {\n        public string FileSystemVersion { get; set; }\n\n        public bool Equals(VmfsDatastoreImpl vmfsDatastoreImpl)\n        {\n            return (vmfsDatastoreImpl != null && this.FileSystemVersion == vmfsDatastoreImpl.FileSystemVersion && this.Id == vmfsDatastoreImpl.Id && this.Name == vmfsDatastoreImpl.Name && this.Uid == vmfsDatastoreImpl.Uid && this.CapacityGB == vmfsDatastoreImpl.CapacityGB && this.FreeSpaceGB == vmfsDatastoreImpl.FreeSpaceGB && this.DatacenterId == vmfsDatastoreImpl.DatacenterId && ((this.Datacenter == null && vmfsDatastoreImpl.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(vmfsDatastoreImpl.Datacenter))) && this.ParentFolderId == vmfsDatastoreImpl.ParentFolderId && ((this.ParentFolder == null && vmfsDatastoreImpl.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(vmfsDatastoreImpl.ParentFolder))) && this.DatastoreBrowserPath == vmfsDatastoreImpl.DatastoreBrowserPath && this.FreeSpaceMB == vmfsDatastoreImpl.FreeSpaceMB && this.CapacityMB == vmfsDatastoreImpl.CapacityMB && this.Accessible == vmfsDatastoreImpl.Accessible && this.Type == vmfsDatastoreImpl.Type && this.StorageIOControlEnabled == vmfsDatastoreImpl.StorageIOControlEnabled && ((this.CongestionThresholdMillisecond == null && vmfsDatastoreImpl.CongestionThresholdMillisecond == null) || (this.CongestionThresholdMillisecond != null && this.CongestionThresholdMillisecond.Equals(vmfsDatastoreImpl.CongestionThresholdMillisecond))) && this.State == vmfsDatastoreImpl.State && ((this.ExtensionData == null && vmfsDatastoreImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vmfsDatastoreImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vmfsDatastoreImpl)\n        {\n            return Equals(vmfsDatastoreImpl as VmfsDatastoreImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FileSystemVersion + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + CapacityGB + \"_\" + FreeSpaceGB + \"_\" + DatacenterId + \"_\" + Datacenter + \"_\" + ParentFolderId + \"_\" + ParentFolder + \"_\" + DatastoreBrowserPath + \"_\" + FreeSpaceMB + \"_\" + CapacityMB + \"_\" + Accessible + \"_\" + Type + \"_\" + StorageIOControlEnabled + \"_\" + CongestionThresholdMillisecond + \"_\" + State + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.EsxCli\n{\n    using System;\n    using System.Collections;\n    using System.Collections.Generic;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.EsxCli;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class DynamicManagedObjectImpl : DynamicManagedObject, IEquatable<DynamicManagedObjectImpl>\n    {\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public object InvokeOperation(string name, IDictionary parameters)\n        {\n            return default(object);\n        }\n\n        public bool Equals(DynamicManagedObjectImpl dynamicManagedObjectImpl)\n        {\n            return (dynamicManagedObjectImpl != null && this.Id == dynamicManagedObjectImpl.Id && this.Uid == dynamicManagedObjectImpl.Uid);\n        }\n\n        public override bool Equals(object dynamicManagedObjectImpl)\n        {\n            return Equals(dynamicManagedObjectImpl as DynamicManagedObjectImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class DynamicTypeManagerImpl : DynamicManagedObjectImpl, DynamicTypeManager, IEquatable<DynamicTypeManagerImpl>\n    {\n        public MoInstanceDescriptor[] QueryMoInstances(string id)\n        {\n            return default(MoInstanceDescriptor[]);\n        }\n\n        public IDictionary<string, object> QueryTypeInfo(string typeSubstring)\n        {\n            return default(IDictionary<string, object>);\n        }\n\n        public DynamicManagedObject CreateDynamicManagedObject(string id)\n        {\n            return default(DynamicManagedObject);\n        }\n\n        public bool Equals(DynamicTypeManagerImpl dynamicTypeManagerImpl)\n        {\n            return (dynamicTypeManagerImpl != null && this.Id == dynamicTypeManagerImpl.Id);\n        }\n\n        public override bool Equals(object dynamicTypeManagerImpl)\n        {\n            return Equals(dynamicTypeManagerImpl as DynamicTypeManagerImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id).GetHashCode();\n        }\n    }\n\n    public class EsxCliElementImpl : EsxCliElement, IEquatable<EsxCliElementImpl>\n    {\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string FullName { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool IsManagedObjectInstance { get; set; }\n\n        public List<EsxCliElement> ChildElements { get; set; }\n\n        public EsxCliHelp help()\n        {\n            return default(EsxCliHelp);\n        }\n\n        public EsxCliMethodHelp help(string methodName)\n        {\n            return default(EsxCliMethodHelp);\n        }\n\n        public bool Equals(EsxCliElementImpl esxCliElementImpl)\n        {\n            return (esxCliElementImpl != null && this.Id == esxCliElementImpl.Id && this.Name == esxCliElementImpl.Name && this.FullName == esxCliElementImpl.FullName && this.Uid == esxCliElementImpl.Uid && this.IsManagedObjectInstance == esxCliElementImpl.IsManagedObjectInstance && ((this.ChildElements == null && esxCliElementImpl.ChildElements == null) || (this.ChildElements != null && esxCliElementImpl.ChildElements != null && Enumerable.SequenceEqual(this.ChildElements, esxCliElementImpl.ChildElements))));\n        }\n\n        public override bool Equals(object esxCliElementImpl)\n        {\n            return Equals(esxCliElementImpl as EsxCliElementImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + FullName + \"_\" + Uid + \"_\" + IsManagedObjectInstance + \"_\" + ChildElements).GetHashCode();\n        }\n    }\n\n    public class EsxCliHelpImpl : EsxCliHelp, IEquatable<EsxCliHelpImpl>\n    {\n        public string DisplayName { get; set; }\n\n        public string FullDisplayName { get; set; }\n\n        public string Name { get; set; }\n\n        public string Help { get; set; }\n\n        public List<EsxCliHelp> ChildElement { get; set; }\n\n        public List<EsxCliMethodHelp> Method { get; set; }\n\n        public bool Equals(EsxCliHelpImpl esxCliHelpImpl)\n        {\n            return (esxCliHelpImpl != null && this.DisplayName == esxCliHelpImpl.DisplayName && this.FullDisplayName == esxCliHelpImpl.FullDisplayName && this.Name == esxCliHelpImpl.Name && this.Help == esxCliHelpImpl.Help && ((this.ChildElement == null && esxCliHelpImpl.ChildElement == null) || (this.ChildElement != null && esxCliHelpImpl.ChildElement != null && Enumerable.SequenceEqual(this.ChildElement, esxCliHelpImpl.ChildElement))) && ((this.Method == null && esxCliHelpImpl.Method == null) || (this.Method != null && esxCliHelpImpl.Method != null && Enumerable.SequenceEqual(this.Method, esxCliHelpImpl.Method))));\n        }\n\n        public override bool Equals(object esxCliHelpImpl)\n        {\n            return Equals(esxCliHelpImpl as EsxCliHelpImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DisplayName + \"_\" + FullDisplayName + \"_\" + Name + \"_\" + Help + \"_\" + ChildElement + \"_\" + Method).GetHashCode();\n        }\n    }\n\n    public class EsxCliImpl : EsxCli, IEquatable<EsxCliImpl>\n    {\n        public string Uid { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public DynamicTypeManager TypeManager { get; set; }\n\n        public bool Equals(EsxCliImpl esxCliImpl)\n        {\n            return (esxCliImpl != null && this.Uid == esxCliImpl.Uid && ((this.VMHost == null && esxCliImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(esxCliImpl.VMHost))) && ((this.TypeManager == null && esxCliImpl.TypeManager == null) || (this.TypeManager != null && this.TypeManager.Equals(esxCliImpl.TypeManager))));\n        }\n\n        public override bool Equals(object esxCliImpl)\n        {\n            return Equals(esxCliImpl as EsxCliImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + VMHost + \"_\" + TypeManager).GetHashCode();\n        }\n    }\n\n    public class EsxCliMethodHelpImpl : EsxCliMethodHelp, IEquatable<EsxCliMethodHelpImpl>\n    {\n        public string DisplayName { get; set; }\n\n        public string FullDisplayName { get; set; }\n\n        public string Name { get; set; }\n\n        public string Help { get; set; }\n\n        public EsxCliParameterHelp Ret { get; set; }\n\n        public EsxCliParameterHelp[] Param { get; set; }\n\n        public IDictionary Hints { get; set; }\n\n        public bool Equals(EsxCliMethodHelpImpl esxCliMethodHelpImpl)\n        {\n            return (esxCliMethodHelpImpl != null && this.DisplayName == esxCliMethodHelpImpl.DisplayName && this.FullDisplayName == esxCliMethodHelpImpl.FullDisplayName && this.Name == esxCliMethodHelpImpl.Name && this.Help == esxCliMethodHelpImpl.Help && ((this.Ret == null && esxCliMethodHelpImpl.Ret == null) || (this.Ret != null && this.Ret.Equals(esxCliMethodHelpImpl.Ret))) && ((this.Param == null && esxCliMethodHelpImpl.Param == null) || (this.Param != null && esxCliMethodHelpImpl.Param != null && Enumerable.SequenceEqual(this.Param, esxCliMethodHelpImpl.Param))) && ((this.Hints == null && esxCliMethodHelpImpl.Hints == null) || (this.Hints != null && esxCliMethodHelpImpl.Hints != null && this.Hints.Equals(esxCliMethodHelpImpl.Hints))));\n        }\n\n        public override bool Equals(object esxCliMethodHelpImpl)\n        {\n            return Equals(esxCliMethodHelpImpl as EsxCliMethodHelpImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DisplayName + \"_\" + FullDisplayName + \"_\" + Name + \"_\" + Help + \"_\" + Ret + \"_\" + Param + \"_\" + Hints).GetHashCode();\n        }\n    }\n\n    public class EsxCliMethodInfoImpl : IEquatable<EsxCliMethodInfoImpl>\n    {\n        public string Name { get; set; }\n\n        public object InvokeWithNamedArguments(object targetObject, Dictionary<string, object> arguments)\n        {\n            return default(object);\n        }\n\n        public object Invoke(object obj, object[] arguments)\n        {\n            return default(object);\n        }\n\n        public bool Equals(EsxCliMethodInfoImpl esxCliMethodInfoImpl)\n        {\n            return (esxCliMethodInfoImpl != null && this.Name == esxCliMethodInfoImpl.Name);\n        }\n\n        public override bool Equals(object esxCliMethodInfoImpl)\n        {\n            return Equals(esxCliMethodInfoImpl as EsxCliMethodInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name).GetHashCode();\n        }\n    }\n\n    public class EsxCliObjectImpl : EsxCliObject, IEquatable<EsxCliObjectImpl>\n    {\n        public bool Equals(EsxCliObjectImpl esxCliObjectImpl)\n        {\n            return (esxCliObjectImpl != null);\n        }\n\n        public override bool Equals(object esxCliObjectImpl)\n        {\n            return Equals(esxCliObjectImpl as EsxCliObjectImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EsxCliParameterHelpImpl : EsxCliParameterHelp, IEquatable<EsxCliParameterHelpImpl>\n    {\n        public string DisplayName { get; set; }\n\n        public string MethodFullDisplayName { get; set; }\n\n        public string Name { get; set; }\n\n        public string Help { get; set; }\n\n        public string[] Constraint { get; set; }\n\n        public string Default { get; set; }\n\n        public string[] Aliases { get; set; }\n\n        public bool Equals(EsxCliParameterHelpImpl esxCliParameterHelpImpl)\n        {\n            return (esxCliParameterHelpImpl != null && this.DisplayName == esxCliParameterHelpImpl.DisplayName && this.MethodFullDisplayName == esxCliParameterHelpImpl.MethodFullDisplayName && this.Name == esxCliParameterHelpImpl.Name && this.Help == esxCliParameterHelpImpl.Help && ((this.Constraint == null && esxCliParameterHelpImpl.Constraint == null) || (this.Constraint != null && esxCliParameterHelpImpl.Constraint != null && Enumerable.SequenceEqual(this.Constraint, esxCliParameterHelpImpl.Constraint))) && this.Default == esxCliParameterHelpImpl.Default && ((this.Aliases == null && esxCliParameterHelpImpl.Aliases == null) || (this.Aliases != null && esxCliParameterHelpImpl.Aliases != null && Enumerable.SequenceEqual(this.Aliases, esxCliParameterHelpImpl.Aliases))));\n        }\n\n        public override bool Equals(object esxCliParameterHelpImpl)\n        {\n            return Equals(esxCliParameterHelpImpl as EsxCliParameterHelpImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DisplayName + \"_\" + MethodFullDisplayName + \"_\" + Name + \"_\" + Help + \"_\" + Constraint + \"_\" + Default + \"_\" + Aliases).GetHashCode();\n        }\n    }\n\n    public class MoInstanceDescriptorImpl : MoInstanceDescriptor, IEquatable<MoInstanceDescriptorImpl>\n    {\n        public string Id { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(MoInstanceDescriptorImpl moInstanceDescriptorImpl)\n        {\n            return (moInstanceDescriptorImpl != null && this.Id == moInstanceDescriptorImpl.Id && this.Type == moInstanceDescriptorImpl.Type);\n        }\n\n        public override bool Equals(object moInstanceDescriptorImpl)\n        {\n            return Equals(moInstanceDescriptorImpl as MoInstanceDescriptorImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Type).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.EsxTop\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.EsxTop;\n\n    public class CounterImpl : Counter, IEquatable<CounterImpl>\n    {\n        public VIServer Server { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public CounterInfoField[] Fields { get; set; }\n\n        public bool Equals(CounterImpl counterImpl)\n        {\n            return (counterImpl != null && ((this.Server == null && counterImpl.Server == null) || (this.Server != null && this.Server.Equals(counterImpl.Server))) && this.Name == counterImpl.Name && this.Uid == counterImpl.Uid && ((this.Fields == null && counterImpl.Fields == null) || (this.Fields != null && counterImpl.Fields != null && Enumerable.SequenceEqual(this.Fields, counterImpl.Fields))));\n        }\n\n        public override bool Equals(object counterImpl)\n        {\n            return Equals(counterImpl as CounterImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Server + \"_\" + Name + \"_\" + Uid + \"_\" + Fields).GetHashCode();\n        }\n    }\n\n    public class CounterInfoFieldImpl : CounterInfoField, IEquatable<CounterInfoFieldImpl>\n    {\n        public string Name { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(CounterInfoFieldImpl counterInfoFieldImpl)\n        {\n            return (counterInfoFieldImpl != null && this.Name == counterInfoFieldImpl.Name && this.Type == counterInfoFieldImpl.Type);\n        }\n\n        public override bool Equals(object counterInfoFieldImpl)\n        {\n            return Equals(counterInfoFieldImpl as CounterInfoFieldImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Type).GetHashCode();\n        }\n    }\n\n    public class CounterValueImpl : CounterValue, IEquatable<CounterValueImpl>\n    {\n        public VIServer Server { get; set; }\n\n        public string Counter { get; set; }\n\n        public bool Equals(CounterValueImpl counterValueImpl)\n        {\n            return (counterValueImpl != null && ((this.Server == null && counterValueImpl.Server == null) || (this.Server != null && this.Server.Equals(counterValueImpl.Server))) && this.Counter == counterValueImpl.Counter);\n        }\n\n        public override bool Equals(object counterValueImpl)\n        {\n            return Equals(counterValueImpl as CounterValueImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Server + \"_\" + Counter).GetHashCode();\n        }\n    }\n\n    public class DynamicDataImpl : DynamicData, IEquatable<DynamicDataImpl>\n    {\n        public bool Equals(DynamicDataImpl dynamicDataImpl)\n        {\n            return (dynamicDataImpl != null);\n        }\n\n        public override bool Equals(object dynamicDataImpl)\n        {\n            return Equals(dynamicDataImpl as DynamicDataImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class EsxTopImpl : IEquatable<EsxTopImpl>\n    {\n        public Counter[] GetCounterInfo(string[] counterList)\n        {\n            return default(Counter[]);\n        }\n\n        public Dictionary<TKey, TValue> GetTopologyInfo<TKey, TValue>(string[] topologyList)\n        {\n            return default(Dictionary<TKey, TValue>);\n        }\n\n        public Dictionary<TKey, TValue> GetCounterValues<TKey, TValue>(string[] counterList)\n        {\n            return default(Dictionary<TKey, TValue>);\n        }\n\n        public void FreeStats()\n        {\n        }\n\n        public bool Equals(EsxTopImpl esxTopImpl)\n        {\n            return (esxTopImpl != null);\n        }\n\n        public override bool Equals(object esxTopImpl)\n        {\n            return Equals(esxTopImpl as EsxTopImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return base.GetHashCode();\n        }\n    }\n\n    public class TopologyInfoImpl : TopologyInfo, IEquatable<TopologyInfoImpl>\n    {\n        public VIServer Server { get; set; }\n\n        public string Topology { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(TopologyInfoImpl topologyInfoImpl)\n        {\n            return (topologyInfoImpl != null && ((this.Server == null && topologyInfoImpl.Server == null) || (this.Server != null && this.Server.Equals(topologyInfoImpl.Server))) && this.Topology == topologyInfoImpl.Topology && this.Uid == topologyInfoImpl.Uid);\n        }\n\n        public override bool Equals(object topologyInfoImpl)\n        {\n            return Equals(topologyInfoImpl as TopologyInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Server + \"_\" + Topology + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host\n{\n    using System;\n    using System.Collections.Generic;\n    using System.IO;\n    using System.Linq;\n    using System.Net;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class HostFirmwareBundleImpl : HostFirmwareBundle, IEquatable<HostFirmwareBundleImpl>\n    {\n        public string Url { get; set; }\n\n        public FileInfo Data { get; set; }\n\n        public VMHost Host { get; set; }\n\n        public bool Equals(HostFirmwareBundleImpl hostFirmwareBundleImpl)\n        {\n            return (hostFirmwareBundleImpl != null && this.Url == hostFirmwareBundleImpl.Url && this.Data == hostFirmwareBundleImpl.Data && ((this.Host == null && hostFirmwareBundleImpl.Host == null) || (this.Host != null && this.Host.Equals(hostFirmwareBundleImpl.Host))));\n        }\n\n        public override bool Equals(object hostFirmwareBundleImpl)\n        {\n            return Equals(hostFirmwareBundleImpl as HostFirmwareBundleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Url + \"_\" + Data + \"_\" + Host).GetHashCode();\n        }\n    }\n\n    public class HostFirmwareImpl : HostFirmware, IEquatable<HostFirmwareImpl>\n    {\n        public string UploadUrl { get; set; }\n\n        public VMHost Host { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(HostFirmwareImpl hostFirmwareImpl)\n        {\n            return (hostFirmwareImpl != null && this.UploadUrl == hostFirmwareImpl.UploadUrl && ((this.Host == null && hostFirmwareImpl.Host == null) || (this.Host != null && this.Host.Equals(hostFirmwareImpl.Host))) && ((this.VMHost == null && hostFirmwareImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hostFirmwareImpl.VMHost))) && this.VMHostId == hostFirmwareImpl.VMHostId && this.Uid == hostFirmwareImpl.Uid && ((this.ExtensionData == null && hostFirmwareImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostFirmwareImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hostFirmwareImpl)\n        {\n            return Equals(hostFirmwareImpl as HostFirmwareImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UploadUrl + \"_\" + Host + \"_\" + VMHost + \"_\" + VMHostId + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class HostServiceImpl : HostService, IEquatable<HostServiceImpl>\n    {\n        public string Key { get; set; }\n\n        public string Label { get; set; }\n\n        public string Policy { get; set; }\n\n        public bool Required { get; set; }\n\n        public string[] Ruleset { get; set; }\n\n        public bool Running { get; set; }\n\n        public bool Uninstallable { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VMHostUid { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(HostServiceImpl hostServiceImpl)\n        {\n            return (hostServiceImpl != null && this.Key == hostServiceImpl.Key && this.Label == hostServiceImpl.Label && this.Policy == hostServiceImpl.Policy && this.Required == hostServiceImpl.Required && ((this.Ruleset == null && hostServiceImpl.Ruleset == null) || (this.Ruleset != null && hostServiceImpl.Ruleset != null && Enumerable.SequenceEqual(this.Ruleset, hostServiceImpl.Ruleset))) && this.Running == hostServiceImpl.Running && this.Uninstallable == hostServiceImpl.Uninstallable && this.VMHostId == hostServiceImpl.VMHostId && ((this.VMHost == null && hostServiceImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hostServiceImpl.VMHost))) && this.VMHostUid == hostServiceImpl.VMHostUid && this.Uid == hostServiceImpl.Uid && ((this.ExtensionData == null && hostServiceImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostServiceImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hostServiceImpl)\n        {\n            return Equals(hostServiceImpl as HostServiceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Label + \"_\" + Policy + \"_\" + Required + \"_\" + Ruleset + \"_\" + Running + \"_\" + Uninstallable + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + VMHostUid + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class TrapTargetImpl : TrapTarget, IEquatable<TrapTargetImpl>\n    {\n        public string Community { get; set; }\n\n        public string HostName { get; set; }\n\n        public int Port { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(TrapTargetImpl trapTargetImpl)\n        {\n            return (trapTargetImpl != null && this.Community == trapTargetImpl.Community && this.HostName == trapTargetImpl.HostName && this.Port == trapTargetImpl.Port && this.Uid == trapTargetImpl.Uid);\n        }\n\n        public override bool Equals(object trapTargetImpl)\n        {\n            return Equals(trapTargetImpl as TrapTargetImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Community + \"_\" + HostName + \"_\" + Port + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostAuthenticationImpl : VMHostAuthentication, IEquatable<VMHostAuthenticationImpl>\n    {\n        public VMHost VMHost { get; set; }\n\n        public string Domain { get; set; }\n\n        public string[] TrustedDomains { get; set; }\n\n        public DomainMembershipStatus? DomainMembershipStatus { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostAuthenticationImpl vMHostAuthenticationImpl)\n        {\n            return (vMHostAuthenticationImpl != null && ((this.VMHost == null && vMHostAuthenticationImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostAuthenticationImpl.VMHost))) && this.Domain == vMHostAuthenticationImpl.Domain && ((this.TrustedDomains == null && vMHostAuthenticationImpl.TrustedDomains == null) || (this.TrustedDomains != null && vMHostAuthenticationImpl.TrustedDomains != null && Enumerable.SequenceEqual(this.TrustedDomains, vMHostAuthenticationImpl.TrustedDomains))) && ((this.DomainMembershipStatus == null && vMHostAuthenticationImpl.DomainMembershipStatus == null) || (this.DomainMembershipStatus != null && this.DomainMembershipStatus.Equals(vMHostAuthenticationImpl.DomainMembershipStatus))) && ((this.ExtensionData == null && vMHostAuthenticationImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostAuthenticationImpl.ExtensionData))) && this.Id == vMHostAuthenticationImpl.Id && this.Name == vMHostAuthenticationImpl.Name && this.Uid == vMHostAuthenticationImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostAuthenticationImpl)\n        {\n            return Equals(vMHostAuthenticationImpl as VMHostAuthenticationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHost + \"_\" + Domain + \"_\" + TrustedDomains + \"_\" + DomainMembershipStatus + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostDiagnosticPartitionImpl : VMHostDiagnosticPartition, IEquatable<VMHostDiagnosticPartitionImpl>\n    {\n        public string HostId { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string HostUid { get; set; }\n\n        public string CanonicalName { get; set; }\n\n        public string DiagnosticType { get; set; }\n\n        public int SlotCount { get; set; }\n\n        public string StorageType { get; set; }\n\n        public bool Active { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostDiagnosticPartitionImpl vMHostDiagnosticPartitionImpl)\n        {\n            return (vMHostDiagnosticPartitionImpl != null && this.HostId == vMHostDiagnosticPartitionImpl.HostId && this.VMHostId == vMHostDiagnosticPartitionImpl.VMHostId && ((this.VMHost == null && vMHostDiagnosticPartitionImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostDiagnosticPartitionImpl.VMHost))) && this.HostUid == vMHostDiagnosticPartitionImpl.HostUid && this.CanonicalName == vMHostDiagnosticPartitionImpl.CanonicalName && this.DiagnosticType == vMHostDiagnosticPartitionImpl.DiagnosticType && this.SlotCount == vMHostDiagnosticPartitionImpl.SlotCount && this.StorageType == vMHostDiagnosticPartitionImpl.StorageType && this.Active == vMHostDiagnosticPartitionImpl.Active && this.Uid == vMHostDiagnosticPartitionImpl.Uid && ((this.ExtensionData == null && vMHostDiagnosticPartitionImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostDiagnosticPartitionImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMHostDiagnosticPartitionImpl)\n        {\n            return Equals(vMHostDiagnosticPartitionImpl as VMHostDiagnosticPartitionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (HostId + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + HostUid + \"_\" + CanonicalName + \"_\" + DiagnosticType + \"_\" + SlotCount + \"_\" + StorageType + \"_\" + Active + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostFirewallExceptionImpl : VMHostFirewallException, IEquatable<VMHostFirewallExceptionImpl>\n    {\n        public string Uid { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public string IncomingPorts { get; set; }\n\n        public string OutgoingPorts { get; set; }\n\n        public string Protocols { get; set; }\n\n        public bool? ServiceRunning { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostFirewallExceptionImpl vmHostFirewallExceptionImpl)\n        {\n            return (vmHostFirewallExceptionImpl != null && this.Uid == vmHostFirewallExceptionImpl.Uid && this.VMHostId == vmHostFirewallExceptionImpl.VMHostId && ((this.VMHost == null && vmHostFirewallExceptionImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vmHostFirewallExceptionImpl.VMHost))) && this.Name == vmHostFirewallExceptionImpl.Name && this.Enabled == vmHostFirewallExceptionImpl.Enabled && this.IncomingPorts == vmHostFirewallExceptionImpl.IncomingPorts && this.OutgoingPorts == vmHostFirewallExceptionImpl.OutgoingPorts && this.Protocols == vmHostFirewallExceptionImpl.Protocols && this.ServiceRunning == vmHostFirewallExceptionImpl.ServiceRunning && ((this.ExtensionData == null && vmHostFirewallExceptionImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vmHostFirewallExceptionImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vmHostFirewallExceptionImpl)\n        {\n            return Equals(vmHostFirewallExceptionImpl as VMHostFirewallExceptionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Name + \"_\" + Enabled + \"_\" + IncomingPorts + \"_\" + OutgoingPorts + \"_\" + Protocols + \"_\" + ServiceRunning + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostHardwareImpl : VMHostHardware, IEquatable<VMHostHardwareImpl>\n    {\n        public VMHost VMHost { get; set; }\n\n        public string Manufacturer { get; set; }\n\n        public string Model { get; set; }\n\n        public string SerialNumber { get; set; }\n\n        public string AssetTag { get; set; }\n\n        public string BiosVersion { get; set; }\n\n        public string CpuModel { get; set; }\n\n        public int CpuCount { get; set; }\n\n        public int CpuCoreCountTotal { get; set; }\n\n        public int MhzPerCpu { get; set; }\n\n        public int MemorySlotCount { get; set; }\n\n        public VMHostMemoryModule[] MemoryModules { get; set; }\n\n        public VMHostPowerSupply[] PowerSupplies { get; set; }\n\n        public int NicCount { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostHardwareImpl vMHostHardwareImpl)\n        {\n            return (vMHostHardwareImpl != null && ((this.VMHost == null && vMHostHardwareImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostHardwareImpl.VMHost))) && this.Manufacturer == vMHostHardwareImpl.Manufacturer && this.Model == vMHostHardwareImpl.Model && this.SerialNumber == vMHostHardwareImpl.SerialNumber && this.AssetTag == vMHostHardwareImpl.AssetTag && this.BiosVersion == vMHostHardwareImpl.BiosVersion && this.CpuModel == vMHostHardwareImpl.CpuModel && this.CpuCount == vMHostHardwareImpl.CpuCount && this.CpuCoreCountTotal == vMHostHardwareImpl.CpuCoreCountTotal && this.MhzPerCpu == vMHostHardwareImpl.MhzPerCpu && this.MemorySlotCount == vMHostHardwareImpl.MemorySlotCount && ((this.MemoryModules == null && vMHostHardwareImpl.MemoryModules == null) || (this.MemoryModules != null && vMHostHardwareImpl.MemoryModules != null && Enumerable.SequenceEqual(this.MemoryModules, vMHostHardwareImpl.MemoryModules))) && ((this.PowerSupplies == null && vMHostHardwareImpl.PowerSupplies == null) || (this.PowerSupplies != null && vMHostHardwareImpl.PowerSupplies != null && Enumerable.SequenceEqual(this.PowerSupplies, vMHostHardwareImpl.PowerSupplies))) && this.NicCount == vMHostHardwareImpl.NicCount && this.Uid == vMHostHardwareImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostHardwareImpl)\n        {\n            return Equals(vMHostHardwareImpl as VMHostHardwareImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHost + \"_\" + Manufacturer + \"_\" + Model + \"_\" + SerialNumber + \"_\" + AssetTag + \"_\" + BiosVersion + \"_\" + CpuModel + \"_\" + CpuCount + \"_\" + CpuCoreCountTotal + \"_\" + MhzPerCpu + \"_\" + MemorySlotCount + \"_\" + MemoryModules + \"_\" + PowerSupplies + \"_\" + NicCount + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostMemoryModuleImpl : VMHostMemoryModule, IEquatable<VMHostMemoryModuleImpl>\n    {\n        public string Name { get; set; }\n\n        public decimal CapacityGB { get; set; }\n\n        public string Manufacturer { get; set; }\n\n        public string Model { get; set; }\n\n        public string SerialNumber { get; set; }\n\n        public bool Equals(VMHostMemoryModuleImpl vMHostMemoryModuleImpl)\n        {\n            return (vMHostMemoryModuleImpl != null && this.Name == vMHostMemoryModuleImpl.Name && this.CapacityGB == vMHostMemoryModuleImpl.CapacityGB && this.Manufacturer == vMHostMemoryModuleImpl.Manufacturer && this.Model == vMHostMemoryModuleImpl.Model && this.SerialNumber == vMHostMemoryModuleImpl.SerialNumber);\n        }\n\n        public override bool Equals(object vMHostMemoryModuleImpl)\n        {\n            return Equals(vMHostMemoryModuleImpl as VMHostMemoryModuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + CapacityGB + \"_\" + Manufacturer + \"_\" + Model + \"_\" + SerialNumber).GetHashCode();\n        }\n    }\n\n    public class VmHostModuleImpl : VmHostModule, IEquatable<VmHostModuleImpl>\n    {\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Name { get; set; }\n\n        public string Options { get; set; }\n\n        public string Uid { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public bool Equals(VmHostModuleImpl vmHostModuleImpl)\n        {\n            return (vmHostModuleImpl != null && this.ServerId == vmHostModuleImpl.ServerId && ((this.Server == null && vmHostModuleImpl.Server == null) || (this.Server != null && this.Server.Equals(vmHostModuleImpl.Server))) && this.Name == vmHostModuleImpl.Name && this.Options == vmHostModuleImpl.Options && this.Uid == vmHostModuleImpl.Uid && ((this.VMHost == null && vmHostModuleImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vmHostModuleImpl.VMHost))));\n        }\n\n        public override bool Equals(object vmHostModuleImpl)\n        {\n            return Equals(vmHostModuleImpl as VmHostModuleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerId + \"_\" + Server + \"_\" + Name + \"_\" + Options + \"_\" + Uid + \"_\" + VMHost).GetHashCode();\n        }\n    }\n\n    public class VMHostPatchImpl : VMHostPatch, IEquatable<VMHostPatchImpl>\n    {\n        public string Id { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public DateTime? InstallDate { get; set; }\n\n        public string Description { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostPatchImpl vMHostPatchImpl)\n        {\n            return (vMHostPatchImpl != null && this.Id == vMHostPatchImpl.Id && this.VMHostId == vMHostPatchImpl.VMHostId && ((this.VMHost == null && vMHostPatchImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostPatchImpl.VMHost))) && this.InstallDate == vMHostPatchImpl.InstallDate && this.Description == vMHostPatchImpl.Description && this.Uid == vMHostPatchImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostPatchImpl)\n        {\n            return Equals(vMHostPatchImpl as VMHostPatchImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + InstallDate + \"_\" + Description + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostPatchResultImpl : VMHostPatchResult, IEquatable<VMHostPatchResultImpl>\n    {\n        public string Id { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public bool IsApplicable { get; set; }\n\n        public bool IsInstalled { get; set; }\n\n        public bool NeedsReconnect { get; set; }\n\n        public bool NeedsRestart { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostPatchResultImpl vMHostPatchResultImpl)\n        {\n            return (vMHostPatchResultImpl != null && this.Id == vMHostPatchResultImpl.Id && this.VMHostId == vMHostPatchResultImpl.VMHostId && ((this.VMHost == null && vMHostPatchResultImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostPatchResultImpl.VMHost))) && this.IsApplicable == vMHostPatchResultImpl.IsApplicable && this.IsInstalled == vMHostPatchResultImpl.IsInstalled && this.NeedsReconnect == vMHostPatchResultImpl.NeedsReconnect && this.NeedsRestart == vMHostPatchResultImpl.NeedsRestart && this.Uid == vMHostPatchResultImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostPatchResultImpl)\n        {\n            return Equals(vMHostPatchResultImpl as VMHostPatchResultImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + IsApplicable + \"_\" + IsInstalled + \"_\" + NeedsReconnect + \"_\" + NeedsRestart + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostPciDeviceImpl : VMHostPciDevice, IEquatable<VMHostPciDeviceImpl>\n    {\n        public string Uid { get; set; }\n\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public string VendorName { get; set; }\n\n        public PciDeviceClass DeviceClass { get; set; }\n\n        public short DeviceId { get; set; }\n\n        public short SubDeviceId { get; set; }\n\n        public short ClassId { get; set; }\n\n        public short VendorId { get; set; }\n\n        public short SubVendorId { get; set; }\n\n        public bool Equals(VMHostPciDeviceImpl vMHostPciDeviceImpl)\n        {\n            return (vMHostPciDeviceImpl != null && this.Uid == vMHostPciDeviceImpl.Uid && this.Id == vMHostPciDeviceImpl.Id && this.Name == vMHostPciDeviceImpl.Name && ((this.VMHost == null && vMHostPciDeviceImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostPciDeviceImpl.VMHost))) && this.DeviceName == vMHostPciDeviceImpl.DeviceName && this.VendorName == vMHostPciDeviceImpl.VendorName && this.DeviceClass == vMHostPciDeviceImpl.DeviceClass && this.DeviceId == vMHostPciDeviceImpl.DeviceId && this.SubDeviceId == vMHostPciDeviceImpl.SubDeviceId && this.ClassId == vMHostPciDeviceImpl.ClassId && this.VendorId == vMHostPciDeviceImpl.VendorId && this.SubVendorId == vMHostPciDeviceImpl.SubVendorId);\n        }\n\n        public override bool Equals(object vMHostPciDeviceImpl)\n        {\n            return Equals(vMHostPciDeviceImpl as VMHostPciDeviceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Id + \"_\" + Name + \"_\" + VMHost + \"_\" + DeviceName + \"_\" + VendorName + \"_\" + DeviceClass + \"_\" + DeviceId + \"_\" + SubDeviceId + \"_\" + ClassId + \"_\" + VendorId + \"_\" + SubVendorId).GetHashCode();\n        }\n    }\n\n    public class VMHostPowerSupplyImpl : VMHostPowerSupply, IEquatable<VMHostPowerSupplyImpl>\n    {\n        public string Name { get; set; }\n\n        public int HealthState { get; set; }\n\n        public string HealthStateText { get; set; }\n\n        public int OperationalStatus { get; set; }\n\n        public string OperationalStatusText { get; set; }\n\n        public bool Equals(VMHostPowerSupplyImpl vMHostPowerSupplyImpl)\n        {\n            return (vMHostPowerSupplyImpl != null && this.Name == vMHostPowerSupplyImpl.Name && this.HealthState == vMHostPowerSupplyImpl.HealthState && this.HealthStateText == vMHostPowerSupplyImpl.HealthStateText && this.OperationalStatus == vMHostPowerSupplyImpl.OperationalStatus && this.OperationalStatusText == vMHostPowerSupplyImpl.OperationalStatusText);\n        }\n\n        public override bool Equals(object vMHostPowerSupplyImpl)\n        {\n            return Equals(vMHostPowerSupplyImpl as VMHostPowerSupplyImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + HealthState + \"_\" + HealthStateText + \"_\" + OperationalStatus + \"_\" + OperationalStatusText).GetHashCode();\n        }\n    }\n\n    public class VMHostRouteImpl : VMHostRoute, IEquatable<VMHostRouteImpl>\n    {\n        public IPAddress Destination { get; set; }\n\n        public IPAddress Gateway { get; set; }\n\n        public int PrefixLength { get; set; }\n\n        public IPVersion IPVersion { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public string Uid { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostRouteImpl vMHostRouteImpl)\n        {\n            return (vMHostRouteImpl != null && ((this.Destination == null && vMHostRouteImpl.Destination == null) || (this.Destination != null && this.Destination.Equals(vMHostRouteImpl.Destination))) && ((this.Gateway == null && vMHostRouteImpl.Gateway == null) || (this.Gateway != null && this.Gateway.Equals(vMHostRouteImpl.Gateway))) && this.PrefixLength == vMHostRouteImpl.PrefixLength && this.IPVersion == vMHostRouteImpl.IPVersion && this.VMHostId == vMHostRouteImpl.VMHostId && this.Uid == vMHostRouteImpl.Uid && ((this.VMHost == null && vMHostRouteImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostRouteImpl.VMHost))) && ((this.ExtensionData == null && vMHostRouteImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostRouteImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMHostRouteImpl)\n        {\n            return Equals(vMHostRouteImpl as VMHostRouteImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Destination + \"_\" + Gateway + \"_\" + PrefixLength + \"_\" + IPVersion + \"_\" + VMHostId + \"_\" + Uid + \"_\" + VMHost + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VmHostSnmpImpl : VmHostSnmp, IEquatable<VmHostSnmpImpl>\n    {\n        public bool Enabled { get; set; }\n\n        public int Port { get; set; }\n\n        public string[] ReadOnlyCommunities { get; set; }\n\n        public string VmHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VmHostUid { get; set; }\n\n        public TrapTarget[] TrapTargets { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VmHostSnmpImpl vmHostSnmpImpl)\n        {\n            return (vmHostSnmpImpl != null && this.Enabled == vmHostSnmpImpl.Enabled && this.Port == vmHostSnmpImpl.Port && ((this.ReadOnlyCommunities == null && vmHostSnmpImpl.ReadOnlyCommunities == null) || (this.ReadOnlyCommunities != null && vmHostSnmpImpl.ReadOnlyCommunities != null && Enumerable.SequenceEqual(this.ReadOnlyCommunities, vmHostSnmpImpl.ReadOnlyCommunities))) && this.VmHostId == vmHostSnmpImpl.VmHostId && ((this.VMHost == null && vmHostSnmpImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vmHostSnmpImpl.VMHost))) && this.VmHostUid == vmHostSnmpImpl.VmHostUid && ((this.TrapTargets == null && vmHostSnmpImpl.TrapTargets == null) || (this.TrapTargets != null && vmHostSnmpImpl.TrapTargets != null && Enumerable.SequenceEqual(this.TrapTargets, vmHostSnmpImpl.TrapTargets))) && this.Uid == vmHostSnmpImpl.Uid && ((this.ExtensionData == null && vmHostSnmpImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vmHostSnmpImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vmHostSnmpImpl)\n        {\n            return Equals(vmHostSnmpImpl as VmHostSnmpImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Enabled + \"_\" + Port + \"_\" + ReadOnlyCommunities + \"_\" + VmHostId + \"_\" + VMHost + \"_\" + VmHostUid + \"_\" + TrapTargets + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostTimeZoneImpl : VMHostTimeZone, IEquatable<VMHostTimeZoneImpl>\n    {\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string Description { get; set; }\n\n        public int GmtOffset { get; set; }\n\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostTimeZoneImpl vMHostTimeZoneImpl)\n        {\n            return (vMHostTimeZoneImpl != null && this.VMHostId == vMHostTimeZoneImpl.VMHostId && ((this.VMHost == null && vMHostTimeZoneImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostTimeZoneImpl.VMHost))) && this.Description == vMHostTimeZoneImpl.Description && this.GmtOffset == vMHostTimeZoneImpl.GmtOffset && this.Key == vMHostTimeZoneImpl.Key && this.Name == vMHostTimeZoneImpl.Name && this.Uid == vMHostTimeZoneImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostTimeZoneImpl)\n        {\n            return Equals(vMHostTimeZoneImpl as VMHostTimeZoneImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHostId + \"_\" + VMHost + \"_\" + Description + \"_\" + GmtOffset + \"_\" + Key + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.Account\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Account;\n    using VMware.VimAutomation.ViCore.Types.V1.PermissionManagement;\n\n    public class HostGroupAccountImpl : HostGroupAccount, IEquatable<HostGroupAccountImpl>\n    {\n        public string[] Users { get; set; }\n\n        public string Id { get; set; }\n\n        public string Description { get; set; }\n\n        public string Domain { get; set; }\n\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(HostGroupAccountImpl hostGroupAccountImpl)\n        {\n            return (hostGroupAccountImpl != null && ((this.Users == null && hostGroupAccountImpl.Users == null) || (this.Users != null && hostGroupAccountImpl.Users != null && Enumerable.SequenceEqual(this.Users, hostGroupAccountImpl.Users))) && this.Id == hostGroupAccountImpl.Id && this.Description == hostGroupAccountImpl.Description && this.Domain == hostGroupAccountImpl.Domain && this.ServerId == hostGroupAccountImpl.ServerId && ((this.Server == null && hostGroupAccountImpl.Server == null) || (this.Server != null && this.Server.Equals(hostGroupAccountImpl.Server))) && this.Name == hostGroupAccountImpl.Name && this.Uid == hostGroupAccountImpl.Uid && ((this.ExtensionData == null && hostGroupAccountImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostGroupAccountImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hostGroupAccountImpl)\n        {\n            return Equals(hostGroupAccountImpl as HostGroupAccountImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Users + \"_\" + Id + \"_\" + Description + \"_\" + Domain + \"_\" + ServerId + \"_\" + Server + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class HostUserAccountImpl : HostUserAccount, IEquatable<HostUserAccountImpl>\n    {\n        public string[] Groups { get; set; }\n\n        public string Id { get; set; }\n\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Description { get; set; }\n\n        public string Domain { get; set; }\n\n        public bool ShellAccessEnabled { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(HostUserAccountImpl hostUserAccountImpl)\n        {\n            return (hostUserAccountImpl != null && ((this.Groups == null && hostUserAccountImpl.Groups == null) || (this.Groups != null && hostUserAccountImpl.Groups != null && Enumerable.SequenceEqual(this.Groups, hostUserAccountImpl.Groups))) && this.Id == hostUserAccountImpl.Id && this.ServerId == hostUserAccountImpl.ServerId && ((this.Server == null && hostUserAccountImpl.Server == null) || (this.Server != null && this.Server.Equals(hostUserAccountImpl.Server))) && this.Description == hostUserAccountImpl.Description && this.Domain == hostUserAccountImpl.Domain && this.ShellAccessEnabled == hostUserAccountImpl.ShellAccessEnabled && this.Name == hostUserAccountImpl.Name && this.Uid == hostUserAccountImpl.Uid && ((this.ExtensionData == null && hostUserAccountImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostUserAccountImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hostUserAccountImpl)\n        {\n            return Equals(hostUserAccountImpl as HostUserAccountImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Groups + \"_\" + Id + \"_\" + ServerId + \"_\" + Server + \"_\" + Description + \"_\" + Domain + \"_\" + ShellAccessEnabled + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.Networking\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n\n    public class DistributedPortGroupImpl : DistributedPortGroup, IEquatable<DistributedPortGroupImpl>\n    {\n        public VirtualSwitchBase VirtualSwitch { get; set; }\n\n        public string Name { get; set; }\n\n        public string Key { get; set; }\n\n        public string Notes { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public Datacenter Datacenter { get; set; }\n\n        public DistributedPortGroupPortBinding PortBinding { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(DistributedPortGroupImpl distributedPortGroupImpl)\n        {\n            return (distributedPortGroupImpl != null && ((this.VirtualSwitch == null && distributedPortGroupImpl.VirtualSwitch == null) || (this.VirtualSwitch != null && this.VirtualSwitch.Equals(distributedPortGroupImpl.VirtualSwitch))) && this.Name == distributedPortGroupImpl.Name && this.Key == distributedPortGroupImpl.Key && this.Notes == distributedPortGroupImpl.Notes && this.NumPorts == distributedPortGroupImpl.NumPorts && ((this.Datacenter == null && distributedPortGroupImpl.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(distributedPortGroupImpl.Datacenter))) && this.PortBinding == distributedPortGroupImpl.PortBinding && ((this.ExtensionData == null && distributedPortGroupImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(distributedPortGroupImpl.ExtensionData))) && this.Id == distributedPortGroupImpl.Id && this.Uid == distributedPortGroupImpl.Uid);\n        }\n\n        public override bool Equals(object distributedPortGroupImpl)\n        {\n            return Equals(distributedPortGroupImpl as DistributedPortGroupImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualSwitch + \"_\" + Name + \"_\" + Key + \"_\" + Notes + \"_\" + NumPorts + \"_\" + Datacenter + \"_\" + PortBinding + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class DistributedSwitchImpl : DistributedSwitch, IEquatable<DistributedSwitchImpl>\n    {\n        public string Key { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public string Notes { get; set; }\n\n        public Datacenter Datacenter { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(DistributedSwitchImpl distributedSwitchImpl)\n        {\n            return (distributedSwitchImpl != null && this.Key == distributedSwitchImpl.Key && this.NumPorts == distributedSwitchImpl.NumPorts && ((this.Mtu == null && distributedSwitchImpl.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(distributedSwitchImpl.Mtu))) && this.Notes == distributedSwitchImpl.Notes && ((this.Datacenter == null && distributedSwitchImpl.Datacenter == null) || (this.Datacenter != null && this.Datacenter.Equals(distributedSwitchImpl.Datacenter))) && this.Name == distributedSwitchImpl.Name && ((this.ExtensionData == null && distributedSwitchImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(distributedSwitchImpl.ExtensionData))) && this.Id == distributedSwitchImpl.Id && this.Uid == distributedSwitchImpl.Uid);\n        }\n\n        public override bool Equals(object distributedSwitchImpl)\n        {\n            return Equals(distributedSwitchImpl as DistributedSwitchImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + NumPorts + \"_\" + Mtu + \"_\" + Notes + \"_\" + Datacenter + \"_\" + Name + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class NicTeamingVirtualPortGroupPolicyImpl : NicTeamingVirtualPortGroupPolicy, IEquatable<NicTeamingVirtualPortGroupPolicyImpl>\n    {\n        public string VirtualPortGroupId { get; set; }\n\n        public VirtualPortGroup VirtualPortGroup { get; set; }\n\n        public string VirtualPortGroupUid { get; set; }\n\n        public bool IsLoadBalancingInherited { get; set; }\n\n        public bool IsNetworkFailoverDetectionInherited { get; set; }\n\n        public bool IsNotifySwitchesInherited { get; set; }\n\n        public bool IsFailbackInherited { get; set; }\n\n        public bool IsFailoverOrderInherited { get; set; }\n\n        public bool IsCheckBeaconInherited { get; set; }\n\n        public LoadBalancingPolicy LoadBalancingPolicy { get; set; }\n\n        public NetworkFailoverDetectionPolicy NetworkFailoverDetectionPolicy { get; set; }\n\n        public bool NotifySwitches { get; set; }\n\n        public bool FailbackEnabled { get; set; }\n\n        public string[] ActiveNic { get; set; }\n\n        public string[] StandbyNic { get; set; }\n\n        public string[] UnusedNic { get; set; }\n\n        public bool CheckBeacon { get; set; }\n\n        public string VmHostId { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(NicTeamingVirtualPortGroupPolicyImpl nicTeamingVirtualPortGroupPolicyImpl)\n        {\n            return (nicTeamingVirtualPortGroupPolicyImpl != null && this.VirtualPortGroupId == nicTeamingVirtualPortGroupPolicyImpl.VirtualPortGroupId && ((this.VirtualPortGroup == null && nicTeamingVirtualPortGroupPolicyImpl.VirtualPortGroup == null) || (this.VirtualPortGroup != null && this.VirtualPortGroup.Equals(nicTeamingVirtualPortGroupPolicyImpl.VirtualPortGroup))) && this.VirtualPortGroupUid == nicTeamingVirtualPortGroupPolicyImpl.VirtualPortGroupUid && this.IsLoadBalancingInherited == nicTeamingVirtualPortGroupPolicyImpl.IsLoadBalancingInherited && this.IsNetworkFailoverDetectionInherited == nicTeamingVirtualPortGroupPolicyImpl.IsNetworkFailoverDetectionInherited && this.IsNotifySwitchesInherited == nicTeamingVirtualPortGroupPolicyImpl.IsNotifySwitchesInherited && this.IsFailbackInherited == nicTeamingVirtualPortGroupPolicyImpl.IsFailbackInherited && this.IsFailoverOrderInherited == nicTeamingVirtualPortGroupPolicyImpl.IsFailoverOrderInherited && this.IsCheckBeaconInherited == nicTeamingVirtualPortGroupPolicyImpl.IsCheckBeaconInherited && this.LoadBalancingPolicy == nicTeamingVirtualPortGroupPolicyImpl.LoadBalancingPolicy && this.NetworkFailoverDetectionPolicy == nicTeamingVirtualPortGroupPolicyImpl.NetworkFailoverDetectionPolicy && this.NotifySwitches == nicTeamingVirtualPortGroupPolicyImpl.NotifySwitches && this.FailbackEnabled == nicTeamingVirtualPortGroupPolicyImpl.FailbackEnabled && ((this.ActiveNic == null && nicTeamingVirtualPortGroupPolicyImpl.ActiveNic == null) || (this.ActiveNic != null && nicTeamingVirtualPortGroupPolicyImpl.ActiveNic != null && Enumerable.SequenceEqual(this.ActiveNic, nicTeamingVirtualPortGroupPolicyImpl.ActiveNic))) && ((this.StandbyNic == null && nicTeamingVirtualPortGroupPolicyImpl.StandbyNic == null) || (this.StandbyNic != null && nicTeamingVirtualPortGroupPolicyImpl.StandbyNic != null && Enumerable.SequenceEqual(this.StandbyNic, nicTeamingVirtualPortGroupPolicyImpl.StandbyNic))) && ((this.UnusedNic == null && nicTeamingVirtualPortGroupPolicyImpl.UnusedNic == null) || (this.UnusedNic != null && nicTeamingVirtualPortGroupPolicyImpl.UnusedNic != null && Enumerable.SequenceEqual(this.UnusedNic, nicTeamingVirtualPortGroupPolicyImpl.UnusedNic))) && this.CheckBeacon == nicTeamingVirtualPortGroupPolicyImpl.CheckBeacon && this.VmHostId == nicTeamingVirtualPortGroupPolicyImpl.VmHostId && ((this.ExtensionData == null && nicTeamingVirtualPortGroupPolicyImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(nicTeamingVirtualPortGroupPolicyImpl.ExtensionData))) && this.Uid == nicTeamingVirtualPortGroupPolicyImpl.Uid);\n        }\n\n        public override bool Equals(object nicTeamingVirtualPortGroupPolicyImpl)\n        {\n            return Equals(nicTeamingVirtualPortGroupPolicyImpl as NicTeamingVirtualPortGroupPolicyImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualPortGroupId + \"_\" + VirtualPortGroup + \"_\" + VirtualPortGroupUid + \"_\" + IsLoadBalancingInherited + \"_\" + IsNetworkFailoverDetectionInherited + \"_\" + IsNotifySwitchesInherited + \"_\" + IsFailbackInherited + \"_\" + IsFailoverOrderInherited + \"_\" + IsCheckBeaconInherited + \"_\" + LoadBalancingPolicy + \"_\" + NetworkFailoverDetectionPolicy + \"_\" + NotifySwitches + \"_\" + FailbackEnabled + \"_\" + ActiveNic + \"_\" + StandbyNic + \"_\" + UnusedNic + \"_\" + CheckBeacon + \"_\" + VmHostId + \"_\" + ExtensionData + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class PortGroupPortImpl : PortGroupPort, IEquatable<PortGroupPortImpl>\n    {\n        public string Key { get; set; }\n\n        public string[] Mac { get; set; }\n\n        public string Type { get; set; }\n\n        public bool Equals(PortGroupPortImpl portGroupPortImpl)\n        {\n            return (portGroupPortImpl != null && this.Key == portGroupPortImpl.Key && ((this.Mac == null && portGroupPortImpl.Mac == null) || (this.Mac != null && portGroupPortImpl.Mac != null && Enumerable.SequenceEqual(this.Mac, portGroupPortImpl.Mac))) && this.Type == portGroupPortImpl.Type);\n        }\n\n        public override bool Equals(object portGroupPortImpl)\n        {\n            return Equals(portGroupPortImpl as PortGroupPortImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Mac + \"_\" + Type).GetHashCode();\n        }\n    }\n\n    public class VirtualPortGroupImpl : VirtualPortGroup, IEquatable<VirtualPortGroupImpl>\n    {\n        public string Name { get; set; }\n\n        public string VirtualSwitchId { get; set; }\n\n        public string VirtualSwitchUid { get; set; }\n\n        public VirtualSwitchBase VirtualSwitch { get; set; }\n\n        public string Key { get; set; }\n\n        public PortGroupPort[] Port { get; set; }\n\n        public int VLanId { get; set; }\n\n        public string VirtualSwitchName { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public string VMHostUid { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitchBase> ToVirtualSwitch()\n        {\n            return default(IEnumerable<VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitchBase>);\n        }\n\n        public bool Equals(VirtualPortGroupImpl virtualPortGroupImpl)\n        {\n            return (virtualPortGroupImpl != null && this.Name == virtualPortGroupImpl.Name && this.VirtualSwitchId == virtualPortGroupImpl.VirtualSwitchId && this.VirtualSwitchUid == virtualPortGroupImpl.VirtualSwitchUid && ((this.VirtualSwitch == null && virtualPortGroupImpl.VirtualSwitch == null) || (this.VirtualSwitch != null && this.VirtualSwitch.Equals(virtualPortGroupImpl.VirtualSwitch))) && this.Key == virtualPortGroupImpl.Key && ((this.Port == null && virtualPortGroupImpl.Port == null) || (this.Port != null && virtualPortGroupImpl.Port != null && Enumerable.SequenceEqual(this.Port, virtualPortGroupImpl.Port))) && this.VLanId == virtualPortGroupImpl.VLanId && this.VirtualSwitchName == virtualPortGroupImpl.VirtualSwitchName && this.VMHostId == virtualPortGroupImpl.VMHostId && this.VMHostUid == virtualPortGroupImpl.VMHostUid && this.Uid == virtualPortGroupImpl.Uid && ((this.ExtensionData == null && virtualPortGroupImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(virtualPortGroupImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object virtualPortGroupImpl)\n        {\n            return Equals(virtualPortGroupImpl as VirtualPortGroupImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + VirtualSwitchId + \"_\" + VirtualSwitchUid + \"_\" + VirtualSwitch + \"_\" + Key + \"_\" + Port + \"_\" + VLanId + \"_\" + VirtualSwitchName + \"_\" + VMHostId + \"_\" + VMHostUid + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VirtualPortGroupSecurityPolicyImpl : VirtualPortgroupSecurityPolicy, IEquatable<VirtualPortGroupSecurityPolicyImpl>\n    {\n        public bool AllowPromiscuous { get; set; }\n\n        public bool ForgedTransmits { get; set; }\n\n        public bool MacChanges { get; set; }\n\n        public VirtualPortGroup VirtualPortGroup { get; set; }\n\n        public bool AllowPromiscuousInherited { get; set; }\n\n        public bool ForgedTransmitsInherited { get; set; }\n\n        public bool MacChangesInherited { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VirtualPortGroupSecurityPolicyImpl virtualPortGroupSecurityPolicyImpl)\n        {\n            return (virtualPortGroupSecurityPolicyImpl != null && this.AllowPromiscuous == virtualPortGroupSecurityPolicyImpl.AllowPromiscuous && this.ForgedTransmits == virtualPortGroupSecurityPolicyImpl.ForgedTransmits && this.MacChanges == virtualPortGroupSecurityPolicyImpl.MacChanges && ((this.VirtualPortGroup == null && virtualPortGroupSecurityPolicyImpl.VirtualPortGroup == null) || (this.VirtualPortGroup != null && this.VirtualPortGroup.Equals(virtualPortGroupSecurityPolicyImpl.VirtualPortGroup))) && this.AllowPromiscuousInherited == virtualPortGroupSecurityPolicyImpl.AllowPromiscuousInherited && this.ForgedTransmitsInherited == virtualPortGroupSecurityPolicyImpl.ForgedTransmitsInherited && this.MacChangesInherited == virtualPortGroupSecurityPolicyImpl.MacChangesInherited && this.Uid == virtualPortGroupSecurityPolicyImpl.Uid && ((this.ExtensionData == null && virtualPortGroupSecurityPolicyImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(virtualPortGroupSecurityPolicyImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object virtualPortGroupSecurityPolicyImpl)\n        {\n            return Equals(virtualPortGroupSecurityPolicyImpl as VirtualPortGroupSecurityPolicyImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AllowPromiscuous + \"_\" + ForgedTransmits + \"_\" + MacChanges + \"_\" + VirtualPortGroup + \"_\" + AllowPromiscuousInherited + \"_\" + ForgedTransmitsInherited + \"_\" + MacChangesInherited + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VirtualSwitchImpl : VirtualSwitch, IEquatable<VirtualSwitchImpl>\n    {\n        public string Id { get; set; }\n\n        public string Key { get; set; }\n\n        public string Name { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public int NumPortsAvailable { get; set; }\n\n        public string[] Nic { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VMHostUid { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VirtualSwitchImpl virtualSwitchImpl)\n        {\n            return (virtualSwitchImpl != null && this.Id == virtualSwitchImpl.Id && this.Key == virtualSwitchImpl.Key && this.Name == virtualSwitchImpl.Name && this.NumPorts == virtualSwitchImpl.NumPorts && this.NumPortsAvailable == virtualSwitchImpl.NumPortsAvailable && ((this.Nic == null && virtualSwitchImpl.Nic == null) || (this.Nic != null && virtualSwitchImpl.Nic != null && Enumerable.SequenceEqual(this.Nic, virtualSwitchImpl.Nic))) && ((this.Mtu == null && virtualSwitchImpl.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(virtualSwitchImpl.Mtu))) && this.VMHostId == virtualSwitchImpl.VMHostId && ((this.VMHost == null && virtualSwitchImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(virtualSwitchImpl.VMHost))) && this.VMHostUid == virtualSwitchImpl.VMHostUid && this.Uid == virtualSwitchImpl.Uid && ((this.ExtensionData == null && virtualSwitchImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(virtualSwitchImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object virtualSwitchImpl)\n        {\n            return Equals(virtualSwitchImpl as VirtualSwitchImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Key + \"_\" + Name + \"_\" + NumPorts + \"_\" + NumPortsAvailable + \"_\" + Nic + \"_\" + Mtu + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + VMHostUid + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostNetworkInfoImpl : VMHostNetworkInfo, IEquatable<VMHostNetworkInfoImpl>\n    {\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VMKernelGateway { get; set; }\n\n        public string VMKernelGatewayDevice { get; set; }\n\n        public string ConsoleGateway { get; set; }\n\n        public string ConsoleGatewayDevice { get; set; }\n\n        public string[] DnsAddress { get; set; }\n\n        public bool DnsFromDhcp { get; set; }\n\n        public string DnsDhcpDevice { get; set; }\n\n        public string DomainName { get; set; }\n\n        public string HostName { get; set; }\n\n        public string[] SearchDomain { get; set; }\n\n        public VirtualSwitch[] VirtualSwitch { get; set; }\n\n        public PhysicalNic[] PhysicalNic { get; set; }\n\n        public HostVirtualNic[] ConsoleNic { get; set; }\n\n        public HostVirtualNic[] VirtualNic { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool? IPv6Enabled { get; set; }\n\n        public string ConsoleV6Gateway { get; set; }\n\n        public string ConsoleV6GatewayDevice { get; set; }\n\n        public string VMKernelV6Gateway { get; set; }\n\n        public string VMKernelV6GatewayDevice { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public object ExtensionData2 { get; set; }\n\n        public string Name { get; set; }\n\n        public string Id { get; set; }\n\n        public bool Equals(VMHostNetworkInfoImpl vMHostNetworkInfoImpl)\n        {\n            return (vMHostNetworkInfoImpl != null && this.VMHostId == vMHostNetworkInfoImpl.VMHostId && ((this.VMHost == null && vMHostNetworkInfoImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostNetworkInfoImpl.VMHost))) && this.VMKernelGateway == vMHostNetworkInfoImpl.VMKernelGateway && this.VMKernelGatewayDevice == vMHostNetworkInfoImpl.VMKernelGatewayDevice && this.ConsoleGateway == vMHostNetworkInfoImpl.ConsoleGateway && this.ConsoleGatewayDevice == vMHostNetworkInfoImpl.ConsoleGatewayDevice && ((this.DnsAddress == null && vMHostNetworkInfoImpl.DnsAddress == null) || (this.DnsAddress != null && vMHostNetworkInfoImpl.DnsAddress != null && Enumerable.SequenceEqual(this.DnsAddress, vMHostNetworkInfoImpl.DnsAddress))) && this.DnsFromDhcp == vMHostNetworkInfoImpl.DnsFromDhcp && this.DnsDhcpDevice == vMHostNetworkInfoImpl.DnsDhcpDevice && this.DomainName == vMHostNetworkInfoImpl.DomainName && this.HostName == vMHostNetworkInfoImpl.HostName && ((this.SearchDomain == null && vMHostNetworkInfoImpl.SearchDomain == null) || (this.SearchDomain != null && vMHostNetworkInfoImpl.SearchDomain != null && Enumerable.SequenceEqual(this.SearchDomain, vMHostNetworkInfoImpl.SearchDomain))) && ((this.VirtualSwitch == null && vMHostNetworkInfoImpl.VirtualSwitch == null) || (this.VirtualSwitch != null && vMHostNetworkInfoImpl.VirtualSwitch != null && Enumerable.SequenceEqual(this.VirtualSwitch, vMHostNetworkInfoImpl.VirtualSwitch))) && ((this.PhysicalNic == null && vMHostNetworkInfoImpl.PhysicalNic == null) || (this.PhysicalNic != null && vMHostNetworkInfoImpl.PhysicalNic != null && Enumerable.SequenceEqual(this.PhysicalNic, vMHostNetworkInfoImpl.PhysicalNic))) && ((this.ConsoleNic == null && vMHostNetworkInfoImpl.ConsoleNic == null) || (this.ConsoleNic != null && vMHostNetworkInfoImpl.ConsoleNic != null && Enumerable.SequenceEqual(this.ConsoleNic, vMHostNetworkInfoImpl.ConsoleNic))) && ((this.VirtualNic == null && vMHostNetworkInfoImpl.VirtualNic == null) || (this.VirtualNic != null && vMHostNetworkInfoImpl.VirtualNic != null && Enumerable.SequenceEqual(this.VirtualNic, vMHostNetworkInfoImpl.VirtualNic))) && this.Uid == vMHostNetworkInfoImpl.Uid && ((this.IPv6Enabled == null && vMHostNetworkInfoImpl.IPv6Enabled == null) || (this.IPv6Enabled != null && this.IPv6Enabled.Equals(vMHostNetworkInfoImpl.IPv6Enabled))) && this.ConsoleV6Gateway == vMHostNetworkInfoImpl.ConsoleV6Gateway && this.ConsoleV6GatewayDevice == vMHostNetworkInfoImpl.ConsoleV6GatewayDevice && this.VMKernelV6Gateway == vMHostNetworkInfoImpl.VMKernelV6Gateway && this.VMKernelV6GatewayDevice == vMHostNetworkInfoImpl.VMKernelV6GatewayDevice && ((this.ExtensionData == null && vMHostNetworkInfoImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostNetworkInfoImpl.ExtensionData))) && ((this.ExtensionData2 == null && vMHostNetworkInfoImpl.ExtensionData2 == null) || (this.ExtensionData2 != null && this.ExtensionData2.Equals(vMHostNetworkInfoImpl.ExtensionData2))) && this.Name == vMHostNetworkInfoImpl.Name && this.Id == vMHostNetworkInfoImpl.Id);\n        }\n\n        public override bool Equals(object vMHostNetworkInfoImpl)\n        {\n            return Equals(vMHostNetworkInfoImpl as VMHostNetworkInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHostId + \"_\" + VMHost + \"_\" + VMKernelGateway + \"_\" + VMKernelGatewayDevice + \"_\" + ConsoleGateway + \"_\" + ConsoleGatewayDevice + \"_\" + DnsAddress + \"_\" + DnsFromDhcp + \"_\" + DnsDhcpDevice + \"_\" + DomainName + \"_\" + HostName + \"_\" + SearchDomain + \"_\" + VirtualSwitch + \"_\" + PhysicalNic + \"_\" + ConsoleNic + \"_\" + VirtualNic + \"_\" + Uid + \"_\" + IPv6Enabled + \"_\" + ConsoleV6Gateway + \"_\" + ConsoleV6GatewayDevice + \"_\" + VMKernelV6Gateway + \"_\" + VMKernelV6GatewayDevice + \"_\" + ExtensionData + \"_\" + ExtensionData2 + \"_\" + Name + \"_\" + Id).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class HostConsoleVirtualNicImpl : HostVirtualNicImpl, HostConsoleVirtualNic, IEquatable<HostConsoleVirtualNicImpl>\n    {\n        public IPv6Address[] IPv6 { get; set; }\n\n        public bool? AutomaticIPv6 { get; set; }\n\n        public bool? IPv6ThroughDhcp { get; set; }\n\n        public bool? IPv6Enabled { get; set; }\n\n        public bool Equals(HostConsoleVirtualNicImpl hostConsoleVirtualNicImpl)\n        {\n            return (hostConsoleVirtualNicImpl != null && ((this.IPv6 == null && hostConsoleVirtualNicImpl.IPv6 == null) || (this.IPv6 != null && hostConsoleVirtualNicImpl.IPv6 != null && Enumerable.SequenceEqual(this.IPv6, hostConsoleVirtualNicImpl.IPv6))) && ((this.AutomaticIPv6 == null && hostConsoleVirtualNicImpl.AutomaticIPv6 == null) || (this.AutomaticIPv6 != null && this.AutomaticIPv6.Equals(hostConsoleVirtualNicImpl.AutomaticIPv6))) && ((this.IPv6ThroughDhcp == null && hostConsoleVirtualNicImpl.IPv6ThroughDhcp == null) || (this.IPv6ThroughDhcp != null && this.IPv6ThroughDhcp.Equals(hostConsoleVirtualNicImpl.IPv6ThroughDhcp))) && ((this.IPv6Enabled == null && hostConsoleVirtualNicImpl.IPv6Enabled == null) || (this.IPv6Enabled != null && this.IPv6Enabled.Equals(hostConsoleVirtualNicImpl.IPv6Enabled))) && this.Uid == hostConsoleVirtualNicImpl.Uid && this.Name == hostConsoleVirtualNicImpl.Name && this.Id == hostConsoleVirtualNicImpl.Id && this.VMHostId == hostConsoleVirtualNicImpl.VMHostId && ((this.VMHost == null && hostConsoleVirtualNicImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hostConsoleVirtualNicImpl.VMHost))) && this.DeviceName == hostConsoleVirtualNicImpl.DeviceName && this.Mac == hostConsoleVirtualNicImpl.Mac && this.DhcpEnabled == hostConsoleVirtualNicImpl.DhcpEnabled && this.IP == hostConsoleVirtualNicImpl.IP && this.SubnetMask == hostConsoleVirtualNicImpl.SubnetMask && ((this.ExtensionData == null && hostConsoleVirtualNicImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostConsoleVirtualNicImpl.ExtensionData))) && this.PortGroupName == hostConsoleVirtualNicImpl.PortGroupName);\n        }\n\n        public override bool Equals(object hostConsoleVirtualNicImpl)\n        {\n            return Equals(hostConsoleVirtualNicImpl as HostConsoleVirtualNicImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IPv6 + \"_\" + AutomaticIPv6 + \"_\" + IPv6ThroughDhcp + \"_\" + IPv6Enabled + \"_\" + Uid + \"_\" + Name + \"_\" + Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + DeviceName + \"_\" + Mac + \"_\" + DhcpEnabled + \"_\" + IP + \"_\" + SubnetMask + \"_\" + ExtensionData + \"_\" + PortGroupName).GetHashCode();\n        }\n    }\n\n    public class HostNicImpl : HostNic, IEquatable<HostNicImpl>\n    {\n        public string Id { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VMHostUid { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public string Mac { get; set; }\n\n        public bool DhcpEnabled { get; set; }\n\n        public string IP { get; set; }\n\n        public string SubnetMask { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(HostNicImpl hostNicImpl)\n        {\n            return (hostNicImpl != null && this.Id == hostNicImpl.Id && this.VMHostId == hostNicImpl.VMHostId && ((this.VMHost == null && hostNicImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hostNicImpl.VMHost))) && this.VMHostUid == hostNicImpl.VMHostUid && this.DeviceName == hostNicImpl.DeviceName && this.Mac == hostNicImpl.Mac && this.DhcpEnabled == hostNicImpl.DhcpEnabled && this.IP == hostNicImpl.IP && this.SubnetMask == hostNicImpl.SubnetMask && this.Uid == hostNicImpl.Uid && this.Name == hostNicImpl.Name && ((this.ExtensionData == null && hostNicImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostNicImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hostNicImpl)\n        {\n            return Equals(hostNicImpl as HostNicImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + VMHostUid + \"_\" + DeviceName + \"_\" + Mac + \"_\" + DhcpEnabled + \"_\" + IP + \"_\" + SubnetMask + \"_\" + Uid + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class HostVirtualNicImpl : HostNicImpl, HostVirtualNic, IEquatable<HostVirtualNicImpl>\n    {\n        public string PortGroupName { get; set; }\n\n        public bool Equals(HostVirtualNicImpl hostVirtualNicImpl)\n        {\n            return (hostVirtualNicImpl != null && this.PortGroupName == hostVirtualNicImpl.PortGroupName && this.Uid == hostVirtualNicImpl.Uid && this.Name == hostVirtualNicImpl.Name && this.Id == hostVirtualNicImpl.Id && this.VMHostId == hostVirtualNicImpl.VMHostId && ((this.VMHost == null && hostVirtualNicImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hostVirtualNicImpl.VMHost))) && this.DeviceName == hostVirtualNicImpl.DeviceName && this.Mac == hostVirtualNicImpl.Mac && this.DhcpEnabled == hostVirtualNicImpl.DhcpEnabled && this.IP == hostVirtualNicImpl.IP && this.SubnetMask == hostVirtualNicImpl.SubnetMask && ((this.ExtensionData == null && hostVirtualNicImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostVirtualNicImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hostVirtualNicImpl)\n        {\n            return Equals(hostVirtualNicImpl as HostVirtualNicImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortGroupName + \"_\" + Uid + \"_\" + Name + \"_\" + Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + DeviceName + \"_\" + Mac + \"_\" + DhcpEnabled + \"_\" + IP + \"_\" + SubnetMask + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class HostVMKernelVirtualNicImpl : HostVirtualNicImpl, HostVMKernelVirtualNic, IEquatable<HostVMKernelVirtualNicImpl>\n    {\n        public bool VMotionEnabled { get; set; }\n\n        public bool? FaultToleranceLoggingEnabled { get; set; }\n\n        public bool? ManagementTrafficEnabled { get; set; }\n\n        public IPv6Address[] IPv6 { get; set; }\n\n        public bool? AutomaticIPv6 { get; set; }\n\n        public bool? IPv6ThroughDhcp { get; set; }\n\n        public bool? IPv6Enabled { get; set; }\n\n        public int? Mtu { get; set; }\n\n        public bool? VsanTrafficEnabled { get; set; }\n\n        public bool Equals(HostVMKernelVirtualNicImpl hostVMKernelVirtualNicImpl)\n        {\n            return (hostVMKernelVirtualNicImpl != null && this.VMotionEnabled == hostVMKernelVirtualNicImpl.VMotionEnabled && ((this.FaultToleranceLoggingEnabled == null && hostVMKernelVirtualNicImpl.FaultToleranceLoggingEnabled == null) || (this.FaultToleranceLoggingEnabled != null && this.FaultToleranceLoggingEnabled.Equals(hostVMKernelVirtualNicImpl.FaultToleranceLoggingEnabled))) && ((this.ManagementTrafficEnabled == null && hostVMKernelVirtualNicImpl.ManagementTrafficEnabled == null) || (this.ManagementTrafficEnabled != null && this.ManagementTrafficEnabled.Equals(hostVMKernelVirtualNicImpl.ManagementTrafficEnabled))) && ((this.IPv6 == null && hostVMKernelVirtualNicImpl.IPv6 == null) || (this.IPv6 != null && hostVMKernelVirtualNicImpl.IPv6 != null && Enumerable.SequenceEqual(this.IPv6, hostVMKernelVirtualNicImpl.IPv6))) && ((this.AutomaticIPv6 == null && hostVMKernelVirtualNicImpl.AutomaticIPv6 == null) || (this.AutomaticIPv6 != null && this.AutomaticIPv6.Equals(hostVMKernelVirtualNicImpl.AutomaticIPv6))) && ((this.IPv6ThroughDhcp == null && hostVMKernelVirtualNicImpl.IPv6ThroughDhcp == null) || (this.IPv6ThroughDhcp != null && this.IPv6ThroughDhcp.Equals(hostVMKernelVirtualNicImpl.IPv6ThroughDhcp))) && ((this.IPv6Enabled == null && hostVMKernelVirtualNicImpl.IPv6Enabled == null) || (this.IPv6Enabled != null && this.IPv6Enabled.Equals(hostVMKernelVirtualNicImpl.IPv6Enabled))) && ((this.Mtu == null && hostVMKernelVirtualNicImpl.Mtu == null) || (this.Mtu != null && this.Mtu.Equals(hostVMKernelVirtualNicImpl.Mtu))) && ((this.VsanTrafficEnabled == null && hostVMKernelVirtualNicImpl.VsanTrafficEnabled == null) || (this.VsanTrafficEnabled != null && this.VsanTrafficEnabled.Equals(hostVMKernelVirtualNicImpl.VsanTrafficEnabled))) && this.Uid == hostVMKernelVirtualNicImpl.Uid && this.Name == hostVMKernelVirtualNicImpl.Name && this.Id == hostVMKernelVirtualNicImpl.Id && this.VMHostId == hostVMKernelVirtualNicImpl.VMHostId && ((this.VMHost == null && hostVMKernelVirtualNicImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hostVMKernelVirtualNicImpl.VMHost))) && this.DeviceName == hostVMKernelVirtualNicImpl.DeviceName && this.Mac == hostVMKernelVirtualNicImpl.Mac && this.DhcpEnabled == hostVMKernelVirtualNicImpl.DhcpEnabled && this.IP == hostVMKernelVirtualNicImpl.IP && this.SubnetMask == hostVMKernelVirtualNicImpl.SubnetMask && ((this.ExtensionData == null && hostVMKernelVirtualNicImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hostVMKernelVirtualNicImpl.ExtensionData))) && this.PortGroupName == hostVMKernelVirtualNicImpl.PortGroupName);\n        }\n\n        public override bool Equals(object hostVMKernelVirtualNicImpl)\n        {\n            return Equals(hostVMKernelVirtualNicImpl as HostVMKernelVirtualNicImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMotionEnabled + \"_\" + FaultToleranceLoggingEnabled + \"_\" + ManagementTrafficEnabled + \"_\" + IPv6 + \"_\" + AutomaticIPv6 + \"_\" + IPv6ThroughDhcp + \"_\" + IPv6Enabled + \"_\" + Mtu + \"_\" + VsanTrafficEnabled + \"_\" + Uid + \"_\" + Name + \"_\" + Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + DeviceName + \"_\" + Mac + \"_\" + DhcpEnabled + \"_\" + IP + \"_\" + SubnetMask + \"_\" + ExtensionData + \"_\" + PortGroupName).GetHashCode();\n        }\n    }\n\n    public class PhysicalNicImpl : HostNicImpl, PhysicalNic, IEquatable<PhysicalNicImpl>\n    {\n        public long BitRatePerSec { get; set; }\n\n        public bool FullDuplex { get; set; }\n\n        public bool? WakeOnLanSupported { get; set; }\n\n        public bool Equals(PhysicalNicImpl physicalNicImpl)\n        {\n            return (physicalNicImpl != null && this.BitRatePerSec == physicalNicImpl.BitRatePerSec && this.FullDuplex == physicalNicImpl.FullDuplex && ((this.WakeOnLanSupported == null && physicalNicImpl.WakeOnLanSupported == null) || (this.WakeOnLanSupported != null && this.WakeOnLanSupported.Equals(physicalNicImpl.WakeOnLanSupported))) && this.Uid == physicalNicImpl.Uid && this.Name == physicalNicImpl.Name && this.Id == physicalNicImpl.Id && this.VMHostId == physicalNicImpl.VMHostId && ((this.VMHost == null && physicalNicImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(physicalNicImpl.VMHost))) && this.DeviceName == physicalNicImpl.DeviceName && this.Mac == physicalNicImpl.Mac && this.DhcpEnabled == physicalNicImpl.DhcpEnabled && this.IP == physicalNicImpl.IP && this.SubnetMask == physicalNicImpl.SubnetMask && ((this.ExtensionData == null && physicalNicImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(physicalNicImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object physicalNicImpl)\n        {\n            return Equals(physicalNicImpl as PhysicalNicImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (BitRatePerSec + \"_\" + FullDuplex + \"_\" + WakeOnLanSupported + \"_\" + Uid + \"_\" + Name + \"_\" + Id + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + DeviceName + \"_\" + Mac + \"_\" + DhcpEnabled + \"_\" + IP + \"_\" + SubnetMask + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.Profile\n{\n    using System;\n    using System.Linq;\n    using System.Security;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Profile;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class VMHostProfileImageCacheConfigurationImpl : VMHostProfileImageCacheConfiguration, IEquatable<VMHostProfileImageCacheConfigurationImpl>\n    {\n        public VMHostProfileInstallationDevice InstallationDevice { get; set; }\n\n        public VMHostProfileInstallationType InstallationType { get; set; }\n\n        public string DiskArguments { get; set; }\n\n        public bool? IgnoreSsd { get; set; }\n\n        public bool? OverwriteVmfs { get; set; }\n\n        public VMHostProfile HostProfile { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostProfileImageCacheConfigurationImpl vMHostProfileImageCacheConfigurationImpl)\n        {\n            return (vMHostProfileImageCacheConfigurationImpl != null && this.InstallationDevice == vMHostProfileImageCacheConfigurationImpl.InstallationDevice && this.InstallationType == vMHostProfileImageCacheConfigurationImpl.InstallationType && this.DiskArguments == vMHostProfileImageCacheConfigurationImpl.DiskArguments && this.IgnoreSsd == vMHostProfileImageCacheConfigurationImpl.IgnoreSsd && this.OverwriteVmfs == vMHostProfileImageCacheConfigurationImpl.OverwriteVmfs && ((this.HostProfile == null && vMHostProfileImageCacheConfigurationImpl.HostProfile == null) || (this.HostProfile != null && this.HostProfile.Equals(vMHostProfileImageCacheConfigurationImpl.HostProfile))) && this.Uid == vMHostProfileImageCacheConfigurationImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostProfileImageCacheConfigurationImpl)\n        {\n            return Equals(vMHostProfileImageCacheConfigurationImpl as VMHostProfileImageCacheConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (InstallationDevice + \"_\" + InstallationType + \"_\" + DiskArguments + \"_\" + IgnoreSsd + \"_\" + OverwriteVmfs + \"_\" + HostProfile + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileImpl : VMHostProfile, IEquatable<VMHostProfileImpl>\n    {\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Description { get; set; }\n\n        public string ReferenceHostId { get; set; }\n\n        public VMHost ReferenceHost { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostProfileImpl vMHostProfileImpl)\n        {\n            return (vMHostProfileImpl != null && this.ServerId == vMHostProfileImpl.ServerId && ((this.Server == null && vMHostProfileImpl.Server == null) || (this.Server != null && this.Server.Equals(vMHostProfileImpl.Server))) && this.Description == vMHostProfileImpl.Description && this.ReferenceHostId == vMHostProfileImpl.ReferenceHostId && ((this.ReferenceHost == null && vMHostProfileImpl.ReferenceHost == null) || (this.ReferenceHost != null && this.ReferenceHost.Equals(vMHostProfileImpl.ReferenceHost))) && this.Name == vMHostProfileImpl.Name && ((this.ExtensionData == null && vMHostProfileImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostProfileImpl.ExtensionData))) && this.Id == vMHostProfileImpl.Id && this.Uid == vMHostProfileImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostProfileImpl)\n        {\n            return Equals(vMHostProfileImpl as VMHostProfileImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerId + \"_\" + Server + \"_\" + Description + \"_\" + ReferenceHostId + \"_\" + ReferenceHost + \"_\" + Name + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileIncomplianceElementImpl : VMHostProfileIncomplianceElement, IEquatable<VMHostProfileIncomplianceElementImpl>\n    {\n        public string PropertyName { get; set; }\n\n        public string Description { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostProfileIncomplianceElementImpl vMHostProfileIncomplianceElementImpl)\n        {\n            return (vMHostProfileIncomplianceElementImpl != null && this.PropertyName == vMHostProfileIncomplianceElementImpl.PropertyName && this.Description == vMHostProfileIncomplianceElementImpl.Description && this.Uid == vMHostProfileIncomplianceElementImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostProfileIncomplianceElementImpl)\n        {\n            return Equals(vMHostProfileIncomplianceElementImpl as VMHostProfileIncomplianceElementImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PropertyName + \"_\" + Description + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileIncomplianceImpl : VMHostProfileIncompliance, IEquatable<VMHostProfileIncomplianceImpl>\n    {\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string VMHostUid { get; set; }\n\n        public string VMHostProfileId { get; set; }\n\n        public VMHostProfile VMHostProfile { get; set; }\n\n        public string VMHostProfileUid { get; set; }\n\n        public VMHostProfileIncomplianceElement[] IncomplianceElementList { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostProfileIncomplianceImpl vMHostProfileIncomplianceImpl)\n        {\n            return (vMHostProfileIncomplianceImpl != null && this.VMHostId == vMHostProfileIncomplianceImpl.VMHostId && ((this.VMHost == null && vMHostProfileIncomplianceImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostProfileIncomplianceImpl.VMHost))) && this.VMHostUid == vMHostProfileIncomplianceImpl.VMHostUid && this.VMHostProfileId == vMHostProfileIncomplianceImpl.VMHostProfileId && ((this.VMHostProfile == null && vMHostProfileIncomplianceImpl.VMHostProfile == null) || (this.VMHostProfile != null && this.VMHostProfile.Equals(vMHostProfileIncomplianceImpl.VMHostProfile))) && this.VMHostProfileUid == vMHostProfileIncomplianceImpl.VMHostProfileUid && ((this.IncomplianceElementList == null && vMHostProfileIncomplianceImpl.IncomplianceElementList == null) || (this.IncomplianceElementList != null && vMHostProfileIncomplianceImpl.IncomplianceElementList != null && Enumerable.SequenceEqual(this.IncomplianceElementList, vMHostProfileIncomplianceImpl.IncomplianceElementList))) && this.Uid == vMHostProfileIncomplianceImpl.Uid && ((this.ExtensionData == null && vMHostProfileIncomplianceImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostProfileIncomplianceImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMHostProfileIncomplianceImpl)\n        {\n            return Equals(vMHostProfileIncomplianceImpl as VMHostProfileIncomplianceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHostId + \"_\" + VMHost + \"_\" + VMHostUid + \"_\" + VMHostProfileId + \"_\" + VMHostProfile + \"_\" + VMHostProfileUid + \"_\" + IncomplianceElementList + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileInputImpl : VMHostProfileInput, IEquatable<VMHostProfileInputImpl>\n    {\n        public string Key { get; set; }\n\n        public VMHostProfileInputType Type { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public VMHostProfile VMHostProfile { get; set; }\n\n        public bool Equals(VMHostProfileInputImpl vMHostProfileInputImpl)\n        {\n            return (vMHostProfileInputImpl != null && this.Key == vMHostProfileInputImpl.Key && this.Type == vMHostProfileInputImpl.Type && ((this.VMHost == null && vMHostProfileInputImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostProfileInputImpl.VMHost))) && ((this.VMHostProfile == null && vMHostProfileInputImpl.VMHostProfile == null) || (this.VMHostProfile != null && this.VMHostProfile.Equals(vMHostProfileInputImpl.VMHostProfile))));\n        }\n\n        public override bool Equals(object vMHostProfileInputImpl)\n        {\n            return Equals(vMHostProfileInputImpl as VMHostProfileInputImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Type + \"_\" + VMHost + \"_\" + VMHostProfile).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileStorageDeviceConfigurationImpl : VMHostProfileStorageDeviceConfiguration, IEquatable<VMHostProfileStorageDeviceConfigurationImpl>\n    {\n        public string DeviceName { get; set; }\n\n        public bool IsSharedClusterwide { get; set; }\n\n        public bool IsPerenniallyReserved { get; set; }\n\n        public bool DeviceStateOn { get; set; }\n\n        public int QueueFullThreshold { get; set; }\n\n        public int QueueFullSampleSize { get; set; }\n\n        public int NumReqOutstanding { get; set; }\n\n        public string PspName { get; set; }\n\n        public string ConfigInfo { get; set; }\n\n        public VMHostProfile HostProfile { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostProfileStorageDeviceConfigurationImpl vMHostProfileStorageDeviceConfigurationImpl)\n        {\n            return (vMHostProfileStorageDeviceConfigurationImpl != null && this.DeviceName == vMHostProfileStorageDeviceConfigurationImpl.DeviceName && this.IsSharedClusterwide == vMHostProfileStorageDeviceConfigurationImpl.IsSharedClusterwide && this.IsPerenniallyReserved == vMHostProfileStorageDeviceConfigurationImpl.IsPerenniallyReserved && this.DeviceStateOn == vMHostProfileStorageDeviceConfigurationImpl.DeviceStateOn && this.QueueFullThreshold == vMHostProfileStorageDeviceConfigurationImpl.QueueFullThreshold && this.QueueFullSampleSize == vMHostProfileStorageDeviceConfigurationImpl.QueueFullSampleSize && this.NumReqOutstanding == vMHostProfileStorageDeviceConfigurationImpl.NumReqOutstanding && this.PspName == vMHostProfileStorageDeviceConfigurationImpl.PspName && this.ConfigInfo == vMHostProfileStorageDeviceConfigurationImpl.ConfigInfo && ((this.HostProfile == null && vMHostProfileStorageDeviceConfigurationImpl.HostProfile == null) || (this.HostProfile != null && this.HostProfile.Equals(vMHostProfileStorageDeviceConfigurationImpl.HostProfile))) && this.Uid == vMHostProfileStorageDeviceConfigurationImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostProfileStorageDeviceConfigurationImpl)\n        {\n            return Equals(vMHostProfileStorageDeviceConfigurationImpl as VMHostProfileStorageDeviceConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (DeviceName + \"_\" + IsSharedClusterwide + \"_\" + IsPerenniallyReserved + \"_\" + DeviceStateOn + \"_\" + QueueFullThreshold + \"_\" + QueueFullSampleSize + \"_\" + NumReqOutstanding + \"_\" + PspName + \"_\" + ConfigInfo + \"_\" + HostProfile + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileUserConfigurationImpl : VMHostProfileUserConfiguration, IEquatable<VMHostProfileUserConfigurationImpl>\n    {\n        public string UserName { get; set; }\n\n        public string Role { get; set; }\n\n        public string Description { get; set; }\n\n        public VMHostProfilePasswordPolicy PasswordPolicy { get; set; }\n\n        public SecureString Password { get; set; }\n\n        public VMHostProfile HostProfile { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostProfileUserConfigurationImpl vMHostProfileUserConfigurationImpl)\n        {\n            return (vMHostProfileUserConfigurationImpl != null && this.UserName == vMHostProfileUserConfigurationImpl.UserName && this.Role == vMHostProfileUserConfigurationImpl.Role && this.Description == vMHostProfileUserConfigurationImpl.Description && this.PasswordPolicy == vMHostProfileUserConfigurationImpl.PasswordPolicy && this.Password == vMHostProfileUserConfigurationImpl.Password && ((this.HostProfile == null && vMHostProfileUserConfigurationImpl.HostProfile == null) || (this.HostProfile != null && this.HostProfile.Equals(vMHostProfileUserConfigurationImpl.HostProfile))) && this.Uid == vMHostProfileUserConfigurationImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostProfileUserConfigurationImpl)\n        {\n            return Equals(vMHostProfileUserConfigurationImpl as VMHostProfileUserConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (UserName + \"_\" + Role + \"_\" + Description + \"_\" + PasswordPolicy + \"_\" + Password + \"_\" + HostProfile + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMHostProfileVmPortGroupConfigurationImpl : VMHostProfileVmPortGroupConfiguration, IEquatable<VMHostProfileVmPortGroupConfigurationImpl>\n    {\n        public string PortGroupName { get; set; }\n\n        public string VSwitchName { get; set; }\n\n        public int VLanId { get; set; }\n\n        public VMHostProfile HostProfile { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMHostProfileVmPortGroupConfigurationImpl vMHostProfileVmPortGroupConfigurationImpl)\n        {\n            return (vMHostProfileVmPortGroupConfigurationImpl != null && this.PortGroupName == vMHostProfileVmPortGroupConfigurationImpl.PortGroupName && this.VSwitchName == vMHostProfileVmPortGroupConfigurationImpl.VSwitchName && this.VLanId == vMHostProfileVmPortGroupConfigurationImpl.VLanId && ((this.HostProfile == null && vMHostProfileVmPortGroupConfigurationImpl.HostProfile == null) || (this.HostProfile != null && this.HostProfile.Equals(vMHostProfileVmPortGroupConfigurationImpl.HostProfile))) && this.Uid == vMHostProfileVmPortGroupConfigurationImpl.Uid);\n        }\n\n        public override bool Equals(object vMHostProfileVmPortGroupConfigurationImpl)\n        {\n            return Equals(vMHostProfileVmPortGroupConfigurationImpl as VMHostProfileVmPortGroupConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PortGroupName + \"_\" + VSwitchName + \"_\" + VLanId + \"_\" + HostProfile + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.Storage\n{\n    using System;\n    using System.Linq;\n    using System.Runtime.Serialization;\n    using VMware.Vim;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Storage;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class FibreChannelHbaImpl : HbaImpl, FibreChannelHba, IEquatable<FibreChannelHbaImpl>\n    {\n        public long NodeWorldWideName { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Host.Storage.FibreChannelPortType PortType { get; set; }\n\n        public long PortWorldWideName { get; set; }\n\n        public long Speed { get; set; }\n\n        public bool Equals(FibreChannelHbaImpl fibreChannelHbaImpl)\n        {\n            return (fibreChannelHbaImpl != null && this.NodeWorldWideName == fibreChannelHbaImpl.NodeWorldWideName && this.PortType == fibreChannelHbaImpl.PortType && this.PortWorldWideName == fibreChannelHbaImpl.PortWorldWideName && this.Speed == fibreChannelHbaImpl.Speed && this.Uid == fibreChannelHbaImpl.Uid && this.Device == fibreChannelHbaImpl.Device && this.Key == fibreChannelHbaImpl.Key && this.Model == fibreChannelHbaImpl.Model && this.Pci == fibreChannelHbaImpl.Pci && this.Driver == fibreChannelHbaImpl.Driver && this.Bus == fibreChannelHbaImpl.Bus && this.VMHostId == fibreChannelHbaImpl.VMHostId && ((this.VMHost == null && fibreChannelHbaImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(fibreChannelHbaImpl.VMHost))) && this.Status == fibreChannelHbaImpl.Status && this.Type == fibreChannelHbaImpl.Type && ((this.ScsiLunUids == null && fibreChannelHbaImpl.ScsiLunUids == null) || (this.ScsiLunUids != null && fibreChannelHbaImpl.ScsiLunUids != null && Enumerable.SequenceEqual(this.ScsiLunUids, fibreChannelHbaImpl.ScsiLunUids))) && this.Name == fibreChannelHbaImpl.Name && ((this.ExtensionData == null && fibreChannelHbaImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(fibreChannelHbaImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object fibreChannelHbaImpl)\n        {\n            return Equals(fibreChannelHbaImpl as FibreChannelHbaImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (NodeWorldWideName + \"_\" + PortType + \"_\" + PortWorldWideName + \"_\" + Speed + \"_\" + Uid + \"_\" + Device + \"_\" + Key + \"_\" + Model + \"_\" + Pci + \"_\" + Driver + \"_\" + Bus + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Status + \"_\" + Type + \"_\" + ScsiLunUids + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class HbaImpl : Hba, IEquatable<HbaImpl>\n    {\n        public string Device { get; set; }\n\n        public string Key { get; set; }\n\n        public string Model { get; set; }\n\n        public string Pci { get; set; }\n\n        public string Driver { get; set; }\n\n        public int Bus { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string Status { get; set; }\n\n        public HbaType Type { get; set; }\n\n        public string[] ScsiLunUids { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(HbaImpl hbaImpl)\n        {\n            return (hbaImpl != null && this.Device == hbaImpl.Device && this.Key == hbaImpl.Key && this.Model == hbaImpl.Model && this.Pci == hbaImpl.Pci && this.Driver == hbaImpl.Driver && this.Bus == hbaImpl.Bus && this.VMHostId == hbaImpl.VMHostId && ((this.VMHost == null && hbaImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(hbaImpl.VMHost))) && this.Status == hbaImpl.Status && this.Type == hbaImpl.Type && ((this.ScsiLunUids == null && hbaImpl.ScsiLunUids == null) || (this.ScsiLunUids != null && hbaImpl.ScsiLunUids != null && Enumerable.SequenceEqual(this.ScsiLunUids, hbaImpl.ScsiLunUids))) && this.Uid == hbaImpl.Uid && this.Name == hbaImpl.Name && ((this.ExtensionData == null && hbaImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(hbaImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object hbaImpl)\n        {\n            return Equals(hbaImpl as HbaImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Device + \"_\" + Key + \"_\" + Model + \"_\" + Pci + \"_\" + Driver + \"_\" + Bus + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Status + \"_\" + Type + \"_\" + ScsiLunUids + \"_\" + Uid + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class HostFileSystemVolumeInfoImpl : IEquatable<HostFileSystemVolumeInfoImpl>\n    {\n        public string AccessMode { get; set; }\n\n        public string Path { get; set; }\n\n        public long Capacity { get; set; }\n\n        public decimal CapacityGB { get; set; }\n\n        public string Name { get; set; }\n\n        public string Type { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(HostFileSystemVolumeInfoImpl hostFileSystemVolumeInfoImpl)\n        {\n            return (hostFileSystemVolumeInfoImpl != null && this.AccessMode == hostFileSystemVolumeInfoImpl.AccessMode && this.Path == hostFileSystemVolumeInfoImpl.Path && this.Capacity == hostFileSystemVolumeInfoImpl.Capacity && this.CapacityGB == hostFileSystemVolumeInfoImpl.CapacityGB && this.Name == hostFileSystemVolumeInfoImpl.Name && this.Type == hostFileSystemVolumeInfoImpl.Type && this.Uid == hostFileSystemVolumeInfoImpl.Uid);\n        }\n\n        public override bool Equals(object hostFileSystemVolumeInfoImpl)\n        {\n            return Equals(hostFileSystemVolumeInfoImpl as HostFileSystemVolumeInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AccessMode + \"_\" + Path + \"_\" + Capacity + \"_\" + CapacityGB + \"_\" + Name + \"_\" + Type + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class IScsiHbaAuthenticationCapabilityImpl : IScsiHbaAuthenticationCapability, IEquatable<IScsiHbaAuthenticationCapabilityImpl>\n    {\n        public bool Chap { get; set; }\n\n        public bool Krb5 { get; set; }\n\n        public bool? MutualChap { get; set; }\n\n        public bool Spkm { get; set; }\n\n        public bool Srp { get; set; }\n\n        public bool? TargetChap { get; set; }\n\n        public bool? TargetMutualChap { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(IScsiHbaAuthenticationCapabilityImpl iScsiHbaAuthenticationCapabilityImpl)\n        {\n            return (iScsiHbaAuthenticationCapabilityImpl != null && this.Chap == iScsiHbaAuthenticationCapabilityImpl.Chap && this.Krb5 == iScsiHbaAuthenticationCapabilityImpl.Krb5 && this.MutualChap == iScsiHbaAuthenticationCapabilityImpl.MutualChap && this.Spkm == iScsiHbaAuthenticationCapabilityImpl.Spkm && this.Srp == iScsiHbaAuthenticationCapabilityImpl.Srp && this.TargetChap == iScsiHbaAuthenticationCapabilityImpl.TargetChap && this.TargetMutualChap == iScsiHbaAuthenticationCapabilityImpl.TargetMutualChap && this.Uid == iScsiHbaAuthenticationCapabilityImpl.Uid);\n        }\n\n        public override bool Equals(object iScsiHbaAuthenticationCapabilityImpl)\n        {\n            return Equals(iScsiHbaAuthenticationCapabilityImpl as IScsiHbaAuthenticationCapabilityImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Chap + \"_\" + Krb5 + \"_\" + MutualChap + \"_\" + Spkm + \"_\" + Srp + \"_\" + TargetChap + \"_\" + TargetMutualChap + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class IScsiHbaAuthenticationPropertiesImpl : IScsiHbaAuthenticationProperties, IEquatable<IScsiHbaAuthenticationPropertiesImpl>\n    {\n        public ChapType? ChapType { get; set; }\n\n        public bool? ChapInherited { get; set; }\n\n        public string ChapName { get; set; }\n\n        public bool? MutualChapEnabled { get; set; }\n\n        public bool? MutualChapInherited { get; set; }\n\n        public string MutualChapName { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(IScsiHbaAuthenticationPropertiesImpl iScsiHbaAuthenticationPropertiesImpl)\n        {\n            return (iScsiHbaAuthenticationPropertiesImpl != null && this.ChapType == iScsiHbaAuthenticationPropertiesImpl.ChapType && this.ChapInherited == iScsiHbaAuthenticationPropertiesImpl.ChapInherited && this.ChapName == iScsiHbaAuthenticationPropertiesImpl.ChapName && this.MutualChapEnabled == iScsiHbaAuthenticationPropertiesImpl.MutualChapEnabled && this.MutualChapInherited == iScsiHbaAuthenticationPropertiesImpl.MutualChapInherited && this.MutualChapName == iScsiHbaAuthenticationPropertiesImpl.MutualChapName && this.Uid == iScsiHbaAuthenticationPropertiesImpl.Uid);\n        }\n\n        public override bool Equals(object iScsiHbaAuthenticationPropertiesImpl)\n        {\n            return Equals(iScsiHbaAuthenticationPropertiesImpl as IScsiHbaAuthenticationPropertiesImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ChapType + \"_\" + ChapInherited + \"_\" + ChapName + \"_\" + MutualChapEnabled + \"_\" + MutualChapInherited + \"_\" + MutualChapName + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n\tpublic class IScsiHbaImpl : HbaImpl, IScsiHba, IEquatable<IScsiHbaImpl>\n\t{\n\t\tpublic IScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n\t\tpublic IScsiHbaAuthenticationCapability AuthenticationCapability { get; set; }\n\n\t\tpublic int? CurrentSpeedMb { get; set; }\n\n\t\tpublic string IScsiAlias { get; set; }\n\n\t\tpublic string IScsiName { get; set; }\n\n\t\tpublic bool IsSoftwareBased { get; set; }\n\n\t\tpublic int? MaxSpeedMb { get; set; }\n\n\t\tpublic bool Equals(IScsiHbaImpl iScsiHbaImpl)\n        {\n            return (iScsiHbaImpl != null && ((this.AuthenticationProperties == null && iScsiHbaImpl.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(iScsiHbaImpl.AuthenticationProperties))) && ((this.AuthenticationCapability == null && iScsiHbaImpl.AuthenticationCapability == null) || (this.AuthenticationCapability != null && this.AuthenticationCapability.Equals(iScsiHbaImpl.AuthenticationCapability))) && this.CurrentSpeedMb == iScsiHbaImpl.CurrentSpeedMb && this.IScsiAlias == iScsiHbaImpl.IScsiAlias && this.IScsiName == iScsiHbaImpl.IScsiName && this.IsSoftwareBased == iScsiHbaImpl.IsSoftwareBased && this.MaxSpeedMb == iScsiHbaImpl.MaxSpeedMb && this.Device == iScsiHbaImpl.Device && this.Key == iScsiHbaImpl.Key && this.Model == iScsiHbaImpl.Model && this.Pci == iScsiHbaImpl.Pci && this.Driver == iScsiHbaImpl.Driver && this.Bus == iScsiHbaImpl.Bus && this.VMHostId == iScsiHbaImpl.VMHostId && ((this.VMHost == null && iScsiHbaImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(iScsiHbaImpl.VMHost))) && this.Status == iScsiHbaImpl.Status && this.Type == iScsiHbaImpl.Type && ((this.ScsiLunUids == null && iScsiHbaImpl.ScsiLunUids == null) || (this.ScsiLunUids != null && iScsiHbaImpl.ScsiLunUids != null && Enumerable.SequenceEqual(this.ScsiLunUids, iScsiHbaImpl.ScsiLunUids))) && this.Uid == iScsiHbaImpl.Uid && this.Name == iScsiHbaImpl.Name && ((this.ExtensionData == null && iScsiHbaImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(iScsiHbaImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object iScsiHbaImpl)\n        {\n            return Equals(iScsiHbaImpl as IScsiHbaImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (AuthenticationProperties + \"_\" + AuthenticationCapability + \"_\" + CurrentSpeedMb + \"_\" + IScsiAlias + \"_\" + IScsiName + \"_\" + IsSoftwareBased + \"_\" + MaxSpeedMb + \"_\" + Device + \"_\" + Key + \"_\" + Model + \"_\" + Pci + \"_\" + Driver + \"_\" + Bus + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Status + \"_\" + Type + \"_\" + ScsiLunUids + \"_\" + Uid + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n\t}\n\n    public class IScsiHbaSendTargetImpl : IScsiHbaTarget, IEquatable<IScsiHbaSendTargetImpl>\n    {\n        public string VmHostId { get; set; }\n\n        public string HostStorageSystemId { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Address { get; set; }\n\n        public int? Port { get; set; }\n\n        public string IScsiHbaKey { get; set; }\n\n        public IScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        public IScsiHbaTargetType Type { get; set; }\n\n        public string IScsiHbaName { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(IScsiHbaSendTargetImpl iScsiHbaSendTargetImpl)\n        {\n            return (iScsiHbaSendTargetImpl != null && this.VmHostId == iScsiHbaSendTargetImpl.VmHostId && this.HostStorageSystemId == iScsiHbaSendTargetImpl.HostStorageSystemId && this.Uid == iScsiHbaSendTargetImpl.Uid && this.Address == iScsiHbaSendTargetImpl.Address && ((this.Port == null && iScsiHbaSendTargetImpl.Port == null) || (this.Port != null && this.Port.Equals(iScsiHbaSendTargetImpl.Port))) && this.IScsiHbaKey == iScsiHbaSendTargetImpl.IScsiHbaKey && ((this.AuthenticationProperties == null && iScsiHbaSendTargetImpl.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(iScsiHbaSendTargetImpl.AuthenticationProperties))) && this.Type == iScsiHbaSendTargetImpl.Type && this.IScsiHbaName == iScsiHbaSendTargetImpl.IScsiHbaName && this.Name == iScsiHbaSendTargetImpl.Name && ((this.ExtensionData == null && iScsiHbaSendTargetImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(iScsiHbaSendTargetImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object iScsiHbaSendTargetImpl)\n        {\n            return Equals(iScsiHbaSendTargetImpl as IScsiHbaSendTargetImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VmHostId + \"_\" + HostStorageSystemId + \"_\" + Uid + \"_\" + Address + \"_\" + Port + \"_\" + IScsiHbaKey + \"_\" + AuthenticationProperties + \"_\" + Type + \"_\" + IScsiHbaName + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class IScsiHbaStaticTargetImpl : IScsiHbaTargetImpl, IScsiHbaStaticTarget, IEquatable<IScsiHbaStaticTargetImpl>\n    {\n        public string IScsiName { get; set; }\n\n        public bool Equals(IScsiHbaStaticTargetImpl iScsiHbaStaticTargetImpl)\n        {\n            return (iScsiHbaStaticTargetImpl != null && this.IScsiName == iScsiHbaStaticTargetImpl.IScsiName && this.VmHostId == iScsiHbaStaticTargetImpl.VmHostId && this.HostStorageSystemId == iScsiHbaStaticTargetImpl.HostStorageSystemId && this.Uid == iScsiHbaStaticTargetImpl.Uid && this.Address == iScsiHbaStaticTargetImpl.Address && ((this.Port == null && iScsiHbaStaticTargetImpl.Port == null) || (this.Port != null && this.Port.Equals(iScsiHbaStaticTargetImpl.Port))) && this.IScsiHbaKey == iScsiHbaStaticTargetImpl.IScsiHbaKey && ((this.AuthenticationProperties == null && iScsiHbaStaticTargetImpl.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(iScsiHbaStaticTargetImpl.AuthenticationProperties))) && this.Type == iScsiHbaStaticTargetImpl.Type && this.IScsiHbaName == iScsiHbaStaticTargetImpl.IScsiHbaName && this.Name == iScsiHbaStaticTargetImpl.Name && ((this.ExtensionData == null && iScsiHbaStaticTargetImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(iScsiHbaStaticTargetImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object iScsiHbaStaticTargetImpl)\n        {\n            return Equals(iScsiHbaStaticTargetImpl as IScsiHbaStaticTargetImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (IScsiName + \"_\" + VmHostId + \"_\" + HostStorageSystemId + \"_\" + Uid + \"_\" + Address + \"_\" + Port + \"_\" + IScsiHbaKey + \"_\" + AuthenticationProperties + \"_\" + Type + \"_\" + IScsiHbaName + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class IScsiHbaTargetImpl : IScsiHbaTarget, IEquatable<IScsiHbaTargetImpl>\n    {\n        public string Uid { get; set; }\n\n        public string Address { get; set; }\n\n        public int? Port { get; set; }\n\n        public string IScsiHbaKey { get; set; }\n\n        public IScsiHbaAuthenticationProperties AuthenticationProperties { get; set; }\n\n        public IScsiHbaTargetType Type { get; set; }\n\n        public string IScsiHbaName { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string VmHostId { get; set; }\n\n        public string HostStorageSystemId { get; set; }\n\n        public bool Equals(IScsiHbaTargetImpl iScsiHbaTargetImpl)\n        {\n            return (iScsiHbaTargetImpl != null && this.Address == iScsiHbaTargetImpl.Address && ((this.Port == null && iScsiHbaTargetImpl.Port == null) || (this.Port != null && this.Port.Equals(iScsiHbaTargetImpl.Port))) && this.IScsiHbaKey == iScsiHbaTargetImpl.IScsiHbaKey && ((this.AuthenticationProperties == null && iScsiHbaTargetImpl.AuthenticationProperties == null) || (this.AuthenticationProperties != null && this.AuthenticationProperties.Equals(iScsiHbaTargetImpl.AuthenticationProperties))) && this.Type == iScsiHbaTargetImpl.Type && this.Uid == iScsiHbaTargetImpl.Uid && this.Name == iScsiHbaTargetImpl.Name && this.IScsiHbaName == iScsiHbaTargetImpl.IScsiHbaName && ((this.ExtensionData == null && iScsiHbaTargetImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(iScsiHbaTargetImpl.ExtensionData))) && this.VmHostId == iScsiHbaTargetImpl.VmHostId && this.HostStorageSystemId == iScsiHbaTargetImpl.HostStorageSystemId);\n        }\n\n        public override bool Equals(object iScsiHbaTargetImpl)\n        {\n            return Equals(iScsiHbaTargetImpl as IScsiHbaTargetImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Address + \"_\" + Port + \"_\" + IScsiHbaKey + \"_\" + AuthenticationProperties + \"_\" + Type + \"_\" + IScsiHbaName + \"_\" + Name + \"_\" + ExtensionData + \"_\" + VmHostId + \"_\" + HostStorageSystemId).GetHashCode();\n        }\n    }\n\n    public class VMHostDiskImpl : VMHostDisk, IEquatable<VMHostDiskImpl>\n    {\n        public string Id { get; set; }\n\n        public string DeviceName { get; set; }\n\n        public long Cylinders { get; set; }\n\n        public int Heads { get; set; }\n\n        public int Sectors { get; set; }\n\n        public long TotalSectors { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLun ScsiLun { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostDiskImpl vMHostDiskImpl)\n        {\n            return (vMHostDiskImpl != null && this.Id == vMHostDiskImpl.Id && this.DeviceName == vMHostDiskImpl.DeviceName && this.Cylinders == vMHostDiskImpl.Cylinders && this.Heads == vMHostDiskImpl.Heads && this.Sectors == vMHostDiskImpl.Sectors && this.TotalSectors == vMHostDiskImpl.TotalSectors && ((this.VMHost == null && vMHostDiskImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostDiskImpl.VMHost))) && ((this.ScsiLun == null && vMHostDiskImpl.ScsiLun == null) || (this.ScsiLun != null && this.ScsiLun.Equals(vMHostDiskImpl.ScsiLun))) && this.Uid == vMHostDiskImpl.Uid && ((this.ExtensionData == null && vMHostDiskImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostDiskImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMHostDiskImpl)\n        {\n            return Equals(vMHostDiskImpl as VMHostDiskImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + DeviceName + \"_\" + Cylinders + \"_\" + Heads + \"_\" + Sectors + \"_\" + TotalSectors + \"_\" + VMHost + \"_\" + ScsiLun + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostDiskPartitionImpl : VMHostDiskPartition, IEquatable<VMHostDiskPartitionImpl>\n    {\n        public string Id { get; set; }\n\n        public int PartitionNumber { get; set; }\n\n        public sbyte Attributes { get; set; }\n\n        public bool Logical { get; set; }\n\n        public long StartSector { get; set; }\n\n        public long EndSector { get; set; }\n\n        public VMHostDiskPartitionType Type { get; set; }\n\n        public VMHostDisk VMHostDisk { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostDiskPartitionImpl vMHostDiskPartitionImpl)\n        {\n            return (vMHostDiskPartitionImpl != null && this.Id == vMHostDiskPartitionImpl.Id && this.PartitionNumber == vMHostDiskPartitionImpl.PartitionNumber && this.Attributes == vMHostDiskPartitionImpl.Attributes && this.Logical == vMHostDiskPartitionImpl.Logical && this.StartSector == vMHostDiskPartitionImpl.StartSector && this.EndSector == vMHostDiskPartitionImpl.EndSector && this.Type == vMHostDiskPartitionImpl.Type && ((this.VMHostDisk == null && vMHostDiskPartitionImpl.VMHostDisk == null) || (this.VMHostDisk != null && this.VMHostDisk.Equals(vMHostDiskPartitionImpl.VMHostDisk))) && this.Uid == vMHostDiskPartitionImpl.Uid && ((this.ExtensionData == null && vMHostDiskPartitionImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostDiskPartitionImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMHostDiskPartitionImpl)\n        {\n            return Equals(vMHostDiskPartitionImpl as VMHostDiskPartitionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + PartitionNumber + \"_\" + Attributes + \"_\" + Logical + \"_\" + StartSector + \"_\" + EndSector + \"_\" + Type + \"_\" + VMHostDisk + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostStorageInfoImpl : VMHostStorageInfo, IEquatable<VMHostStorageInfoImpl>\n    {\n        public VMHost VMHost { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Host.Storage.HostFileSystemVolumeInfo[] FileSystemVolumeInfo { get; set; }\n\n        public bool SoftwareIScsiEnabled { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLun[] ScsiLun { get; set; }\n\n        public string Id { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Name { get; set; }\n\n        public bool Equals(VMHostStorageInfoImpl vMHostStorageInfoImpl)\n        {\n            return (vMHostStorageInfoImpl != null && ((this.VMHost == null && vMHostStorageInfoImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(vMHostStorageInfoImpl.VMHost))) && ((this.FileSystemVolumeInfo == null && vMHostStorageInfoImpl.FileSystemVolumeInfo == null) || (this.FileSystemVolumeInfo != null && vMHostStorageInfoImpl.FileSystemVolumeInfo != null && Enumerable.SequenceEqual(this.FileSystemVolumeInfo, vMHostStorageInfoImpl.FileSystemVolumeInfo))) && this.SoftwareIScsiEnabled == vMHostStorageInfoImpl.SoftwareIScsiEnabled && ((this.ScsiLun == null && vMHostStorageInfoImpl.ScsiLun == null) || (this.ScsiLun != null && vMHostStorageInfoImpl.ScsiLun != null && Enumerable.SequenceEqual(this.ScsiLun, vMHostStorageInfoImpl.ScsiLun))) && this.Id == vMHostStorageInfoImpl.Id && this.VMHostId == vMHostStorageInfoImpl.VMHostId && this.Uid == vMHostStorageInfoImpl.Uid && ((this.ExtensionData == null && vMHostStorageInfoImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostStorageInfoImpl.ExtensionData))) && this.Name == vMHostStorageInfoImpl.Name);\n        }\n\n        public override bool Equals(object vMHostStorageInfoImpl)\n        {\n            return Equals(vMHostStorageInfoImpl as VMHostStorageInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHost + \"_\" + FileSystemVolumeInfo + \"_\" + SoftwareIScsiEnabled + \"_\" + ScsiLun + \"_\" + Id + \"_\" + VMHostId + \"_\" + Uid + \"_\" + ExtensionData + \"_\" + Name).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.Scsi\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class ScsiLunImpl : ScsiLun, IEquatable<ScsiLunImpl>\n    {\n        public string Id { get; set; }\n\n        public string CanonicalName { get; set; }\n\n        public string RuntimeName { get; set; }\n\n        public string Key { get; set; }\n\n        public string LunType { get; set; }\n\n        public string Model { get; set; }\n\n        public string SerialNumber { get; set; }\n\n        public string Vendor { get; set; }\n\n        public string ConsoleDeviceName { get; set; }\n\n        public long? CapacityMB { get; set; }\n\n        public decimal? CapacityGB { get; set; }\n\n        public ScsiLunMultipathPolicy MultipathPolicy { get; set; }\n\n        public int? CommandsToSwitchPath { get; set; }\n\n        public int? BlocksToSwitchPath { get; set; }\n\n        public string HostId { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool IsLocal { get; set; }\n\n        public bool? IsSsd { get; set; }\n\n        public ScsiDiskVsanStatus VsanStatus { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(ScsiLunImpl scsiLunImpl)\n        {\n            return (scsiLunImpl != null && this.Id == scsiLunImpl.Id && this.CanonicalName == scsiLunImpl.CanonicalName && this.RuntimeName == scsiLunImpl.RuntimeName && this.Key == scsiLunImpl.Key && this.LunType == scsiLunImpl.LunType && this.Model == scsiLunImpl.Model && this.SerialNumber == scsiLunImpl.SerialNumber && this.Vendor == scsiLunImpl.Vendor && this.ConsoleDeviceName == scsiLunImpl.ConsoleDeviceName && ((this.CapacityMB == null && scsiLunImpl.CapacityMB == null) || (this.CapacityMB != null && this.CapacityMB.Equals(scsiLunImpl.CapacityMB))) && ((this.CapacityGB == null && scsiLunImpl.CapacityGB == null) || (this.CapacityGB != null && this.CapacityGB.Equals(scsiLunImpl.CapacityGB))) && this.MultipathPolicy == scsiLunImpl.MultipathPolicy && ((this.CommandsToSwitchPath == null && scsiLunImpl.CommandsToSwitchPath == null) || (this.CommandsToSwitchPath != null && this.CommandsToSwitchPath.Equals(scsiLunImpl.CommandsToSwitchPath))) && ((this.BlocksToSwitchPath == null && scsiLunImpl.BlocksToSwitchPath == null) || (this.BlocksToSwitchPath != null && this.BlocksToSwitchPath.Equals(scsiLunImpl.BlocksToSwitchPath))) && this.HostId == scsiLunImpl.HostId && this.VMHostId == scsiLunImpl.VMHostId && ((this.VMHost == null && scsiLunImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(scsiLunImpl.VMHost))) && this.Uid == scsiLunImpl.Uid && this.IsLocal == scsiLunImpl.IsLocal && ((this.IsSsd == null && scsiLunImpl.IsSsd == null) || (this.IsSsd != null && this.IsSsd.Equals(scsiLunImpl.IsSsd))) && this.VsanStatus == scsiLunImpl.VsanStatus && ((this.ExtensionData == null && scsiLunImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(scsiLunImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object scsiLunImpl)\n        {\n            return Equals(scsiLunImpl as ScsiLunImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + CanonicalName + \"_\" + RuntimeName + \"_\" + Key + \"_\" + LunType + \"_\" + Model + \"_\" + SerialNumber + \"_\" + Vendor + \"_\" + ConsoleDeviceName + \"_\" + CapacityMB + \"_\" + CapacityGB + \"_\" + MultipathPolicy + \"_\" + CommandsToSwitchPath + \"_\" + BlocksToSwitchPath + \"_\" + HostId + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Uid + \"_\" + IsLocal + \"_\" + IsSsd + \"_\" + VsanStatus + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class ScsiLunPathImpl : ScsiLunPath, IEquatable<ScsiLunPathImpl>\n    {\n        public string Name { get; set; }\n\n        public string ScsiLunId { get; set; }\n\n        public ScsiLun ScsiLun { get; set; }\n\n        public string LunPath { get; set; }\n\n        public string SanId { get; set; }\n\n        public ScsiLunPathState State { get; set; }\n\n        public bool Preferred { get; set; }\n\n        public string ScsiCanonicalName { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(ScsiLunPathImpl scsiLunPathImpl)\n        {\n            return (scsiLunPathImpl != null && this.Name == scsiLunPathImpl.Name && this.ScsiLunId == scsiLunPathImpl.ScsiLunId && ((this.ScsiLun == null && scsiLunPathImpl.ScsiLun == null) || (this.ScsiLun != null && this.ScsiLun.Equals(scsiLunPathImpl.ScsiLun))) && this.LunPath == scsiLunPathImpl.LunPath && this.SanId == scsiLunPathImpl.SanId && this.State == scsiLunPathImpl.State && this.Preferred == scsiLunPathImpl.Preferred && this.ScsiCanonicalName == scsiLunPathImpl.ScsiCanonicalName && this.Uid == scsiLunPathImpl.Uid && ((this.ExtensionData == null && scsiLunPathImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(scsiLunPathImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object scsiLunPathImpl)\n        {\n            return Equals(scsiLunPathImpl as ScsiLunPathImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + ScsiLunId + \"_\" + ScsiLun + \"_\" + LunPath + \"_\" + SanId + \"_\" + State + \"_\" + Preferred + \"_\" + ScsiCanonicalName + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Host.VMStartPolicy\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n\n    public class VMHostStartPolicyImpl : VMHostStartPolicy, IEquatable<VMHostStartPolicyImpl>\n    {\n        public string VMHostId { get; set; }\n\n        public string VMHostUid { get; set; }\n\n        public bool Enabled { get; set; }\n\n        public int StartDelay { get; set; }\n\n        public VmStopAction StopAction { get; set; }\n\n        public int StopDelay { get; set; }\n\n        public bool WaitForHeartbeat { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMHostStartPolicyImpl vMHostStartPolicyImpl)\n        {\n            return (vMHostStartPolicyImpl != null && this.VMHostId == vMHostStartPolicyImpl.VMHostId && this.VMHostUid == vMHostStartPolicyImpl.VMHostUid && this.Enabled == vMHostStartPolicyImpl.Enabled && this.StartDelay == vMHostStartPolicyImpl.StartDelay && this.StopAction == vMHostStartPolicyImpl.StopAction && this.StopDelay == vMHostStartPolicyImpl.StopDelay && this.WaitForHeartbeat == vMHostStartPolicyImpl.WaitForHeartbeat && this.Uid == vMHostStartPolicyImpl.Uid && ((this.ExtensionData == null && vMHostStartPolicyImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostStartPolicyImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMHostStartPolicyImpl)\n        {\n            return Equals(vMHostStartPolicyImpl as VMHostStartPolicyImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMHostId + \"_\" + VMHostUid + \"_\" + Enabled + \"_\" + StartDelay + \"_\" + StopAction + \"_\" + StopDelay + \"_\" + WaitForHeartbeat + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMStartPolicyImpl : VMStartPolicy, IEquatable<VMStartPolicyImpl>\n    {\n        public string VirtualMachineId { get; set; }\n\n        public string VMId { get; set; }\n\n        public VirtualMachine VM { get; set; }\n\n        public string VirtualMachineName { get; set; }\n\n        public string VmHostId { get; set; }\n\n        public VmStartAction StartAction { get; set; }\n\n        public int StartDelay { get; set; }\n\n        public int? StartOrder { get; set; }\n\n        public VmStopAction StopAction { get; set; }\n\n        public int StopDelay { get; set; }\n\n        public bool WaitForHeartbeat { get; set; }\n\n        public bool IsStartDelayInherited { get; set; }\n\n        public bool IsStopActionInherited { get; set; }\n\n        public bool IsStopDelayInherited { get; set; }\n\n        public bool IsWaitForHeartbeatInherited { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMStartPolicyImpl vMStartPolicyImpl)\n        {\n            return (vMStartPolicyImpl != null && this.VirtualMachineId == vMStartPolicyImpl.VirtualMachineId && this.VMId == vMStartPolicyImpl.VMId && ((this.VM == null && vMStartPolicyImpl.VM == null) || (this.VM != null && this.VM.Equals(vMStartPolicyImpl.VM))) && this.VirtualMachineName == vMStartPolicyImpl.VirtualMachineName && this.VmHostId == vMStartPolicyImpl.VmHostId && this.StartAction == vMStartPolicyImpl.StartAction && this.StartDelay == vMStartPolicyImpl.StartDelay && ((this.StartOrder == null && vMStartPolicyImpl.StartOrder == null) || (this.StartOrder != null && this.StartOrder.Equals(vMStartPolicyImpl.StartOrder))) && this.StopAction == vMStartPolicyImpl.StopAction && this.StopDelay == vMStartPolicyImpl.StopDelay && this.WaitForHeartbeat == vMStartPolicyImpl.WaitForHeartbeat && this.IsStartDelayInherited == vMStartPolicyImpl.IsStartDelayInherited && this.IsStopActionInherited == vMStartPolicyImpl.IsStopActionInherited && this.IsStopDelayInherited == vMStartPolicyImpl.IsStopDelayInherited && this.IsWaitForHeartbeatInherited == vMStartPolicyImpl.IsWaitForHeartbeatInherited && this.Uid == vMStartPolicyImpl.Uid && ((this.ExtensionData == null && vMStartPolicyImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMStartPolicyImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMStartPolicyImpl)\n        {\n            return Equals(vMStartPolicyImpl as VMStartPolicyImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualMachineId + \"_\" + VMId + \"_\" + VM + \"_\" + VirtualMachineName + \"_\" + VmHostId + \"_\" + StartAction + \"_\" + StartDelay + \"_\" + StartOrder + \"_\" + StopAction + \"_\" + StopDelay + \"_\" + WaitForHeartbeat + \"_\" + IsStartDelayInherited + \"_\" + IsStopActionInherited + \"_\" + IsStopDelayInherited + \"_\" + IsWaitForHeartbeatInherited + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Inventory\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Linq;\n    using VMware.Vim;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Cluster;\n    using VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement;\n    using VMware.VimAutomation.ViCore.Types.V1.Host;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Storage;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n    using VMware.VimAutomation.ViCore.Types.V1.VM;\n    using VMware.VimAutomation.ViCore.Types.V1.VM.Guest;\n    using VMware.VimAutomation.ViCore.Types.V1.Vsan;\n\n    public class ClusterImpl : ComputeResourceImpl, Cluster, IEquatable<ClusterImpl>\n    {\n        public bool? VsanEnabled { get; set; }\n\n        public VsanDiskClaimMode? VsanDiskClaimMode { get; set; }\n\n        public int? HATotalSlots { get; set; }\n\n        public int? HAUsedSlots { get; set; }\n\n        public int? HAAvailableSlots { get; set; }\n\n        public int? HASlotCpuMHz { get; set; }\n\n        public int? HASlotMemoryMb { get; set; }\n\n        public decimal? HASlotMemoryGB { get; set; }\n\n        public int? HASlotNumVCpus { get; set; }\n\n        public string ParentId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder ParentFolder { get; set; }\n\n        public bool HAEnabled { get; set; }\n\n        public bool HAAdmissionControlEnabled { get; set; }\n\n        public int HAFailoverLevel { get; set; }\n\n        public HARestartPriority? HARestartPriority { get; set; }\n\n        public HAIsolationResponse? HAIsolationResponse { get; set; }\n\n        public VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        public bool DrsEnabled { get; set; }\n\n        public DrsMode DrsMode { get; set; }\n\n        public DrsAutomationLevel DrsAutomationLevel { get; set; }\n\n        public string EVCMode { get; set; }\n\n        public bool Equals(ClusterImpl clusterImpl)\n        {\n            return (clusterImpl != null && ((this.VsanEnabled == null && clusterImpl.VsanEnabled == null) || (this.VsanEnabled != null && this.VsanEnabled.Equals(clusterImpl.VsanEnabled))) && ((this.VsanDiskClaimMode == null && clusterImpl.VsanDiskClaimMode == null) || (this.VsanDiskClaimMode != null && this.VsanDiskClaimMode.Equals(clusterImpl.VsanDiskClaimMode))) && ((this.HATotalSlots == null && clusterImpl.HATotalSlots == null) || (this.HATotalSlots != null && this.HATotalSlots.Equals(clusterImpl.HATotalSlots))) && ((this.HAUsedSlots == null && clusterImpl.HAUsedSlots == null) || (this.HAUsedSlots != null && this.HAUsedSlots.Equals(clusterImpl.HAUsedSlots))) && ((this.HAAvailableSlots == null && clusterImpl.HAAvailableSlots == null) || (this.HAAvailableSlots != null && this.HAAvailableSlots.Equals(clusterImpl.HAAvailableSlots))) && ((this.HASlotCpuMHz == null && clusterImpl.HASlotCpuMHz == null) || (this.HASlotCpuMHz != null && this.HASlotCpuMHz.Equals(clusterImpl.HASlotCpuMHz))) && ((this.HASlotMemoryMb == null && clusterImpl.HASlotMemoryMb == null) || (this.HASlotMemoryMb != null && this.HASlotMemoryMb.Equals(clusterImpl.HASlotMemoryMb))) && ((this.HASlotMemoryGB == null && clusterImpl.HASlotMemoryGB == null) || (this.HASlotMemoryGB != null && this.HASlotMemoryGB.Equals(clusterImpl.HASlotMemoryGB))) && ((this.HASlotNumVCpus == null && clusterImpl.HASlotNumVCpus == null) || (this.HASlotNumVCpus != null && this.HASlotNumVCpus.Equals(clusterImpl.HASlotNumVCpus))) && this.ParentId == clusterImpl.ParentId && ((this.ParentFolder == null && clusterImpl.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(clusterImpl.ParentFolder))) && this.HAEnabled == clusterImpl.HAEnabled && this.HAAdmissionControlEnabled == clusterImpl.HAAdmissionControlEnabled && this.HAFailoverLevel == clusterImpl.HAFailoverLevel && ((this.HARestartPriority == null && clusterImpl.HARestartPriority == null) || (this.HARestartPriority != null && this.HARestartPriority.Equals(clusterImpl.HARestartPriority))) && ((this.HAIsolationResponse == null && clusterImpl.HAIsolationResponse == null) || (this.HAIsolationResponse != null && this.HAIsolationResponse.Equals(clusterImpl.HAIsolationResponse))) && ((this.VMSwapfilePolicy == null && clusterImpl.VMSwapfilePolicy == null) || (this.VMSwapfilePolicy != null && this.VMSwapfilePolicy.Equals(clusterImpl.VMSwapfilePolicy))) && this.DrsEnabled == clusterImpl.DrsEnabled && this.DrsMode == clusterImpl.DrsMode && this.DrsAutomationLevel == clusterImpl.DrsAutomationLevel && this.EVCMode == clusterImpl.EVCMode && this.Id == clusterImpl.Id && this.Name == clusterImpl.Name && this.Uid == clusterImpl.Uid && ((this.ExtensionData == null && clusterImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(clusterImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object clusterImpl)\n        {\n            return Equals(clusterImpl as ClusterImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VsanEnabled + \"_\" + VsanDiskClaimMode + \"_\" + HATotalSlots + \"_\" + HAUsedSlots + \"_\" + HAAvailableSlots + \"_\" + HASlotCpuMHz + \"_\" + HASlotMemoryMb + \"_\" + HASlotMemoryGB + \"_\" + HASlotNumVCpus + \"_\" + ParentId + \"_\" + ParentFolder + \"_\" + HAEnabled + \"_\" + HAAdmissionControlEnabled + \"_\" + HAFailoverLevel + \"_\" + HARestartPriority + \"_\" + HAIsolationResponse + \"_\" + VMSwapfilePolicy + \"_\" + DrsEnabled + \"_\" + DrsMode + \"_\" + DrsAutomationLevel + \"_\" + EVCMode + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class ComputeResourceImpl : InventoryItemImpl, InventoryItem, IEquatable<ComputeResourceImpl>\n    {\n        public bool Equals(ComputeResourceImpl computeResourceImpl)\n        {\n            return (computeResourceImpl != null && this.Id == computeResourceImpl.Id && this.Name == computeResourceImpl.Name && this.Uid == computeResourceImpl.Uid && ((this.ExtensionData == null && computeResourceImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(computeResourceImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object computeResourceImpl)\n        {\n            return Equals(computeResourceImpl as ComputeResourceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class DatacenterImpl : InventoryItemImpl, VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter, IEquatable<DatacenterImpl>\n    {\n        public string ParentFolderId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder ParentFolder { get; set; }\n\n        public string DatastoreFolderId { get; set; }\n\n        public bool Equals(DatacenterImpl datacenterImpl)\n        {\n            return (datacenterImpl != null && this.ParentFolderId == datacenterImpl.ParentFolderId && ((this.ParentFolder == null && datacenterImpl.ParentFolder == null) || (this.ParentFolder != null && this.ParentFolder.Equals(datacenterImpl.ParentFolder))) && this.Id == datacenterImpl.Id && this.Name == datacenterImpl.Name && this.Uid == datacenterImpl.Uid && ((this.ExtensionData == null && datacenterImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(datacenterImpl.ExtensionData))) && this.DatastoreFolderId == datacenterImpl.DatastoreFolderId);\n        }\n\n        public override bool Equals(object datacenterImpl)\n        {\n            return Equals(datacenterImpl as DatacenterImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentFolderId + \"_\" + ParentFolder + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData + \"_\" + DatastoreFolderId).GetHashCode();\n        }\n    }\n\n    public class FolderImpl : InventoryItemImpl, VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder, IEquatable<FolderImpl>\n    {\n        public string ParentId { get; set; }\n\n        public InventoryItem Parent { get; set; }\n\n        public bool IsChildTypeVm { get; set; }\n\n        public bool IsChildTypeComputeResource { get; set; }\n\n        public bool IsChildTypeDatacenter { get; set; }\n\n        public bool IsChildTypeDatastore { get; set; }\n\n        public FolderType Type { get; set; }\n\n        public bool Equals(FolderImpl folderImpl)\n        {\n            return (folderImpl != null && this.ParentId == folderImpl.ParentId && ((this.Parent == null && folderImpl.Parent == null) || (this.Parent != null && this.Parent.Equals(folderImpl.Parent))) && this.IsChildTypeVm == folderImpl.IsChildTypeVm && this.IsChildTypeComputeResource == folderImpl.IsChildTypeComputeResource && this.IsChildTypeDatacenter == folderImpl.IsChildTypeDatacenter && this.IsChildTypeDatastore == folderImpl.IsChildTypeDatastore && this.Type == folderImpl.Type && this.Id == folderImpl.Id && this.Name == folderImpl.Name && this.Uid == folderImpl.Uid && ((this.ExtensionData == null && folderImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(folderImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object folderImpl)\n        {\n            return Equals(folderImpl as FolderImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentId + \"_\" + Parent + \"_\" + IsChildTypeVm + \"_\" + IsChildTypeComputeResource + \"_\" + IsChildTypeDatacenter + \"_\" + IsChildTypeDatastore + \"_\" + Type + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public abstract class InventoryItemImpl : VIObjectImpl, InventoryItem, IEquatable<InventoryItemImpl>\n    {\n        public IDictionary<string, string> CustomFields { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(InventoryItemImpl inventoryItemImpl)\n        {\n            return (inventoryItemImpl != null && this.Name == inventoryItemImpl.Name && ((this.CustomFields == null && inventoryItemImpl.CustomFields == null) || (this.CustomFields != null && inventoryItemImpl.CustomFields != null && Enumerable.SequenceEqual(this.CustomFields, inventoryItemImpl.CustomFields))) && ((this.ExtensionData == null && inventoryItemImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(inventoryItemImpl.ExtensionData))) && this.Id == inventoryItemImpl.Id && this.Uid == inventoryItemImpl.Uid);\n        }\n\n        public override bool Equals(object inventoryItemImpl)\n        {\n            return Equals(inventoryItemImpl as InventoryItemImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + CustomFields + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class ResourcePoolImpl : InventoryItemImpl, VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool, IEquatable<ResourcePoolImpl>\n    {\n        public string ParentId { get; set; }\n\n        public InventoryItem Parent { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel CpuSharesLevel { get; set; }\n\n        public int NumCpuShares { get; set; }\n\n        public long CpuReservationMHz { get; set; }\n\n        public bool CpuExpandableReservation { get; set; }\n\n        public long CpuLimitMHz { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel MemSharesLevel { get; set; }\n\n        public int NumMemShares { get; set; }\n\n        public decimal MemReservationMB { get; set; }\n\n        public decimal MemReservationGB { get; set; }\n\n        public bool MemExpandableReservation { get; set; }\n\n        public decimal MemLimitMB { get; set; }\n\n        public decimal MemLimitGB { get; set; }\n\n        public bool Equals(ResourcePoolImpl resourcePoolImpl)\n        {\n            return (resourcePoolImpl != null && this.ParentId == resourcePoolImpl.ParentId && ((this.Parent == null && resourcePoolImpl.Parent == null) || (this.Parent != null && this.Parent.Equals(resourcePoolImpl.Parent))) && this.CpuSharesLevel == resourcePoolImpl.CpuSharesLevel && this.NumCpuShares == resourcePoolImpl.NumCpuShares && this.CpuReservationMHz == resourcePoolImpl.CpuReservationMHz && this.CpuExpandableReservation == resourcePoolImpl.CpuExpandableReservation && this.CpuLimitMHz == resourcePoolImpl.CpuLimitMHz && this.MemSharesLevel == resourcePoolImpl.MemSharesLevel && this.NumMemShares == resourcePoolImpl.NumMemShares && this.MemReservationMB == resourcePoolImpl.MemReservationMB && this.MemReservationGB == resourcePoolImpl.MemReservationGB && this.MemExpandableReservation == resourcePoolImpl.MemExpandableReservation && this.MemLimitMB == resourcePoolImpl.MemLimitMB && this.MemLimitGB == resourcePoolImpl.MemLimitGB && this.Id == resourcePoolImpl.Id && this.Name == resourcePoolImpl.Name && this.Uid == resourcePoolImpl.Uid && ((this.ExtensionData == null && resourcePoolImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(resourcePoolImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object resourcePoolImpl)\n        {\n            return Equals(resourcePoolImpl as ResourcePoolImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentId + \"_\" + Parent + \"_\" + CpuSharesLevel + \"_\" + NumCpuShares + \"_\" + CpuReservationMHz + \"_\" + CpuExpandableReservation + \"_\" + CpuLimitMHz + \"_\" + MemSharesLevel + \"_\" + NumMemShares + \"_\" + MemReservationMB + \"_\" + MemReservationGB + \"_\" + MemExpandableReservation + \"_\" + MemLimitMB + \"_\" + MemLimitGB + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class TemplateImpl : InventoryItemImpl, Template, IEquatable<TemplateImpl>\n    {\n        public string FolderId { get; set; }\n\n        public string[] DatastoreIdList { get; set; }\n\n        public string HostId { get; set; }\n\n        public bool Equals(TemplateImpl templateImpl)\n        {\n            return (templateImpl != null && this.FolderId == templateImpl.FolderId && ((this.DatastoreIdList == null && templateImpl.DatastoreIdList == null) || (this.DatastoreIdList != null && templateImpl.DatastoreIdList != null && Enumerable.SequenceEqual(this.DatastoreIdList, templateImpl.DatastoreIdList))) && this.Id == templateImpl.Id && this.Name == templateImpl.Name && this.Uid == templateImpl.Uid && ((this.ExtensionData == null && templateImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(templateImpl.ExtensionData))) && this.HostId == templateImpl.HostId);\n        }\n\n        public override bool Equals(object templateImpl)\n        {\n            return Equals(templateImpl as TemplateImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (FolderId + \"_\" + DatastoreIdList + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData + \"_\" + HostId).GetHashCode();\n        }\n    }\n\n    public class VAppImpl : InventoryItemImpl, VApp, IEquatable<VAppImpl>\n    {\n        public string ParentId { get; set; }\n\n        public InventoryItem Parent { get; set; }\n\n        public VAppStatus Status { get; set; }\n\n        public int NumCpuShares { get; set; }\n\n        public long CpuReservationMhz { get; set; }\n\n        public bool CpuExpandableReservation { get; set; }\n\n        public long CpuLimitMhz { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel CpuSharesLevel { get; set; }\n\n        public int NumMemShares { get; set; }\n\n        public long MemReservationMB { get; set; }\n\n        public decimal MemReservationGB { get; set; }\n\n        public bool MemExpandableReservation { get; set; }\n\n        public long MemLimitMB { get; set; }\n\n        public decimal MemLimitGB { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel MemSharesLevel { get; set; }\n\n        public ManagedObjectReference ObtainExportLease()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(VAppImpl vAppImpl)\n        {\n            return (vAppImpl != null && this.ParentId == vAppImpl.ParentId && ((this.Parent == null && vAppImpl.Parent == null) || (this.Parent != null && this.Parent.Equals(vAppImpl.Parent))) && this.Status == vAppImpl.Status && this.NumCpuShares == vAppImpl.NumCpuShares && this.CpuReservationMhz == vAppImpl.CpuReservationMhz && this.CpuExpandableReservation == vAppImpl.CpuExpandableReservation && this.CpuLimitMhz == vAppImpl.CpuLimitMhz && this.CpuSharesLevel == vAppImpl.CpuSharesLevel && this.NumMemShares == vAppImpl.NumMemShares && this.MemReservationMB == vAppImpl.MemReservationMB && this.MemReservationGB == vAppImpl.MemReservationGB && this.MemExpandableReservation == vAppImpl.MemExpandableReservation && this.MemLimitMB == vAppImpl.MemLimitMB && this.MemLimitGB == vAppImpl.MemLimitGB && this.MemSharesLevel == vAppImpl.MemSharesLevel && this.Id == vAppImpl.Id && this.Name == vAppImpl.Name && this.Uid == vAppImpl.Uid && ((this.ExtensionData == null && vAppImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vAppImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vAppImpl)\n        {\n            return Equals(vAppImpl as VAppImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ParentId + \"_\" + Parent + \"_\" + Status + \"_\" + NumCpuShares + \"_\" + CpuReservationMhz + \"_\" + CpuExpandableReservation + \"_\" + CpuLimitMhz + \"_\" + CpuSharesLevel + \"_\" + NumMemShares + \"_\" + MemReservationMB + \"_\" + MemReservationGB + \"_\" + MemExpandableReservation + \"_\" + MemLimitMB + \"_\" + MemLimitGB + \"_\" + MemSharesLevel + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VirtualMachineImpl : InventoryItemImpl, VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine, IEquatable<VirtualMachineImpl>\n    {\n        public PowerState PowerState { get; set; }\n\n        public VMVersion Version { get; set; }\n\n        public string HardwareVersion { get; set; }\n\n        public string Notes { get; set; }\n\n        public VMGuest Guest { get; set; }\n\n        public int NumCpu { get; set; }\n\n        public int CoresPerSocket { get; set; }\n\n        public decimal MemoryMB { get; set; }\n\n        public decimal MemoryGB { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public VApp VApp { get; set; }\n\n        public string FolderId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder Folder { get; set; }\n\n        public string ResourcePoolId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool ResourcePool { get; set; }\n\n        public string PersistentId { get; set; }\n\n        public decimal UsedSpaceGB { get; set; }\n\n        public decimal ProvisionedSpaceGB { get; set; }\n\n        public string[] DatastoreIdList { get; set; }\n\n        public HARestartPriority? HARestartPriority { get; set; }\n\n        public HAIsolationResponse? HAIsolationResponse { get; set; }\n\n        public DrsAutomationLevel? DrsAutomationLevel { get; set; }\n\n        public VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        public VMResourceConfiguration VMResourceConfiguration { get; set; }\n\n        public string GuestId { get; set; }\n\n        public ManagedObjectReference ObtainExportLease()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(VirtualMachineImpl virtualMachineImpl)\n        {\n            return (virtualMachineImpl != null && this.PowerState == virtualMachineImpl.PowerState && this.Version == virtualMachineImpl.Version && this.HardwareVersion == virtualMachineImpl.HardwareVersion && this.Notes == virtualMachineImpl.Notes && ((this.Guest == null && virtualMachineImpl.Guest == null) || (this.Guest != null && this.Guest.Equals(virtualMachineImpl.Guest))) && this.NumCpu == virtualMachineImpl.NumCpu && this.CoresPerSocket == virtualMachineImpl.CoresPerSocket && this.MemoryMB == virtualMachineImpl.MemoryMB && this.MemoryGB == virtualMachineImpl.MemoryGB && this.VMHostId == virtualMachineImpl.VMHostId && ((this.VMHost == null && virtualMachineImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(virtualMachineImpl.VMHost))) && ((this.VApp == null && virtualMachineImpl.VApp == null) || (this.VApp != null && this.VApp.Equals(virtualMachineImpl.VApp))) && this.FolderId == virtualMachineImpl.FolderId && ((this.Folder == null && virtualMachineImpl.Folder == null) || (this.Folder != null && this.Folder.Equals(virtualMachineImpl.Folder))) && this.ResourcePoolId == virtualMachineImpl.ResourcePoolId && ((this.ResourcePool == null && virtualMachineImpl.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(virtualMachineImpl.ResourcePool))) && this.PersistentId == virtualMachineImpl.PersistentId && this.UsedSpaceGB == virtualMachineImpl.UsedSpaceGB && this.ProvisionedSpaceGB == virtualMachineImpl.ProvisionedSpaceGB && ((this.DatastoreIdList == null && virtualMachineImpl.DatastoreIdList == null) || (this.DatastoreIdList != null && virtualMachineImpl.DatastoreIdList != null && Enumerable.SequenceEqual(this.DatastoreIdList, virtualMachineImpl.DatastoreIdList))) && ((this.HARestartPriority == null && virtualMachineImpl.HARestartPriority == null) || (this.HARestartPriority != null && this.HARestartPriority.Equals(virtualMachineImpl.HARestartPriority))) && ((this.HAIsolationResponse == null && virtualMachineImpl.HAIsolationResponse == null) || (this.HAIsolationResponse != null && this.HAIsolationResponse.Equals(virtualMachineImpl.HAIsolationResponse))) && ((this.DrsAutomationLevel == null && virtualMachineImpl.DrsAutomationLevel == null) || (this.DrsAutomationLevel != null && this.DrsAutomationLevel.Equals(virtualMachineImpl.DrsAutomationLevel))) && ((this.VMSwapfilePolicy == null && virtualMachineImpl.VMSwapfilePolicy == null) || (this.VMSwapfilePolicy != null && this.VMSwapfilePolicy.Equals(virtualMachineImpl.VMSwapfilePolicy))) && ((this.VMResourceConfiguration == null && virtualMachineImpl.VMResourceConfiguration == null) || (this.VMResourceConfiguration != null && this.VMResourceConfiguration.Equals(virtualMachineImpl.VMResourceConfiguration))) && this.GuestId == virtualMachineImpl.GuestId && this.Id == virtualMachineImpl.Id && this.Name == virtualMachineImpl.Name && this.Uid == virtualMachineImpl.Uid && ((this.ExtensionData == null && virtualMachineImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(virtualMachineImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object virtualMachineImpl)\n        {\n            return Equals(virtualMachineImpl as VirtualMachineImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (PowerState + \"_\" + Version + \"_\" + HardwareVersion + \"_\" + Notes + \"_\" + Guest + \"_\" + NumCpu + \"_\" + CoresPerSocket + \"_\" + MemoryMB + \"_\" + MemoryGB + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + VApp + \"_\" + FolderId + \"_\" + Folder + \"_\" + ResourcePoolId + \"_\" + ResourcePool + \"_\" + PersistentId + \"_\" + UsedSpaceGB + \"_\" + ProvisionedSpaceGB + \"_\" + DatastoreIdList + \"_\" + HARestartPriority + \"_\" + HAIsolationResponse + \"_\" + DrsAutomationLevel + \"_\" + VMSwapfilePolicy + \"_\" + VMResourceConfiguration + \"_\" + GuestId + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMHostImpl : InventoryItemImpl, VMHost, IEquatable<VMHostImpl>\n    {\n        public VMHostState State { get; set; }\n\n        public VMHostState ConnectionState { get; set; }\n\n        public VMHostPowerState PowerState { get; set; }\n\n        public string VMSwapfileDatastoreId { get; set; }\n\n        public VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        public string ParentId { get; set; }\n\n        public bool IsStandalone { get; set; }\n\n        public string Manufacturer { get; set; }\n\n        public string Model { get; set; }\n\n        public int NumCpu { get; set; }\n\n        public int CpuTotalMhz { get; set; }\n\n        public int CpuUsageMhz { get; set; }\n\n        public string LicenseKey { get; set; }\n\n        public decimal MemoryTotalMB { get; set; }\n\n        public decimal MemoryTotalGB { get; set; }\n\n        public decimal MemoryUsageMB { get; set; }\n\n        public decimal MemoryUsageGB { get; set; }\n\n        public string ProcessorType { get; set; }\n\n        public bool HyperthreadingActive { get; set; }\n\n        public VMHostTimeZone TimeZone { get; set; }\n\n        public string Version { get; set; }\n\n        public string Build { get; set; }\n\n        public InventoryItem Parent { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore VMSwapfileDatastore { get; set; }\n\n        public VMHostStorageInfo StorageInfo { get; set; }\n\n        public VMHostNetworkInfo NetworkInfo { get; set; }\n\n        public VMHostDiagnosticPartition DiagnosticPartition { get; set; }\n\n        public VMHostFirewallDefaultPolicy FirewallDefaultPolicy { get; set; }\n\n        public string ApiVersion { get; set; }\n\n        public string MaxEVCMode { get; set; }\n\n        public string[] DatastoreIdList { get; set; }\n\n        public bool Equals(VMHostImpl vMHostImpl)\n        {\n            return (vMHostImpl != null && this.State == vMHostImpl.State && this.ConnectionState == vMHostImpl.ConnectionState && this.PowerState == vMHostImpl.PowerState && this.VMSwapfileDatastoreId == vMHostImpl.VMSwapfileDatastoreId && ((this.VMSwapfilePolicy == null && vMHostImpl.VMSwapfilePolicy == null) || (this.VMSwapfilePolicy != null && this.VMSwapfilePolicy.Equals(vMHostImpl.VMSwapfilePolicy))) && this.ParentId == vMHostImpl.ParentId && this.IsStandalone == vMHostImpl.IsStandalone && this.Manufacturer == vMHostImpl.Manufacturer && this.Model == vMHostImpl.Model && this.NumCpu == vMHostImpl.NumCpu && this.CpuTotalMhz == vMHostImpl.CpuTotalMhz && this.CpuUsageMhz == vMHostImpl.CpuUsageMhz && this.LicenseKey == vMHostImpl.LicenseKey && this.MemoryTotalMB == vMHostImpl.MemoryTotalMB && this.MemoryTotalGB == vMHostImpl.MemoryTotalGB && this.MemoryUsageMB == vMHostImpl.MemoryUsageMB && this.MemoryUsageGB == vMHostImpl.MemoryUsageGB && this.ProcessorType == vMHostImpl.ProcessorType && this.HyperthreadingActive == vMHostImpl.HyperthreadingActive && ((this.TimeZone == null && vMHostImpl.TimeZone == null) || (this.TimeZone != null && this.TimeZone.Equals(vMHostImpl.TimeZone))) && this.Version == vMHostImpl.Version && this.Build == vMHostImpl.Build && ((this.Parent == null && vMHostImpl.Parent == null) || (this.Parent != null && this.Parent.Equals(vMHostImpl.Parent))) && ((this.VMSwapfileDatastore == null && vMHostImpl.VMSwapfileDatastore == null) || (this.VMSwapfileDatastore != null && this.VMSwapfileDatastore.Equals(vMHostImpl.VMSwapfileDatastore))) && ((this.StorageInfo == null && vMHostImpl.StorageInfo == null) || (this.StorageInfo != null && this.StorageInfo.Equals(vMHostImpl.StorageInfo))) && ((this.NetworkInfo == null && vMHostImpl.NetworkInfo == null) || (this.NetworkInfo != null && this.NetworkInfo.Equals(vMHostImpl.NetworkInfo))) && ((this.DiagnosticPartition == null && vMHostImpl.DiagnosticPartition == null) || (this.DiagnosticPartition != null && this.DiagnosticPartition.Equals(vMHostImpl.DiagnosticPartition))) && ((this.FirewallDefaultPolicy == null && vMHostImpl.FirewallDefaultPolicy == null) || (this.FirewallDefaultPolicy != null && this.FirewallDefaultPolicy.Equals(vMHostImpl.FirewallDefaultPolicy))) && this.ApiVersion == vMHostImpl.ApiVersion && this.MaxEVCMode == vMHostImpl.MaxEVCMode && this.Id == vMHostImpl.Id && this.Name == vMHostImpl.Name && this.Uid == vMHostImpl.Uid && ((this.ExtensionData == null && vMHostImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMHostImpl.ExtensionData))) && ((this.DatastoreIdList == null && vMHostImpl.DatastoreIdList == null) || (this.DatastoreIdList != null && vMHostImpl.DatastoreIdList != null && Enumerable.SequenceEqual(this.DatastoreIdList, vMHostImpl.DatastoreIdList))));\n        }\n\n        public override bool Equals(object vMHostImpl)\n        {\n            return Equals(vMHostImpl as VMHostImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (State + \"_\" + ConnectionState + \"_\" + PowerState + \"_\" + VMSwapfileDatastoreId + \"_\" + VMSwapfilePolicy + \"_\" + ParentId + \"_\" + IsStandalone + \"_\" + Manufacturer + \"_\" + Model + \"_\" + NumCpu + \"_\" + CpuTotalMhz + \"_\" + CpuUsageMhz + \"_\" + LicenseKey + \"_\" + MemoryTotalMB + \"_\" + MemoryTotalGB + \"_\" + MemoryUsageMB + \"_\" + MemoryUsageGB + \"_\" + ProcessorType + \"_\" + HyperthreadingActive + \"_\" + TimeZone + \"_\" + Version + \"_\" + Build + \"_\" + Parent + \"_\" + VMSwapfileDatastore + \"_\" + StorageInfo + \"_\" + NetworkInfo + \"_\" + DiagnosticPartition + \"_\" + FirewallDefaultPolicy + \"_\" + ApiVersion + \"_\" + MaxEVCMode + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData + \"_\" + DatastoreIdList).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.OSCustomization\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.OSCustomization;\n\n    public class OSCustomizationSpecImpl : VIObjectImpl, OSCustomizationSpec, IEquatable<OSCustomizationSpecImpl>\n    {\n        public OSCustomizationSpecType Type { get; set; }\n\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public DateTime? LastUpdate { get; set; }\n\n        public string DomainAdminUsername { get; set; }\n\n        public string DomainUsername { get; set; }\n\n        public string Description { get; set; }\n\n        public int? AutoLogonCount { get; set; }\n\n        public bool? ChangeSid { get; set; }\n\n        public bool? DeleteAccounts { get; set; }\n\n        public string[] DnsServer { get; set; }\n\n        public string[] DnsSuffix { get; set; }\n\n        public string Domain { get; set; }\n\n        public string FullName { get; set; }\n\n        public string[] GuiRunOnce { get; set; }\n\n        public string NamingPrefix { get; set; }\n\n        public NamingScheme? NamingScheme { get; set; }\n\n        public string OrgName { get; set; }\n\n        public OSType? OSType { get; set; }\n\n        public string ProductKey { get; set; }\n\n        public string TimeZone { get; set; }\n\n        public string Workgroup { get; set; }\n\n        public LicenseMode? LicenseMode { get; set; }\n\n        public int? LicenseMaxConnections { get; set; }\n\n        public sbyte[] EncryptionKey { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string AdminPassword { get; set; }\n\n        public string DomainAdminPassword { get; set; }\n\n        public string DomainPassword { get; set; }\n\n        public bool Equals(OSCustomizationSpecImpl oSCustomizationSpecImpl)\n        {\n            return (oSCustomizationSpecImpl != null && this.Name == oSCustomizationSpecImpl.Name && this.Type == oSCustomizationSpecImpl.Type && this.ServerId == oSCustomizationSpecImpl.ServerId && ((this.Server == null && oSCustomizationSpecImpl.Server == null) || (this.Server != null && this.Server.Equals(oSCustomizationSpecImpl.Server))) && ((this.LastUpdate == null && oSCustomizationSpecImpl.LastUpdate == null) || (this.LastUpdate != null && this.LastUpdate.Equals(oSCustomizationSpecImpl.LastUpdate))) && this.DomainAdminUsername == oSCustomizationSpecImpl.DomainAdminUsername && this.DomainUsername == oSCustomizationSpecImpl.DomainUsername && this.Description == oSCustomizationSpecImpl.Description && ((this.AutoLogonCount == null && oSCustomizationSpecImpl.AutoLogonCount == null) || (this.AutoLogonCount != null && this.AutoLogonCount.Equals(oSCustomizationSpecImpl.AutoLogonCount))) && ((this.ChangeSid == null && oSCustomizationSpecImpl.ChangeSid == null) || (this.ChangeSid != null && this.ChangeSid.Equals(oSCustomizationSpecImpl.ChangeSid))) && ((this.DeleteAccounts == null && oSCustomizationSpecImpl.DeleteAccounts == null) || (this.DeleteAccounts != null && this.DeleteAccounts.Equals(oSCustomizationSpecImpl.DeleteAccounts))) && ((this.DnsServer == null && oSCustomizationSpecImpl.DnsServer == null) || (this.DnsServer != null && oSCustomizationSpecImpl.DnsServer != null && Enumerable.SequenceEqual(this.DnsServer, oSCustomizationSpecImpl.DnsServer))) && ((this.DnsSuffix == null && oSCustomizationSpecImpl.DnsSuffix == null) || (this.DnsSuffix != null && oSCustomizationSpecImpl.DnsSuffix != null && Enumerable.SequenceEqual(this.DnsSuffix, oSCustomizationSpecImpl.DnsSuffix))) && this.Domain == oSCustomizationSpecImpl.Domain && this.FullName == oSCustomizationSpecImpl.FullName && ((this.GuiRunOnce == null && oSCustomizationSpecImpl.GuiRunOnce == null) || (this.GuiRunOnce != null && oSCustomizationSpecImpl.GuiRunOnce != null && Enumerable.SequenceEqual(this.GuiRunOnce, oSCustomizationSpecImpl.GuiRunOnce))) && this.NamingPrefix == oSCustomizationSpecImpl.NamingPrefix && ((this.NamingScheme == null && oSCustomizationSpecImpl.NamingScheme == null) || (this.NamingScheme != null && this.NamingScheme.Equals(oSCustomizationSpecImpl.NamingScheme))) && this.OrgName == oSCustomizationSpecImpl.OrgName && ((this.OSType == null && oSCustomizationSpecImpl.OSType == null) || (this.OSType != null && this.OSType.Equals(oSCustomizationSpecImpl.OSType))) && this.ProductKey == oSCustomizationSpecImpl.ProductKey && this.TimeZone == oSCustomizationSpecImpl.TimeZone && this.Workgroup == oSCustomizationSpecImpl.Workgroup && ((this.LicenseMode == null && oSCustomizationSpecImpl.LicenseMode == null) || (this.LicenseMode != null && this.LicenseMode.Equals(oSCustomizationSpecImpl.LicenseMode))) && ((this.LicenseMaxConnections == null && oSCustomizationSpecImpl.LicenseMaxConnections == null) || (this.LicenseMaxConnections != null && this.LicenseMaxConnections.Equals(oSCustomizationSpecImpl.LicenseMaxConnections))) && ((this.EncryptionKey == null && oSCustomizationSpecImpl.EncryptionKey == null) || (this.EncryptionKey != null && oSCustomizationSpecImpl.EncryptionKey != null && Enumerable.SequenceEqual(this.EncryptionKey, oSCustomizationSpecImpl.EncryptionKey))) && ((this.ExtensionData == null && oSCustomizationSpecImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(oSCustomizationSpecImpl.ExtensionData))) && this.Id == oSCustomizationSpecImpl.Id && this.Uid == oSCustomizationSpecImpl.Uid && this.AdminPassword == oSCustomizationSpecImpl.AdminPassword && this.DomainAdminPassword == oSCustomizationSpecImpl.DomainAdminPassword && this.DomainPassword == oSCustomizationSpecImpl.DomainPassword);\n        }\n\n        public override bool Equals(object oSCustomizationSpecImpl)\n        {\n            return Equals(oSCustomizationSpecImpl as OSCustomizationSpecImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + Type + \"_\" + ServerId + \"_\" + Server + \"_\" + LastUpdate + \"_\" + DomainAdminUsername + \"_\" + DomainUsername + \"_\" + Description + \"_\" + AutoLogonCount + \"_\" + ChangeSid + \"_\" + DeleteAccounts + \"_\" + DnsServer + \"_\" + DnsSuffix + \"_\" + Domain + \"_\" + FullName + \"_\" + GuiRunOnce + \"_\" + NamingPrefix + \"_\" + NamingScheme + \"_\" + OrgName + \"_\" + OSType + \"_\" + ProductKey + \"_\" + TimeZone + \"_\" + Workgroup + \"_\" + LicenseMode + \"_\" + LicenseMaxConnections + \"_\" + EncryptionKey + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Uid + \"_\" + AdminPassword + \"_\" + DomainAdminPassword + \"_\" + DomainPassword).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Ovf\n{\n    using System;\n    using System.Collections;\n    using System.Linq;\n    using VMware.VimAutomation.ViCore.Types.V1.Ovf;\n\n    public class OvfConfigurationImpl : OvfConfiguration, IEquatable<OvfConfigurationImpl>\n    {\n        public string Source { get; set; }\n\n        public Hashtable ToHashTable()\n        {\n            return default(Hashtable);\n        }\n\n        public bool Equals(OvfConfigurationImpl ovfConfigurationImpl)\n        {\n            return (ovfConfigurationImpl != null && this.Source == ovfConfigurationImpl.Source);\n        }\n\n        public override bool Equals(object ovfConfigurationImpl)\n        {\n            return Equals(ovfConfigurationImpl as OvfConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Source).GetHashCode();\n        }\n    }\n\n    public class OvfPropertyImpl : OvfProperty, IEquatable<OvfPropertyImpl>\n    {\n        public string Key { get; set; }\n\n        public object Value { get; set; }\n\n        public object DefaultValue { get; set; }\n\n        public string OvfTypeDescription { get; set; }\n\n        public string Description { get; set; }\n\n        public string GetPropertyPath()\n        {\n            return default(string);\n        }\n\n        public bool Equals(OvfPropertyImpl ovfPropertyImpl)\n        {\n            return (ovfPropertyImpl != null && this.Key == ovfPropertyImpl.Key && ((this.Value == null && ovfPropertyImpl.Value == null) || (this.Value != null && this.Value.Equals(ovfPropertyImpl.Value))) && ((this.DefaultValue == null && ovfPropertyImpl.DefaultValue == null) || (this.DefaultValue != null && this.DefaultValue.Equals(ovfPropertyImpl.DefaultValue))) && this.OvfTypeDescription == ovfPropertyImpl.OvfTypeDescription && this.Description == ovfPropertyImpl.Description);\n        }\n\n        public override bool Equals(object ovfPropertyImpl)\n        {\n            return Equals(ovfPropertyImpl as OvfPropertyImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + Value + \"_\" + DefaultValue + \"_\" + OvfTypeDescription + \"_\" + Description).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.PermissionManagement;\n\n    public class PermissionImpl : Permission, IEquatable<PermissionImpl>\n    {\n        public string EntityId { get; set; }\n\n        public VIObject Entity { get; set; }\n\n        public int RoleId { get; set; }\n\n        public string Role { get; set; }\n\n        public string Principal { get; set; }\n\n        public bool Propagate { get; set; }\n\n        public bool IsGroup { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(PermissionImpl permissionImpl)\n        {\n            return (permissionImpl != null && this.EntityId == permissionImpl.EntityId && ((this.Entity == null && permissionImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(permissionImpl.Entity))) && this.RoleId == permissionImpl.RoleId && this.Role == permissionImpl.Role && this.Principal == permissionImpl.Principal && this.Propagate == permissionImpl.Propagate && this.IsGroup == permissionImpl.IsGroup && this.Uid == permissionImpl.Uid && ((this.ExtensionData == null && permissionImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(permissionImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object permissionImpl)\n        {\n            return this.Equals(permissionImpl as PermissionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (EntityId + \"_\" + Entity + \"_\" + RoleId + \"_\" + Role + \"_\" + Principal + \"_\" + Propagate + \"_\" + IsGroup + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class PrivilegeImpl : Privilege, IEquatable<PrivilegeImpl>\n    {\n        public string Description { get; set; }\n\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Name { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(PrivilegeImpl privilegeImpl)\n        {\n            return (privilegeImpl != null && this.Description == privilegeImpl.Description && this.ServerId == privilegeImpl.ServerId && ((this.Server == null && privilegeImpl.Server == null) || (this.Server != null && this.Server.Equals(privilegeImpl.Server))) && this.Id == privilegeImpl.Id && this.Uid == privilegeImpl.Uid && this.Name == privilegeImpl.Name && ((this.ExtensionData == null && privilegeImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(privilegeImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object privilegeImpl)\n        {\n            return Equals(privilegeImpl as PrivilegeImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + ServerId + \"_\" + Server + \"_\" + Id + \"_\" + Uid + \"_\" + Name + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class RoleImpl : Role, IEquatable<RoleImpl>\n    {\n        public string Description { get; set; }\n\n        public bool IsSystem { get; set; }\n\n        public string[] PrivilegeList { get; set; }\n\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public int Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(RoleImpl roleImpl)\n        {\n            return (roleImpl != null && this.Description == roleImpl.Description && this.IsSystem == roleImpl.IsSystem && ((this.PrivilegeList == null && roleImpl.PrivilegeList == null) || (this.PrivilegeList != null && roleImpl.PrivilegeList != null && Enumerable.SequenceEqual(this.PrivilegeList, roleImpl.PrivilegeList))) && this.ServerId == roleImpl.ServerId && ((this.Server == null && roleImpl.Server == null) || (this.Server != null && this.Server.Equals(roleImpl.Server))) && this.Id == roleImpl.Id && this.Name == roleImpl.Name && this.Uid == roleImpl.Uid && ((this.ExtensionData == null && roleImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(roleImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object roleImpl)\n        {\n            return Equals(roleImpl as RoleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + IsSystem + \"_\" + PrivilegeList + \"_\" + ServerId + \"_\" + Server + \"_\" + Id + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VIGroupAccountImpl : VIGroupAccount, IEquatable<VIGroupAccountImpl>\n    {\n        public string Id { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Description { get; set; }\n\n        public string Domain { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VIGroupAccountImpl vIGroupAccountImpl)\n        {\n            return (vIGroupAccountImpl != null && this.Id == vIGroupAccountImpl.Id && ((this.Server == null && vIGroupAccountImpl.Server == null) || (this.Server != null && this.Server.Equals(vIGroupAccountImpl.Server))) && this.Description == vIGroupAccountImpl.Description && this.Domain == vIGroupAccountImpl.Domain && this.Name == vIGroupAccountImpl.Name && this.Uid == vIGroupAccountImpl.Uid && ((this.ExtensionData == null && vIGroupAccountImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vIGroupAccountImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vIGroupAccountImpl)\n        {\n            return Equals(vIGroupAccountImpl as VIGroupAccountImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Server + \"_\" + Description + \"_\" + Domain + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VIUserAccountImpl : VIUserAccount, IEquatable<VIUserAccountImpl>\n    {\n        public string Id { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Description { get; set; }\n\n        public string Domain { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VIUserAccountImpl vIUserAccountImpl)\n        {\n            return (vIUserAccountImpl != null && this.Id == vIUserAccountImpl.Id && ((this.Server == null && vIUserAccountImpl.Server == null) || (this.Server != null && this.Server.Equals(vIUserAccountImpl.Server))) && this.Description == vIUserAccountImpl.Description && this.Domain == vIUserAccountImpl.Domain && this.Name == vIUserAccountImpl.Name && this.Uid == vIUserAccountImpl.Uid && ((this.ExtensionData == null && vIUserAccountImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vIUserAccountImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vIUserAccountImpl)\n        {\n            return Equals(vIUserAccountImpl as VIUserAccountImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Server + \"_\" + Description + \"_\" + Domain + \"_\" + Name + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Stat\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Stat;\n\n    public class FloatSampleImpl : SampleImpl, FloatSample, IEquatable<FloatSampleImpl>\n    {\n        public float Value { get; set; }\n\n        public bool Equals(FloatSampleImpl floatSampleImpl)\n        {\n            return (floatSampleImpl != null && this.Value == floatSampleImpl.Value && this.Timestamp == floatSampleImpl.Timestamp && this.MetricId == floatSampleImpl.MetricId && this.Description == floatSampleImpl.Description && this.Unit == floatSampleImpl.Unit && ((this.Entity == null && floatSampleImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(floatSampleImpl.Entity))) && this.EntityId == floatSampleImpl.EntityId && this.IntervalSecs == floatSampleImpl.IntervalSecs && this.Instance == floatSampleImpl.Instance && this.Uid == floatSampleImpl.Uid);\n        }\n\n        public override bool Equals(object floatSampleImpl)\n        {\n            return Equals(floatSampleImpl as FloatSampleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value + \"_\" + Timestamp + \"_\" + MetricId + \"_\" + Description + \"_\" + Unit + \"_\" + Entity + \"_\" + EntityId + \"_\" + IntervalSecs + \"_\" + Instance + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class LongSampleImpl : SampleImpl, LongSample, IEquatable<LongSampleImpl>\n    {\n        public long Value { get; set; }\n\n        public bool Equals(LongSampleImpl longSampleImpl)\n        {\n            return (longSampleImpl != null && this.Value == longSampleImpl.Value && this.Timestamp == longSampleImpl.Timestamp && this.MetricId == longSampleImpl.MetricId && this.Description == longSampleImpl.Description && this.Unit == longSampleImpl.Unit && ((this.Entity == null && longSampleImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(longSampleImpl.Entity))) && this.EntityId == longSampleImpl.EntityId && this.IntervalSecs == longSampleImpl.IntervalSecs && this.Instance == longSampleImpl.Instance && this.Uid == longSampleImpl.Uid);\n        }\n\n        public override bool Equals(object longSampleImpl)\n        {\n            return Equals(longSampleImpl as LongSampleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Value + \"_\" + Timestamp + \"_\" + MetricId + \"_\" + Description + \"_\" + Unit + \"_\" + Entity + \"_\" + EntityId + \"_\" + IntervalSecs + \"_\" + Instance + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public abstract class SampleImpl : Sample, IEquatable<SampleImpl>\n    {\n        public DateTime Timestamp { get; set; }\n\n        public string MetricId { get; set; }\n\n        public string Unit { get; set; }\n\n        public string Description { get; set; }\n\n        public VIObject Entity { get; set; }\n\n        public string EntityId { get; set; }\n\n        public int IntervalSecs { get; set; }\n\n        public string Instance { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(SampleImpl sampleImpl)\n        {\n            return (sampleImpl != null && this.Timestamp == sampleImpl.Timestamp && this.MetricId == sampleImpl.MetricId && this.Unit == sampleImpl.Unit && this.Description == sampleImpl.Description && ((this.Entity == null && sampleImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(sampleImpl.Entity))) && this.EntityId == sampleImpl.EntityId && this.IntervalSecs == sampleImpl.IntervalSecs && this.Instance == sampleImpl.Instance && this.Uid == sampleImpl.Uid);\n        }\n\n        public override bool Equals(object sampleImpl)\n        {\n            return Equals(sampleImpl as SampleImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Timestamp + \"_\" + MetricId + \"_\" + Unit + \"_\" + Description + \"_\" + Entity + \"_\" + EntityId + \"_\" + IntervalSecs + \"_\" + Instance + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class StatIntervalImpl : StatInterval, IEquatable<StatIntervalImpl>\n    {\n        public string ServerId { get; set; }\n\n        public VIServer Server { get; set; }\n\n        public string Name { get; set; }\n\n        public int SamplingPeriodSecs { get; set; }\n\n        public int StorageTimeSecs { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(StatIntervalImpl statIntervalImpl)\n        {\n            return (statIntervalImpl != null && this.ServerId == statIntervalImpl.ServerId && ((this.Server == null && statIntervalImpl.Server == null) || (this.Server != null && this.Server.Equals(statIntervalImpl.Server))) && this.Name == statIntervalImpl.Name && this.SamplingPeriodSecs == statIntervalImpl.SamplingPeriodSecs && this.StorageTimeSecs == statIntervalImpl.StorageTimeSecs && this.Uid == statIntervalImpl.Uid && ((this.ExtensionData == null && statIntervalImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(statIntervalImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object statIntervalImpl)\n        {\n            return Equals(statIntervalImpl as StatIntervalImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerId + \"_\" + Server + \"_\" + Name + \"_\" + SamplingPeriodSecs + \"_\" + StorageTimeSecs + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Tagging\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Tagging;\n\n    public class TagAssignmentImpl : TagAssignment, IEquatable<TagAssignmentImpl>\n    {\n        public string Uid { get; set; }\n\n        public Tag Tag { get; set; }\n\n        public VIObjectCore Entity { get; set; }\n\n        public bool Equals(TagAssignmentImpl tagAssignmentImpl)\n        {\n            return (tagAssignmentImpl != null && this.Uid == tagAssignmentImpl.Uid && ((this.Tag == null && tagAssignmentImpl.Tag == null) || (this.Tag != null && this.Tag.Equals(tagAssignmentImpl.Tag))) && ((this.Entity == null && tagAssignmentImpl.Entity == null) || (this.Entity != null && this.Entity.Equals(tagAssignmentImpl.Entity))));\n        }\n\n        public override bool Equals(object tagAssignmentImpl)\n        {\n            return Equals(tagAssignmentImpl as TagAssignmentImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Uid + \"_\" + Tag + \"_\" + Entity).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.Task\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n\n    public class TaskImpl : VMware.VimAutomation.ViCore.Types.V1.Task, VIObject, ExtensionData, IEquatable<TaskImpl>\n    {\n        public string ServerId { get; set; }\n\n        public TaskState State { get; set; }\n\n        public bool IsCancelable { get; set; }\n\n        public float PercentComplete { get; set; }\n\n        public DateTime StartTime { get; set; }\n\n        public DateTime? FinishTime { get; set; }\n\n        public string ObjectId { get; set; }\n\n        public object Result { get; set; }\n\n        public string Description { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string Id { get; set; }\n\n        public string Name { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(TaskImpl taskImpl)\n        {\n            return (taskImpl != null && this.ServerId == taskImpl.ServerId && this.State == taskImpl.State && this.IsCancelable == taskImpl.IsCancelable && this.PercentComplete == taskImpl.PercentComplete && this.StartTime == taskImpl.StartTime && this.FinishTime == taskImpl.FinishTime && this.ObjectId == taskImpl.ObjectId && ((this.Result == null && taskImpl.Result == null) || (this.Result != null && this.Result.Equals(taskImpl.Result))) && this.Description == taskImpl.Description && ((this.ExtensionData == null && taskImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(taskImpl.ExtensionData))) && this.Id == taskImpl.Id && this.Name == taskImpl.Name && this.Uid == taskImpl.Uid);\n        }\n\n        public override bool Equals(object taskImpl)\n        {\n            return Equals(taskImpl as TaskImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ServerId + \"_\" + State + \"_\" + IsCancelable + \"_\" + PercentComplete + \"_\" + StartTime + \"_\" + FinishTime + \"_\" + ObjectId + \"_\" + Result + \"_\" + Description + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.VirtualDevice\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n\n    public class PassThroughDeviceImpl : PassThroughDevice, IEquatable<PassThroughDeviceImpl>\n    {\n        public string VendorName { get; set; }\n\n        public string Name { get; set; }\n\n        public string VMId { get; set; }\n\n        public VirtualMachine VM { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public int? Key { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(PassThroughDeviceImpl passThroughDeviceImpl)\n        {\n            return (passThroughDeviceImpl != null && this.VendorName == passThroughDeviceImpl.VendorName && this.Name == passThroughDeviceImpl.Name && this.VMId == passThroughDeviceImpl.VMId && ((this.VM == null && passThroughDeviceImpl.VM == null) || (this.VM != null && this.VM.Equals(passThroughDeviceImpl.VM))) && this.VMHostId == passThroughDeviceImpl.VMHostId && ((this.VMHost == null && passThroughDeviceImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(passThroughDeviceImpl.VMHost))) && ((this.Key == null && passThroughDeviceImpl.Key == null) || (this.Key != null && this.Key.Equals(passThroughDeviceImpl.Key))) && this.Uid == passThroughDeviceImpl.Uid && ((this.ExtensionData == null && passThroughDeviceImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(passThroughDeviceImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object passThroughDeviceImpl)\n        {\n            return Equals(passThroughDeviceImpl as PassThroughDeviceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VendorName + \"_\" + Name + \"_\" + VMId + \"_\" + VM + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Key + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class PciPassthroughDeviceImpl : PassThroughDeviceImpl, PciPassthroughDevice, IEquatable<PciPassthroughDeviceImpl>\n    {\n        public int Bus { get; set; }\n\n        public int ClassId { get; set; }\n\n        public int DeviceId { get; set; }\n\n        public int Function { get; set; }\n\n        public int Slot { get; set; }\n\n        public PciPassthroughDeviceState State { get; set; }\n\n        public int VendorId { get; set; }\n\n        public bool Equals(PciPassthroughDeviceImpl pciPassthroughDeviceImpl)\n        {\n            return (pciPassthroughDeviceImpl != null && this.Bus == pciPassthroughDeviceImpl.Bus && this.ClassId == pciPassthroughDeviceImpl.ClassId && this.DeviceId == pciPassthroughDeviceImpl.DeviceId && this.Function == pciPassthroughDeviceImpl.Function && this.Slot == pciPassthroughDeviceImpl.Slot && this.State == pciPassthroughDeviceImpl.State && this.VendorId == pciPassthroughDeviceImpl.VendorId && this.Uid == pciPassthroughDeviceImpl.Uid && ((this.Key == null && pciPassthroughDeviceImpl.Key == null) || (this.Key != null && this.Key.Equals(pciPassthroughDeviceImpl.Key))) && this.Name == pciPassthroughDeviceImpl.Name && this.VendorName == pciPassthroughDeviceImpl.VendorName && this.VMId == pciPassthroughDeviceImpl.VMId && ((this.VM == null && pciPassthroughDeviceImpl.VM == null) || (this.VM != null && this.VM.Equals(pciPassthroughDeviceImpl.VM))) && this.VMHostId == pciPassthroughDeviceImpl.VMHostId && ((this.VMHost == null && pciPassthroughDeviceImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(pciPassthroughDeviceImpl.VMHost))) && ((this.ExtensionData == null && pciPassthroughDeviceImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(pciPassthroughDeviceImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object pciPassthroughDeviceImpl)\n        {\n            return Equals(pciPassthroughDeviceImpl as PciPassthroughDeviceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Bus + \"_\" + ClassId + \"_\" + DeviceId + \"_\" + Function + \"_\" + Slot + \"_\" + State + \"_\" + VendorId + \"_\" + Uid + \"_\" + Key + \"_\" + Name + \"_\" + VendorName + \"_\" + VMId + \"_\" + VM + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class ScsiPassthroughDeviceImpl : PassThroughDeviceImpl, ScsiPassthroughDevice, IEquatable<ScsiPassthroughDeviceImpl>\n    {\n        public int ControllerKey { get; set; }\n\n        public string Class { get; set; }\n\n        public int UnitNumber { get; set; }\n\n        public bool Equals(ScsiPassthroughDeviceImpl scsiPassthroughDeviceImpl)\n        {\n            return (scsiPassthroughDeviceImpl != null && this.ControllerKey == scsiPassthroughDeviceImpl.ControllerKey && this.Class == scsiPassthroughDeviceImpl.Class && this.UnitNumber == scsiPassthroughDeviceImpl.UnitNumber && ((this.Key == null && scsiPassthroughDeviceImpl.Key == null) || (this.Key != null && this.Key.Equals(scsiPassthroughDeviceImpl.Key))) && this.Name == scsiPassthroughDeviceImpl.Name && this.VendorName == scsiPassthroughDeviceImpl.VendorName && this.VMId == scsiPassthroughDeviceImpl.VMId && ((this.VM == null && scsiPassthroughDeviceImpl.VM == null) || (this.VM != null && this.VM.Equals(scsiPassthroughDeviceImpl.VM))) && this.VMHostId == scsiPassthroughDeviceImpl.VMHostId && ((this.VMHost == null && scsiPassthroughDeviceImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(scsiPassthroughDeviceImpl.VMHost))) && this.Uid == scsiPassthroughDeviceImpl.Uid && ((this.ExtensionData == null && scsiPassthroughDeviceImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(scsiPassthroughDeviceImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object scsiPassthroughDeviceImpl)\n        {\n            return Equals(scsiPassthroughDeviceImpl as ScsiPassthroughDeviceImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (ControllerKey + \"_\" + Class + \"_\" + UnitNumber + \"_\" + Key + \"_\" + Name + \"_\" + VendorName + \"_\" + VMId + \"_\" + VM + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.VM\n{\n    using System;\n    using System.Linq;\n    using VMware.Vim;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1;\n    using VMware.VimAutomation.ViCore.Impl.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Cluster;\n    using VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.RelatedObject;\n    using VMware.VimAutomation.ViCore.Types.V1.VM;\n    using VMware.VimAutomation.ViCore.Types.V1.VM.Guest;\n\n    public class SnapshotImpl : VIObjectImpl, Snapshot, IEquatable<SnapshotImpl>\n    {\n        public string Description { get; set; }\n\n        public DateTime Created { get; set; }\n\n        public bool Quiesced { get; set; }\n\n        public PowerState PowerState { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine VM { get; set; }\n\n        public string VMId { get; set; }\n\n        public Snapshot Parent { get; set; }\n\n        public string ParentSnapshotId { get; set; }\n\n        public Snapshot ParentSnapshot { get; set; }\n\n        public Snapshot[] Children { get; set; }\n\n        public decimal SizeMB { get; set; }\n\n        public decimal? SizeGB { get; set; }\n\n        public bool IsCurrent { get; set; }\n\n        public bool IsReplaySupported { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(SnapshotImpl snapshotImpl)\n        {\n            return (snapshotImpl != null && this.Description == snapshotImpl.Description && this.Created == snapshotImpl.Created && this.Quiesced == snapshotImpl.Quiesced && this.PowerState == snapshotImpl.PowerState && ((this.VM == null && snapshotImpl.VM == null) || (this.VM != null && this.VM.Equals(snapshotImpl.VM))) && this.VMId == snapshotImpl.VMId && ((this.Parent == null && snapshotImpl.Parent == null) || (this.Parent != null && this.Parent.Equals(snapshotImpl.Parent))) && this.ParentSnapshotId == snapshotImpl.ParentSnapshotId && ((this.ParentSnapshot == null && snapshotImpl.ParentSnapshot == null) || (this.ParentSnapshot != null && this.ParentSnapshot.Equals(snapshotImpl.ParentSnapshot))) && ((this.Children == null && snapshotImpl.Children == null) || (this.Children != null && snapshotImpl.Children != null && Enumerable.SequenceEqual(this.Children, snapshotImpl.Children))) && this.SizeMB == snapshotImpl.SizeMB && ((this.SizeGB == null && snapshotImpl.SizeGB == null) || (this.SizeGB != null && this.SizeGB.Equals(snapshotImpl.SizeGB))) && this.IsCurrent == snapshotImpl.IsCurrent && this.IsReplaySupported == snapshotImpl.IsReplaySupported && ((this.ExtensionData == null && snapshotImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(snapshotImpl.ExtensionData))) && this.Id == snapshotImpl.Id && this.Name == snapshotImpl.Name && this.Uid == snapshotImpl.Uid);\n        }\n\n        public override bool Equals(object snapshotImpl)\n        {\n            return Equals(snapshotImpl as SnapshotImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Description + \"_\" + Created + \"_\" + Quiesced + \"_\" + PowerState + \"_\" + VM + \"_\" + VMId + \"_\" + Parent + \"_\" + ParentSnapshotId + \"_\" + ParentSnapshot + \"_\" + Children + \"_\" + SizeMB + \"_\" + SizeGB + \"_\" + IsCurrent + \"_\" + IsReplaySupported + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Name + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class UniversalVirtualMachineImpl : InventoryItemImpl, VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine, IEquatable<UniversalVirtualMachineImpl>\n    {\n        public PowerState PowerState { get; set; }\n\n        public string Notes { get; set; }\n\n        public VMGuest Guest { get; set; }\n\n        public int NumCpu { get; set; }\n\n        public int CoresPerSocket { get; set; }\n\n        public decimal MemoryMB { get; set; }\n\n        public decimal MemoryGB { get; set; }\n\n        public string VMHostId { get; set; }\n\n        public VMHost VMHost { get; set; }\n\n        public VApp VApp { get; set; }\n\n        public string FolderId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder Folder { get; set; }\n\n        public string ResourcePoolId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool ResourcePool { get; set; }\n\n        public HARestartPriority? HARestartPriority { get; set; }\n\n        public HAIsolationResponse? HAIsolationResponse { get; set; }\n\n        public DrsAutomationLevel? DrsAutomationLevel { get; set; }\n\n        public VMSwapfilePolicy? VMSwapfilePolicy { get; set; }\n\n        public VMResourceConfiguration VMResourceConfiguration { get; set; }\n\n        public VMVersion Version { get; set; }\n\n        public string HardwareVersion { get; set; }\n\n        public string PersistentId { get; set; }\n\n        public string GuestId { get; set; }\n\n        public decimal UsedSpaceGB { get; set; }\n\n        public decimal ProvisionedSpaceGB { get; set; }\n\n        public string[] DatastoreIdList { get; set; }\n\n        public ManagedObjectReference ObtainExportLease()\n        {\n            return default(ManagedObjectReference);\n        }\n\n        public bool Equals(UniversalVirtualMachineImpl universalVirtualMachineImpl)\n        {\n            return (universalVirtualMachineImpl != null && this.Name == universalVirtualMachineImpl.Name && this.PowerState == universalVirtualMachineImpl.PowerState && this.Notes == universalVirtualMachineImpl.Notes && ((this.Guest == null && universalVirtualMachineImpl.Guest == null) || (this.Guest != null && this.Guest.Equals(universalVirtualMachineImpl.Guest))) && this.NumCpu == universalVirtualMachineImpl.NumCpu && this.CoresPerSocket == universalVirtualMachineImpl.CoresPerSocket && this.MemoryMB == universalVirtualMachineImpl.MemoryMB && this.MemoryGB == universalVirtualMachineImpl.MemoryGB && this.VMHostId == universalVirtualMachineImpl.VMHostId && ((this.VMHost == null && universalVirtualMachineImpl.VMHost == null) || (this.VMHost != null && this.VMHost.Equals(universalVirtualMachineImpl.VMHost))) && ((this.VApp == null && universalVirtualMachineImpl.VApp == null) || (this.VApp != null && this.VApp.Equals(universalVirtualMachineImpl.VApp))) && this.FolderId == universalVirtualMachineImpl.FolderId && ((this.Folder == null && universalVirtualMachineImpl.Folder == null) || (this.Folder != null && this.Folder.Equals(universalVirtualMachineImpl.Folder))) && this.ResourcePoolId == universalVirtualMachineImpl.ResourcePoolId && ((this.ResourcePool == null && universalVirtualMachineImpl.ResourcePool == null) || (this.ResourcePool != null && this.ResourcePool.Equals(universalVirtualMachineImpl.ResourcePool))) && ((this.HARestartPriority == null && universalVirtualMachineImpl.HARestartPriority == null) || (this.HARestartPriority != null && this.HARestartPriority.Equals(universalVirtualMachineImpl.HARestartPriority))) && ((this.HAIsolationResponse == null && universalVirtualMachineImpl.HAIsolationResponse == null) || (this.HAIsolationResponse != null && this.HAIsolationResponse.Equals(universalVirtualMachineImpl.HAIsolationResponse))) && ((this.DrsAutomationLevel == null && universalVirtualMachineImpl.DrsAutomationLevel == null) || (this.DrsAutomationLevel != null && this.DrsAutomationLevel.Equals(universalVirtualMachineImpl.DrsAutomationLevel))) && ((this.VMSwapfilePolicy == null && universalVirtualMachineImpl.VMSwapfilePolicy == null) || (this.VMSwapfilePolicy != null && this.VMSwapfilePolicy.Equals(universalVirtualMachineImpl.VMSwapfilePolicy))) && ((this.VMResourceConfiguration == null && universalVirtualMachineImpl.VMResourceConfiguration == null) || (this.VMResourceConfiguration != null && this.VMResourceConfiguration.Equals(universalVirtualMachineImpl.VMResourceConfiguration))) && this.Version == universalVirtualMachineImpl.Version && this.HardwareVersion == universalVirtualMachineImpl.HardwareVersion && this.PersistentId == universalVirtualMachineImpl.PersistentId && this.GuestId == universalVirtualMachineImpl.GuestId && this.UsedSpaceGB == universalVirtualMachineImpl.UsedSpaceGB && this.ProvisionedSpaceGB == universalVirtualMachineImpl.ProvisionedSpaceGB && ((this.DatastoreIdList == null && universalVirtualMachineImpl.DatastoreIdList == null) || (this.DatastoreIdList != null && universalVirtualMachineImpl.DatastoreIdList != null && Enumerable.SequenceEqual(this.DatastoreIdList, universalVirtualMachineImpl.DatastoreIdList))) && ((this.ExtensionData == null && universalVirtualMachineImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(universalVirtualMachineImpl.ExtensionData))) && this.Id == universalVirtualMachineImpl.Id && this.Uid == universalVirtualMachineImpl.Uid);\n        }\n\n        public override bool Equals(object universalVirtualMachineImpl)\n        {\n            return Equals(universalVirtualMachineImpl as UniversalVirtualMachineImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Name + \"_\" + PowerState + \"_\" + Notes + \"_\" + Guest + \"_\" + NumCpu + \"_\" + CoresPerSocket + \"_\" + MemoryMB + \"_\" + MemoryGB + \"_\" + VMHostId + \"_\" + VMHost + \"_\" + VApp + \"_\" + FolderId + \"_\" + Folder + \"_\" + ResourcePoolId + \"_\" + ResourcePool + \"_\" + HARestartPriority + \"_\" + HAIsolationResponse + \"_\" + DrsAutomationLevel + \"_\" + VMSwapfilePolicy + \"_\" + VMResourceConfiguration + \"_\" + Version + \"_\" + HardwareVersion + \"_\" + PersistentId + \"_\" + GuestId + \"_\" + UsedSpaceGB + \"_\" + ProvisionedSpaceGB + \"_\" + DatastoreIdList + \"_\" + ExtensionData + \"_\" + Id + \"_\" + Uid).GetHashCode();\n        }\n    }\n\n    public class VMDiskResourceConfigurationImpl : VMDiskResourceConfiguration, IEquatable<VMDiskResourceConfigurationImpl>\n    {\n        public int Key { get; set; }\n\n        public int NumDiskShares { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel DiskSharesLevel { get; set; }\n\n        public long? DiskLimitIOPerSecond { get; set; }\n\n        public bool Equals(VMDiskResourceConfigurationImpl vMDiskResourceConfigurationImpl)\n        {\n            return (vMDiskResourceConfigurationImpl != null && this.Key == vMDiskResourceConfigurationImpl.Key && this.NumDiskShares == vMDiskResourceConfigurationImpl.NumDiskShares && this.DiskSharesLevel == vMDiskResourceConfigurationImpl.DiskSharesLevel && ((this.DiskLimitIOPerSecond == null && vMDiskResourceConfigurationImpl.DiskLimitIOPerSecond == null) || (this.DiskLimitIOPerSecond != null && this.DiskLimitIOPerSecond.Equals(vMDiskResourceConfigurationImpl.DiskLimitIOPerSecond))));\n        }\n\n        public override bool Equals(object vMDiskResourceConfigurationImpl)\n        {\n            return Equals(vMDiskResourceConfigurationImpl as VMDiskResourceConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Key + \"_\" + NumDiskShares + \"_\" + DiskSharesLevel + \"_\" + DiskLimitIOPerSecond).GetHashCode();\n        }\n    }\n\n    public class VMQuestionImpl : VMQuestion, IEquatable<VMQuestionImpl>\n    {\n        public string VMId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine VM { get; set; }\n\n        public string QuestionId { get; set; }\n\n        public string Text { get; set; }\n\n        public VMQuestionOption[] Options { get; set; }\n\n        public VMQuestionOption DefaultOption { get; set; }\n\n        public string Uid { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VMQuestionImpl vMQuestionImpl)\n        {\n            return (vMQuestionImpl != null && this.VMId == vMQuestionImpl.VMId && ((this.VM == null && vMQuestionImpl.VM == null) || (this.VM != null && this.VM.Equals(vMQuestionImpl.VM))) && this.QuestionId == vMQuestionImpl.QuestionId && this.Text == vMQuestionImpl.Text && ((this.Options == null && vMQuestionImpl.Options == null) || (this.Options != null && vMQuestionImpl.Options != null && Enumerable.SequenceEqual(this.Options, vMQuestionImpl.Options))) && ((this.DefaultOption == null && vMQuestionImpl.DefaultOption == null) || (this.DefaultOption != null && this.DefaultOption.Equals(vMQuestionImpl.DefaultOption))) && this.Uid == vMQuestionImpl.Uid && ((this.ExtensionData == null && vMQuestionImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMQuestionImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vMQuestionImpl)\n        {\n            return Equals(vMQuestionImpl as VMQuestionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VMId + \"_\" + VM + \"_\" + QuestionId + \"_\" + Text + \"_\" + Options + \"_\" + DefaultOption + \"_\" + Uid + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VMQuestionOptionImpl : VMQuestionOption, IEquatable<VMQuestionOptionImpl>\n    {\n        public string QuestionId { get; set; }\n\n        public VMQuestion Question { get; set; }\n\n        public string OptionId { get; set; }\n\n        public string Label { get; set; }\n\n        public string Summary { get; set; }\n\n        public bool Equals(VMQuestionOptionImpl vMQuestionOptionImpl)\n        {\n            return (vMQuestionOptionImpl != null && this.QuestionId == vMQuestionOptionImpl.QuestionId && ((this.Question == null && vMQuestionOptionImpl.Question == null) || (this.Question != null && this.Question.Equals(vMQuestionOptionImpl.Question))) && this.OptionId == vMQuestionOptionImpl.OptionId && this.Label == vMQuestionOptionImpl.Label && this.Summary == vMQuestionOptionImpl.Summary);\n        }\n\n        public override bool Equals(object vMQuestionOptionImpl)\n        {\n            return Equals(vMQuestionOptionImpl as VMQuestionOptionImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (QuestionId + \"_\" + Question + \"_\" + OptionId + \"_\" + Label + \"_\" + Summary).GetHashCode();\n        }\n    }\n\n    public class VMResourceConfigurationImpl : VMResourceConfiguration, IEquatable<VMResourceConfigurationImpl>\n    {\n        public string VirtualMachineId { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine VM { get; set; }\n\n        public string VMId { get; set; }\n\n        public int NumCpuShares { get; set; }\n\n        public long CpuReservationMhz { get; set; }\n\n        public long? CpuLimitMhz { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel CpuSharesLevel { get; set; }\n\n        public int NumMemShares { get; set; }\n\n        public long MemReservationMB { get; set; }\n\n        public decimal MemReservationGB { get; set; }\n\n        public long? MemLimitMB { get; set; }\n\n        public decimal? MemLimitGB { get; set; }\n\n        public VMware.VimAutomation.ViCore.Types.V1.SharesLevel MemSharesLevel { get; set; }\n\n        public VMDiskResourceConfiguration[] DiskResourceConfiguration { get; set; }\n\n        public HTCoreSharing HTCoreSharing { get; set; }\n\n        public CpuAffinity CpuAffinity { get; set; }\n\n        public int[] CpuAffinityList { get; set; }\n\n        public string Uid { get; set; }\n\n        public bool Equals(VMResourceConfigurationImpl vMResourceConfigurationImpl)\n        {\n            return (vMResourceConfigurationImpl != null && this.VirtualMachineId == vMResourceConfigurationImpl.VirtualMachineId && ((this.VM == null && vMResourceConfigurationImpl.VM == null) || (this.VM != null && this.VM.Equals(vMResourceConfigurationImpl.VM))) && this.VMId == vMResourceConfigurationImpl.VMId && this.NumCpuShares == vMResourceConfigurationImpl.NumCpuShares && this.CpuReservationMhz == vMResourceConfigurationImpl.CpuReservationMhz && ((this.CpuLimitMhz == null && vMResourceConfigurationImpl.CpuLimitMhz == null) || (this.CpuLimitMhz != null && this.CpuLimitMhz.Equals(vMResourceConfigurationImpl.CpuLimitMhz))) && this.CpuSharesLevel == vMResourceConfigurationImpl.CpuSharesLevel && this.NumMemShares == vMResourceConfigurationImpl.NumMemShares && this.MemReservationMB == vMResourceConfigurationImpl.MemReservationMB && this.MemReservationGB == vMResourceConfigurationImpl.MemReservationGB && ((this.MemLimitMB == null && vMResourceConfigurationImpl.MemLimitMB == null) || (this.MemLimitMB != null && this.MemLimitMB.Equals(vMResourceConfigurationImpl.MemLimitMB))) && ((this.MemLimitGB == null && vMResourceConfigurationImpl.MemLimitGB == null) || (this.MemLimitGB != null && this.MemLimitGB.Equals(vMResourceConfigurationImpl.MemLimitGB))) && this.MemSharesLevel == vMResourceConfigurationImpl.MemSharesLevel && ((this.DiskResourceConfiguration == null && vMResourceConfigurationImpl.DiskResourceConfiguration == null) || (this.DiskResourceConfiguration != null && vMResourceConfigurationImpl.DiskResourceConfiguration != null && Enumerable.SequenceEqual(this.DiskResourceConfiguration, vMResourceConfigurationImpl.DiskResourceConfiguration))) && this.HTCoreSharing == vMResourceConfigurationImpl.HTCoreSharing && this.CpuAffinity == vMResourceConfigurationImpl.CpuAffinity && ((this.CpuAffinityList == null && vMResourceConfigurationImpl.CpuAffinityList == null) || (this.CpuAffinityList != null && vMResourceConfigurationImpl.CpuAffinityList != null && Enumerable.SequenceEqual(this.CpuAffinityList, vMResourceConfigurationImpl.CpuAffinityList))) && this.Uid == vMResourceConfigurationImpl.Uid);\n        }\n\n        public override bool Equals(object vMResourceConfigurationImpl)\n        {\n            return Equals(vMResourceConfigurationImpl as VMResourceConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VirtualMachineId + \"_\" + VM + \"_\" + VMId + \"_\" + NumCpuShares + \"_\" + CpuReservationMhz + \"_\" + CpuLimitMhz + \"_\" + CpuSharesLevel + \"_\" + NumMemShares + \"_\" + MemReservationMB + \"_\" + MemReservationGB + \"_\" + MemLimitMB + \"_\" + MemLimitGB + \"_\" + MemSharesLevel + \"_\" + DiskResourceConfiguration + \"_\" + HTCoreSharing + \"_\" + CpuAffinity + \"_\" + CpuAffinityList + \"_\" + Uid).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.ViCore.Impl.V1.VM.Guest\n{\n    using System;\n    using System.Linq;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Inventory;\n    using VMware.VimAutomation.ViCore.Types.V1.VirtualDevice;\n    using VMware.VimAutomation.ViCore.Types.V1.VM.Guest;\n\n    public class DiskInfoImpl : DiskInfo, IEquatable<DiskInfoImpl>\n    {\n        public string Path { get; set; }\n\n        public long Capacity { get; set; }\n\n        public decimal CapacityGB { get; set; }\n\n        public long FreeSpace { get; set; }\n\n        public decimal FreeSpaceGB { get; set; }\n\n        public bool Equals(DiskInfoImpl diskInfoImpl)\n        {\n            return (diskInfoImpl != null && this.Path == diskInfoImpl.Path && this.Capacity == diskInfoImpl.Capacity && this.CapacityGB == diskInfoImpl.CapacityGB && this.FreeSpace == diskInfoImpl.FreeSpace && this.FreeSpaceGB == diskInfoImpl.FreeSpaceGB);\n        }\n\n        public override bool Equals(object diskInfoImpl)\n        {\n            return Equals(diskInfoImpl as DiskInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Path + \"_\" + Capacity + \"_\" + CapacityGB + \"_\" + FreeSpace + \"_\" + FreeSpaceGB).GetHashCode();\n        }\n    }\n\n    public class NicInfoImpl : NicInfo, IEquatable<NicInfoImpl>\n    {\n        public bool Connected { get; set; }\n\n        public NetworkAdapter Device { get; set; }\n\n        public string[] IPAddress { get; set; }\n\n        public string MacAddress { get; set; }\n\n        public string NetworkName { get; set; }\n\n        public bool Equals(NicInfoImpl nicInfoImpl)\n        {\n            return (nicInfoImpl != null && this.Connected == nicInfoImpl.Connected && ((this.Device == null && nicInfoImpl.Device == null) || (this.Device != null && this.Device.Equals(nicInfoImpl.Device))) && ((this.IPAddress == null && nicInfoImpl.IPAddress == null) || (this.IPAddress != null && nicInfoImpl.IPAddress != null && Enumerable.SequenceEqual(this.IPAddress, nicInfoImpl.IPAddress))) && this.MacAddress == nicInfoImpl.MacAddress && this.NetworkName == nicInfoImpl.NetworkName);\n        }\n\n        public override bool Equals(object nicInfoImpl)\n        {\n            return Equals(nicInfoImpl as NicInfoImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Connected + \"_\" + Device + \"_\" + IPAddress + \"_\" + MacAddress + \"_\" + NetworkName).GetHashCode();\n        }\n    }\n\n    public class VMGuestImpl : VMGuest, IEquatable<VMGuestImpl>\n    {\n        public string OSFullName { get; set; }\n\n        public string[] IPAddress { get; set; }\n\n        public GuestState State { get; set; }\n\n        public DiskInfo[] Disks { get; set; }\n\n        public string HostName { get; set; }\n\n        public NicInfo[] Nics { get; set; }\n\n        public string VmId { get; set; }\n\n        public VirtualMachine VM { get; set; }\n\n        public string VmUid { get; set; }\n\n        public string VmName { get; set; }\n\n        public string Uid { get; set; }\n\n        public string GuestId { get; set; }\n\n        public string ConfiguredGuestId { get; set; }\n\n        public string RuntimeGuestId { get; set; }\n\n        public string ToolsVersion { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public string GuestFamily { get; set; }\n\n        public bool Equals(VMGuestImpl vMGuestImpl)\n        {\n            return (vMGuestImpl != null && this.OSFullName == vMGuestImpl.OSFullName && ((this.IPAddress == null && vMGuestImpl.IPAddress == null) || (this.IPAddress != null && vMGuestImpl.IPAddress != null && Enumerable.SequenceEqual(this.IPAddress, vMGuestImpl.IPAddress))) && this.State == vMGuestImpl.State && ((this.Disks == null && vMGuestImpl.Disks == null) || (this.Disks != null && vMGuestImpl.Disks != null && Enumerable.SequenceEqual(this.Disks, vMGuestImpl.Disks))) && this.HostName == vMGuestImpl.HostName && ((this.Nics == null && vMGuestImpl.Nics == null) || (this.Nics != null && vMGuestImpl.Nics != null && Enumerable.SequenceEqual(this.Nics, vMGuestImpl.Nics))) && this.VmId == vMGuestImpl.VmId && ((this.VM == null && vMGuestImpl.VM == null) || (this.VM != null && this.VM.Equals(vMGuestImpl.VM))) && this.VmUid == vMGuestImpl.VmUid && this.VmName == vMGuestImpl.VmName && this.Uid == vMGuestImpl.Uid && this.GuestId == vMGuestImpl.GuestId && this.ConfiguredGuestId == vMGuestImpl.ConfiguredGuestId && this.RuntimeGuestId == vMGuestImpl.RuntimeGuestId && this.ToolsVersion == vMGuestImpl.ToolsVersion && ((this.ExtensionData == null && vMGuestImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vMGuestImpl.ExtensionData))) && this.GuestFamily == vMGuestImpl.GuestFamily);\n        }\n\n        public override bool Equals(object vMGuestImpl)\n        {\n            return Equals(vMGuestImpl as VMGuestImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (OSFullName + \"_\" + IPAddress + \"_\" + State + \"_\" + Disks + \"_\" + HostName + \"_\" + Nics + \"_\" + VmId + \"_\" + VM + \"_\" + VmUid + \"_\" + VmName + \"_\" + Uid + \"_\" + GuestId + \"_\" + ConfiguredGuestId + \"_\" + RuntimeGuestId + \"_\" + ToolsVersion + \"_\" + ExtensionData + \"_\" + GuestFamily).GetHashCode();\n        }\n    }\n}\n\nnamespace VMware.VimAutomation.Vds.Types.V1\n{\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking;\n\n    public enum LinkDiscoveryOperation\n    {\n        Advertise,\n        Both,\n        Listen,\n        None\n    }\n\n    public enum LinkDiscoveryProtocol\n    {\n        CDP,\n        LLDP\n    }\n\n    public enum VlanType\n    {\n        None,\n        Vlan,\n        Trunk,\n        PrivateVlan,\n        Unknown\n    }\n\n    public interface VDPortGroup\n    {\n        string Id { get; set; }\n\n        string Uid { get; set; }\n\n        string Name { get; set; }\n\n        string Notes { get; set; }\n\n        int NumPorts { get; set; }\n\n        DistributedPortGroupPortBinding PortBinding { get; set; }\n\n        VDSwitch VDSwitch { get; set; }\n\n        VlanConfiguration VlanConfiguration { get; set; }\n\n        object ExtensionData { get; set; }\n    }\n\n    public interface VDSwitch\n    {\n        string Id { get; set; }\n\n        string Uid { get; set; }\n\n        string Name { get; set; }\n\n        string Version { get; set; }\n\n        int Mtu { get; set; }\n\n        int NumUplinkPorts { get; set; }\n\n        int MaxPorts { get; set; }\n\n        string ContactDetails { get; set; }\n\n        string ContactName { get; set; }\n\n        string Notes { get; set; }\n\n        LinkDiscoveryOperation LinkDiscoveryProtocolOperation { get; set; }\n\n        LinkDiscoveryProtocol LinkDiscoveryProtocol { get; set; }\n\n        object ExtensionData { get; set; }\n    }\n\n    public interface VlanConfiguration\n    {\n        VlanType VlanType { get; set; }\n    }\n\n    public interface SingleVlanConfiguration : VlanConfiguration\n    {\n        int VlanId { get; set; }\n    }\n}\n\nnamespace VMware.VimAutomation.Vds.Impl.V1\n{\n    using System;\n    using VMware.VimAutomation.Sdk.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1;\n    using VMware.VimAutomation.ViCore.Types.V1.Host.Networking;\n    using VMware.VimAutomation.Vds.Types.V1;\n\n    public class SingleVlanConfigurationImpl : SingleVlanConfiguration, IEquatable<SingleVlanConfigurationImpl>\n    {\n        public VlanType VlanType { get; set; }\n        \n        public int VlanId { get; set; }\n\n        public bool Equals(SingleVlanConfigurationImpl singleVlanConfigurationImpl)\n        {\n            return (singleVlanConfigurationImpl != null && this.VlanType == singleVlanConfigurationImpl.VlanType && this.VlanId == singleVlanConfigurationImpl.VlanId);\n        }\n\n        public override bool Equals(object singleVlanConfigurationImpl)\n        {\n            return Equals(singleVlanConfigurationImpl as SingleVlanConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (VlanType + \"_\" + VlanId).GetHashCode();\n        }\n    }\n\n    public class VlanConfigurationImpl : VlanConfiguration, IEquatable<VlanConfigurationImpl>\n    {\n        public VlanType VlanType { get; set; }\n\n        public bool Equals(VlanConfigurationImpl vlanConfigurationImpl)\n        {\n            return (vlanConfigurationImpl != null && this.VlanType == vlanConfigurationImpl.VlanType);\n        }\n\n        public override bool Equals(object vlanConfigurationImpl)\n        {\n            return Equals(vlanConfigurationImpl as VlanConfigurationImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return VlanType.GetHashCode();\n        }\n    }\n\n    public class VmwareVDPortgroupImpl : VDPortGroup, VIObject, VIObjectCore, ExtensionData, IEquatable<VmwareVDPortgroupImpl>\n    {\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Name { get; set; }\n\n        public string Notes { get; set; }\n\n        public int NumPorts { get; set; }\n\n        public DistributedPortGroupPortBinding PortBinding { get; set; }\n\n        public VDSwitch VDSwitch { get; set; }\n\n        public VlanConfiguration VlanConfiguration { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VmwareVDPortgroupImpl vmwareVDPortgroupImpl)\n        {\n            return (vmwareVDPortgroupImpl != null && this.Id == vmwareVDPortgroupImpl.Id && this.Uid == vmwareVDPortgroupImpl.Uid && this.Name == vmwareVDPortgroupImpl.Name && this.Notes == vmwareVDPortgroupImpl.Notes && this.NumPorts == vmwareVDPortgroupImpl.NumPorts && this.PortBinding == vmwareVDPortgroupImpl.PortBinding && ((this.VDSwitch == null && vmwareVDPortgroupImpl.VDSwitch == null) || (this.VDSwitch != null && this.VDSwitch.Equals(vmwareVDPortgroupImpl.VDSwitch))) && ((this.VlanConfiguration == null && vmwareVDPortgroupImpl.VlanConfiguration == null) || (this.VlanConfiguration != null && this.VlanConfiguration.Equals(vmwareVDPortgroupImpl.VlanConfiguration))) && ((this.ExtensionData == null && vmwareVDPortgroupImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vmwareVDPortgroupImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vmwareVDPortgroupImpl)\n        {\n            return Equals(vmwareVDPortgroupImpl as VmwareVDPortgroupImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Uid + \"_\" + Name + \"_\" + Notes + \"_\" + NumPorts + \"_\" + PortBinding + \"_\" + VDSwitch + \"_\" + VlanConfiguration + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n\n    public class VmwareVDSwitchImpl : VDSwitch, VIObject, VIObjectCore, ExtensionData, IEquatable<VmwareVDSwitchImpl>\n    {\n        public string Id { get; set; }\n\n        public string Uid { get; set; }\n\n        public string Name { get; set; }\n\n        public string Version { get; set; }\n\n        public int Mtu { get; set; }\n\n        public int NumUplinkPorts { get; set; }\n\n        public int MaxPorts { get; set; }\n\n        public string ContactDetails { get; set; }\n\n        public string ContactName { get; set; }\n\n        public string Notes { get; set; }\n\n        public LinkDiscoveryOperation LinkDiscoveryProtocolOperation { get; set; }\n\n        public LinkDiscoveryProtocol LinkDiscoveryProtocol { get; set; }\n\n        public object ExtensionData { get; set; }\n\n        public bool Equals(VmwareVDSwitchImpl vmwareVDSwitchImpl)\n        {\n            return (vmwareVDSwitchImpl != null && this.Id == vmwareVDSwitchImpl.Id && this.Uid == vmwareVDSwitchImpl.Uid && this.Name == vmwareVDSwitchImpl.Name && this.Version == vmwareVDSwitchImpl.Version && this.Mtu == vmwareVDSwitchImpl.Mtu && this.NumUplinkPorts == vmwareVDSwitchImpl.NumUplinkPorts && this.MaxPorts == vmwareVDSwitchImpl.MaxPorts && this.ContactDetails == vmwareVDSwitchImpl.ContactDetails && this.ContactName == vmwareVDSwitchImpl.ContactName && this.Notes == vmwareVDSwitchImpl.Notes && this.LinkDiscoveryProtocolOperation == vmwareVDSwitchImpl.LinkDiscoveryProtocolOperation && this.LinkDiscoveryProtocol == vmwareVDSwitchImpl.LinkDiscoveryProtocol && ((this.ExtensionData == null && vmwareVDSwitchImpl.ExtensionData == null) || (this.ExtensionData != null && this.ExtensionData.Equals(vmwareVDSwitchImpl.ExtensionData))));\n        }\n\n        public override bool Equals(object vmwareVDSwitchImpl)\n        {\n            return Equals(vmwareVDSwitchImpl as VmwareVDSwitchImpl);\n        }\n\n        public override int GetHashCode()\n        {\n            return (Id + \"_\" + Uid + \"_\" + Name + \"_\" + Version + \"_\" + Mtu + \"_\" + NumUplinkPorts + \"_\" + MaxPorts + \"_\" + ContactDetails + \"_\" + ContactName + \"_\" + Notes + \"_\" + LinkDiscoveryProtocolOperation + \"_\" + LinkDiscoveryProtocol + \"_\" + ExtensionData).GetHashCode();\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/VMware.VimAutomation.Core/VMware.VimAutomation.Core.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'VMware.VimAutomation.Core.psm1'\n\n# Version number of this module.\nModuleVersion = '1.0'\n\n# ID used to uniquely identify this module\nGUID = '6045d3c7-4857-4701-81d7-14ffec4113e4'\n\n# Author of this module\nAuthor = 'VMware'\n\n# Company or vendor of this module\nCompanyName = 'VMware'\n\n# Copyright statement for this module\nCopyright = '(c) 2018-2020 VMware. All rights reserved.'\n\n# Description of the functionality provided by this module\nDescription = 'PowerShell Module containing VMware.VimAutomation.Core types and methods for testing purposes.'\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.1'\n\n# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.\nFunctionsToExport = '*'\n\n# Variables to export from this module\nVariablesToExport = '*'\n\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/TestHelpers/VMware.VimAutomation.Core/VMware.VimAutomation.Core.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\nMocked PowerCLI Types for the purpose of unit testing.\n#>\nAdd-Type -Path \"$($env:PSModulePath)/VMware.VimAutomation.Core/PowerCLITypes.cs\"\n\nfunction Add-VDSwitchPhysicalNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]]\n        $VMHostPhysicalNic,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        $DistributedSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        $VirtualNicPortgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]]\n        $VMHostVirtualNic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Add-VDSwitchVMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDSwitch]\n        $VDSwitch,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Get-VDPortgroup {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.NetworkAdapter[]]\n        $NetworkAdapter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDSwitch[]]\n        $VDSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]]\n        $VMHostNetworkAdapter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-VDSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.FolderContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Related\", ValueFromPipeline = $true)]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction New-VDPortgroup {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromBackup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDSwitch]\n        $VDSwitch,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Notes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [int]\n        $NumPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [int]\n        $VlanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        $VlanTrunkRange,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.DistributedPortGroupPortBinding]\n        $PortBinding,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ReferencePortgroup\", ValueFromPipeline = $true)]\n        $ReferencePortgroup,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [string]\n        $BackupPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $KeepIdentifiers\n    )\n\n    return $null\n}\n\nfunction New-VDSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $ContactDetails,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $ContactName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[VMware.VimAutomation.Vds.Types.V1.LinkDiscoveryProtocol]]\n        $LinkDiscoveryProtocol,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[VMware.VimAutomation.Vds.Types.V1.LinkDiscoveryOperation]]\n        $LinkDiscoveryProtocolOperation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $MaxPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $Mtu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Notes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $NumUplinkPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Version,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $true)]\n        $ReferenceVDSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CopyFromReferenceSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $WithoutPortGroups,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [string]\n        $BackupPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $KeepIdentifiers\n    )\n\n    return $null\n}\n\nfunction Remove-VDPortGroup {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDPortgroup[]]\n        $VDPortGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VDSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDSwitch[]]\n        $VDSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VDSwitchVMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDSwitch]\n        $VDSwitch,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VDPortgroup {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Notes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [int]\n        $NumPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [int]\n        $VlanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        $VlanTrunkRange,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [int]\n        $PrivateVlanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.DistributedPortGroupPortBinding]\n        $PortBinding,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $DisableVlan,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Rollback\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromBackup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDPortgroup[]]\n        $VDPortgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Rollback\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Rollback\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Rollback\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Rollback\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Rollback\", ValueFromPipeline = $false)]\n        [switch]\n        $RollbackConfiguration,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [string]\n        $BackupPath\n    )\n\n    return $null\n}\n\nfunction Set-VDSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $ContactDetails,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $ContactName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[VMware.VimAutomation.Vds.Types.V1.LinkDiscoveryProtocol]]\n        $LinkDiscoveryProtocol,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[VMware.VimAutomation.Vds.Types.V1.LinkDiscoveryOperation]]\n        $LinkDiscoveryProtocolOperation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $MaxPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $Mtu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Notes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $NumUplinkPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Version,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RollBack\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDSwitch[]]\n        $VDSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RollBack\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RollBack\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RollBack\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RollBack\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [string]\n        $BackupPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromBackup\", ValueFromPipeline = $false)]\n        [switch]\n        $WithoutPortGroups,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RollBack\", ValueFromPipeline = $false)]\n        [switch]\n        $RollBackConfiguration\n    )\n\n    return $null\n}\n\nfunction Set-VDVlanConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Vds.Types.V1.VDPortgroup[]]\n        $VDPortgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [int]\n        $VlanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $DisableVlan,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Add-PassthroughDevice {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.PassThroughDevice[]]\n        $PassthroughDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Add-VirtualSwitchPhysicalNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]]\n        $VMHostPhysicalNic,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        $VirtualNicPortgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]]\n        $VMHostVirtualNic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Add-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $Port,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [pscredential]\n        $Credential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Add-VMHostNtpServer {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $NtpServer,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Connect-VIServer {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $false)]\n        [string[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $false)]\n        [int]\n        $Port,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $false)]\n        [string]\n        $Protocol,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [pscredential]\n        $Credential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Session,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $false)]\n        [switch]\n        $NotDefault,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $SaveCredentials,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $false)]\n        [switch]\n        $AllLinked,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        #[Parameter(Mandatory = $true, ParameterSetName = \"SamlSecurityContext\", ValueFromPipeline = $true)]\n        #[VMware.VimAutomation.Common.Types.V1.Authentication.SamlSecurityContext]\n        #$SamlSecurityContext,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Menu\", ValueFromPipeline = $false)]\n        [switch]\n        $Menu\n    )\n\n    return $null\n}\n\nfunction Copy-DatastoreItem {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [System.Object[]]\n        $Item,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Object]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $PassThru,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Recurse,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Copy-HardDisk {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk[]]\n        $HardDisk,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $DestinationPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $DestinationStorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Copy-VMGuestFile {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [string[]]\n        $Source,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [string]\n        $Destination,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [switch]\n        $GuestToLocal,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [pscredential]\n        $HostCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [string]\n        $HostUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [securestring]\n        $HostPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [pscredential]\n        $GuestCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [string]\n        $GuestUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [securestring]\n        $GuestPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [int]\n        $ToolsWaitSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GuestToLocal\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"LocalToGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $LocalToGuest\n    )\n\n    return $null\n}\n\nfunction Disconnect-VIServer {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Dismount-Tools {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Export-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"ExportVApp\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [string]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp[]]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VAppStorageFormat]\n        $Format,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [switch]\n        $CreateSeparateFolder,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVApp\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ExportVM\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM\n    )\n\n    return $null\n}\n\nfunction Export-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $FilePath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Format-VMHostDiskPartition {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VolumeName,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.VMHostDiskPartition[]]\n        $VMHostDiskPartition,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Get-AdvancedSetting {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-AlarmAction {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmDefinition[]]\n        $AlarmDefinition,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.ActionType[]]\n        $ActionType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-AlarmActionTrigger {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmAction[]]\n        $AlarmAction\n    )\n\n    return $null\n}\n\nfunction Get-AlarmDefinition {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-Annotation {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttribute[]]\n        $CustomAttribute,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name\n    )\n\n    return $null\n}\n\nfunction Get-CDDrive {\n    [CmdletBinding(DefaultParameterSetName = \"VirtualDeviceGetter\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name\n    )\n\n    return $null\n}\n\nfunction Get-Cluster {\n    [CmdletBinding(DefaultParameterSetName = \"Location\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ExternalRelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.ClusterRelatedObjectBase[]]\n        $RelatedObject,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-ContentLibraryItem {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $ItemType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-CustomAttribute {\n    [CmdletBinding(DefaultParameterSetName = \"GetByMoRef\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttributeTargetType[]]\n        $TargetType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $false)]\n        [switch]\n        $Global,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-Datacenter {\n    [CmdletBinding(DefaultParameterSetName = \"Location\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Location\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ExternalRelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.DatacenterRelatedObjectBase[]]\n        $RelatedObject,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-Datastore {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.DatastoreRelatedObjectBase[]]\n        [Alias('VMHost')]\n        $RelatedObject,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [switch]\n        $Refresh,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-DatastoreCluster {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.DatastoreClusterRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-DrsClusterGroup {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterGroupType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost\n    )\n\n    return $null\n}\n\nfunction Get-DrsRecommendation {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Refresh,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int[]]\n        $Priority,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-DrsRule {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostRule\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostRule\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostRule\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.ResourceSchedulingRuleType[]]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostRule\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostRule\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost\n    )\n\n    return $null\n}\n\nfunction Get-DrsVMHostRule {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsVMHostRuleType[]]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterVMGroup[]]\n        $VMGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterVMHostGroup[]]\n        $VMHostGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-EsxCli {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $V2,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-EsxTop {\n    [CmdletBinding(DefaultParameterSetName = \"CounterValues\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"CounterValues\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Counter\", ValueFromPipeline = $false)]\n        [string[]]\n        $CounterName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CounterValues\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Counter\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TopologyInfo\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Counter\", ValueFromPipeline = $false)]\n        [switch]\n        $Counter,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"TopologyInfo\", ValueFromPipeline = $false)]\n        [switch]\n        $TopologyInfo,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"TopologyInfo\", ValueFromPipeline = $false)]\n        [string[]]\n        $Topology\n    )\n\n    return $null\n}\n\nfunction Get-FloppyDrive {\n    [CmdletBinding(DefaultParameterSetName = \"VirtualDeviceGetter\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name\n    )\n\n    return $null\n}\n\nfunction Get-Folder {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.FolderType[]]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.FolderRelatedObjectBase[]]\n        $RelatedObject,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-HAPrimaryVMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-HardDisk {\n    [CmdletBinding(DefaultParameterSetName = \"ProviderPath\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProviderPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastorePath\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProviderPath\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.DatastoreItem[]]\n        $Path,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProviderPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastorePath\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.DiskType[]]\n        $DiskType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProviderPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastorePath\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.HardDiskRelatedObjectBase[]]\n        $RelatedObject,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastorePath\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastorePath\", ValueFromPipeline = $false)]\n        [string[]]\n        $DatastorePath\n    )\n\n    return $null\n}\n\nfunction Get-Inventory {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-IScsiHbaTarget {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHba[]]\n        $IScsiHba,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHbaTargetType[]]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $IPEndPoint,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-KmsCluster {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-Log {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"logSet\", ValueFromPipeline = $true)]\n        [string[]]\n        $Key,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"logSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"logBundleSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"logSet\", ValueFromPipeline = $false)]\n        [int]\n        $StartLineNum,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"logSet\", ValueFromPipeline = $false)]\n        [int]\n        $NumLines,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"logSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"logBundleSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"logBundleSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Bundle,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"logBundleSet\", ValueFromPipeline = $false)]\n        [string]\n        $DestinationPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"logBundleSet\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync\n    )\n\n    return $null\n}\n\nfunction Get-LogType {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-NetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"VirtualDeviceGetter\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.NetworkAdapterRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-NfsUser {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Username,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-NicTeamingPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch[]]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"pg\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup[]]\n        $VirtualPortGroup\n    )\n\n    return $null\n}\n\nfunction Get-OSCustomizationNicMapping {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec[]]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-OSCustomizationSpec {\n    [CmdletBinding(DefaultParameterSetName = \"DefaultSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpecType]\n        $Type\n    )\n\n    return $null\n}\n\nfunction Get-OvfConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"Ovf\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Ovf\", ValueFromPipeline = $false)]\n        [string]\n        $Ovf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Ovf\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-PassthroughDevice {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.PassthroughDeviceType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-PowerCLIConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.ConfigurationScope]\n        $Scope\n    )\n\n    return $null\n}\n\nfunction Get-PowerCLIVersion {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n    )\n\n    return $null\n}\n\nfunction Get-ResourcePool {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByChildVm\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByChildVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByChildVm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ByChildVm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.ResourcePoolRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-ScsiController {\n    [CmdletBinding(DefaultParameterSetName = \"VirtualDeviceGetter\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk[]]\n        $HardDisk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name\n    )\n\n    return $null\n}\n\nfunction Get-ScsiLun {\n    [CmdletBinding(DefaultParameterSetName = \"HostParameterSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HbaParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastoreParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $CanonicalName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VmHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HbaParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastoreParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $Key,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HbaParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastoreParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $LunType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"IdParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HbaParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastoreParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IdParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HbaParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Hba[]]\n        $Hba,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DatastoreParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]]\n        $Datastore\n    )\n\n    return $null\n}\n\nfunction Get-ScsiLunPath {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLun[]]\n        $ScsiLun\n    )\n\n    return $null\n}\n\nfunction Get-SecurityPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch[]]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"portgroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup[]]\n        $VirtualPortGroup\n    )\n\n    return $null\n}\n\nfunction Get-Snapshot {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-Stat {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Common,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Memory,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Cpu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Disk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Network,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Stat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [datetime]\n        $Start,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [datetime]\n        $Finish,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $MaxSamples,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int[]]\n        $IntervalMins,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int[]]\n        $IntervalSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Instance,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Realtime,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-StatInterval {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int[]]\n        $SamplingPeriodSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-StatType {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [datetime]\n        $Start,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [datetime]\n        $Finish,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Stat.StatInterval[]]\n        $Interval,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Realtime,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-Tag {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagCategory[]]\n        $Category,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-TagAssignment {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObjectCore[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagCategory[]]\n        $Category,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-TagCategory {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-Task {\n    [CmdletBinding(DefaultParameterSetName = \"default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.TaskState]\n        $Status,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIConnection[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-Template {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-UsbDevice {\n    [CmdletBinding(DefaultParameterSetName = \"VirtualDeviceGetter\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualDeviceGetter\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name\n    )\n\n    return $null\n}\n\nfunction Get-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-VIAccount {\n    [CmdletBinding(DefaultParameterSetName = \"Name\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Id\", ValueFromPipeline = $false)]\n        [switch]\n        $Group,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Id\", ValueFromPipeline = $false)]\n        [switch]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Name\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Id\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Id\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Id\", ValueFromPipeline = $false)]\n        [string]\n        $Domain\n    )\n\n    return $null\n}\n\nfunction Get-VICredentialStoreItem {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Host,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $File\n    )\n\n    return $null\n}\n\nfunction Get-VIEvent {\n    [CmdletBinding(DefaultParameterSetName = \"DefaultSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [System.Nullable[datetime]]\n        $Start,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [System.Nullable[datetime]]\n        $Finish,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string]\n        $Username,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [int]\n        $MaxSamples,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.EventCategory[]]\n        $Types,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-View {\n    [CmdletBinding(DefaultParameterSetName = \"GetViewByVIObject\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetViewByVIObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject[]]\n        $VIObject,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetViewByVIObject\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetView\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetEntity\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetViewByRelatedObject\", ValueFromPipeline = $false)]\n        [string[]]\n        $Property,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetView\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetEntity\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetView\", ValueFromPipeline = $false)]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetEntity\", ValueFromPipeline = $false)]\n        [VMware.Vim.ManagedObjectReference]\n        $SearchRoot,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetEntity\", ValueFromPipeline = $false)]\n        [type]\n        $ViewType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetEntity\", ValueFromPipeline = $false)]\n        [hashtable]\n        $Filter,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetViewByRelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.ViewBaseMirroredObject[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-VIObjectByVIView {\n    [CmdletBinding(DefaultParameterSetName = \"GetByVIVIew\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetByVIVIew\", ValueFromPipeline = $true)]\n        [VMware.Vim.ViewBase[]]\n        $VIView,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"GetByMoRef\", ValueFromPipeline = $true)]\n        [VMware.Vim.ManagedObjectReference[]]\n        $MORef\n    )\n\n    return $null\n}\n\nfunction Get-VIPermission {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.VIAccount[]]\n        $Principal,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VIPrivilege {\n    [CmdletBinding(DefaultParameterSetName = \"Server\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Server\", ValueFromPipeline = $false)]\n        [switch]\n        $PrivilegeGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Server\", ValueFromPipeline = $false)]\n        [switch]\n        $PrivilegeItem,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Server\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Role\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Server\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Role\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Server\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Role\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Role[]]\n        $Role,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.PrivilegeGroup[]]\n        $Group\n    )\n\n    return $null\n}\n\nfunction Get-VIProperty {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $ObjectType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeclaredOnly\n    )\n\n    return $null\n}\n\nfunction Get-VIRole {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VirtualPortGroup {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitchBase[]]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter[]]\n        $Datacenter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Standard,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Distributed,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObjectParamSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.VirtualPortGroupRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-VirtualSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter[]]\n        $Datacenter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Standard,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Distributed,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObjectParamSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.VirtualSwitchRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-VM {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitchBase[]]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.VmRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-VMGuest {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $NoRecursion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostState[]]\n        $State,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer[]]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DistributedSwitch\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.DistributedSwitch[]]\n        $DistributedSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecondaryParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool[]]\n        $ResourcePool,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RelatedObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.RelatedObject.VMHostRelatedObjectBase[]]\n        $RelatedObject\n    )\n\n    return $null\n}\n\nfunction Get-VMHostAccount {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Group,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostAdvancedConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostAuthentication {\n    [CmdletBinding(DefaultParameterSetName = \"default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-VMHostAvailableTimeZone {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostDiagnosticPartition {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $All,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostDisk {\n    [CmdletBinding(DefaultParameterSetName = \"vmhost\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"vmhost\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"vmhost\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"scsilun\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLun[]]\n        $ScsiLun\n    )\n\n    return $null\n}\n\nfunction Get-VMHostDiskPartition {\n    [CmdletBinding(DefaultParameterSetName = \"byVMHostDisk\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"byVMHostDisk\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.VMHostDisk[]]\n        $VMHostDisk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostFirewallDefaultPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostFirewallException {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int[]]\n        $Port,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostFirmware {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [switch]\n        $BackupConfiguration,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [string]\n        $DestinationPath\n    )\n\n    return $null\n}\n\nfunction Get-VMHostHardware {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [switch]\n        $WaitForAllData,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [switch]\n        $SkipCACheck,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [switch]\n        $SkipCNCheck,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [switch]\n        $SkipRevocationCheck,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [switch]\n        $SkipAllSslCertificateChecks,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"GetById\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-VMHostHba {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Device,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.HbaType[]]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostModule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostNetwork {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost\n    )\n\n    return $null\n}\n\nfunction Get-VMHostNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        $PortGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Physical,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $VMKernel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Console,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostNtpServer {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostPatch {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostPciDevice {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.PciDeviceClass[]]\n        $DeviceClass,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $ReferenceHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostProfileImageCacheConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $HostProfile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostProfileRequiredInput {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [hashtable]\n        $Variable,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Inapplicable,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostProfileStorageDeviceConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $HostProfile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $DeviceName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostProfileUserConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $HostProfile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $UserName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostProfileVmPortGroupConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $HostProfile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $PortGroupName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostRoute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostService {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Refresh,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostSnmp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostStartPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMHostStorage {\n    [CmdletBinding(DefaultParameterSetName = \"default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [switch]\n        $Refresh,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [switch]\n        $RescanAllHba,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [switch]\n        $RescanVmfs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"byId\", ValueFromPipeline = $false)]\n        [string[]]\n        $Id\n    )\n\n    return $null\n}\n\nfunction Get-VMHostSysLogServer {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMQuestion {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $QuestionText,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $QuestionId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Get-VMResourceConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM\n    )\n\n    return $null\n}\n\nfunction Get-VMStartPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Import-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Source,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [hashtable]\n        $OvfConfiguration,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.FolderContainer]\n        $InventoryLocation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $DiskStorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Import-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $FilePath,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $ReferenceHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Install-VMHostPatch {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostPath\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WebPath\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"HostPath\", ValueFromPipeline = $false)]\n        [string[]]\n        $HostPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WebPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WebPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WebPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HostPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WebPath\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"WebPath\", ValueFromPipeline = $false)]\n        [string[]]\n        $WebPath,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [string[]]\n        $LocalPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [string]\n        $HostUsername,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [securestring]\n        $HostPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"LocalPath\", ValueFromPipeline = $false)]\n        [pscredential]\n        $HostCredential\n    )\n\n    return $null\n}\n\nfunction Invoke-DrsRecommendation {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    [Alias('Apply-DrsRecommendation')]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsRecommendation[]]\n        $DrsRecommendation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Invoke-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [hashtable]\n        $Variable,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $AssociateOnly,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $ApplyOnly,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Invoke-VMScript {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ScriptText,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [pscredential]\n        $HostCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $HostUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [securestring]\n        $HostPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [pscredential]\n        $GuestCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $GuestUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [securestring]\n        $GuestPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $ToolsWaitSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.ScriptType]\n        $ScriptType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Mount-Tools {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Move-Cluster {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-Datacenter {\n    [CmdletBinding(DefaultParameterSetName = \"MoveDatacenterSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"MoveDatacenterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter[]]\n        $Datacenter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MoveDatacenterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MoveDatacenterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MoveDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MoveDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MoveDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-Datastore {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-Folder {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder[]]\n        $Folder,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-HardDisk {\n    [CmdletBinding(DefaultParameterSetName = \"UpdateHardDisk\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk[]]\n        $HardDisk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $StorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-Inventory {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]]\n        $Item,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-ResourcePool {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool[]]\n        $ResourcePool,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-Template {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp[]]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-VM {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AdvancedOption[]]\n        $AdvancedOption,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $DiskStorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VMotionPriority]\n        $VMotionPriority,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.NetworkAdapter[]]\n        $NetworkAdapter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroupBase[]]\n        $PortGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.FolderContainer]\n        $InventoryLocation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Move-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-AdvancedSetting {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Object]\n        $Value,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObject]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AdvancedSettingType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-AlarmAction {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"email\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"script\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"snmp\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmDefinition]\n        $AlarmDefinition,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [switch]\n        $Email,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [string]\n        $Subject,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [string[]]\n        $To,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [string[]]\n        $Cc,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [string]\n        $Body,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"script\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"snmp\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"script\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"snmp\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"email\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"script\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"snmp\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"script\", ValueFromPipeline = $false)]\n        [switch]\n        $Script,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"script\", ValueFromPipeline = $false)]\n        [string]\n        $ScriptPath,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"snmp\", ValueFromPipeline = $false)]\n        [switch]\n        $Snmp\n    )\n\n    return $null\n}\n\nfunction New-AlarmActionTrigger {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItemStatus]\n        $StartStatus,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItemStatus]\n        $EndStatus,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmAction]\n        $AlarmAction,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Repeat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-CDDrive {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $IsoPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $HostDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $StartConnected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryIso\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryIso\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryIso\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryIso\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryIso\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.ContentLibrary.ContentLibraryItem]\n        $ContentLibraryIso\n    )\n\n    return $null\n}\n\nfunction New-Cluster {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HARestartPriority]\n        $HARestartPriority,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HAIsolationResponse]\n        $HAIsolationResponse,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VMSwapfilePolicy]\n        $VMSwapfilePolicy,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $HAEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $HAAdmissionControlEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $HAFailoverLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DrsEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsMode]\n        $DrsMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsAutomationLevel]\n        $DrsAutomationLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Vsan.VsanDiskClaimMode]\n        $VsanDiskClaimMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $VsanEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $EVCMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-CustomAttribute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttributeTargetType[]]\n        $TargetType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-Datacenter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-Datastore {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [string]\n        $Path,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [switch]\n        $Nfs,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [string[]]\n        $NfsHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [switch]\n        $ReadOnly,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [switch]\n        $Kerberos,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [string]\n        $FileSystemVersion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NFS\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [switch]\n        $Vmfs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMFS\", ValueFromPipeline = $false)]\n        [int]\n        $BlockSizeMB\n    )\n\n    return $null\n}\n\nfunction New-DatastoreCluster {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-DrsClusterGroup {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost\n    )\n\n    return $null\n}\n\nfunction New-DrsRule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $KeepTogether,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-DrsVMHostRule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterVMGroup]\n        $VMGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterVMHostGroup]\n        $VMHostGroup,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsVMHostRuleType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-FloppyDrive {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $FloppyImagePath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $NewFloppyImagePath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $HostDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $StartConnected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-Folder {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-HardDisk {\n    [CmdletBinding(DefaultParameterSetName = \"CreateNew\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AdvancedOption[]]\n        $AdvancedOption,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"UseExisting\", ValueFromPipeline = $false)]\n        [string]\n        $Persistence,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"UseExisting\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"AttachVDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiController]\n        $Controller,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.DiskType]\n        $DiskType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [long]\n        $CapacityKB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [decimal]\n        $CapacityGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [switch]\n        $Split,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [switch]\n        $ThinProvisioned,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $StorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [string]\n        $DeviceName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Security.KmsCluster]\n        $KmsCluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.StoragePolicy]\n        $StoragePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"UseExisting\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"AttachVDisk\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"UseExisting\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"AttachVDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"UseExisting\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"AttachVDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CreateNew\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"UseExisting\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"AttachVDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"UseExisting\", ValueFromPipeline = $false)]\n        [string]\n        $DiskPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"AttachVDisk\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.VDisk.VDisk]\n        $VDisk\n    )\n\n    return $null\n}\n\nfunction New-IScsiHbaTarget {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHba]\n        $IScsiHba,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Address,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $Port,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHbaTargetType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $IScsiName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.ChapType]\n        $ChapType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ChapName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ChapPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $MutualChapEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $MutualChapName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $MutualChapPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritChap,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritMutualChap,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-NetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [string]\n        $MacAddress,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $NetworkName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $StartConnected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $WakeOnLan,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualNetworkAdapterType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [string]\n        $PortId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Advanced\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.DistributedSwitch]\n        $DistributedSwitch,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroupBase]\n        $Portgroup\n    )\n\n    return $null\n}\n\nfunction New-NfsUser {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Username,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [pscredential]\n        $Credential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-OSCustomizationNicMapping {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationIPMode]\n        $IpMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string]\n        $VCApplicationArgument,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string]\n        $IpAddress,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string]\n        $SubnetMask,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string]\n        $DefaultGateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string]\n        $AlternateGateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string[]]\n        $Dns,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [string[]]\n        $Wins,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string[]]\n        $NetworkAdapterMac,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [int[]]\n        $Position\n    )\n\n    return $null\n}\n\nfunction New-OSCustomizationSpec {\n    [CmdletBinding(DefaultParameterSetName = \"Linux\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $OSType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Cloning\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Cloning\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Cloning\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpecType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $DnsServer,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $DnsSuffix,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Domain,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $NamingScheme,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $NamingPrefix,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Cloning\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Cloning\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Cloning\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $FullName,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $OrgName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $ChangeSid,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $DeleteAccounts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $GuiRunOnce,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $AdminPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $TimeZone,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [int]\n        $AutoLogonCount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Workgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [pscredential]\n        $DomainCredentials,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $DomainUsername,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $DomainPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $ProductKey,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.LicenseMode]\n        $LicenseMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [int]\n        $LicenseMaxConnections\n    )\n\n    return $null\n}\n\nfunction New-ResourcePool {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $CpuExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuLimitMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuReservationMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $CpuSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $MemExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemLimitMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemLimitGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemReservationMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemReservationGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $MemSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpuShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumMemShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-ScsiController {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk]\n        $HardDisk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiControllerType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiBusSharingMode]\n        $BusSharingMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-Snapshot {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $VM,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Memory,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Quiesce,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-StatInterval {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $SamplingPeriodSecs,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StorageTimeSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-Tag {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagCategory]\n        $Category,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-TagAssignment {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag]\n        $Tag,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIObjectCore]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-TagCategory {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cardinality]\n        $Cardinality,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $EntityType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-Template {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $VM,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"register\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $DiskStorageFormat,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"clone\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template]\n        $Template,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"register\", ValueFromPipeline = $false)]\n        [string]\n        $TemplateFilePath\n    )\n\n    return $null\n}\n\nfunction New-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"new\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.FolderContainer]\n        $InventoryLocation,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [bool]\n        $CpuExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [long]\n        $CpuLimitMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [long]\n        $CpuReservationMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $CpuSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [bool]\n        $MemExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [long]\n        $MemLimitMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemLimitGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [long]\n        $MemReservationMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemReservationGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $MemSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpuShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [int]\n        $NumMemShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"new\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"clone\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $DiskStorageFormat,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.ContentLibrary.ContentLibraryItem]\n        $ContentLibraryItem\n    )\n\n    return $null\n}\n\nfunction New-VICredentialStoreItem {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Host,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $File\n    )\n\n    return $null\n}\n\nfunction New-VIPermission {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.VIAccount]\n        $Principal,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Role]\n        $Role,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Propagate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-VIProperty {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ValueFromExtensionProperty\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ValueFromExtensionProperty\", ValueFromPipeline = $false)]\n        [string[]]\n        $ObjectType,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [scriptblock]\n        $Value,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromExtensionProperty\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [string[]]\n        $BasedOnExtensionProperty,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromExtensionProperty\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromScriptBlock\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ValueFromExtensionProperty\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ValueFromExtensionProperty\", ValueFromPipeline = $false)]\n        [string]\n        $ValueFromExtensionProperty\n    )\n\n    return $null\n}\n\nfunction New-VIRole {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Privilege[]]\n        $Privilege,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-VirtualPortGroup {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $VLanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-VirtualSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]]\n        $Nic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $Mtu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-VISamlSecurityContext {\n    [CmdletBinding(DefaultParameterSetName = \"OAuth2SecurityContext\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"OAuth2SecurityContext\", ValueFromPipeline = $true)]\n        [string]\n        $VCenterServer,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"OAuth2SecurityContext\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $Port,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"OAuth2SecurityContext\", ValueFromPipeline = $false)]\n        [switch]\n        $IgnoreSslValidationErrors,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"OAuth2SecurityContext\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.Common.Types.V1.Authentication.OAuth2SecurityContext]\n        $OAuthSecurityContext\n    )\n\n    return $null\n}\n\nfunction New-VM {\n    [CmdletBinding(DefaultParameterSetName = \"DefaultParameterSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.AdvancedOption[]]\n        $AdvancedOption,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.VMVersion]\n        $Version,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $HardwareVersion,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer]\n        $ResourcePool,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder]\n        $Location,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.StorageResource]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [long[]]\n        $DiskMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [decimal[]]\n        $DiskGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $DiskPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $DiskStorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [long]\n        $MemoryMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemoryGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [int]\n        $CoresPerSocket,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Floppy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $CD,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $GuestId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $AlternateGuestName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $NetworkName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroupBase[]]\n        $Portgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HARestartPriority]\n        $HARestartPriority,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HAIsolationResponse]\n        $HAIsolationResponse,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsAutomationLevel]\n        $DrsAutomationLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VMSwapfilePolicy]\n        $VMSwapfilePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Security.KmsCluster]\n        $KmsCluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.StoragePolicy]\n        $StoragePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.ReplicationGroup]\n        $ReplicationGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $SkipHardDisks,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [string]\n        $Notes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Template\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.StoragePolicyTargetType]\n        $StoragePolicyTarget,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [switch]\n        $LinkedClone,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"CloneVm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot]\n        $ReferenceSnapshot,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"CloneVm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Template\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template]\n        $Template,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"RegisterVm\", ValueFromPipeline = $false)]\n        [string]\n        $VMFilePath,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"FromContentLibraryItem\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.ContentLibrary.ContentLibraryItem]\n        $ContentLibraryItem\n    )\n\n    return $null\n}\n\nfunction New-VMHostAccount {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [string]\n        $Id,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [switch]\n        $UserAccount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string[]]\n        $AssignGroups,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [switch]\n        $GrantShellAccess,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [switch]\n        $GroupAccount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [string[]]\n        $AssignUsers\n    )\n\n    return $null\n}\n\nfunction New-VMHostNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $PortGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $PortId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $IP,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $SubnetMask,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Mac,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $Mtu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $ConsoleNic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $VMotionEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $FaultToleranceLoggingEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $IPv6ThroughDhcp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $AutomaticIPv6,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $IPv6,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $ManagementTrafficEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $VsanTrafficEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $ReferenceHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $CompatibilityMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction New-VMHostProfileVmPortGroupConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile]\n        $HostProfile,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $PortGroupName,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VSwitchName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $VLanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction New-VMHostRoute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [ipaddress]\n        $Destination,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [ipaddress]\n        $Gateway,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $PrefixLength,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Open-VMConsoleWindow {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.RemoteConsoleVM[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $FullScreen,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $UrlOnly,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.Sdk.Types.V1.VIConnection[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-AdvancedSetting {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.AdvancedSetting[]]\n        $AdvancedSetting,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-AlarmAction {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmAction[]]\n        $AlarmAction,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-AlarmActionTrigger {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmActionTrigger[]]\n        $AlarmActionTrigger,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-CDDrive {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.CDDrive[]]\n        $CD,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Cluster {\n    [CmdletBinding(DefaultParameterSetName = \"DeleteFromDiskSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"DeleteFromDiskSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DeleteFromDiskSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DeleteFromDiskSet\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DeleteFromDiskSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DeleteFromDiskSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-CustomAttribute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttribute[]]\n        $CustomAttribute,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Datacenter {\n    [CmdletBinding(DefaultParameterSetName = \"RemoveDatacenterSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"RemoveDatacenterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter[]]\n        $Datacenter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RemoveDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RemoveDatacenterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RemoveDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"RemoveDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Datastore {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-DatastoreCluster {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.DatastoreCluster[]]\n        $DatastoreCluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-DrsClusterGroup {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterGroup[]]\n        $DrsClusterGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-DrsRule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsRule[]]\n        $Rule,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-DrsVMHostRule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsVMHostRule[]]\n        $Rule,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-FloppyDrive {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.FloppyDrive[]]\n        $Floppy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Folder {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder[]]\n        $Folder,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeletePermanently,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-HardDisk {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk[]]\n        $HardDisk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeletePermanently,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Inventory {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]]\n        $Item,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-IScsiHbaTarget {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHbaTarget[]]\n        $Target,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-NetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.NetworkAdapter[]]\n        $NetworkAdapter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-NfsUser {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Storage.Types.V1.Nfs.NfsUser[]]\n        $NfsUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-OSCustomizationNicMapping {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationNicMapping[]]\n        $OSCustomizationNicMapping,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-OSCustomizationSpec {\n    [CmdletBinding(DefaultParameterSetName = \"DefaultSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec[]]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-PassthroughDevice {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.PassThroughDevice[]]\n        $PassthroughDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-ResourcePool {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool[]]\n        $ResourcePool,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Snapshot {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RemoveChildren,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-StatInterval {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Stat.StatInterval[]]\n        $Interval,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Tag {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-TagAssignment {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagAssignment[]]\n        $TagAssignment,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-TagCategory {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagCategory[]]\n        $Category,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-Template {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeletePermanently,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-UsbDevice {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.UsbDevice[]]\n        $UsbDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeletePermanently,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp[]]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VICredentialStoreItem {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"ByCredentialItemObject\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VICredentialStoreItem[]]\n        $CredentialStoreItem,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByCredentialItemObject\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByFilters\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByCredentialItemObject\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByFilters\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByFilters\", ValueFromPipeline = $false)]\n        [string]\n        $Host,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByFilters\", ValueFromPipeline = $false)]\n        [string]\n        $User,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ByFilters\", ValueFromPipeline = $false)]\n        [string]\n        $File\n    )\n\n    return $null\n}\n\nfunction Remove-VIPermission {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Permission[]]\n        $Permission,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VIProperty {\n    [CmdletBinding(DefaultParameterSetName = \"VIProperty\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"VIProperty\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIProperty[]]\n        $VIProperty,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VIProperty\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VIProperty\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $Name,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string[]]\n        $ObjectType\n    )\n\n    return $null\n}\n\nfunction Remove-VIRole {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Role[]]\n        $Role,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VirtualPortGroup {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup[]]\n        $VirtualPortGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VirtualSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch[]]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VirtualSwitchPhysicalNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]]\n        $VMHostNetworkAdapter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VM {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeletePermanently,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VMHostAccount {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Account.HostAccount[]]\n        $HostAccount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VMHostNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]]\n        $Nic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VMHostNtpServer {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $NtpServer,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Remove-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EntityParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EntityParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EntityParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EntityParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]]\n        $Entity\n    )\n\n    return $null\n}\n\nfunction Remove-VMHostProfileVmPortGroupConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileVmPortGroupConfiguration[]]\n        $VmPortGroupConfiguration,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Remove-VMHostRoute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostRoute[]]\n        $VMHostRoute,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Restart-VM {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Restart-VMGuest {\n    [CmdletBinding(DefaultParameterSetName = \"Vm\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest\n    )\n\n    return $null\n}\n\nfunction Restart-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Evacuate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Restart-VMHostService {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.HostService[]]\n        $HostService,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-AdvancedSetting {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.AdvancedSetting[]]\n        $AdvancedSetting,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Object]\n        $Value,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-AlarmDefinition {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmDefinition[]]\n        $AlarmDefinition,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $ActionRepeatMinutes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Annotation {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]]\n        $Entity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttribute]\n        $CustomAttribute,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Value,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-CDDrive {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.CDDrive[]]\n        $CD,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $IsoPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $HostDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $NoMedia,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $StartConnected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Connected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Cluster {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HARestartPriority]\n        $HARestartPriority,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HAIsolationResponse]\n        $HAIsolationResponse,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VMSwapfilePolicy]\n        $VMSwapfilePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster[]]\n        $Cluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $HAEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $HAAdmissionControlEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $HAFailoverLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $DrsEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsMode]\n        $DrsMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsAutomationLevel]\n        $DrsAutomationLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $VsanEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Vsan.VsanDiskClaimMode]\n        $VsanDiskClaimMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $EVCMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-CustomAttribute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttribute[]]\n        $CustomAttribute,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Datacenter {\n    [CmdletBinding(DefaultParameterSetName = \"SetDatacenterSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"SetDatacenterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter[]]\n        $Datacenter,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"SetDatacenterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SetDatacenterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SetDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SetDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SetDatacenterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Datastore {\n    [CmdletBinding(DefaultParameterSetName = \"Update\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $false)]\n        [int]\n        $CongestionThresholdMillisecond,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $false)]\n        [bool]\n        $StorageIOControlEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Update\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $false)]\n        [bool]\n        $MaintenanceMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $false)]\n        [switch]\n        $EvacuateAutomatically,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"MaintenanceMode\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync\n    )\n\n    return $null\n}\n\nfunction Set-DatastoreCluster {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.DatastoreCluster[]]\n        $DatastoreCluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $IOLatencyThresholdMillisecond,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IOLoadBalanceEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsAutomationLevel]\n        $SdrsAutomationLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $SpaceUtilizationThresholdPercent,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-DrsClusterGroup {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterGroup]\n        $DrsClusterGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Add,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Remove,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMGroup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DrsClusterVMHostGroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost\n    )\n\n    return $null\n}\n\nfunction Set-DrsRule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsRule[]]\n        $Rule,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-DrsVMHostRule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterVMGroup]\n        $VMGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsClusterVMHostGroup]\n        $VMHostGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsVMHostRule[]]\n        $Rule,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsVMHostRuleType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-FloppyDrive {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.FloppyDrive[]]\n        $Floppy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $FloppyImagePath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $HostDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $NoMedia,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $StartConnected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Connected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Folder {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Folder[]]\n        $Folder,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-HardDisk {\n    [CmdletBinding(DefaultParameterSetName = \"UpdateHardDisk\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"InflateHardDisk\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ZeroOutHardDisk\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"EncryptHardDisk\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"DecryptHardDisk\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk[]]\n        $HardDisk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [long]\n        $CapacityKB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [decimal]\n        $CapacityGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [string]\n        $Persistence,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore]\n        $Datastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualDiskStorageFormat]\n        $StorageFormat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiController]\n        $Controller,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"InflateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ZeroOutHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"UpdateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"InflateHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ZeroOutHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [pscredential]\n        $HostCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [string]\n        $HostUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [securestring]\n        $HostPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [pscredential]\n        $GuestCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [string]\n        $GuestUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [securestring]\n        $GuestPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [int]\n        $ToolsWaitSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]\n        $HelperVM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [string]\n        $Partition,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ResizeGuestPartition\", ValueFromPipeline = $false)]\n        [switch]\n        $ResizeGuestPartition,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"InflateHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $Inflate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ZeroOutHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $ZeroOut,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptHardDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Security.KmsCluster]\n        $KmsCluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptHardDisk\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.StoragePolicy]\n        $StoragePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptHardDisk\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"DecryptHardDisk\", ValueFromPipeline = $false)]\n        [switch]\n        $DisableEncryption\n    )\n\n    return $null\n}\n\nfunction Set-IScsiHbaTarget {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHbaTarget[]]\n        $Target,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.ChapType]\n        $ChapType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ChapName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ChapPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $MutualChapEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $MutualChapName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $MutualChapPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritChap,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritMutualChap,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-NetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.NetworkAdapter[]]\n        $NetworkAdapter,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [string]\n        $MacAddress,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $NetworkName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [bool]\n        $StartConnected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [bool]\n        $Connected,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [bool]\n        $WakeOnLan,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.VirtualNetworkAdapterType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [string]\n        $PortId,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ConnectToPortByKey\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.DistributedSwitch]\n        $DistributedSwitch,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"ConnectToPortgroup\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroupBase]\n        $Portgroup\n    )\n\n    return $null\n}\n\nfunction Set-NfsUser {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Storage.Types.V1.Nfs.NfsUser[]]\n        $NfsUser,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-NicTeamingPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"switch\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.NicTeamingVirtualSwitchPolicy[]]\n        $VirtualSwitchPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [int]\n        $BeaconInterval,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.LoadBalancingPolicy]\n        $LoadBalancingPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.NetworkFailoverDetectionPolicy]\n        $NetworkFailoverDetectionPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $NotifySwitches,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $FailbackEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [string[]]\n        $MakeNicActive,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [string[]]\n        $MakeNicStandby,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [string[]]\n        $MakeNicUnused,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"pg\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.NicTeamingVirtualPortGroupPolicy[]]\n        $VirtualPortGroupPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritLoadBalancingPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritNetworkFailoverDetectionPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritNotifySwitches,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritFailback,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"pg\", ValueFromPipeline = $false)]\n        [bool]\n        $InheritFailoverOrder\n    )\n\n    return $null\n}\n\nfunction Set-OSCustomizationNicMapping {\n    [CmdletBinding(DefaultParameterSetName = \"Positional\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Positional\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Nic\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationNicMapping[]]\n        $OSCustomizationNicMapping,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [int]\n        $Position,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationIPMode]\n        $IpMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string]\n        $VCApplicationArgument,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string]\n        $IpAddress,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string]\n        $SubnetMask,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string]\n        $DefaultGateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string]\n        $AlternateGateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string[]]\n        $Dns,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string[]]\n        $Wins,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Positional\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Nic\", ValueFromPipeline = $false)]\n        [string]\n        $NetworkAdapterMac\n    )\n\n    return $null\n}\n\nfunction Set-OSCustomizationSpec {\n    [CmdletBinding(DefaultParameterSetName = \"Linux\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec[]]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec]\n        $NewSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpecType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $DnsServer,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $DnsSuffix,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Domain,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $NamingScheme,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $NamingPrefix,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Linux\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $FullName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $OrgName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [bool]\n        $ChangeSID,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [bool]\n        $DeleteAccounts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $GuiRunOnce,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $AdminPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $TimeZone,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [int]\n        $AutoLogonCount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Workgroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [pscredential]\n        $DomainCredentials,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $DomainUsername,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $DomainPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $ProductKey,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.LicenseMode]\n        $LicenseMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"WindowsParameterSet\", ValueFromPipeline = $false)]\n        [int]\n        $LicenseMaxConnections\n    )\n\n    return $null\n}\n\nfunction Set-PowerCLIConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.ProxyPolicy]\n        $ProxyPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DefaultVIServerMode]\n        $DefaultVIServerMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.BadCertificateAction]\n        $InvalidCertificateAction,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $ParticipateInCeip,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.ProxyPolicy]\n        $CEIPDataTransferProxyPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $DisplayDeprecationWarnings,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $WebOperationTimeoutSeconds,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VMConsoleWindowBrowser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.ConfigurationScope]\n        $Scope,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-ResourcePool {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.ResourcePool[]]\n        $ResourcePool,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $CpuExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuLimitMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuReservationMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $CpuSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $MemExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemLimitMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemLimitGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemReservationMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemReservationGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $MemSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpuShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumMemShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-ScsiController {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiController[]]\n        $ScsiController,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiBusSharingMode]\n        $BusSharingMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.ScsiControllerType]\n        $Type,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-ScsiLun {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLunMultipathPolicy]\n        $MultipathPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLunPath]\n        $PreferredPath,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLun[]]\n        $ScsiLun,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $CommandsToSwitchPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $BlocksToSwitchPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $NoCommandsSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $NoBlocksSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IsSsd,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IsLocal,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IsLocatorLedOn,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $DeletePartitions,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-ScsiLunPath {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Active,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLunPath[]]\n        $ScsiLunPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Preferred,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-SecurityPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"switch\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitchSecurityPolicy[]]\n        $VirtualSwitchPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [bool]\n        $AllowPromiscuous,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [bool]\n        $ForgedTransmits,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [bool]\n        $MacChanges,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"switch\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"portgroup\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortgroupSecurityPolicy[]]\n        $VirtualPortGroupPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [bool]\n        $AllowPromiscuousInherited,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [bool]\n        $ForgedTransmitsInherited,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"portgroup\", ValueFromPipeline = $false)]\n        [bool]\n        $MacChangesInherited\n    )\n\n    return $null\n}\n\nfunction Set-Snapshot {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot[]]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-StatInterval {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $SamplingPeriodSecs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StorageTimeSecs,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Stat.StatInterval[]]\n        $Interval,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Tag {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.Tag[]]\n        $Tag,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-TagCategory {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagCategory[]]\n        $Category,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Nullable[VMware.VimAutomation.ViCore.Types.V1.Cardinality]]\n        $Cardinality,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $AddEntityType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-Template {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.Template[]]\n        $Template,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $ToVM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp[]]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $CpuExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuLimitMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuReservationMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $CpuSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $MemExpandableReservation,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemLimitMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemLimitGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemReservationMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemReservationGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $MemSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpuShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumMemShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VIPermission {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Permission[]]\n        $Permission,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Role]\n        $Role,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Propagate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VIRole {\n    [CmdletBinding(DefaultParameterSetName = \"Add\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Role[]]\n        $Role,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Privilege[]]\n        $AddPrivilege,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Privilege[]]\n        $RemovePrivilege\n    )\n\n    return $null\n}\n\nfunction Set-VirtualPortGroup {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $VLanId,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup[]]\n        $VirtualPortGroup,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VirtualSwitch {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch[]]\n        $VirtualSwitch,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumPorts,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $Nic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $Mtu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VM {\n    [CmdletBinding(DefaultParameterSetName = \"DefaultSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.VMVersion]\n        $Version,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string]\n        $HardwareVersion,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [long]\n        $MemoryMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemoryGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [int]\n        $CoresPerSocket,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string]\n        $GuestId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string]\n        $AlternateGuestName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec]\n        $OSCustomizationSpec,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HARestartPriority]\n        $HARestartPriority,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.HAIsolationResponse]\n        $HAIsolationResponse,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Cluster.DrsAutomationLevel]\n        $DrsAutomationLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VMSwapfilePolicy]\n        $VMSwapFilePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [string]\n        $Notes,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"DefaultSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"DecryptParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"SnapshotSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot]\n        $Snapshot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"TemplateParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $ToTemplate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Security.KmsCluster]\n        $KmsCluster,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Storage.StoragePolicy]\n        $StoragePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"EncryptParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $SkipHardDisks,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"DecryptParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $DisableEncryption\n    )\n\n    return $null\n}\n\nfunction Set-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecurityParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostState]\n        $State,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VMSwapfilePolicy]\n        $VMSwapfilePolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore]\n        $VMSwapfileDatastore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $Evacuate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostTimeZone]\n        $TimeZone,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [string]\n        $LicenseKey,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Vsan.VsanDataMigrationMode]\n        $VsanDataMigrationMode,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecurityParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecurityParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"SecurityParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"SecurityParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Security.KmsCluster]\n        $KmsCluster\n    )\n\n    return $null\n}\n\nfunction Set-VMHostAccount {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Account.HostGroupAccount[]]\n        $GroupAccount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [string[]]\n        $AssignUsers,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [string[]]\n        $UnassignUsers,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Group\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Account.HostUserAccount[]]\n        $UserAccount,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string[]]\n        $AssignGroups,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [string[]]\n        $UnassignGroups,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"User\", ValueFromPipeline = $false)]\n        [bool]\n        $GrantShellAccess\n    )\n\n    return $null\n}\n\nfunction Set-VMHostAdvancedConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"NameValueParameterSet\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"NameValueParameterSet\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NameValueParameterSet\", ValueFromPipeline = $false)]\n        [System.Object]\n        $Value,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NameValueParameterSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HashtableParameterSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NameValueParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HashtableParameterSet\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NameValueParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HashtableParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"NameValueParameterSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"HashtableParameterSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"HashtableParameterSet\", ValueFromPipeline = $true)]\n        [hashtable]\n        $NameValue\n    )\n\n    return $null\n}\n\nfunction Set-VMHostAuthentication {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [string]\n        $Domain,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [string]\n        $Username,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [securestring]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [pscredential]\n        $Credential,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [switch]\n        $JoinDomain,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"LeaveDomain\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostAuthentication[]]\n        $VMHostAuthentication,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LeaveDomain\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"JoinDomain\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"LeaveDomain\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"LeaveDomain\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"LeaveDomain\", ValueFromPipeline = $false)]\n        [switch]\n        $LeaveDomain\n    )\n\n    return $null\n}\n\nfunction Set-VMHostDiagnosticPartition {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Active,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostDiagnosticPartition[]]\n        $VMHostDiagnosticPartition,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostFirewallDefaultPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $AllowIncoming,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $AllowOutgoing,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostFirewallDefaultPolicy[]]\n        $Policy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostFirewallException {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostFirewallException[]]\n        $Exception,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostFirmware {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Reset\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [switch]\n        $BackupConfiguration,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [string]\n        $DestinationPath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Reset\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Reset\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Backup\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Reset\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Reset\", ValueFromPipeline = $false)]\n        [switch]\n        $ResetToDefaults,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [switch]\n        $Restore,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [string]\n        $SourcePath,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [pscredential]\n        $HostCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [string]\n        $HostUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Restore\", ValueFromPipeline = $false)]\n        [securestring]\n        $HostPassword\n    )\n\n    return $null\n}\n\nfunction Set-VMHostHba {\n    [CmdletBinding(DefaultParameterSetName = \"IScsi\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.IScsiHba[]]\n        $IScsiHba,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [string]\n        $IScsiName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.ChapType]\n        $ChapType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [string]\n        $ChapName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [string]\n        $ChapPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [bool]\n        $MutualChapEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [string]\n        $MutualChapName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [string]\n        $MutualChapPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"IScsi\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostModule {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VmHostModule[]]\n        $HostModule,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Options,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostNetwork {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VMHostNetworkInfo[]]\n        $Network,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ConsoleGateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VMKernelGateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VMKernelGatewayDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ConsoleGatewayDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $DomainName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $HostName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $DnsFromDhcp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Object]\n        $DnsDhcpDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $DnsAddress,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string[]]\n        $SearchDomain,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IPv6Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ConsoleV6Gateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ConsoleV6GatewayDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VMKernelV6Gateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VMKernelV6GatewayDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostNetworkAdapter {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"PhysicalSet\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]]\n        $PhysicalNic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"PhysicalSet\", ValueFromPipeline = $false)]\n        [string]\n        $Duplex,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"PhysicalSet\", ValueFromPipeline = $false)]\n        [int]\n        $BitRatePerSecMb,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"PhysicalSet\", ValueFromPipeline = $false)]\n        [switch]\n        $AutoNegotiate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"PhysicalSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Move\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"PhysicalSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Move\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Move\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]]\n        $VirtualNic,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [switch]\n        $Dhcp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [string]\n        $IP,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [string]\n        $SubnetMask,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [string]\n        $Mac,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [int]\n        $Mtu,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $VMotionEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $FaultToleranceLoggingEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $ManagementTrafficEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $VsanTrafficEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $IPv6ThroughDhcp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $AutomaticIPv6,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [string[]]\n        $IPv6,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VirtualSet\", ValueFromPipeline = $false)]\n        [bool]\n        $IPv6Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Move\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.DistributedPortGroup]\n        $PortGroup\n    )\n\n    return $null\n}\n\nfunction Set-VMHostProfile {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Name,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]\n        $ReferenceHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $Profile,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Description,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostProfileImageCacheConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileImageCacheConfiguration[]]\n        $ImageCacheConfiguration,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileInstallationType]\n        $InstallationType,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileInstallationDevice]\n        $InstallationDevice,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $DiskArguments,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IgnoreSsd,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $OverwriteVmfs,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Set-VMHostProfileStorageDeviceConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileStorageDeviceConfiguration[]]\n        $StorageDeviceConfiguration,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $DeviceStateOn,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IsPerenniallyReserved,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $IsSharedClusterwide,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumReqOutstanding,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $QueueFullSampleSize,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $QueueFullThreshold,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $PspName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $ConfigInfo,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Set-VMHostProfileUserConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileUserConfiguration[]]\n        $UserConfiguration,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfilePasswordPolicy]\n        $PasswordPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $Password,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Set-VMHostProfileVmPortGroupConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfileVmPortGroupConfiguration[]]\n        $VmPortGroupConfiguration,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [string]\n        $VSwitchName,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $VLanId,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Set-VMHostRoute {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMHostRoute[]]\n        $VMHostRoute,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [ipaddress]\n        $Destination,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [ipaddress]\n        $Gateway,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Nullable[int]]\n        $PrefixLength,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostService {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.HostService[]]\n        $HostService,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.HostServicePolicy]\n        $Policy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostSnmp {\n    [CmdletBinding(DefaultParameterSetName = \"Default\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"Default\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VmHostSnmp[]]\n        $HostSnmp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [int]\n        $Port,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [string[]]\n        $ReadOnlyCommunity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Default\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [string]\n        $TargetCommunity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [int]\n        $TargetPort,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [string]\n        $TargetHost,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Add Trap Target\", ValueFromPipeline = $false)]\n        [switch]\n        $AddTarget,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Remove Trap Target\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [switch]\n        $RemoveTarget,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Remove Trap Target By Object\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.TrapTarget]\n        $TrapTargetToRemove\n    )\n\n    return $null\n}\n\nfunction Set-VMHostStartPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy.VMHostStartPolicy[]]\n        $VMHostStartPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $Enabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StartDelay,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy.VmStopAction]\n        $StopAction,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StopDelay,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $WaitForHeartBeat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostStorage {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Storage.VMHostStorageInfo[]]\n        $VMHostStorage,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $SoftwareIScsiEnabled,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMHostSysLogServer {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.NamedIPEndPoint[]]\n        $SysLogServer,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $SysLogServerPort,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMQuestion {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"option\", ValueFromPipeline = $true)]\n        [Parameter(Mandatory = $true, ParameterSetName = \"default\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.VMQuestion[]]\n        $VMQuestion,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"option\", ValueFromPipeline = $false)]\n        [System.Object]\n        $Option,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"option\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"option\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"default\", ValueFromPipeline = $false)]\n        [switch]\n        $DefaultOption\n    )\n\n    return $null\n}\n\nfunction Set-VMResourceConfiguration {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.VMResourceConfiguration[]]\n        $Configuration,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.HTCoreSharing]\n        $HtCoreSharing,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.CpuAffinity]\n        $CpuAffinity,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int[]]\n        $CpuAffinityList,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $CpuReservationMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Nullable[long]]\n        $CpuLimitMhz,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $CpuSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumCpuShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $MemReservationMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [decimal]\n        $MemReservationGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Nullable[long]]\n        $MemLimitMB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [System.Nullable[decimal]]\n        $MemLimitGB,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $MemSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumMemShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk[]]\n        $Disk,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $NumDiskShares,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.SharesLevel]\n        $DiskSharesLevel,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [long]\n        $DiskLimitIOPerSecond,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Set-VMStartPolicy {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy.VMStartPolicy[]]\n        $StartPolicy,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy.VmStartAction]\n        $StartAction,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StartOrder,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $InheritStopActionFromHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $InheritStopDelayFromHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $InheritWaitForHeartbeatFromHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $InheritStartDelayFromHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $UnspecifiedStartOrder,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StartDelay,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy.VmStopAction]\n        $StopAction,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $StopDelay,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [bool]\n        $WaitForHeartBeat,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Start-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp[]]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Start-VM {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Start-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $TimeoutSeconds,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Start-VMHostService {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.HostService[]]\n        $HostService,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Stop-Task {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.Task[]]\n        $Task,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Stop-VApp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VApp[]]\n        $VApp,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Stop-VM {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Kill,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Stop-VMGuest {\n    [CmdletBinding(DefaultParameterSetName = \"Vm\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest\n    )\n\n    return $null\n}\n\nfunction Stop-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Force,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Stop-VMHostService {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.HostService[]]\n        $HostService,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Suspend-VM {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Suspend-VMGuest {\n    [CmdletBinding(DefaultParameterSetName = \"Vm\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest\n    )\n\n    return $null\n}\n\nfunction Suspend-VMHost {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [int]\n        $TimeoutSeconds,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Evacuate,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $WhatIf,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $false)]\n        [switch]\n        $Confirm\n    )\n\n    return $null\n}\n\nfunction Test-VMHostProfileCompliance {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostCompliance\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]\n        $VMHost,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostCompliance\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileCompliance\", ValueFromPipeline = $false)]\n        [switch]\n        $UseCache,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMHostCompliance\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileCompliance\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"ProfileCompliance\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.Profile.VMHostProfile[]]\n        $Profile\n    )\n\n    return $null\n}\n\nfunction Test-VMHostSnmp {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Host.VmHostSnmp[]]\n        $HostSnmp\n    )\n\n    return $null\n}\n\nfunction Update-Tools {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [switch]\n        $NoReboot,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [switch]\n        $RunAsync,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VMGuest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"Vm\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server\n    )\n\n    return $null\n}\n\nfunction Wait-Task {\n    [CmdletBinding(DefaultParameterSetName = \"__AllParameterSets\")]\n    param(\n        [Parameter(Mandatory = $true, ParameterSetName = \"__AllParameterSets\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.Sdk.Types.V1.Task[]]\n        $Task\n    )\n\n    return $null\n}\n\nfunction Wait-Tools {\n    [CmdletBinding(DefaultParameterSetName = \"\")]\n    param(\n        [Parameter(Mandatory = $false, ParameterSetName = \"VM\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]]\n        $VM,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VM\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Guest\", ValueFromPipeline = $false)]\n        [int]\n        $TimeoutSeconds,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VM\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Guest\", ValueFromPipeline = $false)]\n        [pscredential]\n        $HostCredential,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VM\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Guest\", ValueFromPipeline = $false)]\n        [string]\n        $HostUser,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VM\", ValueFromPipeline = $false)]\n        [Parameter(Mandatory = $false, ParameterSetName = \"Guest\", ValueFromPipeline = $false)]\n        [securestring]\n        $HostPassword,\n\n        [Parameter(Mandatory = $false, ParameterSetName = \"VM\", ValueFromPipeline = $false)]\n        [VMware.VimAutomation.ViCore.Types.V1.VIServer[]]\n        $Server,\n\n        [Parameter(Mandatory = $true, ParameterSetName = \"Guest\", ValueFromPipeline = $true)]\n        [VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuest[]]\n        $Guest\n    )\n\n    return $null\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VDPortGroup.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VDPortGroup'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VDPortGroupMocks.ps1\"\n\n        Describe 'VDPortGroup\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDPortGroup\n            }\n\n            Context 'Distributed Port Group does not exist, Distributed Port Group settings are not passed and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistDistributedPortGroupSettingsAreNotPassedAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VDPortGroup mock without Distributed Port Group settings once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VDPortGroup'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DistributedPortGroupName -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group does not exist, Distributed Port Group settings are passed and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistDistributedPortGroupSettingsArePassedAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VDPortGroup mock with Distributed Port Group settings once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VDPortGroup'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DistributedPortGroupName -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            $Notes -eq $script:constants.DistributedPortGroupNotes -and\n                            $NumPorts -eq $script:constants.DistributedPortGroupNumPorts -and\n                            $PortBinding -eq $script:constants.DistributedPortGroupStaticPortBinding -and\n                            $VLanId -eq $script:constants.VLanId -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group does not exist, Reference Distributed Port Group is passed and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistReferenceDistributedPortGroupIsPassedAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VDPortGroup mock with the Reference Distributed Port Group once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VDPortGroup'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.DistributedPortGroupName -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            $ReferencePortgroup -eq $script:constants.ReferenceDistributedPortGroupName -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group exists, Distributed Port Group settings are passed and need to be updated and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsDistributedPortGroupSettingsArePassedAndNeedToBeUpdatedAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VDPortGroup mock with the Distributed Port Group settings that need to be updated once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VDPortGroup'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDPortgroup -eq $script:distributedPortGroup -and\n                            $NumPorts -eq ($script:constants.DistributedPortGroupNumPorts + $script:constants.DistributedPortGroupNumPorts) -and\n                            $PortBinding -eq $script:constants.DistributedPortGroupDynamicPortBinding -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group exists, VLAN ID 0 is passed and needs to be updated and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsVlanId0IsPassedAndNeedsToBeUpdatedAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VDVlanConfiguration mock with the Distributed Port Group and DisableVlan parameter once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VDVlanConfiguration'\n                        ParameterFilter = {\n                            $VDPortgroup -eq $script:distributedPortGroup -and\n                            $DisableVlan -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group exists, VLAN ID is passed and needs to be updated and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsVlanIdIsPassedAndNeedsToBeUpdatedAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VDVlanConfiguration mock with the Distributed Port Group and VLAN ID once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VDVlanConfiguration'\n                        ParameterFilter = {\n                            $VDPortgroup -eq $script:distributedPortGroup -and\n                            $VlanId -eq $script:constants.ModifiedVLanId -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenDistributedPortGroupDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-VDPortGroup mock with the Distributed Port Group' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VDPortGroup'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDPortgroup -eq $script:distributedPortGroup -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Distributed Port Group exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenDistributedPortGroupExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-VDPortGroup mock with the Distributed Port Group once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VDPortGroup'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDPortgroup -eq $script:distributedPortGroup -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VDPortGroup\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDPortGroup\n            }\n\n            Context 'Distributed Port Group does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Distributed Port Group does not exist and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Distributed Port Group exists, passed Distributed Port Group settings are equal to the Server settings and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsPassedDistributedPortGroupSettingsAreEqualToTheServerSettingsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Distributed Port Group exists, the passed Distributed Port Group settings are equal to the Server settings and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Distributed Port Group exists, passed Distributed Port Group settings are not equal to the Server settings and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsPassedDistributedPortGroupSettingsAreNotEqualToTheServerSettingsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Distributed Port Group exists, the passed Distributed Port Group settings are not equal to the Server settings and Ensure is Present' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Distributed Port Group does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Distributed Port Group does not exist and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Distributed Port Group exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Distributed Port Group exists and Ensure is Absent' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VDPortGroup\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDPortGroup\n            }\n\n            Context 'Distributed Port Group does not exist and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.VdsName | Should -Be $resourceProperties.VdsName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Notes | Should -BeNullOrEmpty\n                    $result.NumPorts | Should -Be $resourceProperties.NumPorts\n                    $result.PortBinding | Should -Be 'Unset'\n                    $result.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n                    $result.VLanId | Should -Be 0\n                }\n            }\n\n            Context 'Distributed Port Group exists and Ensure is Present' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsAndEnsureIsPresent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:distributedPortGroup.Name\n                    $result.VdsName | Should -Be $script:distributedPortGroup.VDSwitch.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Notes | Should -Be $script:distributedPortGroup.Notes\n                    $result.NumPorts | Should -Be $script:distributedPortGroup.NumPorts\n                    $result.PortBinding | Should -Be $script:distributedPortGroup.PortBinding\n                    $result.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n                    $result.VLanId | Should -Be $script:distributedPortGroup.VlanConfiguration.VlanId\n                }\n            }\n\n            Context 'Distributed Port Group does not exist and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupDoesNotExistAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.VdsName | Should -Be $resourceProperties.VdsName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Notes | Should -BeNullOrEmpty\n                    $result.NumPorts | Should -Be $resourceProperties.NumPorts\n                    $result.PortBinding | Should -Be 'Unset'\n                    $result.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n                    $result.VLanId | Should -Be 0\n                }\n            }\n\n            Context 'Distributed Port Group exists and Ensure is Absent' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDistributedPortGroupExistsAndEnsureIsAbsent\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:distributedPortGroup.Name\n                    $result.VdsName | Should -Be $script:distributedPortGroup.VDSwitch.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Notes | Should -Be $script:distributedPortGroup.Notes\n                    $result.NumPorts | Should -Be $script:distributedPortGroup.NumPorts\n                    $result.PortBinding | Should -Be $script:distributedPortGroup.PortBinding\n                    $result.ReferenceVDPortGroupName | Should -BeNullOrEmpty\n                    $result.VLanId | Should -Be $script:distributedPortGroup.VlanConfiguration.VlanId\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VDSwitch.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VDSwitch'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VDSwitchMocks.ps1\"\n\n        Describe 'VDSwitch\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDSwitch\n            }\n\n            Context 'Invoking with Ensure Present, non existing Distributed Switch and no Distributed Switch settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingDistributedSwitchAndNoDistributedSwitchSettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VDSwitch mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VDSwitch'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and `\n                                            $Location -eq $script:datacenterNetworkFolder -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, non existing Distributed Switch and Distributed Switch settings specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingDistributedSwitchAndDistributedSwitchSettingsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VDSwitch mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VDSwitch'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder -and `\n                                            $ContactDetails -eq $script:constants.DistributedSwitchContactDetails -and $ContactName -eq $script:constants.DistributedSwitchContactName -and `\n                                            $LinkDiscoveryProtocol -eq $script:constants.DistributedSwitchLinkDiscoveryProtocol -and `\n                                            $LinkDiscoveryProtocolOperation -eq $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation -and `\n                                            $MaxPorts -eq $script:constants.DistributedSwitchMaxPorts -and $Mtu -eq $script:constants.DistributedSwitchMtu -and `\n                                            $Notes -eq $script:constants.DistributedSwitchNotes -and $NumUplinkPorts -eq $script:constants.DistributedSwitchNumUplinkPorts -and `\n                                            $Version -eq $script:constants.DistributedSwitchVersion -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, non existing Distributed Switch and Reference Distributed Switch Name specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentNonExistingDistributedSwitchAndReferenceDistributedSwitchNameSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VDSwitch mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VDSwitch'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:constants.DistributedSwitchName -and $Location -eq $script:datacenterNetworkFolder -and `\n                                            $ReferenceVDSwitch -eq $script:constants.ReferenceDistributedSwitchName -and $WithoutPortGroups -eq $script:constants.WithoutPortGroups -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VDSwitch mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VDSwitch'\n                        ParameterFilter = { $Server -eq $script:viServer -and $VDSwitch -eq $script:distributedSwitch -and !$Confirm -and `\n                                            $ContactDetails -eq ($script:constants.DistributedSwitchContactDetails + $script:constants.DistributedSwitchContactDetails) -and `\n                                            $ContactName -eq ($script:constants.DistributedSwitchContactName + $script:constants.DistributedSwitchContactName) -and `\n                                            $MaxPorts -eq ($script:constants.DistributedSwitchMaxPorts + 1) -and $Mtu -eq ($script:constants.DistributedSwitchMtu + 1) }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndNonExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-VDSwitch mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VDSwitch'\n                        ParameterFilter = { $Server -eq $script:viServer -and $VDSwitch -eq $script:distributedSwitch -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-VDSwitch mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VDSwitch'\n                        ParameterFilter = { $Server -eq $script:viServer -and $VDSwitch -eq $script:distributedSwitch -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VDSwitch\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDSwitch\n            }\n\n            Context 'Invoking with Ensure Present and non existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Distributed Switch does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Distributed Switch and matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingDistributedSwitchAndMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Distributed Switch exists and the Distributed Switch settings are equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Distributed Switch and non matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingDistributedSwitchAndNonMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Distributed Switch exists and the Distributed Switch settings are not equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Distributed Switch does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Distributed Switch exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VDSwitch\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDSwitch\n            }\n\n            Context 'Invoking with Ensure Present and non existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n\n                    $result.ReferenceVDSwitchName | Should -BeNullOrEmpty\n                    $result.WithoutPortGroups | Should -Be $resourceProperties.WithoutPortGroups\n                    $result.ContactDetails | Should -Be $resourceProperties.ContactDetails\n                    $result.ContactName | Should -Be $resourceProperties.ContactName\n                    $result.LinkDiscoveryProtocol.ToString() | Should -Be $resourceProperties.LinkDiscoveryProtocol.ToString()\n                    $result.LinkDiscoveryProtocolOperation.ToString() | Should -Be $resourceProperties.LinkDiscoveryProtocolOperation.ToString()\n                    $result.MaxPorts | Should -Be $resourceProperties.MaxPorts\n                    $result.Mtu | Should -Be $resourceProperties.Mtu\n                    $result.Notes | Should -Be $resourceProperties.Notes\n                    $result.NumUplinkPorts | Should -Be $resourceProperties.NumUplinkPorts\n                    $result.Version | Should -Be $resourceProperties.Version\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:constants.DistributedSwitchName\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.ReferenceVDSwitchName | Should -BeNullOrEmpty\n                    $result.WithoutPortGroups | Should -Be $resourceProperties.WithoutPortGroups\n                    $result.ContactDetails | Should -Be $script:constants.DistributedSwitchContactDetails\n                    $result.ContactName | Should -Be $script:constants.DistributedSwitchContactName\n                    $result.LinkDiscoveryProtocol.ToString() | Should -Be $script:constants.DistributedSwitchLinkDiscoveryProtocol.ToString()\n                    $result.LinkDiscoveryProtocolOperation.ToString() | Should -Be $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation.ToString()\n                    $result.MaxPorts | Should -Be $script:constants.DistributedSwitchMaxPorts\n                    $result.Mtu | Should -Be $script:constants.DistributedSwitchMtu\n                    $result.Notes | Should -Be $script:constants.DistributedSwitchNotes\n                    $result.NumUplinkPorts | Should -Be $script:constants.DistributedSwitchNumUplinkPorts\n                    $result.Version | Should -Be $script:constants.DistributedSwitchVersion\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.ReferenceVDSwitchName | Should -BeNullOrEmpty\n                    $result.WithoutPortGroups | Should -Be $resourceProperties.WithoutPortGroups\n                    $result.ContactDetails | Should -Be $resourceProperties.ContactDetails\n                    $result.ContactName | Should -Be $resourceProperties.ContactName\n                    $result.LinkDiscoveryProtocol.ToString() | Should -Be $resourceProperties.LinkDiscoveryProtocol.ToString()\n                    $result.LinkDiscoveryProtocolOperation.ToString() | Should -Be $resourceProperties.LinkDiscoveryProtocolOperation.ToString()\n                    $result.MaxPorts | Should -Be $resourceProperties.MaxPorts\n                    $result.Mtu | Should -Be $resourceProperties.Mtu\n                    $result.Notes | Should -Be $resourceProperties.Notes\n                    $result.NumUplinkPorts | Should -Be $resourceProperties.NumUplinkPorts\n                    $result.Version | Should -Be $resourceProperties.Version\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:constants.DistributedSwitchName\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.ReferenceVDSwitchName | Should -BeNullOrEmpty\n                    $result.WithoutPortGroups | Should -Be $resourceProperties.WithoutPortGroups\n                    $result.ContactDetails | Should -Be $script:constants.DistributedSwitchContactDetails\n                    $result.ContactName | Should -Be $script:constants.DistributedSwitchContactName\n                    $result.LinkDiscoveryProtocol.ToString() | Should -Be $script:constants.DistributedSwitchLinkDiscoveryProtocol.ToString()\n                    $result.LinkDiscoveryProtocolOperation.ToString() | Should -Be $script:constants.DistributedSwitchLinkDiscoveryProtocolOperation.ToString()\n                    $result.MaxPorts | Should -Be $script:constants.DistributedSwitchMaxPorts\n                    $result.Mtu | Should -Be $script:constants.DistributedSwitchMtu\n                    $result.Notes | Should -Be $script:constants.DistributedSwitchNotes\n                    $result.NumUplinkPorts | Should -Be $script:constants.DistributedSwitchNumUplinkPorts\n                    $result.Version | Should -Be $script:constants.DistributedSwitchVersion\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VDSwitchVMHost.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VDSwitchVMHost'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VDSwitchVMHostMocks.ps1\"\n\n        Describe 'VDSwitchVMHost\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDSwitchVMHost\n            }\n\n            Context 'Invoking with Ensure Present, two VMHosts and one of them is already added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentTwoVMHostsAndOneOfThemIsAlreadyAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchVMHost mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchVMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHost, [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]] @($script:vmHostRemovedFromDistributedSwitchOne))\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present and two VMHosts that are not added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndTwoVMHostsThatAreNotAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchVMHost mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchVMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHost, [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]] @($script:vmHostRemovedFromDistributedSwitchOne, $script:vmHostRemovedFromDistributedSwitchTwo))\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and two VMHosts and one of them is already removed from the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentTwoVMHostsAndOneOfThemIsAlreadyRemovedFromTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-VDSwitchVMHost mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VDSwitchVMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHost, [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]] @($script:vmHostAddedToDistributedSwitchOne))\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and two VMHosts that are not removed from the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndTwoVMHostsThatAreNotRemovedFromTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-VDSwitchVMHost mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VDSwitchVMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VDSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHost, [VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]] @($script:vmHostAddedToDistributedSwitchOne, $script:vmHostAddedToDistributedSwitchTwo))\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VDSwitchVMHost\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDSwitchVMHost\n            }\n\n            Context 'Invoking with Ensure Present and VMHost that is not added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndVMHostThatIsNotAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost is not added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present and VMHost that is added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndVMHostThatIsAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost is added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and VMHost that is not removed from the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndVMHostThatIsNotRemovedFromTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost is not removed from the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and VMHost that is removed from the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndVMHostThatIsRemovedFromTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost is removed from the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VDSwitchVMHost\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVDSwitchVMHost\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VdsName | Should -Be $script:distributedSwitch.Name\n                $result.VMHostNames | Should -Be $resourceProperties.VMHostNames\n                $result.Ensure | Should -Be $resourceProperties.Ensure\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostAccount.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\nfunction Invoke-TestSetup {\n    $script:modulePath = $env:PSModulePath\n    $script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n    $script:moduleName = 'VMware.vSphereDSC'\n    $script:resourceName = 'VMHostAccount'\n\n    $script:user = 'user'\n    $password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n    $credential = New-Object System.Management.Automation.PSCredential($script:user, $password)\n\n    $script:resourceProperties = @{\n        Server = '10.23.80.58'\n        Credential = $credential\n        Id = 'MyCustomVMHostAccount'\n        Ensure = 'Present'\n        Role = 'Admin'\n    }\n\n    $script:constants = @{\n        AccountPassword = 'MyCustomVMHostAccountPassword'\n        Description = 'MyCustomVMHostAccountDescription'\n        RoleId = 1\n        RoleName = 'Admin'\n        RoleDescription = 'role-admin-description'\n        ProductLine = 'embeddedEsx'\n    }\n\n    $script:viServerScriptBlock = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n            Name = '$($script:resourceProperties.Server)'\n            User = '$($script:user)'\n            ProductLine = '$($script:constants.ProductLine)'\n        }\n'@\n\n    $script:viServerForESXiHostScriptBlock = @'\n    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = '$($script:resourceProperties.Server)'\n        User = '$($script:resourceProperties.Id)'\n    }\n'@\n\n    $script:vmHostAccountWithoutDescriptionScriptBlock = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Host.Account.HostUserAccountImpl] @{\n            Id = '$($script:resourceProperties.Id)'\n            Name = '$($script:resourceProperties.Name)'\n        }\n'@\n\n    $script:vmHostAccountScriptBlock = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Host.Account.HostUserAccountImpl] @{\n            Id = '$($script:resourceProperties.Id)'\n            Name = '$($script:resourceProperties.Name)'\n            Description = '$($script:constants.Description)'\n        }\n'@\n\n    $script:accountRoleScriptBlock = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.RoleImpl] @{\n            Id = '$($script:constants.RoleId)'\n            Name = '$($script:constants.RoleName)'\n            Description = '$($script:constants.RoleDescription)'\n        }\n'@\n\n    $script:rolePermissionScriptBlock = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PermissionImpl] @{\n            RoleId = '$($script:constants.RoleId)'\n            Role = '$($script:constants.RoleName)'\n        }\n'@\n\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n\n    $script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = $script:resourceProperties.Server\n        User = $script:user\n        ProductLine = $script:constants.ProductLine\n    }\n\n    $script:viServerForESXiHost = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = $script:resourceProperties.Server\n        User = $script:resourceProperties.Id\n    }\n\n    $script:vmHostAccountWithoutDescription = [VMware.VimAutomation.ViCore.Impl.V1.Host.Account.HostUserAccountImpl] @{\n        Id = $script:resourceProperties.Id\n        Name = $script:resourceProperties.Name\n    }\n\n    $script:vmHostAccount = [VMware.VimAutomation.ViCore.Impl.V1.Host.Account.HostUserAccountImpl] @{\n        Id = $script:resourceProperties.Id\n        Name = $script:resourceProperties.Name\n        Description = $script:constants.Description\n    }\n\n    $script:accountRole = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.RoleImpl] @{\n        Id = $script:constants.RoleId\n        Name = $script:constants.RoleName\n        Description = $script:constants.RoleDescription\n    }\n\n    $script:accountPermission = [VMware.VimAutomation.ViCore.Impl.V1.PermissionManagement.PermissionImpl] @{\n        RoleId = $script:constants.RoleId\n        Role = $script:constants.RoleName\n    }\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostAccount\\Set' -Tag 'Set' {\n        BeforeEach {\n            # Arrange\n            $viServerMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerScriptBlock))\n\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        }\n\n        Context 'Invoking with Ensure Absent, non existing VMHostAccount and only Account Id specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should call the Get-VMHostAccount mock with the VIServer and VMHost Account Id once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:resourceProperties.Id }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present, non existing VMHost Account and only Account Password specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountWithoutDescriptionScriptBlock))\n                $accountRoleMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:accountRoleScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName New-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VIRole -MockWith $accountRoleMock -ModuleName $script:moduleName\n                Mock -CommandName New-VIPermission -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('AccountPassword')\n            }\n\n            It 'Should call the New-VMHostAccount mock with the VIServer, VMHost Account Id and Password once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'New-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:resourceProperties.Id -and $Password -eq $script:resourceProperties.AccountPassword -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the Get-VIRole mock with the VIServer and Role Name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VIRole'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Role }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the New-VIPermission mock with the VIServer, VMHost Entity, VMHost Account and Role once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'New-VIPermission'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Entity -eq $script:resourceProperties.Server -and `\n                                        $Principal -eq $script:vmHostAccountWithoutDescription -and $Role -eq $script:accountRole }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present, non existing VMHost Account, Account Password and Description specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword\n                $script:resourceProperties.Description = $script:constants.Description\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $accountRoleMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:accountRoleScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName New-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VIRole -MockWith $accountRoleMock -ModuleName $script:moduleName\n                Mock -CommandName New-VIPermission -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('AccountPassword')\n                $script:resourceProperties.Remove('Description')\n            }\n\n            It 'Should call the New-VMHostAccount mock with the VIServer, VMHost Account Id, Password and Description once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'New-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:resourceProperties.Id -and $Password -eq $script:resourceProperties.AccountPassword -and `\n                                        $Description -eq $script:resourceProperties.Description -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the Get-VIRole mock with the VIServer and Role Name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VIRole'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Role }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the New-VIPermission mock with the VIServer, VMHost Entity, VMHost Account and Role once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'New-VIPermission'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Entity -eq $script:resourceProperties.Server -and `\n                                        $Principal -eq $script:vmHostAccount -and $Role -eq $script:accountRole }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account and no Account settings specified' {\n            BeforeAll {\n                # Arrange\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            It 'Should call the Set-VMHostAccount mock with the VIServer and VMHost Account once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Set-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $UserAccount -eq $script:vmHostAccount -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the Get-VIPermission mock with the VIServer, VMHost Entity and VMHost Account once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VIPermission'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Entity -eq $script:resourceProperties.Server -and $Principal -eq $script:vmHostAccount }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, Account Password and Description specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword + 'Modified Password'\n                $script:resourceProperties.Description = $script:constants.Description + 'Modified Description'\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('AccountPassword')\n                $script:resourceProperties.Remove('Description')\n            }\n\n            It 'Should call the Set-VMHostAccount mock with the VIServer and VMHost Account, Account Password and Description once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Set-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $UserAccount -eq $script:vmHostAccount -and $Password -eq $script:resourceProperties.AccountPassword -and `\n                                        $Description -eq $script:resourceProperties.Description -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the Get-VIPermission mock with the VIServer, VMHost Entity and VMHost Account once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VIPermission'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Entity -eq $script:resourceProperties.Server -and $Principal -eq $script:vmHostAccount }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account and new Role specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Role = $script:constants.RoleName + 'New'\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $accountRoleMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:accountRoleScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIRole -MockWith $accountRoleMock -ModuleName $script:moduleName\n                Mock -CommandName New-VIPermission -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Role = $script:constants.RoleName\n            }\n\n            It 'Should call the Get-VIRole mock with the VIServer and Role Name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VIRole'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Role }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the New-VIPermission mock with the VIServer, VMHost Entity, VMHost Account and Role once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'New-VIPermission'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Entity -eq $script:resourceProperties.Server -and `\n                                        $Principal -eq $script:vmHostAccount -and $Role -eq $script:accountRole }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Absent and existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Remove-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should call the Remove-VMHostAccount mock with the VIServer and VMHost Account once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Remove-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $HostAccount -eq $script:vmHostAccount -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Absent and non existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Remove-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should not call the Remove-VMHostAccount mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Remove-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $HostAccount -eq $script:vmHostAccount -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n    }\n\n    Describe 'VMHostAccount\\Test' -Tag 'Test' {\n        BeforeEach {\n            # Arrange\n            $viServerMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerScriptBlock))\n\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        }\n\n        Context 'Invoking with Ensure Absent, non existing VMHostAccount and only Account Id specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should call the Get-VMHostAccount mock with the VIServer and VMHost Account Id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:resourceProperties.Id }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present and non existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            It 'Should return $false' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, matching Account Password and no Description specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $viServerForESXiHostMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerForESXiHostScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Connect-VIServer -MockWith $viServerForESXiHostMock `\n                                                   -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $User -eq $script:resourceProperties.Id -and `\n                                                                      $Password -eq $script:constants.AccountPassword } `\n                                                   -ModuleName $script:moduleName\n                Mock -CommandName Disconnect-VIServer -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('Password')\n            }\n\n            It 'Should call Connect-VIServer mock with the passed Server, Id and Account Password once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $User -eq $script:resourceProperties.Id -and $Password -eq $script:constants.AccountPassword }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Disconnect-VIServer mock with the passed Server once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Disconnect-VIServer'\n                    ParameterFilter = { $Server -eq $script:viServerForESXiHost -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $true' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, non matching Account Password and no Description specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Connect-VIServer -MockWith { return $null } `\n                                                   -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $User -eq $script:resourceProperties.Id -and `\n                                                                      $Password -eq $script:constants.AccountPassword } `\n                                                   -ModuleName $script:moduleName\n                Mock -CommandName Disconnect-VIServer -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('Password')\n            }\n\n            It 'Should call Connect-VIServer mock with the passed Server, Id and Account Password once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $User -eq $script:resourceProperties.Id -and $Password -eq $script:constants.AccountPassword }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should not call Disconnect-VIServer mock' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Disconnect-VIServer'\n                    ParameterFilter = { $Server -eq $script:viServerForESXiHost -and !$Confirm }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $false' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, matching Description and no Account Password specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Description = $script:constants.Description\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('Description')\n            }\n\n            It 'Should return $true' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, non matching Description and no Account Password specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Description = $script:constants.Description + 'Modified Description'\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('Description')\n            }\n\n            It 'Should return $false' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, non matching Account Password, no Description and no Role Permission specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Connect-VIServer -MockWith { return $null } `\n                                                   -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $User -eq $script:resourceProperties.Id -and `\n                                                                      $Password -eq $script:constants.AccountPassword } `\n                                                   -ModuleName $script:moduleName\n                Mock -CommandName Disconnect-VIServer -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('Password')\n            }\n\n            It 'Should return $false' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure Present, existing VMHost Account, non matching Account Password, no Description and Role Permission specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.AccountPassword = $script:constants.AccountPassword\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Connect-VIServer -MockWith { return $null } `\n                                                   -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $User -eq $script:resourceProperties.Id -and `\n                                                                      $Password -eq $script:constants.AccountPassword } `\n                                                   -ModuleName $script:moduleName\n                Mock -CommandName Disconnect-VIServer -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Remove('Password')\n            }\n\n            It 'Should return $false' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure Absent and non existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should return $true' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with Ensure Absent and existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should return $false' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n    }\n\n    Describe 'VMHostAccount\\Get' -Tag 'Get' {\n        BeforeAll {\n            $script:resourceProperties.Description = $script:constants.Description\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n        }\n\n        AfterAll {\n            $script:resourceProperties.Remove('Description')\n        }\n\n        BeforeEach {\n            # Arrange\n            $viServerMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerScriptBlock))\n\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        }\n\n        Context 'Invoking with Ensure Absent, non existing VMHostAccount and only Account Id specified' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should call the Get-VMHostAccount mock with the VIServer and VMHost Account Id once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHostAccount'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:resourceProperties.Id }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Invoking with Ensure Present and non existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            It 'Should retrieve the correct settings from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.Id | Should -Be $script:resourceProperties.Id\n                $result.Ensure | Should -Be 'Absent'\n                $result.Role | Should -Be $script:resourceProperties.Role\n                $result.Description | Should -Be $script:resourceProperties.Description\n            }\n        }\n\n        Context 'Invoking with Ensure Present and existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n            }\n\n            It 'Should retrieve the correct settings from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.Id | Should -Be $script:vmHostAccount.Id\n                $result.Ensure | Should -Be 'Present'\n                $result.Role | Should -Be $script:accountPermission.Role\n                $result.Description | Should -Be $script:vmHostAccount.Description\n            }\n        }\n\n        Context 'Invoking with Ensure Absent and non existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                Mock -CommandName Get-VMHostAccount -MockWith { return $null } -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should retrieve the correct settings from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.Id | Should -Be $script:resourceProperties.Id\n                $result.Ensure | Should -Be 'Absent'\n                $result.Role | Should -Be $script:resourceProperties.Role\n                $result.Description | Should -Be $script:resourceProperties.Description\n            }\n        }\n\n        Context 'Invoking with Ensure Absent and existing VMHost Account' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $vmHostAccountMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostAccountScriptBlock))\n                $rolePermissionMock = [ScriptBlock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:rolePermissionScriptBlock))\n\n                Mock -CommandName Get-VMHostAccount -MockWith $vmHostAccountMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VIPermission -MockWith $rolePermissionMock -ModuleName $script:moduleName\n\n                $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n            }\n\n            AfterAll {\n                $script:resourceProperties.Ensure = 'Present'\n            }\n\n            It 'Should retrieve the correct settings from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.Id | Should -Be $script:vmHostAccount.Id\n                $result.Ensure | Should -Be 'Present'\n                $result.Role | Should -Be $script:accountPermission.Role\n                $result.Description | Should -Be $script:vmHostAccount.Description\n            }\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostAdvancedSettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostAdvancedSettings'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostAdvancedSettingsMocks.ps1\"\n\n        Describe 'VMHostAdvancedSettings\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAdvancedSettingsWithOptionManager\n            }\n\n            Context 'Invoking with hashtable where all Advanced Settings need to be updated' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenHashtableContainsAdvancedSettingsAndAllOfThemNeedToBeUpdated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-VMHostAdvancedSettings mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-VMHostAdvancedSettings'\n                        ParameterFilter = { $OptionManager -eq $script:optionManager -and $null -eq (Compare-Object -ReferenceObject $Options -DifferenceObject $script:allAdvancedOptionsToUpdate) }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with hashtable where not all Advanced Settings need to be updated' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenHashtableContainsAdvancedSettingsAndNotAllOfThemNeedToBeUpdated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-VMHostAdvancedSettings mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-VMHostAdvancedSettings'\n                        ParameterFilter = { $OptionManager -eq $script:optionManager -and $null -eq (Compare-Object -ReferenceObject $Options -DifferenceObject $script:notAllAdvancedOptionsToUpdate) }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with hashtable where no Advanced Settings need to be updated' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenHashtableContainsAdvancedSettingsAndNoneOfThemNeedToBeUpdated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Update-VMHostAdvancedSettings mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-VMHostAdvancedSettings'\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostAdvancedSettings\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAdvancedSettings\n            }\n\n            Context 'Invoking with hashtable where at least one Advanced Setting needs to be updated' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenHashtableContainsAtLeastOneAdvancedSettingThatNeedsToBeUpdated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when at least one Advanced Setting needs to be updated' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with hashtable where no Advanced Settings need to be updated' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenHashtableDoesNotContainAdvancedSettingsThatNeedToBeUpdated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when no Advanced Settings need to be updated' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostAdvancedSettings\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAdvancedSettings\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.Name | Should -Be $script:constants.VMHostName\n                $result.AdvancedSettings.Count | Should -Be $script:vmHostAdvancedSettings.Count\n\n                foreach ($advancedSettingName in $result.AdvancedSettings.Keys) {\n                    $vmHostAdvancedSetting = $script:vmHostAdvancedSettings | Where-Object { $_.Name -eq $advancedSettingName }\n                    $result.AdvancedSettings[$advancedSettingName] | Should -Be $vmHostAdvancedSetting.Value.ToString()\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostAgentVM.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostAgentVM'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostAgentVMMocks.ps1\"\n\n        Describe 'VMHostAgentVM\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAgentVMWithEsxAgentHostManagerWithNullAgentVmSettings\n            }\n\n            Context 'Invoking with AgentVmDatastore set to $null and AgentVmNetwork set to $null' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-VMHostAgentVMProperties\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-AgentVMConfiguration mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-AgentVMConfiguration'\n                        ParameterFilter = { $EsxAgentHostManager -eq $script:esxAgentHostManagerWithNullAgentVmSettings -and $EsxAgentHostManagerConfigInfo -eq $script:esxAgentHostManagerConfigInfoWithNullAgentVmSettings }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with AgentVmDatastore that is an existing Datastore and AgentVmNetwork that is an existing Network' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmDatastoreIsAnExistingDatastoreAndAgentVmNetworkIsAnExistingNetwork\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-AgentVMConfiguration mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-AgentVMConfiguration'\n                        ParameterFilter = { $EsxAgentHostManager -eq $script:esxAgentHostManagerWithNullAgentVmSettings -and $EsxAgentHostManagerConfigInfo -eq $script:esxAgentHostManagerConfigWithNotNullAgentVmSettings }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with AgentVmDatastore that is not an exisitng Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmDatastoreIsNotAnExistingDatastore\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Datastore does not exist' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not retrieve Datastore $($resourceProperties.AgentVmDatastore) for VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Invoking with AgentVmNetwork that is not an existing Network' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmNetworkIsNotAnExistingNetwork\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Network does not exist' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"Could not find Network $($resourceProperties.AgentVmNetwork) for VMHost $($script:vmHost.Name).\"\n                }\n            }\n        }\n\n        Describe 'VMHostAgentVM\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAgentVM\n            }\n\n            Context 'Invoking with AgentVm Settings set to $null and Server values not equal to $null' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsAreSetToNullAndServerValuesAreNotEqualToNull\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when AgentVm Settings are set to $null and Server values are not equal to $null' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with AgentVm Settings set to $null and Server values equal to $null' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsAreSetToNullAndServerValuesAreEqualToNull\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when AgentVm Settings are set to $null and Server values are equal to $null' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with AgentVm Settings not set to $null and Server values equal to $null' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsAreNotSetToNullAndServerValuesAreEqualToNull\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when AgentVm Settings are not set to $null and Server values are equal to $null' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with AgentVm Settings not equal to Server values' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsAreNotEqualToServerValues\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when AgentVm Settings are not equal to Server values' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with AgentVm Settings equal to Server values' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsAreEqualToServerValues\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when AgentVm Settings are equal to Server values' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostAgentVM\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAgentVM\n            }\n\n            Context 'Invoking with AgentVm Settings from the Server equal to $null' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsFromTheServerAreEqualToNull\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:constants.VMHostName\n\n                    <#\n                    In the Resource Implementation when setting the property value to $null,\n                    PowerShell converts it to an empty string, so the comparison should be against\n                    empty string instead of $null.\n                    #>\n                    $agentVmSettingEmptyValue = [string]::Empty\n\n                    $result.AgentVmDatastore | Should -Be $agentVmSettingEmptyValue\n                    $result.AgentVmNetwork | Should -Be $agentVmSettingEmptyValue\n                }\n            }\n\n            Context 'Invoking with AgentVm Settings from the Server not equal to $null' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAgentVmSettingsFromTheServerAreNotEqualToNull\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:constants.VMHostName\n                    $result.AgentVmDatastore | Should -Be $script:constants.DatastoreName\n                    $result.AgentVmNetwork | Should -Be $script:constants.NetworkName\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostAuthentication.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostAuthentication'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostAuthenticationMocks.ps1\"\n\n        Describe 'VMHostAuthentication\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAuthentication\n            }\n\n            Context 'When Domain Action is Join and error occurs while including the VMHost to the domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsJoinAndErrorOccursWhileIncludingTheVMHostToTheDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when Domain Action is Join and error occurs while including the VMHost to the domain' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not include VMHost $($script:vmHost.Name) in domain $($resourceProperties.DomainName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Domain Action is Join' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsJoin\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostAuthentication mock with the specified domain and credentials once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostAuthentication'\n                        ParameterFilter = {\n                            $VMHostAuthentication -eq $script:vmHostAuthenticationInfoWithoutDomain -and\n                            $Domain -eq $resourceProperties.DomainName -and\n                            $Credential -eq $resourceProperties.DomainCredential -and\n                            $JoinDomain -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Domain Action is Leave and error occurs while excluding the VMHost from the domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsLeaveAndErrorOccursWhileExcludingTheVMHostFromTheDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when Domain Action is Leave and error occurs while excluding the VMHost from the domain' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not exclude VMHost $($script:vmHost.Name) from domain $($resourceProperties.DomainName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Domain Action is Leave' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsLeave\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostAuthentication mock with the LeaveDomain and Force parameters once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostAuthentication'\n                        ParameterFilter = {\n                            $VMHostAuthentication -eq $script:vmHostAuthenticationInfoWithDomain -and\n                            $LeaveDomain -and\n                            $Force -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostAuthentication\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAuthentication\n            }\n\n            Context 'When error occurs while retrieving the VMHost Authentication info' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenErrorOccursWhileRetrievingTheVMHostAuthenticationInfo\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while retrieving the VMHost Authentication info' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Test() } | Should -Throw \"Could not retrieve Authentication information for VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Domain Action is Join and the VMHost is not included in the specified domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsJoinAndTheVMHostIsNotIncludedInTheSpecifiedDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Domain Action is Join and the VMHost is not included in the specified domain' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Domain Action is Join and the VMHost is included in the specified domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsJoinAndTheVMHostIsIncludedInTheSpecifiedDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Domain Action is Join and the VMHost is included in the specified domain' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Domain Action is Leave and the VMHost is not excluded from the specified domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsLeaveAndTheVMHostIsNotExcludedFromTheSpecifiedDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Domain Action is Leave and the VMHost is not excluded from the specified domain' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Domain Action is Leave and the VMHost is excluded from the specified domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDomainActionIsLeaveAndTheVMHostIsExcludedFromTheSpecifiedDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Domain Action is Leave and the VMHost is excluded from the specified domain' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostAuthentication\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostAuthentication\n            }\n\n            Context 'When the VMHost is included in the specified domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostIsIncludedInTheSpecifiedDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct values' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DomainName | Should -Be $script:vmHostAuthenticationInfoWithDomain.Domain\n                    $result.DomainAction | Should -Be $script:constants.DomainActionJoin\n                }\n            }\n\n            Context 'When the VMHost is excluded from the specified domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostIsExcludedFromTheSpecifiedDomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the correct values' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.DomainName | Should -Be $resourceProperties.DomainName\n                    $result.DomainAction | Should -Be $script:constants.DomainActionLeave\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostCache.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostCache'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostCacheMocks.ps1\"\n\n        Describe 'VMHostCache\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostCache\n            }\n\n            Context 'Invoking with negative Swap Size' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPassedSwapSizeIsNegative\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Swap Size is negative' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"The passed Swap Size $($script:constants.NegativeSwapSize) is less than zero.\"\n                }\n            }\n\n            Context 'Invoking with Swap Size bigger than Datastore Free Space' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPassedSwapSizeIsBiggerThanDatastoreFreeSpace\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Swap Size is bigger than the Datastore Free Space' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"The passed Swap Size $($script:constants.OverflowingSwapSize) is larger than the free space of the Datastore $($script:datastore.Name).\"\n                }\n            }\n\n            Context 'Invoking with Swap Size that results in an Error' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenUpdateCacheConfigurationResultsInError\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Update of the Cache Configuration results in an error' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"An error occured while updating Cache Configuration for VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Invoking with Swap Size that results in a Success' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenUpdateCacheConfigurationResultsInSuccess\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-HostCacheConfiguration mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-HostCacheConfiguration'\n                        ParameterFilter = { $VMHostCacheConfigurationManager -eq $script:vmHostCacheConfigurationManager -and $Spec -eq $script:hostCacheConfigurationSpec }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should call the Get-Task mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Get-Task'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:hostCacheConfigurationResult }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should call the Wait-Task mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Wait-Task'\n                        ParameterFilter = { $Task -eq $script:hostCacheConfigurationSuccessTask }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostCache\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostCache\n            }\n\n            Context 'Invoking with Swap Size not equal to current Swap Size' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenSwapSizeIsNotEqualToCurrentSwapSize\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Swap Size is not equal to the current Swap Size' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Swap Size equal to current Swap Size' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenSwapSizeIsEqualToCurrentSwapSize\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Swap Size is equal to the current Swap Size' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostCache\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostCache\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.Name | Should -Be $script:constants.VMHostName\n                $result.DatastoreName | Should -Be $script:datastore.Name\n                $result.SwapSizeGB | Should -Be $script:constants.SwapSizeGB\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostConfiguration.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostConfiguration'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostConfigurationMocks.ps1\"\n\n        Describe 'VMHostConfiguration\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostConfiguration\n            }\n\n            Context 'When the VMHost configuration needs to be modified and error occurs while retrieving the Time Zone' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedAndErrorOccursWhileRetrievingTheTimeZone\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while retrieving the Time Zone' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not retrieve Time Zone $($script:constants.VMHostUTCTimeZoneName) available on VMHost $($script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the VMHost configuration needs to be modified and error occurs while retrieving the VM Swapfile Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedAndErrorOccursWhileRetrievingTheVMSwapFileDatastore\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while retrieving the VM Swapfile Datastore' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not retrieve Datastore $($script:constants.VMSwapfileDatastoreTwoName) from VMHost $($script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the VMHost configuration needs to be modified and Drs Recommendation should be generated and applied' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedAndDrsRecommendationShouldBeGeneratedAndApplied\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHost mock with the specified VMHost and configuration parameters to modify once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithClusterWithManualDrsAutomationLevelAsParentAndSettingsToModify -and\n                            $State -eq $script:constants.VMHostMaintenanceState -and\n                            $Evacuate -eq $script:constants.EvacuateVMs -and\n                            $VsanDataMigrationMode -eq $script:constants.VsanDataMigrationMode -and\n                            $LicenseKey -eq $script:constants.VMHostLicenseKeyTwo -and\n                            $TimeZone -eq $script:vmHostUTCTimeZone -and\n                            $VMSwapfileDatastore -eq $script:vmSwapfileDatastoreTwo -and\n                            $VMSwapfilePolicy -eq $script:constants.WithVMDatastoreVMSwapfilePolicy -and\n                            $Profile -eq $script:hostProfile -and\n                            $RunAsync -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When the VMHost configuration needs to be modified without generating a Drs Recommendation' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostConfigurationNeedsToBeModifiedWithoutGeneratingADrsRecommendation\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHost mock with the specified VMHost and configuration parameters to modify once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify -and\n                            $State -eq $script:constants.VMHostMaintenanceState -and\n                            $Evacuate -eq $script:constants.EvacuateVMs -and\n                            $VsanDataMigrationMode -eq $script:constants.VsanDataMigrationMode -and\n                            $LicenseKey -eq $script:constants.VMHostLicenseKeyTwo -and\n                            $TimeZone -eq $script:vmHostUTCTimeZone -and\n                            $VMSwapfileDatastore -eq $script:vmSwapfileDatastoreTwo -and\n                            $VMSwapfilePolicy -eq $script:constants.WithVMDatastoreVMSwapfilePolicy -and\n                            $Profile -eq $script:hostProfile -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When the CryptoKey of the VMHost needs to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheCryptoKeyOfTheVMHostNeedsToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHost mock with the specified VMHost and Kms Cluster once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithClusterWithFullyAutomatedDrsAutomationLevelAsParentAndSettingsToModify -and\n                            $KmsCluster -eq $script:kmsCluster -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostConfiguration\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostConfiguration\n            }\n\n            Context 'When the VMHost configuration does not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostConfigurationDoesNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the VMHost configuration does not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the VMHost configuration needs to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheVMHostConfigurationNeedsToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost configuration needs to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostConfiguration\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostConfiguration\n            }\n\n            Context 'When the Host Profile and Kms Cluster names are not specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheHostProfileAndKmsClusterNamesAreNotSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHostWithoutSettingsToModify.Name\n                    $result.State | Should -Be $script:vmHostWithoutSettingsToModify.ConnectionState.ToString()\n                    $result.Evacuate | Should -Be $resourceProperties.Evacuate\n                    $result.VsanDataMigrationMode | Should -Be $resourceProperties.VsanDataMigrationMode\n                    $result.LicenseKey | Should -Be $script:vmHostWithoutSettingsToModify.LicenseKey\n                    $result.TimeZoneName | Should -Be $script:vmHostWithoutSettingsToModify.TimeZone.Name\n                    $result.VMSwapfileDatastoreName | Should -Be $script:vmHostWithoutSettingsToModify.VMSwapfileDatastore.Name\n                    $result.VMSwapfilePolicy | Should -Be $script:vmHostWithoutSettingsToModify.VMSwapfilePolicy.ToString()\n                    $result.HostProfileName | Should -BeNullOrEmpty\n                    $result.KmsClusterName | Should -BeNullOrEmpty\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostDnsSettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostDnsSettings'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n    Dhcp = $false\n    DomainName = 'Domain Name'\n    HostName = 'Host Name'\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostDnsSettings\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.Dhcp = $false\n            $script:resourceProperties.VirtualNicDevice = [string]::Empty\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ ConfigManager = [VMware.Vim.HostConfigManager] @{ NetworkSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostNetworkSystem'; Value = 'networkSystem' } } } }\n                }\n                $networkSystemMock = {\n                    return [VMware.Vim.HostNetworkSystem] @{}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Dhcp set to $false' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostNetworkSystem'; Value = 'networkSystem' }\n                $networkSystemObject = [VMware.Vim.HostNetworkSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ ConfigManager = [VMware.Vim.HostConfigManager] @{ NetworkSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostNetworkSystem'; Value = 'networkSystem' } } } }\n                }\n                $dnsConfigMock = {\n                    return [VMware.Vim.HostDnsConfig] @{ Dhcp = $false; DomainName = 'Domain Name'; HostName = 'Host Name' }\n                }\n                $networkSystemMock = {\n                    return [VMware.Vim.HostNetworkSystem] @{}\n                }\n\n                $dnsConfigObject = [VMware.Vim.HostDnsConfig] @{ Dhcp = $false; DomainName = 'Domain Name'; HostName = 'Host Name' }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DNSConfig -MockWith $dnsConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n                Mock -CommandName Update-DNSConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call New-DNSConfig mock once with the passed parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DNSConfig `\n                                  -ParameterFilter { $Dhcp -eq $script:resourceProperties.Dhcp -and $DomainName -eq $script:resourceProperties.DomainName -and `\n                                                     $HostName -eq $script:resourceProperties.HostName } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-View mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $networkSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Update-DNSConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DNSConfig `\n                                  -ParameterFilter { $NetworkSystem -eq $networkSystemObject -and $DnsConfig -eq $dnsConfigObject } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Dhcp set to $true' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostNetworkSystem'; Value = 'networkSystem' }\n                $networkSystemObject = [VMware.Vim.HostNetworkSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ ConfigManager = [VMware.Vim.HostConfigManager] @{ NetworkSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostNetworkSystem'; Value = 'networkSystem' } } } }\n                }\n                $dnsConfigMock = {\n                    return [VMware.Vim.HostDnsConfig] @{ Dhcp = $true; DomainName = 'Domain Name'; HostName = 'Host Name'; VirtualNicDevice = 'VirtualNicDevice' }\n                }\n                $networkSystemMock = {\n                    return [VMware.Vim.HostNetworkSystem] @{}\n                }\n\n                $script:resourceProperties.Dhcp = $true\n                $script:resourceProperties.VirtualNicDevice = 'VirtualNicDevice'\n\n                $dnsConfigObject = [VMware.Vim.HostDnsConfig] @{ Dhcp = $true; DomainName = 'Domain Name'; HostName = 'Host Name'; VirtualNicDevice = 'VirtualNicDevice' }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DNSConfig -MockWith $dnsConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n                Mock -CommandName Update-DNSConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call New-DNSConfig mock once with the passed parameters' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DNSConfig `\n                                  -ParameterFilter { $Dhcp -eq $script:resourceProperties.Dhcp -and $DomainName -eq $script:resourceProperties.DomainName -and `\n                                                     $HostName -eq $script:resourceProperties.HostName -and $VirtualNicDevice -eq $script:resourceProperties.VirtualNicDevice } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-View mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $networkSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Update-DNSConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DNSConfig `\n                                  -ParameterFilter { $NetworkSystem -eq $networkSystemObject -and $DnsConfig -eq $dnsConfigObject } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostDnsSettings\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.Dhcp = $false\n            $script:resourceProperties.VirtualNicDevice = [string]::Empty\n            $script:resourceProperties.Address = $null\n            $script:resourceProperties.SearchDomain = $null\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ ConfigManager = [VMware.Vim.HostConfigManager] @{ NetworkSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostNetworkSystem'; Value = 'networkSystem' } } } }\n                }\n                $networkSystemMock = {\n                    return [VMware.Vim.HostNetworkSystem] @{}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with equal DNS Configs' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ Network = [VMware.Vim.HostNetworkInfo] @{ DnsConfig `\n                         = [VMware.Vim.HostDnsConfig] @{ VirtualNicDevice = [string]::Empty; Dhcp = $false; DomainName = 'Domain Name'; HostName = 'Host Name'; Address = @('address 1', 'address 2'); SearchDomain = @('search domain 1') } } } } }\n                }\n\n                $script:resourceProperties.Address = @('address 2', 'address 1')\n                $script:resourceProperties.SearchDomain = @('search domain 1')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The DNS Configs are equal)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with different DNS Addresses' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ Network = [VMware.Vim.HostNetworkInfo] @{ DnsConfig `\n                         = [VMware.Vim.HostDnsConfig] @{ Dhcp = $false; DomainName = 'Domain Name'; HostName = 'Host Name'; Address = @('address 1', 'address 2'); SearchDomain = @('search domain 1') } } } } }\n                }\n\n                $script:resourceProperties.Address = @('address 1')\n                $script:resourceProperties.SearchDomain = @('search domain 1')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The DNS Configs are not equal)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with different DNS VirtualNicDevice' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ Network = [VMware.Vim.HostNetworkInfo] @{ DnsConfig `\n                         = [VMware.Vim.HostDnsConfig] @{ Dhcp = $false; DomainName = 'Domain Name'; HostName = 'Host Name'; VirtualNicDevice = 'Fake Virtual Nic Device' } } } } }\n                }\n\n                $script:resourceProperties.VirtualNicDevice = \"Virtual Nic Device\"\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The DNS Configs are not equal)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n    }\n\n    Describe 'VMHostDnsSettings\\Get' -Tag 'Get' {\n        BeforeAll {\n            # Arrange\n            $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n            $viServerMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n            }\n            $vmHostMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ Network = [VMware.Vim.HostNetworkInfo] @{ DnsConfig `\n                     = [VMware.Vim.HostDnsConfig] @{ Dhcp = $false; DomainName = 'Domain Name'; HostName = 'Host Name'; Address = @('address 1', 'address 2'); SearchDomain = @('Search Domain 1'); VirtualNicDevice = 'Virtual Nic Device'; Ipv6VirtualNicDevice = 'Ipv6' } } } } }\n            }\n\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        }\n\n        # Arrange\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Connect-VIServer `\n                              -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should call Get-VMHost mock with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Get-VMHost `\n                              -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Name | Should -Be $script:resourceProperties.Name\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Dhcp | Should -Be $false\n            $result.DomainName | Should -Be 'Domain Name'\n            $result.HostName | Should -Be 'Host Name'\n            $result.Address | Should -Be @('address 1', 'address 2')\n            $result.SearchDomain | Should -Be @('Search Domain 1')\n            $result.VirtualNicDevice | Should -Be 'Virtual Nic Device'\n            $result.Ipv6VirtualNicDevice | Should -Be 'Ipv6'\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostFirewallRuleset.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostFirewallRuleset'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostFirewallRulesetMocks.ps1\"\n\n        Describe 'VMHostFirewallRuleset\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostFirewallRuleset\n            }\n\n            Context 'When error occurs while modifying the state of the VMHost firewall ruleset' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenErrorOccursWhileModifyingTheStateOfTheVMHostFirewallRuleset\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while modifying the state of the VMHost firewall ruleset' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not modify the state of firewall ruleset $($script:constants.FirewallRulesetName) on VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When no error occurs while modifying the state of the VMHost firewall ruleset' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenNoErrorOccursWhileModifyingTheStateOfTheVMHostFirewallRuleset\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostFirewallException mock with the specified firewall ruleset once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostFirewallException'\n                        ParameterFilter = {\n                            $Exception -eq $script:vmHostFirewallRuleset -and\n                            $Enabled -eq !$script:constants.FirewallRulesetEnabled -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When error occurs while modifying the allowed IP addresses list of the VMHost firewall ruleset' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenErrorOccursWhileModifyingTheAllowedIPAddressesListOfTheVMHostFirewallRuleset\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while modifying the allowed IP addresses list of the VMHost firewall ruleset' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not modify the allowed IP addresses list of firewall ruleset $($script:constants.FirewallRulesetName) on VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When no error occurs while modifying the allowed IP addresses list of the VMHost firewall ruleset' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenNoErrorOccursWhileModifyingTheAllowedIPAddressesListOfTheVMHostFirewallRuleset\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Update-VMHostFirewallRuleset mock with the specified IP addresses and IP networks once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-VMHostFirewallRuleset'\n                        ParameterFilter = {\n                            $VMHostFirewallSystem -eq $script:vmHostFirewallSystem -and\n                            $VMHostFirewallRulesetId -eq $script:vmHostFirewallRuleset.ExtensionData.Key -and\n                            $VMHostFirewallRulesetSpec -eq $script:vmHostFirewallRulesetSpec\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostFirewallRuleset\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostFirewallRuleset\n            }\n\n            Context 'When the state of the VMHost firewall ruleset does not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheStateOfTheVMHostFirewallRulesetDoesNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the state of the VMHost firewall ruleset does not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n\n            Context 'When the state of the VMHost firewall ruleset needs to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheStateOfTheVMHostFirewallRulesetNeedsToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the state of the VMHost firewall ruleset needs to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When the allowed IP addresses list of the VMHost firewall ruleset does not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheAllowedIPAddressesListOfTheVMHostFirewallRulesetDoesNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the allowed IP addresses list of the VMHost firewall ruleset does not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n\n            Context 'When the allowed IP addresses list of the VMHost firewall ruleset needs to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheAllowedIPAddressesListOfTheVMHostFirewallRulesetNeedsToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the allowed IP addresses list of the VMHost firewall ruleset needs to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n        }\n\n        Describe 'VMHostFirewallRuleset\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostFirewallRuleset\n\n                $resourceProperties = New-VMHostFirewallRulesetProperties\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VMHostName | Should -Be $script:vmHost.Name\n                $result.Name | Should -Be $script:vmHostFirewallRuleset.Name\n                $result.Enabled | Should -Be $script:vmHostFirewallRuleset.Enabled\n                $result.AllIP | Should -Be $script:vmHostFirewallRuleset.ExtensionData.AllowedHosts.AllIp\n                $result.IPAddresses | Should -Be ($script:vmHostFirewallRuleset.ExtensionData.AllowedHosts.IPAddress + $script:constants.FirewallRulesetIPNetworksOne)\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostGraphics/VMHostGraphics.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostGraphics'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostGraphicsMocks.ps1\"\n\n        Describe 'VMHostGraphics\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostGraphics\n\n                <#\n                The Product Line should be modified here to avoid infinite loop in the EnsureVMHostIsInDesiredState()\n                because when the Connection is a vCenter and the ESXi is restarted the VMHost State changes from 'Maintenance' to\n                'NotResponding' and again to 'Maintenance'. This behaviour cannot be mocked in the Tests.\n                #>\n                $script:viServer.ProductLine = $script:constants.ESXiProductId\n\n                # Arrange\n                $resourceProperties = New-MocksInSet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should call the Update-GraphicsConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-GraphicsConfig'\n                    ParameterFilter = { $VMHostGraphicsManager -eq $script:vmHostGraphicsManager -and $VMHostGraphicsConfig -eq $script:vmHostGraphicsConfigWithoutGraphicsDevice }\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the Restart-VMHost mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Restart-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and !$Confirm }\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            AfterAll {\n                # The Product Line should be set to its default value after all Tests in this Context block.\n                $script:viServer.ProductLine = $script:constants.vCenterProductId\n            }\n        }\n\n        Describe 'VMHostGraphics\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostGraphics\n            }\n\n            Context 'Invoking with DefaultGraphicsType value not equal to Graphics Configuration DefaultGraphicsType value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDefaultGraphicsTypeValueIsNotEqualToGraphicsConfigurationDefaultGraphicsTypeValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when DefaultGraphicsType value is not equal to Graphics Configuration DefaultGraphicsType value' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with SharedPassthruAssignmentPolicy value not equal to Graphics Configuration SharedPassthruAssignmentPolicy value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenSharedPassthruAssignmentPolicyValueIsNotEqualToGraphicsConfigurationSharedPassthruAssignmentPolicyValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when SharedPassthruAssignmentPolicy value is not equal to Graphics Configuration SharedPassthruAssignmentPolicy value' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostGraphics\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostGraphics\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:constants.VMHostName\n                    $result.RestartTimeoutMinutes | Should -Be $script:constants.DefaultVMHostRestartTimeoutMinutes\n                    $result.GraphicsType | Should -Be $script:constants.DefaultGraphicsType\n                    $result.SharedPassthruAssignmentPolicy | Should -Be $script:constants.SharedPassthruAssignmentPolicy\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostGraphics/VMHostGraphicsDevice.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostGraphicsDevice'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostGraphicsDeviceMocks.ps1\"\n\n        Describe 'VMHostGraphicsDevice\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostGraphicsDevice\n\n                <#\n                The Product Line should be modified here to avoid infinite loop in the EnsureVMHostIsInDesiredState()\n                because when the Connection is a vCenter and the ESXi is restarted the VMHost State changes from 'Maintenance' to\n                'NotResponding' and again to 'Maintenance'. This behaviour cannot be mocked in the Tests.\n                #>\n                $script:viServer.ProductLine = $script:constants.ESXiProductId\n\n                # Arrange\n                $resourceProperties = New-MocksInSet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should call the Update-GraphicsConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-GraphicsConfig'\n                    ParameterFilter = { $VMHostGraphicsManager -eq $script:vmHostGraphicsManager -and $VMHostGraphicsConfig -eq $script:vmHostGraphicsConfigWithGraphicsDevice }\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call the Restart-VMHost mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Restart-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and !$Confirm }\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            AfterAll {\n                # The Product Line should be set to its default value after all Tests in this Context block.\n                $script:viServer.ProductLine = $script:constants.vCenterProductId\n            }\n        }\n\n        Describe 'VMHostGraphicsDevice\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostGraphicsDevice\n            }\n\n            Context 'Invoking with Graphics Device that is not existing' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenGraphicsDeviceIsNotExisting\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Graphics Device does not exist' {\n                    # Act && Assert\n                    { $resource.Test() } | Should -Throw \"Device $($script:constants.GraphicsDeviceId + $script:constants.GraphicsDeviceId) was not found in the available Graphics devices.\"\n                }\n            }\n\n            Context 'Invoking with Graphics Device Type value not equal to Graphics Configuration Graphics Device Type value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenGraphicsDeviceTypeValueIsNotEqualToGraphicsConfigurationGraphicsDeviceTypeValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Graphics Device Type value is not equal to Graphics Configuration Graphics Device Type value' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Graphics Device Type value equal to Graphics Configuration Graphics Device Type value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenGraphicsDeviceTypeValueIsEqualToGraphicsConfigurationGraphicsDeviceTypeValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Graphics Device Type value is equal to Graphics Configuration Graphics Device Type value' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostGraphicsDevice\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostGraphicsDevice\n            }\n\n            Context 'Invoking with Graphics Device that is not existing' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenGraphicsDeviceIsNotExisting\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Get()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the Graphics Device does not exist' {\n                    # Act && Assert\n                    { $resource.Get() } | Should -Throw \"Device $($script:constants.GraphicsDeviceId + $script:constants.GraphicsDeviceId) was not found in the available Graphics devices.\"\n                }\n            }\n\n            Context 'Invoking with existing Graphics Device' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenGraphicsDeviceIsExisting\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.Name | Should -Be $script:constants.VMHostName\n                    $result.RestartTimeoutMinutes | Should -Be $script:constants.DefaultVMHostRestartTimeoutMinutes\n                    $result.Id | Should -Be $script:constants.GraphicsDeviceId\n                    $result.GraphicsType | Should -Be $script:constants.DefaultGraphicsType\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostIScsiHba/VMHostIScsiHba.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostIScsiHba'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostIScsiHbaMocks.ps1\"\n\n        Describe 'VMHostIScsiHba\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHba\n            }\n\n            Context 'When error occurs while configuring the iSCSI Host Bus Adapter CHAP settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenErrorOccursWhileConfiguringTheiSCSIHostBusAdapterCHAPSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while configuring the iSCSI Host Bus Adapter CHAP settings' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not configure iSCSI Host Bus Adapter $($script:constants.IScsiHbaDeviceName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When no error occurs while configuring the iSCSI Host Bus Adapter CHAP settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenNoErrorOccursWhileConfiguringTheiSCSIHostBusAdapterCHAPSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostHba mock with the specified iSCSI Host Bus Adapter and CHAP settings once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostHba'\n                        ParameterFilter = {\n                            $IScsiHba -eq $script:iScsiHba -and\n                            $ChapType -eq $script:constants.ChapTypeProhibited -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When modifying the iSCSI name of the iSCSI Host Bus Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenModifyingTheIScsiNameOfTheIScsiHostBusAdapter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostHba mock with the specified iSCSI Host Bus Adapter and iSCSI name once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostHba'\n                        ParameterFilter = {\n                            $IScsiHba -eq $script:iScsiHba -and\n                            $IScsiName -eq $script:constants.IScsiName -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostIScsiHba\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHba\n            }\n\n            Context 'When the CHAP settings of the iSCSI Host Bus Adapter do not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterDoNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the CHAP settings of the iSCSI Host Bus Adapter do not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n\n            Context 'When the CHAP settings of the iSCSI Host Bus Adapter need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the CHAP settings of the iSCSI Host Bus Adapter need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When the iSCSI name of the iSCSI Host Bus Adapter does not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheIScsiNameOfTheIScsiHostBusAdapterDoesNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the iSCSI name of the iSCSI Host Bus Adapter does not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n\n            Context 'When the iSCSI name of the iSCSI Host Bus Adapter needs to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheIScsiNameOfTheIScsiHostBusAdapterNeedsToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the iSCSI name of the iSCSI Host Bus Adapter needs to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n        }\n\n        Describe 'VMHostIScsiHba\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHba\n\n                $resourceProperties = New-VMHostIScsiHbaProperties\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VMHostName | Should -Be $script:vmHost.Name\n                $result.Name | Should -Be $script:iScsiHba.Device\n                $result.IScsiName | Should -Be $script:iScsiHba.IScsiName\n                $result.ChapType | Should -Be $script:iScsiHba.AuthenticationProperties.ChapType\n                $result.ChapName | Should -Be $script:iScsiHba.AuthenticationProperties.ChapName\n                $result.MutualChapEnabled | Should -Be $script:iScsiHba.AuthenticationProperties.MutualChapEnabled\n                $result.MutualChapName | Should -Be $script:iScsiHba.AuthenticationProperties.MutualChapName\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostIScsiHba/VMHostIScsiHbaBaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $vmHostIScsiHbaBaseDSCClassName = 'VMHostIScsiHbaBaseDSC'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostIScsiHbaBaseDSCMocks.ps1\"\n\n        Describe 'VMHostIScsiHbaBaseDSCBaseDSC\\GetIScsiHba' -Tag 'GetIScsiHba' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaBaseDSC\n            }\n\n            Context 'When error occurs while retrieving the iSCSI Host Bus Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenErrorOccursWhileRetrievingTheiSCSIHostBusAdapter\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $vmHostIScsiHbaBaseDSC.GetIScsiHba($script:constants.IScsiHbaDeviceName)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while retrieving the iSCSI Host Bus Adapter' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $vmHostIScsiHbaBaseDSC.GetIScsiHba($script:constants.IScsiHbaDeviceName) } | Should -Throw \"Could not retrieve iSCSI Host Bus Adapter $($script:constants.IScsiHbaDeviceName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the iSCSI Host Bus Adapter is retrieved successfully' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenTheiSCSIHostBusAdapterIsRetrievedSuccessfully\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $vmHostIScsiHbaBaseDSC.GetIScsiHba($script:constants.IScsiHbaDeviceName)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the iSCSI Host Bus Adapter with the specified name when the iSCSI Host Bus Adapter exists' {\n                    # Act\n                    $iScsiHba = $vmHostIScsiHbaBaseDSC.GetIScsiHba($script:constants.IScsiHbaDeviceName)\n\n                    # Assert\n                    $iScsiHba | Should -Be $script:iScsiHba\n                }\n            }\n        }\n\n        Describe 'VMHostIScsiHbaBaseDSCBaseDSC\\ShouldModifyCHAPSettings' -Tag 'ShouldModifyCHAPSettings' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaBaseDSC\n            }\n\n            Context 'When the CHAP settings of the iSCSI Host Bus Adapter do not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterDoNotNeedToBeModified\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should return $false when the CHAP settings of the iSCSI Host Bus Adapter do not need to be modified' {\n                    # Act\n                    $result = $vmHostIScsiHbaBaseDSC.ShouldModifyCHAPSettings($script:iScsiHba.AuthenticationProperties, $null, $null)\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When the CHAP settings of the iSCSI Host Bus Adapter need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenTheCHAPSettingsOfTheiSCSIHostBusAdapterNeedToBeModified\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should return $true when the CHAP settings of the iSCSI Host Bus Adapter need to be modified' {\n                    # Act\n                    $result = $vmHostIScsiHbaBaseDSC.ShouldModifyCHAPSettings($script:iScsiHba.AuthenticationProperties, $null, $null)\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n        }\n\n        Describe 'VMHostIScsiHbaBaseDSCBaseDSC\\PopulateCmdletParametersWithCHAPSettings' -Tag 'PopulateCmdletParametersWithCHAPSettings' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaBaseDSC\n            }\n\n            Context 'When InheritChap and InheritMutualChap are not specified and ChapType is Required' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenInheritChapAndInheritMutualChapAreNotSpecifiedAndChapTypeIsRequired\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                    $cmdletParams = @{}\n                }\n\n                It 'Should populate the cmdlet parameters hashtable with the CHAP and MutualCHAP settings' {\n                    # Act\n                    $vmHostIScsiHbaBaseDSC.PopulateCmdletParametersWithCHAPSettings($cmdletParams, $null, $null)\n\n                    # Assert\n                    $cmdletParams.Keys.Count | Should -Be 6\n                    $cmdletParams.ChapType | Should -Be $script:constants.ChapTypeRequired\n                    $cmdletParams.ChapName | Should -Be $script:constants.ChapName\n                    $cmdletParams.ChapPassword | Should -Be $script:constants.ChapPassword\n                    $cmdletParams.MutualChapEnabled | Should -Be $script:constants.MutualChapEnabled\n                    $cmdletParams.MutualChapName | Should -Be $script:constants.MutualChapName\n                    $cmdletParams.MutualChapPassword | Should -Be $script:constants.MutualChapPassword\n                }\n            }\n\n            Context 'When InheritChap and InheritMutualChap are not specified and ChapType is Prohibited' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenInheritChapAndInheritMutualChapAreNotSpecifiedAndChapTypeIsProhibited\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                    $cmdletParams = @{}\n                }\n\n                It 'Should populate the cmdlet parameters hashtable without the CHAP and MutualCHAP settings' {\n                    # Act\n                    $vmHostIScsiHbaBaseDSC.PopulateCmdletParametersWithCHAPSettings($cmdletParams, $null, $null)\n\n                    # Assert\n                    $cmdletParams.Keys.Count | Should -Be 1\n                    $cmdletParams.ChapType | Should -Be $script:constants.ChapTypeProhibited\n                }\n            }\n\n            Context 'When InheritChap and InheritMutualChap are not specified, ChapType is Required and MutualChapEnabled is $false' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenInheritChapAndInheritMutualChapAreNotSpecifiedChapTypeIsRequiredAndMutualChapEnabledIsFalse\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                    $cmdletParams = @{}\n                }\n\n                It 'Should populate the cmdlet parameters hashtable with the CHAP settings and without the MutualChapName and MutualChapPassword settings' {\n                    # Act\n                    $vmHostIScsiHbaBaseDSC.PopulateCmdletParametersWithCHAPSettings($cmdletParams, $null, $null)\n\n                    # Assert\n                    $cmdletParams.Keys.Count | Should -Be 4\n                    $cmdletParams.ChapType | Should -Be $script:constants.ChapTypeRequired\n                    $cmdletParams.ChapName | Should -Be $script:constants.ChapName\n                    $cmdletParams.ChapPassword | Should -Be $script:constants.ChapPassword\n                    $cmdletParams.MutualChapEnabled | Should -Be (!$script:constants.MutualChapEnabled)\n                }\n            }\n\n            Context 'When InheritChap and InheritMutualChap are both specified with $false value' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenInheritChapAndInheritMutualChapAreBothSpecifiedWithFalseValue\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                    $cmdletParams = @{}\n                }\n\n                It 'Should populate the cmdlet parameters hashtable with the CHAP, MutualCHAP, InheritChap and InheritMutualChap settings' {\n                    # Act\n                    $vmHostIScsiHbaBaseDSC.PopulateCmdletParametersWithCHAPSettings($cmdletParams, !$script:constants.ChapInherited, !$script:constants.MutualChapInherited)\n\n                    # Assert\n                    $cmdletParams.Keys.Count | Should -Be 8\n                    $cmdletParams.ChapType | Should -Be $script:constants.ChapTypeRequired\n                    $cmdletParams.InheritChap | Should -Be (!$script:constants.ChapInherited)\n                    $cmdletParams.ChapName | Should -Be $script:constants.ChapName\n                    $cmdletParams.ChapPassword | Should -Be $script:constants.ChapPassword\n                    $cmdletParams.InheritMutualChap | Should -Be (!$script:constants.MutualChapInherited)\n                    $cmdletParams.MutualChapEnabled | Should -Be $script:constants.MutualChapEnabled\n                    $cmdletParams.MutualChapName | Should -Be $script:constants.MutualChapName\n                    $cmdletParams.MutualChapPassword | Should -Be $script:constants.MutualChapPassword\n                }\n            }\n\n            Context 'When InheritChap and InheritMutualChap are both specified with $true value' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostIScsiHbaBaseDSCProperties = New-MocksWhenInheritChapAndInheritMutualChapAreBothSpecifiedWithTrueValue\n                    $vmHostIScsiHbaBaseDSC = New-Object -TypeName $vmHostIScsiHbaBaseDSCClassName -Property $vmHostIScsiHbaBaseDSCProperties\n\n                    $vmHostIScsiHbaBaseDSC.ConnectVIServer()\n                    $vmHostIScsiHbaBaseDSC.RetrieveVMHost()\n                    $cmdletParams = @{}\n                }\n\n                It 'Should populate the cmdlet parameters hashtable with the InheritChap and InheritMutualChap settings and without the CHAP and Mutual CHAP settings' {\n                    # Act\n                    $vmHostIScsiHbaBaseDSC.PopulateCmdletParametersWithCHAPSettings($cmdletParams, $script:constants.ChapInherited, $script:constants.MutualChapInherited)\n\n                    # Assert\n                    $cmdletParams.Keys.Count | Should -Be 2\n                    $cmdletParams.InheritChap | Should -Be $script:constants.ChapInherited\n                    $cmdletParams.InheritMutualChap | Should -Be $script:constants.MutualChapInherited\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostIScsiHba/VMHostIScsiHbaTarget.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostIScsiHbaTarget'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostIScsiHbaTargetMocks.ps1\"\n\n        Describe 'VMHostIScsiHbaTarget\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaTarget\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is not created and error occurs while creating the iSCSI Host Bus Adapter target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsNotCreatedAndErrorOccursWhileCreatingTheiSCSIHostBusAdapterTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the iSCSI Host Bus Adapter target' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not create iSCSI Host Bus Adapter target with IP address $($script:constants.IScsiIPEndPoint) on iSCSI Host Bus Adapter device $($script:iScsiHba.Device). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is not created and no error occurs while creating the iSCSI Host Bus Adapter Send target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsNotCreatedAndNoErrorOccursWhileCreatingTheiSCSIHostBusAdapterSendTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-IScsiHbaTarget mock with the specified Address, Port and iSCSI Host Bus Adapter once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-IScsiHbaTarget'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Address -eq $script:constants.IScsiHbaTargetAddress -and\n                            $Port -eq $script:constants.IScsiHbaTargetPort -and\n                            $IScsiHba -eq $script:iScsiHba -and\n                            $Type -eq $script:constants.IScsiHbaSendTargetType -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is not created and no error occurs while creating the iSCSI Host Bus Adapter Static target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsNotCreatedAndNoErrorOccursWhileCreatingTheiSCSIHostBusAdapterStaticTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-IScsiHbaTarget mock with the specified Address, Port, IScsiName and iSCSI Host Bus Adapter once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-IScsiHbaTarget'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Address -eq $script:constants.IScsiHbaTargetAddress -and\n                            $Port -eq $script:constants.IScsiHbaTargetPort -and\n                            $IScsiHba -eq $script:iScsiHba -and\n                            $Type -eq $script:constants.IScsiHbaStaticTargetType -and\n                            $IScsiName -eq $script:constants.IScsiName -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is already created and error occurs while modifying the CHAP settings of the iSCSI Host Bus Adapter target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndErrorOccursWhileModifyingTheCHAPSettingsOfTheiSCSIHostBusAdapterTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while modifying the CHAP settings of the iSCSI Host Bus Adapter target' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not modify CHAP settings of iSCSI Host Bus Adapter target with IP address $($script:constants.IScsiIPEndPoint) on iSCSI Host Bus Adapter device $($script:iScsiHba.Device). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is already created and the no error occurs while modifying the CHAP settings of the iSCSI Host Bus Adapter target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndNoErrorOccursWhileModifyingTheCHAPSettingsOfTheiSCSIHostBusAdapterTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-IScsiHbaTarget mock with the specified iSCSI Host Bus Adapter target once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-IScsiHbaTarget'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Target -eq $script:iScsiHbaTarget -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the iSCSI Host Bus Adapter target is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-IScsiHbaTarget mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-IScsiHbaTarget'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Target -eq $script:iScsiHbaTarget -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent, the iSCSI Host Bus Adapter target is not removed and error occurs while removing the iSCSI Host Bus Adapter target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheiSCSIHostBusAdapterTargetIsNotRemovedAndErrorOccursWhileRemovingTheiSCSIHostBusAdapterTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while removing the iSCSI Host Bus Adapter target' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not remove iSCSI Host Bus Adapter target with IP address $($script:constants.IScsiIPEndPoint) from iSCSI Host Bus Adapter device $($script:iScsiHba.Device). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Absent, the iSCSI Host Bus Adapter target is not removed and no error occurs while removing the iSCSI Host Bus Adapter target' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheiSCSIHostBusAdapterTargetIsNotRemovedAndNoErrorOccursWhileRemovingTheiSCSIHostBusAdapterTarget\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-IScsiHbaTarget mock with the specified iSCSI Host Bus Adapter target once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-IScsiHbaTarget'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Target -eq $script:iScsiHbaTarget -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostIScsiHbaTarget\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaTarget\n            }\n\n            Context 'When Ensure is Present and the iSCSI Host Bus Adapter target is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheiSCSIHostBusAdapterTargetIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the iSCSI Host Bus Adapter target is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is already created and CHAP settings do not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndCHAPSettingsDoNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, the iSCSI Host Bus Adapter target is already created and CHAP settings do not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Present, the iSCSI Host Bus Adapter target is already created and CHAP settings need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndCHAPSettingsNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the iSCSI Host Bus Adapter target is already created and CHAP settings need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Absent and the iSCSI Host Bus Adapter target is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the iSCSI Host Bus Adapter target is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Absent and the iSCSI Host Bus Adapter target is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the iSCSI Host Bus Adapter target is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -BeFalse\n                }\n            }\n        }\n\n        Describe 'VMHostIScsiHbaTarget\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaTarget\n            }\n\n            Context 'When Ensure is Present and the iSCSI Host Bus Adapter target is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheiSCSIHostBusAdapterTargetIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.Address | Should -Be $resourceProperties.Address\n                    $result.Port | Should -Be $resourceProperties.Port\n                    $result.IScsiHbaName | Should -Be $resourceProperties.IScsiHbaName\n                    $result.TargetType | Should -Be $resourceProperties.TargetType\n                    $result.IScsiName | Should -Be $resourceProperties.IScsiName\n                    $result.InheritChap | Should -BeNull\n                    $result.ChapType | Should -Be 'Unset'\n                    $result.ChapName | Should -BeNullOrEmpty\n                    $result.InheritMutualChap | Should -BeNull\n                    $result.MutualChapEnabled | Should -BeNull\n                    $result.MutualChapName | Should -BeNullOrEmpty\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'When Ensure is Present and the iSCSI Host Bus Adapter target is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheiSCSIHostBusAdapterTargetIsAlreadyCreatedAndCHAPSettingsDoNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.Address | Should -Be $script:iScsiHbaTarget.Address\n                    $result.Port | Should -Be $script:iScsiHbaTarget.Port\n                    $result.IScsiHbaName | Should -Be $script:iScsiHbaTarget.IScsiHbaName\n                    $result.TargetType | Should -Be $script:iScsiHbaTarget.Type\n                    $result.IScsiName | Should -Be ([string] $script:iScsiHbaTarget.IScsiName)\n                    $result.InheritChap | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.ChapInherited\n                    $result.ChapType | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.ChapType\n                    $result.ChapName | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.ChapName\n                    $result.InheritMutualChap | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.MutualChapInherited\n                    $result.MutualChapEnabled | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.MutualChapEnabled\n                    $result.MutualChapName | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.MutualChapName\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n\n            Context 'When Ensure is Absent and the iSCSI Host Bus Adapter target is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.Address | Should -Be $resourceProperties.Address\n                    $result.Port | Should -Be $resourceProperties.Port\n                    $result.IScsiHbaName | Should -Be $resourceProperties.IScsiHbaName\n                    $result.TargetType | Should -Be $resourceProperties.TargetType\n                    $result.IScsiName | Should -Be $resourceProperties.IScsiName\n                    $result.InheritChap | Should -BeNull\n                    $result.ChapType | Should -Be 'Unset'\n                    $result.ChapName | Should -BeNullOrEmpty\n                    $result.InheritMutualChap | Should -BeNull\n                    $result.MutualChapEnabled | Should -BeNull\n                    $result.MutualChapName | Should -BeNullOrEmpty\n                    $result.Ensure | Should -Be 'Absent'\n                }\n            }\n\n            Context 'When Ensure is Absent and the iSCSI Host Bus Adapter target is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheiSCSIHostBusAdapterTargetIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.Address | Should -Be $script:iScsiHbaTarget.Address\n                    $result.Port | Should -Be $script:iScsiHbaTarget.Port\n                    $result.IScsiHbaName | Should -Be $script:iScsiHbaTarget.IScsiHbaName\n                    $result.TargetType | Should -Be $script:iScsiHbaTarget.Type\n                    $result.IScsiName | Should -Be ([string] $script:iScsiHbaTarget.IScsiName)\n                    $result.InheritChap | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.ChapInherited\n                    $result.ChapType | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.ChapType\n                    $result.ChapName | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.ChapName\n                    $result.InheritMutualChap | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.MutualChapInherited\n                    $result.MutualChapEnabled | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.MutualChapEnabled\n                    $result.MutualChapName | Should -Be $script:iScsiHbaTarget.AuthenticationProperties.MutualChapName\n                    $result.Ensure | Should -Be 'Present'\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic.Mocks.Data.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:Constants = @{\n    VIServer = '10.23.112.235'\n    VIServerUser = 'Admin1'\n    VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force\n    VMHostName = 'DscVMHost'\n    IScsiHbaDeviceName = 'vmhba65'\n    IScsiDeviceType = 'iSCSI'\n    BoundVMKernelNicName = 'vmk0'\n    UnboundVMKernelNicName = 'vmk1'\n}\n\n$script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword)\n\n$script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:Constants.VIServer\n    User = $script:Constants.VIServerUser\n}\n\n$script:VMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:Constants.VMHostName\n}\n\n$script:EsxCli = [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl] @{\n    VMHost = $script:VMHost\n}\n\n$script:IScsiHba = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.IScsiHbaImpl] @{\n    Device = $script:Constants.IScsiHbaDeviceName\n    VMHost = $script:VMHost\n}\n\n$script:BoundVMKernelNic = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:Constants.BoundVMKernelNicName\n    VMHost = $script:VMHost\n}\n\n$script:UnboundVMKernelNic = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:Constants.UnboundVMKernelNicName\n    VMHost = $script:VMHost\n}\n\n$script:EsxCliBoundVMKernelNic = [PSObject] @{\n    Vmknic = $script:Constants.BoundVMKernelNicName\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic.Mocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostIScsiHbaVMKernelNicDscResourceProperties {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostIScsiHbaVMKernelNicDscResourceProperties = @{\n        Server = $script:Constants.VIServer\n        Credential = $script:Credential\n        VMHostName = $script:Constants.VMHostName\n        IScsiHbaName = $script:Constants.IScsiHbaDeviceName\n    }\n\n    $VMHostIScsiHbaVMKernelNicDscResourceProperties\n}\n\nfunction New-MocksForVMHostIScsiHbaVMKernelNicDscResource {\n    $viServerMock = $script:VIServer\n    $vmHostMock = $script:VMHost\n    $esxCliMock = $script:EsxCli\n    $iScsiHbaMock = $script:IScsiHba\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $getEsxCliMockParams = @{\n        CommandName = 'Get-EsxCli'\n        MockWith = { return $esxCliMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $V2 -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getEsxCliMockParams\n\n    $getVMHostHbaMockParams = @{\n        CommandName = 'Get-VMHostHba'\n        MockWith = { return $iScsiHbaMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Device -eq $script:Constants.IScsiHbaDeviceName -and\n            $Type -eq $script:Constants.IScsiDeviceType\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostHbaMockParams\n}\n\nfunction New-MocksWhenEnsureIsPresentAndTwoVMKernelNetworkAdaptersArePassedOneBoundAndOneUnbound {\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties = New-VMHostIScsiHbaVMKernelNicDscResourceProperties\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.VMKernelNicNames = @($script:Constants.BoundVMKernelNicName, $script:Constants.UnboundVMKernelNicName)\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Ensure = 'Present'\n\n    $vmKernelNicsMock = @($script:BoundVMKernelNic, $script:UnboundVMKernelNic)\n    $bindedVMKernelNicsMock = @($script:EsxCliBoundVMKernelNic)\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $getIScsiHbaBoundNicsMockParams = @{\n        CommandName = 'Get-IScsiHbaBoundNics'\n        MockWith = { return $bindedVMKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $EsxCli -eq $script:EsxCli -and\n            $IScsiHbaName -eq $script:IScsiHba.Device\n        }\n        Verifiable = $true\n    }\n    Mock @getIScsiHbaBoundNicsMockParams\n\n    Mock -CommandName 'Update-IScsiHbaBoundNics' -MockWith { return $null }.GetNewClosure()\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTwoVMKernelNetworkAdaptersArePassedOneBoundAndOneUnbound {\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties = New-VMHostIScsiHbaVMKernelNicDscResourceProperties\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.VMKernelNicNames = @($script:Constants.BoundVMKernelNicName, $script:Constants.UnboundVMKernelNicName)\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Ensure = 'Absent'\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Force = $true\n\n    $vmKernelNicsMock = @($script:BoundVMKernelNic, $script:UnboundVMKernelNic)\n    $bindedVMKernelNicsMock = @($script:EsxCliBoundVMKernelNic)\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $getIScsiHbaBoundNicsMockParams = @{\n        CommandName = 'Get-IScsiHbaBoundNics'\n        MockWith = { return $bindedVMKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $EsxCli -eq $script:EsxCli -and\n            $IScsiHbaName -eq $script:IScsiHba.Device\n        }\n        Verifiable = $true\n    }\n    Mock @getIScsiHbaBoundNicsMockParams\n\n    Mock -CommandName 'Update-IScsiHbaBoundNics' -MockWith { return $null }.GetNewClosure()\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentAndOneBoundVMKernelNetworkAdapterIsPassed {\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties = New-VMHostIScsiHbaVMKernelNicDscResourceProperties\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.VMKernelNicNames = @($script:Constants.BoundVMKernelNicName)\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Ensure = 'Present'\n\n    $vmKernelNicsMock = @($script:BoundVMKernelNic)\n    $bindedVMKernelNicsMock = @($script:EsxCliBoundVMKernelNic)\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $getIScsiHbaBoundNicsMockParams = @{\n        CommandName = 'Get-IScsiHbaBoundNics'\n        MockWith = { return $bindedVMKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $EsxCli -eq $script:EsxCli -and\n            $IScsiHbaName -eq $script:IScsiHba.Device\n        }\n        Verifiable = $true\n    }\n    Mock @getIScsiHbaBoundNicsMockParams\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndOneUnboundVMKernelNetworkAdapterIsPassed {\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties = New-VMHostIScsiHbaVMKernelNicDscResourceProperties\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.VMKernelNicNames = @($script:Constants.UnboundVMKernelNicName)\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Ensure = 'Absent'\n\n    $vmKernelNicsMock = @($script:UnboundVMKernelNic)\n    $bindedVMKernelNicsMock = @($script:EsxCliBoundVMKernelNic)\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $getIScsiHbaBoundNicsMockParams = @{\n        CommandName = 'Get-IScsiHbaBoundNics'\n        MockWith = { return $bindedVMKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $EsxCli -eq $script:EsxCli -and\n            $IScsiHbaName -eq $script:IScsiHba.Device\n        }\n        Verifiable = $true\n    }\n    Mock @getIScsiHbaBoundNicsMockParams\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties\n}\n\nfunction New-MocksWhenIScsiHostBusAdapterWithoutBoundVMKernelNetworkAdaptersIsPassed {\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties = New-VMHostIScsiHbaVMKernelNicDscResourceProperties\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.VMKernelNicNames = @($script:Constants.BoundVMKernelNicName, $script:Constants.UnboundVMKernelNicName)\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Ensure = 'Present'\n\n    $bindedVMKernelNicsMock = @()\n\n    $getIScsiHbaBoundNicsMockParams = @{\n        CommandName = 'Get-IScsiHbaBoundNics'\n        MockWith = { return $bindedVMKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $EsxCli -eq $script:EsxCli -and\n            $IScsiHbaName -eq $script:IScsiHba.Device\n        }\n        Verifiable = $true\n    }\n    Mock @getIScsiHbaBoundNicsMockParams\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties\n}\n\nfunction New-MocksWhenIScsiHostBusAdapterWithBoundVMKernelNetworkAdaptersIsPassed {\n    [OutputType([System.Collections.Hashtable])]\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties = New-VMHostIScsiHbaVMKernelNicDscResourceProperties\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.VMKernelNicNames = @($script:Constants.BoundVMKernelNicName, $script:Constants.UnboundVMKernelNicName)\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Ensure = 'Absent'\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties.Force = $false\n\n    $bindedVMKernelNicsMock = @($script:EsxCliBoundVMKernelNic)\n\n    $getIScsiHbaBoundNicsMockParams = @{\n        CommandName = 'Get-IScsiHbaBoundNics'\n        MockWith = { return $bindedVMKernelNicsMock }.GetNewClosure()\n        ParameterFilter = {\n            $EsxCli -eq $script:EsxCli -and\n            $IScsiHbaName -eq $script:IScsiHba.Device\n        }\n        Verifiable = $true\n    }\n    Mock @getIScsiHbaBoundNicsMockParams\n\n    $vmHostIScsiHbaVMKernelNicDscResourceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostIScsiHbaVMKernelNic/VMHostIScsiHbaVMKernelNic.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PSModulePath = $env:PSModulePath\n$script:ModuleName = 'VMware.vSphereDSC'\n\n$script:UnitTestsPath = Join-Path (Join-Path (Get-Module -Name $script:ModuleName -ListAvailable).ModuleBase 'Tests') 'Unit'\n. (Join-Path -Path (Join-Path -Path $script:UnitTestsPath -ChildPath 'TestHelpers') -ChildPath 'TestUtils.ps1')\n\nImport-VMwareVSphereDSCModule\n\n# Imports the mocked 'VMware.VimAutomation.Core' module in the current session before all tests are executed.\nInvoke-TestSetup\n\ntry {\n    InModuleScope -ModuleName $script:ModuleName {\n        $script:DscResourceName = 'VMHostIScsiHbaVMKernelNic'\n\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'VMHostIScsiHbaVMKernelNic.Mocks.Data.ps1')\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'VMHostIScsiHbaVMKernelNic.Mocks.ps1')\n\n        Describe \"$script:DscResourceName\\Set\" -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaVMKernelNicDscResource\n            }\n\n            Context 'When Ensure is Present and two VMKernel Network Adapters are passed, one bound and one unbound' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTwoVMKernelNetworkAdaptersArePassedOneBoundAndOneUnbound\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Update-IScsiHbaBoundNics mock with the iSCSI Host Bus Adapter and unbound VMKernel Network Adapter once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-IScsiHbaBoundNics'\n                        ParameterFilter = {\n                            $EsxCli -eq $script:EsxCli -and\n                            $IScsiHbaName -eq $script:IScsiHba.Device -and\n                            $VMKernelNicName -eq $script:UnboundVMKernelNic.Name -and\n                            $Operation -eq 'Add' -and\n                            $Force -eq $null\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and two VMKernel Network Adapters are passed, one bound and one unbound' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTwoVMKernelNetworkAdaptersArePassedOneBoundAndOneUnbound\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Update-IScsiHbaBoundNics mock with the iSCSI Host Bus Adapter and bound VMKernel Network Adapter once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-IScsiHbaBoundNics'\n                        ParameterFilter = {\n                            $EsxCli -eq $script:EsxCli -and\n                            $IScsiHbaName -eq $script:IScsiHba.Device -and\n                            $VMKernelNicName -eq $script:BoundVMKernelNic.Name -and\n                            $Operation -eq 'Remove' -and\n                            $Force -eq $true\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Test\" -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaVMKernelNicDscResource\n            }\n\n            Context 'When Ensure is Present and two VMKernel Network Adapters are passed, one bound and one unbound' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndTwoVMKernelNetworkAdaptersArePassedOneBoundAndOneUnbound\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and two VMKernel Network Adapters are passed, one bound and one unbound' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Absent and two VMKernel Network Adapters are passed, one bound and one unbound' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTwoVMKernelNetworkAdaptersArePassedOneBoundAndOneUnbound\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and two VMKernel Network Adapters are passed, one bound and one unbound' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Present and one bound VMKernel Network Adapter is passed' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentAndOneBoundVMKernelNetworkAdapterIsPassed\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present and one bound VMKernel Network Adapter is passed' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Absent and one unbound VMKernel Network Adapter is passed' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndOneUnboundVMKernelNetworkAdapterIsPassed\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and one unbound VMKernel Network Adapter is passed' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Get\" -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIScsiHbaVMKernelNicDscResource\n            }\n\n            Context 'When iSCSI Host Bus Adapter without bound VMKernel Network Adapters is passed' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenIScsiHostBusAdapterWithoutBoundVMKernelNetworkAdaptersIsPassed\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the DSC Resource properties' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.VMHostName | Should -Be $dscResourceProperties.VMHostName\n                    $dscResourceGetMethodResult.IScsiHbaName | Should -Be $dscResourceProperties.IScsiHbaName\n                    $dscResourceGetMethodResult.VMKernelNicNames | Should -Be $dscResourceProperties.VMKernelNicNames\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Absent'\n                    $dscResourceGetMethodResult.Force | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When iSCSI Host Bus Adapter with bound VMKernel Network Adapters is passed' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenIScsiHostBusAdapterWithBoundVMKernelNetworkAdaptersIsPassed\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                    $dscResourceGetMethodResult.VMHostName | Should -Be $dscResourceProperties.VMHostName\n                    $dscResourceGetMethodResult.IScsiHbaName | Should -Be $dscResourceProperties.IScsiHbaName\n                    $dscResourceGetMethodResult.VMKernelNicNames | Should -Be @($script:Constants.BoundVMKernelNicName)\n                    $dscResourceGetMethodResult.Ensure | Should -Be 'Present'\n                    $dscResourceGetMethodResult.Force | Should -BeFalse\n                }\n            }\n        }\n    }\n}\nfinally {\n    # Removes the mocked 'VMware.VimAutomation.Core' module from the current session after all tests have executed.\n    Invoke-TestCleanup -ModulePath $script:PSModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostIPRoute/VMHostIPRoute.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostIPRoute'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostIPRouteMocks.ps1\"\n\n        Describe 'VMHostIPRoute\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIPRoute\n            }\n\n            Context 'When Ensure is Present, the IP Route is not created and error occurs while creating the IP Route' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheIPRouteIsNotCreatedAndErrorOccursWhileCreatingTheIPRoute\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while creating the IP Route' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not create IP Route with Gateway address $($script:constants.Gateway) and Destination address $($script:constants.Destination) on VMHost $($script:constants.VMHostName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the IP Route is not created and no error occurs while creating the IP Route' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheIPRouteIsNotCreatedAndNoErrorOccursWhileCreatingTheIPRoute\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VMHostRoute mock with the specified Gateway address, Destination address and PrefixLength once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VMHostRoute'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHost -and\n                            $Gateway -eq $script:constants.Gateway -and\n                            $Destination -eq $script:constants.Destination -and\n                            $PrefixLength -eq $script:constants.PrefixLength -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the IP Route is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheIPRouteIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-VMHostRoute mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostRoute'\n                        ParameterFilter = {\n                            $VMHostRoute -eq $script:vmHostIPRouteOne -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent, the IP Route is not removed and error occurs while removing the IP Route' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheIPRouteIsNotRemovedAndErrorOccursWhileRemovingTheIPRoute\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while removing the IP Route' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not remove IP Route with Gateway address $($script:constants.Gateway) and Destination address $($script:constants.Destination) on VMHost $($script:constants.VMHostName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Absent, the IP Route is not removed and no error occurs while removing the IP Route' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheIPRouteIsNotRemovedAndNoErrorOccursWhileRemovingTheIPRoute\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-VMHostIPRoute mock with the specified IP Route once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostRoute'\n                        ParameterFilter = {\n                            $VMHostRoute -eq $script:vmHostIPRouteOne -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostIPRoute\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIPRoute\n            }\n\n            Context 'When Ensure is Present and the IP Route is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheIPRouteIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the IP Route is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present and the IP Route is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheIPRouteIsAlreadyCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present and the IP Route is already created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the IP Route is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheIPRouteIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the IP Route is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the IP Route is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheIPRouteIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the IP Route is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostIPRoute\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostIPRoute\n            }\n\n            Context 'When Ensure is Present and the IP Route is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheIPRouteIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Gateway | Should -Be $resourceProperties.Gateway\n                    $result.Destination | Should -Be $resourceProperties.Destination\n                    $result.PrefixLength | Should -Be $resourceProperties.PrefixLength\n                }\n            }\n\n            Context 'When Ensure is Present and the IP Route is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheIPRouteIsAlreadyCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Gateway | Should -Be $script:constants.Gateway\n                    $result.Destination | Should -Be $script:constants.Destination\n                    $result.PrefixLength | Should -Be $script:constants.PrefixLength\n                }\n            }\n\n            Context 'When Ensure is Absent and the IP Route is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheIPRouteIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Gateway | Should -Be $resourceProperties.Gateway\n                    $result.Destination | Should -Be $resourceProperties.Destination\n                    $result.PrefixLength | Should -Be $resourceProperties.PrefixLength\n                }\n            }\n\n            Context 'When Ensure is Absent and the IP Route is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheIPRouteIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHost.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Gateway | Should -Be $script:constants.Gateway\n                    $result.Destination | Should -Be $script:constants.Destination\n                    $result.PrefixLength | Should -Be $script:constants.PrefixLength\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNetworkMigration/VMHostVDSwitchMigration.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVDSwitchMigration'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVDSwitchMigrationMocks.ps1\"\n\n        Describe 'VMHostVDSwitchMigration\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVDSwitchMigration\n            }\n\n            Context 'One disconnected Physical Network Adapter is passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneDisconnectedPhysicalNetworkAdapterIsPassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when one disconnected Physical Network Adapter is passed and Server error occurs during migration' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $($script:disconnectedPhysicalNetworkAdapterOne.Name) to VDSwitch $($script:distributedSwitch.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'One disconnected Physical Network Adapter is passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneDisconnectedPhysicalNetworkAdapterIsPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch and the one disconnected Physical Network Adapter once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two disconnected Physical Network Adapters are passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersArePassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two disconnected Physical Network Adapters are passed and Server error occurs during migration' {\n                    # Act && Assert\n                    $vmHostPhysicalNetworkAdaptersToMigrate = @($script:disconnectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterTwo)\n\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $($vmHostPhysicalNetworkAdaptersToMigrate.Name -Join ', ') to VDSwitch $($script:distributedSwitch.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two disconnected Physical Network Adapters are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch and the two disconnected Physical Network Adapters once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two connected and one disconnected Physical Network Adapters are passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersArePassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two connected and one disconnected Physical Network Adapters are passed and Server error occurs during migration' {\n                    # Act && Assert\n                    $vmHostPhysicalNetworkAdaptersToMigrate = @($script:connectedPhysicalNetworkAdapterOne, $script:connectedPhysicalNetworkAdapterTwo, $script:disconnectedPhysicalNetworkAdapterOne)\n\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $($vmHostPhysicalNetworkAdaptersToMigrate.Name -Join ', ') to VDSwitch $($script:distributedSwitch.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two connected and one disconnected Physical Network Adapters are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch and the Physical Network Adapters once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:connectedPhysicalNetworkAdapterOne, $script:connectedPhysicalNetworkAdapterTwo, $script:disconnectedPhysicalNetworkAdapterOne)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'One disconnected Physical Network Adapter, two VMKernel Network Adapters and one Port Group are passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupArePassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when one disconnected Physical Network Adapter, two VMKernel Network Adapters and one Port Group are passed and Server error occurs during migration' {\n                    # Act && Assert\n                    $vmHostPhysicalNetworkAdaptersToMigrate = @($script:disconnectedPhysicalNetworkAdapterOne)\n                    $vmHostVMKernlNetworkAdaptersToMigrate = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $($vmHostPhysicalNetworkAdaptersToMigrate.Name) and VMKernel Network Adapters $($vmHostVMKernlNetworkAdaptersToMigrate.Name -Join ', ') to VDSwitch $($script:distributedSwitch.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'One disconnected Physical Network Adapter, two VMKernel Network Adapters and one Port Group are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the disconnected Physical Network Adapter, the two VMKernel Network Adapters and the Port Group once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'One disconnected Physical Network Adapter, two VMKernel Network Adapters and two Port Groups are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneDisconnectedPhysicalNetworkAdapterTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the disconnected Physical Network Adapter, the two VMKernel Network Adapters and the two Port Groups once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two disconnected Physical Network Adapters, two VMKernel Network Adapters and one Port Group are passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupArePassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two disconnected Physical Network Adapters, two VMKernel Network Adapters and one Port Group are passed and Server error occurs during migration' {\n                    # Act && Assert\n                    $vmHostPhysicalNetworkAdaptersToMigrate = @($script:disconnectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterTwo)\n                    $vmKernelNetworkAdaptersToMigrate = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $($vmHostPhysicalNetworkAdaptersToMigrate.Name -Join ', ') and VMKernel Network Adapters $($vmKernelNetworkAdaptersToMigrate.Name -Join ', ') to VDSwitch $($script:distributedSwitch.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two disconnected Physical Network Adapters, two VMKernel Network Adapters and one Port Group are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the two disconnected Physical Network Adapters, the two VMKernel Network Adapters and the Port Group once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterTwo)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two disconnected Physical Network Adapters, two VMKernel Network Adapters and two Port Groups are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the two disconnected Physical Network Adapters, the two VMKernel Network Adapters and the two Port Groups once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterTwo)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two connected and one disconnected Physical Network Adapters, two VMKernel Network Adapters and one Port Group are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the two connected and first disconnected Physical Network Adapters, the two VMKernel Network Adapters and the Port Group once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:connectedPhysicalNetworkAdapterOne, $script:connectedPhysicalNetworkAdapterTwo, $script:disconnectedPhysicalNetworkAdapterOne)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two connected and one disconnected Physical Network Adapters, two VMKernel Network Adapters and two Port Groups are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoConnectedAndOneDisconnectedPhysicalNetworkAdaptersTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the two connected and first disconnected Physical Network Adapters, the two VMKernel Network Adapters and the two Port Groups once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:connectedPhysicalNetworkAdapterOne, $script:connectedPhysicalNetworkAdapterTwo, $script:disconnectedPhysicalNetworkAdapterOne)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne, $script:vmKernelNetworkAdapterTwo)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Port Group with associated VLan is passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPortGroupWithAssociatedVLanIsPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VDSwitchPhysicalNetworkAdapter mock with the Distributed Switch, the disconnected Physical Network Adapter, the VMKernel Network Adapter and the Port Group with VLan once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:disconnectedPhysicalNetworkAdapterOne)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNicAttachedToPortGroupWithVLan)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VDSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $DistributedSwitch -eq $script:distributedSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostVDSwitchMigration\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVDSwitchMigration\n            }\n\n            Context 'One VMKernel Network Adapter and zero Port Groups are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneVMKernelNetworkAdapterAndZeroPortGroupsArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when one VMKernel Network Adapter and zero Port Groups are passed' {\n                    # Act && Assert\n                    { $resource.Test() } | Should -Throw \"$($resourceProperties.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($resourceProperties.PortGroupNames.Length) Port Groups specified which is not valid.\"\n                }\n            }\n\n            Context 'Zero VMKernel Network Adapters and one Port Group are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenZeroVMKernelNetworkAdaptersAndOnePortGroupArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when zero VMKernel Network Adapters and one Port Group are passed' {\n                    # Act && Assert\n                    { $resource.Test() } | Should -Throw \"$($resourceProperties.PortGroupNames.Length) Port Groups specified and no VMKernel Network Adapters specified which is not valid.\"\n                }\n            }\n\n            Context 'VMHost is not added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenVMHostIsNotAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the VMHost is not added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'One Physical Network Adapter is passed and no Physical Network Adapters are added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndNoPhysicalNetworkAdaptersAreAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when one Physical Network Adapter is passed and no Physical Network Adapters are added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Two Physical Network Adapters are passed and the second is not added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoPhysicalNetworkAdaptersArePassedAndTheSecondIsNotAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when two Physical Network Adapters are passed and the second is not added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'One Physical Network Adapter is passed and is added to the Distributed Switch and no VMKernel Network Adapters and Port Groups are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndItIsAddedToTheDistributedSwitchAndNoVMKernelNetworkAdaptersAndPortGroupsArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when one Physical Network Adapter is passed and is added to the Distributed Switch and no VMKernel Network Adapters and Port Groups are passed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Two VMKernel Network Adapters and one Port Group are passed and the second VMKernel Network Adapter is not added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoVMKernelNetworkAdaptersAndOnePortGroupArePassedAndTheSecondVMKernelNetworkAdapterIsNotAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when two VMKernel Network Adapters and one Port Group are passed and the second VMKernel Network Adapter is not added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Two VMKernel Network Adapters and two Port Groups are passed and the second VMKernel Network Adapter is not added to the Distributed Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoVMKernelNetworkAdaptersAndTwoPortGroupsArePassedAndTheSecondVMKernelNetworkAdapterIsNotAddedToTheDistributedSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when two VMKernel Network Adapters and two Port Groups are passed and the second VMKernel Network Adapter is not added to the Distributed Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostVDSwitchMigration\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVDSwitchMigration\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the Resource properties from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $expectedPhysicalNicNames = @($script:constants.ConnectedPhysicalNetworkAdapterOneName, $script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n                $expectedVMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName, $script:constants.VMKernelNetworkAdapterTwoName)\n                $expectedPortGroupNames = @($script:constants.PortGroupOneName, $script:constants.PortGroupTwoName)\n\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VMHostName | Should -Be $script:vmHostAddedToDistributedSwitchOne.Name\n                $result.VdsName | Should -Be $script:distributedSwitch.Name\n                $result.PhysicalNicNames | Should -Be $expectedPhysicalNicNames\n                $result.VMKernelNicNames | Should -Be $expectedVMKernelNicNames\n                $result.PortGroupNames | Should -Be $expectedPortGroupNames\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNetworkMigration/VMHostVssMigration.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVssMigration'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVssMigrationMocks.ps1\"\n\n        Describe 'VMHostVssMigration\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssMigration\n            }\n\n            Context 'Server error occurs during Standard Switch retrieval' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenServerErrorOccursDuringStandardSwitchRetrieval\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when Server error occurs during Standard Switch retrieval' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not retrieve Standard Switch $($resourceProperties.VssName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two Physical Network Adapters are passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoPhysicalNetworkAdaptersArePassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two Physical Network Adapters are passed and Server error occurs during migration' {\n                    # Act && Assert\n                    $vmHostPhysicalNetworkAdaptersToMigrate = @($script:connectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterOne)\n\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $vmHostPhysicalNetworkAdaptersToMigrate to Standard Switch $($script:virtualSwitch.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two Physical Network Adapters are passed and both are not added the the passed Standard Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoPhysicalNetworkAdaptersArePassedAndBothAreNotAddedToThePassedStandardSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VirtualSwitchPhysicalNetworkAdapter mock with the Standard Switch and the two passed Physical Network Adapters once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:connectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterOne)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VirtualSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VirtualSwitch -eq $script:virtualSwitch -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Two Physical Network Adapters, One VMKernel Network Adapter and One Port Group are passed and Server error occurs during migration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoPhysicalNetworkAdaptersOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndServerErrorOccursDuringMigration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two Physical Network Adapters, One VMKernel Network Adapter and One Port Group are passed and Server error occurs during migration' {\n                    # Act && Assert\n                    $vmHostPhysicalNetworkAdaptersToMigrate = @($script:connectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterOne)\n                    $vmHostVMKernelNetworkAdaptersToMigrate = @($script:vmKernelNetworkAdapterOne)\n\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not migrate Physical Network Adapters $vmHostPhysicalNetworkAdaptersToMigrate and VMKernel Network Adapters $vmHostVMKernelNetworkAdaptersToMigrate to Standard Switch $($script:standardSwitchWithOnePhysicalNetworkAdapter.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two Physical Network Adapters, One VMKernel Network Adapter and One Port Group are passed, the Port Group does not exist and Server error occurs during Port Group creation' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoPhysicalNetworkAdaptersOneVMKernelNetworkAdapterAndOnePortGroupArePassedThePortGroupDoesNotExistAndServerErrorOccursDuringPortGroupCreation\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two Physical Network Adapters, One VMKernel Network Adapter and One Port Group are passed, the Port Group does not exist and Server error occurs during Port Group creation' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Cannot create Standard Port Group $($script:constants.PortGroupOneName) on Standard Switch $($script:standardSwitchWithOnePhysicalNetworkAdapter.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Two Physical Network Adapters, One VMKernel Network Adapter and One Port Group are passed and the Port Group does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoPhysicalNetworkAdaptersOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndThePortGroupDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Add-VirtualSwitchPhysicalNetworkAdapter mock with the Standard Switch, the first passed Physical Network Adapter, the VMKernel Network Adapter and Port Group once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedVMHostPhysicalNic = @($script:connectedPhysicalNetworkAdapterOne, $script:disconnectedPhysicalNetworkAdapterOne)\n                    $expectedVMHostVirtualNic = @($script:vmKernelNetworkAdapterOne)\n                    $expectedVirtualNicPortgroup = @($script:constants.PortGroupOneName)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VirtualSwitchPhysicalNetworkAdapter'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VirtualSwitch -eq $script:standardSwitchWithOnePhysicalNetworkAdapter -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostPhysicalNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.PhysicalNic[]] $expectedVMHostPhysicalNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VMHostVirtualNic, [VMware.VimAutomation.ViCore.Types.V1.Host.Networking.Nic.HostVirtualNic[]] $expectedVMHostVirtualNic) -and\n                            [System.Linq.Enumerable]::SequenceEqual($VirtualNicPortgroup, [string[]] $expectedVirtualNicPortgroup) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostVssMigration\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssMigration\n            }\n\n            Context 'One Physical Network Adapter is passed and is not present on the Server' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndIsNotPresentOnTheServer\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when one Physical Network Adapter is passed and is not present on the Server' {\n                    # Act && Assert\n                    { $resource.Test() } | Should -Throw \"At least one Physical Network Adapter needs to be specified.\"\n                }\n            }\n\n            Context 'One Physical Network Adapter is passed and the Standard Switch does not have Physical Network Adapters added to it' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndTheStandardSwitchDoesNotHavePhysicalNetworkAdaptersAddedToIt\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when one Physical Network Adapter is passed and the Standard Switch does not have Physical Network Adapters added to it' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'One Physical Network Adapter is passed and it is not added to the Standard Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndItIsNotAddedToTheStandardSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when one Physical Network Adapter is passed and it is not added to the Standard Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'One Physical Network Adapter is passed and it is added to the Standard Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOnePhysicalNetworkAdapterIsPassedAndItIsAddedToTheStandardSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when one Physical Network Adapter is passed and it is added to the Standard Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Two VMKernel Network Adapters and one Port Group are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTwoVMKernelNetworkAdaptersAndOnePortGroupArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when two VMKernel Network Adapters and one Port Group are passed' {\n                    # Act && Assert\n                    { $resource.Test() } | Should -Throw \"$($resourceProperties.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($resourceProperties.PortGroupNames.Length) Port Groups specified which is not valid.\"\n                }\n            }\n\n            Context 'Zero VMKernel Network Adapters and one Port Group are passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenZeroVMKernelNetworkAdaptersAndOnePortGroupArePassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when zero VMKernel Network Adapters and one Port Group are passed' {\n                    # Act && Assert\n                    { $resource.Test() } | Should -Throw \"$($resourceProperties.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($resourceProperties.PortGroupNames.Length) Port Groups specified which is not valid.\"\n                }\n            }\n\n            Context 'One VMKernel Network Adapter and one Port Group are passed and the VMKernel Network Adapter is not added to the Standard Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndTheVMKernelNetworkAdapterIsNotAddedToTheStandardSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when one VMKernel Network Adapter and one Port Group are passed and the VMKernel Network Adapter is not added to the Standard Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'One VMKernel Network Adapter and one Port Group are passed and the VMKernel Network Adapter is added to the Standard Switch' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenOneVMKernelNetworkAdapterAndOnePortGroupArePassedAndTheVMKernelNetworkAdapterIsAddedToTheStandardSwitch\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when one VMKernel Network Adapter and one Port Group are passed and the VMKernel Network Adapter is added to the Standard Switch' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVssMigration\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssMigration\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the Resource properties from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $expectedPhysicalNicNames = @($script:constants.DisconnectedPhysicalNetworkAdapterOneName)\n                $expectedVMKernelNicNames = @($script:constants.VMKernelNetworkAdapterOneName)\n                $expectedPortGroupNames = @($script:constants.PortGroupOneName)\n\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VMHostName | Should -Be $script:vmHost.Name\n                $result.VssName | Should -Be $script:standardSwitchWithOnePhysicalNetworkAdapter.Name\n                $result.PhysicalNicNames | Should -Be $expectedPhysicalNicNames\n                $result.VMKernelNicNames | Should -Be $expectedVMKernelNicNames\n                $result.PortGroupNames | Should -Be $expectedPortGroupNames\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNic/VMHostNicBaseDSC.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $vmHostNicBaseDSCClassName = 'VMHostNicBaseDSC'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostNicBaseDSCMocks.ps1\"\n\n        Describe 'VMHostNicBaseDSC\\GetVMHostNetworkAdapter' -Tag 'GetVMHostNetworkAdapter' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNicBaseDSC\n            }\n\n            Context 'Invoking with existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterExists\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return the VMKernel Network Adapter from the server' {\n                    # Act\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n\n                    # Assert\n                    $vmHostNetworkAdapter | Should -Be $script:vmHostNetworkAdapter\n                }\n            }\n\n            Context 'Invoking with non existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterDoesNotExist\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $null' {\n                    # Act\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n\n                    # Assert\n                    $vmHostNetworkAdapter | Should -BeNullOrEmpty\n                }\n            }\n        }\n\n        Describe 'VMHostNicBaseDSC\\ShouldUpdateVMHostNetworkAdapter' -Tag 'ShouldUpdateVMHostNetworkAdapter' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNicBaseDSC\n            }\n\n            Context 'Invoking with matching VMKernel Network Adapter settings' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterSettingsMatch\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when VMKernel Network Adapter settings match' {\n                    # Act\n                    $result = $vmHostNicBaseDSC.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with non matching VMKernel Network Adapter settings' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterSettingsDoesNotMatch\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when VMKernel Network Adapter settings does not match' {\n                    # Act\n                    $result = $vmHostNicBaseDSC.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostNicBaseDSC\\AddVMHostNetworkAdapter' -Tag 'AddVMHostNetworkAdapter' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNicBaseDSC\n            }\n\n            Context 'Invoking with VMKernel Network Adapter settings that results in an Error' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterSettingsResultsInAnError\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $null)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when Adding new VMKernel Network Adapter results in an error' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $null) } | Should -Throw \"Cannot create VMKernel Network Adapter connected to Virtual Switch $($script:virtualSwitch.Name) and Port Group $($vmHostNicBaseDSCProperties.PortGroupName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Invoking without Port Id' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenAddingVMKernelNetworkAdapter\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $null)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $null)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VMHostNetworkAdapter'\n                        ParameterFilter = { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $VirtualSwitch -eq $script:virtualSwitch -and $PortGroup -eq $script:constants.VirtualPortGroupName -and `\n                                            $IP -eq $script:constants.VMKernelNetworkAdapterIP -and $SubnetMask -eq $script:constants.VMKernelNetworkAdapterSubnetMask -and `\n                                            $Mac -eq $script:constants.VMKernelNetworkAdapterMac -and $AutomaticIPv6 -eq $script:constants.VMKernelNetworkAdapterAutomaticIPv6 -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($IPv6, @()) -and $IPv6ThroughDhcp -eq $script:constants.VMKernelNetworkAdapterIPv6ThroughDhcp -and `\n                                            $Mtu -eq $script:constants.VMKernelNetworkAdapterMtu -and $ManagementTrafficEnabled -eq $script:constants.VMKernelNetworkAdapterManagementTrafficEnabled -and `\n                                            $FaultToleranceLoggingEnabled -eq $script:constants.VMKernelNetworkAdapterFaultToleranceLoggingEnabled -and `\n                                            $VMotionEnabled -eq $script:constants.VMKernelNetworkAdapterVMotionEnabled -and `\n                                            $VsanTrafficEnabled -eq $script:constants.VMKernelNetworkAdapterVsanTrafficEnabled -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should return the correct VMKernel Network Adapter' {\n                    # Act\n                    $result = $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $null)\n\n                    # Assert\n                    $result | Should -Be $script:vmHostNetworkAdapter\n                }\n            }\n\n            Context 'Invoking with Port Id' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenAddingVMKernelNetworkAdapter\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $script:constants.VMKernelNetworkAdapterPortId)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $script:constants.VMKernelNetworkAdapterPortId)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VMHostNetworkAdapter'\n                        ParameterFilter = { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and $VirtualSwitch -eq $script:virtualSwitch -and $PortId -eq $script:constants.VMKernelNetworkAdapterPortId -and `\n                                            $IP -eq $script:constants.VMKernelNetworkAdapterIP -and $SubnetMask -eq $script:constants.VMKernelNetworkAdapterSubnetMask -and `\n                                            $Mac -eq $script:constants.VMKernelNetworkAdapterMac -and $AutomaticIPv6 -eq $script:constants.VMKernelNetworkAdapterAutomaticIPv6 -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($IPv6, @()) -and $IPv6ThroughDhcp -eq $script:constants.VMKernelNetworkAdapterIPv6ThroughDhcp -and `\n                                            $Mtu -eq $script:constants.VMKernelNetworkAdapterMtu -and $ManagementTrafficEnabled -eq $script:constants.VMKernelNetworkAdapterManagementTrafficEnabled -and `\n                                            $FaultToleranceLoggingEnabled -eq $script:constants.VMKernelNetworkAdapterFaultToleranceLoggingEnabled -and `\n                                            $VMotionEnabled -eq $script:constants.VMKernelNetworkAdapterVMotionEnabled -and `\n                                            $VsanTrafficEnabled -eq $script:constants.VMKernelNetworkAdapterVsanTrafficEnabled -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should return the correct VMKernel Network Adapter' {\n                    # Act\n                    $result = $vmHostNicBaseDSC.AddVMHostNetworkAdapter($script:virtualSwitch, $script:constants.VMKernelNetworkAdapterPortId)\n\n                    # Assert\n                    $result | Should -Be $script:vmHostNetworkAdapter\n                }\n            }\n        }\n\n        Describe 'VMHostNicBaseDSC\\UpdateVMHostNetworkAdapter' -Tag 'UpdateVMHostNetworkAdapter' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNicBaseDSC\n            }\n\n            Context 'Invoking with VMKernel Network Adapter settings to update that results in an Error' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenUpdatingVMKernelNetworkAdapterSettingsResultsInAnError\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $vmHostNicBaseDSC.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when Updating the VMKernel Network Adapter results in an error' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $vmHostNicBaseDSC.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter) } | Should -Throw \"Cannot update VMKernel Network Adapter $($script:constants.VMKernelNetworkAdapterName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Invoking without Dhcp and IPv6Enabled' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenUpdatingVMKernelNetworkAdapterWithoutDhcpAndIPv6Enabled\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $vmHostNicBaseDSC.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = { $VirtualNic -eq $vmHostNetworkAdapter -and $Mac -eq ($script:constants.VMKernelNetworkAdapterMac + $script:constants.VMKernelNetworkAdapterMac) -and `\n                                            $ManagementTrafficEnabled -eq !($script:constants.VMKernelNetworkAdapterManagementTrafficEnabled) -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Dhcp and IPv6Enabled' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenUpdatingVMKernelNetworkAdapterWithDhcpAndIPv6Enabled\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $vmHostNicBaseDSC.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = { $VirtualNic -eq $vmHostNetworkAdapter -and $Dhcp -eq !($script:constants.VMKernelNetworkAdapterDhcp) -and `\n                                            $IPv6Enabled -eq !($script:constants.VMKernelNetworkAdapterIPv6Enabled) -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostNicBaseDSC\\RemoveVMHostNetworkAdapter' -Tag 'RemoveVMHostNetworkAdapter' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNicBaseDSC\n            }\n\n            Context 'Invoking with VMKernel Network Adapter settings to remove that results in an Error' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenRemovingVMKernelNetworkAdapterResultsInAnError\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $vmHostNicBaseDSC.RemoveVMHostNetworkAdapter($vmHostNetworkAdapter)\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when Removing the VMKernel Network Adapter results in an error' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $vmHostNicBaseDSC.RemoveVMHostNetworkAdapter($vmHostNetworkAdapter) } | Should -Throw \"Cannot remove VMKernel Network Adapter $($script:constants.VMKernelNetworkAdapterName). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Invoking with VMKernel Network Adapter settings to remove that results in a Success' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenRemovingVMKernelNetworkAdapter\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.RemoveVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $vmHostNicBaseDSC.RemoveVMHostNetworkAdapter($vmHostNetworkAdapter)\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostNetworkAdapter'\n                        ParameterFilter = { $Nic -eq $vmHostNetworkAdapter -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostNicBaseDSC\\PopulateResult' -Tag 'PopulateResult' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostNicBaseDSC\n            }\n\n            Context 'Invoking with existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterExists\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                    $result = New-Object -TypeName $vmHostNicBaseDSCClassName\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.PopulateResult($vmHostNetworkAdapter, $result)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $vmHostNicBaseDSC.PopulateResult($vmHostNetworkAdapter, $result)\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.PortGroupName | Should -Be $script:constants.VirtualPortGroupName\n                    $result.Ensure | Should -Be 'Present'\n                    $result.IP | Should -Be $script:constants.VMKernelNetworkAdapterIP\n                    $result.SubnetMask | Should -Be $script:constants.VMKernelNetworkAdapterSubnetMask\n                    $result.Mac | Should -Be $script:constants.VMKernelNetworkAdapterMac\n                    $result.AutomaticIPv6 | Should -Be $script:constants.VMKernelNetworkAdapterAutomaticIPv6\n                    $result.IPv6 | Should -Be @()\n                    $result.IPv6ThroughDhcp | Should -Be $script:constants.VMKernelNetworkAdapterIPv6ThroughDhcp\n                    $result.Mtu | Should -Be $script:constants.VMKernelNetworkAdapterMtu\n                    $result.Dhcp | Should -Be $script:constants.VMKernelNetworkAdapterDhcp\n                    $result.IPv6Enabled | Should -Be $script:constants.VMKernelNetworkAdapterIPv6Enabled\n                    $result.ManagementTrafficEnabled | Should -Be $script:constants.VMKernelNetworkAdapterManagementTrafficEnabled\n                    $result.FaultToleranceLoggingEnabled | Should -Be $script:constants.VMKernelNetworkAdapterFaultToleranceLoggingEnabled\n                    $result.VMotionEnabled | Should -Be $script:constants.VMKernelNetworkAdapterVMotionEnabled\n                    $result.VsanTrafficEnabled | Should -Be $script:constants.VMKernelNetworkAdapterVsanTrafficEnabled\n                }\n            }\n\n            Context 'Invoking with non existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $vmHostNicBaseDSCProperties = New-MocksWhenVMKernelNetworkAdapterDoesNotExist\n                    $vmHostNicBaseDSC = New-Object -TypeName $vmHostNicBaseDSCClassName -Property $vmHostNicBaseDSCProperties\n\n                    $vmHostNicBaseDSC.ConnectVIServer()\n                    $vmHostNicBaseDSC.RetrieveVMHost()\n                    $vmHostNetworkAdapter = $vmHostNicBaseDSC.GetVMHostNetworkAdapter($script:virtualSwitch)\n                    $result = New-Object -TypeName $vmHostNicBaseDSCClassName\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $vmHostNicBaseDSC.PopulateResult($vmHostNetworkAdapter, $result)\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $vmHostNicBaseDSC.PopulateResult($vmHostNetworkAdapter, $result)\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.PortGroupName | Should -Be $vmHostNicBaseDSCProperties.PortGroupName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.IP | Should -Be $vmHostNicBaseDSCProperties.IP\n                    $result.SubnetMask | Should -Be $vmHostNicBaseDSCProperties.SubnetMask\n                    $result.Mac | Should -Be $vmHostNicBaseDSCProperties.Mac\n                    $result.AutomaticIPv6 | Should -Be $vmHostNicBaseDSCProperties.AutomaticIPv6\n                    $result.IPv6 | Should -Be @()\n                    $result.IPv6ThroughDhcp | Should -Be $vmHostNicBaseDSCProperties.IPv6ThroughDhcp\n                    $result.Mtu | Should -Be $vmHostNicBaseDSCProperties.Mtu\n                    $result.Dhcp | Should -BeNullOrEmpty\n                    $result.IPv6Enabled | Should -BeNullOrEmpty\n                    $result.ManagementTrafficEnabled | Should -Be $vmHostNicBaseDSCProperties.ManagementTrafficEnabled\n                    $result.FaultToleranceLoggingEnabled | Should -Be $vmHostNicBaseDSCProperties.FaultToleranceLoggingEnabled\n                    $result.VMotionEnabled | Should -Be $vmHostNicBaseDSCProperties.VMotionEnabled\n                    $result.VsanTrafficEnabled | Should -Be $vmHostNicBaseDSCProperties.VsanTrafficEnabled\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNic/VMHostPhysicalNic.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostPhysicalNic'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostPhysicalNicMocks.ps1\"\n\n        Describe 'VMHostPhysicalNic\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPhysicalNic\n            }\n\n            Context 'Invoking without specifying AutoNegotiate' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAutoNegotiateIsNotPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = { $PhysicalNic -eq $script:physicalNetworkAdapter -and `\n                                            $Duplex -eq $script:constants.FullDuplex -and `\n                                            $BitRatePerSecMb -eq $script:constants.BitRatePerSecMb }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with AutoNegotiate set to $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAutoNegotiateIsSetToFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = { $PhysicalNic -eq $script:physicalNetworkAdapter -and `\n                                            $Duplex -eq $script:constants.FullDuplex -and `\n                                            $BitRatePerSecMb -eq $script:constants.BitRatePerSecMb }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with AutoNegotiate set to $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenAutoNegotiateIsSetToTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = { $PhysicalNic -eq $script:physicalNetworkAdapter -and `\n                                            $AutoNegotiate -eq $script:constants.AutoNegotiate }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostPhysicalNic\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPhysicalNic\n            }\n\n            Context 'Invoking with Physical Network Adapter Full Duplex' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenThePhysicalNetworkAdapterIsWithFullDuplex\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Physical Network Adapter has Full Duplex and Half Duplex is passed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Physical Network Adapter Half Duplex' {\n                BeforeAll {\n                    # Arrange\n                    # The Duplex server value should be modified here before the mocking occurs.\n                    $script:physicalNetworkAdapter.FullDuplex = $false\n\n                    $resourceProperties = New-MocksWhenThePhysicalNetworkAdapterIsWithHalfDuplex\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Physical Network Adapter has Half Duplex and Full Duplex is passed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n\n                AfterAll {\n                    # The Duplex server value should be set to its default value.\n                    $script:physicalNetworkAdapter.FullDuplex = $true\n                }\n            }\n\n            Context 'Invoking with AutoNegotiate set to $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInTestWhenAutoNegotiateIsSetToFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Physical Network Adapter speed/duplex settings are not configured automatically' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with AutoNegotiate set to $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInTestWhenAutoNegotiateIsSetToTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Physical Network Adapter speed/duplex settings are not configured automatically' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostPhysicalNic\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPhysicalNic\n            }\n\n            Context 'Invoking with Physical Network Adapter Full Duplex' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenThePhysicalNetworkAdapterIsWithFullDuplex\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.VMHostName | Should -Be $script:constants.VMHostName\n                    $result.Name | Should -Be $script:constants.PhysicalNetworkAdapterName\n                    $result.Duplex | Should -Be $script:constants.FullDuplex\n                    $result.BitRatePerSecMb | Should -Be $script:constants.BitRatePerSecMb\n                    $result.AutoNegotiate | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'Invoking with Physical Network Adapter Half Duplex' {\n                BeforeAll {\n                    # Arrange\n                    # The Duplex server value should be modified here before the mocking occurs.\n                    $script:physicalNetworkAdapter.FullDuplex = $false\n\n                    $resourceProperties = New-MocksWhenThePhysicalNetworkAdapterIsWithHalfDuplex\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.VMHostName | Should -Be $script:constants.VMHostName\n                    $result.Name | Should -Be $script:constants.PhysicalNetworkAdapterName\n                    $result.Duplex | Should -Be $script:constants.HalfDuplex\n                    $result.BitRatePerSecMb | Should -Be $script:constants.BitRatePerSecMb\n                    $result.AutoNegotiate | Should -BeNullOrEmpty\n                }\n\n                AfterAll {\n                    # The Duplex server value should be set to its default value.\n                    $script:physicalNetworkAdapter.FullDuplex = $true\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic.Mocks.Data.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:Constants = @{\n    VIServer = '10.23.112.235'\n    VIServerUser = 'Admin1'\n    VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force\n    ProductLine = 'vpx'\n    VMHostName = 'DscVMHost'\n    VDSwitchName = 'DscVDSwitch'\n    DistributedPortGroupName = 'DscDistributedPortGroup'\n    VMKernelNICName = 'DscVMKernelNic'\n    IP = '192.168.0.1'\n    SubnetMask = '255.255.255.0'\n    VMotionEnabled = $true\n    ManagementTrafficEnabled = $true\n}\n\n$script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword)\n\n$script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:Constants.VIServer\n    User = $script:Constants.VIServerUser\n    ProductLine = $script:Constants.ProductLine\n}\n\n$script:VDSwitch = [VMware.VimAutomation.Vds.Impl.V1.VmwareVDSwitchImpl] @{\n    Name = $script:Constants.VDSwitchName\n}\n\n$script:ProxySwitch = [VMware.Vim.HostProxySwitch] @{\n    DvsName = $script:Constants.VDSwitchName\n}\n\n$script:VMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:Constants.VMHostName\n    ExtensionData = [VMware.Vim.HostSystem] @{\n        Config = [VMware.Vim.HostConfigInfo] @{\n            Network = [VMware.Vim.HostNetworkInfo] @{\n                ProxySwitch = @(\n                    $script:ProxySwitch\n                )\n            }\n        }\n    }\n}\n\n$script:VMKernelNIC = [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.Nic.HostVMKernelVirtualNicImpl] @{\n    Name = $script:Constants.VMKernelNICName\n    VMHost = $script:VMHost\n    PortGroupName = $script:Constants.DistributedPortGroupName\n    IP = $script:Constants.IP\n    SubnetMask = $script:Constants.SubnetMask\n    VMotionEnabled = $script:Constants.VMotionEnabled\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic.Mocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostVdsNicDscResourceProperties {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = @{\n        Server = $script:Constants.VIServer\n        Credential = $script:Credential\n        Name = $script:Constants.VMKernelNICName\n        VMHostName = $script:Constants.VMHostName\n        VdsName = $script:Constants.VDSwitchName\n        PortGroupName = $script:Constants.DistributedPortGroupName\n        IP = $script:Constants.IP\n        SubnetMask = $script:Constants.SubnetMask\n        VMotionEnabled = $script:Constants.VMotionEnabled\n    }\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksForVMHostVdsNicDscResource {\n    $viServerMock = $script:VIServer\n    $vmHostMock = $script:VMHost\n    $vdSwitchMock = $script:VDSwitch\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $getVDSwitchMockParams = @{\n        CommandName = 'Get-VDSwitch'\n        MockWith = { return $vdSwitchMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $Name -eq $script:Constants.VDSwitchName\n        }\n        Verifiable = $true\n    }\n    Mock @getVDSwitchMockParams\n}\n\nfunction New-MocksInSetWhenEnsureIsPresentAndTheVMKernelNICExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Present'\n\n    $vmKernelNICMock = $script:VMKernelNIC\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNICMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    Mock -CommandName 'Set-VMHostNetworkAdapter' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheVMKernelNICDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Absent'\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    Mock -CommandName 'Remove-VMHostNetworkAdapter' -MockWith { return $null }.GetNewClosure()\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksInSetWhenEnsureIsAbsentAndTheVMKernelNICExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Absent'\n\n    $vmKernelNICMock = $script:VMKernelNIC\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNICMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    Mock -CommandName 'Remove-VMHostNetworkAdapter' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMKernelNICExistsAndTheVMKernelNICSettingsShouldNotBeModified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Present'\n\n    $vmKernelNICMock = $script:VMKernelNIC\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNICMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsPresentTheVMKernelNICExistsAndTheVMKernelNICSettingsShouldBeModified {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Present'\n    $VMHostVdsNicDscResourceProperties.ManagementTrafficEnabled = $script:Constants.ManagementTrafficEnabled\n\n    $vmKernelNICMock = $script:VMKernelNIC\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNICMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheVMKernelNICDoesNotExist {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Absent'\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $null }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $VMHostVdsNicDscResourceProperties\n}\n\nfunction New-MocksWhenEnsureIsAbsentAndTheVMKernelNICExists {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostVdsNicDscResourceProperties = New-VMHostVdsNicDscResourceProperties\n    $VMHostVdsNicDscResourceProperties.Ensure = 'Absent'\n\n    $vmKernelNICMock = $script:VMKernelNIC\n\n    $getVMHostNetworkAdapterMockParams = @{\n        CommandName = 'Get-VMHostNetworkAdapter'\n        MockWith = { return $vmKernelNICMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost -and\n            $Name -eq $script:Constants.VMKernelNICName -and\n            $VirtualSwitch -eq $script:VDSwitch -and\n            $PortGroup -eq $script:Constants.DistributedPortGroupName -and\n            $VMKernel -eq $true\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostNetworkAdapterMockParams\n\n    $VMHostVdsNicDscResourceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNic/VMHostVdsNic/VMHostVdsNic.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PSModulePath = $env:PSModulePath\n$script:ModuleName = 'VMware.vSphereDSC'\n\n$script:UnitTestsPath = Join-Path (Join-Path (Get-Module -Name $script:ModuleName -ListAvailable).ModuleBase 'Tests') 'Unit'\n. (Join-Path -Path (Join-Path -Path $script:UnitTestsPath -ChildPath 'TestHelpers') -ChildPath 'TestUtils.ps1')\n\nImport-VMwareVSphereDSCModule\n\n# Imports the mocked 'VMware.VimAutomation.Core' module in the current session before all tests are executed.\nInvoke-TestSetup\n\ntry {\n    InModuleScope -ModuleName $script:ModuleName {\n        $script:DscResourceName = 'VMHostVdsNic'\n\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'VMHostVdsNic.Mocks.Data.ps1')\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'VMHostVdsNic.Mocks.ps1')\n\n        Describe \"$script:DscResourceName\\Set\" -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVdsNicDscResource\n            }\n\n            Context 'When Ensure is Present and the VMKernel NIC exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsPresentAndTheVMKernelNICExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostNetworkAdapter mock with the specified VMKernel NIC once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = {\n                            $VirtualNic -eq $script:VMKernelNIC\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMKernel NIC does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheVMKernelNICDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-VMHostNetworkAdapter mock' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostNetworkAdapter'\n                        ParameterFilter = {\n                            $Nic -eq $script:VMKernelNIC\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMKernel NIC exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheVMKernelNICExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-VMHostNetworkAdapter mock with the specified VMKernel NIC once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostNetworkAdapter'\n                        ParameterFilter = {\n                            $Nic -eq $script:VMKernelNIC\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Test\" -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVdsNicDscResource\n            }\n\n            Context 'When Ensure is Present, the VMKernel NIC exists and the VMKernel NIC settings should not be modified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheVMKernelNICExistsAndTheVMKernelNICSettingsShouldNotBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, the VMKernel NIC exists and the VMKernel NIC settings should not be modified' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Present, the VMKernel NIC exists and the VMKernel NIC settings should be modified' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheVMKernelNICExistsAndTheVMKernelNICSettingsShouldBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the VMKernel NIC exists and the VMKernel NIC settings should be modified' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMKernel NIC does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMKernelNICDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the VMKernel NIC does not exist' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMKernel NIC exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMKernelNICExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the VMKernel NIC exists' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Get\" -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVdsNicDscResource\n            }\n\n            Context 'When Ensure is Present and the VMKernel NIC exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsPresentTheVMKernelNICExistsAndTheVMKernelNICSettingsShouldNotBeModified\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the VMKernel NIC and VDSwitch names from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.VdsName | Should -Be $script:VDSwitch.Name\n                    $dscResourceGetMethodResult.Name | Should -Be $script:VMKernelNIC.Name\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMKernel NIC does not exist' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMKernelNICDoesNotExist\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the VMKernel NIC and VDSwitch names from the DSC Resource properties' {\n                    # Assert\n                    $dscResourceGetMethodResult.VdsName | Should -Be $dscResourceProperties.VdsName\n                    $dscResourceGetMethodResult.Name | Should -Be $dscResourceProperties.Name\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMKernel NIC exists' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMKernelNICExists\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceGetMethodResult = $dscResource.Get()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the VMKernel NIC and VDSwitch names from the server' {\n                    # Assert\n                    $dscResourceGetMethodResult.VdsName | Should -Be $script:VDSwitch.Name\n                    $dscResourceGetMethodResult.Name | Should -Be $script:VMKernelNIC.Name\n                }\n            }\n        }\n    }\n}\nfinally {\n    # Removes the mocked 'VMware.VimAutomation.Core' module from the current session after all tests have executed.\n    Invoke-TestCleanup -ModulePath $script:PSModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostNic/VMHostVssNic.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVssNic'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVssNicMocks.ps1\"\n\n        Describe 'VMHostVssNic\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssNic\n            }\n\n            Context 'Invoking with Ensure Present and non existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndVMKernelNetworkAdapterDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call the New-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VMHostNetworkAdapter'\n                        ParameterFilter = { $VMHost -eq $script:vmHost -and $VirtualSwitch -eq $script:virtualSwitch }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndVMKernelNetworkAdapterExists\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call the Set-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostNetworkAdapter'\n                        ParameterFilter = { $VirtualNic -eq $script:vmHostNetworkAdapter -and $IPv6Enabled -eq !$script:constants.VMKernelNetworkAdapterIPv6Enabled }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndVMKernelNetworkAdapterDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should not call the Remove-VMHostNetworkAdapter mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostNetworkAdapter'\n                        ParameterFilter = { $Nic -eq $script:vmHostNetworkAdapter }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndVMKernelNetworkAdapterExists\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call the Remove-VMHostNetworkAdapter mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHostNetworkAdapter'\n                        ParameterFilter = { $Nic -eq $script:vmHostNetworkAdapter }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostVssNic\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssNic\n            }\n\n            Context 'Invoking with Ensure Present and non existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndVMKernelNetworkAdapterDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when the VMKernel Network Adapter does not exist' {\n                   # Act\n                   $result = $resource.Test()\n\n                   # Assert\n                   $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing VMKernel Network Adapter and matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentVMKernelNetworkAdapterExistsAndMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $true when the VMKernel Network Adapter exists and the VMKernel Network Adapter settings are equal' {\n                   # Act\n                   $result = $resource.Test()\n\n                   # Assert\n                   $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing VMKernel Network Adapter and non matching settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentVMKernelNetworkAdapterExistsAndNonMatchingSettings\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when the VMKernel Network Adapter exists and the VMKernel Network Adapter settings are not equal' {\n                   # Act\n                   $result = $resource.Test()\n\n                   # Assert\n                   $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndVMKernelNetworkAdapterDoesNotExist\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $true when the VMKernel Network Adapter does not exist' {\n                   # Act\n                   $result = $resource.Test()\n\n                   # Assert\n                   $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing VMKernel Network Adapter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndVMKernelNetworkAdapterExists\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should return $false when the VMKernel Network Adapter exists' {\n                   # Act\n                   $result = $resource.Test()\n\n                   # Assert\n                   $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostVssNic\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssNic\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.VssName | Should -Be $script:constants.VirtualSwitchName\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroup.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVssPortGroup'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVssPortGroupMocks.ps1\"\n\n        Describe 'VMHostVssPortGroup\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroup\n            }\n\n            Context 'Invoking with Ensure Present and non existing Port Group' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsurePresentAndNonExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the New-VirtualPortGroup mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VirtualPortGroup'\n                        ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:constants.VirtualPortGroupName -and $VirtualSwitch -eq $script:virtualSwitch -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Port Group and negative VLanId' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingPortGroupAndNegativeVLanId\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the VLanId is negative' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"The passed VLanId value $($resourceProperties.VLanId) is not valid. The valid values are in the following range: [0, $($resource.VLanIdMaxValue)].\"\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Port Group and VLanId bigger than the Max valid value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingPortGroupAndVLanIdBiggerThanTheMaxValidValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the VLanId is bigger than the Max valid value' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"The passed VLanId value $($resourceProperties.VLanId) is not valid. The valid values are in the following range: [0, $($resource.VLanIdMaxValue)].\"\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Port Group and valid VLanId' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingPortGroupAndValidVLanId\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-VirtualPortGroup mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VirtualPortGroup'\n                        ParameterFilter = { $VirtualPortGroup -eq $script:virtualPortGroup -and $VLanId -eq $script:constants.VLanId -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Port Group' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndNonExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not call the Remove-VirtualPortGroup mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VirtualPortGroup'\n                        ParameterFilter = { $VirtualPortGroup -eq $script:virtualPortGroup -and !$Confirm }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Port Group' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureAbsentAndExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Remove-VirtualPortGroup mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VirtualPortGroup'\n                        ParameterFilter = { $VirtualPortGroup -eq $script:virtualPortGroup -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostVssPortGroup\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroup\n            }\n\n            Context 'Invoking with Ensure Present and non existing Port Group' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Port Group does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Port Group and no VLanId specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingPortGroupAndNoVLanIdSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when no VLanId is specified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Port Group and VLanId not equal to Port Group VLanId' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingPortGroupAndVLanIdNotEqualToPortGroupVLanId\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the passed VLanId is not equal to the Port Group VLanId' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Ensure Present, existing Port Group and VLanId equal to Port Group VLanId' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsurePresentExistingPortGroupAndVLanIdEqualToPortGroupVLanId\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the passed VLanId is equal to the Port Group VLanId' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Port Group' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Port Group does not exist' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Port Group' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Port Group exists' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostVssGroup\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroup\n            }\n\n            Context 'Invoking with Ensure Present and non existing Port Group' {\n                BeforeAll {\n                    $resourceProperties = New-MocksWhenEnsurePresentAndNonExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.VMHostName | Should -Be $resourceProperties.VMHostName\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.VssName | Should -Be $resourceProperties.VssName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.VLanId | Should -Be $resourceProperties.VLanId\n                }\n            }\n\n            Context 'Invoking with Ensure Present and existing Port Group' {\n                BeforeAll {\n                    $resourceProperties = New-MocksWhenEnsurePresentAndExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $script:virtualPortGroup.Name\n                    $result.VssName | Should -Be $script:virtualPortGroup.VirtualSwitch.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.VLanId | Should -Be $script:virtualPortGroup.VLanId\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and non existing Port Group' {\n                BeforeAll {\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndNonExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Resource properties and Ensure should be set to Absent' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.VMHostName | Should -Be $resourceProperties.VMHostName\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.VssName | Should -Be $resourceProperties.VssName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.VLanId | Should -Be $resourceProperties.VLanId\n                }\n            }\n\n            Context 'Invoking with Ensure Absent and existing Port Group' {\n                BeforeAll {\n                    $resourceProperties = New-MocksWhenEnsureAbsentAndExistingPortGroup\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve the correct settings from the Server and Ensure should be set to Present' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $resourceProperties.Server\n                    $result.VMHostName | Should -Be $script:vmHost.Name\n                    $result.Name | Should -Be $script:virtualPortGroup.Name\n                    $result.VssName | Should -Be $script:virtualPortGroup.VirtualSwitch.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.VLanId | Should -Be $script:virtualPortGroup.VLanId\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroupSecurity.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVssPortGroupSecurity'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVssPortGroupSecurityMocks.ps1\"\n\n        Describe 'VMHostVssPortGroupSecurity\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupSecurity\n            }\n\n            Context 'Invoking with Security Policy Settings and Security Policy Settings Inherited are not passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenSecurityPolicySettingsArePassedAndSecurityPolicySettingsInheritedAreNotPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-SecurityPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-SecurityPolicy'\n                        ParameterFilter = { $AllowPromiscuous -eq $script:constants.AllowPromiscuous -and `\n                                            $ForgedTransmits -eq $script:constants.ForgedTransmits -and `\n                                            $MacChanges -eq $script:constants.MacChanges }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Security Policy Settings and Security Policy Settings Inherited set to $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenSecurityPolicySettingsArePassedAndSecurityPolicySettingsInheritedAreSetToFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-SecurityPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-SecurityPolicy'\n                        ParameterFilter = { $AllowPromiscuous -eq $script:constants.AllowPromiscuous -and $AllowPromiscuousInherited -eq $script:constants.AllowPromiscuousInherited -and `\n                                            $ForgedTransmits -eq $script:constants.ForgedTransmits -and $ForgedTransmitsInherited -eq $script:constants.ForgedTransmitsInherited -and `\n                                            $MacChanges -eq $script:constants.MacChanges -and $MacChangesInherited -eq $script:constants.MacChangesInherited }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Security Policy Settings and Security Policy Settings Inherited set to $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenSecurityPolicySettingsArePassedAndSecurityPolicySettingsInheritedAreSetToTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-SecurityPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-SecurityPolicy'\n                        ParameterFilter = { $AllowPromiscuousInherited -eq !$script:constants.AllowPromiscuousInherited -and `\n                                            $ForgedTransmitsInherited -eq !$script:constants.ForgedTransmitsInherited -and `\n                                            $MacChangesInherited -eq !$script:constants.MacChangesInherited }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostVssPortGroupSecurity\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupSecurity\n            }\n\n            Context 'Invoking with non matching Security Policy Settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheSecurityPolicySettingsAreNonMatching\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Security Policy Settings are not equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with matching Security Policy Settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheSecurityPolicySettingsAreMatching\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Security Policy Settings are equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVssPortGroupSecurity\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupSecurity\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.VMHostName | Should -Be $script:constants.VMHostName\n                $result.Name | Should -Be $script:constants.VirtualPortGroupName\n                $result.Ensure | Should -Be $resourceProperties.Ensure\n                $result.AllowPromiscuous | Should -Be $script:constants.AllowPromiscuous\n                $result.AllowPromiscuousInherited | Should -Be $script:constants.AllowPromiscuousInherited\n                $result.ForgedTransmits | Should -Be $script:constants.ForgedTransmits\n                $result.ForgedTransmitsInherited | Should -Be $script:constants.ForgedTransmitsInherited\n                $result.MacChanges | Should -Be $script:constants.MacChanges\n                $result.MacChangesInherited | Should -Be $script:constants.MacChangesInherited\n            }\n        }\n\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroupShaping.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVssPortGroupShaping'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVssPortGroupShapingMocks.ps1\"\n\n        Describe 'VMHostVssPortGroupShaping\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupShaping\n\n                $resourceProperties = New-MocksInSet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should call the Update-VirtualPortGroup mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-VirtualPortGroup'\n                    ParameterFilter = { $VMHostNetworkSystem -eq $script:vmHostNetworkSystem -and `\n                                        $VirtualPortGroupName -eq $script:virtualPortGroup.Name -and `\n                                        $Spec -eq $script:virtualPortGroupSpec }\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Describe 'VMHostVssPortGroupShaping\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupShaping\n            }\n\n            Context 'Invoking with non matching Shaping Policy Settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheShapingPolicySettingsAreNonMatching\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Shaping Policy Settings are not equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with matching Shaping Policy Settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheShapingPolicySettingsAreMatching\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Shaping Policy Settings are equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVssPortGroupShaping\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupShaping\n\n                $resourceProperties = New-VMHostVssPortGroupShapingProperties\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.VMHostName | Should -Be $script:constants.VMHostName\n                $result.Name | Should -Be $script:constants.VirtualPortGroupName\n                $result.Ensure | Should -Be $resourceProperties.Ensure\n                $result.Enabled | Should -Be $script:constants.ShapingEnabled\n                $result.AverageBandwidth | Should -Be $script:constants.AverageBandwidth\n                $result.PeakBandwidth | Should -Be $script:constants.PeakBandwidth\n                $result.BurstSize | Should -Be $script:constants.BurstSize\n            }\n        }\n\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNetwork/VMHostVssPortGroup/VMHostVssPortGroupTeaming.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostVssPortGroupTeaming'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostVssPortGroupTeamingMocks.ps1\"\n\n        Describe 'VMHostVssPortGroupTeaming\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupTeaming\n            }\n\n            Context 'Invoking with Teaming Policy Settings and Teaming Policy Settings Inherited are not passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTeamingPolicySettingsArePassedAndTeamingPolicySettingsInheritedAreNotPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-NicTeamingPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-NicTeamingPolicy'\n                        ParameterFilter = { $FailbackEnabled -eq $script:constants.FailbackEnabled -and `\n                                            $LoadBalancingPolicy -eq $script:constants.LoadBalancingPolicyIP -and `\n                                            $NetworkFailoverDetectionPolicy -eq $script:constants.NetworkFailoverDetectionPolicy -and `\n                                            $NotifySwitches -eq $script:constants.NotifySwitches -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($MakeNicActive, [string[]] $script:constants.ActiveNic) -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($MakeNicStandby, [string[]] $script:constants.StandbyNic) -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($MakeNicUnused, [string[]] $script:constants.UnusedNic) }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Teaming Policy Settings and Teaming Policy Settings Inherited set to $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTeamingPolicySettingsArePassedAndTeamingPolicySettingsInheritedAreSetToFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-NicTeamingPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-NicTeamingPolicy'\n                        ParameterFilter = { $FailbackEnabled -eq $script:constants.FailbackEnabled -and `\n                                            $LoadBalancingPolicy -eq $script:constants.LoadBalancingPolicyIP -and `\n                                            $NetworkFailoverDetectionPolicy -eq $script:constants.NetworkFailoverDetectionPolicy -and `\n                                            $NotifySwitches -eq $script:constants.NotifySwitches -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($MakeNicActive, [string[]] $script:constants.ActiveNic) -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($MakeNicStandby, [string[]] $script:constants.StandbyNic) -and `\n                                            [System.Linq.Enumerable]::SequenceEqual($MakeNicUnused, [string[]] $script:constants.UnusedNic) -and `\n                                            $InheritFailback -eq $script:constants.InheritFailback -and `\n                                            $InheritFailoverOrder -eq $script:constants.InheritFailoverOrder -and `\n                                            $InheritLoadBalancingPolicy -eq $script:constants.InheritLoadBalancingPolicy -and `\n                                            $InheritNetworkFailoverDetectionPolicy -eq $script:constants.InheritNetworkFailoverDetectionPolicy -and `\n                                            $InheritNotifySwitches -eq $script:constants.InheritNotifySwitches }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with Teaming Policy Settings and Teaming Policy Settings Inherited set to $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTeamingPolicySettingsArePassedAndTeamingPolicySettingsInheritedAreSetToTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Set-NicTeamingPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-NicTeamingPolicy'\n                        ParameterFilter = { $InheritFailback -eq !$script:constants.InheritFailback -and `\n                                            $InheritFailoverOrder -eq !$script:constants.InheritFailoverOrder -and `\n                                            $InheritLoadBalancingPolicy -eq !$script:constants.InheritLoadBalancingPolicy -and `\n                                            $InheritNetworkFailoverDetectionPolicy -eq !$script:constants.InheritNetworkFailoverDetectionPolicy -and `\n                                            $InheritNotifySwitches -eq !$script:constants.InheritNotifySwitches }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostVssPortGroupTeaming\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupTeaming\n            }\n\n            Context 'Invoking with non matching Teaming Policy Settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheTeamingPolicySettingsAreNonMatching\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the Teaming Policy Settings are not equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with matching Teaming Policy Settings' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheTeamingPolicySettingsAreMatching\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the Teaming Policy Settings are equal' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostVssPortGroupTeaming\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostVssPortGroupTeaming\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.VMHostName | Should -Be $script:constants.VMHostName\n                $result.Name | Should -Be $script:constants.VirtualPortGroupName\n                $result.Ensure | Should -Be $resourceProperties.Ensure\n                $result.FailbackEnabled | Should -Be $script:constants.FailbackEnabled\n                $result.LoadBalancingPolicy | Should -Be $script:constants.LoadBalancingPolicyIP\n                $result.NetworkFailoverDetectionPolicy | Should -Be $script:constants.NetworkFailoverDetectionPolicy\n                $result.NotifySwitches | Should -Be $script:constants.NotifySwitches\n                $result.ActiveNic | Should -Be $script:constants.ActiveNic\n                $result.StandbyNic | Should -Be $script:constants.StandbyNic\n                $result.UnusedNic | Should -Be $script:constants.UnusedNic\n                $result.InheritFailback | Should -Be $script:constants.InheritFailback\n                $result.InheritFailoverOrder | Should -Be $script:constants.InheritFailoverOrder\n                $result.InheritLoadBalancingPolicy | Should -Be $script:constants.InheritLoadBalancingPolicy\n                $result.InheritNetworkFailoverDetectionPolicy | Should -Be $script:constants.InheritNetworkFailoverDetectionPolicy\n                $result.InheritNotifySwitches | Should -Be $script:constants.InheritNotifySwitches\n            }\n        }\n\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostNtpSettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostNtpSettings'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostNtpSettings\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.NtpServer = $null\n            $script:resourceProperties.NtpServicePolicy = 'unset'\n        }\n\n        Context 'Invoking without NTPServer and NTP Service Policy' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo `\n                         = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{} }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } } } }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with not specified NTP Server' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $dateTimeInfoObject = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{} }\n                $dateTimeSystemObject = [VMware.Vim.HostDateTimeSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo `\n                         = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{} }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } } } }\n                }\n                $dateTimeConfigMock = {\n                    return [VMware.Vim.HostDateTimeInfo] @{}\n                }\n                $dateTimeSystemMock = {\n                    return [VMware.Vim.HostDateTimeSystem] @{}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DateTimeConfig -MockWith $dateTimeConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $dateTimeSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemObject } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-DateTimeConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call New-DateTimeConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DateTimeConfig -ParameterFilter { $NtpServer -eq $null } -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Get-View mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemObject } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Update-DateTimeConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DateTimeConfig `\n                                  -ParameterFilter { $DateTimeSystem -eq $dateTimeSystemObject -and `\n                                                     $DateTimeConfig -eq $dateTimeInfoObject } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with empty array NTP Server' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $dateTimeInfoObject = [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org') } }\n                $dateTimeSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' }\n                $dateTimeSystemObject = [VMware.Vim.HostDateTimeSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n                $dateTimeConfigMock = {\n                    return [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org') } }\n                }\n                $dateTimeSystemMock = {\n                    return [VMware.Vim.HostDateTimeSystem] @{}\n                }\n\n                $script:resourceProperties.NtpServer = @()\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DateTimeConfig -MockWith $dateTimeConfigMock `\n                                                     -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $dateTimeSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-DateTimeConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call New-DateTimeConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DateTimeConfig `\n                                  -ParameterFilter { [System.Linq.Enumerable]::SequenceEqual($NtpServer, $script:resourceProperties.NtpServer) } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-View mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Update-DateTimeConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DateTimeConfig `\n                                  -ParameterFilter { $DateTimeSystem -eq $dateTimeSystemObject -and `\n                                                     $DateTimeConfig -eq $dateTimeInfoObject } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with IP address contained in Desired NTP Server, but not in current NTP Server' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $dateTimeInfoObject = [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('1.bg.pool.ntp.org') } }\n                $dateTimeSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' }\n                $dateTimeSystemObject = [VMware.Vim.HostDateTimeSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo =[VMware.Vim.HostDateTimeInfo]@{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n                $dateTimeConfigMock = {\n                    return [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('1.bg.pool.ntp.org') } }\n                }\n                $dateTimeSystemMock = {\n                    return [VMware.Vim.HostDateTimeSystem] @{}\n                }\n\n                $script:resourceProperties.NtpServer = @(\"1.bg.pool.ntp.org\")\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DateTimeConfig -MockWith $dateTimeConfigMock `\n                                                     -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $dateTimeSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-DateTimeConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call New-DateTimeConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DateTimeConfig `\n                                  -ParameterFilter { [System.Linq.Enumerable]::SequenceEqual($NtpServer, [string[]] $script:resourceProperties.NtpServer) } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-View mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Update-DateTimeConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DateTimeConfig `\n                                  -ParameterFilter { $DateTimeSystem -eq $dateTimeSystemObject -and `\n                                                     $DateTimeConfig -eq $dateTimeInfoObject } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Desired NTP Server as a subset of current NTP Server' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $dateTimeInfoObject = [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('1.bg.pool.ntp.org') } }\n                $dateTimeSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' }\n                $dateTimeSystemObject = [VMware.Vim.HostDateTimeSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo =[VMware.Vim.HostDateTimeInfo]@{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n                $dateTimeConfigMock = {\n                    return [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('1.bg.pool.ntp.org') } }\n                }\n                $dateTimeSystemMock = {\n                    return [VMware.Vim.HostDateTimeSystem] @{}\n                }\n\n                $script:resourceProperties.NtpServer = @('1.bg.pool.ntp.org')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DateTimeConfig -MockWith $dateTimeConfigMock `\n                                                     -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $dateTimeSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-DateTimeConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call New-DateTimeConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DateTimeConfig `\n                                  -ParameterFilter { [System.Linq.Enumerable]::SequenceEqual($NtpServer, [string[]] $script:resourceProperties.NtpServer) } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-View mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Update-DateTimeConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DateTimeConfig `\n                                  -ParameterFilter { $DateTimeSystem -eq $dateTimeSystemObject -and `\n                                                     $DateTimeConfig -eq $dateTimeInfoObject } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Desired NTP Server equal to current NTP Server' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $dateTimeInfoObject = [VMware.Vim.HostDateTimeConfig] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }\n                $dateTimeSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' }\n                $dateTimeSystemObject = [VMware.Vim.HostDateTimeSystem] @{}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n                $dateTimeConfigMock = {\n                    return [VMware.Vim.HostDateTimeInfo] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }\n                }\n                $dateTimeSystemMock = {\n                    return [VMware.Vim.HostDateTimeSystem] @{}\n                }\n\n                $script:resourceProperties.NtpServer = @('1.bg.pool.ntp.org', '0.bg.pool.ntp.org')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName New-DateTimeConfig -MockWith $dateTimeConfigMock `\n                                                     -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $dateTimeSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-DateTimeConfig -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call New-DateTimeConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-DateTimeConfig `\n                                  -ParameterFilter { [System.Linq.Enumerable]::SequenceEqual($NtpServer, [string[]] $script:resourceProperties.NtpServer) } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Get-View mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $dateTimeSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Update-DateTimeConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-DateTimeConfig `\n                                  -ParameterFilter { $DateTimeSystem -eq $dateTimeSystemObject -and `\n                                                     $DateTimeConfig -eq $dateTimeInfoObject } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with not specified NTP Service Policy' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $serviceSystemObject = [VMware.Vim.HostServiceSystem] @{}\n                $serviceSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo =[VMware.Vim.HostDateTimeInfo]@{}; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ ServiceSystem = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' } } } }\n                }\n                $serviceSystemMock = {\n                    return [VMware.Vim.HostServiceSystem] @{}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $serviceSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $VIObject -eq $serviceSystemObject } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-ServicePolicy -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Get-View mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $serviceSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Update-ServicePolicy mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-ServicePolicy `\n                                  -ParameterFilter { $ServiceSystem -eq $serviceSystemObject -and `\n                                                     $ServiceId -eq 'ntpd' -and `\n                                                     $ServicePolicyValue -eq 'unset' } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with the same NTP Service Policy' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $serviceSystemObject = [VMware.Vim.HostServiceSystem] @{}\n                $serviceSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{}; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ ServiceSystem = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' } } } }\n                }\n                $serviceSystemMock = {\n                    return [VMware.Vim.HostServiceSystem] @{}\n                }\n\n                $script:resourceProperties.NtpServicePolicy = 'automatic'\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $serviceSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $VIObject -eq $serviceSystemObject } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-ServicePolicy -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Get-View mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $serviceSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Update-ServicePolicy mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-ServicePolicy `\n                                  -ParameterFilter { $ServiceSystem -eq $serviceSystemObject -and `\n                                                     $ServiceId -eq 'ntpd' -and `\n                                                     $ServicePolicyValue -eq 'automatic' } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with different NTP Service Policy' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $serviceSystemObject = [VMware.Vim.HostServiceSystem] @{}\n                $serviceSystemMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{}; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ ServiceSystem = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' } } } }\n                }\n                $serviceSystemMock = {\n                    return [VMware.Vim.HostServiceSystem] @{}\n                }\n\n                $script:resourceProperties.NtpServicePolicy = 'on'\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $serviceSystemMock `\n                                           -ParameterFilter { $Server -eq $viServer -and $Id -eq $serviceSystemMoRef } `\n                                           -ModuleName $script:moduleName\n                Mock -CommandName Update-ServicePolicy -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Get-View mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $viServer -and $Id -eq $serviceSystemMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Update-ServicePolicy mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-ServicePolicy `\n                                  -ParameterFilter { $ServiceSystem -eq $serviceSystemObject -and `\n                                                     $ServiceId -eq 'ntpd' -and `\n                                                     $ServicePolicyValue -eq 'on' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostNtpSettings\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.NtpServer = $null\n            $script:resourceProperties.NtpServicePolicy = 'unset'\n        }\n\n        Context 'Invoking without NTPServer and NTP Service Policy' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo `\n                         = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{} }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } } } }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with not specified NTP Server' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo `\n                         = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig = [VMware.Vim.HostNtpConfig] @{} }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } } } }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The NTP Server should not be updated)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with empty array NTP Server' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n\n                $script:resourceProperties.NtpServer = @()\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired NTP Server is empty array and current NTP Server should be updated)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with IP address contained in Desired NTP Server, but not in current NTP Server' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n\n                $script:resourceProperties.NtpServer = @('1.bg.pool.ntp.org')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired NTP Server contains IP address that the current NTP Server does not)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Desired NTP Server as a subset of current NTP Server' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n\n                $script:resourceProperties.NtpServer = @('1.bg.pool.ntp.org')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired NTP Server is a subset of the current NTP Server)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Desired NTP Server equal to current NTP Server' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                         = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager `\n                         = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n                }\n\n                $script:resourceProperties.NtpServer = @('1.bg.pool.ntp.org', '0.bg.pool.ntp.org')\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The desired NTP Server is equal to the current NTP Server)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with not specified NTP Service Policy' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{}; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager = [VMware.Vim.HostConfigManager] @{ ServiceSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' } } } }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The NTP Service Policy is not specified and should not be updated)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with the same NTP Service Policy' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{}; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager = [VMware.Vim.HostConfigManager] @{ ServiceSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' } } } }\n                }\n\n                $script:resourceProperties.NtpServicePolicy = 'automatic'\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The desired NTP Service Policy is the same as the current NTP Service Policy)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with different NTP Service Policy' {\n            BeforeAll {\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ ExtensionData `\n                         = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{}; Service `\n                         = [VMware.Vim.HostServiceInfo] @{ Service = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager = [VMware.Vim.HostConfigManager] @{ ServiceSystem `\n                         = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostServiceSystem'; Value = 'ServiceSystem' } } } }\n                }\n\n                $script:resourceProperties.NtpServicePolicy = 'on'\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired NTP Service Policy is different than the current NTP Service Policy)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n    }\n\n    Describe 'VMHostNtpSettings\\Get' -Tag 'Get' {\n        BeforeAll {\n            # Arrange\n            $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n            $viServerMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n            }\n            $vmHostMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; ExtensionData `\n                     = [VMware.Vim.HostSystem] @{ Config = [VMware.Vim.HostConfigInfo] @{ DateTimeInfo = [VMware.Vim.HostDateTimeInfo] @{ NtpConfig `\n                     = [VMware.Vim.HostNtpConfig] @{ Server = @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org') } }; Service = [VMware.Vim.HostServiceInfo] @{ Service `\n                     = @([VMware.Vim.HostService] @{ Key = 'ntpd'; Policy = 'automatic' }) } }; ConfigManager = [VMware.Vim.HostConfigManager] @{ DateTimeSystem `\n                     = [VMware.Vim.ManagedObjectReference] @{ Type = 'HostDateTimeSystem'; Value = 'DateTimeSystem' } } } }\n            }\n\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        }\n\n        AfterEach {\n            $script:resourceProperties.NtpServer = $null\n            $script:resourceProperties.NtpServicePolicy = 'unset'\n        }\n\n        # Arrange\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Connect-VIServer `\n                              -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should call Get-VMHost mock with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Get-VMHost `\n                              -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Name | Should -Be $script:resourceProperties.Name\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.NtpServer | Should -Be @('0.bg.pool.ntp.org', '1.bg.pool.ntp.org')\n            $result.NtpServicePolicy | Should -Be 'automatic'\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostPciPassthrough.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostPciPassthrough'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostPciPassthroughMocks.ps1\"\n\n        Describe 'VMHostPciPassthrough\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPciPassthrough\n            }\n\n            Context 'Invoking with PCI Device that is not existing' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPCIDeviceIsNotExisting\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the PCI Device does not exist' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"The specified PCI Device $($script:constants.PciDeviceId + $script:constants.PciDeviceId) does not exist for VMHost $($script:vmHost.Name).\"\n                }\n            }\n\n            Context 'Invoking with existing PCI Device that is not Passthrough capable' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPCIDeviceIsExistingButIsNotPassthroughCapable\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when the PCI Device exists but is not Passthrough capable' {\n                    # Act && Assert\n                    { $resource.Set() } | Should -Throw \"Cannot configure PCI-Passthrough on incapable device $($script:constants.PciDeviceId).0.\"\n                }\n            }\n\n            Context 'Invoking with existing PCI Device' {\n                BeforeAll {\n                    <#\n                    The Product Line should be modified here to avoid infinite loop in the EnsureVMHostIsInDesiredState()\n                    because when the Connection is a vCenter and the ESXi is restarted the VMHost State changes from 'Maintenance' to\n                    'NotResponding' and again to 'Maintenance'. This behaviour cannot be mocked in the Tests.\n                    #>\n                    $script:viServer.ProductLine = $script:constants.ESXiProductId\n\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPCIDeviceIsExisting\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-PassthruConfig mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-PassthruConfig'\n                        ParameterFilter = { $VMHostPciPassthruSystem -eq $script:vmHostPciPassthruSystem -and $VMHostPciPassthruConfig -eq $script:vmHostPciPassthruConfig }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                It 'Should call the Restart-VMHost mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Restart-VMHost'\n                        ParameterFilter = { $Server -eq $script:viServer -and $VMHost -eq $script:vmHost -and !$Confirm }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n\n                AfterAll {\n                    # The Product Line should be set to its default value after all Tests in this Context block.\n                    $script:viServer.ProductLine = $script:constants.vCenterProductId\n                }\n            }\n        }\n\n        Describe 'VMHostPciPassthrough\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPciPassthrough\n            }\n\n            Context 'Invoking with Enabled value not equal to PCI Device Passthrough Enabled value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnabledValueIsNotEqualToPCIDevicePassthroughEnabledValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Enabled value is not equal to PCI Device Passthrough Enabled value' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Enabled value equal to PCI Device Passthrough Enabled value' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnabledValueIsEqualToPCIDevicePassthroughEnabledValue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Enabled value is equal to PCI Device Passthrough Enabled value' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostPciPassthrough\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPciPassthrough\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.Name | Should -Be $script:constants.VMHostName\n                $result.RestartTimeoutMinutes | Should -Be $script:constants.DefaultVMHostRestartTimeoutMinutes\n                $result.Id | Should -Be $script:constants.PciDeviceId\n                $result.Enabled | Should -Be $script:constants.PciDeviceEnabled\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostPermission.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostPermission'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostPermissionMocks.ps1\"\n\n        Describe 'VMHostPermission\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPermission\n            }\n\n            Context 'When Ensure is Present, the Permission is not created and the Entity is a Datacenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsADatacenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified Datacenter Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:datacenterEntity -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is not created and the Entity is a VMHost' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsAVMHost\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified VMHost Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:vmHost -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is not created and the Entity is a Datastore' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsADatastore\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified Datastore Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:datastoreEntity -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is not created and the Entity is a Resource Pool' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedAndTheEntityIsAResourcePool\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified Resource Pool Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:resourcePoolEntity -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is not created, the Entity is a VM and empty Entity location is passed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedTheEntityIsAVMAndEmptyEntityLocationIsPassed\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified VM Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:vmEntity -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is not created, the Entity is a VM and Entity location is one Resource Pool' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedTheEntityIsAVMAndEntityLocationIsOneResourcePool\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified VM Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:vmEntity -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is not created, the Entity is a VM and Entity location is one Resource Pool and one vApp' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsNotCreatedTheEntityIsAVMAndEntityLocationIsOneResourcePoolAndOneVApp\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIPermission mock with the specified VM Entity, Principal and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Entity -eq $script:vmEntity -and\n                            $Principal -eq $script:principal -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present and the Permission is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureIsPresentAndThePermissionIsAlreadyCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VIPermission mock with the specified Permission and Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VIPermission'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Permission -eq $script:vmHostPermission -and\n                            $Role -eq $script:vmHostRole -and\n                            $Propagate -eq $script:constants.PropagatePermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Permission is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureIsAbsentAndThePermissionIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-VIPermission mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VIPermission'\n                        ParameterFilter = {\n                            $Permission -eq $script:vmHostPermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Permission is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureIsAbsentAndThePermissionIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-VIPermission mock with the specified Permission once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VIPermission'\n                        ParameterFilter = {\n                            $Permission -eq $script:vmHostPermission -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostPermission\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPermission\n            }\n\n            Context 'When the Principal is part of a domain' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenThePrincipalIsPartOfADomain\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Get-VIAccount mock with the specified domain and username once' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Get-VIAccount'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Domain -eq $script:constants.DomainName -and\n                            $User -and\n                            $Id -eq $script:constants.PrincipalName\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present and the Permission is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndThePermissionIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the Permission is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is already created and the desired Role and Propagate behaviour are different from the current Role and Propagate behaviour' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsAlreadyCreatedAndTheDesiredRoleAndPropagateBehaviourAreDifferentFromTheCurrentRoleAndPropagateBehaviour\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the Permission is already created and the desired Role and Propagate behaviour are different from the current Role and Propagate behaviour' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Permission is already created and the desired Role and Propagate behaviour are the same as the current Role and Propagate behaviour' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentThePermissionIsAlreadyCreatedAndTheDesiredRoleAndPropagateBehaviourAreTheSameAsTheCurrentRoleAndPropagateBehaviour\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, the Permission is already created and the desired Role and Propagate behaviour are the same as the current Role and Propagate behaviour' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Permission is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndThePermissionIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the Permission is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Permission is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndThePermissionIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the Permission is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostPermission\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPermission\n            }\n\n            Context 'When Ensure is Present and the Permission is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndThePermissionIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.EntityName | Should -Be $resourceProperties.EntityName\n                    $result.EntityLocation | Should -Be $resourceProperties.EntityLocation\n                    $result.EntityType | Should -Be $resourceProperties.EntityType\n                    $result.PrincipalName | Should -Be $resourceProperties.PrincipalName\n                    $result.RoleName | Should -Be $resourceProperties.RoleName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Propagate | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When Ensure is Present and the Permission is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndThePermissionIsAlreadyCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.EntityName | Should -Be $script:vmHostPermission.Entity.Name\n                    $result.EntityLocation | Should -Be $resourceProperties.EntityLocation\n                    $result.EntityType | Should -Be $resourceProperties.EntityType\n                    $result.PrincipalName | Should -Be $script:vmHostPermission.Principal\n                    $result.RoleName | Should -Be $script:vmHostPermission.Role\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Propagate | Should -Be $script:vmHostPermission.Propagate\n                }\n            }\n\n            Context 'When Ensure is Absent and the Permission is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndThePermissionIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.EntityName | Should -Be $resourceProperties.EntityName\n                    $result.EntityLocation | Should -Be $resourceProperties.EntityLocation\n                    $result.EntityType | Should -Be $resourceProperties.EntityType\n                    $result.PrincipalName | Should -Be $resourceProperties.PrincipalName\n                    $result.RoleName | Should -Be $resourceProperties.RoleName\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Propagate | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When Ensure is Absent and the Permission is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndThePermissionIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.EntityName | Should -Be $script:vmHostPermission.Entity.Name\n                    $result.EntityLocation | Should -Be $resourceProperties.EntityLocation\n                    $result.EntityType | Should -Be $resourceProperties.EntityType\n                    $result.PrincipalName | Should -Be $script:vmHostPermission.Principal\n                    $result.RoleName | Should -Be $script:vmHostPermission.Role\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Propagate | Should -Be $script:vmHostPermission.Propagate\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostPowerPolicy.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostPowerPolicy'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostPowerPolicyMocks.ps1\"\n\n        Describe 'VMHostPowerPolicy\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPowerPolicy\n            }\n\n            Context 'Invoking with Balanced Power Policy and no Server errors' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPowerPolicyIsBalancedAndNoServerErrors\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should call the Update-PowerPolicy mock once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Update-PowerPolicy'\n                        ParameterFilter = { $VMHostPowerSystem -eq $script:vmHostPowerSystem -and $PowerPolicy -eq $script:constants.PowerPolicy.Balanced }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'Invoking with High Performance Power Policy and Power System Server error' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPowerPolicyIsHighPerformanceAndPowerSystemServerError\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when Power System Server error occurs' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not retrieve the Power System of VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'Invoking with Custom Power Policy and Update Power Policy Server error' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenPowerPolicyIsCustomAndUpdatePowerPolicyServerError\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw the correct error when Update Power Policy Server error occurs' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"The Power Policy of VMHost $($script:vmHost.Name) could not be updated: ScriptHalted\"\n                }\n            }\n        }\n\n        Describe 'VMHostPowerPolicy\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPowerPolicy\n            }\n\n            Context 'Invoking with Power Policy not equal to current Power Policy' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDesiredPowerPolicyIsNotEqualToCurrentPowerPolicy\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Desired Power Policy is not equal to current Power Policy' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'Invoking with Power Policy equal to current Power Policy' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDesiredPowerPolicyIsEqualToCurrentPowerPolicy\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should call all defined mocks' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Desired Power Policy is equal to current Power Policy' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n        }\n\n        Describe 'VMHostPowerPolicy\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostPowerPolicy\n\n                $resourceProperties = New-VMHostPowerPolicyProperties\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should call all defined mocks' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve the correct settings from the Server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $resourceProperties.Server\n                $result.Name | Should -Be $script:constants.VMHostName\n\n                # Here GetEnumerator() is needed because $script:constants.PowerPolicy is a hashtable and wtihout it you can't iterate over the Key-Value pairs.\n                $powerPolicy = $script:constants.PowerPolicy.GetEnumerator() | Where-Object { $_.Value -eq $script:vmHost.ExtensionData.Config.PowerSystemInfo.CurrentPolicy.Key }\n                $result.PowerPolicy | Should -Be $powerPolicy.Key\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostRole.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostRole'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostRoleMocks.ps1\"\n\n        Describe 'VMHostRole\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostRole\n            }\n\n            Context 'When Ensure is Present, the Role is not created and there are no passed Privileges' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheRoleIsNotCreatedAndThereAreNoPassedPrivileges\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIRole mock with the specified name once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIRole'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Name -eq $resourceProperties.Name -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Role is not created and there are passed Privileges' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheRoleIsNotCreatedAndThereArePassedPrivileges\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the New-VIRole mock with the specified name and Privileges once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $expectedPrivileges = @($script:anonymousPrivilege, $script:viewPrivilege, $script:readPrivilege)\n\n                    $assertMockCalledParams = @{\n                        CommandName = 'New-VIRole'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Name -eq $resourceProperties.Name -and\n                            [System.Linq.Enumerable]::SequenceEqual($Privilege, [VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Privilege[]] $expectedPrivileges) -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the Role is already created and the desired Privilege list is different from the current Privilege list' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureIsPresentTheRoleIsAlreadyCreatedAndTheDesiredPrivilegeListIsDifferentFromTheCurrentPrivilegeList\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VIRole mock with the specified Privileges twice' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VIRole'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Role -eq $script:vmHostRole -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 2\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Role is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheRoleIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-VIRole mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VIRole'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Role -eq $script:vmHostRole -and\n                            $Force -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the Role is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksInSetWhenEnsureIsAbsentAndTheRoleIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-VIRole mock with the specified Role once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VIRole'\n                        ParameterFilter = {\n                            $Server -eq $script:esxiServer -and\n                            $Role -eq $script:vmHostRole -and\n                            $Force -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostRole\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostRole\n            }\n\n            Context 'When Ensure is Present and the Role is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheRoleIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the Role is not created' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Role is already created and the desired Privilege list is different from the current Privilege list' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheRoleIsAlreadyCreatedAndTheDesiredPrivilegeListIsDifferentFromTheCurrentPrivilegeList\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the Role is already created and the desired Privilege list is different from the current Privilege list' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the Role is already created and the desired Privilege list is the same as the current Privilege list' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheRoleIsAlreadyCreatedAndTheDesiredPrivilegeListIsTheSameAsTheCurrentPrivilegeList\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present, the Role is already created and the desired Privilege list is the same as the current Privilege list' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Role is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheRoleIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the Role is already removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the Role is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheRoleIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the Role is not removed' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostRole\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostRole\n            }\n\n            Context 'When Ensure is Present and the Role is not created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheRoleIsNotCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.PrivilegeIds | Should -Be $resourceProperties.PrivilegeIds\n                }\n            }\n\n            Context 'When Ensure is Present and the Role is already created' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheRoleIsAlreadyCreated\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.Name | Should -Be $script:vmHostRole.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.PrivilegeIds | Should -Be $script:vmHostRole.PrivilegeList\n                }\n            }\n\n            Context 'When Ensure is Absent and the Role is already removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheRoleIsAlreadyRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.PrivilegeIds | Should -Be $resourceProperties.PrivilegeIds\n                }\n            }\n\n            Context 'When Ensure is Absent and the Role is not removed' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheRoleIsNotRemoved\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:esxiServer.Name\n                    $result.Name | Should -Be $script:vmHostRole.Name\n                    $result.Ensure | Should -Be 'Present'\n                    $result.PrivilegeIds | Should -Be $script:vmHostRole.PrivilegeList\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostSatpClaimRule.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostSatpClaimRule'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n    Ensure = 'Present'\n    RuleName = 'VMW_SATP_LOCAL'\n    Transport = 'VMW_SATP_LOCAL Transport'\n    Description = 'Description of VMW_SATP_LOCAL Claim Rule.'\n    Type = 'transport'\n    Psp = 'VMW_PSP_MRU'\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostSatpClaimRule\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.Ensure = 'Present'\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhostObject = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'add' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $addSatpArgs = @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null; force = $false\n                    }\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n                    $esxcli.storage.nmp.satp.rule.add | Add-Member -MemberType ScriptMethod -Name 'CreateArgs' -Value { return $addSatpArgs }\n                    $esxcli.storage.nmp.satp.rule.add | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { return $null }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n                $satpAddArgsMock = {\n                    return @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null; force = $false\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n                Mock -CommandName Add-CreateArgs -MockWith $satpAddArgsMock -ModuleName $script:moduleName\n                Mock -CommandName Add-SATPClaimRule -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock with the passed server and vmhost once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                                  -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $vmhostObject -and $V2 } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking when ensure set to Present and the SATP Claim Rule is not installed' {\n            BeforeAll {\n                # Arrange\n                $addSatpArgs = @{\n                    satp = 'VMW_SATP_LOCAL'; pspoption = $null; transport = 'VMW_SATP_LOCAL Transport'; description = 'Description of VMW_SATP_LOCAL Claim Rule.'; vendor = $null; boot = $false;\n                    type = 'transport'; device = $null; driver = $null; claimoption = $null; psp = 'VMW_PSP_MRU'; option = $null; model = $null; force = $false\n                }\n\n                $esxcliObject = New-Object PSObject\n                $esxcliObject | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'add' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $addSatpArgs = @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null; force = $false\n                    }\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n                    $esxcli.storage.nmp.satp.rule.add | Add-Member -MemberType ScriptMethod -Name 'CreateArgs' -Value { return $addSatpArgs }\n                    $esxcli.storage.nmp.satp.rule.add | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { return $null }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n                $satpAddArgsMock = {\n                    return @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null; force = $false\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n                Mock -CommandName Add-CreateArgs -MockWith $satpAddArgsMock -ModuleName $script:moduleName\n                Mock -CommandName Add-SATPClaimRule -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Get-SATPClaimRules mock once with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-SATPClaimRules `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Add-CreateArgs mock once with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Add-CreateArgs `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Add-SATPClaimRule mock once with the passed EsxCli and SATP Args' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Add-SATPClaimRule `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id -and ( Compare-Object -ReferenceObject $SatpArgs.Values -DifferenceObject $addSatpArgs.Values ) -eq $null } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking when ensure set to Present and the SATP Claim Rule is installed' {\n            BeforeAll {\n                # Arrange\n                $addSatpArgs = @{\n                    satp = 'VMW_SATP_LOCAL'; pspoption = $null; transport = 'VMW_SATP_LOCAL Transport'; description = 'Description of VMW_SATP_LOCAL Claim Rule.'; vendor = $null; boot = $false;\n                    type = 'transport'; device = $null; driver = $null; claimoption = $null; psp = 'VMW_PSP_MRU'; option = $null; model = $null; force = $false\n                }\n\n                $esxcliObject = New-Object PSObject\n                $esxcliObject | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'add' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $addSatpArgs = @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null; force = $false\n                    }\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n                    $esxcli.storage.nmp.satp.rule.add | Add-Member -MemberType ScriptMethod -Name 'CreateArgs' -Value { return $addSatpArgs }\n                    $esxcli.storage.nmp.satp.rule.add | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { return $null }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n                $satpAddArgsMock = {\n                    return @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null; force = $false\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n                Mock -CommandName Add-CreateArgs -MockWith $satpAddArgsMock -ModuleName $script:moduleName\n                Mock -CommandName Add-SATPClaimRule -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Get-SATPClaimRules mock once with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-SATPClaimRules `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Add-CreateArgs mock with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Add-CreateArgs `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Add-SATPClaimRule mock with the passed EsxCli and SATP Args' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Add-SATPClaimRule `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id -and ( Compare-Object -ReferenceObject $SatpArgs.Values -DifferenceObject $addSatpArgs.Values ) -eq $null } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking when ensure set to Absent and the SATP Claim Rule is installed' {\n            BeforeAll {\n                # Arrange\n                $removeSatpArgs = @{\n                    satp = 'VMW_SATP_LOCAL'; pspoption = $null; transport = 'VMW_SATP_LOCAL Transport'; description = 'Description of VMW_SATP_LOCAL Claim Rule.'; vendor = $null; boot = $false;\n                    type = 'transport'; device = $null; driver = $null; claimoption = $null; psp = 'VMW_PSP_MRU'; option = $null; model = $null\n                }\n\n                $esxcliObject = New-Object PSObject\n                $esxcliObject | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'remove' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $removeSatpArgs = @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null\n                    }\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n                    $esxcli.storage.nmp.satp.rule.remove | Add-Member -MemberType ScriptMethod -Name 'CreateArgs' -Value { return $removeSatpArgs }\n                    $esxcli.storage.nmp.satp.rule.remove | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { return $null }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n                $satpRemoveArgsMock = {\n                    return @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n                Mock -CommandName Remove-CreateArgs -MockWith $satpRemoveArgsMock -ModuleName $script:moduleName\n                Mock -CommandName Remove-SATPClaimRule -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Get-SATPClaimRules mock once with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-SATPClaimRules `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Remove-CreateArgs mock once with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Remove-CreateArgs `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Remove-SATPClaimRule mock once with the passed EsxCli and SATP Args' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Remove-SATPClaimRule `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id -and ( Compare-Object -ReferenceObject $SatpArgs.Values -DifferenceObject $removeSatpArgs.Values ) -eq $null } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking when ensure set to Absent and the SATP Claim Rule is not installed' {\n            BeforeAll {\n                # Arrange\n                $removeSatpArgs = @{\n                    satp = 'VMW_SATP_LOCAL'; pspoption = $null; transport = 'VMW_SATP_LOCAL Transport'; description = 'Description of VMW_SATP_LOCAL Claim Rule.'; vendor = $null; boot = $false;\n                    type = 'transport'; device = $null; driver = $null; claimoption = $null; psp = 'VMW_PSP_MRU'; option = $null; model = $null\n                }\n\n                $esxcliObject = New-Object PSObject\n                $esxcliObject | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'id' -Value 'esxCli Id'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'remove' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $removeSatpArgs = @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null\n                    }\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n                    $esxcli.storage.nmp.satp.rule.remove | Add-Member -MemberType ScriptMethod -Name 'CreateArgs' -Value { return $removeSatpArgs }\n                    $esxcli.storage.nmp.satp.rule.remove | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { return $null }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n                $satpRemoveArgsMock = {\n                    return @{\n                        satp = $null; pspoption = $null; transport = $null; description = $null; vendor = $null; boot = $false; type = $null; device = $null; driver = $null; claimoption = $null;\n                        psp = $null; option = $null; model = $null\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n                Mock -CommandName Remove-CreateArgs -MockWith $satpRemoveArgsMock -ModuleName $script:moduleName\n                Mock -CommandName Remove-SATPClaimRule -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Get-SATPClaimRules mock once with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-SATPClaimRules `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Remove-CreateArgs mock with the passed EsxCli' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Remove-CreateArgs `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should not call Remove-SATPClaimRule mock with the passed EsxCli and SATP Args' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Remove-SATPClaimRule `\n                                  -ParameterFilter { $EsxCli.Id -eq $esxcliObject.Id -and ( Compare-Object -ReferenceObject $SatpArgs.Values -DifferenceObject $removeSatpArgs.Values ) -eq $null } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostSatpClaimRule\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.Ensure = 'Present'\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhostObject = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock with the passed server and vmhost once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                                  -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $vmhostObject -and $V2 } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Ensure set to Present and the SATP Claim Rule is not installed' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false ( The rule is not installed )' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure set to Present and the SATP Claim Rule is installed' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true ( The rule is installed )' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with Ensure set to Absent and the SATP Claim Rule is installed' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false ( The rule is installed )' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with Ensure set to Absent and the SATP Claim Rule is not installed' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Ensure = 'Absent'\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{}\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true ( The rule is not installed )' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'VMHostSatpClaimRule\\Get' -Tag 'Get' {\n        AfterEach {\n            $script:resourceProperties.Ensure = 'Present'\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhostObject = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock with the passed server and vmhost once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                                  -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $vmhostObject -and $V2 } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Claim Rule Installed' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL'; Transport = 'VMW_SATP_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return the resource with the properties retrieved from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Name | Should -Be $script:resourceProperties.Name\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.Ensure | Should -Be 'Present'\n                $result.RuleName | Should -Be $script:resourceProperties.RuleName\n                $result.Transport | Should -Be $script:resourceProperties.Transport\n                $result.Description | Should -Be $script:resourceProperties.Description\n                $result.Type | Should -Be $script:resourceProperties.Type\n                $result.Psp | Should -Be $script:resourceProperties.Psp\n                $result.PSPoptions | Should -Be ''\n                $result.Vendor | Should -Be ''\n                $result.Device | Should -Be ''\n                $result.Driver | Should -Be ''\n                $result.ClaimOptions | Should -Be ''\n                $result.Options | Should -Be ''\n                $result.Model | Should -Be ''\n                $result.Boot | Should -Be $null\n                $result.Force | Should -Be $null\n            }\n        }\n\n        Context 'Invoking with Claim Rule Not Installed' {\n            BeforeAll {\n                # Arrange\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'storage' -Value (New-Object PSObject)\n                    $esxcli.storage | Add-Member -MemberType NoteProperty -Name 'nmp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp | Add-Member -MemberType NoteProperty -Name 'satp' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp | Add-Member -MemberType NoteProperty -Name 'rule' -Value (New-Object PSObject)\n                    $esxcli.storage.nmp.satp.rule | Add-Member -MemberType NoteProperty -Name 'list' -Value (New-Object PSObject)\n\n                    $satpClaimRules = @(\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                       [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n\n                    $esxcli.storage.nmp.satp.rule.list | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $satpClaimRules }\n\n                    return $esxcli\n                }\n                $satpClaimRulesMock = {\n                    return @(\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_LOCAL_2'; Transport = 'VMW_SATP_LOCAL_2 Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' };\n                        [VMware.Vim.SatpClaimRule] @{ Name = 'VMW_SATP_NOT_LOCAL'; Transport = 'VMW_SATP_NOT_LOCAL Transport'; Description = 'Description of VMW_SATP_LOCAL Claim Rule.'; DefaultPSP = 'VMW_PSP_MRU' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-SATPClaimRules -MockWith $satpClaimRulesMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return the resource with the properties retrieved from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Name | Should -Be $script:resourceProperties.Name\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.Ensure | Should -Be 'Absent'\n                $result.RuleName | Should -Be $script:resourceProperties.RuleName\n                $result.Transport | Should -Be $script:resourceProperties.Transport\n                $result.Description | Should -Be $script:resourceProperties.Description\n                $result.Type | Should -Be $script:resourceProperties.Type\n                $result.Psp | Should -Be $script:resourceProperties.Psp\n                $result.PSPoptions | Should -Be ''\n                $result.Vendor | Should -Be ''\n                $result.Device | Should -Be ''\n                $result.Driver | Should -Be ''\n                $result.ClaimOptions | Should -Be ''\n                $result.Options | Should -Be ''\n                $result.Model | Should -Be ''\n                $result.Boot | Should -Be $null\n                $result.Force | Should -Be $null\n            }\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostScsiLun.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostScsiLun'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostScsiLunMocks.ps1\"\n\n        Describe 'VMHostScsiLun\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostScsiLun\n            }\n\n            Context 'When error occurs while modifying the SCSI Lun configuration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenErrorOccursWhileModifyingTheScsiLunConfiguration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while modifying the SCSI Lun configuration' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not modify the configuration of SCSI device $($script:constants.VMHostScsiLunCanonicalName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When no error occurs while modifying the SCSI Lun configuration' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenNoErrorOccursWhileModifyingTheScsiLunConfiguration\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-ScsiLun mock with the specified SCSI Lun and desired settings to configure once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-ScsiLun'\n                        ParameterFilter = {\n                            $ScsiLun -eq $script:vmHostScsiLun -and\n                            $MultipathPolicy -eq $script:constants.VMHostScsiLunMultipathPolicy -and\n                            $PreferredPath -eq $script:vmHostScsiLunPath -and\n                            $DeletePartitions -eq $script:constants.VMHostScsiLunDeletePartitions -and\n                            $IsLocal -eq $script:constants.VMHostScsiLunIsLocal -and\n                            $IsSsd -eq $script:constants.VMHostScsiLunIsSsd -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostScsiLun\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostScsiLun\n            }\n\n            Context 'When the ScsiLun is not found' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunIsNotFound\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when the ScsiLun is not found' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Test() } | Should -Throw \"Could not retrieve SCSI device $($script:constants.VMHostScsiLunCanonicalName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the SCSI Lun path is not found' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathIsNotFound\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when the SCSI Lun path is not found' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Test() } | Should -Throw \"Could not retrieve SCSI Lun path $($script:constants.VMHostScsiLunPathName) to SCSI device $($script:constants.VMHostScsiLunCanonicalName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the SCSI Lun configuration does not need to be modified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunConfigurationDoesNotNeedToBeModified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the SCSI Lun configuration does not need to be modified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the SCSI Lun path is not preferred' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathIsNotPreferred\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the SCSI Lun path is not preferred' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When disk partitions exist and DeletePartitions is specified' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenDiskPartitionsExistAndDeletePartitionsIsSpecified\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when disk partitions exist and DeletePartitions is specified' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostScsiLun\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostScsiLun\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VMHostName | Should -Be $script:vmHost.Name\n                $result.CanonicalName | Should -Be $script:constants.VMHostScsiLunCanonicalName\n                $result.MultipathPolicy | Should -Be $script:constants.VMHostScsiLunMultipathPolicy\n                $result.PreferredScsiLunPathName | Should -Be $script:constants.VMHostScsiLunPathName\n                $result.BlocksToSwitchPath | Should -Be $script:constants.VMHostScsiLunBlocksToSwitchPath\n                $result.CommandsToSwitchPath | Should -Be $script:constants.VMHostScsiLunCommandsToSwitchPath\n                $result.DeletePartitions | Should -Be $script:constants.VMHostScsiLunDeletePartitions\n                $result.IsLocal | Should -Be $script:constants.VMHostScsiLunIsLocal\n                $result.IsSsd | Should -Be $script:constants.VMHostScsiLunIsSsd\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostScsiLunPath.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'VMHostScsiLunPath'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\VMHostScsiLunPathMocks.ps1\"\n\n        Describe 'VMHostScsiLunPath\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostScsiLunPath\n            }\n\n            Context 'When error occurs while configuring the SCSI Lun path' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenErrorOccursWhileConfiguringTheScsiLunPath\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while configuring the SCSI Lun path' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not configure SCSI Lun path $($script:constants.VMHostScsiLunPathName) to SCSI device $($script:constants.VMHostScsiLunCanonicalName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When no error occurs while configuring the SCSI Lun path' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenNoErrorOccursWhileConfiguringTheScsiLunPath\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-ScsiLunPath mock with the specified SCSI Lun path and active and preferred values once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-ScsiLunPath'\n                        ParameterFilter = {\n                            $ScsiLunPath -eq $script:vmHostScsiLunPath -and\n                            $Active -eq $script:constants.VMHostActiveScsiLunPath -and\n                            $Preferred -eq $script:constants.VMHostPreferredScsiLunPath -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'VMHostScsiLunPath\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostScsiLunPath\n            }\n\n            Context 'When the ScsiLun is not found' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunIsNotFound\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when the ScsiLun is not found' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Test() } | Should -Throw \"Could not retrieve SCSI device $($script:constants.VMHostScsiLunCanonicalName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the SCSI Lun path is not found' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathIsNotFound\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Test()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when the SCSI Lun path is not found' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Test() } | Should -Throw \"Could not retrieve SCSI Lun path $($script:constants.VMHostScsiLunPathName) to SCSI device $($script:constants.VMHostScsiLunCanonicalName) from VMHost $($script:vmHost.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When the SCSI Lun path state is Active and the Active property is $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathStateIsActiveAndTheActivePropertyIsTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the SCSI Lun path state is Active and the Active property is $true' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the SCSI Lun path state is Active and the Active property is $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathStateIsActiveAndTheActivePropertyIsFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the SCSI Lun path state is Active and the Active property is $false' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When the SCSI Lun path is Preferred and the Preferred property is $true' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathIsPreferredAndThePreferredPropertyIsTrue\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when the SCSI Lun path is Preferred and the Preferred property is $true' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When the SCSI Lun path is Preferred and the Preferred property is $false' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenTheScsiLunPathIsPreferredAndThePreferredPropertyIsFalse\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when the SCSI Lun path is Preferred and the Preferred property is $false' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'VMHostScsiLunPath\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostScsiLunPath\n\n                $resourceProperties = New-MocksInGet\n                $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:viServer.Name\n                $result.VMHostName | Should -Be $script:vmHost.Name\n                $result.Name | Should -Be $script:vmHostScsiLunPath.Name\n                $result.ScsiLunCanonicalName | Should -Be $script:vmHostScsiLunPath.ScsiLun.CanonicalName\n                $result.Active | Should -BeTrue\n                $result.Preferred | Should -Be $script:vmHostScsiLunPath.Preferred\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostService.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostService'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n    Key = 'TSM-SSH'\n    Policy = 'Unset'\n    Running = $false\n    Label = 'SSH'\n    Required = $false\n    RuleSet = @('Rule1', 'Rule2')\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostService\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.Key = [string]::Empty\n            $script:resourceProperties.Policy = 'Unset'\n            $script:resourceProperties.Running = $false\n        }\n\n        Context 'Invoking with empty settings' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $vmHostService = [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{ Key = 'TSM-SSH'}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $vmHostService = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{ Key = 'TSM-SSH'; Policy = 'Off'; Running = $false }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $vmHostService -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostService mock with the passed server and vmhost once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostService `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with VMHostService To Update Policy' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n                $script:resourceProperties.Policy = 'On'\n                $script:resourceProperties.Running = $true\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $getServiceSettingsMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{Key = 'TSM-SSH'; Policy = 'Off'; Running = $false}\n                }\n\n                $setServiceSettingMock = {\n                    return $null\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $getServiceSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostService -MockWith $setServiceSettingMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Set-VMHostService for service Policy that needs to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostService `\n                    -ParameterFilter { $HostService.Key -eq $script:resourceProperties.Key -and $Policy -eq $script:resourceProperties.Policy } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n        }\n\n        Context 'Invoking with VMHostService To start service' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n                $script:resourceProperties.Policy = 'On'\n                $script:resourceProperties.Running = $true\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $getServiceSettingsMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{Key = 'TSM-SSH'; Policy = 'On'; Running = $false}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $getServiceSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Start-VMHostService -MockWith { return $null} -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Start-VMHostService once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Start-VMHostService `\n                    -ParameterFilter { $HostService.Key -eq $script:resourceProperties.Key } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with VMHostService To stop service' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n                $script:resourceProperties.Policy = 'On'\n                $script:resourceProperties.Running = $false\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $getServiceSettingsMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{Key = 'TSM-SSH'; Policy = 'On'; Running = $true}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $getServiceSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Stop-VMHostService -MockWith { return $null} -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Stop-VMHostService once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Stop-VMHostService `\n                    -ParameterFilter { $HostService.Key -eq $script:resourceProperties.Key } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking without Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n                $script:resourceProperties.Policy = 'On'\n                $script:resourceProperties.Running = $false\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $serviceSettingsMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{Key = 'TSM-SSH'; Policy = 'On'; Running = $false}\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $serviceSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostService -MockWith { return $null } -ModuleName $script:moduleName\n                Mock -CommandName Start-VMHostService -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Set-VMHostService for each setting that does not need to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostService `\n                    -ParameterFilter { $HostService.Key -eq $script:resourceProperties.Key -and !$Confirm } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n            It 'Should not call Start-VMHostService for each setting that does not need to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Start-VMHostService `\n                    -ParameterFilter { $HostService.Key -eq $script:resourceProperties.Key -and !$Confirm } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostService\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.Key = [string]::Empty\n            $script:resourceProperties.Policy = 'Unset'\n            $script:resourceProperties.Running = [bool]::FalseString\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $vmHostService = [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{ Key = 'TSM-SSH'}\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'}\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId'}\n                }\n                $serviceSettingsMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{Key = 'TSM-SSH'; Policy = 'On'; Running = $false }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $serviceSettingsMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostService mock with the passed server and vmhost once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostService `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with equal VMHostService settings' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n                $script:resourceProperties.Policy = 'Automatic'\n                $script:resourceProperties.Running = [bool]::TrueString\n\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $serviceSettingsMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{\n                        Key = 'TSM-SSH'\n                        Policy = 'On'\n                        Running = $true\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $serviceSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostService -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostService mock with the passed server and vCenter once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostService `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n                $script:resourceProperties.Policy = 'On'\n                $script:resourceProperties.Running = $true\n\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $vmhostServiceMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{\n                        Key = 'TSM-SSH'\n                        Policy = 'Unset'\n                        Running = $false\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $vmhostServiceMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostService mock with the passed server and vCenter once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostService `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should return $false on Test' {\n                $resource.Test() | Should be $false\n            }\n        }\n    }\n\n    Describe 'VMHostService\\Get' -Tag 'Get' {\n        AfterAll {\n            $script:resourceProperties.Key = [string]::Empty\n            $script:resourceProperties.Policy = 'Unset'\n            $script:resourceProperties.Running = [bool]::FalseString\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Key = 'TSM-SSH'\n\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; Id = 'VMHostId' }\n                }\n                $vmhostServiceMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Host.HostServiceImpl] @{\n                        Key = 'TSM-SSH'\n                        Label = 'SSH'\n                        Policy = 'Automatic'\n                        Running = $script:resourceProperties.Running\n                        Required = $script:resourceProperties.Required\n                        Ruleset = @('Rule1', 'Rule2')\n                    }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostService -MockWith $vmhostServiceMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostService mock with the passed server and vCenter once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostService `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should match the properties retrieved from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Name | Should -Be $retrievedVMHost.Name\n                $result.Server | Should -Be $viServer.Name\n                $result.Key | Should -Be $script:resourceProperties.Key\n                $result.Policy | Should -Be 'Automatic'\n                $result.Running | Should -Be $script:resourceProperties.Running.ToString()\n                $result.Label | Should -Be $script:resourceProperties.Label\n                $result.Required | Should -Be $script:resourceProperties.Required.ToString()\n                ($result.Ruleset | ConvertTo-Json) | Should -Be ($script:resourceProperties.RuleSet | ConvertTo-Json)\n            }\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostSettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostSettings'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name       = '10.23.82.112'\n    Server     = '10.23.82.112'\n    Credential = $credential\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostSettings\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.Motd = [string]::Empty\n            $script:resourceProperties.Issue = [string]::Empty\n        }\n\n        Context 'Invoking with empty settings' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vmhost once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                    -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from isue!'\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = [string]::Empty }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = [string]::Empty }\n                )\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = [string]::Empty }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = [string]::Empty }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Set-AdvancedSetting for each setting that needs to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                    -ParameterFilter { $AdvancedSetting -eq $advancedSettings[0] -and $Value -eq $script:resourceProperties.Motd -and !$Confirm } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                    -ParameterFilter { $AdvancedSetting -eq $advancedSettings[1] -and $Value -eq $script:resourceProperties.Issue -and !$Confirm } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking without Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from issue!'\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello World from motd!' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello World from issue!' }\n                )\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello World from motd!' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello World from issue!' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Set-AdvancedSetting for each setting that does not need to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                    -ParameterFilter { $AdvancedSetting -eq $advancedSettings[0] -and $Value -eq $script:resourceProperties.Motd -and !$Confirm } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                    -ParameterFilter { $AdvancedSetting -eq $advancedSettings[1] -and $Value -eq $script:resourceProperties.Issue -and !$Confirm } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostSettings\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.Motd = [string]::Empty\n            $script:resourceProperties.Issue = [string]::Empty\n            $script:resourceProperties.MotdClear = $false\n            $script:resourceProperties.IssueClear = $false\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vmhost once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                    -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with equal motd and issue Configs' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Motd = 'Hello World!'\n                $script:resourceProperties.MotdClear = $false\n                $script:resourceProperties.Issue = 'Hello World!'\n                $script:resourceProperties.IssueClear = $false\n\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello World!' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello World!' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vCenter once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                    -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Shall not call Set-AdvancedSetting mock with the passed server and vCenter' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                    -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.Motd = 'Hello World!'\n                $script:resourceProperties.MotdClear = $false\n                $script:resourceProperties.Issue = 'Hello World!'\n                $script:resourceProperties.IssueClear = $false\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello World!' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello World!' }\n                )\n\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello Brave New World!' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello Brave New World!' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vCenter once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                    -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostSettings\\Get' -Tag 'Get' {\n        AfterEach {\n            $script:resourceProperties.Server = '10.23.82.112'\n            $script:resourceProperties.Name = '10.23.82.112'\n            $script:resourceProperties.Motd = 'Hello World!'\n            $script:resourceProperties.MotdClear = $false\n            $script:resourceProperties.Issue = 'Hello World!'\n            $script:resourceProperties.IssueClear = $false\n        }\n\n        BeforeAll {\n            # Arrange\n            $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n            $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId'; Name = '10.23.82.112' }\n            $advancedSettings = @(\n                [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello Brave New World!' }\n                [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello Brave New World!' }\n            )\n\n            $viServerMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n            }\n            $vmHostMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId'; Name = '10.23.82.112' }\n            }\n            $advancedSettingsMock = {\n                return @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.issue'; Value = 'Hello World!' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Config.Etc.motd'; Value = 'Hello World!' }\n                )\n            }\n\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n        }\n\n        # Arrange\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Connect-VIServer `\n                -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should call Get-VMHost mock with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Get-VMHost `\n                -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should call Get-AdvancedSetting mock with the passed server and vCenter once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Get-AdvancedSetting `\n                -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost } `\n                -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Name | Should -Be $vmhost.Name\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Motd | Should -Be 'Hello World!'\n            $result.Issue | Should -Be 'Hello World!'\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostStorage/VMHostStorage.Mocks.Data.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:Constants = @{\n    VIServer = '10.23.112.235'\n    VIServerUser = 'Admin1'\n    VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force\n    VMHostName = 'DscVMHost'\n    SoftwareIScsiEnabled = $true\n}\n\n$script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword)\n\n$script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:Constants.VIServer\n    User = $script:Constants.VIServerUser\n}\n\n$script:VMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n    Name = $script:Constants.VMHostName\n}\n\n$script:VMHostStorage = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.VMHostStorageInfoImpl] @{\n    VMHost = $script:VMHost\n    SoftwareIScsiEnabled = $script:Constants.SoftwareIScsiEnabled\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostStorage/VMHostStorage.Mocks.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-VMHostStorageDscResourceProperties {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostStorageDscResourceProperties = @{\n        Server = $script:Constants.VIServer\n        Credential = $script:Credential\n        Name = $script:Constants.VMHostName\n    }\n\n    $VMHostStorageDscResourceProperties\n}\n\nfunction New-MocksForVMHostStorageDscResource {\n    $viServerMock = $script:VIServer\n    $vmHostMock = $script:VMHost\n    $vmHostStorageMock = $script:VMHostStorage\n\n    Mock -CommandName Connect-VIServer -MockWith { return $viServerMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Get-VMHost -MockWith { return $vmHostMock }.GetNewClosure() -Verifiable\n    Mock -CommandName Disconnect-VIServer -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $getVMHostStorageMockParams = @{\n        CommandName = 'Get-VMHostStorage'\n        MockWith = { return $vmHostStorageMock }.GetNewClosure()\n        ParameterFilter = {\n            $Server -eq $script:VIServer -and\n            $VMHost -eq $script:VMHost\n        }\n        Verifiable = $true\n    }\n    Mock @getVMHostStorageMockParams\n}\n\nfunction New-MocksWhenErrorOccursWhileConfiguringTheVMHostStorage {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostStorageDscResourceProperties = New-VMHostStorageDscResourceProperties\n    $VMHostStorageDscResourceProperties.Enabled = $script:Constants.SoftwareIScsiEnabled\n\n    Mock -CommandName 'Set-VMHostStorage' -MockWith { throw }.GetNewClosure() -Verifiable\n\n    $VMHostStorageDscResourceProperties\n}\n\nfunction New-MocksWhenNoErrorOccursWhileConfiguringTheVMHostStorage {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostStorageDscResourceProperties = New-VMHostStorageDscResourceProperties\n    $VMHostStorageDscResourceProperties.Enabled = $script:Constants.SoftwareIScsiEnabled\n\n    Mock -CommandName 'Set-VMHostStorage' -MockWith { return $null }.GetNewClosure() -Verifiable\n\n    $VMHostStorageDscResourceProperties\n}\n\nfunction New-MocksWhenSoftwareIscsiSupportShouldBeDisabled {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostStorageDscResourceProperties = New-VMHostStorageDscResourceProperties\n    $VMHostStorageDscResourceProperties.Enabled = !$script:Constants.SoftwareIScsiEnabled\n\n    $VMHostStorageDscResourceProperties\n}\n\nfunction New-MocksWhenSoftwareIscsiSupportShouldStayEnabled {\n    [OutputType([System.Collections.Hashtable])]\n\n    $VMHostStorageDscResourceProperties = New-VMHostStorageDscResourceProperties\n    $VMHostStorageDscResourceProperties.Enabled = $script:Constants.SoftwareIScsiEnabled\n\n    $VMHostStorageDscResourceProperties\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostStorage/VMHostStorage.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:PSModulePath = $env:PSModulePath\n$script:ModuleName = 'VMware.vSphereDSC'\n\n$script:UnitTestsPath = Join-Path (Join-Path (Get-Module -Name $script:ModuleName -ListAvailable).ModuleBase 'Tests') 'Unit'\n. (Join-Path -Path (Join-Path -Path $script:UnitTestsPath -ChildPath 'TestHelpers') -ChildPath 'TestUtils.ps1')\n\nImport-VMwareVSphereDSCModule\n\n# Imports the mocked 'VMware.VimAutomation.Core' module in the current session before all tests are executed.\nInvoke-TestSetup\n\ntry {\n    InModuleScope -ModuleName $script:ModuleName {\n        $script:DscResourceName = 'VMHostStorage'\n\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'VMHostStorage.Mocks.Data.ps1')\n        . (Join-Path -Path $PSScriptRoot -ChildPath 'VMHostStorage.Mocks.ps1')\n\n        Describe \"$script:DscResourceName\\Set\" -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostStorageDscResource\n            }\n\n            Context 'When error occurs while configuring the VMHost storage' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenErrorOccursWhileConfiguringTheVMHostStorage\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceSetMethodError = { $dscResource.Set() } | Should -Throw -PassThru\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while configuring the VMHost storage' {\n                    # Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    $exceptionMessage = \"Could not configure VMHost storage for VMHost {0}. For more information: ScriptHalted\" -f @(\n                        $script:Constants.VMHostName\n                    )\n                    $dscResourceSetMethodError.Exception.Message | Should -Be $exceptionMessage\n                }\n            }\n\n            Context 'When no error occurs while configuring the VMHost storage' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenNoErrorOccursWhileConfiguringTheVMHostStorage\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResource.Set()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Set-VMHostStorage mock with the VMHost storage and SoftwareIScsiEnabled once' {\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Set-VMHostStorage'\n                        ParameterFilter = {\n                            $VMHostStorage -eq $script:VMHostStorage -and\n                            $SoftwareIScsiEnabled -eq $script:Constants.SoftwareIScsiEnabled -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'Context'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Test\" -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostStorageDscResource\n            }\n\n            Context 'When software iSCSI support should be disabled' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenSoftwareIscsiSupportShouldBeDisabled\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when software iSCSI support should be disabled' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeFalse\n                }\n            }\n\n            Context 'When software iSCSI support should stay enabled' {\n                BeforeAll {\n                    # Arrange\n                    $dscResourceProperties = New-MocksWhenSoftwareIscsiSupportShouldStayEnabled\n                    $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                    # Act\n                    $dscResourceTestMethodResult = $dscResource.Test()\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when software iSCSI support should stay enabled' {\n                    # Assert\n                    $dscResourceTestMethodResult | Should -BeTrue\n                }\n            }\n        }\n\n        Describe \"$script:DscResourceName\\Get\" -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForVMHostStorageDscResource\n\n                $dscResourceProperties = New-VMHostStorageDscResourceProperties\n                $dscResource = New-Object -TypeName $script:DscResourceName -Property $dscResourceProperties\n\n                # Act\n                $dscResourceGetMethodResult = $dscResource.Get()\n            }\n\n            It 'Should invoke all defined mocks with the correct parameters' {\n                # Assert\n                Assert-VerifiableMock\n            }\n\n            It 'Should retrieve and return the correct values from the server' {\n                # Assert\n                $dscResourceGetMethodResult.Server | Should -Be $dscResourceProperties.Server\n                $dscResourceGetMethodResult.Name | Should -Be $dscResourceProperties.Name\n                $dscResourceGetMethodResult.Enabled | Should -Be $script:VMHostStorage.SoftwareIScsiEnabled\n            }\n        }\n    }\n}\nfinally {\n    # Removes the mocked 'VMware.VimAutomation.Core' module from the current session after all tests have executed.\n    Invoke-TestCleanup -ModulePath $script:PSModulePath\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostSyslog.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostSyslog'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n    LogHost = 'udp://vli.local.lab:514'\n    CheckSslCerts = $true\n    DefaultRotate = 10\n    DefaultSize = 100\n    DefaultTimeout = 180\n    DropLogRotate = 10\n    DropLogSize = 100\n    LogDir = '/scratch/log'\n    LogDirUnique = $false\n    QueueDropMark = 90\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostSyslog\\Set' -Tag 'Set' {\n        Context 'Invoking with syslog not configured' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n\n                    $syslogConfig = [VMware.Vim.SyslogConfig]::new()\n\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Get-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should call Set-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with default syslog settings' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $syslogConfig = [VMware.Vim.SyslogConfig] @{\n                    LogHost = $script:resourceProperties.LogHost\n                    CheckSslCerts = $script:resourceProperties.CheckSslCerts\n                    DefaultRotate = $script:resourceProperties.DefaultRotate\n                    DefaultSize = $script:resourceProperties.DefaultSize\n                    DefaultTimeout = $script:resourceProperties.DefaultTimeout\n                    DropLogRotate = $script:resourceProperties.DropLogRotate\n                    DropLogSize = $script:resourceProperties.DropLogSize\n                    LogDir = $script:resourceProperties.LogDir\n                    LogDirUnique = $script:resourceProperties.LogDirUnique\n                    QueueDropMark = $script:resourceProperties.QueueDropMark\n                }\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Get-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should call Set-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id -and $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with new syslog settings' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $syslogConfig = [VMware.Vim.SyslogConfig] @{\n                    LogHost = $script:resourceProperties.LogHost\n                    CheckSslCerts = -not $script:resourceProperties.CheckSslCerts\n                    DefaultRotate = $script:resourceProperties.DefaultRotate + 1\n                    DefaultSize = $script:resourceProperties.DefaultSize + 1\n                    DefaultTimeout = $script:resourceProperties.DefaultTimeout + 1\n                    DropLogRotate = $script:resourceProperties.DropLogRotate + 1\n                    DropLogSize = $script:resourceProperties.DropLogSize + 1\n                    LogDir = $script:resourceProperties.LogDir\n                    LogDirUnique = -not $script:resourceProperties.LogDirUnique\n                    QueueDropMark = $script:resourceProperties.QueueDropMark + 1\n                }\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Get-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n\n            It 'Should call Set-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id -and $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostSyslog\\Test' -Tag 'Test' {\n        Context 'Invoking with syslog not configured' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n\n                    $syslogConfig = [VMware.Vim.SyslogConfig]::new()\n\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Set-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with default syslog settings' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $syslogConfig = [VMware.Vim.SyslogConfig] @{\n                    LogHost = $script:resourceProperties.LogHost\n                    CheckSslCerts = $script:resourceProperties.CheckSslCerts\n                    DefaultRotate = $script:resourceProperties.DefaultRotate\n                    DefaultSize = $script:resourceProperties.DefaultSize\n                    DefaultTimeout = $script:resourceProperties.DefaultTimeout\n                    DropLogRotate = $script:resourceProperties.DropLogRotate\n                    DropLogSize = $script:resourceProperties.DropLogSize\n                    LogDir = $script:resourceProperties.LogDir\n                    LogDirUnique = $script:resourceProperties.LogDirUnique\n                    QueueDropMark = $script:resourceProperties.QueueDropMark\n                }\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Set-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id -and $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with new syslog settings' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                $syslogConfig = [VMware.Vim.SyslogConfig] @{\n                    LogHost = $script:resourceProperties.LogHost\n                    CheckSslCerts = -not $script:resourceProperties.CheckSslCerts\n                    DefaultRotate = $script:resourceProperties.DefaultRotate + 1\n                    DefaultSize = $script:resourceProperties.DefaultSize + 1\n                    DefaultTimeout = $script:resourceProperties.DefaultTimeout + 1\n                    DropLogRotate = $script:resourceProperties.DropLogRotate + 1\n                    DropLogSize = $script:resourceProperties.DropLogSize + 1\n                    LogDir = $script:resourceProperties.LogDir\n                    LogDirUnique = -not $script:resourceProperties.LogDirUnique\n                    QueueDropMark = $script:resourceProperties.QueueDropMark + 1\n                }\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Set-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id -and $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostSyslog\\Get' -Tag 'Get' {\n        Context 'Invoking with syslog not configured' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; Id = 'VMHostId' }\n                $syslogConfig = [VMware.Vim.SyslogConfig] @{\n                    LogHost = $script:resourceProperties.LogHost\n                    CheckSslCerts = $script:resourceProperties.CheckSslCerts\n                    DefaultRotate = $script:resourceProperties.DefaultRotate\n                    DefaultSize = $script:resourceProperties.DefaultSize\n                    DefaultTimeout = $script:resourceProperties.DefaultTimeout\n                    DropLogRotate = $script:resourceProperties.DropLogRotate\n                    DropLogSize = $script:resourceProperties.DropLogSize\n                    LogDir = $script:resourceProperties.LogDir\n                    LogDirUnique = $script:resourceProperties.LogDirUnique\n                    QueueDropMark = $script:resourceProperties.QueueDropMark\n                }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfig }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return $syslogConfig\n                }\n                $setSyslogConfigMock = {\n                    return $true\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n                Mock -CommandName Set-VMHostSyslogConfig -MockWith $setSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                    -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                    -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-EsxCli mock once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-EsxCli `\n                    -ParameterFilter { $Server -eq $viServer -and $VMHost -eq $retrievedVMHost -and $V2 } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHostSyslogConfig mock once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHostSyslogConfig `\n                    -ParameterFilter { $EsxCli.VMHost.Id -eq $retrievedVMHost.Id } `\n                    -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should not call Set-VMHostSyslogConfig mock' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-VMHostSyslogConfig `\n                    -ParameterFilter { $VMHostSyslogConfig.LogHost -eq $script:resourceProperties.LogHost  } `\n                    -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n\n        Context 'Invoking with default syslog settings' {\n            BeforeAll {\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $retrievedVMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Name = '10.23.82.112'; Id = 'VMHostId' }\n                }\n                $esxCliMock = {\n                    $esxcli = New-Object PSObject\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'VMHost' -Value (New-Object psobject)\n                    $esxcli.VMHost | Add-Member -MemberType NoteProperty -Name 'Id' -Value 'VMHostId'\n                    $esxcli | Add-Member -MemberType NoteProperty -Name 'system' -Value (New-Object PSObject)\n                    $esxcli.system | Add-Member -MemberType NoteProperty -Name 'syslog' -Value (New-Object PSObject)\n                    $esxcli.system.syslog | Add-Member -MemberType NoteProperty -Name 'config' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'get' -Value (New-Object PSObject)\n                    $esxcli.system.syslog.config | Add-Member -MemberType NoteProperty -Name 'set' -Value (New-Object PSObject)\n                    $syslogConfigOut = [VMware.Vim.SyslogConfigOut] @{\n                        RemoteHost = 'udp://vli.local.lab:514'\n                        CheckSslCerts = $true\n                        DefaultRotate = 10\n                        DefaultSize = 100\n                        DefaultTimeout = 180\n                        DropLogRotate = 10\n                        DropLogSize = 100\n                        LogDir = '/scratch/log'\n                        LogDirUnique = $false\n                        QueueDropMark = 90\n                    }\n                    $esxcli.system.syslog.config.get | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $syslogConfigOut }\n                    $esxcli.system.syslog.config.set | Add-Member -MemberType ScriptMethod -Name 'Invoke' -Value { $true }\n\n                    return $esxcli\n                }\n                $getSyslogConfigMock = {\n                    return ([VMware.Vim.SyslogConfigOut] @{\n                            RemoteHost = 'udp://vli.local.lab:514'\n                            CheckSslCerts = $true\n                            DefaultRotate = 10\n                            DefaultSize = 100\n                            DefaultTimeout = 180\n                            DropLogRotate = 10\n                            DropLogSize = 100\n                            LogDir = '/scratch/log'\n                            LogDirUnique = $false\n                            QueueDropMark = 90\n                        })\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-EsxCli -MockWith $esxCliMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHostSyslogConfig -MockWith $getSyslogConfigMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return the resource with the properties retrieved from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Name | Should -Be $script:resourceProperties.Name\n                $result.Server | Should -Be $script:resourceProperties.Server\n                # The Syslog object for the Unit Tests should be modified to reflect the values retrieved from the Server.\n\n                # $result.LogHost | Should -Be $script:resourceProperties.LogHost\n                # $result.CheckSslCerts | Should -Be $script:resourceProperties.CheckSslCerts\n                # $result.DefaultRotate | Should -Be $script:resourceProperties.DefaultRotate\n                # $result.DefaultSize | Should -Be $script:resourceProperties.DefaultSize\n                # $result.DefaultTimeout | Should -Be $script:resourceProperties.DefaultTimeout\n                # $result.DropLogRotate | Should -Be $script:resourceProperties.DropLogRotate\n                # $result.DropLogSize | Should -Be $script:resourceProperties.DropLogSize\n                # $result.LogDir | Should -Be $script:resourceProperties.LogDir\n                # $result.LogDirUnique | Should -Be $script:resourceProperties.LogDirUnique\n                # $result.QueueDropMark | Should -Be $script:resourceProperties.QueueDropMark\n            }\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostTpsSettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'VMHostTpsSettings'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostTpsSettings\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.ShareScanTime = $null\n            $script:resourceProperties.ShareScanGHz = $null\n            $script:resourceProperties.ShareRateMax = $null\n            $script:resourceProperties.ShareForceSalting = $null\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vmhost once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                                  -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost -and $Name -eq 'Mem.Sh*' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.ShareScanTime = 21\n                $script:resourceProperties.ShareScanGHz = 31\n                $script:resourceProperties.ShareRateMax = 41\n                $script:resourceProperties.ShareForceSalting = 51\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                )\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Set-AdvancedSetting for each setting that needs to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[0] -and $Value -eq $script:resourceProperties.ShareScanTime -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[1] -and $Value -eq $script:resourceProperties.ShareScanGHz -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[2] -and $Value -eq $script:resourceProperties.ShareRateMax -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[3] -and $Value -eq $script:resourceProperties.ShareForceSalting -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking without Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.ShareScanTime = 20\n                $script:resourceProperties.ShareScanGHz = 30\n                $script:resourceProperties.ShareRateMax = 40\n                $script:resourceProperties.ShareForceSalting = 50\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                )\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Set-AdvancedSetting for each setting that does not need to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[0] -and $Value -eq $script:resourceProperties.ShareScanTime -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[1] -and $Value -eq $script:resourceProperties.ShareScanGHz -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[2] -and $Value -eq $script:resourceProperties.ShareRateMax -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[3] -and $Value -eq $script:resourceProperties.ShareForceSalting -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n    }\n\n    Describe 'VMHostTpsSettings\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.ShareScanTime = $null\n            $script:resourceProperties.ShareScanGHz = $null\n            $script:resourceProperties.ShareRateMax = $null\n            $script:resourceProperties.ShareForceSalting = $null\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vmhost once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                                  -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost -and $Name -eq 'Mem.Sh*' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.ShareScanTime = 21\n                $script:resourceProperties.ShareScanGHz = 31\n                $script:resourceProperties.ShareRateMax = 41\n                $script:resourceProperties.ShareForceSalting = 51\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (Advanced Settings need to be updated.)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking without Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.ShareScanTime = 20\n                $script:resourceProperties.ShareScanGHz = 30\n                $script:resourceProperties.ShareRateMax = 40\n                $script:resourceProperties.ShareForceSalting = 50\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (Advanced Settings do not need to be updated.)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'VMHostTpsSettings\\Get' -Tag 'Get' {\n        AfterEach {\n            $script:resourceProperties.ShareScanTime = $null\n            $script:resourceProperties.ShareScanGHz = $null\n            $script:resourceProperties.ShareRateMax = $null\n            $script:resourceProperties.ShareForceSalting = $null\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $vmhost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId'; Name = '10.23.82.112' }\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                )\n\n                $viServerMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $vmHostMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ Id = 'VMHostId'; Name = '10.23.82.112' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanTime'; Value = 20 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareScanGHz'; Value = 30 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareRateMax'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'Mem.ShareForceSalting'; Value = 50 }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n                Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-VMHost mock with the passed server and name once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-VMHost `\n                                  -ParameterFilter { $Server -eq $viServer -and $Name -eq $script:resourceProperties.Name } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vmhost once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                                  -ParameterFilter { $Server -eq $viServer -and $Entity -eq $vmhost -and $Name -eq 'Mem.Sh*' } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should return the resource with the properties passed from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Name | Should -Be $vmhost.Name\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.ShareScanTime | Should -Be $advancedSettings[0].Value\n                $result.ShareScanGHz | Should -Be $advancedSettings[1].Value\n                $result.ShareRateMax | Should -Be $advancedSettings[2].Value\n                $result.ShareForceSalting | Should -Be $advancedSettings[3].Value\n            }\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostVss/VMHostVss.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\nfunction Invoke-TestSetup {\n    $script:modulePath = $env:PSModulePath\n    $script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n    $script:moduleName = 'VMware.vSphereDSC'\n    $script:resourceName = 'VMHostVss'\n\n    $user = 'user'\n    $password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:Constants = @{\n    VIServerUser = 'user'\n    NetworkSystemMoRefType = 'HostNetworkSystem'\n    NetworkSystemMoRefValue = 'networkSystem'\n}\n$script:resourceProperties = @{\n    Name = '10.23.82.112'\n    Server = '10.23.82.112'\n    Credential = $credential\n    Ensure = 'Present'\n    VssName = 'DSCTest'\n    Mtu = 1500\n    Key = 'VSS'\n    NumPortsAvailable = 1\n    Pnic = @('vmnic1', 'vmnic2')\n    Portgroup = @('Portgroup1', 'Portgroup2')\n}\n$script:resourcePropertiesAbsent = $script:resourceProperties.Clone()\n$script:resourcePropertiesAbsent.Ensure = 'Absent'\n$script:netObjectAdd = 'add'\n$script:netObjectEdit = 'edit'\n$script:netObjectRemove = 'remove'\n$script:viServerCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n            Name = '$($script:resourceProperties.Server)'\n            User = '$($script:Constants.VIServerUser)'\n    }\n'@\n$script:vmHostCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n            Name = '$($script:resourceProperties.Name)'\n            ExtensionData = [VMware.Vim.HostSystem] @{\n                ConfigManager = [VMware.Vim.HostConfigManager] @{\n                    NetworkSystem = [VMware.Vim.ManagedObjectReference] @{\n                        Type = '$($script:Constants.NetworkSystemMoRefType)'\n                        Value = '$($script:Constants.NetworkSystemMoRefValue)'\n                    }\n                }\n            }\n        }\n'@\n$script:networkSystemNoVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @()\n                }\n            }\n        )\n'@\n$script:networkSystemDiffVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Key = '$($script:resourceProperties.Key)'\n                            Mtu = $($script:resourceProperties.Mtu + 1)\n                            Name = '$($script:resourceProperties.VssName)'\n                            NumPortsAvailable = $($script:resourceProperties.NumPortsAvailable)\n                            Pnic = $(($script:resourceProperties.Pnic | %{\"'$_'\"}) -join ',')\n                            PortGroup = $(($script:resourceProperties.Portgroup | %{\"'$_'\"}) -join ',')\n                        }\n                    )\n                }\n            }\n        )\n'@\n$script:networkSystemSameVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Key = '$($script:resourceProperties.Key)'\n                            Mtu = $($script:resourceProperties.Mtu)\n                            Name = '$($script:resourceProperties.VssName)'\n                            NumPortsAvailable = $($script:resourceProperties.NumPortsAvailable)\n                            Pnic = $(($script:resourceProperties.Pnic | %{\"'$_'\"}) -join ',')\n                            PortGroup = $(($script:resourceProperties.Portgroup | %{\"'$_'\"}) -join ',')\n                        }\n                    )\n                }\n            }\n        )\n'@\n$script:vssConfigAddVssCode = @'\n        return [VMware.Vim.HostVirtualSwitchConfig] @{\n            Name = '$($script:resourceProperties.VssName)'\n            ChangeOperation = '$($script:netObjectAdd.Operation)'\n            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                Mtu = $($script:resourceProperties.Mtu)\n            }\n        }\n'@\n$script:vssConfigEditVssCode = @'\n        return [VMware.Vim.HostVirtualSwitchConfig] @{\n            Name = '$($script:resourceProperties.VssName)'\n            ChangeOperation = '$($script:netObjectEdit)'\n            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                Mtu = $($script:resourceProperties.Mtu)\n            }\n        }\n'@\n$script:vssConfigRemoveVssCode = @'\n        return [VMware.Vim.HostVirtualSwitchConfig] @{\n            Name = '$($script:resourceProperties.VssName)'\n            ChangeOperation = '$($script:netObjectRemove)'\n            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                Mtu = $($script:resourceProperties.Mtu)\n            }\n        }\n'@\n$script:updateNetworkCode = @'\n        return [VMware.Vim.HostNetworkConfigResult] @{\n            ConsoleVnicDevice = @()\n            VnicDevice = @()\n        }\n'@\n\n$env:PSModulePath = $script:mockModuleLocation\n$vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\nif ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n    throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n}\n\nImport-Module -Name VMware.VimAutomation.Core\n\n$script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n    Name = $script:resourceProperties.Server\n    User = $script:Constants.VIServerUser\n}\n$script:networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{\n    Type = $script:Constants.NetworkSystemMoRefType\n    Value = $script:Constants.NetworkSystemMoRefValue\n}\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostVss\\Set'  -Tag 'Set' {\n        Context 'Present and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id twice' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Update-Network once with VssConfig and operation Add' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssConfig -and $VssConfig.Operation -eq $script:netObjectAdd }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Present and VSS does exist with different properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Update-Network once with VssConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssConfig -and $VssConfig.Operation -eq $script:netObjectEdit }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Absent and VSS exists' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call Update-Network once with VssConfig and operation Remove' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssConfig -and $VssConfig.Operation -eq $script:netObjectRemove }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n    }\n\n    Describe 'VMHostVss\\Test' -Tag 'Test' {\n        Context 'Present and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $false (The desired VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n        }\n    }\n\n    Context 'Present and VSS does exist with different properties' {\n        BeforeAll {\n            $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n            $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n            $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssCode))\n        }\n\n        # Arrange\n        Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should return $false (The desired VSS is not configured correctly)' {\n            # Act\n            $result = $resource.Test()\n\n            # Assert\n            $result | Should -Be $false\n    }\n}\n\nContext 'Present and VSS does exist with the same properties' {\n    BeforeAll {\n        $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n        $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n        $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssCode))\n    }\n\n    # Arrange\n    Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n    Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n    Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n    $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n    It 'Should return $true (The desired VSS is configured correctly)' {\n        # Act\n        $result = $resource.Test()\n\n        # Assert\n        $result | Should -Be $true\n}\n}\n\nContext 'Absent and VSS does not exist' {\n    BeforeAll {\n        $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n        $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n        $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n    }\n\n    # Arrange\n    Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n    Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n    Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n    $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n    It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n        # Act\n        $resource.Test()\n\n        # Assert\n        $assertMockCalledParams = @{\n            CommandName = 'Connect-VIServer'\n            ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n            ModuleName = $script:moduleName\n            Exactly = $true\n            Times = 1\n            Scope = 'It'\n        }\n        Assert-MockCalled @assertMockCalledParams\n    }\n\n    It 'Should call Get-VMHost with the passed server and name once' {\n        # Act\n        $resource.Get()\n\n        # Assert\n        $assertMockCalledParams = @{\n            CommandName = 'Get-VMHost'\n            ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n            ModuleName = $script:moduleName\n            Exactly = $true\n            Times = 1\n            Scope = 'It'\n        }\n        Assert-MockCalled @assertMockCalledParams\n    }\n\n    It 'Should call Get-View with the passed server and id once' {\n        # Act\n        $resource.Get()\n\n        # Assert\n        $assertMockCalledParams = @{\n            CommandName = 'Get-View'\n            ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n            ModuleName = $script:moduleName\n            Exactly = $true\n            Times = 1\n            Scope = 'It'\n        }\n        Assert-MockCalled @assertMockCalledParams\n    }\n\n    It 'Should return $true (The VSS does not exist)' {\n        # Act\n        $result = $resource.Test()\n\n        # Assert\n        $result | Should -Be $true\n}\n}\n\nContext 'Absent and VSS does exist with different properties' {\n    BeforeAll {\n        $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n        $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n        $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssCode))\n    }\n\n    # Arrange\n    Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n    Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n    Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n    $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n    It 'Should return $false (The VSS exists)' {\n        # Act\n        $result = $resource.Test()\n\n        # Assert\n        $result | Should -Be $false\n}\n}\n\nContext 'Absent and VSS does exist with the same properties' {\n    BeforeAll {\n        $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n        $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n        $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssCode))\n    }\n\n    # Arrange\n    Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n    Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n    Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n    $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n    It 'Should return $false (The VSS exists)' {\n        # Act\n        $result = $resource.Test()\n\n        # Assert\n        $result | Should -Be $false\n}\n}\n}\n\nDescribe 'VMHostVss\\Get' -Tag 'Get' {\n    BeforeAll {\n        $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n        $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n        $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssCode))\n    }\n\n    # Arrange\n    Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n    Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n    Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n    $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n    It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n        # Act\n        $resource.Get()\n\n        # Assert\n        $assertMockCalledParams = @{\n            CommandName = 'Connect-VIServer'\n            ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n            ModuleName = $script:moduleName\n            Exactly = $true\n            Times = 1\n            Scope = 'It'\n        }\n        Assert-MockCalled @assertMockCalledParams\n    }\n\n    It 'Should call Get-VMHost with the passed server and name once' {\n        # Act\n        $resource.Get()\n\n        # Assert\n        $assertMockCalledParams = @{\n            CommandName = 'Get-VMHost'\n            ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n            ModuleName = $script:moduleName\n            Exactly = $true\n            Times = 1\n            Scope = 'It'\n        }\n        Assert-MockCalled @assertMockCalledParams\n    }\n\n    It 'Should call Get-View with the passed server and id once' {\n        # Act\n        $resource.Get()\n\n        # Assert\n        $assertMockCalledParams = @{\n            CommandName = 'Get-View'\n            ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n            ModuleName = $script:moduleName\n            Exactly = $true\n            Times = 1\n            Scope = 'It'\n        }\n        Assert-MockCalled @assertMockCalledParams\n    }\n\n    It 'Should match the properties retrieved from the server' {\n        # Act\n        $result = $resource.Get()\n\n        # Assert\n        $result.Server | Should -Be $script:resourceProperties.Server\n    $result.Name | Should -Be $script:resourceProperties.Name\n$result.Ensure | Should -Be $script:resourceProperties.Ensure\n$result.VssName | Should -Be $script:resourceProperties.VssName\n$result.Mtu | Should -Be $script:resourceProperties.Mtu\n$result.Key | Should -Be $script:resourceProperties.Key\n$result.NumPortsAvailable | Should -Be $script:resourceProperties.NumPortsAvailable\nCompare-Object -ReferenceObject ($result.Pnic | ConvertTo-Json) -DifferenceObject ($script:resourceProperties.Pnic | ConvertTo-Json) | Should -Be $null\nCompare-Object -ReferenceObject ($result.PortGroup | ConvertTo-Json) -DifferenceObject ($script:resourceProperties.Portgroup | ConvertTo-Json) | Should -Be $null\n}\n}\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostVss/VMHostVssBridge.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\nfunction Invoke-TestSetup {\n    $script:modulePath = $env:PSModulePath\n    $script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n    $script:moduleName = 'VMware.vSphereDSC'\n    $script:resourceName = 'VMHostVssBridge'\n\n    $user = 'user'\n    $password = ConvertTo-SecureString -String 'password' -AsPlainText -Force\n    $credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n    $script:Constants = @{\n        VIServerUser = 'user'\n        NetworkSystemMoRefType = 'HostNetworkSystem'\n        NetworkSystemMoRefValue = 'networkSystem'\n    }\n    $script:resourceProperties = @{\n        Name = '10.23.82.112'\n        Server = '10.23.82.112'\n        Credential = $credential\n        Ensure = 'Present'\n        VssName = 'DSCTest'\n        NicDevice = @()\n        BeaconInterval = 0\n        LinkDiscoveryProtocolProtocol = 'CDP'\n        LinkDiscoveryProtocolOperation = 'Listen'\n    }\n    $script:resourcePropertiesAbsent = $script:resourceProperties.Clone()\n    $script:resourcePropertiesAbsent.Ensure = 'Absent'\n    $script:NicDeviceAlt = \"'vmnic1', 'vmnic2'\"\n    $script:BeaconIntervalAlt = 1\n    $script:LinkDiscoveryProtocolProtocolAlt = \"CDP\"\n    $script:LinkDiscoveryProtocolOperationAlt = \"Both\"\n    $script:LinkDiscoveryProtocolProtocolUnset = \"Unset\"\n    $script:LinkDiscoveryProtocolOperationUnset = \"Unset\"\n    $script:netObjectEdit = 'edit'\n    $script:viServerCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n            Name = '$($script:resourceProperties.Server)'\n            User = '$($script:Constants.VIServerUser)'\n        }\n'@\n    $script:vmHostCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n            Name = '$($script:resourceProperties.Name)'\n            ExtensionData = [VMware.Vim.HostSystem] @{\n                ConfigManager = [VMware.Vim.HostConfigManager] @{\n                    NetworkSystem = [VMware.Vim.ManagedObjectReference] @{\n                        Type = '$($script:Constants.NetworkSystemMoRefType)'\n                        Value = '$($script:Constants.NetworkSystemMoRefValue)'\n                    }\n                }\n            }\n        }\n'@\n    $script:networkSystemNoVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @()\n                }\n            }\n        )\n'@\n    $script:networkSystemNoVssBridgeCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Bridge = @{}\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:networkSystemSameVssBridgeCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Bridge = [VMware.Vim.HostVirtualSwitchBondBridge] @{\n                                    NicDevice = @($($script:resourceProperties.NicDevice))\n                                    Beacon = [VMware.Vim.HostVirtualSwitchBeaconConfig] @{\n                                        Interval = '$($script:resourceProperties.BeaconInterval)'\n                                    }\n                                    LinkDiscoveryProtocolConfig = [VMware.Vim.LinkDiscoveryProtocolConfig] @{\n                                        Operation = '$($script:resourceProperties.LinkDiscoveryProtocolOperation)'\n                                        Protocol = '$($script:resourceProperties.LinkDiscoveryProtocolProtocol)'\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:networkSystemUnsetVssBridgeCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Bridge = [VMware.Vim.HostVirtualSwitchBondBridge] @{\n                                    NicDevice = @($($script:resourceProperties.NicDevice))\n                                    Beacon = [VMware.Vim.HostVirtualSwitchBeaconConfig] @{\n                                        Interval = '$($script:resourceProperties.BeaconInterval)'\n                                    }\n                                    LinkDiscoveryProtocolConfig = [VMware.Vim.LinkDiscoveryProtocolConfig] @{\n                                        Operation = '$($script:resourceProperties.LinkDiscoveryProtocolOperationUnset)'\n                                        Protocol = '$($script:resourceProperties.LinkDiscoveryProtocolProtocolUnset)'\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:networkSystemDiffVssBridgeCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Bridge = [VMware.Vim.HostVirtualSwitchBondBridge] @{\n                                    NicDevice = @($($script:NicDeviceAlt))\n                                    Beacon = [VMware.Vim.HostVirtualSwitchBeaconConfig] @{\n                                        Interval = '$($script:BeaconIntervalAlt)'\n                                    }\n                                    LinkDiscoveryProtocolConfig = [VMware.Vim.LinkDiscoveryProtocolConfig] @{\n                                        Operation = '$($script:LinkDiscoveryProtocolOperationAlt)'\n                                        Protocol = '$($script:LinkDiscoveryProtocolProtocolAlt)'\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:updateNetworkCode = @'\n        return [VMware.Vim.HostNetworkConfigResult] @{\n            ConsoleVnicDevice = @()\n            VnicDevice = @()\n        }\n'@\n\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n\n    $script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = $script:resourceProperties.Server\n        User = $script:Constants.VIServerUser\n    }\n    $script:networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:Constants.NetworkSystemMoRefType\n        Value = $script:Constants.NetworkSystemMoRefValue\n    }\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostVssBridge\\Set'  -Tag 'Set' {\n        Context 'Present and no Bridge settings' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssBridgeCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id twice' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should not call Update-Network' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $VssBridgeConfig -ne $null -and $VssBridgeConfig.Operation -eq $script:netObjectEdit.Operation }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Present and same Bridge settings' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssBridgeCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Update-Network' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssBridgeConfig -and $VssBridgeConfig.Operation -eq $script:netObjectEdit }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Present and different Bridge settings' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssBridgeCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Update-Network once with VssConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssBridgeConfig -and $VssBridgeConfig.Operation -eq $script:netObjectEdit }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Absent and Bridge settings' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssBridgeCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call Update-Network once with VssBridgeConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssBridgeConfig -and $VssBridgeConfig.Operation -eq $script:netObjectEdit }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n    }\n\n    Describe 'VMHostVssBridge\\Test' -Tag 'Test' {\n        Context 'Present and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $false (The desired VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and Bridge with the same properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssBridgeCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The desired VSS is configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Present, VSS exists and Bridge with different properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssBridgeCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired VSS is not configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Absent and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $true (The VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent, VSS exists and Bridge with the default properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemUnsetVssBridgeCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $false (The VSS exists and Bridge has the default properties)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Absent, VSS exists and Bridge with non-default properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssBridgeCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $false (The VSS exists, and Bridge does not have the default properties)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n    }\n\n    Describe 'VMHostVssBridge\\Get' -Tag 'Get' {\n        BeforeAll {\n            $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n            $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n            $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssBridgeCode))\n        }\n\n        # Arrange\n        Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Connect-VIServer'\n                ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-VMHost with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-VMHost'\n                ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-View with the passed server and id once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-View'\n                ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Name | Should -Be $script:resourceProperties.Name\n            $result.Ensure | Should -Be $script:resourceProperties.Ensure\n            $result.VssName | Should -Be $script:resourceProperties.VssName\n            $result.NicDevice | Should -Be $script:resourceProperties.NicDevice\n            $result.BeaconInterval | Should -Be $script:resourceProperties.BeaconInterval\n            $result.LinkDiscoveryProtocolProtocol | Should -Be $script:resourceProperties.LinkDiscoveryProtocolProtocol\n            $result.LinkDiscoveryProtocolOperation | Should -Be $script:resourceProperties.LinkDiscoveryProtocolOperation\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostVss/VMHostVssSecurity.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\nfunction Invoke-TestSetup {\n    $script:modulePath = $env:PSModulePath\n    $script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n    $script:moduleName = 'VMware.vSphereDSC'\n    $script:resourceName = 'VMHostVssSecurity'\n\n    $user = 'user'\n    $password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n    $credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n    $script:Constants = @{\n        VIServerUser = 'user'\n        NetworkSystemMoRefType = 'HostNetworkSystem'\n        NetworkSystemMoRefValue = 'networkSystem'\n    }\n    $script:resourceProperties = @{\n        Name = '10.23.82.112'\n        Server = '10.23.82.112'\n        Credential = $credential\n        Ensure = 'Present'\n        VssName = 'DSCTest'\n        AllowPromiscuous = $false\n        ForgedTransmits = $true\n        MacChanges = $true\n    }\n    $script:resourcePropertiesAbsent = $script:resourceProperties.Clone()\n    $script:resourcePropertiesAbsent.Ensure = 'Absent'\n    $script:netObjectEdit = 'edit'\n    $script:vssProperties = @{\n        NumPorts = 1\n        Mtu = 1500\n        Key = 'VSS'\n        NumPortsAvailable = 1\n        Pnic = @('vmnic1', 'vmnic2')\n        Portgroup = @('Portgroup1', 'Portgroup2')\n    }\n    $script:viServerCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n            Name = '$($script:resourceProperties.Server)'\n            User = '$($script:Constants.VIServerUser)'\n    }\n'@\n    $script:vmHostCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n            Name = '$($script:resourceProperties.Name)'\n            ExtensionData = [VMware.Vim.HostSystem] @{\n                ConfigManager = [VMware.Vim.HostConfigManager] @{\n                    NetworkSystem = [VMware.Vim.ManagedObjectReference] @{\n                        Type = '$($script:Constants.NetworkSystemMoRefType)'\n                        Value = '$($script:Constants.NetworkSystemMoRefValue)'\n                    }\n                }\n            }\n        }\n'@\n    $script:networkSystemNoVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @()\n                }\n            }\n        )\n'@\n    $script:networkSystemDiffVssSecurityCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Policy = [VMware.Vim.HostNetworkPolicy] @{\n                                    Security = [VMware.Vim.HostNetworkSecurityPolicy] @{\n                                        AllowPromiscuous = `$$(-not $script:resourceProperties.AllowPromiscuous)\n                                        ForgedTransmits = `$$(-not $script:resourceProperties.ForgedTransmits)\n                                        MacChanges = `$$(-not $script:resourceProperties.MacChanges)\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:networkSystemSameVssSecurityCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Policy = [VMware.Vim.HostNetworkPolicy] @{\n                                    Security = [VMware.Vim.HostNetworkSecurityPolicy] @{\n                                        AllowPromiscuous = `$$($script:resourceProperties.AllowPromiscuous)\n                                        ForgedTransmits = `$$($script:resourceProperties.ForgedTransmits)\n                                        MacChanges = `$$($script:resourceProperties.MacChanges)\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:updateNetworkCode = @'\n        return [VMware.Vim.HostNetworkConfigResult] @{\n            ConsoleVnicDevice = @()\n            VnicDevice = @()\n        }\n'@\n\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n\n    $script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = $script:resourceProperties.Server\n        User = $script:Constants.VIServerUser\n    }\n    $script:networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:Constants.NetworkSystemMoRefType\n        Value = $script:Constants.NetworkSystemMoRefValue\n    }\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostVssSecurity\\Set'  -Tag 'Set' {\n        Context 'Present and default Security properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssSecurityCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id twice' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should not call Update-Network' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $VssSecurityConfig -ne $null -and $VssSecurityConfig.Operation -eq $script:netObjectEdit.Operation }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Present and different security properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssSecurityCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Update-Network once with VssConfigSecurity and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssSecurityConfig -and $VssSecurityConfig.Operation -eq $script:netObjectEdit  }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Absent and VSS exists' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssSecurityCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call Update-Network once  with VssConfigSecurity and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssSecurityConfig -and $VssSecurityConfig.Operation -eq $script:netObjectEdit  }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n    }\n\n    Describe 'VMHostVssSecurity\\Test' -Tag 'Test' {\n        Context 'Present and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $false (The desired VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and security with different properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssSecurityCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired VSS is not configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and security with the same properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssSecurityCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The desired VSS is configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $true (The VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent, VSS exists and not default security properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssSecurityCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $false (The VSS exists)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Absent, VSS exists and default security properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssSecurityCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $true (The VSS exists, but Security settings are defaults)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'VMHostVssSecurity\\Get' -Tag 'Get' {\n        BeforeAll {\n            $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n            $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n            $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssSecurityCode))\n        }\n\n        # Arrange\n        Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Connect-VIServer'\n                ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-VMHost with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-VMHost'\n                ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-View with the passed server and id once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-View'\n                ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Name | Should -Be $script:resourceProperties.Name\n            $result.Ensure | Should -Be $script:resourceProperties.Ensure\n            $result.VssName | Should -Be $script:resourceProperties.VssName\n            $result.AllowPromiscuous | Should -Be $script:resourceProperties.AllowPromiscuous\n            $result.ForgedTransmits | Should -Be $script:resourceProperties.ForgedTransmits\n            $result.MacChanges | Should -Be $script:resourceProperties.MacChanges\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostVss/VMHostVssShaping.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\nfunction Invoke-TestSetup {\n    $script:modulePath = $env:PSModulePath\n    $script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n    $script:moduleName = 'VMware.vSphereDSC'\n    $script:resourceName = 'VMHostVssShaping'\n\n    $user = 'user'\n    $password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n    $credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n    $script:Constants = @{\n        VIServerUser = 'user'\n        NetworkSystemMoRefType = 'HostNetworkSystem'\n        NetworkSystemMoRefValue = 'networkSystem'\n    }\n    $script:resourceProperties = @{\n        Name = '10.23.82.112'\n        Server = '10.23.82.112'\n        Credential = $credential\n        Ensure = 'Present'\n        VssName = 'DSCTest'\n        AverageBandwidth = [long]100000\n        BurstSize = [long]100000\n        Enabled = $false\n        PeakBandwidth = [long]100000\n    }\n    $script:resourcePropertiesAbsent = $script:resourceProperties.Clone()\n    $script:resourcePropertiesAbsent.Ensure = 'Absent'\n    $script:netObjectEdit = 'edit'\n    $script:viServerCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n            Name = '$($script:resourceProperties.Server)'\n            User = '$($script:Constants.VIServerUser)'\n        }\n'@\n    $script:vmHostCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n            Name = '$($script:resourceProperties.Name)'\n            ExtensionData = [VMware.Vim.HostSystem] @{\n                ConfigManager = [VMware.Vim.HostConfigManager] @{\n                    NetworkSystem = [VMware.Vim.ManagedObjectReference] @{\n                        Type = '$($script:Constants.NetworkSystemMoRefType)'\n                        Value = '$($script:Constants.NetworkSystemMoRefValue)'\n                    }\n                }\n            }\n        }\n'@\n    $script:networkSystemNoVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @()\n                }\n            }\n        )\n'@\n    $script:networkSystemDiffVssShapingCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Policy = [VMware.Vim.HostNetworkPolicy] @{\n                                    ShapingPolicy = [VMware.Vim.HostNetworkTrafficShapingPolicy] @{\n                                        AverageBandwidth = $($script:resourceProperties.AverageBandwidth + 1)\n                                        BurstSize = $($script:resourceProperties.BurstSize + 1)\n                                        Enabled = `$$(-not $script:resourceProperties.Enabled)\n                                        PeakBandwidth = $($script:resourceProperties.PeakBandwidth + 1)\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:networkSystemSameVssShapingCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Policy = [VMware.Vim.HostNetworkPolicy] @{\n                                    ShapingPolicy = [VMware.Vim.HostNetworkTrafficShapingPolicy] @{\n                                        AverageBandwidth = $($script:resourceProperties.AverageBandwidth)\n                                        BurstSize = $($script:resourceProperties.BurstSize)\n                                        Enabled = `$$($script:resourceProperties.Enabled)\n                                        PeakBandwidth = $($script:resourceProperties.PeakBandwidth)\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:updateNetworkCode = @'\n        return [VMware.Vim.HostNetworkConfigResult] @{\n            ConsoleVnicDevice = @()\n            VnicDevice = @()\n        }\n'@\n\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n\n    $script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = $script:resourceProperties.Server\n        User = $script:Constants.VIServerUser\n    }\n    $script:networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:Constants.NetworkSystemMoRefType\n        Value = $script:Constants.NetworkSystemMoRefValue\n    }\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostVssShaping\\Set'  -Tag 'Set' {\n        Context 'Present and default Shaping properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssShapingCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id twice' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should not call Update-Network' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $VssShapingConfig -ne $null -and $VssShapingConfig.Operation -eq $script:netObjectEdit.Operation }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Present and different shaping properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssShapingCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Update-Network once with VssConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssShapingConfig -and $VssShapingConfig.Operation -eq $script:netObjectEdit }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Absent and VSS exists' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssShapingCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call Update-Network once  with VssShapingConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssShapingConfig -and $VssShapingConfig.Operation -eq $script:netObjectEdit }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n    }\n\n    Describe 'VMHostVssShaping\\Test' -Tag 'Test' {\n        Context 'Present and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $false (The desired VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and shaping with different properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssShapingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired VSS is not configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and shaping with the same properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssShapingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The desired VSS is configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $true (The VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent, VSS exists and not default shaping properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssShapingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $false (The VSS exists)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Absent, VSS exists and default shaping properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssShapingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $true (The VSS exists, but Shaping settings are defaults)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'VMHostVssShaping\\Get' -Tag 'Get' {\n        BeforeAll {\n            $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n            $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n            $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssShapingCode))\n        }\n\n        # Arrange\n        Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Connect-VIServer'\n                ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-VMHost with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-VMHost'\n                ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-View with the passed server and id once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-View'\n                ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Name | Should -Be $script:resourceProperties.Name\n            $result.Ensure | Should -Be $script:resourceProperties.Ensure\n            $result.VssName | Should -Be $script:resourceProperties.VssName\n            $result.AverageBandwidth | Should -Be $script:resourceProperties.AverageBandwidth\n            $result.BurstSize | Should -Be $script:resourceProperties.BurstSize\n            $result.Enabled | Should -Be $script:resourceProperties.Enabled\n            $result.PeakBandwidth | Should -Be $script:resourceProperties.PeakBandwidth\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/VMHostVss/VMHostVssTeaming.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\..\\VMware.vSphereDSC.psm1'\n\nfunction Invoke-TestSetup {\n    $script:modulePath = $env:PSModulePath\n    $script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n    $script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n    $script:moduleName = 'VMware.vSphereDSC'\n    $script:resourceName = 'VMHostVssTeaming'\n\n    $user = 'user'\n    $password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n    $credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n    $script:Constants = @{\n        VIServerUser = 'user'\n        NetworkSystemMoRefType = 'HostNetworkSystem'\n        NetworkSystemMoRefValue = 'networkSystem'\n    }\n    $script:resourceProperties = @{\n        Name = '10.23.82.112'\n        Server = '10.23.82.112'\n        Credential = $credential\n        Ensure = 'Present'\n        VssName = 'DSCTest'\n        CheckBeacon = $false\n        ActiveNic = @()\n        StandbyNic = @()\n        NotifySwitches = $true\n        Policy = \"LoadBalance_SrcId\"\n        RollingOrder = $false\n    }\n    $script:resourcePropertiesAbsent = $script:resourceProperties.Clone()\n    $script:resourcePropertiesAbsent.Ensure = 'Absent'\n    $script:ActiveNicAlt = \"'vmnic2', 'vmnic3'\"\n    $script:StandbyNicAlt = \"'vmnic6', 'vmnic7'\"\n    $script:PolicyAlt = \"LoadBalance_IP\"\n    $script:netObjectEdit = 'edit'\n    $script:viServerCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n            Name = '$($script:resourceProperties.Server)'\n            User = '$($script:Constants.VIServerUser)'\n        }\n'@\n    $script:vmHostCode = @'\n        return [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{\n            Name = '$($script:resourceProperties.Name)'\n            ExtensionData = [VMware.Vim.HostSystem] @{\n                ConfigManager = [VMware.Vim.HostConfigManager] @{\n                    NetworkSystem = [VMware.Vim.ManagedObjectReference] @{\n                        Type = '$($script:Constants.NetworkSystemMoRefType)'\n                        Value = '$($script:Constants.NetworkSystemMoRefValue)'\n                    }\n                }\n            }\n        }\n'@\n    $script:networkSystemNoVssCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @()\n                }\n            }\n        )\n'@\n    $script:networkSystemDiffVssTeamingCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Policy = [VMware.Vim.HostNetworkPolicy] @{\n                                    NicTeaming = [VMware.Vim.HostNicTeamingPolicy] @{\n                                        FailureCriteria = [VMware.Vim.HostNicFailureCriteria] @{\n                                            CheckBeacon = `$$(-not $script:resourceProperties.CheckBeacon)\n                                        }\n                                        NicOrder = [VMware.Vim.HostNicOrderPolicy] @{\n                                            ActiveNic = @($($script:ActiveNicAlt))\n                                            StandbyNic = @($($script:StandbyNicAlt))\n                                        }\n                                        NotifySwitches = `$$(-not $script:resourceProperties.NotifySwitches)\n                                        Policy = '$($script:PolicyAlt)'\n                                        RollingOrder = `$$(-not $script:resourceProperties.RollingOrder)\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:networkSystemSameVssTeamingCode = @'\n        return (\n            [VMware.Vim.HostNetworkSystem] @{\n                NetworkInfo = [VMware.Vim.HostNetworkInfo] @{\n                    vswitch = @(\n                        [VMware.Vim.HostVirtualSwitch]@{\n                            Name = '$($script:resourceProperties.VssName)'\n                            Spec = [VMware.Vim.HostVirtualSwitchSpec] @{\n                                Policy = [VMware.Vim.HostNetworkPolicy] @{\n                                    NicTeaming = [VMware.Vim.HostNicTeamingPolicy] @{\n                                        FailureCriteria = [VMware.Vim.HostNicFailureCriteria] @{\n                                            CheckBeacon = `$$($script:resourceProperties.CheckBeacon)\n                                        }\n                                        NicOrder = [VMware.Vim.HostNicOrderPolicy] @{\n                                            ActiveNic = @($($script:resourceProperties.ActiveNic))\n                                            StandbyNic = @($($script:resourceProperties.StandbyNic))\n                                        }\n                                        NotifySwitches = `$$($script:resourceProperties.NotifySwitches)\n                                        Policy = '$($script:resourceProperties.Policy)'\n                                        RollingOrder = `$$($script:resourceProperties.RollingOrder)\n                                    }\n                                }\n                            }\n                        }\n                    )\n                }\n            }\n        )\n'@\n    $script:updateNetworkCode = @'\n        return [VMware.Vim.HostNetworkConfigResult] @{\n            ConsoleVnicDevice = @()\n            VnicDevice = @()\n        }\n'@\n\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n\n    $script:viServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{\n        Name = $script:resourceProperties.Server\n        User = $script:Constants.VIServerUser\n    }\n    $script:networkSystemMoRef = [VMware.Vim.ManagedObjectReference] @{\n        Type = $script:Constants.NetworkSystemMoRefType\n        Value = $script:Constants.NetworkSystemMoRefValue\n    }\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'VMHostVssTeaming\\Set'  -Tag 'Set' {\n        Context 'Present and default Teaming properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssTeamingCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id twice' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should not call Update-Network' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $VssTeamingConfig -ne $null -and $VssTeamingConfig.Operation -eq $script:netObjectEdit.Operation }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 0\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Present and different teaming properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssTeamingCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Update-Network once with VssConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssTeamingConfig -and $VssTeamingConfig.Operation -eq $script:netObjectEdit  }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n\n        Context 'Absent and VSS exists' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssTeamingCode))\n                $updateNetworkMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:updateNetworkCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n            Mock -CommandName Update-Network -MockWith $updateNetworkMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call Update-Network once with VssTeamingConfig and operation Edit' {\n                # Act\n                $result = $resource.Set()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Update-Network'\n                    ParameterFilter = { $null -ne $VssTeamingConfig -and $VssTeamingConfig.Operation -eq $script:netObjectEdit  }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n        }\n    }\n\n    Describe 'VMHostVssTeaming\\Test' -Tag 'Test' {\n        Context 'Present and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $false (The desired VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and teaming with different properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssTeamingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The desired VSS is not configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Present, VSS exists and teaming with the same properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssTeamingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The desired VSS is configured correctly)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent and VSS does not exist' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemNoVssCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Connect-VIServer'\n                    ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-VMHost with the passed server and name once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-VMHost'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should call Get-View with the passed server and id once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                $assertMockCalledParams = @{\n                    CommandName = 'Get-View'\n                    ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                    ModuleName = $script:moduleName\n                    Exactly = $true\n                    Times = 1\n                    Scope = 'It'\n                }\n                Assert-MockCalled @assertMockCalledParams\n            }\n\n            It 'Should return $true (The VSS does not exist)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Absent, VSS exists and not default teaming properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemDiffVssTeamingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $false (The VSS exists)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Absent, VSS exists and default teaming properties' {\n            BeforeAll {\n                $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n                $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n                $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssTeamingCode))\n            }\n\n            # Arrange\n            Mock -CommandName Connect-VIServer -MockWith $viserverMock -ModuleName $script:moduleName\n            Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourcePropertiesAbsent\n\n            It 'Should return $true (The VSS exists, but teaming settings are defaults)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'VMHostVssTeaming\\Get' -Tag 'Get' {\n        BeforeAll {\n            $viserverMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:viServerCode))\n            $vmHostMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:vmHostCode))\n            $networkSystemMock = [scriptblock]::Create($ExecutionContext.InvokeCommand.ExpandString($script:networkSystemSameVssTeamingCode))\n        }\n\n        # Arrange\n        Mock -CommandName Connect-VIServer -MockWith $viServerMock -ModuleName $script:moduleName\n        Mock -CommandName Get-VMHost -MockWith $vmHostMock -ModuleName $script:moduleName\n        Mock -CommandName Get-View -MockWith $networkSystemMock -ModuleName $script:moduleName\n\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Connect-VIServer'\n                ParameterFilter = { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-VMHost with the passed server and name once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-VMHost'\n                ParameterFilter = { $Server -eq $script:viServer -and $Name -eq $script:resourceProperties.Name }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should call Get-View with the passed server and id once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            $assertMockCalledParams = @{\n                CommandName = 'Get-View'\n                ParameterFilter = { $Server -eq $script:viServer -and $Id -eq $script:networkSystemMoRef }\n                ModuleName = $script:moduleName\n                Exactly = $true\n                Times = 1\n                Scope = 'It'\n            }\n            Assert-MockCalled @assertMockCalledParams\n        }\n\n        It 'Should match the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Name | Should -Be $script:resourceProperties.Name\n            $result.Ensure | Should -Be $script:resourceProperties.Ensure\n            $result.VssName | Should -Be $script:resourceProperties.VssName\n            $result.AverageBandwidth | Should -Be $script:resourceProperties.AverageBandwidth\n            $result.BurstSize | Should -Be $script:resourceProperties.BurstSize\n            $result.Enabled | Should -Be $script:resourceProperties.Enabled\n            $result.PeakBandwidth | Should -Be $script:resourceProperties.PeakBandwidth\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/vCenterSettings.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'vCenterSettings'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Server = '10.23.82.112'\n    Credential = $credential\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'vCenterSettings\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.LoggingLevel = 'Unset'\n            $script:resourceProperties.EventMaxAgeEnabled = $false\n            $script:resourceProperties.EventMaxAge = 40\n            $script:resourceProperties.TaskMaxAgeEnabled = $false\n            $script:resourceProperties.TaskMaxAge = 40\n            $script:resourceProperties.Motd = [string]::Empty\n            $script:resourceProperties.Issue = [string]::Empty\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $vCenter = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vCenter once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                                  -ParameterFilter { $Server -eq $vCenter -and $Entity -eq $vCenter } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.LoggingLevel = 'Warning'\n                $script:resourceProperties.EventMaxAgeEnabled = $true\n                $script:resourceProperties.EventMaxAge = 41\n                $script:resourceProperties.TaskMaxAgeEnabled = $true\n                $script:resourceProperties.TaskMaxAge = 41\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from isue!'\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Info' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $false }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 40 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $false }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 40 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = [string]::Empty }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = [string]::Empty }\n                )\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Info' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $false }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $false }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = [string]::Empty }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = [string]::Empty }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call Set-AdvancedSetting for each setting that needs to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[0] -and $Value -eq $script:resourceProperties.LoggingLevel -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[1] -and $Value -eq $script:resourceProperties.EventMaxAgeEnabled -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[2] -and $Value -eq $script:resourceProperties.EventMaxAge -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[3] -and $Value -eq $script:resourceProperties.TaskMaxAgeEnabled -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[4] -and $Value -eq $script:resourceProperties.TaskMaxAge -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[5] -and $Value -eq $script:resourceProperties.Motd -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[6] -and $Value -eq $script:resourceProperties.Issue -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking without Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.LoggingLevel = 'Warning'\n                $script:resourceProperties.EventMaxAgeEnabled = $true\n                $script:resourceProperties.EventMaxAge = 41\n                $script:resourceProperties.TaskMaxAgeEnabled = $true\n                $script:resourceProperties.TaskMaxAge = 41\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from issue!'\n\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Warning' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $true }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 41 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $true }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 41 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = 'Hello World from motd!' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = 'Hello World from issue!' }\n                )\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Warning' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $true }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 41 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $true }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 41 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = 'Hello World from motd!' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = 'Hello World from issue!' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should not call Set-AdvancedSetting for each setting that does not need to be updated' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[0] -and $Value -eq $script:resourceProperties.LoggingLevel -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[1] -and $Value -eq $script:resourceProperties.EventMaxAgeEnabled -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[2] -and $Value -eq $script:resourceProperties.EventMaxAge -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[3] -and $Value -eq $script:resourceProperties.TaskMaxAgeEnabled -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[4] -and $Value -eq $script:resourceProperties.TaskMaxAge -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[5] -and $Value -eq $script:resourceProperties.Motd -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n                Assert-MockCalled -CommandName Set-AdvancedSetting `\n                                  -ParameterFilter { $AdvancedSetting -eq $advancedSettings[6] -and $Value -eq $script:resourceProperties.Issue -and !$Confirm } `\n                                  -ModuleName $script:moduleName -Exactly 0 -Scope It\n            }\n        }\n    }\n\n    Describe 'vCenterSettings\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.LoggingLevel = 'Unset'\n            $script:resourceProperties.EventMaxAgeEnabled = $false\n            $script:resourceProperties.EventMaxAge = 40\n            $script:resourceProperties.TaskMaxAgeEnabled = $false\n            $script:resourceProperties.TaskMaxAge = 40\n            $script:resourceProperties.Motd = [string]::Empty\n            $script:resourceProperties.Issue = [string]::Empty\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                # Arrange\n                $vCenter = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vCenter once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                                  -ParameterFilter { $Server -eq $vCenter -and $Entity -eq $vCenter } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.LoggingLevel = 'Warning'\n                $script:resourceProperties.EventMaxAgeEnabled = $true\n                $script:resourceProperties.EventMaxAge = 41\n                $script:resourceProperties.TaskMaxAgeEnabled = $true\n                $script:resourceProperties.TaskMaxAge = 41\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from issue!'\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Info' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $false }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $false }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 40 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = [string]::Empty }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = [string]::Empty }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (Advanced Settings need to be updated.)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking without Advanced Settings To Update' {\n            BeforeAll {\n                # Arrange\n                $script:resourceProperties.LoggingLevel = 'Warning'\n                $script:resourceProperties.EventMaxAgeEnabled = $true\n                $script:resourceProperties.EventMaxAge = 41\n                $script:resourceProperties.TaskMaxAgeEnabled = $true\n                $script:resourceProperties.TaskMaxAge = 41\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from issue!'\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Warning' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $true }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 41 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $true }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 41 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = 'Hello World from motd!' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = 'Hello World from issue!' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (Advanced Settings do not need to be updated.)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'vCenterSettings\\Get' -Tag 'Get' {\n        AfterEach {\n            $script:resourceProperties.LoggingLevel = 'Unset'\n            $script:resourceProperties.EventMaxAgeEnabled = $false\n            $script:resourceProperties.EventMaxAge = 40\n            $script:resourceProperties.TaskMaxAgeEnabled = $false\n            $script:resourceProperties.TaskMaxAge = 40\n            $script:resourceProperties.Motd = [string]::Empty\n            $script:resourceProperties.Issue = [string]::Empty\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeEach {\n                # Arrange\n                $script:resourceProperties.LoggingLevel = 'Warning'\n                $script:resourceProperties.EventMaxAgeEnabled = $true\n                $script:resourceProperties.EventMaxAge = 41\n                $script:resourceProperties.TaskMaxAgeEnabled = $true\n                $script:resourceProperties.TaskMaxAge = 41\n                $script:resourceProperties.Motd = 'Hello World from motd!'\n                $script:resourceProperties.Issue = 'Hello World from issue!'\n\n                $vCenter = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                $advancedSettings = @(\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Warning' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $true }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 41 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $true }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 41 }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = 'Hello World from motd!' }\n                    [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = 'Hello World from issue!' }\n                )\n\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user' }\n                }\n                $advancedSettingsMock = {\n                    return @(\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'log.level'; Value = 'Warning' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAgeEnabled'; Value = $true }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'event.maxAge'; Value = 41 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAgeEnabled'; Value = $true }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'task.maxAge'; Value = 41 }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.motd'; Value = 'Hello World from motd!' }\n                        [VMware.VimAutomation.ViCore.Impl.V1.AdvancedSettingImpl] @{ Name = 'etc.issue'; Value = 'Hello World from issue!' }\n                    )\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-AdvancedSetting -MockWith $advancedSettingsMock -ModuleName $script:moduleName\n                Mock -CommandName Set-AdvancedSetting -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call Get-AdvancedSetting mock with the passed server and vmhost once' {\n                # Act\n                $resource.Get()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-AdvancedSetting `\n                                  -ParameterFilter { $Server -eq $vCenter -and $Entity -eq $vCenter } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should return the resource with the properties passed from the server' {\n                # Act\n                $result = $resource.Get()\n\n                # Assert\n                $result.Server | Should -Be $script:resourceProperties.Server\n                $result.LoggingLevel | Should -Be $script:resourceProperties.LoggingLevel\n                $result.EventMaxAgeEnabled | Should -Be $script:resourceProperties.EventMaxAgeEnabled\n                $result.EventMaxAge | Should -Be $script:resourceProperties.EventMaxAge\n                $result.TaskMaxAgeEnabled | Should -Be $script:resourceProperties.TaskMaxAgeEnabled\n                $result.TaskMaxAge | Should -Be $script:resourceProperties.TaskMaxAge\n                $result.Motd | Should -Be $script:resourceProperties.Motd\n                $result.Issue | Should -Be $script:resourceProperties.Issue\n            }\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/vCenterStatistics.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:modulePath = $env:PSModulePath\n$script:unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n$script:mockModuleLocation = \"$script:unitTestsFolder\\TestHelpers\"\n\n$script:moduleName = 'VMware.vSphereDSC'\n$script:resourceName = 'vCenterStatistics'\n\n$user = 'user'\n$password = 'password' | ConvertTo-SecureString -AsPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($user, $password)\n\n$script:resourceProperties = @{\n    Server = '10.23.82.112'\n    Credential = $credential\n    Period = 'Month'\n}\n\nfunction Invoke-TestSetup {\n    $env:PSModulePath = $script:mockModuleLocation\n    $vimAutomationModule = Get-Module -Name VMware.VimAutomation.Core\n    if ($null -ne $vimAutomationModule -and $vimAutomationModule.Path -NotMatch 'TestHelpers') {\n        throw 'The Original VMware.VimAutomation.Core Module is loaded in the current session. If you want to run the unit tests please open a new PowerShell session.'\n    }\n\n    Import-Module -Name VMware.VimAutomation.Core\n}\n\nfunction Invoke-TestCleanup {\n    Remove-Module -Name VMware.VimAutomation.Core\n    $env:PSModulePath = $script:modulePath\n}\n\ntry {\n    # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n    Invoke-TestSetup\n\n    Describe 'vCenterStatistics\\Set' -Tag 'Set' {\n        AfterEach {\n            $script:resourceProperties.PeriodLength = $null\n            $script:resourceProperties.Level = $null\n            $script:resourceProperties.Enabled = $null\n            $script:resourceProperties.IntervalMinutes = $null\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                $vCenter = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                $perfManagerMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' }\n                $perfManager = [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                $perfInterval = [VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; SamplingPeriod = 600; Length = 2629800; Level = 1 }\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n                $performanceIntervalMock = {\n                    return [VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; SamplingPeriod = 600; Length = 2629800; Level = 1 }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n                Mock -CommandName New-PerformanceInterval -MockWith $performanceIntervalMock -ModuleName $script:moduleName\n                Mock -CommandName Update-PerfInterval -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call the Get-View mock with the PerformanceManager once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $vCenter -and $Id -eq $perfManagerMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call the New-PerformanceInterval mock with the Performance Interval once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-PerformanceInterval `\n                                  -ParameterFilter { $Key -eq $perfInterval.Key -and $Name -eq $perfInterval.Name -and $Enabled -eq $perfInterval.Enabled -and `\n                                                     $SamplingPeriod -eq $perfInterval.SamplingPeriod -and $Length -eq $perfInterval.Length -and $Level -eq $perfInterval.Level } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call the Update-PerfInterval mock with the Performance Manager and Performance Interval once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-PerfInterval `\n                                  -ParameterFilter { $PerformanceManager -eq $perfManager -and $PerformanceInterval -eq $perfInterval } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n\n        Context 'Invoking with specified resource properties' {\n            BeforeAll {\n                $script:resourceProperties.PeriodLength = 2\n                $script:resourceProperties.Level = 2\n                $script:resourceProperties.Enabled = $true\n                $script:resourceProperties.IntervalMinutes = 30\n\n                $perfInterval = [VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $true; `\n                                                             SamplingPeriod = 30 * 60; Length = 2 * 2629800; `\n                                                             Level = 2 }\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n                $performanceIntervalMock = {\n                    return [VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $true; SamplingPeriod = 30 * 60; Length = 2 * 2629800; Level = 2 }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n                Mock -CommandName New-PerformanceInterval -MockWith $performanceIntervalMock -ModuleName $script:moduleName\n                Mock -CommandName Update-PerfInterval -MockWith { return $null } -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the New-PerformanceInterval mock with the Performance Interval once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName New-PerformanceInterval `\n                                  -ParameterFilter { $Key -eq $perfInterval.Key -and $Name -eq $perfInterval.Name -and $Enabled -eq $perfInterval.Enabled -and `\n                                                     $SamplingPeriod -eq $perfInterval.SamplingPeriod -and $Length -eq $perfInterval.Length -and $Level -eq $perfInterval.Level } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call the Update-PerfInterval mock with the Performance Manager and Performance Interval once' {\n                # Act\n                $resource.Set()\n\n                # Assert\n                Assert-MockCalled -CommandName Update-PerfInterval `\n                                  -ParameterFilter { $PerformanceManager -eq $perfManager -and $PerformanceInterval -eq $perfInterval } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n        }\n    }\n\n    Describe 'vCenterStatistics\\Test' -Tag 'Test' {\n        AfterEach {\n            $script:resourceProperties.PeriodLength = $null\n            $script:resourceProperties.Level = $null\n            $script:resourceProperties.Enabled = $null\n            $script:resourceProperties.IntervalMinutes = $null\n        }\n\n        Context 'Invoking with default resource properties' {\n            BeforeAll {\n                $vCenter = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                $perfManagerMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' }\n                $perfManager = [VMware.Vim.PerformanceManager] @{}\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Connect-VIServer `\n                                  -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should call the Get-View mock with the PerformanceManager once' {\n                # Act\n                $resource.Test()\n\n                # Assert\n                Assert-MockCalled -CommandName Get-View `\n                                  -ParameterFilter { $Server -eq $vCenter -and $Id -eq $perfManagerMoRef } `\n                                  -ModuleName $script:moduleName -Exactly 1 -Scope It\n            }\n\n            It 'Should return $true (The Statistics Settings are in the desired state)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n\n        Context 'Invoking with different Level Setting' {\n            BeforeAll {\n                $script:resourceProperties.PeriodLength = 1\n                $script:resourceProperties.Level = 2\n                $script:resourceProperties.Enabled = $false\n                $script:resourceProperties.IntervalMinutes = 10\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The Statistics Settings are not in the desired state)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with different Enabled Setting' {\n            BeforeAll {\n                $script:resourceProperties.PeriodLength = 1\n                $script:resourceProperties.Level = 1\n                $script:resourceProperties.Enabled = $true\n                $script:resourceProperties.IntervalMinutes = 10\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The Statistics Settings are not in the desired state)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with different Period Length Setting' {\n            BeforeAll {\n                $script:resourceProperties.PeriodLength = 2\n                $script:resourceProperties.Level = 1\n                $script:resourceProperties.Enabled = $false\n                $script:resourceProperties.IntervalMinutes = 10\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The Statistics Settings are not in the desired state)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with different Interval Minutes Setting' {\n            BeforeAll {\n                $script:resourceProperties.PeriodLength = 1\n                $script:resourceProperties.Level = 1\n                $script:resourceProperties.Enabled = $false\n                $script:resourceProperties.IntervalMinutes = 20\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $false (The Statistics Settings are not in the desired state)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $false\n            }\n        }\n\n        Context 'Invoking with the same Statistics Settings' {\n            BeforeAll {\n                $script:resourceProperties.PeriodLength = 1\n                $script:resourceProperties.Level = 1\n                $script:resourceProperties.Enabled = $false\n                $script:resourceProperties.IntervalMinutes = 10\n\n                # Arrange\n                $vCenterMock = {\n                    return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                    [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                    [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n                }\n                $performanceManagerMock = {\n                    return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                              SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n                }\n\n                Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n                Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n            }\n\n            # Arrange\n            $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n            It 'Should return $true (The Statistics Settings are in the desired state)' {\n                # Act\n                $result = $resource.Test()\n\n                # Assert\n                $result | Should -Be $true\n            }\n        }\n    }\n\n    Describe 'vCenterStatistics\\Get' -Tag 'Get' {\n        AfterEach {\n            $script:resourceProperties.PeriodLength = $null\n            $script:resourceProperties.Level = $null\n            $script:resourceProperties.Enabled = $null\n            $script:resourceProperties.IntervalMinutes = $null\n        }\n\n        BeforeAll {\n            $vCenter = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n            [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n            [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n            $perfManagerMoRef = [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' }\n            $perfManager = [VMware.Vim.PerformanceManager] @{}\n            $perfInterval = [VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; SamplingPeriod = 600; Length = 2629800; Level = 1 }\n\n            # Arrange\n            $vCenterMock = {\n                return [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ Name = '10.23.82.112'; User = 'user'; ExtensionData = `\n                [VMware.Vim.ServiceInstance] @{ Content = [VMware.Vim.ServiceContent] @{ PerfManager = `\n                [VMware.Vim.ManagedObjectReference] @{ Type = 'PerformanceManager'; Value = 'PerfMgr' } } } }\n            }\n            $performanceManagerMock = {\n                return [VMware.Vim.PerformanceManager] @{ HistoricalInterval = @([VMware.Vim.PerfInterval] @{ Key = 1; Name = 'Month'; Enabled = $false; `\n                                                          SamplingPeriod = 600; Length = 2629800; Level = 1 }) }\n            }\n\n            Mock -CommandName Connect-VIServer -MockWith $vCenterMock -ModuleName $script:moduleName\n            Mock -CommandName Get-View -MockWith $performanceManagerMock -ModuleName $script:moduleName\n        }\n\n        # Arrange\n        $resource = New-Object -TypeName $script:resourceName -Property $script:resourceProperties\n\n        It 'Should call the Connect-VIServer mock with the passed server and credentials once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Connect-VIServer `\n                              -ParameterFilter { $Server -eq $script:resourceProperties.Server -and $Credential -eq $script:resourceProperties.Credential } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should call the Get-View mock with the PerformanceManager once' {\n            # Act\n            $resource.Get()\n\n            # Assert\n            Assert-MockCalled -CommandName Get-View `\n                              -ParameterFilter { $Server -eq $vCenter -and $Id -eq $perfManagerMoRef } `\n                              -ModuleName $script:moduleName -Exactly 1 -Scope It\n        }\n\n        It 'Should return the Resource with the properties retrieved from the server' {\n            # Act\n            $result = $resource.Get()\n\n            # Assert\n            $result.Server | Should -Be $script:resourceProperties.Server\n            $result.Period | Should -Be $script:resourceProperties.Period\n            $result.Enabled | Should -Be $perfInterval.Enabled\n            $result.Level | Should -Be $perfInterval.Level\n            $result.IntervalMinutes | Should -Be ($perfInterval.SamplingPeriod / 60)\n            $result.PeriodLength | Should -Be ($perfInterval.Length / 2629800)\n        }\n    }\n}\nfinally {\n    # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n    Invoke-TestCleanup\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/Unit/vCenterVMHost.Unit.Tests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '..\\..\\VMware.vSphereDSC.psm1'\n\n$script:moduleName = 'VMware.vSphereDSC'\n\nInModuleScope -ModuleName $script:moduleName {\n    try {\n        $unitTestsFolder = Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Tests') 'Unit'\n        $modulePath = $env:PSModulePath\n        $resourceName = 'vCenterVMHost'\n\n        . \"$unitTestsFolder\\TestHelpers\\TestUtils.ps1\"\n\n        # Calls the function to Import the mocked VMware.VimAutomation.Core module before all tests.\n        Invoke-TestSetup\n\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\MockData.ps1\"\n        . \"$unitTestsFolder\\TestHelpers\\Mocks\\vCenterVMHostMocks.ps1\"\n\n        Describe 'vCenterVMHost\\Set' -Tag 'Set' {\n            BeforeAll {\n                # Arrange\n                New-MocksForvCenterVMHostInSet\n            }\n\n            Context 'When Ensure is Present, the VMHost is not added to the vCenter and error occurs while adding the VMHost to the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVMHostIsNotAddedToThevCenterAndErrorOccursWhileAddingTheVMHostToThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while adding the VMHost to the vCenter' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not add VMHost $($script:constants.VMHostName) to vCenter $($script:viServer.Name) and location $($script:datacenterHostFolder.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the VMHost is not added to the vCenter and no error occurs while adding the VMHost to the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVMHostIsNotAddedToThevCenterAndNoErrorOccursWhileAddingTheVMHostToThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Add-VMHost mock with the specified VMHost and credential once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Add-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $Name -eq $script:constants.VMHostName -and\n                            $Location -eq $script:datacenterHostFolder -and\n                            $Credential -eq $script:credential -and\n                            $Port -eq $script:constants.VMHostPort -and\n                            $Force -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the VMHost is already added to the vCenter and it is on the desired location' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterAndItIsOnTheDesiredLocation\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Move-VMHost mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Move-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithDatacenterHostFolderAsParent -and\n                            $Destination -eq $script:datacenterHostFolder -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Present, the VMHost is already added to the vCenter and error occurs while moving the VMHost to the desired location' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterAndErrorOccursWhileMovingTheVMHostToTheDesiredLocation\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while moving the VMHost to the desired location' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not move VMHost $($script:vmHostWithInventoryItemLocationItemOneAsParent.Name) to location $($script:datacenterHostFolder.Name) on vCenter $($script:viServer.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Present, the VMHost is already added to the vCenter and no error occurs while moving the VMHost to the desired location' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterAndNoErrorOccursWhileMovingTheVMHostToTheDesiredLocation\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Move-VMHost mock with the specified VMHost and destination location once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Move-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithInventoryItemLocationItemOneAsParent -and\n                            $Destination -eq $script:datacenterHostFolder -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMHost is already removed from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMHostIsAlreadyRemovedFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should not invoke the Remove-VMHost mock' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithDatacenterHostFolderAsParent -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 0\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n\n            Context 'When Ensure is Absent, the VMHost is not removed from the vCenter and error occurs while removing the VMHost from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheVMHostIsNotRemovedFromThevCenterAndErrorOccursWhileRemovingTheVMHostFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    try {\n                        # Act\n                        $resource.Set()\n                    }\n                    catch {\n                        # Assert\n                        Assert-VerifiableMock\n                    }\n                }\n\n                It 'Should throw an exception with the correct message when error occurs while removing the VMHost from the vCenter' {\n                    # Act && Assert\n                    # When the Throw statement does not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error.\n                    { $resource.Set() } | Should -Throw \"Could not remove VMHost $($script:vmHostWithDatacenterHostFolderAsParent.Name) from vCenter $($script:viServer.Name). For more information: ScriptHalted\"\n                }\n            }\n\n            Context 'When Ensure is Absent, the VMHost is not removed from the vCenter and no error occurs while removing the VMHost from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentTheVMHostIsNotRemovedFromThevCenterAndNoErrorOccursWhileRemovingTheVMHostFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should invoke the Remove-VMHost mock with the specified VMHost once' {\n                    # Act\n                    $resource.Set()\n\n                    # Assert\n                    $assertMockCalledParams = @{\n                        CommandName = 'Remove-VMHost'\n                        ParameterFilter = {\n                            $Server -eq $script:viServer -and\n                            $VMHost -eq $script:vmHostWithDatacenterHostFolderAsParent -and\n                            !$Confirm\n                        }\n                        Exactly = $true\n                        Times = 1\n                        Scope = 'It'\n                    }\n\n                    Assert-MockCalled @assertMockCalledParams\n                }\n            }\n        }\n\n        Describe 'vCenterVMHost\\Test' -Tag 'Test' {\n            BeforeAll {\n                # Arrange\n                New-MocksForvCenterVMHost\n            }\n\n            Context 'When Ensure is Present and the VMHost is not added to the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheVMHostIsNotAddedToThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present and the VMHost is not added to the vCenter' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present, the VMHost is already added to the vCenter but not on the desired location' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentTheVMHostIsAlreadyAddedToThevCenterButNotOnTheDesiredLocation\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Present, the VMHost is already added to the vCenter but not on the desired location' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n\n            Context 'When Ensure is Present and the VMHost is already added to the desired location on the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheVMHostIsAlreadyAddedToTheDesiredLocationOnThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Present and the VMHost is already added to the desired location on the vCenter' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMHost is already removed from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMHostIsAlreadyRemovedFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $true when Ensure is Absent and the VMHost is already removed from the vCenter' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $true\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMHost is not removed from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMHostIsNotRemovedFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Test()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should return $false when Ensure is Absent and the VMHost is not removed from the vCenter' {\n                    # Act\n                    $result = $resource.Test()\n\n                    # Assert\n                    $result | Should -Be $false\n                }\n            }\n        }\n\n        Describe 'vCenterVMHost\\Get' -Tag 'Get' {\n            BeforeAll {\n                # Arrange\n                New-MocksForvCenterVMHost\n            }\n\n            Context 'When Ensure is Present and the VMHost is not added to the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheVMHostIsNotAddedToThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Port | Should -Be $resourceProperties.Port\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.ResourcePoolLocation | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When Ensure is Present and the VMHost is already added to the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsPresentAndTheVMHostIsAlreadyAddedToThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHostWithDatacenterHostFolderAsParent.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Port | Should -Be $script:vmHostWithDatacenterHostFolderAsParent.ExtensionData.Summary.Config.Port\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.ResourcePoolLocation | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMHost is already removed from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMHostIsAlreadyRemovedFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the Resource properties' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $resourceProperties.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Absent'\n                    $result.Port | Should -Be $resourceProperties.Port\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.ResourcePoolLocation | Should -BeNullOrEmpty\n                }\n            }\n\n            Context 'When Ensure is Absent and the VMHost is not removed from the vCenter' {\n                BeforeAll {\n                    # Arrange\n                    $resourceProperties = New-MocksWhenEnsureIsAbsentAndTheVMHostIsNotRemovedFromThevCenter\n                    $resource = New-Object -TypeName $resourceName -Property $resourceProperties\n                }\n\n                It 'Should invoke all defined mocks with the correct parameters' {\n                    # Act\n                    $resource.Get()\n\n                    # Assert\n                    Assert-VerifiableMock\n                }\n\n                It 'Should retrieve and return the correct values from the server' {\n                    # Act\n                    $result = $resource.Get()\n\n                    # Assert\n                    $result.Server | Should -Be $script:viServer.Name\n                    $result.Name | Should -Be $script:vmHostWithDatacenterHostFolderAsParent.Name\n                    $result.Location | Should -Be $resourceProperties.Location\n                    $result.DatacenterName | Should -Be $resourceProperties.DatacenterName\n                    $result.DatacenterLocation | Should -Be $resourceProperties.DatacenterLocation\n                    $result.Ensure | Should -Be 'Present'\n                    $result.Port | Should -Be $script:vmHostWithDatacenterHostFolderAsParent.ExtensionData.Summary.Config.Port\n                    $result.Force | Should -Be $resourceProperties.Force\n                    $result.ResourcePoolLocation | Should -BeNullOrEmpty\n                }\n            }\n        }\n    }\n    finally {\n        # Calls the function to Remove the mocked VMware.VimAutomation.Core module after all tests.\n        Invoke-TestCleanup -ModulePath $modulePath\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/Tests/UnitTests.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase\n$unitTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Unit'\n\nInvoke-Pester -Path \"$unitTestsFolderPath\\*\" -CodeCoverage @{ Path = \"$moduleFolderPath\\VMware.vSphereDSC.psm1\" }\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/VMware.vSphereDSC.CompositeResourcesHelper.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.SYNOPSIS\nCreates a new Resource Block for the specified Resource with the specified properties.\n\n.DESCRIPTION\nCreates a new Resource Block for the specified Resource with the specified properties. The Resource\nBlock is part of a Configuration. The function allows to dynamically pass Resource properties to the\nResource Block based on some criteria, which is not possible if the Resource Block is directly defined\nin the Configuration.\nExample function output:\nParam(\n    [Parameter(Mandatory = $true)]\n    [hashtable]\n    $Parameters\n)\n\nVMHostVssPortGroup VMHostVssPortGroup {\n    VssName = $Parameters['VssName']\n    VMHostName = $Parameters['VMHostName']\n    Server = $Parameters['Server']\n    Credential = $Parameters['Credential']\n    Name = $Parameters['Name']\n    Ensure = $Parameters['Ensure']\n}\n\n.PARAMETER ResourceName\nSpecifies the name of the Resource.\n\n.PARAMETER Properties\nSpecifies the properties that are going to be populated for the specified Resource.\n#>\nfunction New-DscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $ResourceName,\n\n        [Parameter(Mandatory = $true)]\n        [hashtable]\n        $Properties\n    )\n\n    $stringBuilder = [System.Text.StringBuilder]::new()\n\n    $stringBuilder.AppendLine(\"Param(\") | Out-Null\n    $stringBuilder.AppendLine(\"    [Parameter(Mandatory = `$true)]\") | Out-Null\n    $stringBuilder.AppendLine(\"    [hashtable]\") | Out-Null\n    $stringBuilder.AppendLine(\"    `$Parameters\") | Out-Null\n    $stringBuilder.AppendLine(\")\") | Out-Null\n\n    $stringBuilder.Append([System.Environment]::NewLine) | Out-Null\n    $stringBuilder.AppendLine(\"$ResourceName $ResourceName {\") | Out-Null\n\n    foreach($propertyName in $Properties.Keys) {\n        $stringBuilder.AppendLine(\"    $propertyName = `$Parameters['$propertyName']\") | Out-Null\n    }\n\n    $stringBuilder.AppendLine(\"}\") | Out-Null\n\n    <#\n        The scriptBlock gets returned so that it can be invoked in the caller's scope.\n        The earlier implementation of the scriptBlock getting invoked in this function\n        was causing problems with custom defined functions for the DSC Resources,\n        because they and other script variables can't be seen in this scope.\n    #>\n    [ScriptBlock]::Create($stringBuilder.ToString())\n}\n\n<#\n.SYNOPSIS\nPushes the specified properties that are not $null to the properties hashtable.\n\n.DESCRIPTION\nPushes the specified properties that are not $null to the properties hashtable. $null properties are not pushed\nto the properties hashtable, because when the Configuration is parsed, the compiled MOF contains all $null properties\nwith their default values depending on the type, instead of ignoring them and them not being part of the compiled MOF file.\n\n.PARAMETER ResourceBlockProperties\nSpecifies the hashtable with the properties that are going to be passed to the Resource Block.\n\n.PARAMETER NullableProperties\nSpecifies the nullable properties that are going to be pushed to the properties hashtable. Only properties with value that is\ndifferent from $null are going to be pushed to the properties hashtable.\n#>\nfunction Push-NullablePropertiesToDscResourceBlock {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [hashtable]\n        $ResourceBlockProperties,\n\n        [Parameter(Mandatory = $true)]\n        [hashtable]\n        $NullableProperties\n    )\n\n    foreach ($nullablePropertyName in $NullableProperties.Keys) {\n        if ($null -ne $NullableProperties.$nullablePropertyName) {\n            $ResourceBlockProperties.$nullablePropertyName = $NullableProperties.$nullablePropertyName\n        }\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/VMware.vSphereDSC.Helper.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nfunction New-DateTimeConfig {\n    [CmdletBinding()]\n    [OutputType([VMware.Vim.HostDateTimeConfig])]\n    param(\n        [string[]] $NtpServer\n    )\n\n    $dateTimeConfig = New-Object VMware.Vim.HostDateTimeConfig\n    $dateTimeConfig.NtpConfig = New-Object VMware.Vim.HostNtpConfig\n    $dateTimeConfig.NtpConfig.Server = $NtpServer\n\n    return $dateTimeConfig\n}\n\nfunction Update-DateTimeConfig {\n    [CmdletBinding()]\n    param(\n        [VMware.Vim.HostDateTimeSystem] $DateTimeSystem,\n        [VMware.Vim.HostDateTimeConfig] $DateTimeConfig\n    )\n\n    $DateTimeSystem.UpdateDateTimeConfig($DateTimeConfig)\n}\n\nfunction Update-ServicePolicy {\n    [CmdletBinding()]\n    param(\n        [VMware.Vim.HostServiceSystem] $ServiceSystem,\n        [string] $ServiceId,\n        [string] $ServicePolicyValue\n    )\n\n    $ServiceSystem.UpdateServicePolicy($ServiceId, $ServicePolicyValue)\n}\n\nfunction New-DNSConfig {\n    [CmdletBinding()]\n    [OutputType([VMware.Vim.HostDnsConfig])]\n    param(\n        [string[]] $Address,\n        [bool] $Dhcp,\n        [string] $DomainName,\n        [string] $HostName,\n        $Ipv6VirtualNicDevice,\n        [string[]] $SearchDomain,\n        $VirtualNicDevice\n    )\n\n    $dnsConfig = New-Object VMware.Vim.HostDnsConfig\n    $dnsConfig.HostName = $HostName\n    $dnsConfig.DomainName = $DomainName\n\n    if (!$Dhcp) {\n        if ($null -ne $Address) { $dnsConfig.Address = $Address }\n        if ($null -ne $SearchDomain) { $dnsConfig.SearchDomain = $SearchDomain }\n    }\n    else {\n        $dnsConfig.Dhcp = $Dhcp\n\n        if ($null -ne $VirtualNicDevice) { $dnsConfig.VirtualNicDevice = $VirtualNicDevice }\n        if ($null -ne $Ipv6VirtualNicDevice) { $dnsConfig.Ipv6VirtualNicDevice = $Ipv6VirtualNicDevice }\n    }\n\n    return $dnsConfig\n}\n\nfunction Update-DNSConfig {\n    [CmdletBinding()]\n    param(\n        [VMware.Vim.HostNetworkSystem] $NetworkSystem,\n        [VMware.Vim.HostDnsConfig] $DnsConfig\n    )\n\n    $NetworkSystem.UpdateDnsConfig($DnsConfig)\n}\n\nfunction Get-SATPClaimRules {\n    [CmdletBinding()]\n    [OutputType([Object[]])]\n    param(\n        [PSObject] $EsxCli\n    )\n\n    $satpClaimRules = $EsxCli.storage.nmp.satp.rule.list.Invoke()\n    return $satpClaimRules\n}\n\nfunction Add-CreateArgs {\n    [CmdletBinding()]\n    [OutputType([Hashtable])]\n    param(\n        [PSOBject] $EsxCli\n    )\n\n    $satpArgs = $EsxCli.storage.nmp.satp.rule.add.CreateArgs()\n    return $satpArgs\n}\n\nfunction Add-SATPClaimRule {\n    [CmdletBinding()]\n    param(\n        [PSObject] $EsxCli,\n        [Hashtable] $SatpArgs\n    )\n\n    $EsxCli.storage.nmp.satp.rule.add.Invoke($SatpArgs)\n}\n\nfunction Remove-CreateArgs {\n    [CmdletBinding()]\n    [OutputType([Hashtable])]\n    param(\n        [PSObject] $EsxCli\n    )\n\n    $satpArgs = $EsxCli.storage.nmp.satp.rule.remove.CreateArgs()\n    return $satpArgs\n}\n\nfunction Remove-SATPClaimRule {\n    [CmdletBinding()]\n    param(\n        [PSObject] $EsxCli,\n        [Hashtable] $SatpArgs\n    )\n\n    $EsxCli.storage.nmp.satp.rule.remove.Invoke($SatpArgs)\n}\n\nfunction New-PerformanceInterval {\n    [CmdletBinding()]\n    [OutputType([VMware.Vim.PerfInterval])]\n    param(\n        [int] $Key,\n        [string] $Name,\n        [bool] $Enabled,\n        [int] $Level,\n        [long] $SamplingPeriod,\n        [long] $Length\n    )\n\n    $performanceInterval = New-Object VMware.Vim.PerfInterval\n\n    $performanceInterval.Key = $Key\n    $performanceInterval.Name = $Name\n    $performanceInterval.Enabled = $Enabled\n    $performanceInterval.Level = $Level\n    $performanceInterval.SamplingPeriod = $SamplingPeriod\n    $performanceInterval.Length = $Length\n\n    return $performanceInterval\n}\n\nfunction Update-PerfInterval {\n    [CmdletBinding()]\n    param(\n        [VMware.Vim.PerformanceManager] $PerformanceManager,\n        [VMware.Vim.PerfInterval] $PerformanceInterval\n    )\n\n    $PerformanceManager.UpdatePerfInterval($PerformanceInterval)\n}\n\nfunction Compare-Settings {\n    <#\n    .SYNOPSIS\n    Compare settings between current and desired states\n    .DESCRIPTION\n    This compares the current and desired states by comparing the configuration values specified in the desired state to the current state.\n    If a value is not specified in the desired state it is not assessed against the current state.\n\n    .PARAMETER DesiredState\n    Desired state configuration object.\n\n    .PARAMETER CurrentState\n    Current state configuration object.\n    #>\n    [CmdletBinding()]\n    param(\n        $DesiredState,\n        $CurrentState\n    )\n\n    foreach ($key in $DesiredState.Keys) {\n        if ($CurrentState.$key -ne $DesiredState.$key ) {\n            return $true\n        }\n    }\n    return $false\n}\n\nfunction Get-VMHostSyslogConfig {\n    [CmdletBinding()]\n    [OutputType([Object])]\n    param(\n        [PSObject] $EsxCli\n    )\n\n    $syslogConfig = $EsxCli.system.syslog.config.get.Invoke()\n\n    return $syslogConfig\n}\n\nfunction Set-VMHostSyslogConfig {\n    [CmdletBinding()]\n    [OutputType([Object[]])]\n    param(\n        [PSObject] $EsxCli,\n        [Hashtable] $VMHostSyslogConfig\n    )\n\n    $esxcli.system.syslog.config.set.Invoke($VMHostSyslogConfig)\n    $esxcli.system.syslog.reload.Invoke()\n}\n\nfunction Update-Network {\n    [CmdletBinding()]\n    param(\n        [VMware.Vim.HostNetworkSystem] $NetworkSystem,\n        [Parameter(ParameterSetName = 'VSS')]\n        [Hashtable] $VssConfig,\n        [Parameter(ParameterSetName = 'VSSSecurity')]\n        [Hashtable] $VssSecurityConfig,\n        [Parameter(ParameterSetName = 'VSSShaping')]\n        [Hashtable] $VssShapingConfig,\n        [Parameter(ParameterSetName = 'VSSTeaming')]\n        [Hashtable] $VssTeamingConfig,\n        [Parameter(ParameterSetName = 'VSSBridge')]\n        [Hashtable] $VssBridgeConfig\n    )\n\n    Write-Verbose -Message \"$(Get-Date) $($s = Get-PSCallStack; \"Entering {0}\" -f $s[0].FunctionName)\"\n\n    <#\n    $configNet is the parameter object we pass to the UpdateNetworkConfig method.\n    Since all network updates will be done via this UpdateNetworkConfig method,\n    we start with an empty VMware.Vim.HostNetworkConfig object in $configNet.\n    Depending on the Switch case, we add the required objects to $configNet.\n\n    This allows the Update-Network function to be used for all ESXi network related changes.\n    #>\n\n    $configNet = New-Object VMware.Vim.HostNetworkConfig\n\n    switch ($PSCmdlet.ParameterSetName) {\n        'VSS' {\n            $hostVirtualSwitchConfig = $NetworkSystem.NetworkConfig.Vswitch | Where-Object { $_.Name -eq $VssConfig.Name }\n\n            if ($null -eq $hostVirtualSwitchConfig -and $VssConfig.Operation -ne 'add') {\n                throw \"Standard Virtual Switch $($VssConfig.Name) was not found.\"\n            }\n\n            if ($null -eq $hostVirtualSwitchConfig) {\n                $hostVirtualSwitchConfig = New-Object VMware.Vim.HostVirtualSwitchConfig\n            }\n\n            $hostVirtualSwitchConfig.ChangeOperation = $VssConfig.Operation\n            $hostVirtualSwitchConfig.Name = $VssConfig.Name\n\n            if ($null -eq $hostVirtualSwitchConfig.Spec) {\n                $hostVirtualSwitchConfig.Spec = New-Object VMware.Vim.HostVirtualSwitchSpec\n            }\n\n            $hostVirtualSwitchConfig.Spec.Mtu = $VssConfig.Mtu\n            # Although ignored since ESXi 5.5, the NumPorts property is 'required'\n            $hostVirtualSwitchConfig.Spec.NumPorts = 1\n            $configNet.Vswitch += $hostVirtualSwitchConfig\n        }\n\n        'VSSSecurity' {\n            $hostVirtualSwitchConfig = $NetworkSystem.NetworkConfig.Vswitch | Where-Object { $_.Name -eq $VssSecurityConfig.Name }\n\n            $hostVirtualSwitchConfig.ChangeOperation = $VssSecurityConfig.Operation\n            if ($null -ne $VssSecurityConfig.AllowPromiscuous) { $hostVirtualSwitchConfig.Spec.Policy.Security.AllowPromiscuous = $VssSecurityConfig.AllowPromiscuous }\n            if ($null -ne $VssSecurityConfig.ForgedTransmits) { $hostVirtualSwitchConfig.Spec.Policy.Security.ForgedTransmits = $VssSecurityConfig.ForgedTransmits }\n            if ($null -ne $VssSecurityConfig.MacChanges) { $hostVirtualSwitchConfig.Spec.Policy.Security.MacChanges = $VssSecurityConfig.MacChanges }\n\n            $configNet.Vswitch += $hostVirtualSwitchConfig\n        }\n\n        'VSSShaping' {\n            $hostVirtualSwitchConfig = $NetworkSystem.NetworkConfig.Vswitch | Where-Object { $_.Name -eq $VssShapingConfig.Name }\n\n            $hostVirtualSwitchConfig.ChangeOperation = $VssShapingConfig.Operation\n            if ($null -ne $VssShapingConfig.Enabled) { $hostVirtualSwitchConfig.Spec.Policy.ShapingPolicy.Enabled = $VssShapingConfig.Enabled }\n            if ($null -ne $VssShapingConfig.AverageBandwidth) { $hostVirtualSwitchConfig.Spec.Policy.ShapingPolicy.AverageBandwidth = $VssShapingConfig.AverageBandwidth }\n            if ($null -ne $VssShapingConfig.BurstSize) { $hostVirtualSwitchConfig.Spec.Policy.ShapingPolicy.BurstSize = $VssShapingConfig.BurstSize }\n            if ($null -ne $VssShapingConfig.PeakBandwidth) { $hostVirtualSwitchConfig.Spec.Policy.ShapingPolicy.PeakBandwidth = $VssShapingConfig.PeakBandwidth }\n\n            $configNet.Vswitch += $hostVirtualSwitchConfig\n        }\n\n        'VSSTeaming' {\n            $hostVirtualSwitchConfig = $NetworkSystem.NetworkConfig.Vswitch | Where-Object { $_.Name -eq $VssTeamingConfig.Name }\n\n            if ($null -ne $VssTeamingConfig.CheckBeacon -and\n                $VssTeamingConfig.CheckBeacon -and\n                ($hostVirtualSwitchConfig.Spec.Bridge -isNot [VMware.Vim.HostVirtualSwitchBridge] -or\n                    $hostVirtualSwitchConfig.Spec.Bridge.Interval -eq 0)) {\n                throw 'VMHostVssTeaming: Configuration error - CheckBeacon can only be enabled if the VirtualSwitch has been configured to use the beacon.'\n            }\n\n            if ($null -ne $VssTeamingConfig.CheckBeacon -and\n                !$VssTeamingConfig.CheckBeacon -and\n                $hostVirtualSwitchConfig.Spec.Bridge -is [VMware.Vim.HostVirtualSwitchBridge] -and\n                $hostVirtualSwitchConfig.Spec.Bridge.Interval -eq 0) {\n                throw 'VMHostVssTeaming: Configuration error - CheckBeacon can only be disabled if the VirtualSwitch has not been configured to use the beacon.'\n            }\n\n            if (($VssTeamingConfig.ActiveNic.Count -ne 0 -or\n                $VssTeamingConfig.StandbyNic.Count -ne 0) -and\n                $null -ne $hostVirtualSwitchConfig.Spec.Bridge -and\n                $hostVirtualSwitchConfig.Spec.Bridge.NicDevice.Count -eq 0) {\n                throw \"VMHostVssTeaming: Configuration error - You cannot use Active or Standby NICs, when there are no NICs assigned to the Bridge.\"\n            }\n\n            <#\n                A physical network adapter cannot be in both active and standby lists, so if the\n                physical network adapter is moved from one list to another, it should be removed\n                from the current list as well.\n            #>\n            $updateNicOrderingPolicyParams = @{\n                CurrentActiveNic = $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NicOrder.ActiveNic\n                DesiredActiveNic = $VssTeamingConfig.ActiveNic\n                CurrentStandbyNic = $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NicOrder.StandbyNic\n                DesiredStandbyNic = $VssTeamingConfig.StandbyNic\n            }\n            $modifiedNics = Update-NicOrderingPolicy @updateNicOrderingPolicyParams\n\n            $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NicOrder.ActiveNic = $modifiedNics.ActiveNic\n            $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NicOrder.StandbyNic = $modifiedNics.StandbyNic\n\n            $hostVirtualSwitchConfig.ChangeOperation = $VssTeamingConfig.Operation\n            if ($null -ne $VssTeamingConfig.CheckBeacon) { $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon = $VssTeamingConfig.CheckBeacon }\n            if ($null -ne $VssTeamingConfig.NotifySwitches) { $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NotifySwitches = $VssTeamingConfig.NotifySwitches }\n            if ($null -ne $VssTeamingConfig.RollingOrder) { $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.RollingOrder = $VssTeamingConfig.RollingOrder }\n\n            # The Network Adapter teaming policy should be specified only when it is passed.\n            if ($null -ne $VssTeamingConfig.Policy) { $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.Policy = $VssTeamingConfig.Policy }\n\n            $configNet.Vswitch += $hostVirtualSwitchConfig\n        }\n\n        'VssBridge' {\n            $hostVirtualSwitchConfig = $NetworkSystem.NetworkConfig.Vswitch | Where-Object { $_.Name -eq $VssBridgeConfig.Name }\n\n            if ($VssBridgeConfig.NicDevice.Count -eq 0) {\n                if ($hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NicOrder.ActiveNic.Count -ne 0 -or\n                    $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.NicOrder.StandbyNic.Count -ne 0) {\n                    throw \"VMHostVssBridge: Configuration error - When NICs are defined as Active or Standby, you must specify them under NicDevice as well.\"\n                }\n                elseif ($null -ne $VssBridgeConfig.BeaconInterval) {\n                    throw \"VMHostVssBridge: Configuration error - When you define a BeaconInterval, you must have one or more NICs defined under NicDevice.\"\n                }\n                elseif (![string]::IsNullOrEmpty($VssBridgeConfig.LinkDiscoveryProtocolOperation) -or ![string]::IsNullOrEmpty($VssBridgeConfig.LinkDiscoveryProtocolProtocol)) {\n                    throw \"VMHostVssBridge: Configuration error - When you use Link Discovery, you must have NICs defined under NicDevice.\"\n                }\n            }\n            else {\n                if ($VssBridgeConfig.BeaconInterval -eq 0 -and $hostVirtualSwitchConfig.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon) {\n                    throw \"VMHostVssBridge: Configuration error - You can not have a Beacon interval of zero, when Beacon Checking is enabled.\"\n                }\n            }\n\n            $hostVirtualSwitchConfig.ChangeOperation = $VssBridgeConfig.Operation\n\n            if ($VssBridgeConfig.NicDevice.Count -ne 0) {\n                $hostVirtualSwitchConfig.Spec.Bridge = New-Object -TypeName 'VMware.Vim.HostVirtualSwitchBondBridge'\n                $hostVirtualSwitchConfig.Spec.Bridge.NicDevice = $VssBridgeConfig.NicDevice\n\n                if ($VssBridgeConfig.BeaconInterval -ne 0) {\n                    $hostVirtualSwitchConfig.Spec.Bridge.Beacon = New-Object VMware.Vim.HostVirtualSwitchBeaconConfig\n                    $hostVirtualSwitchConfig.Spec.Bridge.Beacon.Interval = $VssBridgeConfig.BeaconInterval\n                }\n                else {\n                    if ($vss.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon) {\n                        throw \"VMHostVssBridge: Configuration error - When CheckBeacon is True, the BeaconInterval cannot be 0.\"\n                    }\n                }\n\n                if (![string]::IsNullOrEmpty($VssBridgeConfig.LinkDiscoveryProtocolProtocol)) {\n                    if ($VssBridgeConfig.LinkDiscoveryProtocolProtocol -eq ([LinkDiscoveryProtocolProtocol]::CDP).ToString()) {\n                        $hostVirtualSwitchConfig.Spec.Bridge.linkDiscoveryProtocolConfig = New-Object -TypeName VMware.Vim.LinkDiscoveryProtocolConfig\n                        $hostVirtualSwitchConfig.Spec.Bridge.linkDiscoveryProtocolConfig.Operation = $VssBridgeConfig.LinkDiscoveryProtocolOperation.ToLower()\n                        $hostVirtualSwitchConfig.Spec.Bridge.linkDiscoveryProtocolConfig.Protocol = $VssBridgeConfig.LinkDiscoveryProtocolProtocol.ToLower()\n                    }\n                    else {\n                        throw \"VMHostVssBridge: Configuration error - A Virtual Switch (VSS) only supports CDP as the Link Discovery Protocol.\"\n                    }\n                }\n            }\n            else {\n                $hostVirtualSwitchConfig.Spec.Bridge = $null\n            }\n\n            $configNet.Vswitch += $hostVirtualSwitchConfig\n        }\n    }\n\n    $NetworkSystem.UpdateNetworkConfig($configNet, [VMware.Vim.HostConfigChangeMode]::modify)\n}\n\n<#\n.SYNOPSIS\nModifies the network adapter ordering policy of a standard switch.\n\n.DESCRIPTION\nModifies the network adapter ordering policy of a standard switch. A physical network adapter\ncan be in the active list, the standby list, or neither. It cannot be in both lists.\n\n.PARAMETER CurrentActiveNic\nSpecifies the current active list of physical network adapters.\n\n.PARAMETER DesiredActiveNic\nSpecifies the desired active list of physical network adapters.\n\n.PARAMETER CurrentStandbyNic\nSpecifies the current standby list of physical network adapters.\n\n.PARAMETER DesiredStandbyNic\nSpecifies the desired standby list of physical network adapters.\n#>\nfunction Update-NicOrderingPolicy {\n    [CmdletBinding()]\n    [OutputType([hashtable])]\n    Param(\n        [Parameter(Mandatory = $false)]\n        [string[]] $CurrentActiveNic,\n\n        [Parameter(Mandatory = $false)]\n        [string[]] $DesiredActiveNic,\n\n        [Parameter(Mandatory = $false)]\n        [string[]] $CurrentStandbyNic,\n\n        [Parameter(Mandatory = $false)]\n        [string[]] $DesiredStandbyNic\n    )\n\n    $modifiedActiveNic = $CurrentActiveNic\n    $modifiedStandbyNic = $CurrentStandbyNic\n\n    if (\n        $null -ne $DesiredActiveNic -and\n        $null -ne $DesiredStandbyNic\n    ) {\n        $modifiedActiveNic = $DesiredActiveNic\n        $modifiedStandbyNic = $DesiredStandbyNic\n    }\n    elseif (\n        $null -ne $DesiredActiveNic -and\n        $null -eq $DesiredStandbyNic\n    ) {\n        $modifiedActiveNic = $DesiredActiveNic\n\n        if ($CurrentStandbyNic.Length -gt 0) {\n            $standbyNics = @()\n            foreach ($standyNic in $CurrentStandbyNic) {\n                if (!($DesiredActiveNic -Contains $standyNic)) {\n                    $standbyNics += $standyNic\n                }\n            }\n\n            $modifiedStandbyNic = $standbyNics\n        }\n    }\n    elseif (\n        $null -ne $DesiredStandbyNic -and\n        $null -eq $DesiredActiveNic\n    ) {\n        $modifiedStandbyNic = $DesiredStandbyNic\n\n        if ($CurrentActiveNic.Length -gt 0) {\n            $activeNics = @()\n            foreach ($activeNic in $CurrentActiveNic) {\n                if (!($DesiredStandbyNic -Contains $activeNic)) {\n                    $activeNics += $activeNic\n                }\n            }\n\n            $modifiedActiveNic = $activeNics\n        }\n    }\n\n    return @{\n        'ActiveNic' = $modifiedActiveNic\n        'StandbyNic' = $modifiedStandbyNic\n    }\n}\n\nfunction Add-Cluster {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.Folder] $Folder,\n\n        [Parameter(Mandatory = $true)]\n        [string] $Name,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.ClusterConfigSpecEx] $Spec\n    )\n\n    $Folder.CreateClusterEx($Name, $Spec)\n}\n\nfunction Update-ClusterComputeResource {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.ClusterComputeResource] $ClusterComputeResource,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.ClusterConfigSpecEx] $Spec\n    )\n\n    $ClusterComputeResource.ReconfigureComputeResource_Task($Spec, $true)\n}\n\nfunction Remove-ClusterComputeResource {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.ClusterComputeResource] $ClusterComputeResource\n    )\n\n    $ClusterComputeResource.Destroy()\n}\n\nfunction Update-VMHostAdvancedSettings {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.OptionManager] $VMHostAdvancedOptionManager,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.OptionValue[]] $Options\n    )\n\n    $VMHostAdvancedOptionManager.UpdateOptions($Options)\n}\n\nfunction Update-AgentVMConfiguration {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostEsxAgentHostManager] $EsxAgentHostManager,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostEsxAgentHostManagerConfigInfo] $EsxAgentHostManagerConfigInfo\n    )\n\n    $EsxAgentHostManager.EsxAgentHostManagerUpdateConfig($EsxAgentHostManagerConfigInfo)\n}\n\nfunction Update-PassthruConfig {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostPciPassthruSystem] $VMHostPciPassthruSystem,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostPciPassthruConfig] $VMHostPciPassthruConfig\n    )\n\n    $VMHostPciPassthruSystem.UpdatePassthruConfig($VMHostPciPassthruConfig)\n}\n\nfunction Update-GraphicsConfig {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostGraphicsManager] $VMHostGraphicsManager,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostGraphicsConfig] $VMHostGraphicsConfig\n    )\n\n    $VMHostGraphicsManager.UpdateGraphicsConfig($VMHostGraphicsConfig)\n}\n\nfunction Update-PowerPolicy {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostPowerSystem] $VMHostPowerSystem,\n\n        [Parameter(Mandatory = $true)]\n        [int] $PowerPolicy\n    )\n\n    $VMHostPowerSystem.ConfigurePowerPolicy($PowerPolicy)\n}\n\nfunction Update-HostCacheConfiguration {\n    [CmdletBinding()]\n    [OutputType([VMware.Vim.ManagedObjectReference])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostCacheConfigurationManager] $VMHostCacheConfigurationManager,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostCacheConfigurationSpec] $Spec\n    )\n\n    return $VMHostCacheConfigurationManager.ConfigureHostCache_Task($Spec)\n}\n\nfunction Update-VirtualPortGroup {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostNetworkSystem] $VMHostNetworkSystem,\n\n        [Parameter(Mandatory = $true)]\n        [string] $VirtualPortGroupName,\n\n        [Parameter(Mandatory = $true)]\n        [VMware.Vim.HostPortGroupSpec] $Spec\n    )\n\n    $VMHostNetworkSystem.UpdatePortGroup($VirtualPortGroupName, $Spec)\n}\n\nfunction Invoke-EsxCliCommandMethod {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl]\n        $EsxCli,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullorEmpty()]\n        [string]\n        $EsxCliCommandMethod,\n\n        [Parameter(Mandatory = $true)]\n        [hashtable]\n        $EsxCliCommandMethodArguments\n    )\n\n    Invoke-Expression -Command (\"`$EsxCli.\" + ($EsxCliCommandMethod -f \"`$EsxCliCommandMethodArguments\")) -ErrorAction Stop -Verbose:$false\n}\n\nfunction Update-VMHostFirewallRuleset {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [VMware.Vim.HostFirewallSystem]\n        $VMHostFirewallSystem,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMHostFirewallRulesetId,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [VMware.Vim.HostFirewallRulesetRulesetSpec]\n        $VMHostFirewallRulesetSpec\n    )\n\n    $VMHostFirewallSystem.UpdateRuleset($VMHostFirewallRulesetId, $VMHostFirewallRulesetSpec)\n}\n\nfunction Get-IScsiHbaBoundNics {\n    [CmdletBinding()]\n    [OutputType([Object[]])]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl]\n        $EsxCli,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName\n    )\n\n    $listIScsiHbaBoundNicsArgs = $EsxCli.iscsi.networkportal.list.CreateArgs()\n    $listIScsiHbaBoundNicsArgs.adapter = $IScsiHbaName\n\n    return $EsxCli.iscsi.networkportal.list.Invoke($listIScsiHbaBoundNicsArgs)\n}\n\nfunction Update-IScsiHbaBoundNics {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNull()]\n        [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl]\n        $EsxCli,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $IScsiHbaName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateNotNullOrEmpty()]\n        [string]\n        $VMKernelNicName,\n\n        [Parameter(Mandatory = $true)]\n        [ValidateSet('Add', 'Remove')]\n        [string]\n        $Operation,\n\n        [Parameter(Mandatory = $false)]\n        [nullable[bool]]\n        $Force\n    )\n\n    $arguments = $null\n    if ($Operation -eq 'Add') {\n        $arguments = $EsxCli.iscsi.networkportal.add.CreateArgs()\n    }\n    else {\n        $arguments = $EsxCli.iscsi.networkportal.remove.CreateArgs()\n    }\n\n    $arguments.adapter = $IScsiHbaName\n    $arguments.nic = $VMKernelNicName\n\n    if ($null -ne $Force) {\n        $arguments.force = $Force\n    }\n\n    if ($Operation -eq 'Add') {\n        $EsxCli.iscsi.networkportal.add.Invoke($arguments) | Out-Null\n    }\n    else {\n        $EsxCli.iscsi.networkportal.remove.Invoke($arguments) | Out-Null\n    }\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/VMware.vSphereDSC.Logging.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n<#\n.SYNOPSIS\nWrites the specified message to the verbose message stream.\n\n.DESCRIPTION\nWrites the specified message to the verbose message stream. If arguments\nare passed to the function, the message is formatted accordingly using [string]::Format method.\n\n.PARAMETER Message\nSpecifies the message to write to the verbose message stream.\n\n.PARAMETER Arguments\nSpecifies the arguments that are needed for formatting the message using [string]::Format method.\nThe message is expected to be a format string that expects the given arguments.\n#>\nfunction Write-VerboseLog {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [string] $Message,\n\n        [Parameter()]\n        [array] $Arguments\n    )\n\n    if ($null -ne $Arguments) {\n        $Message = [string]::Format($Message, $Arguments)\n    }\n    \n    Write-Verbose -Message $Message\n}\n\n<#\n.SYNOPSIS\nWrites the specified warning message to the PowerShell host.\n\n.DESCRIPTION\nWrites the specified warning message to the PowerShell host. The response to the warning depends on the value\nof the user's $WarningPreference variable and the use of the WarningAction common parameter. If arguments\nare passed to the function, the message is formatted accordingly using [string]::Format method.\n\n.PARAMETER Message\nSpecifies the warning message to write to the PowerShell host.\n\n.PARAMETER Arguments\nSpecifies the arguments that are needed for formatting the message using [string]::Format method.\nThe message is expected to be a format string that expects the given arguments.\n#>\nfunction Write-WarningLog {\n    [CmdletBinding()]\n    Param(\n        [Parameter(Mandatory = $true)]\n        [string] $Message,\n\n        [Parameter()]\n        [array] $Arguments\n    )\n\n    if ($null -ne $Arguments) {\n        $Message = [string]::Format($Message, $Arguments)\n    }\n    \n    Write-Warning -Message $Message\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/VMware.vSphereDSC.build.ps1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n$script:ModuleRoot = $PSScriptRoot\n$script:ProjectRoot = (Get-Item -Path $script:ModuleRoot).Parent.Parent.FullName\n$script:ModuleName = Split-Path -Path $script:ModuleRoot -Leaf\n\n$script:PsmPath = Join-Path -Path $script:ModuleRoot -ChildPath \"$($script:ModuleName).psm1\"\n$script:PsdPath = Join-Path -Path $script:ModuleRoot -ChildPath \"$($script:ModuleName).psd1\"\n\n$script:LicensePath = Join-Path -Path $script:ProjectRoot -ChildPath \"LICENSE.txt\"\n# This is used to skip the lines from LICENSE.txt containing the repository name and the empty line after it.\n$script:LicenseSkipLines = 2\n$script:LicenseFileContent = Get-Content -Path $script:LicensePath | Select-Object -Skip $script:LicenseSkipLines\n\n$script:EnumsFolder = Join-Path -Path $script:ModuleRoot -ChildPath \"Enums\"\n$script:ClassesFolder = Join-Path -Path $script:ModuleRoot -ChildPath \"Classes\"\n$script:ClassesFiles = Get-ChildItem -Path $script:ClassesFolder -File -Filter *.ps1 -Recurse\n$script:DSCResourcesFolder = Join-Path -Path $script:ModuleRoot -ChildPath \"DSCResources\"\n\nclass Node {\n    [string] $Name\n\n    [string] $BaseName\n\n    [string] $FileName\n\n    [Node[]] $Edge\n\n    [void] AddEdge($edge) {\n        if ($null -eq $this.Edge) {\n            $this.Edge = @()\n        }\n\n        $this.Edge += $edge\n    }\n}\n\nfunction Add-DependenciesBetweenClasses {\n    [CmdletBinding()]\n    param (\n        [System.Object[]] $Files\n    )\n\n    $allClasses = @()\n\n    foreach ($file in $Files) {\n        $fileContent = Get-Content -Path $file.FullName\n        $errors = $null\n\n        $tokens = [System.Management.Automation.PSParser]::Tokenize($fileContent, [ref] $errors)\n        $classTokens = $tokens | Where-Object { $_.Content -eq 'class' }\n\n        foreach ($classToken in $classTokens) {\n            $classLine = $fileContent[$classToken.StartLine - 1]\n            $classLine = $classLine.Substring('class '.Length)\n            $classLineBaseInheritor = $classLine.Split(':').Split('{') | ForEach-Object { $_.Trim() }\n            $baseName = $null\n            $name = $null\n\n            # If the class does not have a base class that inherits from, the array will contain only two values: <class name> and <empty string>\n            if ($classLineBaseInheritor.Length -gt 2) {\n                $name = $classLineBaseInheritor[0]\n                $baseName = $classLineBaseInheritor[1]\n            }\n            else {\n                $name = $classLineBaseInheritor[0]\n            }\n\n            $currentClass = [Node]::new()\n            $currentClass.Name = $name\n            $currentClass.BaseName = $baseName\n            $currentClass.FileName = $file.Name\n\n            $allClasses += $currentClass\n        }\n    }\n\n    foreach ($class in $allClasses) {\n        if (![string]::IsNullOrEmpty($class.BaseName)) {\n            $baseClass = $allClasses | Where-Object { $_.Name -eq $class.BaseName }\n            $class.AddEdge($baseClass)\n        }\n    }\n\n    return $allClasses\n}\n\nfunction Get-OrderedClasses {\n    [CmdletBinding()]\n    param (\n        [Node] $Class,\n        [ref] $ResolvedClasses\n    )\n\n    foreach ($edge in $Class.Edge) {\n        $containedEdge = $ResolvedClasses.Value | Where-Object { $_.Name -eq $edge.Name }\n        if ($null -eq $containedEdge) {\n            Get-OrderedClasses -Class $edge -ResolvedClasses ([ref] $ResolvedClasses.Value)\n        }\n    }\n\n    $containedClass = $ResolvedClasses.Value | Where-Object { $_.Name -eq $Class.Name }\n    if ($null -eq $containedClass) {\n        $ResolvedClasses.Value.Add($Class)\n    }\n}\n\nfunction Get-OrderedFiles {\n    [CmdletBinding()]\n    param (\n        [System.Object[]] $Files\n    )\n\n    $classes = Add-DependenciesBetweenClasses -Files $Files\n    $resolvedClasses = New-Object System.Collections.Generic.List[Node]\n\n    foreach ($class in $classes) {\n        Get-OrderedClasses -Class $class -ResolvedClasses ([ref] $resolvedClasses)\n    }\n\n    $orderedFiles = @()\n\n    foreach ($class in $resolvedClasses) {\n        $containedFile = $orderedFiles | Where-Object { $_.Name -eq $class.FileName }\n        if ($null -eq $containedFile) {\n            $file = $Files | Where-Object { $_.Name -eq $class.FileName }\n            $orderedFiles += $file\n        }\n    }\n\n    return $orderedFiles\n}\n\nfunction Get-LinesRange {\n    [CmdletBinding()]\n    [OutputType([System.Collections.Hashtable])]\n    param(\n        [System.Object[]] $FileContent,\n        [string] $StartLinePattern,\n        [string] $EndLinePattern\n    )\n\n    $range = @{}\n\n    $index = 1\n    $startLine = 0\n    $endLine = 0\n\n    foreach ($line in $FileContent) {\n        if ($line -Like $StartLinePattern) {\n            $startLine = $index\n        }\n\n        if ($line.Trim().EndsWith($EndLinePattern) -and $startLine -ne 0) {\n            $endLine = $index\n            break\n        }\n\n        $index++\n    }\n\n    $range.StartLine = $startLine\n    $range.EndLine = $endLine\n\n    return $range\n}\n\nfunction Update-ContentOfModuleFile {\n    [CmdletBinding()]\n    param(\n        [string] $Folder,\n        [System.Object[]] $Files\n    )\n\n    if (Test-Path -Path $Folder) {\n        if ($null -eq $Files) {\n            $Files = Get-ChildItem -Path $Folder -File -Filter *.ps1 -Recurse\n        }\n\n        foreach ($file in $Files) {\n            $fileContent = Get-Content -Path $file.FullName\n\n            $range = Get-LinesRange -FileContent $fileContent -StartLinePattern '*Copyright*' -EndLinePattern '#>'\n            $endLine = $range.EndLine\n\n            # We skip the comment lines for the License and the License text for each file.\n            $fileContent = $fileContent[$endLine..($fileContent.Length - 1)]\n            $fileContent | ForEach-Object { $_ | Out-File -FilePath $script:PsmPath -Encoding Default -Append }\n        }\n    }\n}\n\nfunction Update-ModuleVersion {\n    [CmdletBinding()]\n    [OutputType([System.Object[]])]\n    param(\n        [System.Object[]] $FileContent\n    )\n\n    $moduleVersionPattern = \"(?<=ModuleVersion = ')(\\d*.\\d*.\\d*.\\d*)\"\n    $moduleVersionMatch = $FileContent | Select-String -Pattern $moduleVersionPattern\n    [System.Version] $currentVersion = $moduleVersionMatch.Matches[0].Value\n\n    $newVersion = (New-Object -TypeName 'System.Version' $currentVersion.Major, $currentVersion.Minor, $currentVersion.Build, ($currentVersion.Revision + 1)).ToString()\n\n    return $FileContent -Replace $moduleVersionPattern, $newVersion\n}\n\n# Add License to psm1 file.\n\"<#\" | Out-File -FilePath $script:PsmPath -Encoding Default\n$script:LicenseFileContent | ForEach-Object { $_ | Out-File -FilePath $script:PsmPath -Encoding Default -Append }\n\"#>\" + [System.Environment]::NewLine | Out-File -FilePath $script:PsmPath -Encoding Default -Append\n\n# Add helper module to psm1 file.\n\"Using module '.\\VMware.vSphereDSC.Helper.psm1'\" | Out-File -FilePath $script:PsmPath -Encoding Default -Append\n\n# Add logging module to psm1 file.\n\"Using module '.\\VMware.vSphereDSC.Logging.psm1'\" | Out-File -FilePath $script:PsmPath -Encoding Default -Append\n\n# Updating VMware.vSphereDSC.psm1 content with enums.\nUpdate-ContentOfModuleFile -Folder $script:EnumsFolder\n\n<#\nUpdating VMware.vSphereDSC.psm1 content with classes.\nThe files need to be ordered by the inheritance of the classes inside and not alphabetically.\nBecause we can have cases where the child class is defined before the parent class which will result in an exception.\nExample:\nclass DatastoreInventory : Inventory {\n}\n\nclass Inventory {\n}\n\nSo with this function we first order the classes based on the inheritance(the first classes in the array are the ones that do not inherit from anything and then\nafter them we order the classes that inherit from them and so on). And the last classes in the array are the ones that are not base classes to any other class.\nAfter we order the classes, we order the files based on the classes defined inside. With this step we guarantee that when a class is placed in the psm1 file, if the file has a\nclass it inherits from, that class will be already defined and no exception will be thrown like the above example.\n\nAfter ordering the files we pass them to the Update-ContentOfModuleFile function to place the content in the module file.\n#>\n$orderedClassesFiles = Get-OrderedFiles -Files $script:ClassesFiles\nUpdate-ContentOfModuleFile -Folder $script:ClassesFolder -Files $orderedClassesFiles\n\n# Updating VMware.vSphereDSC.psm1 content with DSC Resources.\nUpdate-ContentOfModuleFile -Folder $script:DSCResourcesFolder\n\n# Updating VMware.vSphereDSC.psd1 content with DSC Resources to export.\nif (Test-Path -Path $script:DSCResourcesFolder) {\n    $resources = (Get-ChildItem -Path $script:DSCResourcesFolder -File -Filter *.ps1 -Recurse | Select-Object -ExpandProperty BaseName) -join \"', '\"\n    $resources = \"'{0}'\" -f $resources\n    $dscResourcesToExport = \"DscResourcesToExport = @($resources)\"\n\n    $psdFileContent = Get-Content -Path $script:PsdPath\n\n    # Updating the module version in the psd1 file.\n    $psdFileContent = Update-ModuleVersion -FileContent $psdFileContent\n\n    $range = Get-LinesRange -FileContent $psdFileContent -StartLinePattern '*DscResourcesToExport*' -EndLinePattern ')'\n    $startLine = $range.StartLine\n    $endLine = $range.EndLine\n\n    $psdFileContent = $psdFileContent[0..($startLine - 2)], $dscResourcesToExport, $psdFileContent[$endLine..($psdFileContent.Length - 1)]\n    $psdFileContent | Out-File -FilePath $script:PsdPath -Encoding Default\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/VMware.vSphereDSC.psd1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\n@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'VMware.vSphereDSC.psm1'\n\n# Version number of this module.\nModuleVersion = '2.2.0.84'\n\n# ID used to uniquely identify this module\nGUID = '664b57b4-bd8d-4a56-9984-278f7fe10cf8'\n\n# Author of this module\nAuthor = 'VMware'\n\n# Company or vendor of this module\nCompanyName = 'VMware'\n\n# Supported PSEditions\nCompatiblePSEditions = 'Desktop', 'Core'\n\n# Copyright statement for this module\nCopyright = '(c) 2018-2020 VMware. All rights reserved.'\n\n# Description of the functionality provided by this module\nDescription = 'This PowerShell module contains DSC Resources for vSphere.'\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.1'\n\n<#\n    The RequiredModules were added to enable installing the module with all needed dependencies.\n    We are facing problems with Invoke-DSCResource cmdlet on PowerShell 7.0 related to PowerCLI inability to work in multiple PowerShell runspaces.\n    Removing RequiredModules is a workaround of this PowerCLI bug that allows vSphere.DSC Resources to be invoked with PS7.0 Invoke-DSCResource.\n    The disadvantage though is PowerCLI has to be installed separately as a prerequisite.\n#>\n# Modules that must be imported into the global environment prior to importing this module\nRequiredModules = @(\n    #@{ \"ModuleName\" = \"VMware.VimAutomation.Vds\"; \"ModuleVersion\" = \"11.2.0.12483615\" },\n    #@{ \"ModuleName\" = \"VMware.VimAutomation.Storage\"; \"ModuleVersion\" = \"11.5.0.14901686\" }\n)\n\n# Variables to export from this module\nVariablesToExport = '*'\n\n# DSC resources to export from this module\nDscResourcesToExport = @('Datacenter', 'DatacenterFolder', 'DatastoreCluster', 'DatastoreClusterAddDatastore', 'DRSRule', 'Folder', 'NfsUser', 'PowerCLISettings', 'vCenterSettings', 'vCenterStatistics', 'vCenterVMHost', 'VDPortGroup', 'VDSwitch', 'VDSwitchVMHost', 'VMHostAccount', 'VMHostAdvancedSettings', 'VMHostAgentVM', 'VMHostAuthentication', 'VMHostCache', 'VMHostConfiguration', 'VMHostDnsSettings', 'VMHostFirewallRuleset', 'VMHostIScsiHba', 'VMHostIScsiHbaTarget', 'VMHostIScsiHbaVMKernelNic', 'VMHostNtpSettings', 'VMHostPciPassthrough', 'VMHostPermission', 'VMHostPowerPolicy', 'VMHostRole', 'VMHostSatpClaimRule', 'VMHostScsiLun', 'VMHostScsiLunPath', 'VMHostService', 'VMHostSettings', 'VMHostStorage', 'VMHostSyslog', 'VMHostTpsSettings', 'NfsDatastore', 'VmfsDatastore', 'VMHostVssPortGroup', 'VMHostVssPortGroupSecurity', 'VMHostVssPortGroupShaping', 'VMHostVssPortGroupTeaming', 'VMHostAcceptanceLevel', 'VMHostDCUIKeyboard', 'VMHostNetworkCoreDump', 'VMHostSharedSwapSpace', 'VMHostSNMPAgent', 'VMHostSoftwareDevice', 'VMHostVMKernelActiveDumpFile', 'VMHostVMKernelActiveDumpPartition', 'VMHostVMKernelDumpFile', 'VMHostVMKernelModule', 'VMHostvSANNetworkConfiguration', 'VMHostVDSwitchMigration', 'VMHostVssMigration', 'VMHostPhysicalNic', 'VMHostVdsNic', 'VMHostVssNic', 'VMHostIPRoute', 'VMHostGraphics', 'VMHostGraphicsDevice', 'VMHostVss', 'VMHostVssBridge', 'VMHostVssSecurity', 'VMHostVssShaping', 'VMHostVssTeaming', 'DrsCluster', 'HACluster')\n\n# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.\nPrivateData = @{\n\n    PSData = @{\n\n        # Tags applied to this module. These help with module discovery in online galleries.\n        Tags = @('VMware', 'Automation', 'PowerCLI', 'DSC', 'DesiredStateConfiguration')\n\n        # A URL to the main website for this project.\n        ProjectUri = 'https://github.com/vmware/dscr-for-vmware'\n\n    } # End of PSData hashtable\n\n}\n\n}\n"
  },
  {
    "path": "Source/VMware.vSphereDSC/VMware.vSphereDSC.psm1",
    "content": "<#\nCopyright (c) 2018-2021 VMware, Inc.  All rights reserved\n\nThe BSD-2 license (the \"License\") set forth below applies to all parts of the Desired State Configuration Resources for VMware project.  You may not use this file except in compliance with the License.\n\nBSD-2 License\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#>\n\nUsing module '.\\VMware.vSphereDSC.Helper.psm1'\nUsing module '.\\VMware.vSphereDSC.Logging.psm1'\n\nenum AcceptanceLevel {\n    VMwareCertified\n    VMwareAccepted\n    PartnerSupported\n    CommunitySupported\n}\n\nenum ChapType {\n    Prohibited\n    Discouraged\n    Preferred\n    Required\n    Unset\n}\n\nenum DomainAction {\n    Join\n    Leave\n}\n\nenum DRSRuleType {\n    VMAffinity\n    VMAntiAffinity\n}\n\nenum Duplex {\n    Full\n    Half\n    Unset\n}\n\nenum Ensure {\n    Absent\n    Present\n}\n\nenum EntityType {\n    Folder\n    Datacenter\n    Cluster\n    Datastore\n    DatastoreCluster\n    VMHost\n    ResourcePool\n    VApp\n    VM\n    Template\n}\n\nenum FolderType {\n    Network\n    Datastore\n    Vm\n    Host\n}\n\nenum GraphicsType {\n    Shared\n    SharedDirect\n}\n\nenum IScsiHbaTargetType {\n    Static\n    Send\n}\n\nenum LinkDiscoveryProtocolOperation {\n    Advertise\n    Both\n    Listen\n    None\n    Unset\n}\n\nenum LinkDiscoveryProtocolProtocol {\n    CDP\n    LLDP\n    Unset\n}\n\nenum LoadBalancingPolicy {\n    LoadBalanceIP\n    LoadBalanceSrcMac\n    LoadBalanceSrcId\n    ExplicitFailover\n    Unset\n}\n\nenum LoggingLevel {\n    Unset\n    None\n    Error\n    Warning\n    Info\n    Verbose\n    Trivia\n}\n\nenum MultipathPolicy {\n    Fixed\n    MostRecentlyUsed\n    RoundRobin\n    Unknown\n    Unset\n}\n\nenum NetworkFailoverDetectionPolicy {\n    LinkStatus\n    BeaconProbing\n    Unset\n}\n\nenum Period {\n    Day = 86400\n    Week = 604800\n    Month = 2629800\n    Year = 31556926\n}\n\nenum PortBinding {\n    Static\n    Dynamic\n    Ephemeral\n    Unset\n}\n\nenum PowerPolicy {\n    HighPerformance = 1\n    Balanced = 2\n    LowPower = 3\n    Custom = 4\n}\n\nenum ServicePolicy {\n    Unset\n    On\n    Off\n    Automatic\n}\n\nenum SharedPassthruAssignmentPolicy {\n    Performance\n    Consolidation\n}\n\nenum VMHostState {\n    Connected\n    Disconnected\n    Maintenance\n    Unset\n}\n\nenum VMSwapfilePolicy {\n    InHostDatastore\n    WithVM\n    Unset\n}\n\nenum VsanDataMigrationMode {\n    Full\n    EnsureAccessibility\n    NoDataMigration\n    Unset\n}\n\nenum AccessMode {\n    ReadWrite\n    ReadOnly\n}\n\nenum AuthenticationMethod {\n    AUTH_SYS\n    Kerberos\n}\n\nenum NicTeamingPolicy {\n    Loadbalance_ip\n    Loadbalance_srcmac\n    Loadbalance_srcid\n    Failover_explicit\n    Unset\n}\n\nenum DrsAutomationLevel {\n    FullyAutomated\n    Manual\n    PartiallyAutomated\n    Disabled\n    Unset\n}\n\nenum HAIsolationResponse {\n    PowerOff\n    DoNothing\n    Shutdown\n    Unset\n}\n\nenum HARestartPriority {\n    Disabled\n    Low\n    Medium\n    High\n    Unset\n}\n\nenum BadCertificateAction {\n    Ignore\n    Warn\n    Prompt\n    Fail\n    Unset\n}\n\nenum DefaultVIServerMode {\n    Single\n    Multiple\n    Unset\n}\n\nenum PowerCLISettingsScope {\n    LCM\n}\n\nenum ProxyPolicy {\n    NoProxy\n    UseSystemProxy\n    Unset\n}\n\nclass BasevSphereConnection {\n    <#\n    .DESCRIPTION\n\n    Credentials needed for connection to the specified Server.\n    #>\n    [DscProperty()]\n    [PSCredential] $Credential\n\n    <#\n    .DESCRIPTION\n\n    Established connection to the specified vSphere Server.\n    #>\n    [PSObject] $Connection\n\n    <#\n    .DESCRIPTION\n\n    Saves logs in a HashTable ref in order to retrieve the stream output from outside of Invoke-DscResource execution.\n    #>\n    [ref] $Logs\n\n    hidden [string] $DscResourceName = $this.GetType().Name\n    hidden [string] $DscResourceIsInDesiredStateMessage = \"{0} DSC Resource is in Desired State.\"\n    hidden [string] $DscResourceIsNotInDesiredStateMessage = \"{0} DSC Resource is not in Desired State.\"\n\n    hidden [string] $TestMethodStartMessage = \"Begin executing Test functionality for {0} DSC Resource.\"\n    hidden [string] $TestMethodEndMessage = \"End executing Test functionality for {0} DSC Resource.\"\n    hidden [string] $SetMethodStartMessage = \"Begin executing Set functionality for {0} DSC Resource.\"\n    hidden [string] $SetMethodEndMessage = \"End executing Set functionality for {0} DSC Resource.\"\n    hidden [string] $GetMethodStartMessage = \"Begin executing Get functionality for {0} DSC Resource.\"\n    hidden [string] $GetMethodEndMessage = \"End executing Get functionality for {0} DSC Resource.\"\n\n    hidden [string] $SettingIsNotInDesiredStateMessage = \"Setting {0}: Current setting value [ {1} ] does not match desired setting value [ {2} ].\"\n    hidden [string] $DscResourcesEnumDefaultValue = 'Unset'\n\n    hidden [string] $VCenterConnectionRequiredMessage = \"The DSC Resource operations are only supported when connection is directly to a vCenter.\"\n    hidden [string] $ESXiConnectionRequiredMessage = \"The DSC Resource operations are only supported when connection is directly to an ESXi host.\"\n\n    hidden [string] $CouldNotEstablishvSphereConnectionMessage = \"Could not establish connection to vSphere Server {0}. For more information: {1}\"\n    hidden [string] $CouldNotClosevSphereConnectionMessage = \"Could not close connection to vSphere Server {0}. For more information: {1}\"\n\n    hidden [string] $vCenterProductId = 'vpx'\n    hidden [string] $ESXiProductId = 'embeddedEsx'\n\n    <#\n    .DESCRIPTION\n\n    Imports the required modules where the used PowerCLI cmdlets reside.\n    #>\n    [void] ImportRequiredModules() {\n        <#\n            The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n            when importing the 'VMware.VimAutomation.Core' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        Import-Module -Name 'VMware.VimAutomation.Core'\n\n        $global:VerbosePreference = $savedVerbosePreference\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed array is in the desired state and if an update should be performed.\n    #>\n    [bool] ShouldUpdateArraySetting($settingName, $currentArray, $desiredArray) {\n        $result = $null\n\n        if ($null -eq $desiredArray) {\n            # The property is not specified.\n            $result = $false\n        }\n        elseif ($desiredArray.Length -eq 0 -and $currentArray.Length -ne 0) {\n            # Empty array specified as desired, but current is not an empty array, so update should be performed.\n            $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($settingName, ($currentArray -Join ', '), ($desiredArray -Join ', ')))\n\n            $result = $true\n        }\n        else {\n            $elementsToAdd = $desiredArray | Where-Object { $currentArray -NotContains $_ }\n            $elementsToRemove = $currentArray | Where-Object { $desiredArray -NotContains $_ }\n\n            if ($null -ne $elementsToAdd -or $null -ne $elementsToRemove) {\n                <#\n                    The current array does not contain at least one element from desired array or\n                    the desired array is a subset of the current array. In both cases\n                    we should perform an update operation.\n                #>\n                $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($settingName, ($currentArray -Join ', '), ($desiredArray -Join ', ')))\n\n                $result = $true\n            }\n            else {\n                # No need to perform an update operation.\n                $result = $false\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed setting is in the desired state and if an update should be performed.\n    #>\n    [bool] ShouldUpdateDscResourceSetting($settingName, $currentSetting, $desiredSetting) {\n        $result = $null\n\n        if ($this.$settingName -is [string]) {\n            $result = ($null -ne $desiredSetting -and $desiredSetting -ne [string] $currentSetting)\n        }\n        elseif ($this.$settingName -is [enum]) {\n            $result = ($desiredSetting -ne $this.DscResourcesEnumDefaultValue -and $desiredSetting -ne $currentSetting)\n        }\n        else {\n            $result = ($null -ne $desiredSetting -and $desiredSetting -ne $currentSetting)\n        }\n\n        if ($result) {\n            $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($settingName, $currentSetting, $desiredSetting))\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Connection is directly to a vCenter and if not, throws an exception.\n    #>\n    [void] EnsureConnectionIsvCenter() {\n        if ($this.Connection.ProductLine -ne $this.vCenterProductId) {\n            throw $this.VCenterConnectionRequiredMessage\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Connection is directly to an ESXi host and if not, throws an exception.\n    #>\n    [void] EnsureConnectionIsESXi() {\n        if ($this.Connection.ProductLine -ne $this.ESXiProductId) {\n            throw $this.ESXiConnectionRequiredMessage\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Writes a Verbose message specifying if the DSC Resource is in the Desired State.\n    #>\n    [void] WriteDscResourceState($result) {\n        $messageToUse = [string]::Empty\n\n        if ($result) {\n            $messageToUse = $this.DscResourceIsInDesiredStateMessage\n        }\n        else {\n            $messageToUse = $this.DscResourceIsNotInDesiredStateMessage\n        }\n\n        $this.WriteLogUtil('Verbose', $messageToUse, @($this.DscResourceName))\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VIObject is of the specified type.\n    #>\n    [bool] IsVIObjectOfTheCorrectType($viObject, $typeAsString) {\n        $result = $false\n        $viObjectType = $viObject.GetType()\n\n        if ($viObjectType.FullName -eq $typeAsString) {\n            $result = $true\n        }\n        elseif (($viObjectType.GetInterfaces().FullName -eq $typeAsString).Length -gt 0) {\n            $result = $true\n        }\n        else {\n            $baseType = $viObjectType.BaseType\n\n            while ($null -ne $baseType) {\n                if ($baseType.FullName -eq $typeAsString) {\n                    $result = $true\n                    break\n                }\n\n                $baseType = $baseType.BaseType\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Connects to the specified vSphere Server with the passed Credentials.\n    The method sets the Connection property to the established connection.\n    If connection cannot be established, the method throws an exception.\n    #>\n    [void] ConnectVIServer() {\n        $this.ImportRequiredModules()\n\n        if ($null -eq $this.Connection) {\n            try {\n                $connectVIServerParams = @{\n                    Server = $this.Server\n                    Credential = $this.Credential\n                    ErrorAction = 'Stop'\n                    Verbose = $false\n                }\n\n                $this.Connection = Connect-VIServer @connectVIServerParams\n            }\n            catch {\n                throw ($this.CouldNotEstablishvSphereConnectionMessage -f $this.Server, $_.Exception.Message)\n            }\n        } else {\n            # this is a connection from a vSphereDSC node\n            # a new connection with the same session and server name get created because of an issue with runspaces in PowerShell\n\n            $this.Connection = Connect-VIServer -Session $this.Connection.SessionSecret -Server $this.Connection.Name\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Closes the last open connection to the specified vSphere Server.\n    #>\n    [void] DisconnectVIServer() {\n        if ($null -eq $this.Connection) {\n            return\n        }\n\n        try {\n            $disconnectVIServerParams = @{\n                Server = $this.Connection\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            Disconnect-VIServer @disconnectVIServerParams\n        }\n        catch {\n            throw ($this.CouldNotClosevSphereConnectionMessage -f $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Logs a message to the correct information stream and to a property.\n    #>\n    [void] WriteLogUtil($logType, $message, $arguments) {\n        $writeLogSplat = @{\n            Message = $message\n        }\n\n        # this variable will be added to the logs hashtable\n        $logMessage = $message\n\n        if ($null -ne $arguments) {\n            $writeLogSplat['Arguments'] = $arguments\n\n            $logMessage = [string]::Format($Message, $Arguments)\n        }\n\n        # write to warning or verbose stream\n        if ($logType -eq 'Verbose') {\n            Write-VerboseLog @writeLogSplat\n        } elseif ($logType -eq 'Warning') {\n            Write-WarningLog @writeLogSplat\n        }\n\n        if ($null -eq $this.Logs) {\n            return\n        }\n\n        $this.Logs.Value.Add([PsObject]@{\n            Type = $logType\n            Message = $logMessage\n        }) | Out-Null\n    }\n\n    [void] WriteLogUtil($logType, $message) {\n        $this.WriteLogUtil($logType, $message, $null)\n    }\n}\n\nclass BaseDSC : BasevSphereConnection {\n    <#\n    .DESCRIPTION\n\n    Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi.\n    #>\n    [DscProperty()]\n    [string] $Server\n}\n\nclass DatacenterInventoryBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the Inventory Item located in the Datacenter specified in 'DatacenterName' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Location of the Inventory Item with name specified in 'Name' key property in\n    the Datacenter specified in the 'DatacenterName' key property.\n    Location consists of 0 or more Inventory Items.\n    Empty Location means that the Inventory Item is in the Root Folder of the Datacenter ('Vm', 'Host', 'Network' or 'Datastore' based on the Inventory Item).\n    The Root Folders of the Datacenter are not part of the Location.\n    Inventory Item names in Location are separated by \"/\".\n    Example Location for a VM Inventory Item: \"Discovered Virtual Machines/My Ubuntu VMs\".\n    #>\n    [DscProperty(Key)]\n    [string] $Location\n\n    <#\n    .DESCRIPTION\n\n    Name of the Datacenter we will use from the specified Inventory.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterName\n\n    <#\n    .DESCRIPTION\n\n    Location of the Datacenter we will use from the Inventory.\n    Root Folder of the Inventory is not part of the Location.\n    Empty Location means that the Datacenter is in the Root Folder of the Inventory.\n    Folder names in Location are separated by \"/\".\n    Example Location: \"MyDatacentersFolder\".\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterLocation\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Inventory Item should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Type of Folder in which the Inventory Item is located.\n    Possible values are VM, Network, Datastore, Host.\n    #>\n    hidden [FolderType] $InventoryItemFolderType\n\n    <#\n    .DESCRIPTION\n\n    Ensures the correct behaviour when the Location is not valid based on the passed Ensure value.\n    If Ensure is set to 'Present' and the Location is not valid, the method should throw with the passed error message.\n    Otherwise Ensure is set to 'Absent' and $null result is returned because with invalid Location, the Inventory Item is 'Absent'\n    from that Location and no error should be thrown.\n    #>\n    [PSObject] EnsureCorrectBehaviourForInvalidLocation($expression) {\n        if ($this.Ensure -eq [Ensure]::Present) {\n            throw $expression\n        }\n\n        return $null\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Datacenter we will use from the Inventory.\n    #>\n    [PSObject] GetDatacenter() {\n        $rootFolderAsViewObject = Get-View -Server $this.Connection -Id $this.Connection.ExtensionData.Content.RootFolder\n        $rootFolder = Get-Inventory -Server $this.Connection -Id $rootFolderAsViewObject.MoRef\n\n        # Special case where the Location does not contain any folders.\n        if ($this.DatacenterLocation -eq [string]::Empty) {\n            $foundDatacenter = Get-Datacenter -Server $this.Connection -Name $this.DatacenterName -Location $rootFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $rootFolder.Id }\n            if ($null -eq $foundDatacenter) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) was not found at $($rootFolder.Name).\")\n            }\n\n            return $foundDatacenter\n        }\n\n        # Special case where the Location is just one folder.\n        if ($this.DatacenterLocation -NotMatch '/') {\n            $foundLocation = Get-Folder -Server $this.Connection -Name $this.DatacenterLocation -Location $rootFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $rootFolder.Id }\n            if ($null -eq $foundLocation) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Folder $($this.DatacenterLocation) was not found at $($rootFolder.Name).\")\n            }\n\n            $foundDatacenter = Get-Datacenter -Server $this.Connection -Name $this.DatacenterName -Location $foundLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $foundLocation.Id }\n            if ($null -eq $foundDatacenter) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) was not found at $($foundLocation.Name).\")\n            }\n\n            return $foundDatacenter\n        }\n\n        $locationItems = $this.DatacenterLocation -Split '/'\n        $childEntities = Get-View -Server $this.Connection -Id $rootFolder.ExtensionData.ChildEntity\n        $foundLocationItem = $null\n\n        for ($i = 0; $i -lt $locationItems.Length; $i++) {\n            $locationItem = $locationItems[$i]\n            $foundLocationItem = $childEntities | Where-Object -Property Name -eq $locationItem\n\n            if ($null -eq $foundLocationItem) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) with Location $($this.DatacenterLocation) was not found because $locationItem folder cannot be found below $($rootFolder.Name).\")\n            }\n\n            # If the found location item does not have 'ChildEntity' member, the item is a Datacenter.\n            $childEntityMember = $foundLocationItem | Get-Member -Name 'ChildEntity'\n            if ($null -eq $childEntityMember) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.DatacenterLocation) contains another Datacenter $locationItem.\")\n            }\n\n            <#\n            If the found location item is a Folder we check how many Child Entities the folder has:\n            If the Folder has zero Child Entities and the Folder is not the last location item, the Location is not valid.\n            Otherwise we start looking in the items of this Folder.\n            #>\n            if ($foundLocationItem.ChildEntity.Length -eq 0) {\n                if ($i -ne $locationItems.Length - 1) {\n                    return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.DatacenterLocation) is not valid because Folder $locationItem does not have Child Entities and the Location $($this.DatacenterLocation) contains other Inventory Items.\")\n                }\n            }\n            else {\n                $childEntities = Get-View -Server $this.Connection -Id $foundLocationItem.ChildEntity\n            }\n        }\n\n        $foundLocation = Get-Inventory -Server $this.Connection -Id $foundLocationItem.MoRef\n        $foundDatacenter = Get-Datacenter -Server $this.Connection -Name $this.DatacenterName -Location $foundLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $foundLocation.Id }\n\n        if ($null -eq $foundDatacenter) {\n            return $this.EnsureCorrectBehaviourForInvalidLocation(\"Datacenter $($this.DatacenterName) with Location $($this.DatacenterLocation) was not found.\")\n        }\n\n        return $foundDatacenter\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Location of the Inventory Item from the specified Datacenter.\n    #>\n    [PSObject] GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName) {\n        <#\n        Here if the Ensure property is set to 'Absent', we do not need to check if the Location is valid\n        because the Datacenter does not exist and this means that the Inventory Item does not exist in the specified Datacenter.\n        #>\n        if ($null -eq $datacenter -and $this.Ensure -eq [Ensure]::Absent) {\n            return $null\n        }\n\n        $validInventoryItemLocation = $null\n        $datacenterFolderAsViewObject = Get-View -Server $this.Connection -Id $datacenter.ExtensionData.$datacenterFolderName\n        $datacenterFolder = Get-Inventory -Server $this.Connection -Id $datacenterFolderAsViewObject.MoRef\n\n        # Special case where the Location does not contain any Inventory Items.\n        if ($this.Location -eq [string]::Empty) {\n            return $datacenterFolder\n        }\n\n        # Special case where the Location is just one Inventory Item.\n        if ($this.Location -NotMatch '/') {\n            $validInventoryItemLocation = Get-Inventory -Server $this.Connection -Name $this.Location -Location $datacenterFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $datacenterFolder.Id }\n\n            if ($null -eq $validInventoryItemLocation) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Location $($this.Location) of Inventory Item $($this.Name) was not found in Folder $($datacenterFolder.Name).\")\n            }\n\n            return $validInventoryItemLocation\n        }\n\n        $locationItems = $this.Location -Split '/'\n\n        # Reverses the location items so that we can start from the bottom and go to the top of the Inventory.\n        [array]::Reverse($locationItems)\n\n        $datacenterInventoryItemLocationName = $locationItems[0]\n        $foundLocations = Get-Inventory -Server $this.Connection -Name $datacenterInventoryItemLocationName -Location $datacenterFolder -ErrorAction SilentlyContinue\n\n        # Removes the Name of the Inventory Item Location from the location items array as we already retrieved it.\n        $locationItems = $locationItems[1..($locationItems.Length - 1)]\n\n        <#\n        For every found Inventory Item Location in the Datacenter with the specified name we start to go up through the parents to check if the Location is valid.\n        If one of the Parents does not meet the criteria of the Location, we continue with the next found Location.\n        If we find a valid Location we stop iterating through the Locations and return it.\n        #>\n        foreach ($foundLocation in $foundLocations) {\n            $foundLocationAsViewObject = Get-View -Server $this.Connection -Id $foundLocation.Id -Property Parent\n            $validLocation = $true\n\n            foreach ($locationItem in $locationItems) {\n                $foundLocationAsViewObject = Get-View -Server $this.Connection -Id $foundLocationAsViewObject.Parent -Property Name, Parent\n                if ($foundLocationAsViewObject.Name -ne $locationItem) {\n                    $validLocation = $false\n                    break\n                }\n            }\n\n            if ($validLocation) {\n                $validInventoryItemLocation = $foundLocation\n                break\n            }\n        }\n\n        if ($null -eq $validInventoryItemLocation) {\n            return $this.EnsureCorrectBehaviourForInvalidLocation(\"Location $($this.Location) of Inventory Item $($this.Name) was not found in Datacenter $($datacenter.Name).\")\n        }\n\n        return $validInventoryItemLocation\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Inventory Item from the specified Location in the Datacenter if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetInventoryItem($inventoryItemLocationInDatacenter) {\n        return Get-Inventory -Server $this.Connection -Name $this.Name -Location $inventoryItemLocationInDatacenter -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $inventoryItemLocationInDatacenter.Id }\n    }\n}\n\nclass VMHostEntityBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the VMHost which is going to be used.\n    #>\n    [DscProperty(Key)]\n    [string] $VMHostName\n\n    <#\n    .DESCRIPTION\n\n    The VMHost which is going to be used.\n    #>\n    hidden [PSObject] $VMHost\n\n    hidden [string] $RetrieveVMHostMessage = \"Retrieving VMHost {0} from vCenter {1}.\"\n    hidden [string] $CouldNotRetrieveVMHostMessage = \"Could not retrieve VMHost {0} from vCenter {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost with the specified name from the server.\n    If the VMHost is not found, it throws an exception.\n    #>\n    [void] RetrieveVMHost() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVMHostMessage, @($this.VMHostName, $this.Connection.Name))\n\n            $getVMHostParams = @{\n                Server = $this.Connection\n                Name = $this.VMHostName\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            $this.VMHost = Get-VMHost @getVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVMHostMessage -f $this.VMHostName, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n}\n\nclass DatastoreBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    For Nfs Datastore, specifies the remote path of the Nfs mount point.\n    For Vmfs Datastore, specifies the canonical name of the Scsi logical unit that contains the Vmfs Datastore.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $Path\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Datastore should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the file system that is used on the Datastore.\n    #>\n    [DscProperty()]\n    [string] $FileSystemVersion\n\n    <#\n    .DESCRIPTION\n\n    Specifies the latency period beyond which the storage array is considered congested. The range of this value is between 10 to 100 milliseconds.\n    #>\n    [DscProperty()]\n    [nullable[int]] $CongestionThresholdMillisecond\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the IO control is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $StorageIOControlEnabled\n\n    hidden [string] $CreateDatastoreMessage = \"Creating Datastore {0} on VMHost {1}.\"\n    hidden [string] $ModifyDatastoreMessage = \"Modifying Datastore {0} on VMHost {1}.\"\n    hidden [string] $RemoveDatastoreMessage = \"Removing Datastore {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotCreateDatastoreMessage = \"Could not create Datastore {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyDatastoreMessage = \"Could not modify Datastore {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveDatastoreMessage = \"Could not remove Datastore {0} from VMHost {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore with the specified name from the VMHost if it exists.\n    #>\n    [PSObject] GetDatastore() {\n        $getDatastoreParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            VMHost = $this.VMHost\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Datastore @getDatastoreParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified Datastore should be modified.\n    #>\n    [bool] ShouldModifyDatastore($datastore) {\n        $shouldModifyDatastore = @(\n            $this.ShouldUpdateDscResourceSetting('CongestionThresholdMillisecond', $datastore.CongestionThresholdMillisecond, $this.CongestionThresholdMillisecond),\n            $this.ShouldUpdateDscResourceSetting('StorageIOControlEnabled', $datastore.StorageIOControlEnabled, $this.StorageIOControlEnabled)\n        )\n\n        return ($shouldModifyDatastore -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datastore with the specified name on the VMHost.\n    #>\n    [PSObject] NewDatastore($newDatastoreParams) {\n        $newDatastoreParams.Server = $this.Connection\n        $newDatastoreParams.Name = $this.Name\n        $newDatastoreParams.VMHost = $this.VMHost\n        $newDatastoreParams.Path = $this.Path\n        $newDatastoreParams.Confirm = $false\n        $newDatastoreParams.ErrorAction = 'Stop'\n        $newDatastoreParams.Verbose = $false\n\n        if (![string]::IsNullOrEmpty($this.FileSystemVersion)) { $newDatastoreParams.FileSystemVersion = $this.FileSystemVersion }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateDatastoreMessage, @($this.Name, $this.VMHost.Name))\n\n            $datastore = New-Datastore @newDatastoreParams\n\n            return $datastore\n        }\n        catch {\n            throw ($this.CouldNotCreateDatastoreMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the properties of the specified Datastore.\n    #>\n    [void] ModifyDatastore($datastore) {\n        $setDatastoreParams = @{\n            Server = $this.Connection\n            Datastore = $datastore\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.StorageIOControlEnabled) { $setDatastoreParams.StorageIOControlEnabled = $this.StorageIOControlEnabled }\n        if ($null -ne $this.CongestionThresholdMillisecond) { $setDatastoreParams.CongestionThresholdMillisecond = $this.CongestionThresholdMillisecond }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyDatastoreMessage, @($datastore.Name, $this.VMHost.Name))\n\n            Set-Datastore @setDatastoreParams\n        }\n        catch {\n            throw ($this.CouldNotModifyDatastoreMessage -f $datastore.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Datastore from the VMHost.\n    #>\n    [void] RemoveDatastore($datastore) {\n        $removeDatastoreParams = @{\n            Server = $this.Connection\n            Datastore = $datastore\n            VMHost = $thiS.VMHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveDatastoreMessage, @($datastore.Name, $this.VMHost.Name))\n\n            Remove-Datastore @removeDatastoreParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveDatastoreMessage -f $datastore.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $datastore) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n\n        if ($null -ne $datastore) {\n            $result.Name = $datastore.Name\n            $result.Ensure = [Ensure]::Present\n            $result.FileSystemVersion = $datastore.FileSystemVersion\n            $result.CongestionThresholdMillisecond = $datastore.CongestionThresholdMillisecond\n            $result.StorageIOControlEnabled = $datastore.StorageIOControlEnabled\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.FileSystemVersion = $this.FileSystemVersion\n            $result.CongestionThresholdMillisecond = $this.CongestionThresholdMillisecond\n            $result.StorageIOControlEnabled = $this.StorageIOControlEnabled\n        }\n    }\n}\n\nclass VMHostBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VMHost to configure.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    hidden [string] $CouldNotRetrieveVMHostMessage = \"Could not retrieve VMHost {0} on Server {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost with the specified name from the specified Server.\n    If the VMHost is not found, the method throws an exception.\n    #>\n    [PSObject] GetVMHost() {\n        try {\n            $getVMHostParams = @{\n                Server = $this.Connection\n                Name = $this.Name\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VMHost @getVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVMHostMessage -f $this.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n}\n\nclass EsxCliBaseDSC : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The PowerCLI EsxCli version 2 interface to ESXCLI.\n    #>\n    hidden [PSObject] $EsxCli\n\n    <#\n    .DESCRIPTION\n\n    The EsxCli command for the DSC Resource that inherits the base class.\n    For the DCUI Keyboard DSC Resource the command is the following: 'system.settings.keyboard.layout'.\n    #>\n    hidden [string] $EsxCliCommand\n\n    <#\n    .DESCRIPTION\n\n    The name of the DSC Resource that inherits the base class.\n    #>\n    hidden [string] $DscResourceName = $this.GetType().Name\n\n    hidden [string] $EsxCliAddMethodName = 'add'\n    hidden [string] $EsxCliSetMethodName = 'set'\n    hidden [string] $EsxCliRemoveMethodName = 'remove'\n    hidden [string] $EsxCliGetMethodName = 'get'\n    hidden [string] $EsxCliListMethodName = 'list'\n\n    hidden [string] $CouldNotRetrieveEsxCliInterfaceMessage = \"Could not retrieve EsxCli interface for VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotCreateMethodArgumentsMessage = \"Could not create arguments for {0} method. For more information: {1}\"\n    hidden [string] $EsxCliCommandFailedMessage = \"EsxCli command {0} failed to execute successfully. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the EsxCli version 2 interface to ESXCLI for the specified VMHost.\n    #>\n    [void] GetEsxCli($vmHost) {\n        try {\n            $this.EsxCli = Get-EsxCli -Server $this.Connection -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotRetrieveEsxCliInterfaceMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Executes the specified method for modification - 'set', 'add' or 'remove' of the specified EsxCli command.\n    #>\n    [void] ExecuteEsxCliModifyMethod($methodName, $methodArguments) {\n        $esxCliCommandMethod = \"$($this.EsxCliCommand).$methodName.\"\n        $esxCliMethodArgs = $null\n\n        try {\n            $esxCliMethodArgs = Invoke-Expression -Command (\"`$this.EsxCli.\" + $esxCliCommandMethod + 'CreateArgs()') -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotCreateMethodArgumentsMessage -f $methodName, $_.Exception.Message)\n        }\n\n        # Skips the properties that are defined in the base classes of the Dsc Resource because they are not arguments of the EsxCli command.\n        $dscResourceNamesOfProperties = $this.GetType().GetProperties() |\n                                        Where-Object -FilterScript { $_.DeclaringType.Name -eq $this.DscResourceName } |\n                                        Select-Object -ExpandProperty Name\n\n        # A separate array of keys is needed because collections cannot be modified while being enumerated.\n        $commandArgs = @()\n        $commandArgs = $commandArgs + $esxCliMethodArgs.Keys\n        foreach ($key in $commandArgs) {\n            # The argument of the method is present in the method arguments hashtable and should be used instead of the property of the Dsc Resource.\n            if ($methodArguments.Count -gt 0 -and $null -ne $methodArguments.$key) {\n                $esxCliMethodArgs.$key = $methodArguments.$key\n            }\n            else {\n                # The name of the property of the Dsc Resource starts with a capital letter whereas the key of the argument contains only lower case letters.\n                $dscResourcePropertyName = $dscResourceNamesOfProperties | Where-Object -FilterScript { $_.ToLower() -eq $key.ToLower() }\n\n                # Not all properties of the Dsc Resource are part of the arguments hashtable.\n                if ($null -ne $dscResourcePropertyName) {\n                    if ($this.$dscResourcePropertyName -is [string]) {\n                        if (![string]::IsNullOrEmpty($this.$dscResourcePropertyName)) { $esxCliMethodArgs.$key = $this.$dscResourcePropertyName }\n                    }\n                    elseif ($this.$dscResourcePropertyName -is [array]) {\n                        if ($null -ne $this.$dscResourcePropertyName -and $this.$dscResourcePropertyName.Length -gt 0) { $esxCliMethodArgs.$key = $this.$dscResourcePropertyName }\n                    }\n                    else {\n                        if ($null -ne $this.$dscResourcePropertyName) { $esxCliMethodArgs.$key = $this.$dscResourcePropertyName }\n                    }\n                }\n            }\n        }\n\n        try {\n            Invoke-EsxCliCommandMethod -EsxCli $this.EsxCli -EsxCliCommandMethod ($esxCliCommandMethod + 'Invoke({0})') -EsxCliCommandMethodArguments $esxCliMethodArgs\n        }\n        catch {\n            throw ($this.EsxCliCommandFailedMessage -f ('esxcli.' + $this.EsxCliCommand), $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Executes the specified method for modification - 'set', 'add' or 'remove' of the specified EsxCli command.\n    #>\n    [void] ExecuteEsxCliModifyMethod($methodName) {\n        $this.ExecuteEsxCliModifyMethod($methodName, @{})\n    }\n\n    <#\n    .DESCRIPTION\n\n    Executes the specified retrieval method - 'get' or 'list' of the specified EsxCli command.\n    #>\n    [PSObject] ExecuteEsxCliRetrievalMethod($methodName) {\n        $esxCliCommandMethod = '$this.EsxCli.' + \"$($this.EsxCliCommand).$methodName.\"\n\n        try {\n            $esxCliCommandMethodResult = Invoke-Expression -Command ($esxCliCommandMethod + 'Invoke()') -ErrorAction Stop -Verbose:$false\n            return $esxCliCommandMethodResult\n        }\n        catch {\n            throw ($this.EsxCliCommandFailedMessage -f ('esxcli.' + $this.EsxCliCommand), $_.Exception.Message)\n        }\n    }\n}\n\nclass InventoryBaseDSC : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the Inventory Item (Folder or Datacenter) located in the Folder specified in 'Location' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Location of the Inventory Item (Folder or Datacenter) we will use from the Inventory.\n    Root Folder of the Inventory is not part of the Location.\n    Empty Location means that the Inventory Item (Folder or Datacenter) is in the Root Folder of the Inventory.\n    Folder names in Location are separated by \"/\".\n    Example Location: \"MyDatacenters\".\n    #>\n    [DscProperty(Key)]\n    [string] $Location\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Inventory Item (Folder or Datacenter) should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Ensures the correct behaviour when the Location is not valid based on the passed Ensure value.\n    If Ensure is set to 'Present' and the Location is not valid, the method should throw with the passed error message.\n    Otherwise Ensure is set to 'Absent' and $null result is returned because with invalid Location, the Inventory Item is 'Absent'\n    from that Location and no error should be thrown.\n    #>\n    [PSObject] EnsureCorrectBehaviourForInvalidLocation($expression) {\n        if ($this.Ensure -eq [Ensure]::Present) {\n            throw $expression\n        }\n\n        return $null\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Location of the Inventory Item (Folder or Datacenter) from the specified Inventory.\n    #>\n    [PSObject] GetInventoryItemLocation() {\n        $rootFolderAsViewObject = Get-View -Server $this.Connection -Id $this.Connection.ExtensionData.Content.RootFolder\n        $rootFolder = Get-Inventory -Server $this.Connection -Id $rootFolderAsViewObject.MoRef\n\n        # Special case where the Location does not contain any folders.\n        if ($this.Location -eq [string]::Empty) {\n            return $rootFolder\n        }\n\n        # Special case where the Location is just one folder.\n        if ($this.Location -NotMatch '/') {\n            $foundLocation = Get-Inventory -Server $this.Connection -Name $this.Location -Location $rootFolder -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $rootFolder.Id }\n            if ($null -eq $foundLocation) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Folder $($this.Location) was not found at $($rootFolder.Name).\")\n            }\n\n            return $foundLocation\n        }\n\n        $locationItems = $this.Location -Split '/'\n        $childEntities = Get-View -Server $this.Connection -Id $rootFolder.ExtensionData.ChildEntity\n        $foundLocationItem = $null\n\n        for ($i = 0; $i -lt $locationItems.Length; $i++) {\n            $locationItem = $locationItems[$i]\n            $foundLocationItem = $childEntities | Where-Object -Property Name -eq $locationItem\n\n            if ($null -eq $foundLocationItem) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"Inventory Item $($this.Name) with Location $($this.Location) was not found because $locationItem folder cannot be found below $($rootFolder.Name).\")\n            }\n\n            # If the found location item does not have 'ChildEntity' member, the item is a Datacenter.\n            $childEntityMember = $foundLocationItem | Get-Member -Name 'ChildEntity'\n            if ($null -eq $childEntityMember) {\n                return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.Location) contains Datacenter $locationItem which is not valid.\")\n            }\n\n            <#\n            If the found location item is a Folder we check how many Child Entities the folder has:\n            If the Folder has zero Child Entities and the Folder is not the last location item, the Location is not valid.\n            Otherwise we start looking in the items of this Folder.\n            #>\n            if ($foundLocationItem.ChildEntity.Length -eq 0) {\n                if ($i -ne $locationItems.Length - 1) {\n                    return $this.EnsureCorrectBehaviourForInvalidLocation(\"The Location $($this.Location) is not valid because Folder $locationItem does not have Child Entities and the Location $($this.Location) contains other Inventory Items.\")\n                }\n            }\n            else {\n                $childEntities = Get-View -Server $this.Connection -Id $foundLocationItem.ChildEntity\n            }\n        }\n\n        return Get-Inventory -Server $this.Connection -Id $foundLocationItem.MoRef\n    }\n}\n\nclass InventoryUtil {\n    InventoryUtil($viServer, $ensure) {\n        $this.VIServer = $viServer\n        $this.Ensure = $ensure\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the established connection to the vCenter Server system.\n    #>\n    [PSObject] $VIServer\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Inventory Item that is exposed through a DSC Resource that uses the 'InventoryUtil' class\n    should be present or absent. It is used to determine the behaviour of the methods in the class\n    that retrieve Inventory Items.\n    #>\n    [Ensure] $Ensure\n\n    hidden [string] $InvalidLocationMessage = \"Location {0} is not a valid location inside Folder {1}.\"\n\n    hidden [string] $CouldNotRetrieveRootFolderMessage = \"Could not retrieve Inventory Root Folder of vCenter Server {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveDatacenterRootFolderMessage = \"Could not retrieve {0} of Datacenter {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveVDSwitchMessage = \"Could not retrieve VDSwitch {0}. For more information: {1}\"\n    hidden [string] $CouldNotFindDatacenterMessage = \"Could not find Datacenter {0} located in Folder {1}.\"\n    hidden [string] $CouldNotFindFolderMessage = \"Could not find Folder {0} located in Folder {1}.\"\n    hidden [string] $CouldNotFindInventoryItemMessage = \"Could not find Inventory Item {0} located in Inventory Item {1}.\"\n    hidden [string] $CouldNotFindDatastoreClusterMessage = \"Could not find Datastore Cluster {0} located in Folder {1}.\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datacenter with the specified name, located in the specified Folder.\n    #>\n    [PSObject] GetDatacenter($datacenterName, $datacenterLocation) {\n        $datacenter = $null\n        $inventoryRootFolder = $this.GetInventoryRootFolder()\n\n        <#\n            If empty Datacenter location is passed, the Datacenter should be located\n                in the Root Folder of the Inventory.\n            If Datacenter location without '/' is passed, the Datacenter should be located\n                in the Folder specified in the Datacenter location.\n            If Datacenter location with '/' is passed, the Datacenter should be located\n                in the Folder that is lastly specified in the Datacenter location.\n        #>\n        if ($datacenterLocation -eq [string]::Empty) {\n            $datacenter = $this.GetDatacenterInFolder($datacenterName, $inventoryRootFolder)\n        }\n        elseif ($datacenterLocation -NotMatch '/') {\n            $folder = $this.GetFolder($datacenterLocation, $inventoryRootFolder)\n            $datacenter = $this.GetDatacenterInFolder($datacenterName, $folder)\n        }\n        else {\n            $folder = $null\n            $datacenterLocationItems = $datacenterLocation -Split '/'\n\n            # The array needs to be reversed so we can retrieve the Folder where the Datacenter is located.\n            [array]::Reverse($datacenterLocationItems)\n\n            $datacenterLocationName = $datacenterLocationItems[0]\n            $foundDatacenterFolderLocations = $this.GetDatacenterFoldersByName($datacenterLocationName, $inventoryRootFolder)\n\n            # The Folder where the Datacenter is located is already retrieved and it's not needed anymore.\n            $datacenterLocationItems = $datacenterLocationItems[1..($datacenterLocationItems.Length - 1)]\n\n            foreach ($foundDatacenterFolderLocation in $foundDatacenterFolderLocations) {\n                $currentDatacenterLocationItem = $foundDatacenterFolderLocation\n                $isDatacenterLocationValid = $true\n\n                foreach ($datacenterLocationItem in $datacenterLocationItems) {\n                    if ($currentDatacenterLocationItem.Parent.Name -ne $datacenterLocationItem) {\n                        $isDatacenterLocationValid = $false\n                        break\n                    }\n\n                    $currentDatacenterLocationItem = $currentDatacenterLocationItem.Parent\n                }\n\n                <#\n                    If the Datacenter location is valid, the first Datacenter location item\n                    should be located inside the Root Folder of the Inventory.\n                #>\n                if (\n                    $isDatacenterLocationValid -and\n                    $currentDatacenterLocationItem.ParentId -eq $inventoryRootFolder.Id\n                ) {\n                    $folder = $foundDatacenterFolderLocation\n                    break\n                }\n            }\n\n            if ($null -eq $folder -and $this.Ensure -eq [Ensure]::Present) {\n                throw ($this.InvalidLocationMessage -f $datacenterLocation, $inventoryRootFolder.Name)\n            }\n\n            $datacenter = $this.GetDatacenterInFolder($datacenterName, $folder)\n        }\n\n        return $datacenter\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Parent of the Inventory Item located in the specified Datacenter.\n    #>\n    [PSObject] GetInventoryItemParent($inventoryItemLocation, $datacenter, $datacenterRootFolderName) {\n        # If the Datacenter doesn't exist, the Inventory Item Parent doesn't exist as well.\n        if ($null -eq $datacenter) {\n            return $null\n        }\n\n        $inventoryItemParent = $null\n        $datacenterRootFolder = $this.GetRootFolderOfDatacenter($datacenter, $datacenterRootFolderName)\n\n        <#\n            If empty Inventory Item location is passed, the Inventory Item Parent\n                in the Root Folder of the Datacenter.\n            If Inventory Item location without '/' is passed, the Inventory Item Parent\n                is the Inventory Item specified in the Inventory Item location.\n            If Inventory Item location with '/' is passed, the Inventory Item Parent\n                is the Inventory Item that is lastly specified in the Inventory Item location.\n        #>\n        if ($inventoryItemLocation -eq [string]::Empty) {\n            $inventoryItemParent = $datacenterRootFolder\n        }\n        elseif ($inventoryItemLocation -NotMatch '/') {\n            $inventoryItemParent = $this.GetInventoryItem($inventoryItemLocation, $datacenterRootFolder)\n        }\n        else {\n            $inventoryItemLocationItems = $inventoryItemLocation -Split '/'\n\n            # The array needs to be reversed so we can retrieve the name of the Parent of the Inventory Item.\n            [array]::Reverse($inventoryItemLocationItems)\n\n            $inventoryItemParentName = $inventoryItemLocationItems[0]\n            $foundInventoryItemLocations = $this.GetInventoryItemsByName($inventoryItemParentName, $datacenterRootFolder)\n\n            # The Parent name where the Inventory Item is located is already retrieved and it's not needed anymore.\n            $inventoryItemLocationItems = $inventoryItemLocationItems[1..($inventoryItemLocationItems.Length - 1)]\n\n            foreach ($foundInventoryItemLocation in $foundInventoryItemLocations) {\n                $currentInventoryItemLocationItem = $foundInventoryItemLocation\n                $isInventoryItemLocationValid = $true\n\n                foreach ($inventoryItemLocationItem in $inventoryItemLocationItems) {\n                    if ($currentInventoryItemLocationItem.Parent.Name -ne $inventoryItemLocationItem) {\n                        $isInventoryItemLocationValid = $false\n                        break\n                    }\n\n                    $currentInventoryItemLocationItem = $currentInventoryItemLocationItem.Parent\n                }\n\n                <#\n                    If the Inventory Item location is valid, the first Inventory Item location item\n                    should be located inside the corresponding Root Folder of the Datacenter.\n                #>\n                if (\n                    $isInventoryItemLocationValid -and\n                    $currentInventoryItemLocationItem.ParentId -eq $datacenterRootFolder.Id\n                ) {\n                    $inventoryItemParent = $foundInventoryItemLocation\n                    break\n                }\n            }\n\n            if ($null -eq $inventoryItemParent -and $this.Ensure -eq [Ensure]::Present) {\n                throw ($this.InvalidLocationMessage -f $inventoryItemLocation, $datacenterRootFolder.Name)\n            }\n        }\n\n        return $inventoryItemParent\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Root Folder of the specified Inventory.\n    #>\n    [PSObject] GetInventoryRootFolder() {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Id = $this.VIServer.ExtensionData.Content.RootFolder\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            return Get-Inventory @getInventoryParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRootFolderMessage -f $this.VIServer.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the specified Root Folder of the Datacenter.\n    #>\n    [PSObject] GetRootFolderOfDatacenter($datacenter, $datacenterRootFolderName) {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Id = $datacenter.ExtensionData.$datacenterRootFolderName\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            return Get-Inventory @getInventoryParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveDatacenterRootFolderMessage -f $datacenterRootFolderName, $datacenter.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datacenter with the specified name, located in the specified Folder.\n    #>\n    [PSObject] GetDatacenterInFolder($datacenterName, $folder) {\n        $getDatacenterParams = @{\n            Server = $this.VIServer\n            Name = $datacenterName\n            Location = $folder\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentFolderId -eq $folder.Id\n            }\n        }\n\n        $datacenter = Get-Datacenter @getDatacenterParams | Where-Object @whereObjectParams\n        if ($null -eq $datacenter -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindDatacenterMessage -f $datacenterName, $folder.Name)\n        }\n\n        return $datacenter\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Folder with the specified name, located in the specified Folder.\n    #>\n    [PSObject] GetFolder($folderName, $parentFolder) {\n        $getFolderParams = @{\n            Server = $this.VIServer\n            Name = $folderName\n            Location = $parentFolder\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentId -eq $parentFolder.Id\n            }\n        }\n\n        $folder = Get-Folder @getFolderParams | Where-Object @whereObjectParams\n        if ($null -eq $folder -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindFolderMessage -f $folderName, $parentFolder.Name)\n        }\n\n        return $folder\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves all Folders with the specified name of type Datacenter,\n    located inside the specified Folder.\n    #>\n    [PSObject] GetDatacenterFoldersByName($folderName, $folderLocation) {\n        $getFolderParams = @{\n            Server = $this.VIServer\n            Name = $folderName\n            Location = $folderLocation\n            Type = 'Datacenter'\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Folder @getFolderParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves all Inventory Items with the specified name,\n    located inside the specified Inventory Item.\n    #>\n    [array] GetInventoryItemsByName($inventoryItemName, $inventoryItemLocation) {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Name = $inventoryItemName\n            Location = $inventoryItemLocation\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Inventory @getInventoryParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Inventory Item with the specified name, located in the specified Inventory Item.\n    #>\n    [PSObject] GetInventoryItem($inventoryItemName, $inventoryItemParent) {\n        $getInventoryParams = @{\n            Server = $this.VIServer\n            Name = $inventoryItemName\n            Location = $inventoryItemParent\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentId -eq $inventoryItemParent.Id\n            }\n        }\n\n        $inventoryItem = Get-Inventory @getInventoryParams | Where-Object @whereObjectParams\n        if ($null -eq $inventoryItem -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindInventoryItemMessage -f $inventoryItemName, $inventoryItemParent.Name)\n        }\n\n        return $inventoryItem\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore Cluster with the specified name located in the specified Folder.\n    #>\n    [PSObject] GetDatastoreCluster($datastoreClusterName, $folder) {\n        $getDatastoreClusterParams = @{\n            Server = $this.VIServer\n            Name = $datastoreClusterName\n            Location = $folder\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ExtensionData.Parent -eq $folder.ExtensionData.MoRef\n            }\n        }\n\n        <#\n            Multiple Datastore Clusters with the same name can be present in a Datacenter. So we need to filter\n            by the direct Parent Folder of the Datastore Cluster to retrieve the desired one.\n        #>\n        $datastoreCluster = Get-DatastoreCluster @getDatastoreClusterParams | Where-Object @whereObjectParams\n        if ($null -eq $datastoreCluster -and $this.Ensure -eq [Ensure]::Present) {\n            throw ($this.CouldNotFindDatastoreClusterMessage -f $datastoreClusterName, $folder.Name)\n        }\n\n        return $datastoreCluster\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VDSwitch with the specified name from the server if it exists.\n    If the VDSwitch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise the method throws an exception.\n    #>\n    [PSObject] GetVDSwitch($vdSwitchName) {\n        <#\n            The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n            when importing the 'VMware.VimAutomation.Vds' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        $getVDSwitchParams = @{\n            Server = $this.VIServer\n            Name = $vdSwitchName\n            Verbose = $false\n        }\n\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            $getVDSwitchParams.ErrorAction = 'SilentlyContinue'\n        }\n        else {\n            $getVDSwitchParams.ErrorAction = 'Stop'\n        }\n\n        try {\n            return Get-VDSwitch @getVDSwitchParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVDSwitchMessage -f $vdSwitchName, $_.Exception.Message)\n        }\n        finally {\n            $global:VerbosePreference = $savedVerbosePreference\n        }\n    }\n}\n\nclass VMHostRestartBaseDSC : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the time in minutes to wait for the VMHost to restart before timing out\n    and aborting the operation. The default value is 5 minutes.\n    #>\n    [DscProperty()]\n    [int] $RestartTimeoutMinutes = 5\n\n    hidden [string] $NotRespondingState = 'NotResponding'\n    hidden [string] $MaintenanceState = 'Maintenance'\n\n    hidden [string] $VMHostIsRestartedSuccessfullyMessage = \"VMHost {0} is successfully restarted and in {1} State.\"\n    hidden [string] $VMHostIsStillNotInDesiredStateMessage = \"VMHost {0} is still not in {1} State.\"\n    hidden [string] $RestartVMHostMessage = \"Restarting VMHost {0}.\"\n\n    hidden [string] $VMHostIsNotInMaintenanceModeMessage = \"The Resource update operation requires the VMHost {0} to be in a Maintenance mode.\"\n    hidden [string] $CouldNotRestartVMHostInTimeMessage = \"VMHost {0} could not be restarted successfully in {1} minutes.\"\n    hidden [string] $CouldNotRestartVMHostMessage = \"Could not restart VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost is in Maintenance mode and if not, throws an exception.\n    #>\n    [void] EnsureVMHostIsInMaintenanceMode($vmHost) {\n        if ($vmHost.ConnectionState.ToString() -ne $this.MaintenanceState) {\n            throw ($this.VMHostIsNotInMaintenanceModeMessage -f $vmHost.Name)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified VMHost is restarted successfully in the specified period of time. If the elapsed time is\n    longer than the desired time for restart, the method throws an exception.\n    #>\n    [void] EnsureRestartTimeoutIsNotReached($elapsedTimeInSeconds) {\n        $timeSpan = New-TimeSpan -Seconds $elapsedTimeInSeconds\n        if ($this.RestartTimeoutMinutes -le $timeSpan.Minutes) {\n            throw ($this.CouldNotRestartVMHostInTimeMessage -f $this.Name, $this.RestartTimeoutMinutes)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified VMHost is in a Desired State after successful restart operation.\n    #>\n    [void] EnsureVMHostIsInDesiredState($requiresVIServerConnection, $desiredState) {\n        $sleepTimeInSeconds = 10\n        $elapsedTimeInSeconds = 0\n\n        while ($true) {\n            $this.EnsureRestartTimeoutIsNotReached($elapsedTimeInSeconds)\n\n            Start-Sleep -Seconds $sleepTimeInSeconds\n            $elapsedTimeInSeconds += $sleepTimeInSeconds\n\n            try {\n                if ($requiresVIServerConnection) {\n                    $this.ConnectVIServer()\n                }\n\n                $vmHost = $this.GetVMHost()\n                if ($vmHost.ConnectionState.ToString() -eq $desiredState) {\n                    break\n                }\n\n                $this.WriteLogUtil('Verbose', $this.VMHostIsStillNotInDesiredStateMessage, @($this.Name, $desiredState))\n            }\n            catch {\n                <#\n                Here the message used in the try block is written again in the case when an exception is thrown\n                when retrieving the VMHost or establishing a Connection. This way the user still gets notified\n                that the VMHost is not in the Desired State.\n                #>\n                $this.WriteLogUtil('Verbose', $this.VMHostIsStillNotInDesiredStateMessage, @($this.Name, $desiredState))\n            }\n        }\n\n        $this.WriteLogUtil('Verbose', $this.VMHostIsRestartedSuccessfullyMessage, @($this.Name, $desiredState))\n    }\n\n    <#\n    .DESCRIPTION\n\n    Restarts the specified VMHost so that the update of the VMHost Configuration is successful.\n    #>\n    [void] RestartVMHost($vmHost) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RestartVMHostMessage, @($vmHost.Name))\n\n            $restartVMHostParams = @{\n                Server = $this.Connection\n                VMHost = $vmHost\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            Restart-VMHost @restartVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRestartVMHostMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n\n        <#\n        If the Connection is directly to a vCenter we do not need to establish a new connection so we pass $false\n        to the method 'EnsureVMHostIsInCorrectState'. When the Connection is directly to an ESXi, after a successful\n        restart the ESXi is down so new Connection needs to be established to check the ESXi state. So we pass $true\n        to the method 'EnsureVMHostIsInCorrectState'. We also need to set the variable holding the current Connection\n        to $null, so a new Connection can be established via the ConnectVIServer().\n        #>\n        if ($this.Connection.ProductLine -eq $this.vCenterProductId) {\n            $this.EnsureVMHostIsInDesiredState($false, $this.NotRespondingState)\n            $this.EnsureVMHostIsInDesiredState($false, $this.MaintenanceState)\n        }\n        else {\n            $this.Connection = $null\n            $this.EnsureVMHostIsInDesiredState($true, $this.MaintenanceState)\n        }\n    }\n}\n\nclass VMHostGraphicsBaseDSC : VMHostRestartBaseDSC {\n    hidden [string] $CouldNotRetrieveGraphicsManagerMessage = \"Could not retrieve the Graphics Manager of VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Graphics Manager of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostGraphicsManager($vmHost) {\n        try {\n            $vmHostGraphicsManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.GraphicsManager -ErrorAction Stop\n            return $vmHostGraphicsManager\n        }\n        catch {\n            throw ($this.CouldNotRetrieveGraphicsManagerMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    The enum value passed in the Configuration should be converted to string value by the following criteria:\n    Shared => shared; SharedDevice => sharedDevice\n    #>\n    [string] ConvertEnumValueToServerValue($enumValue) {\n        return $enumValue.ToString().Substring(0, 1).ToLower() + $enumValue.ToString().Substring(1)\n    }\n}\n\nclass VMHostIScsiHbaBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the CHAP (Challenge Handshake Authentication Protocol).\n    #>\n    [DscProperty()]\n    [ChapType] $ChapType = [ChapType]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the CHAP authentication name.\n    #>\n    [DscProperty()]\n    [string] $ChapName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the CHAP authentication password.\n    #>\n    [DscProperty()]\n    [string] $ChapPassword\n\n    <#\n    .DESCRIPTION\n\n    Indicates that Mutual CHAP is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MutualChapEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Mutual CHAP authentication name.\n    #>\n    [DscProperty()]\n    [string] $MutualChapName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Mutual CHAP authentication password.\n    #>\n    [DscProperty()]\n    [string] $MutualChapPassword\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to change the password for CHAP, Mutual CHAP or both. When the property is not specified or its value is $false, it is ignored.\n    If the property is $true the passwords for CHAP and Mutual CHAP are changed to their desired values.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $IScsiDeviceType = 'iSCSI'\n\n    hidden [string] $CouldNotRetrieveIScsiHbaMessage = \"Could not retrieve iSCSI Host Bus Adapter {0} from VMHost {1}. For more information: {2}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the iSCSI Host Bus Adapter with the specified name from the specified VMHost if it exists.\n    #>\n    [PSObject] GetIScsiHba($iScsiHbaName) {\n        try {\n            $iScsiHba = Get-VMHostHba -Server $this.Connection -VMHost $this.VMHost -Device $iScsiHbaName -Type $this.IScsiDeviceType -ErrorAction Stop -Verbose:$false\n            return $iScsiHba\n        }\n        catch {\n            throw ($this.CouldNotRetrieveIScsiHbaMessage -f $iScsiHbaName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the CHAP settings should be modified based on the current authentication properties.\n    #>\n    [bool] ShouldModifyCHAPSettings($authenticationProperties, $inheritChap, $inheritMutualChap) {\n        $shouldModifyCHAPSettings = @(\n            $this.ShouldUpdateDscResourceSetting('InheritChap', $authenticationProperties.ChapInherited, $inheritChap),\n            $this.ShouldUpdateDscResourceSetting('ChapType', [string] $authenticationProperties.ChapType, $this.ChapType.ToString()),\n            $this.ShouldUpdateDscResourceSetting('InheritMutualChap', $authenticationProperties.MutualChapInherited, $inheritMutualChap),\n            $this.ShouldUpdateDscResourceSetting('MutualChapEnabled', $authenticationProperties.MutualChapEnabled, $this.MutualChapEnabled),\n            $this.ShouldUpdateDscResourceSetting('Force', $false, $this.Force)\n        )\n\n        # CHAP and Mutual CHAP names should be ignored when determining the Desired State when CHAP type is 'Prohibited'.\n        if ($this.ChapType -ne [ChapType]::Prohibited) {\n            $shouldModifyCHAPSettings += $this.ShouldUpdateDscResourceSetting(\n                'ChapName',\n                [string] $authenticationProperties.ChapName,\n                $this.ChapName\n            )\n            $shouldModifyCHAPSettings += $this.ShouldUpdateDscResourceSetting(\n                'MutualChapName',\n                [string] $authenticationProperties.MutualChapName,\n                $this.MutualChapName\n            )\n        }\n\n        return ($shouldModifyCHAPSettings -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the CHAP settings should be modified based on the current authentication properties.\n    #>\n    [bool] ShouldModifyCHAPSettings($authenticationProperties) {\n        return $this.ShouldModifyCHAPSettings($authenticationProperties, $null, $null)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the cmdlet parameters with the CHAP settings based on the following criteria:\n    1. CHAP settings can only be passed to the cmdlet if the 'InheritChap' option is not passed or it is passed with a '$false' value.\n    2. Mutual CHAP settings can only be passed to the cmdlet if the 'InheritMutualChap' option is not passed or it is passed with a '$false' value.\n    3. CHAP name and CHAP password can be passed to the cmdlet if the CHAP type is not 'Prohibited'.\n    4. Mutual CHAP settings can only be passed to the cmdlet if the CHAP type is 'Required'.\n    5. Mutual CHAP name and Mutual CHAP password can be passed to the cmdlet if Mutual CHAP enabled is not passed\n       or if it is passed with a '$true' value.\n    #>\n    [void] PopulateCmdletParametersWithCHAPSettings($cmdletParams, $inheritChap, $inheritMutualChap) {\n        if ($null -ne $inheritChap -and $inheritChap) {\n            $cmdletParams.InheritChap = $inheritChap\n        }\n        else {\n            # When 'InheritChap' is $false, it can be passed to the cmdlet only if CHAP type is not 'Prohibited'.\n            if ($null -ne $inheritChap -and $this.ChapType -ne [ChapType]::Prohibited) { $cmdletParams.InheritChap = $inheritChap }\n            if ($this.ChapType -ne [ChapType]::Unset) { $cmdletParams.ChapType = $this.ChapType.ToString() }\n\n            if ($this.ChapType -ne [ChapType]::Prohibited) {\n                if (![string]::IsNullOrEmpty($this.ChapName)) { $cmdletParams.ChapName = $this.ChapName }\n                if (![string]::IsNullOrEmpty($this.ChapPassword)) { $cmdletParams.ChapPassword = $this.ChapPassword }\n            }\n        }\n\n        if ($null -ne $inheritMutualChap -and $inheritMutualChap) {\n            $cmdletParams.InheritMutualChap = $inheritMutualChap\n        }\n        else {\n            # When 'InheritMutualChap' is $false, it can be passed to the cmdlet only if CHAP type is not 'Prohibited'.\n            if ($null -ne $inheritMutualChap -and $this.ChapType -ne [ChapType]::Prohibited) { $cmdletParams.InheritMutualChap = $inheritMutualChap }\n\n            if ($this.ChapType -eq [ChapType]::Required) {\n                if ($null -ne $this.MutualChapEnabled) { $cmdletParams.MutualChapEnabled = $this.MutualChapEnabled }\n\n                if ($null -eq $this.MutualChapEnabled -or $this.MutualChapEnabled) {\n                    if (![string]::IsNullOrEmpty($this.MutualChapName)) { $cmdletParams.MutualChapName = $this.MutualChapName }\n                    if (![string]::IsNullOrEmpty($this.MutualChapPassword)) { $cmdletParams.MutualChapPassword = $this.MutualChapPassword }\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the cmdlet parameters with the CHAP settings.\n    #>\n    [void] PopulateCmdletParametersWithCHAPSettings($cmdletParams) {\n        $this.PopulateCmdletParametersWithCHAPSettings($cmdletParams, $null, $null)\n    }\n}\n\nclass VMHostNetworkBaseDSC : VMHostBaseDSC {\n    hidden [PSObject] $VMHostNetworkSystem\n\n    hidden [string] $CouldNotRetrieveNetworkSystemMessage = \"Could not retrieve the Network System of VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Network System from the specified VMHost.\n    #>\n    [void] GetNetworkSystem($vmHost) {\n        try {\n            $this.VMHostNetworkSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.NetworkSystem -ErrorAction Stop\n        }\n        catch {\n            throw ($this.CouldNotRetrieveNetworkSystemMessage -f $this.Name, $_.Exception.Message)\n        }\n    }\n}\n\nclass VMHostNetworkMigrationBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Physical Network Adapters that should be part of the vSphere Distributed/Standard Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $PhysicalNicNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the VMKernel Network Adapters that should be part of the vSphere Distributed/Standard Switch.\n    #>\n    [DscProperty()]\n    [string[]] $VMKernelNicNames\n\n    hidden [string] $RetrievePhysicalNicMessage = \"Retrieving Physical Network Adapter {0} from VMHost {1}.\"\n    hidden [string] $RetrieveVMKernelNicMessage = \"Retrieving VMKernel Network Adapter {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotFindPhysicalNicMessage = \"Physical Network Adapter {0} was not found on VMHost {1} and will be ignored.\"\n    hidden [string] $CouldNotFindVMKernelNicMessage = \"VMKernel Network Adapter {0} was not found on VMHost {1}.\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Physical Network Adapters with the specified names from the server if they exist.\n    For every Physical Network Adapter that does not exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetPhysicalNetworkAdapters() {\n        $physicalNetworkAdapters = @()\n\n        foreach ($physicalNetworkAdapterName in $this.PhysicalNicNames) {\n            $this.WriteLogUtil('Verbose', $this.RetrievePhysicalNicMessage, @($physicalNetworkAdapterName, $this.VMHost.Name))\n\n            $getVMHostNetworkAdapterParams = @{\n                Server = $this.Connection\n                Name = $physicalNetworkAdapterName\n                VMHost = $this.VMHost\n                Physical = $true\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $physicalNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n            if ($null -eq $physicalNetworkAdapter) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindPhysicalNicMessage, @($physicalNetworkAdapterName, $this.VMHost.Name))\n            }\n            else {\n                $physicalNetworkAdapters += $physicalNetworkAdapter\n            }\n        }\n\n        return $physicalNetworkAdapters\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel Network Adapters with the specified names from the server if they exist.\n    If one of the passed VMKernel Network Adapters does not exist, an exception is thrown.\n    #>\n    [array] GetVMKernelNetworkAdapters() {\n        $vmKernelNetworkAdapters = @()\n\n        foreach ($vmKernelNetworkAdapterName in $this.VMKernelNicNames) {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVMKernelNicMessage, @($vmKernelNetworkAdapterName, $this.VMHost.Name))\n\n            $getVMHostNetworkAdapterParams = @{\n                Server = $this.Connection\n                Name = $vmKernelNetworkAdapterName\n                VMHost = $this.VMHost\n                VMKernel = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            try {\n                $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n                $vmKernelNetworkAdapters += $vmKernelNetworkAdapter\n            }\n            catch {\n                <#\n                Here 'throw' should be used instead of 'Write-WarningLog' because if we ignore one VMKernel Network Adapter that is invalid, the mapping between VMKernel\n                Network Adapters and Port Groups will not work: The first Adapter should be attached to the first Port Group,\n                the second Adapter should be attached to the second Port Group, and so on.\n                #>\n                throw ($this.CouldNotFindVMKernelNicMessage -f $vmKernelNetworkAdapterName, $this.VMHost.Name)\n            }\n        }\n\n        return $vmKernelNetworkAdapters\n    }\n}\n\nclass VMHostNicBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Port Group to which the VMKernel Network Adapter should be connected. If a Distributed Switch is passed, an existing Port Group name should be specified.\n    For Standard Virtual Switches, if the Port Group is non-existent, a new Port Group with the specified name will be created and the VMKernel Network Adapter will be connected to it.\n    #>\n    [DscProperty(Key)]\n    [string] $PortGroupName\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VMKernel Network Adapter should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the VMKernel Network Adapter uses a Dhcp server.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Dhcp\n\n    <#\n    .DESCRIPTION\n\n    Specifies an IP address for the VMKernel Network Adapter. All IP addresses are specified using IPv4 dot notation. If IP is not specified, DHCP mode is enabled.\n    #>\n    [DscProperty()]\n    [string] $IP\n\n    <#\n    .DESCRIPTION\n\n    Specifies a Subnet Mask for the VMKernel Network Adapter.\n    #>\n    [DscProperty()]\n    [string] $SubnetMask\n\n    <#\n    .DESCRIPTION\n\n    Specifies a media access control (MAC) address for the VMKernel Network Adapter.\n    #>\n    [DscProperty()]\n    [string] $Mac\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the IPv6 address is obtained through a router advertisement.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AutomaticIPv6\n\n    <#\n    .DESCRIPTION\n\n    Specifies multiple static addresses using the following format: <IPv6>/<subnet_prefix_length> or <IPv6>. If you skip <subnet_prefix_length>, the default value of 64 is used.\n    #>\n    [DscProperty()]\n    [string[]] $IPv6\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the IPv6 address is obtained through DHCP.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IPv6ThroughDhcp\n\n    <#\n    .DESCRIPTION\n\n    Specifies the MTU size.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Mtu\n\n    <#\n    .DESCRIPTION\n\n    Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables all IPv6-related parameters.\n    If the value is $true, you need to provide values for at least one of the IPv6 parameters.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IPv6Enabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that you want to enable the VMKernel Network Adapter for management traffic.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ManagementTrafficEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the VMKernel Network Adapter is enabled for Fault Tolerance (FT) logging.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $FaultToleranceLoggingEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that you want to use the VMKernel Network Adapter for VMotion.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $VMotionEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that Virtual SAN traffic is enabled on this VMKernel Network Adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $VsanTrafficEnabled\n\n    hidden [string] $CouldNotCreateVMKernelNicMessage = \"Cannot create VMKernel Network Adapter connected to Virtual Switch {0} and Port Group {1}. For more information: {2}\"\n    hidden [string] $CouldNotUpdateVMKernelNicMessage = \"Cannot update VMKernel Network Adapter {0}. For more information: {1}\"\n    hidden [string] $CouldNotRemoveVMKernelNicMessage = \"Cannot remove VMKernel Network Adapter {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel Network Adapter connected to the specified Port Group and Virtual Switch and available on the specified VMHost from the server\n    if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetVMHostNetworkAdapter($virtualSwitch) {\n        if ($null -eq $virtualSwitch) {\n            <#\n            If the Virtual Switch is $null, it means that Ensure was set to 'Absent' and\n            the VMKernel Network Adapter does not exist for the specified Virtual Switch.\n            #>\n            return $null\n        }\n\n        return Get-VMHostNetworkAdapter -Server $this.Connection -PortGroup $this.PortGroupName -VirtualSwitch $virtualSwitch -VMHost $this.VMHost -VMKernel -ErrorAction SilentlyContinue\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed VMKernel Network Adapter IPv6 array needs to be updated.\n    #>\n    [bool] ShouldUpdateIPv6($ipv6) {\n        $currentIPv6 = @()\n        foreach ($ip in $ipv6) {\n            <#\n            The IPs on the server are of type 'IPv6Address' so they need to be converted to\n            string before being passed to ShouldUpdateArraySetting method.\n            #>\n            $currentIPv6 += $ip.ToString()\n        }\n\n        <#\n        The default IPv6 array contains one element, so when empty array is passed no update\n        should be performed.\n        #>\n        if ($null -ne $this.IPv6 -and ($this.IPv6.Length -eq 0 -and $currentIPv6.Length -eq 1)) {\n            return $false\n        }\n\n        return $this.ShouldUpdateArraySetting('IPv6', $currentIPv6, $this.IPv6)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed VMKernel Network Adapter needs be updated based on the specified properties.\n    #>\n    [bool] ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter) {\n        $shouldUpdateVMHostNetworkAdapter = @(\n            $this.ShouldUpdateDscResourceSetting('IP', [string] $vmHostNetworkAdapter.IP, $this.IP),\n            $this.ShouldUpdateDscResourceSetting('SubnetMask', [string] $vmHostNetworkAdapter.SubnetMask, $this.SubnetMask),\n            $this.ShouldUpdateDscResourceSetting('Mac', [string] $vmHostNetworkAdapter.Mac, $this.Mac),\n            $this.ShouldUpdateDscResourceSetting('Dhcp', $vmHostNetworkAdapter.DhcpEnabled, $this.Dhcp),\n            $this.ShouldUpdateDscResourceSetting('AutomaticIPv6', $vmHostNetworkAdapter.AutomaticIPv6, $this.AutomaticIPv6),\n            $this.ShouldUpdateIPv6($vmHostNetworkAdapter.IPv6),\n            $this.ShouldUpdateDscResourceSetting('IPv6ThroughDhcp', $vmHostNetworkAdapter.IPv6ThroughDhcp, $this.IPv6ThroughDhcp),\n            $this.ShouldUpdateDscResourceSetting('Mtu', $vmHostNetworkAdapter.Mtu, $this.Mtu),\n            $this.ShouldUpdateDscResourceSetting('IPv6Enabled', $vmHostNetworkAdapter.IPv6Enabled, $this.IPv6Enabled),\n            $this.ShouldUpdateDscResourceSetting('ManagementTrafficEnabled', $vmHostNetworkAdapter.ManagementTrafficEnabled, $this.ManagementTrafficEnabled),\n            $this.ShouldUpdateDscResourceSetting('FaultToleranceLoggingEnabled', $vmHostNetworkAdapter.FaultToleranceLoggingEnabled, $this.FaultToleranceLoggingEnabled),\n            $this.ShouldUpdateDscResourceSetting('VMotionEnabled', $vmHostNetworkAdapter.VMotionEnabled, $this.VMotionEnabled),\n            $this.ShouldUpdateDscResourceSetting('VsanTrafficEnabled', $vmHostNetworkAdapter.VsanTrafficEnabled, $this.VsanTrafficEnabled)\n        )\n\n        return ($shouldUpdateVMHostNetworkAdapter -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated VMKernel Network Adapter parameters.\n    #>\n    [hashtable] GetVMHostNetworkAdapterParams() {\n        $vmHostNetworkAdapterParams = @{}\n\n        $vmHostNetworkAdapterParams.Confirm = $false\n        $vmHostNetworkAdapterParams.ErrorAction = 'Stop'\n\n        if (![string]::IsNullOrEmpty($this.IP)) { $vmHostNetworkAdapterParams.IP = $this.IP }\n        if (![string]::IsNullOrEmpty($this.SubnetMask)) { $vmHostNetworkAdapterParams.SubnetMask = $this.SubnetMask }\n        if (![string]::IsNullOrEmpty($this.Mac)) { $vmHostNetworkAdapterParams.Mac = $this.Mac }\n\n        if ($null -ne $this.AutomaticIPv6) { $vmHostNetworkAdapterParams.AutomaticIPv6 = $this.AutomaticIPv6 }\n        if ($null -ne $this.IPv6) { $vmHostNetworkAdapterParams.IPv6 = $this.IPv6 }\n        if ($null -ne $this.IPv6ThroughDhcp) { $vmHostNetworkAdapterParams.IPv6ThroughDhcp = $this.IPv6ThroughDhcp }\n        if ($null -ne $this.Mtu) { $vmHostNetworkAdapterParams.Mtu = $this.Mtu }\n        if ($null -ne $this.ManagementTrafficEnabled) { $vmHostNetworkAdapterParams.ManagementTrafficEnabled = $this.ManagementTrafficEnabled }\n        if ($null -ne $this.FaultToleranceLoggingEnabled) { $vmHostNetworkAdapterParams.FaultToleranceLoggingEnabled = $this.FaultToleranceLoggingEnabled }\n        if ($null -ne $this.VMotionEnabled) { $vmHostNetworkAdapterParams.VMotionEnabled = $this.VMotionEnabled }\n        if ($null -ne $this.VsanTrafficEnabled) { $vmHostNetworkAdapterParams.VsanTrafficEnabled = $this.VsanTrafficEnabled }\n\n        return $vmHostNetworkAdapterParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new VMKernel Network Adapter connected to the specified Virtual Switch and Port Group for the specified VMHost.\n    If the Port Id is specified, the Port Group is ignored and only the Port Id is passed to the cmdlet.\n    #>\n    [PSObject] AddVMHostNetworkAdapter($virtualSwitch, $portId) {\n        $vmHostNetworkAdapterParams = $this.GetVMHostNetworkAdapterParams()\n\n        $vmHostNetworkAdapterParams.Server = $this.Connection\n        $vmHostNetworkAdapterParams.VMHost = $this.VMHost\n        $vmHostNetworkAdapterParams.VirtualSwitch = $virtualSwitch\n\n        if ($null -ne $portId) {\n            $vmHostNetworkAdapterParams.PortId = $portId\n        }\n        else {\n            $vmHostNetworkAdapterParams.PortGroup = $this.PortGroupName\n        }\n\n        try {\n            return New-VMHostNetworkAdapter @vmHostNetworkAdapterParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVMKernelNicMessage -f $virtualSwitch.Name, $this.PortGroupName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMKernel Network Adapter with the specified properties.\n    #>\n    [void] UpdateVMHostNetworkAdapter($vmHostNetworkAdapter) {\n        $vmHostNetworkAdapterParams = $this.GetVMHostNetworkAdapterParams()\n\n        <#\n        IPv6 should only be passed to the cmdlet if an update needs to be performed.\n        Otherwise the following error occurs when passing the same array: 'Address already exists in the config.'\n        #>\n        if (!$this.ShouldUpdateIPv6($vmHostNetworkAdapter.IPv6)) {\n            $vmHostNetworkAdapterParams.Remove('IPv6')\n        }\n\n        <#\n        Both Dhcp and IPv6Enabled are applicable only for the Update operation, so they are not\n        populated in the GetVMHostNetworkAdapterParams() which is used for Create and Update operations.\n        #>\n        if ($null -ne $this.Dhcp) {\n            $vmHostNetworkAdapterParams.Dhcp = $this.Dhcp\n\n            <#\n            IP and SubnetMask parameters are mutually exclusive with Dhcp so they should be removed\n            from the parameters hashtable before calling Set-VMHostNetworkAdapter cmdlet.\n            #>\n            $vmHostNetworkAdapterParams.Remove('IP')\n            $vmHostNetworkAdapterParams.Remove('SubnetMask')\n        }\n\n        if ($null -ne $this.IPv6Enabled) {\n            $vmHostNetworkAdapterParams.IPv6Enabled = $this.IPv6Enabled\n\n            if (!$this.IPv6Enabled) {\n                <#\n                If the value of IPv6Enabled is $false, other IPv6 settings cannot be specified.\n                #>\n                $vmHostNetworkAdapterParams.Remove('AutomaticIPv6')\n                $vmHostNetworkAdapterParams.Remove('IPv6ThroughDhcp')\n                $vmHostNetworkAdapterParams.Remove('IPv6')\n            }\n        }\n\n        try {\n            $vmHostNetworkAdapter | Set-VMHostNetworkAdapter @vmHostNetworkAdapterParams\n        }\n        catch {\n            throw ($this.CouldNotUpdateVMKernelNicMessage -f $vmHostNetworkAdapter.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMKernel Network Adapter connected to the specified Virtual Switch and Port Group for the specified VMHost.\n    #>\n    [void] RemoveVMHostNetworkAdapter($vmHostNetworkAdapter) {\n        try {\n            Remove-VMHostNetworkAdapter -Nic $vmHostNetworkAdapter -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw ($this.CouldNotRemoveVMKernelNicMessage -f $vmHostNetworkAdapter.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMKernel Network Adapter from the server.\n    #>\n    [void] PopulateResult($vmHostNetworkAdapter, $result) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n\n        if ($null -ne $vmHostNetworkAdapter) {\n            $result.PortGroupName = $vmHostNetworkAdapter.PortGroupName\n            $result.Ensure = [Ensure]::Present\n            $result.IP = $vmHostNetworkAdapter.IP\n            $result.SubnetMask = $vmHostNetworkAdapter.SubnetMask\n            $result.Mac = $vmHostNetworkAdapter.Mac\n            $result.AutomaticIPv6 = $vmHostNetworkAdapter.AutomaticIPv6\n            $result.IPv6 = $vmHostNetworkAdapter.IPv6\n            $result.IPv6ThroughDhcp = $vmHostNetworkAdapter.IPv6ThroughDhcp\n            $result.Mtu = $vmHostNetworkAdapter.Mtu\n            $result.Dhcp = $vmHostNetworkAdapter.DhcpEnabled\n            $result.IPv6Enabled = $vmHostNetworkAdapter.IPv6Enabled\n            $result.ManagementTrafficEnabled = $vmHostNetworkAdapter.ManagementTrafficEnabled\n            $result.FaultToleranceLoggingEnabled = $vmHostNetworkAdapter.FaultToleranceLoggingEnabled\n            $result.VMotionEnabled = $vmHostNetworkAdapter.VMotionEnabled\n            $result.VsanTrafficEnabled = $vmHostNetworkAdapter.VsanTrafficEnabled\n        }\n        else {\n            $result.PortGroupName = $this.PortGroupName\n            $result.Ensure = [Ensure]::Absent\n            $result.IP = $this.IP\n            $result.SubnetMask = $this.SubnetMask\n            $result.Mac = $this.Mac\n            $result.AutomaticIPv6 = $this.AutomaticIPv6\n            $result.IPv6 = $this.IPv6\n            $result.IPv6ThroughDhcp = $this.IPv6ThroughDhcp\n            $result.Mtu = $this.Mtu\n            $result.Dhcp = $this.Dhcp\n            $result.IPv6Enabled = $this.IPv6Enabled\n            $result.ManagementTrafficEnabled = $this.ManagementTrafficEnabled\n            $result.FaultToleranceLoggingEnabled = $this.FaultToleranceLoggingEnabled\n            $result.VMotionEnabled = $this.VMotionEnabled\n            $result.VsanTrafficEnabled = $this.VsanTrafficEnabled\n        }\n    }\n}\n\nclass VMHostVssBaseDSC : VMHostNetworkBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VSS should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    The name of the VSS.\n    #>\n    [DscProperty(Key)]\n    [string] $VssName\n\n    <#\n    .DESCRIPTION\n\n    Returns the desired virtual switch if it is present on the server otherwise returns $null.\n    #>\n    [PSObject] GetVss() {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $this.vmHostNetworkSystem.UpdateViewData('NetworkInfo.Vswitch')\n        return ($this.vmHostNetworkSystem.NetworkInfo.Vswitch | Where-Object { $_.Name -eq $this.VssName })\n    }\n}\n\nclass VMHostVssPortGroupBaseDSC : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Name of the the Port Group.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Port Group should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    The Network System of the specified VMHost.\n    #>\n    hidden [PSObject] $VMHostNetworkSystem\n\n    hidden [string] $CouldNotRetrievePortGroupMessage = \"Could not retrieve Virtual Port Group {0} of VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveNetworkSystemMessage = \"Could not retrieve the Network System of VMHost {0}. For more information: {1}\"\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group with the specified name from the server if it exists.\n    The Virtual Port Group must be a Standard Virtual Port Group. If the Virtual Port Group does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVirtualPortGroup() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            return $null\n        }\n        else {\n            try {\n                $virtualPortGroup = Get-VirtualPortGroup -Server $this.Connection -Name $this.Name -VMHost $this.VMHost -Standard -ErrorAction Stop\n                return $virtualPortGroup\n            }\n            catch {\n                throw ($this.CouldNotRetrievePortGroupMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Network System of the specified VMHost.\n    #>\n    [void] GetVMHostNetworkSystem() {\n        try {\n            $this.VMHostNetworkSystem = Get-View -Server $this.Connection -Id $this.VMHost.ExtensionData.ConfigManager.NetworkSystem -ErrorAction Stop\n        }\n        catch {\n            throw ($this.CouldNotRetrieveNetworkSystemMessage -f $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the specified Policy Setting. If the Inherited Setting is passed and set to $true,\n    the Policy Setting should not be populated because \"Parameters of the form \"XXX\" and \"InheritXXX\" are mutually exclusive.\"\n    If the Inherited Setting is set to $false, both parameters can be populated.\n    #>\n    [void] PopulatePolicySetting($policyParams, $policySettingName, $policySetting, $policySettingInheritedName, $policySettingInherited) {\n        if ($null -ne $policySetting) {\n            if ($null -eq $policySettingInherited -or !$policySettingInherited) {\n                $policyParams.$policySettingName = $policySetting\n            }\n        }\n\n        if ($null -ne $policySettingInherited) { $policyParams.$policySettingInheritedName = $policySettingInherited }\n    }\n}\n\n[DscResource()]\nclass Datacenter : InventoryBaseDSC {\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterLocation = $this.GetInventoryItemLocation()\n            $datacenter = $this.GetDatacenter($datacenterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datacenter) {\n                    $this.AddDatacenter($datacenterLocation)\n                }\n            }\n            else {\n                if ($null -ne $datacenter) {\n                    $this.RemoveDatacenter($datacenter)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterLocation = $this.GetInventoryItemLocation()\n            $datacenter = $this.GetDatacenter($datacenterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                return ($null -ne $datacenter)\n            }\n            else {\n                return ($null -eq $datacenter)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [Datacenter] Get() {\n        try {\n            $result = [Datacenter]::new()\n\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n\n            $this.ConnectVIServer()\n\n            $datacenterLocation = $this.GetInventoryItemLocation()\n            $datacenter = $this.GetDatacenter($datacenterLocation)\n\n            $this.PopulateResult($datacenter, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Datacenter from the specified Location if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetDatacenter($datacenterLocation) {\n        <#\n        The client side filtering here is used so we can retrieve only the Datacenter which is located directly below the found Folder Location\n        because Get-Datacenter searches recursively and can return more than one Datacenter located below the found Folder Location.\n        #>\n        return Get-Datacenter -Server $this.Connection -Name $this.Name -Location $datacenterLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentFolderId -eq $datacenterLocation.Id }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datacenter with the specified properties at the specified Location.\n    #>\n    [void] AddDatacenter($datacenterLocation) {\n        $datacenterParams = @{}\n\n        $datacenterParams.Server = $this.Connection\n        $datacenterParams.Name = $this.Name\n        $datacenterParams.Location = $datacenterLocation\n        $datacenterParams.Confirm = $false\n        $datacenterParams.ErrorAction = 'Stop'\n\n        try {\n            New-Datacenter @datacenterParams\n        }\n        catch {\n            throw \"Cannot create Datacenter $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Datacenter from the specified Location.\n    #>\n    [void] RemoveDatacenter($datacenter) {\n        $datacenterParams = @{}\n\n        $datacenterParams.Server = $this.Connection\n        $datacenterParams.Confirm = $false\n        $datacenterParams.ErrorAction = 'Stop'\n\n        try {\n            $datacenter | Remove-Datacenter @datacenterParams\n        }\n        catch {\n            throw \"Cannot remove Datacenter $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Datacenter from the server.\n    #>\n    [void] PopulateResult($datacenter, $result) {\n        if ($null -ne $datacenter) {\n            $result.Name = $datacenter.Name\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass DatacenterFolder : InventoryBaseDSC {\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterFolderLocation = $this.GetInventoryItemLocation()\n            $datacenterFolder = $this.GetDatacenterFolder($datacenterFolderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datacenterFolder) {\n                    $this.AddDatacenterFolder($datacenterFolderLocation)\n                }\n            }\n            else {\n                if ($null -ne $datacenterFolder) {\n                    $this.RemoveDatacenterFolder($datacenterFolder)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenterFolderLocation = $this.GetInventoryItemLocation()\n            $datacenterFolder = $this.GetDatacenterFolder($datacenterFolderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                return ($null -ne $datacenterFolder)\n            }\n            else {\n                return ($null -eq $datacenterFolder)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [DatacenterFolder] Get() {\n        try {\n            $result = [DatacenterFolder]::new()\n\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n\n            $this.ConnectVIServer()\n\n            $datacenterFolderLocation = $this.GetInventoryItemLocation()\n            $datacenterFolder = $this.GetDatacenterFolder($datacenterFolderLocation)\n\n            $this.PopulateResult($datacenterFolder, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Datacenter Folder from the specified Location if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetDatacenterFolder($datacenterFolderLocation) {\n        <#\n        The client side filtering here is used so we can retrieve only the Folder which is located directly below the found Folder Location\n        because Get-Folder searches recursively and can return more than one Folder located below the found Folder Location.\n        #>\n        return Get-Folder -Server $this.Connection -Name $this.Name -Location $datacenterFolderLocation -ErrorAction SilentlyContinue | Where-Object { $_.ParentId -eq $datacenterFolderLocation.Id }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datacenter Folder with the specified properties at the specified Location.\n    #>\n    [void] AddDatacenterFolder($datacenterFolderLocation) {\n        $datacenterFolderParams = @{}\n\n        $datacenterFolderParams.Server = $this.Connection\n        $datacenterFolderParams.Name = $this.Name\n        $datacenterFolderParams.Location = $datacenterFolderLocation\n        $datacenterFolderParams.Confirm = $false\n        $datacenterFolderParams.ErrorAction = 'Stop'\n\n        try {\n            New-Folder @datacenterFolderParams\n        }\n        catch {\n            throw \"Cannot create Datacenter Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Datacenter Folder from the specified Location.\n    #>\n    [void] RemoveDatacenterFolder($datacenterFolder) {\n        $datacenterFolderParams = @{}\n\n        $datacenterFolderParams.Server = $this.Connection\n        $datacenterFolderParams.Confirm = $false\n        $datacenterFolderParams.ErrorAction = 'Stop'\n\n        try {\n            $datacenterFolder | Remove-Folder @datacenterFolderParams\n        }\n        catch {\n            throw \"Cannot remove Datacenter Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Datacenter Folder from the server.\n    #>\n    [void] PopulateResult($datacenterFolder, $result) {\n        if ($null -ne $datacenterFolder) {\n            $result.Name = $datacenterFolder.Name\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass DatastoreCluster : DatacenterInventoryBaseDSC {\n    DatastoreCluster() {\n        $this.InventoryItemFolderType = [FolderType]::Datastore\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum I/O latency in milliseconds allowed before Storage DRS is triggered for the Datastore Cluster.\n    Valid values are in the range of 5 to 100. If the value of IOLoadBalancing is $false, the setting for the I/O latency threshold is not applied.\n    #>\n    [DscProperty()]\n    [nullable[int]] $IOLatencyThresholdMillisecond\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether I/O load balancing is enabled for the Datastore Cluster. If the value is $false, I/O load balancing is disabled\n    and the settings for the I/O latency threshold and utilized space threshold are not applied.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IOLoadBalanceEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Storage DRS automation level for the Datastore Cluster. Valid values are Disabled, Manual and FullyAutomated.\n    #>\n    [DscProperty()]\n    [DrsAutomationLevel] $SdrsAutomationLevel = [DrsAutomationLevel]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum percentage of consumed space allowed before Storage DRS is triggered for the Datastore Cluster.\n    Valid values are in the range of 50 to 100. If the value of IOLoadBalancing is $false, the setting for the utilized space threshold is not applied.\n    #>\n    [DscProperty()]\n    [nullable[int]] $SpaceUtilizationThresholdPercent\n\n    hidden [string] $CreateDatastoreClusterMessage = \"Creating Datastore Cluster {0} in Folder {1}.\"\n    hidden [string] $ModifyDatastoreClusterMessage = \"Modifying Datastore Cluster {0} configuration.\"\n    hidden [string] $RemoveDatastoreClusterMessage = \"Removing Datastore Cluster {0}.\"\n\n    hidden [string] $CouldNotCreateDatastoreClusterMessage = \"Could not create Datastore Cluster {0} in Folder {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyDatastoreClusterMessage = \"Could not modify Datastore Cluster {0} configuration. For more information: {1}\"\n    hidden [string] $CouldNotRemoveDatastoreClusterMessage = \"Could not remove Datastore Cluster {0}. For more information: {1}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $datastoreClusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n            $datastoreCluster = $this.GetDatastoreCluster($datastoreClusterLocation)\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastoreCluster) {\n                    $datastoreCluster = $this.NewDatastoreCluster($datastoreClusterLocation)\n                }\n\n                if ($this.ShouldModifyDatastoreCluster($datastoreCluster)) {\n                    $this.ModifyDatastoreCluster($datastoreCluster)\n                }\n            }\n            else {\n                if ($null -ne $datastoreCluster) {\n                    $this.RemoveDatastoreCluster($datastoreCluster)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $datastoreClusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n            $datastoreCluster = $this.GetDatastoreCluster($datastoreClusterLocation)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastoreCluster) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDatastoreCluster($datastoreCluster)\n                }\n            }\n            else {\n                $result = ($null -eq $datastoreCluster)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [DatastoreCluster] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [DatastoreCluster]::new()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $datastoreClusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n            $datastoreCluster = $this.GetDatastoreCluster($datastoreClusterLocation)\n            $this.PopulateResult($result, $datastoreCluster)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore Cluster with the specified name located in the specified Folder if it exists.\n    #>\n    [PSObject] GetDatastoreCluster($datastoreClusterLocation) {\n        $getDatastoreClusterParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Location = $datastoreClusterLocation\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ExtensionData.Parent -eq $datastoreClusterLocation.ExtensionData.MoRef\n            }\n        }\n\n        <#\n            Multiple Datastore Clusters with the same name can be present in a Datacenter. So we need to filter\n            by the direct Parent Folder of the Datastore Cluster to retrieve the desired one.\n        #>\n        return Get-DatastoreCluster @getDatastoreClusterParams | Where-Object @whereObjectParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified Datastore Cluster configuration should be modified.\n    #>\n    [bool] ShouldModifyDatastoreCluster($datastoreCluster) {\n        $shouldModifyDatastoreCluster = @(\n            $this.ShouldUpdateDscResourceSetting(\n                'IOLatencyThresholdMillisecond',\n                $datastoreCluster.IOLatencyThresholdMillisecond,\n                $this.IOLatencyThresholdMillisecond\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'IOLoadBalanceEnabled',\n                $datastoreCluster.IOLoadBalanceEnabled,\n                $this.IOLoadBalanceEnabled\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'SdrsAutomationLevel',\n                [string] $datastoreCluster.SdrsAutomationLevel,\n                $this.SdrsAutomationLevel.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'SpaceUtilizationThresholdPercent',\n                $datastoreCluster.SpaceUtilizationThresholdPercent,\n                $this.SpaceUtilizationThresholdPercent\n            )\n        )\n\n        return ($shouldModifyDatastoreCluster -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Datastore Cluster with the specified name located in the specified Folder.\n    #>\n    [PSObject] NewDatastoreCluster($datastoreClusterLocation) {\n        $newDatastoreClusterParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Location = $datastoreClusterLocation\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateDatastoreClusterMessage, @($this.Name, $datastoreClusterLocation.Name))\n\n            return New-DatastoreCluster @newDatastoreClusterParams\n        }\n        catch {\n            throw ($this.CouldNotCreateDatastoreClusterMessage -f $this.Name, $datastoreClusterLocation.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the configuration of the specified Datastore Cluster.\n    #>\n    [void] ModifyDatastoreCluster($datastoreCluster) {\n        $setDatastoreClusterParams = @{\n            Server = $this.Connection\n            DatastoreCluster = $datastoreCluster\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.IOLatencyThresholdMillisecond) { $setDatastoreClusterParams.IOLatencyThresholdMillisecond = $this.IOLatencyThresholdMillisecond }\n        if ($null -ne $this.IOLoadBalanceEnabled) { $setDatastoreClusterParams.IOLoadBalanceEnabled = $this.IOLoadBalanceEnabled }\n        if ($this.SdrsAutomationLevel -ne [DrsAutomationLevel]::Unset) { $setDatastoreClusterParams.SdrsAutomationLevel = $this.SdrsAutomationLevel.ToString() }\n        if ($null -ne $this.SpaceUtilizationThresholdPercent) { $setDatastoreClusterParams.SpaceUtilizationThresholdPercent = $this.SpaceUtilizationThresholdPercent }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyDatastoreClusterMessage, @($datastoreCluster.Name))\n\n            Set-DatastoreCluster @setDatastoreClusterParams\n        }\n        catch {\n            throw ($this.CouldNotModifyDatastoreClusterMessage -f $datastoreCluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Datastore Cluster.\n    #>\n    [void] RemoveDatastoreCluster($datastoreCluster) {\n        $removeDatastoreClusterParams = @{\n            Server = $this.Connection\n            DatastoreCluster = $datastoreCluster\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveDatastoreClusterMessage, @($datastoreCluster.Name))\n\n            Remove-DatastoreCluster @removeDatastoreClusterParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveDatastoreClusterMessage -f $datastoreCluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $datastoreCluster) {\n        $result.Server = $this.Server\n        $result.Location = $this.Location\n        $result.DatacenterName = $this.DatacenterName\n        $result.DatacenterLocation = $this.DatacenterLocation\n\n        if ($null -ne $datastoreCluster) {\n            $result.Name = $datastoreCluster.Name\n            $result.Ensure = [Ensure]::Present\n            $result.IOLatencyThresholdMillisecond = $datastoreCluster.IOLatencyThresholdMillisecond\n            $result.IOLoadBalanceEnabled = $datastoreCluster.IOLoadBalanceEnabled\n            $result.SdrsAutomationLevel = $datastoreCluster.SdrsAutomationLevel.ToString()\n            $result.SpaceUtilizationThresholdPercent = $datastoreCluster.SpaceUtilizationThresholdPercent\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.IOLatencyThresholdMillisecond = $this.IOLatencyThresholdMillisecond\n            $result.IOLoadBalanceEnabled = $this.IOLoadBalanceEnabled\n            $result.SdrsAutomationLevel = $this.SdrsAutomationLevel\n            $result.SpaceUtilizationThresholdPercent = $this.SpaceUtilizationThresholdPercent\n        }\n    }\n}\n\n[DscResource()]\nclass DatastoreClusterAddDatastore : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datacenter where the specified\n    Datastore Cluster and Datastores are located.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Datacenter where the specified Datastore Cluster and\n    Datastores are located. The Root Folder of the Inventory is not part of the location.\n    Empty location means that the Datacenter is in the Root Folder of the Inventory.\n    The Folder names in the location are separated by '/'.\n    Example Datacenter location: 'MyDatacentersFolderOne/MyDatacentersFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore Cluster located in the Datacenter specified in 'DatacenterName' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreClusterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Datastore Cluster with name specified in 'DatastoreClusterName' key property in the Datacenter\n    specified in 'DatacenterName' key property. Location consists of 0 or more Folders.\n    Empty location means that the Datastore Cluster is located in the Datastore Folder of the Datacenter.\n    The Root Folders of the Datacenter are not part of the location. Folder names in the location are separated by '/'.\n    Example location for a Datastore Cluster: 'MyDatastoreClusterFolderOne/MyDatastoreClusterFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreClusterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Datastores that should be located in the specified Datastore Cluster.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $DatastoreNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies the instance of the 'InventoryUtil' class that is used\n    for Inventory operations.\n    #>\n    hidden [InventoryUtil] $InventoryUtil\n\n    hidden [string] $AddDatastoresToDatastoreClusterMessage = \"Adding Datastores {0} to Datastore Cluster {1}.\"\n\n    hidden [string] $CouldNotFindDatastoreMessage = \"Could not find Datastore {0} in Datacenter {1}.\"\n    hidden [string] $CouldNotAddDatastoresToDatastoreClusterMessage = \"Could not add Datastores {0} to Datastore Cluster {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterDatastoreFolderName = [FolderType]::Datastore.ToString() + 'Folder'\n            $datastoreCluster = $this.InventoryUtil.GetDatastoreCluster(\n                $this.DatastoreClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.DatastoreClusterLocation,\n                    $datacenter,\n                    $datacenterDatastoreFolderName\n                )\n            )\n\n            $datastores = $this.GetDatastores($datacenter)\n            $datastoresToAddToDatastoreCluster = $this.GetDatastoresToAddToDatastoreCluster($datastoreCluster, $datastores)\n\n            $this.AddDatastoresToDatastoreCluster($datastoreCluster, $datastoresToAddToDatastoreCluster)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterDatastoreFolderName = [FolderType]::Datastore.ToString() + 'Folder'\n            $datastoreCluster = $this.InventoryUtil.GetDatastoreCluster(\n                $this.DatastoreClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.DatastoreClusterLocation,\n                    $datacenter,\n                    $datacenterDatastoreFolderName\n                )\n            )\n\n            $datastores = $this.GetDatastores($datacenter)\n            $datastoresToAddToDatastoreCluster = $this.GetDatastoresToAddToDatastoreCluster($datastoreCluster, $datastores)\n            $result = !($datastoresToAddToDatastoreCluster.Length -gt 0)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [DatastoreClusterAddDatastore] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [DatastoreClusterAddDatastore]::new()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterDatastoreFolderName = [FolderType]::Datastore.ToString() + 'Folder'\n            $datastoreCluster = $this.InventoryUtil.GetDatastoreCluster(\n                $this.DatastoreClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.DatastoreClusterLocation,\n                    $datacenter,\n                    $datacenterDatastoreFolderName\n                )\n            )\n\n            $datastores = $this.GetDatastoresInDatastoreCluster($datastoreCluster)\n\n            $result.Server = $this.Server\n            $result.DatacenterName = $datacenter.Name\n            $result.DatacenterLocation = $this.DatacenterLocation\n            $result.DatastoreClusterName = $datastoreCluster.Name\n            $result.DatastoreClusterLocation = $this.DatastoreClusterLocation\n            $result.DatastoreNames = $datastores | Select-Object -ExpandProperty Name\n\n            return $result\n        }\n        finally {            \n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Initializes an instance of the 'InventoryUtil' class.\n    #>\n    [void] InitInventoryUtil() {\n        if ($null -eq $this.InventoryUtil) {\n            $this.InventoryUtil = [InventoryUtil]::new($this.Connection, [Ensure]::Present)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastores with the specified names located in the specified Datacenter.\n    #>\n    [array] GetDatastores($datacenter) {\n        $result = @()\n        if ($this.DatastoreNames.Length -gt 0) {\n            $getDatastoreParams = @{\n                Server = $this.Connection\n                Name = $this.DatastoreNames\n                Location = $datacenter\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $result = Get-Datastore @getDatastoreParams\n        }\n\n        if ($this.DatastoreNames.Length -gt $result.Length) {\n            $notFoundDatastoreNames = $this.DatastoreNames | Where-Object -FilterScript { $result.Name -NotContains $_ }\n            foreach ($notFoundDatastoreName in $notFoundDatastoreNames) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindDatastoreMessage, @($notFoundDatastoreName, $datacenter.Name))\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastores located in the specified Datastore Cluster.\n    #>\n    [array] GetDatastoresInDatastoreCluster($datastoreCluster) {\n        $getDatastoreParams = @{\n            Server = $this.Connection\n            Location = $datastoreCluster\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-Datastore @getDatastoreParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves only the Datastores that are still not added to the specified\n    Datastore Cluster.\n    #>\n    [array] GetDatastoresToAddToDatastoreCluster($datastoreCluster, $datastores) {\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.ParentFolderId -ne $datastoreCluster.Id\n            }\n        }\n\n        return $datastores | Where-Object @whereObjectParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the specified Datastores to the Datastore Cluster.\n    #>\n    [void] AddDatastoresToDatastoreCluster($datastoreCluster, $datastoresToAddToDatastoreCluster) {\n        $moveDatastoreParams = @{\n            Server = $this.Connection\n            Datastore = $datastoresToAddToDatastoreCluster\n            Destination = $datastoreCluster\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddDatastoresToDatastoreClusterMessage, @(\n                ($datastoresToAddToDatastoreCluster.Name -Join ', '),\n                $datastoreCluster.Name\n            ))\n                \n            Move-Datastore @moveDatastoreParams\n        }\n        catch {\n            throw (\n                $this.CouldNotAddDatastoresToDatastoreClusterMessage -f @(\n                    ($datastoresToAddToDatastoreCluster.Name -Join ', '),\n                    $datastoreCluster.Name,\n                    $_.Exception.Message\n                )\n            )\n        }\n    }\n}\n\n[DscResource()]\nclass DRSRule : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the DRS rule.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datacenter where the Cluster, for which the DRS rule applies, is located.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Datacenter where the Cluster, for which the DRS rule applies, is located.\n    The Root Folder of the Inventory is not part of the location.\n    Empty location means that the Datacenter is located in the Root Folder of the Inventory.\n    The Folder names in the location are separated by '/'.\n    Example Datacenter location: 'MyDatacentersFolderOne/MyDatacentersFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $DatacenterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Cluster for which the DRS rule applies.\n    #>\n    [DscProperty(Key)]\n    [string] $ClusterName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Cluster, for which the DRS rule applies, located in the\n    Datacenter specified in 'DatacenterName' key property.\n    The Root Folders of the Datacenter are not part of the location.\n    Empty location means that the Cluster is located in the Host Folder of the Datacenter.\n    The Folder names in the location are separated by '/'.\n    Example Cluster location: 'MyClusterFolderOne/MyClusterFolderTwo'.\n    #>\n    [DscProperty(Key)]\n    [string] $ClusterLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the DRS rule - affinity or anti-affinity.\n    #>\n    [DscProperty(Key)]\n    [DRSRuleType] $DRSRuleType\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the virtual machines that are referenced by the DRS rule.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $VMNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the DRS rule should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the DRS rule is enabled or disabled for the specified Cluster.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the instance of the 'InventoryUtil' class that is used\n    for Inventory operations.\n    #>\n    hidden [InventoryUtil] $InventoryUtil\n\n    hidden [string] $CreateDrsRuleMessage = \"Creating DRS Rule {0} for Cluster {1}.\"\n    hidden [string] $ModifyDrsRuleMessage = \"Modifying DRS rule {0} for Cluster {1}.\"\n    hidden [string] $RemoveDrsRuleMessage = \"Removing DRS rule {0} for Cluster {1}.\"\n\n    hidden [string] $InvalidVMCountMessage = \"At least 2 Virtual Machines should be specified.\"\n\n    hidden [string] $CouldNotFindVMMessage = \"Could not find Virtual Machine {0} in Cluster {1}.\"\n    hidden [string] $CouldNotCreateDrsRuleMessage = \"Could not create DRS rule {0} for Cluster {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyDrsRuleMessage = \"Could not modify DRS rule {0} for Cluster {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveDrsRuleMessage = \"Could not remove DRS rule {0} for Cluster {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterHostFolderName = [FolderType]::Host.ToString() + 'Folder'\n            $cluster = $this.InventoryUtil.GetInventoryItem(\n                $this.ClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.ClusterLocation,\n                    $datacenter,\n                    $datacenterHostFolderName\n                )\n            )\n\n            $drsRule = $this.GetDrsRule($cluster)\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $virtualMachines = $this.GetVirtualMachines($cluster)\n                if ($null -eq $drsRule) {\n                    $this.NewDrsRule($cluster, $virtualMachines)\n                }\n                else {\n                    $this.ModifyDrsRule($drsRule, $virtualMachines)\n                }\n            }\n            else {\n                if ($null -ne $drsRule) {\n                    $this.RemoveDrsRule($drsRule)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterHostFolderName = [FolderType]::Host.ToString() + 'Folder'\n            $cluster = $this.InventoryUtil.GetInventoryItem(\n                $this.ClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.ClusterLocation,\n                    $datacenter,\n                    $datacenterHostFolderName\n                )\n            )\n\n            $drsRule = $this.GetDrsRule($cluster)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $drsRule) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDrsRule($drsRule)\n                }\n            }\n            else {\n                $result = ($null -eq $drsRule)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [DRSRule] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [DRSRule]::new()\n\n            $this.InitInventoryUtil()\n            $datacenter = $this.InventoryUtil.GetDatacenter($this.DatacenterName, $this.DatacenterLocation)\n            $datacenterHostFolderName = [FolderType]::Host.ToString() + 'Folder'\n            $cluster = $this.InventoryUtil.GetInventoryItem(\n                $this.ClusterName,\n                $this.InventoryUtil.GetInventoryItemParent(\n                    $this.ClusterLocation,\n                    $datacenter,\n                    $datacenterHostFolderName\n                )\n            )\n\n            $drsRule = $this.GetDrsRule($cluster)\n\n            $result.DatacenterName = $datacenter.Name\n            $result.ClusterName = $cluster.Name\n            $this.PopulateResult($result, $drsRule)\n\n            return $result\n        }\n        finally {            \n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Initializes an instance of the 'InventoryUtil' class.\n    #>\n    [void] InitInventoryUtil() {\n        if ($null -eq $this.InventoryUtil) {\n            $this.InventoryUtil = [InventoryUtil]::new($this.Connection, $this.Ensure)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the DRS Rule with the speciifed name located in the specified Cluster.\n    #>\n    [PSObject] GetDrsRule($cluster) {\n        $getDrsRuleParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Cluster = $cluster\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-DrsRule @getDrsRuleParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Machines with the specified names located in the specified Cluster.\n    #>\n    [array] GetVirtualMachines($cluster) {\n        $result = @()\n        if ($this.VMNames.Length -gt 0) {\n            $getVMParams = @{\n                Server = $this.Connection\n                Name = $this.VMNames\n                Location = $cluster\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $result = Get-VM @getVMParams\n        }\n\n        if ($result.Length -lt 2) {\n            throw $this.InvalidVMCountMessage\n        }\n\n        if ($this.VMNames.Length -gt $result.Length) {\n            $notFoundVMNames = $this.VMNames | Where-Object -FilterScript { $result.Name -NotContains $_ }\n            foreach ($notFoundVMName in $notFoundVMNames) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindVMMessage, @($notFoundVMName, $cluster.Name))\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the names of the Virtual Machines with the specified Ids.\n    #>\n    [string[]] GetVirtualMachineNames($vmIds) {\n        $getVMParams = @{\n            Server = $this.Connection\n            Id = $vmIds\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-VM @getVMParams | Select-Object -ExpandProperty Name\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified DRS rule should be modified.\n    #>\n    [bool] ShouldModifyDrsRule($drsRule) {\n        $shouldModifyDrsRule = @(\n            $this.ShouldUpdateDscResourceSetting('Enabled', $drsRule.Enabled, $this.Enabled),\n            $this.ShouldUpdateArraySetting('VMNames', $this.GetVirtualMachineNames($drsRule.VMIds), $this.VMNames)\n        )\n\n        return ($shouldModifyDrsRule -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new DRS rule with the specified name for the specified Cluster.\n    #>\n    [void] NewDrsRule($cluster, $virtualMachines) {\n        $newDrsRuleParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Cluster = $cluster\n            KeepTogether = ($this.DRSRuleType -eq [DRSRuleType]::VMAffinity)\n            VM = $virtualMachines\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Enabled) { $newDrsRuleParams.Enabled = $this.Enabled }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateDrsRuleMessage, @($this.Name, $cluster.Name))\n\n            New-DrsRule @newDrsRuleParams\n        }\n        catch {\n            throw ($this.CouldNotCreateDrsRuleMessage -f $this.Name, $cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the specified DRS rule.\n    #>\n    [void] ModifyDrsRule($drsRule, $virtualMachines) {\n        $setDrsRuleParams = @{\n            Server = $this.Connection\n            Rule = $drsRule\n            VM = $virtualMachines\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Enabled) { $setDrsRuleParams.Enabled = $this.Enabled }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyDrsRuleMessage, @($drsRule.Name, $drsRule.Cluster.Name))\n\n            Set-DrsRule @setDrsRuleParams\n        }\n        catch {\n            throw ($this.CouldNotModifyDrsRuleMessage -f $drsRule.Name, $drsRule.Cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified DRS rule.\n    #>\n    [void] RemoveDrsRule($drsRule) {\n        $removeDrsRuleParams = @{\n            Rule = $drsRule\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveDrsRuleMessage, @($drsRule.Name, $drsRule.Cluster.Name))\n\n            Remove-DrsRule @removeDrsRuleParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveDrsRuleMessage -f $drsRule.Name, $drsRule.Cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $drsRule) {\n        $result.Server = $this.Server\n        $result.DatacenterLocation = $this.DatacenterLocation\n        $result.ClusterLocation = $this.ClusterLocation\n\n        if ($null -ne $drsRule) {\n            $result.Name = $drsRule.Name\n            $result.DRSRuleType = [string] $drsRule.Type\n            $result.VMNames = $this.GetVirtualMachineNames($drsRule.VMIds)\n            $result.Ensure = [Ensure]::Present\n            $result.Enabled = $drsRule.Enabled\n        }\n        else {\n            $result.Name = $this.Name\n            $result.DRSRuleType = $this.DRSRuleType\n            $result.VMNames = $this.VMNames\n            $result.Ensure = [Ensure]::Absent\n            $result.Enabled = $this.Enabled\n        }\n    }\n}\n\n[DscResource()]\nclass Folder : DatacenterInventoryBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The type of Root Folder in the Datacenter in which the Folder is located.\n    Possible values are VM, Network, Datastore, Host.\n    #>\n    [DscProperty(Key)]\n    [FolderType] $FolderType\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.FolderType)Folder\"\n            $folderLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $folder = $this.GetInventoryItem($folderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $folder) {\n                    $this.AddFolder($folderLocation)\n                }\n            }\n            else {\n                if ($null -ne $folder) {\n                    $this.RemoveFolder($folder)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.FolderType)Folder\"\n            $folderLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $folder = $this.GetInventoryItem($folderLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                return ($null -ne $folder)\n            }\n            else {\n                return ($null -eq $folder)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [Folder] Get() {\n        try {\n            $result = [Folder]::new()\n\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n            $result.FolderType = $this.FolderType\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.FolderType)Folder\"\n            $folderLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $folder = $this.GetInventoryItem($folderLocation)\n\n            $this.PopulateResult($folder, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Folder with the specified properties at the specified Location.\n    #>\n    [void] AddFolder($folderLocation) {\n        $folderParams = @{}\n\n        $folderParams.Server = $this.Connection\n        $folderParams.Name = $this.Name\n        $folderParams.Location = $folderLocation\n        $folderParams.Confirm = $false\n        $folderParams.ErrorAction = 'Stop'\n\n        try {\n            New-Folder @folderParams\n        }\n        catch {\n            throw \"Cannot create Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Folder from the specified Location.\n    #>\n    [void] RemoveFolder($folder) {\n        $folderParams = @{}\n\n        $folderParams.Server = $this.Connection\n        $folderParams.Confirm = $false\n        $folderParams.ErrorAction = 'Stop'\n\n        try {\n            $folder | Remove-Folder @folderParams\n        }\n        catch {\n            throw \"Cannot remove Folder $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Folder from the server.\n    #>\n    [void] PopulateResult($folder, $result) {\n        if ($null -ne $folder) {\n            $result.Name = $folder.Name\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass NfsUser : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Nfs User name used for Kerberos authentication.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Nfs User password used for Kerberos authentication.\n    #>\n    [DscProperty()]\n    [string] $Password\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Nfs User should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to change the password of the Nfs User. When the property is not specified or is $false, it is ignored.\n    If the property is $true and the Nfs User exists, the password of the Nfs User is changed.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $CreateNfsUserMessage = \"Creating Nfs User {0} on VMHost {1}.\"\n    hidden [string] $ChangeNfsUserPasswordMessage = \"Changing Nfs User {0} password on VMHost {1}.\"\n    hidden [string] $RemoveNfsUserMessage = \"Removing Nfs User {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotCreateNfsUserMessage = \"Could not create Nfs User {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotChangeNfsUserPasswordMessage = \"Could not change Nfs User {0} password on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveNfsUserMessage = \"Could not remove Nfs User {0} from VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $nfsUser = $this.GetNfsUser()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $nfsUser) {\n                    $this.NewNfsUser()\n                }\n                else {\n                    $this.ChangeNfsUserPassword($nfsUser)\n                }\n            }\n            else {\n                if ($null -ne $nfsUser) {\n                    $this.RemoveNfsUser($nfsUser)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $nfsUser = $this.GetNfsUser()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $nfsUser) {\n                    $result = $false\n                }\n                else {\n                    $result = !($null -ne $this.Force -and $this.Force)\n                }\n            }\n            else {\n                $result = ($null -eq $nfsUser)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [NfsUser] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [NfsUser]::new()\n\n            $this.RetrieveVMHost()\n\n            $nfsUser = $this.GetNfsUser()\n            $this.PopulateResult($result, $nfsUser)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Nfs User with the specified name from the VMHost if it exists.\n    #>\n    [PSObject] GetNfsUser() {\n        <#\n        The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n        when importing the 'VMware.VimAutomation.Storage' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        $nfsUser = Get-NfsUser -Server $this.Connection -Username $this.Name -VMHost $this.VMHost -ErrorAction SilentlyContinue -Verbose:$false\n\n        $global:VerbosePreference = $savedVerbosePreference\n\n        return $nfsUser\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Nfs User with the specified name and password on the VMHost.\n    #>\n    [void] NewNfsUser() {\n        $newNfsUserParams = @{\n            Server = $this.Connection\n            Username = $this.Name\n            VMHost = $this.VMHost\n            Password = $this.Password\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateNfsUserMessage,  @($this.Name, $this.VMHost.Name))\n\n            New-NfsUser @newNfsUserParams\n        }\n        catch {\n            throw ($this.CouldNotCreateNfsUserMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Changes the password of the specified Nfs User on the VMHost.\n    #>\n    [void] ChangeNfsUserPassword($nfsUser) {\n        $setNfsUserParams = @{\n            Server = $this.Connection\n            NfsUser = $nfsUser\n            Password = $this.Password\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ChangeNfsUserPasswordMessage,  @($nfsUser.Username, $this.VMHost.Name))\n\n            Set-NfsUser @setNfsUserParams\n        }\n        catch {\n            throw ($this.CouldNotChangeNfsUserPasswordMessage -f $nfsUser.Username, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Nfs User from the VMHost.\n    #>\n    [void] RemoveNfsUser($nfsUser) {\n        $removeNfsUserParams = @{\n            NfsUser = $nfsUser\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveNfsUserMessage,  @($nfsUser.Username, $this.VMHost.Name))\n\n            Remove-NfsUser @removeNfsUserParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveNfsUserMessage -f $nfsUser.Username, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $nfsUser) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Force = $this.Force\n\n        if ($null -ne $nfsUser) {\n            $result.Name = $nfsUser.Username\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass PowerCLISettings {\n    <#\n    .DESCRIPTION\n\n    Specifies the scope on which the PowerCLI Settings will be applied.\n    LCM is the only possible value for the Settings Scope.\n    #>\n    [DscProperty(Key)]\n    [PowerCLISettingsScope] $SettingsScope\n\n    <#\n    .DESCRIPTION\n\n    Specifies the proxy policy for the connection through which Customer Experience Improvement Program (CEIP) data is sent to VMware.\n    #>\n    [DscProperty()]\n    [ProxyPolicy] $CEIPDataTransferProxyPolicy = [ProxyPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the server connection mode.\n    #>\n    [DscProperty()]\n    [DefaultVIServerMode] $DefaultVIServerMode = [DefaultVIServerMode]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether you want to see warnings about deprecated elements.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DisplayDeprecationWarnings\n\n    <#\n    .DESCRIPTION\n\n    Define the action to take when an attempted connection to a server fails due to a certificate error.\n    #>\n    [DscProperty()]\n    [BadCertificateAction] $InvalidCertificateAction = [BadCertificateAction]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies if PowerCLI should send anonymous usage information to VMware.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ParticipateInCeip\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether VMware PowerCLI uses a system proxy server to connect to the vCenter Server system.\n    #>\n    [DscProperty()]\n    [ProxyPolicy] $ProxyPolicy = [ProxyPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Defines the timeout for Web operations. The default value is 300 sec.\n    #>\n    [DscProperty()]\n    [nullable[int]] $WebOperationTimeoutSeconds\n\n    hidden [string] $Scope = \"User\"\n\n    [void] Set() {\n        $this.ImportRequiredModules()\n        $powerCLIConfigurationProperties = $this.GetPowerCLIConfigurationProperties()\n\n        $commandName = 'Set-PowerCLIConfiguration'\n        $namesOfPowerCLIConfigurationProperties = $powerCLIConfigurationProperties.Keys\n\n        <#\n        For testability we use this function to construct the Set-PowerCLIConfiguration cmdlet instead of using splatting and passing the cmdlet parameters as hashtable.\n        At the moment Pester does not allow to pass hashtable in the ParameterFilter property of the Assert-MockCalled function.\n        There is an open issue in GitHub: (https://github.com/pester/Pester/issues/862) describing the problem in details.\n        #>\n        $constructedCommand = $this.ConstructCommandWithParameters($commandName, $powerCLIConfigurationProperties, $namesOfPowerCLIConfigurationProperties)\n        Invoke-Expression -Command $constructedCommand\n    }\n\n    [bool] Test() {\n        $this.ImportRequiredModules()\n        $powerCLICurrentConfiguration = Get-PowerCLIConfiguration -Scope $this.Scope\n        $powerCLIDesiredConfiguration = $this.GetPowerCLIConfigurationProperties()\n\n        return $this.Equals($powerCLICurrentConfiguration, $powerCLIDesiredConfiguration)\n    }\n\n    [PowerCLISettings] Get() {\n        $this.ImportRequiredModules()\n        $result = [PowerCLISettings]::new()\n        $powerCLICurrentConfiguration = Get-PowerCLIConfiguration -Scope $this.Scope\n\n        $this.PopulateResult($powerCLICurrentConfiguration, $result)\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Imports the needed VMware Modules.\n    #>\n    [void] ImportRequiredModules() {\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        Import-Module -Name VMware.VimAutomation.Core\n\n        $global:VerbosePreference = $savedVerbosePreference\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns all passed PowerCLI configuration properties as a hashtable.\n    #>\n    [hashtable] GetPowerCLIConfigurationProperties() {\n        $powerCLIConfigurationProperties = @{}\n\n        # Adds the Default Scope to the hashtable.\n        $powerCLIConfigurationProperties.Add(\"Scope\", $this.Scope)\n\n        if ($this.CEIPDataTransferProxyPolicy -ne [ProxyPolicy]::Unset -and $this.ParticipateInCeip -eq $true) {\n            $powerCLIConfigurationProperties.Add(\"CEIPDataTransferProxyPolicy\", $this.CEIPDataTransferProxyPolicy)\n        }\n\n        if ($this.DefaultVIServerMode -ne [DefaultVIServerMode]::Unset) {\n            $powerCLIConfigurationProperties.Add(\"DefaultVIServerMode\", $this.DefaultVIServerMode)\n        }\n\n        if ($null -ne $this.DisplayDeprecationWarnings) {\n            $powerCLIConfigurationProperties.Add(\"DisplayDeprecationWarnings\", $this.DisplayDeprecationWarnings)\n        }\n\n        if ($this.InvalidCertificateAction -ne [BadCertificateAction]::Unset) {\n            $powerCLIConfigurationProperties.Add(\"InvalidCertificateAction\", $this.InvalidCertificateAction)\n        }\n\n        if ($null -ne $this.ParticipateInCeip) {\n            $powerCLIConfigurationProperties.Add(\"ParticipateInCeip\", $this.ParticipateInCeip)\n        }\n\n        if ($this.ProxyPolicy -ne [ProxyPolicy]::Unset) {\n            $powerCLIConfigurationProperties.Add(\"ProxyPolicy\", $this.ProxyPolicy)\n        }\n\n        if ($null -ne $this.WebOperationTimeoutSeconds) {\n            $powerCLIConfigurationProperties.Add(\"WebOperationTimeoutSeconds\", $this.WebOperationTimeoutSeconds)\n        }\n\n        return $powerCLIConfigurationProperties\n    }\n\n    <#\n    .DESCRIPTION\n\n    Constructs the Set-PowerCLIConfiguration cmdlet with the passed properties.\n    This function is used instead of splatting because at the moment Pester does not allow to pass hashtable in the ParameterFilter property of the Assert-MockCalled function.\n    There is an open issue in GitHub: (https://github.com/pester/Pester/issues/862) describing the problem in details.\n    So with this function we can successfully test which properties are passed to the Set-PowerCLIConfiguration cmdlet.\n    #>\n    [string] ConstructCommandWithParameters($commandName, $properties, $namesOfProperties) {\n        $constructedCommand = [System.Text.StringBuilder]::new()\n\n        # Adds the command name to the constructed command.\n        [void]$constructedCommand.Append(\"$commandName \")\n\n        # For every property name we add the property value with the following syntax: '-Property Value'.\n        foreach ($propertyName in $namesOfProperties) {\n            $propertyValue = $properties.$propertyName\n\n            <#\n            For bool values we need to add another '$' sign so the value can be evaluated to bool.\n            So we check the type of the value and if it is a boolean we add another '$' sign, because without it the value will\n            not be evaluated to boolean and instead it will be evaluated to string which will cause an exception of mismatching types.\n            #>\n            if ($propertyValue.GetType().Name -eq 'Boolean') {\n                [void]$constructedCommand.Append(\"-$propertyName $\")\n                [void]$constructedCommand.Append(\"$propertyValue \")\n            }\n            else {\n                [void]$constructedCommand.Append(\"-$propertyName $propertyValue \")\n            }\n        }\n\n        # Adds the confirm:$false to the command to ignore the confirmation.\n        [void]$constructedCommand.Append(\"-Confirm:`$false\")\n\n        # Converts the StringBuilder to String and returns the result.\n        return $constructedCommand.ToString()\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the current PowerCLI Configuration is equal to the Desired Configuration.\n    #>\n    [bool] Equals($powerCLICurrentConfiguration, $powerCLIDesiredConfiguration) {\n        foreach ($key in $powerCLIDesiredConfiguration.Keys) {\n            <#\n            Currently works only for properties which are numbers, strings and enums. For more complex types like\n            Hashtable the logic needs to be modified to work correctly.\n            #>\n            if ($powerCLIDesiredConfiguration.$key.ToString() -ne $powerCLICurrentConfiguration.$key.ToString()) {\n                return $false\n            }\n        }\n\n        return $true\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the PowerCLI settings from the server.\n    #>\n    [void] PopulateResult($powerCLICurrentConfiguration, $result) {\n        $result.SettingsScope = $this.SettingsScope\n        $result.CEIPDataTransferProxyPolicy = if ($null -ne $powerCLICurrentConfiguration.CEIPDataTransferProxyPolicy) { $powerCLICurrentConfiguration.CEIPDataTransferProxyPolicy.ToString() } else { [ProxyPolicy]::Unset }\n        $result.DefaultVIServerMode = if ($null -ne $powerCLICurrentConfiguration.DefaultVIServerMode) { $powerCLICurrentConfiguration.DefaultVIServerMode.ToString() } else { [DefaultVIServerMode]::Unset }\n        $result.DisplayDeprecationWarnings = $powerCLICurrentConfiguration.DisplayDeprecationWarnings\n        $result.InvalidCertificateAction = if ($null -ne $powerCLICurrentConfiguration.InvalidCertificateAction) { $powerCLICurrentConfiguration.InvalidCertificateAction.ToString() } else { [BadCertificateAction]::Unset }\n        $result.ParticipateInCeip = $powerCLICurrentConfiguration.ParticipateInCEIP\n        $result.ProxyPolicy = if ($null -ne $powerCLICurrentConfiguration.ProxyPolicy) { $powerCLICurrentConfiguration.ProxyPolicy.ToString() } else { [ProxyPolicy]::Unset }\n        $result.WebOperationTimeoutSeconds = $powerCLICurrentConfiguration.WebOperationTimeoutSeconds\n    }\n}\n\n<#\n.NOTES\nvCenterSettings inherits BasevSphereConnection instead of BaseDSC because it is a specific case where\nthe resource does not have it's own DSC key property. That's why were define a $Server property here in order to\nuse it as a key.\n#>\n[DscResource()]\nclass vCenterSettings : BasevSphereConnection {\n    <#\n    .DESCRIPTION\n\n    Name of the Server we are trying to connect to. The Server must be a vCenter.\n    #>\n    [DscProperty(Key)]\n    [string] $Server\n\n    <#\n    .DESCRIPTION\n\n    Logging Level Advanced Setting value.\n    #>\n    [DscProperty()]\n    [LoggingLevel] $LoggingLevel = [LoggingLevel]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Event Max Age Enabled Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $EventMaxAgeEnabled\n\n    <#\n    .DESCRIPTION\n\n    Event Max Age Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $EventMaxAge\n\n    <#\n    .DESCRIPTION\n\n    Task Max Age Enabled Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $TaskMaxAgeEnabled\n\n    <#\n    .DESCRIPTION\n\n    Task Max Age Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $TaskMaxAge\n\n    <#\n    .DESCRIPTION\n\n    Motd Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Motd\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Motd content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $MotdClear\n\n    <#\n    .DESCRIPTION\n\n    Issue Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Issue\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Issue content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $IssueClear\n\n    hidden [string] $LogLevelSettingName = \"log.level\"\n    hidden [string] $EventMaxAgeEnabledSettingName = \"event.maxAgeEnabled\"\n    hidden [string] $EventMaxAgeSettingName = \"event.maxAge\"\n    hidden [string] $TaskMaxAgeEnabledSettingName = \"task.maxAgeEnabled\"\n    hidden [string] $TaskMaxAgeSettingName = \"task.maxAge\"\n    hidden [string] $MotdSettingName = \"etc.motd\"\n    hidden [string] $IssueSettingName = \"etc.issue\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.UpdatevCenterSettings($this.Connection)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = !$this.ShouldUpdatevCenterSettings()\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [vCenterSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [vCenterSettings]::new()\n            $result.Server = $this.Server\n\n            $this.PopulateResult($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the advanced settings of the specified vCenter Server.\n    #>\n    [PSObject] GetvCenterAdvancedSettings() {\n        $getAdvancedSettingParams = @{\n            Server = $this.Connection\n            Entity = $this.Connection\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        return Get-AdvancedSetting @getAdvancedSettingParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if at least one Advanced Setting value should be updated.\n    #>\n    [bool] ShouldUpdatevCenterSettings() {\n        $vCenterCurrentAdvancedSettings = $this.GetvCenterAdvancedSettings()\n\n    \t$currentLogLevel = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.LogLevelSettingName }\n    \t$currentEventMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeEnabledSettingName }\n    \t$currentEventMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeSettingName }\n    \t$currentTaskMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeEnabledSettingName }\n    \t$currentTaskMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeSettingName }\n    \t$currentMotd = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n        $currentIssue = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $motdDesiredValue = if ($this.MotdClear) { [string]::Empty } else { $this.Motd }\n        $issueDesiredValue = if ($this.IssueClear) { [string]::Empty } else { $this.Issue }\n\n    \t$shouldUpdatevCenterSettings = @(\n            $this.ShouldUpdateDscResourceSetting('LoggingLevel', [string] $currentLogLevel.Value, $this.LoggingLevel.ToString()),\n            $this.ShouldUpdateDscResourceSetting('EventMaxAgeEnabled', $currentEventMaxAgeEnabled.Value, $this.EventMaxAgeEnabled),\n            $this.ShouldUpdateDscResourceSetting('EventMaxAge', $currentEventMaxAge.Value, $this.EventMaxAge),\n            $this.ShouldUpdateDscResourceSetting('TaskMaxAgeEnabled', $currentTaskMaxAgeEnabled.Value, $this.TaskMaxAgeEnabled),\n            $this.ShouldUpdateDscResourceSetting('TaskMaxAge', $currentTaskMaxAge.Value, $this.TaskMaxAge),\n            $this.ShouldUpdateDscResourceSetting('Motd', $currentMotd.Value, $motdDesiredValue),\n            $this.ShouldUpdateDscResourceSetting('Issue', $currentIssue.Value, $issueDesiredValue)\n        )\n\n    \treturn ($shouldUpdatevCenterSettings -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets the desired value for the Advanced Setting, if update of the Advanced Setting value is needed.\n    #>\n   [void] SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue) {\n        if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, $advancedSettingDesiredValue)) {\n            $setAdvancedSettingParams = @{\n                AdvancedSetting = $advancedSetting\n                Value = $advancedSettingDesiredValue\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Set-AdvancedSetting @setAdvancedSettingParams\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets the desired value for the Advanced Setting, if update of the Advanced Setting value is needed.\n    This handles Advanced Settings that have a \"Clear\" property.\n    #>\n\n    [void] SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue, $clearValue) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\" , @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \tif ($clearValue) {\n      \t    if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, [string]::Empty)) {\n                $setAdvancedSettingParams = @{\n                    AdvancedSetting = $advancedSetting\n                    Value = [string]::Empty\n                    Confirm = $false\n                    ErrorAction = 'Stop'\n                    Verbose = $false\n                }\n                Set-AdvancedSetting @setAdvancedSettingParams\n      \t    }\n    \t}\n    \telse {\n            $this.SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue)\n    \t}\n  \t}\n\n    <#\n    .DESCRIPTION\n\n    Performs update on those Advanced Settings values that needs to be updated.\n    #>\n    [void] UpdatevCenterSettings($vCenter) {\n        $vCenterCurrentAdvancedSettings = $this.GetvCenterAdvancedSettings()\n\n        $currentLogLevel = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.LogLevelSettingName }\n        $currentEventMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeEnabledSettingName }\n        $currentEventMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeSettingName }\n        $currentTaskMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeEnabledSettingName }\n        $currentTaskMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeSettingName }\n    \t$currentMotd = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n    \t$currentIssue = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $this.SetAdvancedSetting('LoggingLevel', $currentLogLevel, $this.LoggingLevel.ToString(), $currentLogLevel.Value)\n        $this.SetAdvancedSetting('EventMaxAgeEnabled', $currentEventMaxAgeEnabled, $this.EventMaxAgeEnabled, $currentEventMaxAgeEnabled.Value)\n        $this.SetAdvancedSetting('EventMaxAge', $currentEventMaxAge, $this.EventMaxAge, $currentEventMaxAge.Value)\n        $this.SetAdvancedSetting('TaskMaxAgeEnabled', $currentTaskMaxAgeEnabled, $this.TaskMaxAgeEnabled, $currentTaskMaxAgeEnabled.Value)\n        $this.SetAdvancedSetting('TaskMaxAge', $currentTaskMaxAge, $this.TaskMaxAge, $currentTaskMaxAge.Value)\n    \t$this.SetAdvancedSetting('Motd', $currentMotd, $this.Motd, $currentMotd.Value, $this.MotdClear)\n    \t$this.SetAdvancedSetting('Issue', $currentIssue, $this.Issue, $currentIssue.Value, $this.IssueClear)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the advanced settings from the server.\n    #>\n    [void] PopulateResult($result) {\n        $vCenterCurrentAdvancedSettings = $this.GetvCenterAdvancedSettings()\n\n        $currentLogLevel = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.LogLevelSettingName }\n        $currentEventMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeEnabledSettingName }\n        $currentEventMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.EventMaxAgeSettingName }\n        $currentTaskMaxAgeEnabled = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeEnabledSettingName }\n        $currentTaskMaxAge = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.TaskMaxAgeSettingName }\n        $currentMotd = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n        $currentIssue = $vCenterCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $result.LoggingLevel = $currentLogLevel.Value\n        $result.EventMaxAgeEnabled = $currentEventMaxAgeEnabled.Value\n        $result.EventMaxAge = $currentEventMaxAge.Value\n        $result.TaskMaxAgeEnabled = $currentTaskMaxAgeEnabled.Value\n        $result.TaskMaxAge = $currentTaskMaxAge.Value\n        $result.Motd = $currentMotd.Value\n        $result.Issue = $currentIssue.Value\n    }\n}\n\n[DscResource()]\nclass vCenterStatistics : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    The unit of period. Statistics can be stored separatelly for each of the {Day, Week, Month, Year} period units.\n    #>\n    [DscProperty(Key)]\n    [Period] $Period\n\n    <#\n    .DESCRIPTION\n\n    Period for which the statistics are saved.\n    #>\n    [DscProperty()]\n    [nullable[long]] $PeriodLength\n\n    <#\n    .DESCRIPTION\n\n    Specified Level value for the vCenter Statistics.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Level\n\n    <#\n    .DESCRIPTION\n\n    If collecting statistics for the specified period unit is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Interval in Minutes, indicating the period for collecting statistics.\n    #>\n    [DscProperty()]\n    [nullable[long]] $IntervalMinutes\n\n    hidden [int] $SecondsInAMinute = 60\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $performanceManager = $this.GetPerformanceManager()\n            $currentPerformanceInterval = $this.GetPerformanceInterval($performanceManager)\n\n            $this.UpdatePerformanceInterval($performanceManager, $currentPerformanceInterval)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $performanceManager = $this.GetPerformanceManager()\n            $currentPerformanceInterval = $this.GetPerformanceInterval($performanceManager)\n\n            $result = !((\n                $this.ShouldUpdateDscResourceSetting('Level', $currentPerformanceInterval.Level, $this.Level),\n                $this.ShouldUpdateDscResourceSetting('Enabled', $currentPerformanceInterval.Enabled, $this.Enabled),\n                $this.ShouldUpdateDscResourceSetting('IntervalMinutes', $currentPerformanceInterval.SamplingPeriod / $this.SecondsInAMinute, $this.IntervalMinutes),\n                $this.ShouldUpdateDscResourceSetting('PeriodLength', $currentPerformanceInterval.Length / $this.Period, $this.PeriodLength)\n            ) -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [vCenterStatistics] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [vCenterStatistics]::new()\n            $result.Server = $this.Server\n            $result.Period = $this.Period\n\n            $performanceManager = $this.GetPerformanceManager()\n            $currentPerformanceInterval = $this.GetPerformanceInterval($performanceManager)\n\n            $result.Level = $currentPerformanceInterval.Level\n            $result.Enabled = $currentPerformanceInterval.Enabled\n\n            # Converts the Sampling Period from seconds to minutes\n            $result.IntervalMinutes = $currentPerformanceInterval.SamplingPeriod / $this.SecondsInAMinute\n\n            # Converts the PeriodLength from seconds to the specified Period type\n            $result.PeriodLength = $currentPerformanceInterval.Length / $this.Period\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Performance Manager for the specified vCenter.\n    #>\n    [PSObject] GetPerformanceManager() {\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $this.Connection.ExtensionData.Content.PerfManager\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        return Get-View @getViewParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Performance Interval for which the new statistics settings should be applied.\n    #>\n    [PSObject] GetPerformanceInterval($performanceManager) {\n        $currentPerformanceInterval = $performanceManager.HistoricalInterval | Where-Object { $_.Name -Match $this.Period }\n\n        return $currentPerformanceInterval\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the value to set for the Performance Interval Setting.\n    #>\n    [PSObject] SpecifiedOrCurrentValue($desiredValue, $currentValue) {\n        if ($null -eq $desiredValue) {\n            # Desired value is not specified\n            return $currentValue\n        }\n        else {\n            return $desiredValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Performance Interval with the specified settings for vCenter Statistics.\n    #>\n    [void] UpdatePerformanceInterval($performanceManager, $currentPerformanceInterval) {\n        $performanceIntervalArgs = @{\n            Key = $currentPerformanceInterval.Key\n            Name = $currentPerformanceInterval.Name\n            Enabled = $this.SpecifiedOrCurrentValue($this.Enabled, $currentPerformanceInterval.Enabled)\n            Level = $this.SpecifiedOrCurrentValue($this.Level, $currentPerformanceInterval.Level)\n            SamplingPeriod = $this.SpecifiedOrCurrentValue($this.IntervalMinutes * $this.SecondsInAMinute, $currentPerformanceInterval.SamplingPeriod)\n            Length = $this.SpecifiedOrCurrentValue($this.PeriodLength * $this.Period, $currentPerformanceInterval.Length)\n        }\n\n        $desiredPerformanceInterval = New-PerformanceInterval @performanceIntervalArgs\n\n        try {\n            Update-PerfInterval -PerformanceManager $performanceManager -PerformanceInterval $desiredPerformanceInterval\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass vCenterVMHost : DatacenterInventoryBaseDSC {\n    vCenterVMHost() {\n        $this.InventoryItemFolderType = [FolderType]::Host\n    }\n\n    <#\n    .DESCRIPTION\n\n    Credentials needed for authenticating with the VMHost.\n    #>\n    [DscProperty(Mandatory)]\n    [PSCredential] $VMHostCredential\n\n    <#\n    .DESCRIPTION\n\n    Specifies the port on the VMHost used for the connection.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Port\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the VMHost is added to the vCenter if the authenticity of the VMHost SSL certificate cannot be verified.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Resource Pool in the Cluster. Location consists of 0 or more Resource Pools. The Root Resource Pool of the Cluster is not part of the location.\n    If '/' location is passed, the Resource Pool is the Root Resource Pool of the Cluster. Resource Pools names in the location are separated by '/'.\n    The VMHost's Root Resource Pool becomes the last Resource Pool specified in the location and the VMHost Resource Pool hierarchy is imported into the new nested Resource Pool.\n    Example location for a Resource Pool: 'MyResourcePoolOne/MyResourcePoolTwo'.\n    #>\n    [DscProperty()]\n    [string] $ResourcePoolLocation\n\n    hidden [string] $ClusterType = 'VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster'\n\n    hidden [string] $AddVMHostTovCenterMessage = \"Adding VMHost {0} to vCenter {1} and location {2}.\"\n    hidden [string] $MoveVMHostToDestinationMessage = \"Moving VMHost {0} to location {1} on vCenter {2}.\"\n    hidden [string] $RemoveVMHostFromvCenterMessage = \"Removing VMHost {0} from vCenter {1}.\"\n\n    hidden [string] $FoundLocationIsNotAClusterMessage = \"Resource Pool location {0} is specified but the found location {1} for VMHost {2} is not a Cluster.\"\n    hidden [string] $CouldNotRetrieveRootResourcePoolOfClusterMessage = \"Could not retrieve Root Resource Pool of Cluster {0}. For more information: {1}\"\n    hidden [string] $InvalidResourcePoolLocationInClusterMessage = \"Resource Pool location {0} is not valid in Cluster {2}.\"\n    hidden [string] $CouldNotAddVMHostTovCenterMessage = \"Could not add VMHost {0} to vCenter {1} and location {2}. For more information: {3}\"\n    hidden [string] $CouldNotMoveVMHostToDestinationMessage = \"Could not move VMHost {0} to location {1} on vCenter {2}. For more information: {3}\"\n    hidden [string] $CouldNotRemoveVMHostFromvCenterMessage = \"Could not remove VMHost {0} from vCenter {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $datacenter = $this.GetDatacenter()\n                $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n                $vmHostLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n                if (![string]::IsNullOrEmpty($this.ResourcePoolLocation)) {\n                    <#\n                    If the Resource Pool location is specified it means that the desired VMHost location should be a Cluster and the Resource Pool needs to be passed to the cmdlets\n                    as VMHost location instead of the Cluster.\n                    #>\n                    if (!$this.IsVIObjectOfTheCorrectType($vmHostLocation, $this.ClusterType)) {\n                        throw ($this.FoundLocationIsNotAClusterMessage -f $this.ResourcePoolLocation, $vmHostLocation.Name, $this.Name)\n                    }\n                    $rootResourcePool = $this.GetRootResourcePoolOfCluster($vmHostLocation)\n                    $vmHostLocation = $this.GetClusterResourcePool($rootResourcePool, $vmHostLocation.Name)\n                }\n\n                if ($null -eq $vmHost) {\n                    $this.AddVMHost($vmHostLocation)\n                }\n                else {\n                    if ($vmHost.ParentId -ne $vmHostLocation.Id) {\n                        $this.MoveVMHost($vmHost, $vmHostLocation)\n                    }\n                }\n            }\n            else {\n                if ($null -ne $vmHost) {\n                    $this.RemoveVMHost($vmHost)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHost) {\n                    $result = $false\n                }\n                else {\n                    $datacenter = $this.GetDatacenter()\n                    $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n                    $vmHostLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n\n                    $result = ($vmHost.ParentId -eq $vmHostLocation.Id)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHost)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [vCenterVMHost] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [vCenterVMHost]::new()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost with the specified name if it is on the vCenter Server system.\n    #>\n    [PSObject] GetVMHost() {\n        return Get-VMHost -Server $this.Connection -Name $this.Name -ErrorAction SilentlyContinue -Verbose:$false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Root Resource Pool of the specified Cluster.\n    #>\n    [PSObject] GetRootResourcePoolOfCluster($cluster) {\n        try {\n            $rootResourcePool = Get-ResourcePool -Server $this.Connection -Location $cluster -ErrorAction Stop -Verbose:$false |\n                                Where-Object -FilterScript { $_.ParentId -eq $cluster.Id }\n            return $rootResourcePool\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRootResourcePoolOfClusterMessage -f $cluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Resource Pool with the specified name from the specified Cluster.\n    #>\n    [PSObject] GetClusterResourcePool($rootResourcePool, $clusterName) {\n        $clusterResourcePool = $null\n\n        if ($this.ResourcePoolLocation -eq '/') {\n            # Special case where the Resource Pool location does not contain any Resource Pools. So the Root Resource Pool is the searched Resource Pool from the Cluster.\n            $clusterResourcePool = $rootResourcePool\n        }\n        elseif ($this.ResourcePoolLocation -NotMatch '/') {\n            # Special case where the Resource Pool location is just one Resource Pool.\n            $clusterResourcePool = Get-Inventory -Server $this.Connection -Name $this.ResourcePoolLocation -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false |\n                                           Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n        }\n        else {\n            $resourcePoolLocationItems = $this.ResourcePoolLocation -Split '/'\n\n            # Reverse the Resource Pool location items so that we can start from the bottom and go to the Root Resource Pool.\n            [array]::Reverse($resourcePoolLocationItems)\n\n            $resourcePoolName = $resourcePoolLocationItems[0]\n            $foundResourcePools = Get-Inventory -Server $this.Connection -Name $resourcePoolName -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false\n\n            # Remove the name of the Resource Pool from the Resource Pool location items array as we already retrieved it.\n            $resourcePoolLocationItems = $resourcePoolLocationItems[1..($resourcePoolLocationItems.Length - 1)]\n\n            <#\n            For every found Resource Pool in the Cluster with the specified name we start to go up through the parents to check if the Resource Pool location is valid.\n            If one of the Parents does not meet the criteria of the Resource Pool location, we continue with the next found Resource Pool.\n            If we find a valid Resource Pool location we stop iterating through the Resource Pools and mark it as the searched Resource Pool from the Cluster.\n            #>\n            foreach ($foundResourcePool in $foundResourcePools) {\n                $foundResourcePoolAsViewObject = Get-View -Server $this.Connection -Id $foundResourcePool.Id -Property Parent -Verbose:$false\n                $validResourcePoolLocation = $true\n\n                foreach ($resourcePoolLocationItem in $resourcePoolLocationItems) {\n                    $foundResourcePoolAsViewObject = Get-View -Server $this.Connection -Id $foundResourcePoolAsViewObject.Parent -Property Name, Parent -Verbose:$false\n                    if ($foundResourcePoolAsViewObject.Name -ne $resourcePoolLocationItem) {\n                        $validResourcePoolLocation = $false\n                        break\n                    }\n                }\n\n                if ($validResourcePoolLocation) {\n                    $clusterResourcePool = $foundResourcePool\n                    break\n                }\n            }\n        }\n\n        if ($null -eq $clusterResourcePool) {\n            throw ($this.InvalidResourcePoolLocationInClusterMessage -f $this.ResourcePoolLocation, $clusterName)\n        }\n\n        return $clusterResourcePool\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the VMHost to the specified location and to be managed by the vCenter Server system.\n    #>\n    [void] AddVMHost($vmHostLocation) {\n        $addVMHostParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            Location = $vmHostLocation\n            Credential = $this.VMHostCredential\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Port) { $addVMHostParams.Port = $this.Port }\n        if ($null -ne $this.Force) { $addVMHostParams.Force = $this.Force }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddVMHostTovCenterMessage, @($this.Name, $this.Connection.Name, $vmHostLocation.Name))\n\n            Add-VMHost @addVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotAddVMHostTovCenterMessage -f $this.Name, $this.Connection.Name, $vmHostLocation.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Moves the VMHost to the specified location on the vCenter Server system.\n    #>\n    [void] MoveVMHost($vmHost, $vmHostLocation) {\n        $moveVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Destination = $vmHostLocation\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.MoveVMHostToDestinationMessage, @($vmHost.Name, $vmHostLocation.Name, $this.Connection.Name))\n\n            Move-VMHost @moveVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotMoveVMHostToDestinationMessage -f $vmHost.Name, $vmHostLocation.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMHost from the vCenter Server system.\n    #>\n    [void] RemoveVMHost($vmHost) {\n        $removeVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveVMHostFromvCenterMessage, @($vmHost.Name, $this.Connection.Name))\n\n            Remove-VMHost @removeVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveVMHostFromvCenterMessage -f $vmHost.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Location = $this.Location\n        $result.DatacenterName = $this.DatacenterName\n        $result.DatacenterLocation = $this.DatacenterLocation\n        $result.Force = $this.Force\n        $result.ResourcePoolLocation = $this.ResourcePoolLocation\n\n        if ($null -ne $vmHost) {\n            $result.Name = $vmHost.Name\n            $result.Ensure = [Ensure]::Present\n            $result.Port = $vmHost.ExtensionData.Summary.Config.Port\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.Port = $this.Port\n        }\n    }\n}\n\n[DscResource()]\nclass VDPortGroup : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Distributed Port Group.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch associated with the Distributed Port Group.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Distributed Port Group should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies a description for the Distributed Port Group.\n    #>\n    [DscProperty()]\n    [string] $Notes\n\n    <#\n    .DESCRIPTION\n\n    Specifies the number of ports that the Distributed Port Group will have.\n    If the parameter is not specified, the number of ports for the Distributed Port Group is 128.\n    #>\n    [DscProperty()]\n    [nullable[int]] $NumPorts\n\n    <#\n    .DESCRIPTION\n\n    Specifies the port binding setting for the Distributed Port Group.\n    Valid values are Static, Dynamic, and Ephemeral.\n    #>\n    [DscProperty()]\n    [PortBinding] $PortBinding = [PortBinding]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the VLAN ID for the Distributed Port Group.\n    Valid values are integers in the range of 1 to 4094.\n    If 0 is specified, the VLAN type is 'None'.\n    #>\n    [DscProperty()]\n    [nullable[int]] $VLanId\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name for the reference Distributed Port Group.\n    The properties of the new Distributed Port Group will be cloned from the reference Distributed Port Group.\n    #>\n    [DscProperty()]\n    [string] $ReferenceVDPortGroupName\n\n    hidden [string] $RetrieveVDSwitchMessage = \"Retrieving distributed switch {0}.\"\n    hidden [string] $CreateVDPortGroupMessage = \"Creating distributed port group {0} on distributed switch {1}.\"\n    hidden [string] $ModifyVDPortGroupMessage = \"Modifying distributed port group {0}.\"\n    hidden [string] $ModifyVDPortGroupVlanConfigurationMessage = \"Modifying the VLAN ID of distributed port group {0} to {1}.\"\n    hidden [string] $RemoveVDPortGroupMessage = \"Removing distributed port group {0} from distributed switch {1}.\"\n\n    hidden [string] $CouldNotRetrieveVDSwitchMessage = \"Could not retrieve distributed switch {0}. For more information: {1}\"\n    hidden [string] $CouldNotCreateVDPortGroupMessage = \"Could not create distributed port group {0} on distributed switch {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyVDPortGroupMessage = \"Could not modify distributed port group {0}. For more information: {1}\"\n    hidden [string] $CouldNotModifyVDPortGroupVlanConfigurationMessage = \"Could not modify the VLAN ID of distributed port group {0} to {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveVDPortGroupMessage = \"Could not remove distributed port group {0} from distributed switch {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $distributedPortGroup = $this.GetDistributedPortGroup($distributedSwitch)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedPortGroup) {\n                    $this.AddDistributedPortGroup($distributedSwitch)\n                }\n                else {\n                    if ($this.ShouldUpdateVLanId($distributedPortGroup)) {\n                        $this.UpdateDistributedPortGroupVlanConfiguration($distributedPortGroup)\n                    }\n\n                    if ($this.ShouldUpdateDistributedPortGroup($distributedPortGroup)) {\n                        $this.UpdateDistributedPortGroup($distributedPortGroup)\n                    }\n                }\n            }\n            else {\n                if ($null -ne $distributedPortGroup) {\n                    $this.RemoveDistributedPortGroup($distributedPortGroup)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $distributedPortGroup = $this.GetDistributedPortGroup($distributedSwitch)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedPortGroup) {\n                    $result = $false\n                }\n                else {\n                    $result = if ($this.ShouldUpdateDistributedPortGroup($distributedPortGroup) -or $this.ShouldUpdateVLanId($distributedPortGroup)) { $false } else { $true }\n                }\n            }\n            else {\n                $result = ($null -eq $distributedPortGroup)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VDPortGroup] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n            $result = [VDPortGroup]::new()\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $distributedPortGroup = $this.GetDistributedPortGroup($distributedSwitch)\n\n            $this.PopulateResult($distributedPortGroup, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch with the specified name from the server if it exists.\n    If the Distributed Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetDistributedSwitch() {\n        <#\n            The Verbose logic here is needed to suppress the Verbose output of the Import-Module cmdlet\n            when importing the 'VMware.VimAutomation.Vds' Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        try {\n            $getVDSwitchParams = @{\n                Server = $this.Connection\n                Name = $this.VdsName\n                Verbose = $false\n            }\n            if ($this.Ensure -eq [Ensure]::Absent) {\n                $getVDSwitchParams.ErrorAction = 'SilentlyContinue'\n                return Get-VDSwitch @getVDSwitchParams\n            }\n            else {\n                try {\n                    $this.WriteLogUtil('Verbose', $this.RetrieveVDSwitchMessage, @($this.VdsName))\n                    $getVDSwitchParams.ErrorAction = 'Stop'\n                    return Get-VDSwitch @getVDSwitchParams\n                }\n                catch {\n                    throw ($this.CouldNotRetrieveVDSwitchMessage -f $this.VdsName, $_.Exception.Message)\n                }\n            }\n        }\n        finally {\n            $global:VerbosePreference = $savedVerbosePreference\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Port Group with the specified name, available on the specified Distributed Switch from the server if it exists.\n    Otherwise returns $null.\n    #>\n    [PSObject] GetDistributedPortGroup($distributedSwitch) {\n        if ($null -eq $distributedSwitch) {\n            <#\n            If the Distributed Switch is $null, it means that Ensure was set to 'Absent' and\n            the Distributed Port Group does not exist for the specified Distributed Switch.\n            #>\n            return $null\n        }\n\n        $getVDPortgroupParams = @{\n            Server = $this.Connection\n            Name = $this.Name\n            VDSwitch = $distributedSwitch\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n        return Get-VDPortgroup @getVDPortgroupParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed Distributed Port Group needs be modified based on the passed properties.\n    #>\n    [bool] ShouldUpdateDistributedPortGroup($distributedPortGroup) {\n        $shouldUpdateDistributedPortGroup = @(\n            $this.ShouldUpdateDscResourceSetting('NumPorts', $distributedPortGroup.NumPorts, $this.NumPorts),\n            $this.ShouldUpdateDscResourceSetting('PortBinding', [string] $distributedPortGroup.PortBinding, $this.PortBinding.ToString()),\n            $this.ShouldUpdateDscResourceSetting('Notes', [string] $distributedPortGroup.Notes, $this.Notes)\n        )\n\n        return ($shouldUpdateDistributedPortGroup -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VLAN ID of the specified distributed port group should be modified.\n    #>\n    [bool] ShouldUpdateVLanId($distributedPortGroup) {\n        $currentVLanId = if ($null -ne $distributedPortGroup.VlanConfiguration) { $distributedPortGroup.VlanConfiguration.VlanId } else { 0 }\n        return $this.ShouldUpdateDscResourceSetting('VLanId', $currentVLanId, $this.VLanId)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Distributed Port Group parameters.\n    #>\n    [hashtable] GetDistributedPortGroupParams() {\n        $distributedPortGroupParams = @{}\n\n        $distributedPortGroupParams.Server = $this.Connection\n        $distributedPortGroupParams.Confirm = $false\n        $distributedPortGroupParams.ErrorAction = 'Stop'\n        $distributedPortGroupParams.Verbose = $false\n\n        if ($null -ne $this.Notes) { $distributedPortGroupParams.Notes = $this.Notes }\n        if ($null -ne $this.NumPorts) { $distributedPortGroupParams.NumPorts = $this.NumPorts }\n\n        if ($this.PortBinding -ne [PortBinding]::Unset) {\n            $distributedPortGroupParams.PortBinding = $this.PortBinding.ToString()\n        }\n\n        return $distributedPortGroupParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Distributed Port Group available on the specified Distributed Switch.\n    #>\n    [void] AddDistributedPortGroup($distributedSwitch) {\n        $distributedPortGroupParams = $this.GetDistributedPortGroupParams()\n        $distributedPortGroupParams.Name = $this.Name\n        $distributedPortGroupParams.VDSwitch = $distributedSwitch\n\n        <#\n        ReferencePortGroup and VLanId are parameters only for the New-VDPortgroup cmdlet\n        and are not used for the Set-VDPortgroup cmdlet.\n        #>\n        if (![string]::IsNullOrEmpty($this.ReferenceVDPortGroupName)) { $distributedPortGroupParams.ReferencePortgroup = $this.ReferenceVDPortGroupName }\n        if ($null -ne $this.VLanId) { $distributedPortGroupParams.VlanId = $this.VLanId }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateVDPortGroupMessage, @($this.Name, $distributedSwitch.Name))\n            New-VDPortgroup @distributedPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVDPortGroupMessage -f $this.Name, $distributedSwitch.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the configuration of the specified Distributed Port Group with the passed properties.\n    #>\n    [void] UpdateDistributedPortGroup($distributedPortGroup) {\n        $distributedPortGroupParams = $this.GetDistributedPortGroupParams()\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVDPortGroupMessage, @($distributedPortGroup.Name))\n            $distributedPortGroup | Set-VDPortgroup @distributedPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVDPortGroupMessage -f $distributedPortGroup.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the VLAN configuration of the specified Distributed Port Group.\n    #>\n    [void] UpdateDistributedPortGroupVlanConfiguration($distributedPortGroup) {\n        $setVDVlanConfigurationParams = @{\n            VDPortgroup = $distributedPortGroup\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($this.VLanId -eq 0) {\n            $setVDVlanConfigurationParams.DisableVlan = $true\n        }\n        else {\n            $setVDVlanConfigurationParams.VlanId = $this.VLanId\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVDPortGroupVlanConfigurationMessage, @($distributedPortGroup.Name, $this.VLanId))\n            Set-VDVlanConfiguration @setVDVlanConfigurationParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVDPortGroupVlanConfigurationMessage -f $distributedPortGroup.Name, $this.VLanId, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Distributed Port Group from the vSphere Distributed Switch that it belongs to.\n    #>\n    [void] RemoveDistributedPortGroup($distributedPortGroup) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveVDPortGroupMessage, @($distributedPortGroup.Name, $distributedPortGroup.VDSwitch.Name))\n            $removeVDPortGroupParams = @{\n                Server = $this.Connection\n                VDPortGroup = $distributedPortGroup\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Remove-VDPortGroup @removeVDPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveVDPortGroupMessage -f $distributedPortGroup.Name, $distributedPortGroup.VDSwitch.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($distributedPortGroup, $result) {\n        $result.Server = $this.Connection.Name\n        $result.ReferenceVDPortGroupName = $this.ReferenceVDPortGroupName\n\n        if ($null -ne $distributedPortGroup) {\n            $result.Name = $distributedPortGroup.Name\n            $result.VdsName = $distributedPortGroup.VDSwitch.Name\n            $result.Ensure = [Ensure]::Present\n            $result.Notes = $distributedPortGroup.Notes\n            $result.NumPorts = $distributedPortGroup.NumPorts\n            $result.PortBinding = $distributedPortGroup.PortBinding.ToString()\n            $result.VLanId = [int] $distributedPortGroup.VlanConfiguration.VlanId\n        }\n        else {\n            $result.Name = $this.Name\n            $result.VdsName = $this.VdsName\n            $result.Ensure = [Ensure]::Absent\n            $result.Notes = $this.Notes\n            $result.NumPorts = $this.NumPorts\n            $result.PortBinding = $this.PortBinding\n            $result.VLanId = [int] $this.VLanId\n        }\n    }\n}\n\n[DscResource()]\nclass VDSwitch : DatacenterInventoryBaseDSC {\n    DistributedSwitch() {\n        $this.InventoryItemFolderType = [FolderType]::Network\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the contact details of the vSphere Distributed Switch administrator.\n    #>\n    [DscProperty()]\n    [string] $ContactDetails\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch administrator.\n    #>\n    [DscProperty()]\n    [string] $ContactName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the discovery protocol type of the vSphere Distributed Switch that you want to create.\n    The valid values are CDP, LLDP and Unset. If you do not set a value for this parameter, the default server setting is used.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolProtocol] $LinkDiscoveryProtocol = [LinkDiscoveryProtocolProtocol]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the link discovery protocol operation for the vSphere Distributed Switch that you want to create.\n    The valid values are Advertise, Both, Listen, None and Unset. If you do not set a value for this parameter, the default server setting is used.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolOperation] $LinkDiscoveryProtocolOperation = [LinkDiscoveryProtocolOperation]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum number of ports allowed on the vSphere Distributed Switch that you want to create.\n    #>\n    [DscProperty()]\n    [nullable[int]] $MaxPorts\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum MTU size for the vSphere Distributed Switch that you want to create. Valid values are positive integers only.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Mtu\n\n    <#\n    .DESCRIPTION\n\n    Specifies a description for the vSphere Distributed Switch that you want to create.\n    #>\n    [DscProperty()]\n    [string] $Notes\n\n    <#\n    .DESCRIPTION\n\n    Specifies the number of uplink ports on the vSphere Distributed Switch that you want to create.\n    #>\n    [DscProperty()]\n    [nullable[int]] $NumUplinkPorts\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Name for the reference vSphere Distributed Switch.\n    The properties of the new vSphere Distributed Switch will be cloned from the reference vSphere Distributed Switch.\n    #>\n    [DscProperty()]\n    [string] $ReferenceVDSwitchName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the version of the vSphere Distributed Switch that you want to create.\n    You cannot specify a version that is incompatible with the version of the vCenter Server system you are connected to.\n    #>\n    [DscProperty()]\n    [string] $Version\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the new vSphere Distributed Switch will be created without importing the port groups from the specified reference vSphere Distributed Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $WithoutPortGroups\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $distributedSwitchLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $distributedSwitch = $this.GetDistributedSwitch($distributedSwitchLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedSwitch) {\n                    $this.AddDistributedSwitch($distributedSwitchLocation)\n                }\n                else {\n                    $this.UpdateDistributedSwitch($distributedSwitch)\n                }\n            }\n            else {\n                if ($null -ne $distributedSwitch) {\n                    $this.RemoveDistributedSwitch($distributedSwitch)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $distributedSwitchLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $distributedSwitch = $this.GetDistributedSwitch($distributedSwitchLocation)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $distributedSwitch) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateDistributedSwitch($distributedSwitch)\n                }\n            }\n            else {\n                $result = ($null -eq $distributedSwitch)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VDSwitch] Get() {\n        try {\n            $result = [VDSwitch]::new()\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n            $result.ReferenceVDSwitchName = $this.ReferenceVDSwitchName\n            $result.WithoutPortGroups = $this.WithoutPortGroups\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $distributedSwitchLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $distributedSwitch = $this.GetDistributedSwitch($distributedSwitchLocation)\n\n            $this.PopulateResult($distributedSwitch, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch from the specified Location in the Datacenter if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetDistributedSwitch($distributedSwitchLocation) {\n        <#\n        The Verbose logic here is needed to suppress the Exporting and Importing of the\n        cmdlets from the VMware.VimAutomation.Vds Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        $distributedSwitch = Get-VDSwitch -Server $this.Connection -Name $this.Name -Location $distributedSwitchLocation -ErrorAction SilentlyContinue\n\n        $global:VerbosePreference = $savedVerbosePreference\n\n        return $distributedSwitch\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the passed Distributed Switch needs be updated based on the specified properties.\n    #>\n    [bool] ShouldUpdateDistributedSwitch($distributedSwitch) {\n        $shouldUpdateDistributedSwitch = @(\n            $this.ShouldUpdateDscResourceSetting('ContactDetails', [string] $distributedSwitch.ContactDetails, $this.ContactDetails),\n            $this.ShouldUpdateDscResourceSetting('ContactName', [string] $distributedSwitch.ContactName, $this.ContactName),\n            $this.ShouldUpdateDscResourceSetting('Notes', [string] $distributedSwitch.Notes, $this.Notes),\n            $this.ShouldUpdateDscResourceSetting('Version', [string] $distributedSwitch.Version, $this.Version),\n            $this.ShouldUpdateDscResourceSetting('MaxPorts', $distributedSwitch.MaxPorts, $this.MaxPorts),\n            $this.ShouldUpdateDscResourceSetting('Mtu', $distributedSwitch.Mtu, $this.Mtu),\n            $this.ShouldUpdateDscResourceSetting('NumUplinkPorts', $distributedSwitch.NumUplinkPorts, $this.NumUplinkPorts),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocol',\n                [string] $distributedSwitch.LinkDiscoveryProtocol,\n                $this.LinkDiscoveryProtocol.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocolOperation',\n                [string] $distributedSwitch.LinkDiscoveryProtocolOperation,\n                $this.LinkDiscoveryProtocolOperation.ToString()\n            )\n        )\n\n        return ($shouldUpdateDistributedSwitch -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Distributed Switch parameters.\n    #>\n    [hashtable] GetDistributedSwitchParams() {\n        $distributedSwitchParams = @{}\n\n        $distributedSwitchParams.Server = $this.Connection\n        $distributedSwitchParams.Confirm = $false\n        $distributedSwitchParams.ErrorAction = 'Stop'\n\n        if (![string]::IsNullOrEmpty($this.ContactDetails)) { $distributedSwitchParams.ContactDetails = $this.ContactDetails }\n        if (![string]::IsNullOrEmpty($this.ContactName)) { $distributedSwitchParams.ContactName = $this.ContactName }\n        if (![string]::IsNullOrEmpty($this.Notes)) { $distributedSwitchParams.Notes = $this.Notes }\n        if (![string]::IsNullOrEmpty($this.Version)) { $distributedSwitchParams.Version = $this.Version }\n\n        if ($null -ne $this.MaxPorts) { $distributedSwitchParams.MaxPorts = $this.MaxPorts }\n        if ($null -ne $this.Mtu) { $distributedSwitchParams.Mtu = $this.Mtu }\n        if ($null -ne $this.NumUplinkPorts) { $distributedSwitchParams.NumUplinkPorts = $this.NumUplinkPorts }\n\n        if ($this.LinkDiscoveryProtocol -ne [LinkDiscoveryProtocolProtocol]::Unset) {\n            $distributedSwitchParams.LinkDiscoveryProtocol = $this.LinkDiscoveryProtocol.ToString()\n        }\n\n        if ($this.LinkDiscoveryProtocolOperation -ne [LinkDiscoveryProtocolOperation]::Unset) {\n            $distributedSwitchParams.LinkDiscoveryProtocolOperation = $this.LinkDiscoveryProtocolOperation.ToString()\n        }\n\n        return $distributedSwitchParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Distributed Switch with the specified properties at the specified location.\n    #>\n    [void] AddDistributedSwitch($distributedSwitchLocation) {\n        $distributedSwitchParams = $this.GetDistributedSwitchParams()\n        $distributedSwitchParams.Name = $this.Name\n        $distributedSwitchParams.Location = $distributedSwitchLocation\n\n        <#\n        ReferenceVDSwitch and WithoutPortGroups are parameters only for the New-VDSwitch cmdlet\n        and are not used for the Set-VDSwitch cmdlet.\n        #>\n        if (![string]::IsNullOrEmpty($this.ReferenceVDSwitchName)) { $distributedSwitchParams.ReferenceVDSwitch = $this.ReferenceVDSwitchName }\n        if ($null -ne $this.WithoutPortGroups) { $distributedSwitchParams.WithoutPortGroups = $this.WithoutPortGroups }\n\n        try {\n            New-VDSwitch @distributedSwitchParams\n        }\n        catch {\n            throw \"Cannot create Distributed Switch $($this.Name) at Location $($distributedSwitchLocation.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Distributed Switch with the specified properties.\n    #>\n    [void] UpdateDistributedSwitch($distributedSwitch) {\n        $distributedSwitchParams = $this.GetDistributedSwitchParams()\n\n        try {\n            $distributedSwitch | Set-VDSwitch @distributedSwitchParams\n        }\n        catch {\n            throw \"Cannot update Distributed Switch $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Distributed Switch from the specified location.\n    #>\n    [void] RemoveDistributedSwitch($distributedSwitch) {\n        try {\n            $distributedSwitch | Remove-VDSwitch -Server $this.Connection -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw \"Cannot remove Distributed Switch $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Distributed Switch from the server.\n    #>\n    [void] PopulateResult($distributedSwitch, $result) {\n        if ($null -ne $distributedSwitch) {\n            $result.Name = $distributedSwitch.Name\n            $result.Ensure = [Ensure]::Present\n            $result.ContactDetails = $distributedSwitch.ContactDetails\n            $result.ContactName = $distributedSwitch.ContactName\n            $result.LinkDiscoveryProtocol = $distributedSwitch.LinkDiscoveryProtocol.ToString()\n            $result.LinkDiscoveryProtocolOperation = $distributedSwitch.LinkDiscoveryProtocolOperation.ToString()\n            $result.MaxPorts = $distributedSwitch.MaxPorts\n            $result.Mtu = $distributedSwitch.Mtu\n            $result.Notes = $distributedSwitch.Notes\n            $result.NumUplinkPorts = $distributedSwitch.NumUplinkPorts\n            $result.Version = $distributedSwitch.Version\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.ContactDetails = $this.ContactDetails\n            $result.ContactName = $this.ContactName\n            $result.LinkDiscoveryProtocol = $this.LinkDiscoveryProtocol\n            $result.LinkDiscoveryProtocolOperation = $this.LinkDiscoveryProtocolOperation\n            $result.MaxPorts = $this.MaxPorts\n            $result.Mtu = $this.Mtu\n            $result.Notes = $this.Notes\n            $result.NumUplinkPorts = $this.NumUplinkPorts\n            $result.Version = $this.Version\n        }\n    }\n}\n\n[DscResource()]\nclass VDSwitchVMHost : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch to/from which you want to add/remove the specified VMHosts.\n    #>\n    [DscProperty(Key)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the VMHosts that you want to add/remove to/from the specified vSphere Distributed Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $VMHostNames\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VMHosts should be Present/Absent to/from the specified vSphere Distributed Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $vmHosts = $this.GetVMHosts()\n            $filteredVMHosts = $this.GetFilteredVMHosts($vmHosts, $distributedSwitch)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $this.AddVMHostsToDistributedSwitch($filteredVMHosts, $distributedSwitch)\n            }\n            else {\n                $this.RemoveVMHostsFromDistributedSwitch($filteredVMHosts, $distributedSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $vmHosts = $this.GetVMHosts()\n\n            if ($null -eq $distributedSwitch) {\n                # If the Distributed Switch is $null, it means that Ensure is 'Absent' and the Distributed Switch does not exist.\n                return $true\n            }\n\n            return !$this.ShouldUpdateVMHostsInDistributedSwitch($vmHosts, $distributedSwitch)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VDSwitchVMHost] Get() {\n        try {\n            $result = [VDSwitchVMHost]::new()\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $distributedSwitch = $this.GetDistributedSwitch()\n            $vmHosts = $this.GetVMHosts()\n\n            $result.Server = $this.Connection.Name\n            $result.VMHostNames = $vmHosts | Select-Object -ExpandProperty Name\n            $result.Ensure = $this.Ensure\n\n            if ($null -eq $distributedSwitch) {\n                # If the Distributed Switch is $null, it means that Ensure is 'Absent' and the Distributed Switch does not exist.\n                $result.VdsName = $this.Name\n            }\n            else {\n                $result.VdsName = $distributedSwitch.Name\n            }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch with the specified name from the server if it exists.\n    If the Distributed Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetDistributedSwitch() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            $distributedSwitch = Get-VDSwitch -Server $this.Connection -Name $this.VdsName -ErrorAction SilentlyContinue\n            return $distributedSwitch\n        }\n        else {\n            try {\n                $distributedSwitch = Get-VDSwitch -Server $this.Connection -Name $this.VdsName -ErrorAction Stop\n                return $distributedSwitch\n            }\n            catch {\n                throw \"Could not retrieve Distributed Switch $($this.VdsName). For more information: $($_.Exception.Message)\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHosts with the specified names from the server if they exist.\n    For every VMHost that does not exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetVMHosts() {\n        $vmHosts = @()\n\n        foreach ($vmHostName in $this.VMHostNames) {\n            $vmHost = Get-VMHost -Server $this.Connection -Name $vmHostName -ErrorAction SilentlyContinue\n            if ($null -eq $vmHost) {\n                $this.WriteLogUtil('Warning', \"The passed VMHost {0} was not found and it will be ignored.\", @($vmHostName))\n            }\n            else {\n                $vmHosts += $vmHost\n            }\n        }\n\n        return $vmHosts\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if VMHosts should be added/removed from the Distributed Switch depending on the value of the Ensure property.\n    If Ensure is set to 'Present', checks if all passed VMHosts are part of the Distributed Switch.\n    If Ensure is set to 'Absent', checks if all passed VMHosts are not part of the Distributed Switch.\n    #>\n    [bool] ShouldUpdateVMHostsInDistributedSwitch($vmHosts, $distributedSwitch) {\n        if ($this.Ensure -eq [Ensure]::Present) {\n            foreach ($vmHost in $vmHosts) {\n                $addedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -eq $addedVMHost) {\n                    return $true\n                }\n            }\n        }\n        else {\n            foreach ($vmHost in $vmHosts) {\n                $removedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -ne $removedVMHost) {\n                    return $true\n                }\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the filtered VMHosts based on the value of the Ensure property. If Ensure is set to 'Present', it returns only\n    these VMHosts that are currently not part of the Distributed Switch. The other VMHosts in the array are ignored because they are already part\n    of the Distributed Switch. If Ensure is set to 'Absent', it returns only these VMHosts that are currently part of the Distributed Switch. The other VMHosts\n    in the array are ignored because they are not part of the Distributed Switch. In both cases a warning message is shown to the user when a specific VMHost is\n    ignored.\n    #>\n    [array] GetFilteredVMHosts($vmHosts, $distributedSwitch) {\n        $filteredVMHosts = @()\n\n        if ($this.Ensure -eq [Ensure]::Present) {\n            foreach ($vmHost in $vmHosts) {\n                $addedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -ne $addedVMHost) {\n                    $this.WriteLogUtil('Warning', \"VMHost {0} is already added to Distributed Switch {1} and it will be ignored.\", @($vmHost.Name, $distributedSwitch.Name))\n\n                    continue\n                }\n\n                $filteredVMHosts += $vmHost\n            }\n        }\n        else {\n            foreach ($vmHost in $vmHosts) {\n                $removedVMHost = $vmHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n                if ($null -eq $removedVMHost) {\n                    $this.WriteLogUtil('Warning', \"VMHost {0} is not added to Distributed Switch {1} and it will be ignored.\", @($vmHost.Name, $distributedSwitch.Name))\n\n                    continue\n                }\n\n                $filteredVMHosts += $vmHost\n            }\n        }\n\n        return $filteredVMHosts\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the VMHosts to the specified Distributed Switch.\n    #>\n    [void] AddVMHostsToDistributedSwitch($filteredVMHosts, $distributedSwitch) {\n        try {\n            Add-VDSwitchVMHost -Server $this.Connection -VDSwitch $distributedSwitch -VMHost $filteredVMHosts -ErrorAction Stop\n        }\n        catch {\n            throw \"Could not add VMHosts $filteredVMHosts to Distributed Switch $($distributedSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMHosts from the specified Distributed Switch.\n    #>\n    [void] RemoveVMHostsFromDistributedSwitch($filteredVMHosts, $distributedSwitch) {\n        try {\n            Remove-VDSwitchVMHost -Server $this.Connection -VDSwitch $distributedSwitch -VMHost $filteredVMHosts -ErrorAction Stop\n        }\n        catch {\n            throw \"Could not remove VMHosts $filteredVMHosts from Distributed Switch $($distributedSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostAccount : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the ID for the host account.\n    #>\n    [DscProperty(Key)]\n    [string] $Id\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the Resource should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Permission on the VMHost entity is created for the specified User Id with the specified Role.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $Role\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Password for the host account.\n    #>\n    [DscProperty()]\n    [string] $AccountPassword\n\n    <#\n    .DESCRIPTION\n\n    Provides a description for the host account. The maximum length of the text is 255 symbols.\n    #>\n    [DscProperty()]\n    [string] $Description\n\n    hidden [string] $AccountPasswordParameterName = 'Password'\n    hidden [string] $DescriptionParameterName = 'Description'\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n            $vmHostAccount = $this.GetVMHostAccount()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostAccount) {\n                    $this.AddVMHostAccount()\n                }\n                else {\n                    $this.UpdateVMHostAccount($vmHostAccount)\n                }\n            }\n            else {\n                if ($null -ne $vmHostAccount) {\n                    $this.RemoveVMHostAccount($vmHostAccount)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n            $vmHostAccount = $this.GetVMHostAccount()\n\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostAccount) {\n                    $result = $false\n                }\n                else {\n                    $result = if ($this.ShouldUpdateVMHostAccount($vmHostAccount) -or $this.ShouldCreateAcountPermission($vmHostAccount)) { $false } else { $true }\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostAccount)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostAccount] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostAccount]::new()\n            $result.Server = $this.Server\n\n            $this.EnsureConnectionIsESXi()\n            $vmHostAccount = $this.GetVMHostAccount()\n\n            $this.PopulateResult($vmHostAccount, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the VMHost Account if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetVMHostAccount() {\n        $getVMHostAccountParams = @{\n            Server = $this.Connection\n            Id = $this.Id\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-VMHostAccount @getVMHostAccountParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if a new Permission with the passed Role needs to be created for the specified VMHost Account.\n    #>\n    [bool] ShouldCreateAcountPermission($vmHostAccount) {\n        $getVIPermissionParams = @{\n            Server = $this.Connection\n            Entity = $this.Server\n            Principal = $vmHostAccount\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $existingPermission = Get-VIPermission @getVIPermissionParams\n\n        return ($null -eq $existingPermission)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMHost Account should be updated.\n    #>\n    [bool] ShouldUpdateVMHostAccount($vmHostAccount) {\n        <#\n        If the Account Password is passed, we should check if we can connect to the ESXi host with the passed Id and Password.\n        If we can connect to the host it means that the password is in the desired state so we should close the connection and\n        continue checking the other passed properties. If we cannot connect to the host it means that\n        the desired Password is not equal to the current Password of the Account.\n        #>\n        if ($null -ne $this.AccountPassword) {\n            $connectVIServerParams = @{\n                Server = $this.Server\n                User = $this.Id\n                Password = $this.AccountPassword\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $hostConnection = Connect-VIServer @connectVIServerParams\n\n            if ($null -eq $hostConnection) {\n                return $true\n            }\n            else {\n                $disconnectVIServerParams = @{\n                    Server = $hostConnection\n                    ErrorAction = 'SilentlyContinue'\n                    Verbose = $false\n                    Confirm = $false\n                }\n\n                Disconnect-VIServer @disconnectVIServerParams\n            }\n        }\n\n        return $this.ShouldUpdateDscResourceSetting('Description', $vmHostAccount.Description, $this.Description)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the parameters for the New-VMHostAccount and Set-VMHostAccount cmdlets.\n    #>\n    [void] PopulateVMHostAccountParams($vmHostAccountParams, $parameter, $desiredValue) {\n        if ($null -ne $desiredValue) {\n            $vmHostAccountParams.$parameter = $desiredValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated VMHost Account parameters.\n    #>\n    [hashtable] GetVMHostAccountParams() {\n        $vmHostAccountParams = @{}\n\n        $vmHostAccountParams.Server = $this.Connection\n        $vmHostAccountParams.Confirm = $false\n        $vmHostAccountParams.ErrorAction = 'Stop'\n        $vmHostAccountParams.Verbose = $false\n\n        $this.PopulateVMHostAccountParams($vmHostAccountParams, $this.AccountPasswordParameterName, $this.AccountPassword)\n        $this.PopulateVMHostAccountParams($vmHostAccountParams, $this.DescriptionParameterName, $this.Description)\n\n        return $vmHostAccountParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Permission with the passed Role for the specified VMHost Account.\n    #>\n    [void] CreateAccountPermission($vmHostAccount) {\n        $getVIRoleParams = @{\n            Server = $this.Connection\n            Name = $this.Role\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $accountRole = Get-VIRole @getVIRoleParams\n        if ($null -eq $accountRole) {\n            throw \"The passed role $($this.Role) is not present on the server.\"\n        }\n\n        try {\n            $newVIPermissionParams = @{\n                Server = $this.Connection\n                Entity = $this.Server\n                Principal = $vmHostAccount\n                Role = $accountRole\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            New-VIPermission @newVIPermissionParams\n        }\n        catch {\n            throw \"Cannot assign role $($this.Role) to account $($vmHostAccount.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new VMHost Account with the specified properties.\n    #>\n    [void] AddVMHostAccount() {\n        $vmHostAccountParams = $this.GetVMHostAccountParams()\n        $vmHostAccountParams.Id = $this.Id\n\n        $vmHostAccount = $null\n\n        try {\n            $vmHostAccount = New-VMHostAccount @vmHostAccountParams\n        }\n        catch {\n            throw \"Cannot create VMHost Account $($this.Id). For more information: $($_.Exception.Message)\"\n        }\n\n        $this.CreateAccountPermission($vmHostAccount)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMHost Account with the specified properties.\n    #>\n    [void] UpdateVMHostAccount($vmHostAccount) {\n        $vmHostAccountParams = $this.GetVMHostAccountParams()\n\n        try {\n            $vmHostAccount | Set-VMHostAccount @vmHostAccountParams\n        }\n        catch {\n            throw \"Cannot update VMHost Account $($this.Id). For more information: $($_.Exception.Message)\"\n        }\n\n        if ($this.ShouldCreateAcountPermission($vmHostAccount)) {\n            $this.CreateAccountPermission($vmHostAccount)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the VMHost Account.\n    #>\n    [void] RemoveVMHostAccount($vmHostAccount) {\n        try {\n            $removeVMHostAccountParams = @{\n                Server = $this.Connection\n                HostAccount = $vmHostAccount\n                ErrorAction = 'Stop'\n                Verbose = $false\n                Confirm = $false\n            }\n\n            Remove-VMHostAccount @removeVMHostAccountParams\n        }\n        catch {\n            throw \"Cannot remove VMHost Account $($this.Id). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMHost Account from the server.\n    #>\n    [void] PopulateResult($vmHostAccount, $result) {\n        if ($null -ne $vmHostAccount) {\n            $getVIPermissionParams = @{\n                Server = $this.Connection\n                Entity = $this.Server\n                Principal = $vmHostAccount\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            $permission = Get-VIPermission @getVIPermissionParams\n\n            $result.Id = $vmHostAccount.Id\n            $result.Ensure = [Ensure]::Present\n            $result.Role = $permission.Role\n            $result.Description = $vmHostAccount.Description\n        }\n        else {\n            $result.Id = $this.Id\n            $result.Ensure = [Ensure]::Absent\n            $result.Role = $this.Role\n            $result.Description = $this.Description\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostAdvancedSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Hashtable containing the advanced settings of the specified VMHost, where\n    each key-value pair represents one advanced setting - the key is the name of the\n    setting and the value is the desired value for the setting.\n    #>\n    [DscProperty(Mandatory)]\n    [hashtable] $AdvancedSettings\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostAdvancedSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            return !$this.ShouldUpdateVMHostAdvancedSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostAdvancedSettings] Get() {\n        try {\n            $result = [VMHostAdvancedSettings]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $result.Name = $vmHost.Name\n            $result.AdvancedSettings = @{}\n\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Advanced Settings of the specified VMHost from the server.\n    #>\n    [array] GetAdvancedSettings($vmHost) {\n        try {\n            $retrievedAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost -ErrorAction Stop\n            return $retrievedAdvancedSettings\n        }\n        catch {\n            throw \"Could not retrieve the Advanced Settings of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Advanced Setting if it is present in the retrieved Advanced Settings from the server.\n    Otherwise returns $null.\n    #>\n    [PSObject] GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHostName) {\n        $advancedSetting = $retrievedAdvancedSettings | Where-Object { $_.Name -eq $advancedSettingName }\n        if ($null -eq $advancedSetting) {\n            <#\n            Here a warning log is used instead of 'throw' to ensure that the execution will not stop\n            if an invalid Advanced Setting is present in the passed hashtable and in the same time to\n            provide an information to the user that invalid data is passed.\n            #>\n            $this.WriteLogUtil('Warning', \"Advanced Setting {0} does not exist for VMHost {1} and will be ignored.\", @($advancedSettingName, $vmHostName))\n        }\n\n        return $advancedSetting\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the desired value of the Advanced Setting from the hashtable to the correct type of the value\n    from the server. Works only for primitive types.\n    #>\n    [object] ConvertAdvancedSettingDesiredValueToCorrectType($advancedSetting) {\n        $advancedSettingDesiredValue = $null\n        if ($advancedSetting.Value -is [bool]) {\n            # For bool values the '-as' operator returns 'True' for both 'true' and 'false' strings so specific conversion is needed.\n            $advancedSettingDesiredValue = [System.Convert]::ToBoolean($this.AdvancedSettings[$advancedSetting.Name])\n        }\n        else {\n            $advancedSettingDesiredValue = $this.AdvancedSettings[$advancedSetting.Name] -as $advancedSetting.Value.GetType()\n        }\n\n        return $advancedSettingDesiredValue\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Advanced Setting should be updated depending on the passed desired value.\n    #>\n    [bool] ShouldUpdateVMHostAdvancedSetting($advancedSetting) {\n        <#\n        Each element in the hashtable is of type MSFT_KeyValuePair where the value is a string.\n        So before comparison the value needs to be converted to its original type which can be\n        retrieved from its server value.\n        #>\n        $advancedSettingDesiredValue = $this.ConvertAdvancedSettingDesiredValueToCorrectType($advancedSetting)\n\n        $result = $advancedSettingDesiredValue -ne $advancedSetting.Value\n        if ($result) {\n            $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @(\n                $advancedSetting.Name,\n                $advancedSetting.Value,\n                $advancedSettingDesiredValue\n            ))\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if any of the Advanced Settings present in the hashtable need to be updated.\n    #>\n    [bool] ShouldUpdateVMHostAdvancedSettings($vmHost) {\n        $retrievedAdvancedSettings = $this.GetAdvancedSettings($vmHost)\n\n        foreach ($advancedSettingName in $this.AdvancedSettings.Keys) {\n            $advancedSetting = $this.GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHost.Name)\n\n            if ($null -ne $advancedSetting -and $this.ShouldUpdateVMHostAdvancedSetting($advancedSetting)) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Advanced Option Manager of the specified VMHost.\n    #>\n    [PSObject] GetVMHostAdvancedOptionManager($vmHost) {\n        try {\n            $vmHostAdvancedOptionManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.AdvancedOption -ErrorAction Stop\n            return $vmHostAdvancedOptionManager\n        }\n        catch {\n            throw \"VMHost Advanced Option Manager could not be retrieved. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on these Advanced Settings that are present in the hashtable and\n    need to be updated.\n    #>\n    [void] UpdateVMHostAdvancedSettings($vmHost) {\n        $retrievedAdvancedSettings = $this.GetAdvancedSettings($vmHost)\n        $vmHostAdvancedOptionManager = $this.GetVMHostAdvancedOptionManager($vmHost)\n        $options = @()\n\n        foreach ($advancedSettingName in $this.AdvancedSettings.Keys) {\n            $advancedSetting = $this.GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHost.Name)\n\n            if ($null -ne $advancedSetting -and $this.ShouldUpdateVMHostAdvancedSetting($advancedSetting)) {\n                <#\n                Each element in the hashtable is of type MSFT_KeyValuePair where the value is a string.\n                So before setting the value of the option, we need to convert it to its original type which can be\n                retrieved from its server value.\n                #>\n                $option = New-Object VMware.Vim.OptionValue\n                $option.Key = $advancedSettingName\n                $option.Value = $this.ConvertAdvancedSettingDesiredValueToCorrectType($advancedSetting)\n\n                $options += $option\n            }\n        }\n\n        if ($options.Length -eq 0) {\n            return\n        }\n\n        try {\n            Update-VMHostAdvancedSettings -VMHostAdvancedOptionManager $vmHostAdvancedOptionManager -Options $options\n        }\n        catch {\n            throw \"The Advanced Settings Update operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Advanced Settings from the server.\n    #>\n    [void] PopulateResult($vmHost, $result) {\n        $retrievedAdvancedSettings = $this.GetAdvancedSettings($vmHost)\n\n        foreach ($advancedSettingName in $this.AdvancedSettings.Keys) {\n            $advancedSetting = $this.GetAdvancedSetting($retrievedAdvancedSettings, $advancedSettingName, $vmHost.Name)\n\n            if ($null -ne $advancedSetting) {\n                <#\n                The LCM converts the hashtable to MSFT_KeyValuePair class which has the following properties:\n                Key of type string and Value of type string. So the value of the Advanced Setting from the server\n                should be converted to string to avoid an error to be thrown. This will only work for primitive types\n                like bool, int, long and so on. If a non-primitive type is introduced for Advanced Setting, invalid result\n                will be returned from the conversion.\n                #>\n                $result.AdvancedSettings[$advancedSettingName] = $advancedSetting.Value.ToString()\n            }\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostAgentVM : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Datastore used for deploying Agent VMs on this host.\n    #>\n    [DscProperty()]\n    [string] $AgentVmDatastore\n\n    <#\n    .DESCRIPTION\n\n    Specifies the Management Network for Agent VMs on this host.\n    #>\n    [DscProperty()]\n    [string] $AgentVmNetwork\n\n    hidden [string] $AgentVmDatastoreName = 'AgentVmDatastore'\n    hidden [string] $AgentVmNetworkName = 'AgentVmNetwork'\n    hidden [string] $GetAgentVmDatastoreAsViewObjectMethodName = 'GetAgentVmDatastoreAsViewObject'\n    hidden [string] $GetAgentVmNetworkAsViewObjectMethodName = 'GetAgentVmNetworkAsViewObject'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            # vCenter Connection is needed to retrieve the EsxAgentHostManager.\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $esxAgentHostManager = $this.GetEsxAgentHostManager($vmHost)\n\n            $this.UpdateAgentVMConfiguration($vmHost, $esxAgentHostManager)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            # vCenter Connection is needed to retrieve the EsxAgentHostManager.\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $esxAgentHostManager = $this.GetEsxAgentHostManager($vmHost)\n\n            return !$this.ShouldUpdateAgentVMConfiguration($esxAgentHostManager)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostAgentVM] Get() {\n        try {\n            $result = [VMHostAgentVM]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n\n            # vCenter Connection is needed to retrieve the EsxAgentHostManager.\n            $this.EnsureConnectionIsvCenter()\n\n            $vmHost = $this.GetVMHost()\n            $esxAgentHostManager = $this.GetEsxAgentHostManager($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($esxAgentHostManager, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the EsxAgentHostManager of the specified VMHost from the server.\n    #>\n    [PSObject] GetEsxAgentHostManager($vmHost) {\n        try {\n            $esxAgentHostManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.EsxAgentHostManager -ErrorAction Stop\n            return $esxAgentHostManager\n        }\n        catch {\n            throw \"Could not retrieve the EsxAgentHostManager of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the AgentVM Datastore of the EsxAgentHostManager of the specified VMHost from the server as a View Object.\n    #>\n    [PSObject] GetAgentVmDatastoreAsViewObject($esxAgentHostManager) {\n        try {\n            $datastoreAsViewObject = Get-View -Server $this.Connection -Id $esxAgentHostManager.ConfigInfo.AgentVmDatastore -ErrorAction Stop\n            return $datastoreAsViewObject\n        }\n        catch {\n            throw \"Could not retrieve the AgentVM Datastore of the EsxAgentHostManager. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the AgentVM Network of the EsxAgentHostManager of the specified VMHost from the server as a View Object.\n    #>\n    [PSObject] GetAgentVmNetworkAsViewObject($esxAgentHostManager) {\n        try {\n            $networkAsViewObject = Get-View -Server $this.Connection -Id $esxAgentHostManager.ConfigInfo.AgentVmNetwork -ErrorAction Stop\n            return $networkAsViewObject\n        }\n        catch {\n            throw \"Could not retrieve the AgentVM Network of the EsxAgentHostManager. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the AgentVM Setting needs to be updated with the desired value.\n    #>\n    [bool] ShouldUpdateAgentVMSetting($esxAgentHostManager, $agentVmSetting, $agentVmSettingName, $getAgentVmSettingAsViewObjectMethodName) {\n        if ($null -eq $agentVmSetting) {\n            if ($null -ne $esxAgentHostManager.ConfigInfo.$agentVmSettingName) {\n                return $true\n            }\n        }\n        else {\n            if ($null -eq $esxAgentHostManager.ConfigInfo.$agentVmSettingName) {\n                return $true\n            }\n            else {\n                $agentVmSettingAsViewObject = $this.$getAgentVmSettingAsViewObjectMethodName($esxAgentHostManager)\n                if ($agentVmSetting -ne $agentVmSettingAsViewObject.Name) {\n                    $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @(\n                        $agentVmSettingName,\n                        $agentVmSettingAsViewObject.Name,\n                        $agentVmSetting\n                    ))\n\n                    return $true\n                }\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the AgentVM Configuration needs to be updated with the desired values.\n    #>\n    [bool] ShouldUpdateAgentVMConfiguration($esxAgentHostManager) {\n        if ($this.ShouldUpdateAgentVMSetting($esxAgentHostManager, $this.AgentVmDatastore, $this.AgentVmDatastoreName, $this.GetAgentVmDatastoreAsViewObjectMethodName)) {\n            return $true\n        }\n        elseif ($this.ShouldUpdateAgentVMSetting($esxAgentHostManager, $this.AgentVmNetwork, $this.AgentVmNetworkName, $this.GetAgentVmNetworkAsViewObjectMethodName)) {\n            return $true\n        }\n        else {\n            return $false\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore for AgentVM from the server if it exists.\n    If the Datastore name is not passed it returns $null and if the Datastore does not exist\n    it throws an exception.\n    #>\n    [PSObject] GetDatastoreForAgentVM($vmHost) {\n        if ($null -eq $this.AgentVmDatastore) {\n            return $null\n        }\n\n        try {\n            $datastore = Get-Datastore -Server $this.Connection -Name $this.AgentVmDatastore -RelatedObject $vmHost -ErrorAction Stop\n            return $datastore.ExtensionData.MoRef\n        }\n        catch {\n            throw \"Could not retrieve Datastore $($this.AgentVmDatastore) for VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Network for AgentVM from the specified VMHost if it exists.\n    If the Network name is not passed it returns $null and if the Network does not exist\n    it throws an exception.\n    #>\n    [PSObject] GetNetworkForAgentVM($vmHost) {\n        if ($null -eq $this.AgentVmNetwork) {\n            return $null\n        }\n\n        $foundNetwork = $null\n        $networks = $vmHost.ExtensionData.Network\n\n        foreach ($network in $networks) {\n            $networkAsViewObject = Get-View -Server $this.Connection -Id $network\n            if ($this.AgentVmNetwork -eq $networkAsViewObject.Name) {\n                $foundNetwork = $network\n                break\n            }\n        }\n\n        if ($null -eq $foundNetwork) {\n            throw \"Could not find Network $($this.AgentVmNetwork) for VMHost $($vmHost.Name).\"\n        }\n\n        return $foundNetwork\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the AgentVM Configuration of the specified VMHost by setting the Datastore and Network.\n    #>\n    [void] UpdateAgentVMConfiguration($vmHost, $esxAgentHostManager) {\n        $datastore = $this.GetDatastoreForAgentVM($vmHost)\n        $network = $this.GetNetworkForAgentVM($vmHost)\n\n        $configInfo = New-Object VMware.Vim.HostEsxAgentHostManagerConfigInfo\n\n        $configInfo.AgentVmDatastore = $datastore\n        $configInfo.AgentVmNetwork = $network\n\n        try {\n            Update-AgentVMConfiguration -EsxAgentHostManager $esxAgentHostManager -EsxAgentHostManagerConfigInfo $configInfo\n        }\n        catch {\n            throw \"The AgentVM Configuration of VMHost $($vmHost.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the AgentVM Setting value from the Configuration on the server.\n    #>\n    [string] PopulateAgentVmSetting($esxAgentHostManager, $agentVmSettingName, $getAgentVmSettingAsViewObjectMethodName) {\n        if ($null -eq $esxAgentHostManager.ConfigInfo.$agentVmSettingName) {\n            return $null\n        }\n        else {\n            $agentVmSettingAsViewObject = $this.$getAgentVmSettingAsViewObjectMethodName($esxAgentHostManager)\n            return $agentVmSettingAsViewObject.Name\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the AgentVM Settings from the server.\n    #>\n    [void] PopulateResult($esxAgentHostManager, $result) {\n        $result.AgentVmDatastore = $this.PopulateAgentVmSetting($esxAgentHostManager, $this.AgentVmDatastoreName, $this.GetAgentVmDatastoreAsViewObjectMethodName)\n        $result.AgentVmNetwork = $this.PopulateAgentVmSetting($esxAgentHostManager, $this.AgentVmNetworkName, $this.GetAgentVmNetworkAsViewObjectMethodName)\n    }\n}\n\n[DscResource()]\nclass VMHostAuthentication : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the domain to join/leave. The name should be the fully qualified domain name (FQDN).\n    #>\n    [DscProperty(Mandatory)]\n    [string] $DomainName\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the specified VMHost should join/leave the specified domain.\n    #>\n    [DscProperty(Mandatory)]\n    [DomainAction] $DomainAction\n\n    <#\n    .DESCRIPTION\n\n    The credentials needed for joining the specified domain.\n    #>\n    [DscProperty()]\n    [PSCredential] $DomainCredential\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostAuthenticationInfo = $this.GetVMHostAuthenticationInfo($vmHost)\n\n            if ($this.DomainAction -eq [DomainAction]::Join) {\n                $this.JoinDomain($vmHostAuthenticationInfo, $vmHost)\n            }\n            else {\n                $this.LeaveDomain($vmHostAuthenticationInfo, $vmHost)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostAuthenticationInfo = $this.GetVMHostAuthenticationInfo($vmHost)\n\n            $result = $null\n            if ($this.DomainAction -eq [DomainAction]::Join) {\n                $result = !$this.ShouldUpdateDscResourceSetting('DomainName', [string] $vmHostAuthenticationInfo.Domain, $this.DomainName)\n            }\n            else {\n                $result = ($null -eq $vmHostAuthenticationInfo.Domain)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostAuthentication] Get() {\n        try {\n            $result = [VMHostAuthentication]::new()\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostAuthenticationInfo = $this.GetVMHostAuthenticationInfo($vmHost)\n\n            $this.PopulateResult($vmHostAuthenticationInfo, $vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Authentication information for the specified VMHost.\n    #>\n    [PSObject] GetVMHostAuthenticationInfo($vmHost) {\n        try {\n            $vmHostAuthenticationInfo = Get-VMHostAuthentication -Server $this.Connection -VMHost $vmHost -ErrorAction Stop\n            return $vmHostAuthenticationInfo\n        }\n        catch {\n            throw \"Could not retrieve Authentication information for VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Includes the specified VMHost in the specified domain.\n    #>\n    [void] JoinDomain($vmHostAuthenticationInfo, $vmHost) {\n        $setVMHostAuthenticationParams = @{\n            VMHostAuthentication = $vmHostAuthenticationInfo\n            Domain = $this.DomainName\n            Credential = $this.DomainCredential\n            JoinDomain = $true\n            Confirm = $false\n            ErrorAction = 'Stop'\n        }\n\n        try {\n            Set-VMHostAuthentication @setVMHostAuthenticationParams\n        }\n        catch {\n            throw \"Could not include VMHost $($vmHost.Name) in domain $($this.DomainName). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Excludes the specified VMHost from the specified domain.\n    #>\n    [void] LeaveDomain($vmHostAuthenticationInfo, $vmHost) {\n        $setVMHostAuthenticationParams = @{\n            VMHostAuthentication = $vmHostAuthenticationInfo\n            LeaveDomain = $true\n            Force = $true\n            Confirm = $false\n            ErrorAction = 'Stop'\n        }\n\n        try {\n            Set-VMHostAuthentication @setVMHostAuthenticationParams\n        }\n        catch {\n            throw \"Could not exclude VMHost $($vmHost.Name) from domain $($this.DomainName). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($vmHostAuthenticationInfo, $vmHost, $result) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        if ($null -ne $vmHostAuthenticationInfo.Domain) {\n            $result.DomainName = $vmHostAuthenticationInfo.Domain\n            $result.DomainAction = [DomainAction]::Join\n        }\n        else {\n            $result.DomainName = $this.DomainName\n            $result.DomainAction = [DomainAction]::Leave\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostCache : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore used for swap performance enhancement.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the space to allocate on the specified Datastore to implement swap performance enhancements, in GB.\n    This value should be less than or equal to the free space capacity of the Datastore.\n    #>\n    [DscProperty(Mandatory)]\n    [double] $SwapSizeGB\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateHostCacheConfiguration($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            return !$this.ShouldUpdateHostCacheConfiguration($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostCache] Get() {\n        try {\n            $result = [VMHostCache]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    hidden [int] $NumberOfFractionalDigits = 3\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Cache Configuration Manager of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostCacheConfigurationManager($vmHost) {\n        try {\n            $vmHostCacheConfigurationManager = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.CacheConfigurationManager -ErrorAction Stop\n            return $vmHostCacheConfigurationManager\n        }\n        catch {\n            throw \"Could not retrieve the Cache Configuration Manager of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore for Host Cache Configuration from the server if it exists.\n    If the Datastore does not exist, it throws an exception.\n    #>\n    [PSObject] GetDatastore($vmHost) {\n        try {\n            $foundDatastore = Get-Datastore -Server $this.Connection -Name $this.DatastoreName -RelatedObject $vmHost -ErrorAction Stop\n            return $foundDatastore\n        }\n        catch {\n            throw \"Could not retrieve Datastore $($this.DatastoreName) for VMHost $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Cache Info for the specified Datastore from the Host Cache Configuration.\n    If the Datastore is not enabled for swap performance, it throws an exception.\n    #>\n    [PSObject] GetDatastoreCacheInfo($vmHostCacheConfigurationManager, $foundDatastore) {\n        $datastoreCacheInfo = $vmHostCacheConfigurationManager.CacheConfigurationInfo | Where-Object { $_.Key -eq $foundDatastore.ExtensionData.MoRef }\n        if ($null -eq $datastoreCacheInfo) {\n            throw \"Datastore $($foundDatastore.Name) could not be found in enabled for swap performance Datastores.\"\n        }\n\n        return $datastoreCacheInfo\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed MB value to GB value by rounding it down with 3 fractional digits in the return value.\n    #>\n    [double] ConvertMBValueToGBValue($mbValue) {\n        return [Math]::Round($mbValue * 1MB / 1GB, $this.NumberOfFractionalDigits)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed GB value to MB value by rounding it down.\n    #>\n    [long] ConvertGBValueToMBValue($gbValue) {\n        return [long] [Math]::Round($gbValue * 1GB / 1MB)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Host Cache Configuration should be updated for the specified VMHost by checking\n    if the current Swap Size is equal to the desired one for the specified Datastore.\n    #>\n    [bool] ShouldUpdateHostCacheConfiguration($vmHost) {\n        $vmHostCacheConfigurationManager = $this.GetVMHostCacheConfigurationManager($vmHost)\n        $foundDatastore = $this.GetDatastore($vmHost)\n        $datastoreCacheInfo = $this.GetDatastoreCacheInfo($vmHostCacheConfigurationManager, $foundDatastore)\n\n        return $this.ShouldUpdateDscResourceSetting('SwapSizeGB', $this.ConvertMBValueToGBValue($datastoreCacheInfo.SwapSize), $this.SwapSizeGB)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Host Cache Configuration of the specified VMHost by changing the Swap Size for the\n    specified Datastore.\n    #>\n    [void] UpdateHostCacheConfiguration($vmHost) {\n        $vmHostCacheConfigurationManager = $this.GetVMHostCacheConfigurationManager($vmHost)\n        $foundDatastore = $this.GetDatastore($vmHost)\n\n        if ($this.SwapSizeGB -lt 0) {\n            throw \"The passed Swap Size $($this.SwapSizeGB) is less than zero.\"\n        }\n\n        if ($this.SwapSizeGB -gt $foundDatastore.FreeSpaceGB) {\n            throw \"The passed Swap Size $($this.SwapSizeGB) is larger than the free space of the Datastore $($foundDatastore.Name).\"\n        }\n\n        $hostCacheConfigurationSpec = New-Object VMware.Vim.HostCacheConfigurationSpec\n        $hostCacheConfigurationSpec.Datastore = $foundDatastore.ExtensionData.MoRef\n        $hostCacheConfigurationSpec.SwapSize = $this.ConvertGBValueToMBValue($this.SwapSizeGB)\n\n        $hostCacheConfigurationResult = Update-HostCacheConfiguration -VMHostCacheConfigurationManager $vmHostCacheConfigurationManager -Spec $hostCacheConfigurationSpec\n        $hostCacheConfigurationTask = Get-Task -Server $this.Connection -Id $hostCacheConfigurationResult\n\n        try {\n            Wait-Task -Task $hostCacheConfigurationTask -ErrorAction Stop\n        }\n        catch {\n            throw \"An error occured while updating Cache Configuration for VMHost $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n\n        $this.WriteLogUtil('Verbose', \"Cache Configuration was successfully updated for VMHost {0}.\", @($this.Name))\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Host Cache Configuration from the server.\n    #>\n    [void] PopulateResult($vmHost, $result) {\n        $vmHostCacheConfigurationManager = $this.GetVMHostCacheConfigurationManager($vmHost)\n        $foundDatastore = $this.GetDatastore($vmHost)\n        $datastoreCacheInfo = $this.GetDatastoreCacheInfo($vmHostCacheConfigurationManager, $foundDatastore)\n\n        $result.DatastoreName = $foundDatastore.Name\n        $result.SwapSizeGB = $this.ConvertMBValueToGBValue($datastoreCacheInfo.SwapSize)\n    }\n}\n\n[DscResource()]\nclass VMHostConfiguration : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the state of the VMHost. If there are powered on VMs on the VMHost, the VMHost can be set into Maintenance mode, only if it is a part of a Drs-enabled Cluster.\n    Before entering Maintenance mode, if the VMHost is fully automated, all powered on VMs are relocated. If the VMHost is not fully automated,\n    a Drs recommendation is generated and all powered on VMs are relocated or powered off.\n    Valid values are Connected, Disconnected and Maintenance.\n    #>\n    [DscProperty()]\n    [VMHostState] $State = [VMHostState]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the license key to be used by the VMHost. You can set the VMHost to evaluation mode by passing the '00000-00000-00000-00000-00000' evaluation key.\n    #>\n    [DscProperty()]\n    [string] $LicenseKey\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Time Zone for the VMHost.\n    #>\n    [DscProperty()]\n    [string] $TimeZoneName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore that is visible to the VMHost and can be used for storing swapfiles for the VMs that run on the VMHost. Using a VMHost-specific\n    swap location might degrade the VMotion performance.\n    #>\n    [DscProperty()]\n    [string] $VMSwapfileDatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the swapfile placement policy.\n    Valid values are InHostDatastore and WithVM.\n    #>\n    [DscProperty()]\n    [VMSwapfilePolicy] $VMSwapfilePolicy = [VMSwapfilePolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the host profile associated with the VMHost. If the value is an empty string, the current profile association should not exist.\n    #>\n    [DscProperty()]\n    [string] $HostProfileName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the KmsCluster which is used to generate a key to set the VMHost. If the property is passed and the VMHost is not in CryptoSafe state,\n    the DSC Resource makes the VMHost CryptoSafe. If the property is passed and the VMHost is already in CryptoSafe state, the DSC Resource resets the CryptoKey in the VMHost.\n    #>\n    [DscProperty()]\n    [string] $KmsClusterName\n\n    <#\n    .DESCRIPTION\n\n    If the value is $true, vCenter Server system automatically reregisters the VMs that are compatible for reregistration. If they are not compatible, they remain on the VMHost.\n    The Evacuate property is valid only when the connection is to a vCenter Server system and the State property is 'Maintenance'. Also, the VMHost must be in a Drs-enabled Cluster.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Evacuate\n\n    <#\n    .DESCRIPTION\n\n    Specifies the special action to take regarding Virtual SAN data when moving in Maintenance mode. The VsanDataMigrationMode property is valid only when the connection is to a\n    vCenter Server system and the State property is 'Maintenance'.\n    #>\n    [DscProperty()]\n    [VsanDataMigrationMode] $VsanDataMigrationMode = [VsanDataMigrationMode]::Unset\n\n    hidden [string] $ClusterType = 'VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster'\n    hidden [int] $EnterMaintenanceModeTaskSecondsToSleep = 5\n\n    hidden [string] $ModifyVMHostConfigurationMessage = \"Modifying the configuration of VMHost {0}.\"\n    hidden [string] $ApplyingDrsRecommendationsFromClusterMessage = \"Applying Drs Recommendations from Cluster {0}.\"\n    hidden [string] $VMHostStateWasChangedSuccessfullyMessage = \"The state of the VMHost {0} was changed successfully to {1}.\"\n    hidden [string] $ModifyVMHostCryptoKeyMessage = \"Modifying the Crypto Key of VMHost {0} by using Kms Cluster {1}.\"\n\n    hidden [string] $CouldNotRetrieveTimeZoneMessage = \"Could not retrieve Time Zone {0} available on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveDatastoreMessage = \"Could not retrieve Datastore {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveHostProfileMessage = \"Could not retrieve Host Profile {0} from Server {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveHostProfileAssociatedWithVMHostMessage = \"Could not retrieve Host Profile associated with VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveKmsClusterMessage = \"Could not retrieve Kms Cluster {0} from the Server. For more information: {1}\"\n    hidden [string] $CouldNotModifyVMHostConfigurationMessage = \"Could not modify the configuration of VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotModifyVMHostCryptoKeyMessage = \"Could not modify the Crypto Key of VMHost {0} by using Kms Cluster {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            if ($this.ShouldModifyVMHostConfiguration($vmHost)) {\n                $setVMHostParams = $this.GetVMHostParamsToModify($vmHost)\n\n                if ($this.ShouldApplyDrsRecommendation($vmHost)) {\n                    $this.ModifyVMHostConfigurationAndApplyDrsRecommendation($setVMHostParams)\n                }\n                else {\n                    $this.ModifyVMHostConfiguration($setVMHostParams)\n                }\n            }\n\n            if ($this.ShouldModifyCryptoKeyOfVMHost($vmHost)) {\n                $this.ModifyVMHostCryptoKey($vmHost)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $result = $true\n\n            if ($this.ShouldModifyVMHostConfiguration($vmHost) -or $this.ShouldModifyCryptoKeyOfVMHost($vmHost)) {\n                $result = $false\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostConfiguration] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostConfiguration]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Time Zone with the specified name available on the specified VMHost.\n    #>\n    [PSObject] GetVMHostTimeZone($vmHost) {\n        $getVMHostAvailableTimeZoneParams = @{\n            Server = $this.Connection\n            Name = $this.TimeZoneName\n            VMHost = $vmHost\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $vmHostTimeZone = Get-VMHostAvailableTimeZone @getVMHostAvailableTimeZoneParams\n            return $vmHostTimeZone\n        }\n        catch {\n            throw ($this.CouldNotRetrieveTimeZoneMessage -f $this.TimeZoneName, $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Datastore with the specified name that is used for storing swapfiles for the VMs that run on the specified VMHost.\n    #>\n    [PSObject] GetVMSwapfileDatastore($vmHost) {\n        $getDatastoreParams = @{\n            Server = $this.Connection\n            Name = $this.VMSwapfileDatastoreName\n            VMHost = $vmHost\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $vmSwapfileDatastore = Get-Datastore @getDatastoreParams\n            return $vmSwapfileDatastore\n        }\n        catch {\n            throw ($this.CouldNotRetrieveDatastoreMessage -f $this.VMSwapfileDatastoreName, $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Host Profile with the specified name from the Server.\n    #>\n    [PSObject] GetHostProfile() {\n        $getVMHostProfileParams = @{\n            Server = $this.Connection\n            Name = $this.HostProfileName\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $hostProfile = Get-VMHostProfile @getVMHostProfileParams\n            return $hostProfile\n        }\n        catch {\n            throw ($this.CouldNotRetrieveHostProfileMessage -f $this.HostProfileName, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Host Profile associated with the specified VMHost if the VMHost is associated with a Host Profile.\n    Otherwise returns $null, which indicates that the VMHost is not associated with a Host Profile.\n    #>\n    [PSObject] GetHostProfileAssociatedWithVMHost($vmHost) {\n        $getVMHostProfileParams = @{\n            Server = $this.Connection\n            Entity = $vmHost\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        if (![string]::IsNullOrEmpty($this.HostProfileName)) {\n            $getVMHostProfileParams.Name = $this.HostProfileName\n        }\n\n        try {\n            $hostProfileAssociatedWithVMHost = Get-VMHostProfile @getVMHostProfileParams\n            return $hostProfileAssociatedWithVMHost\n        }\n        catch {\n            throw ($this.CouldNotRetrieveHostProfileAssociatedWithVMHostMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Kms Cluster with the specified name from the Server.\n    #>\n    [PSObject] GetKmsCluster() {\n        try {\n            $kmsCluster = Get-KmsCluster -Server $this.Connection -Name $this.KmsClusterName -ErrorAction Stop -Verbose:$false\n            return $kmsCluster\n        }\n        catch {\n            throw ($this.CouldNotRetrieveKmsClusterMessage -f $this.KmsClusterName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates and returns the parameters which should be modified with the Set-VMHost cmdlet.\n    #>\n    [hashtable] GetVMHostParamsToModify($vmHost) {\n        $setVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if (\n            ![string]::IsNullOrEmpty($this.LicenseKey) -and\n            $this.LicenseKey -ne $vmHost.LicenseKey\n        ) { $setVMHostParams.LicenseKey = $this.LicenseKey }\n\n        if (\n            ![string]::IsNullOrEmpty($this.TimeZoneName) -and\n            $this.TimeZoneName -ne $vmHost.TimeZone.Name\n        ) { $setVMHostParams.TimeZone = $this.GetVMHostTimeZone($vmHost) }\n\n        if (\n            ![string]::IsNullOrEmpty($this.VMSwapfileDatastoreName) -and\n            $this.VMSwapfileDatastoreName -ne $vmHost.VMSwapfileDatastore.Name\n        ) { $setVMHostParams.VMSwapfileDatastore = $this.GetVMSwapfileDatastore($vmHost) }\n\n        if (\n            $this.VMSwapfilePolicy -ne [VMSwapfilePolicy]::Unset -and\n            $this.VMSwapfilePolicy.ToString() -ne $vmHost.VMSwapfilePolicy.ToString()\n        ) { $setVMHostParams.VMSwapfilePolicy = $this.VMSwapfilePolicy.ToString() }\n\n        if ($null -ne $this.HostProfileName) {\n            if ($this.HostProfileName -eq [string]::Empty) {\n                # Profile value '$null' cannot be passed if the specified VMHost does not have a Host Profile associated with it.\n                $hostProfileAssociatedWithVMHost = $this.GetHostProfileAssociatedWithVMHost($vmHost)\n                if ($null -ne $hostProfileAssociatedWithVMHost) {\n                    $setVMHostParams.Profile = $null\n                }\n            }\n            else {\n                $setVMHostParams.Profile = $this.GetHostProfile()\n            }\n        }\n\n        if (\n            $this.State -ne [VMHostState]::Unset -and\n            $this.State.ToString() -ne $vmHost.ConnectionState.ToString()\n        ) {\n            $setVMHostParams.State = $this.State.ToString()\n            if ($this.State -eq [VMHostState]::Maintenance) {\n                if ($null -ne $this.Evacuate) { $setVMHostParams.Evacuate = $this.Evacuate }\n                if ($this.VsanDataMigrationMode -ne [VsanDataMigrationMode]::Unset) { $setVMHostParams.VsanDataMigrationMode = $this.VsanDataMigrationMode.ToString() }\n            }\n        }\n\n        return $setVMHostParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the configuration of the specified VMHost should be modified.\n    #>\n    [bool] ShouldModifyVMHostConfiguration($vmHost) {\n        $shouldModifyVMHostConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('State', [string] $vmHost.ConnectionState, $this.State.ToString()),\n            $this.ShouldUpdateDscResourceSetting('LicenseKey', [string] $vmHost.LicenseKey, $this.LicenseKey),\n            $this.ShouldUpdateDscResourceSetting('TimeZoneName', [string] $vmHost.TimeZone.Name, $this.TimeZoneName),\n            $this.ShouldUpdateDscResourceSetting('VMSwapfileDatastoreName', [string] $vmHost.VMSwapfileDatastore.Name, $this.VMSwapfileDatastoreName),\n            $this.ShouldUpdateDscResourceSetting('VMSwapfilePolicy', [string] $vmHost.VMSwapfilePolicy, $this.VMSwapfilePolicy.ToString())\n        )\n\n        <#\n        If the Host Profile name is specified and it is an empty string, the VMHost should not be associated with a Host Profile.\n        If the Host Profile name is not an empty string, the VMHost should be associated with the specified Host Profile.\n        #>\n        if ($null -ne $this.HostProfileName) {\n            $hostProfileAssociatedWithVMHost = $this.GetHostProfileAssociatedWithVMHost($vmHost)\n            if ($this.HostProfileName -eq [string]::Empty) {\n                $shouldModifyVMHostConfiguration += ($null -ne $hostProfileAssociatedWithVMHost)\n            }\n            else {\n                $shouldModifyVMHostConfiguration += ($null -eq $hostProfileAssociatedWithVMHost)\n            }\n        }\n\n        return ($shouldModifyVMHostConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the CryptoKey of the specified VMHost should be modified.\n    #>\n    [bool] ShouldModifyCryptoKeyOfVMHost($vmHost) {\n        $result = $false\n\n        if (![string]::IsNullOrEmpty($this.KmsClusterName)) {\n            $kmsCluster = $this.GetKmsCluster()\n            $result = ($kmsCluster.Id -ne $vmHost.ExtensionData.Runtime.CryptoKeyId.ProviderId.Id)\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if a Drs recommendation should be generated and applied. A Drs recommendation is generated when the following criteria is met:\n    1. State property is specified with 'Maintenance' value.\n    2. The current State of the VMHost is not 'Maintenance'.\n    3. The VMHost is part of a Drs Cluster and the Cluster is not 'Fully Automated'.\n    #>\n    [bool] ShouldApplyDrsRecommendation($vmHost) {\n        $result = $false\n        $vmHostParent = $vmHost.Parent\n\n        if (\n            $this.State -ne [VMHostState]::Unset -and\n            $this.State -eq [VMHostState]::Maintenance -and\n            $vmHost.ConnectionState.ToString() -ne ([VMHostState]::Maintenance).ToString() -and\n            $this.IsVIObjectOfTheCorrectType($vmHostParent, $this.ClusterType)\n        ) {\n            $clusterAutomationLevel = $vmHostParent.DrsAutomationLevel.ToString()\n            $result = (\n                $vmHostParent.DrsEnabled -and\n                $clusterAutomationLevel -ne ([DrsAutomationLevel]::FullyAutomated).ToString()\n            )\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the specified configuration parameters of the VMHost.\n    Generates and applies the Drs Recommendation from the Cluster of the specified VMHost.\n    #>\n    [void] ModifyVMHostConfigurationAndApplyDrsRecommendation($setVMHostParams) {\n        $setVMHostParams.RunAsync = $true\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostConfigurationMessage, @($setVMHostParams.VMHost.Name))\n\n            $modifyVMHostConfigurationTask = Set-VMHost @setVMHostParams\n\n            # The Drs Recommendation is not generated immediately after 'EnterMaintenance' task generation.\n            Start-Sleep -Seconds $this.EnterMaintenanceModeTaskSecondsToSleep\n\n            $getDrsRecommendationParams = @{\n                Server = $this.Connection\n                Cluster = $setVMHostParams.VMHost.Parent\n                Refresh = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            $clusterDrsRecommendations = Get-DrsRecommendation @getDrsRecommendationParams\n            if ($null -ne $clusterDrsRecommendations) {\n                $applyDrsRecommendationParams = @{\n                    DrsRecommendation = $clusterDrsRecommendations\n                    RunAsync = $true\n                    Confirm = $false\n                    ErrorAction = 'Stop'\n                    Verbose = $false\n                }\n\n                # All generated Drs Recommendations from the Cluster should be applied and when the Task is completed all powered on VMs are relocated or powered off.\n                $this.WriteLogUtil('Verbose', $this.ApplyingDrsRecommendationsFromClusterMessage, @($setVMHostParams.VMHost.Parent.Name))\n\n                $applyDrsRecommendationTask = Apply-DrsRecommendation @applyDrsRecommendationParams\n                Wait-Task -Task $applyDrsRecommendationTask -ErrorAction Stop -Verbose:$false\n            }\n\n            Wait-Task -Task $modifyVMHostConfigurationTask -ErrorAction Stop -Verbose:$false\n            $vmHost = $this.GetVMHost()\n\n            # The state of the VMHost should be verified when the Task completes.\n            if ($vmHost.ConnectionState.ToString() -eq ([VMHostState]::Maintenance).ToString()) {\n                $this.WriteLogUtil('Verbose', $this.VMHostStateWasChangedSuccessfullyMessage, @($vmHost.Name, $vmHost.ConnectionState.ToString()))\n            }\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostConfigurationMessage -f $setVMHostParams.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the specified configuration parameters of the VMHost.\n    #>\n    [void] ModifyVMHostConfiguration($setVMHostParams) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostConfigurationMessage, @($setVMHostParams.VMHost.Name))\n\n            Set-VMHost @setVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostConfigurationMessage -f $setVMHostParams.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the CryptoKey of the specified VMHost.\n    #>\n    [void] ModifyVMHostCryptoKey($vmHost) {\n        $setVMHostParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        $kmsCluster = $this.GetKmsCluster()\n        $setVMHostParams.KmsCluster = $kmsCluster\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostCryptoKeyMessage, @($vmHost.Name, $kmsCluster.Name))\n\n            Set-VMHost @setVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostCryptoKeyMessage -f $vmHost.Name, $kmsCluster.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.State = $vmHost.ConnectionState.ToString()\n        $result.Evacuate = $this.Evacuate\n        $result.VsanDataMigrationMode = $this.VsanDataMigrationMode\n        $result.LicenseKey = $vmHost.LicenseKey\n        $result.TimeZoneName = $vmHost.TimeZone.Name\n        $result.VMSwapfileDatastoreName = $vmHost.VMSwapfileDatastore.Name\n        $result.VMSwapfilePolicy = $vmHost.VMSwapfilePolicy.ToString()\n\n        $hostProfileAssociatedWithVMHost = $this.GetHostProfileAssociatedWithVMHost($vmHost)\n        $result.HostProfileName = $hostProfileAssociatedWithVMHost.Name\n\n        if (![string]::IsNullOrEmpty($this.KmsClusterName)) {\n            $kmsCluster = $this.GetKmsCluster()\n            $result.KmsClusterName = if ($kmsCluster.Id -ne $vmHost.ExtensionData.Runtime.CryptoKeyId.ProviderId.Id) { $kmsCluster.Name } else { $null }\n        }\n        else {\n            $result.KmsClusterName = $this.KmsClusterName\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostDnsSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n\n    List of domain name or IP address of the DNS Servers.\n    #>\n    [DscProperty()]\n    [string[]] $Address\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether DHCP is used to determine DNS configuration.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Dhcp\n\n    <#\n    .DESCRIPTION\n\n    Domain Name portion of the DNS name. For example, \"vmware.com\".\n    #>\n    [DscProperty(Mandatory)]\n    [string] $DomainName\n\n    <#\n    .DESCRIPTION\n\n    Host Name portion of DNS name. For example, \"esx01\".\n    #>\n    [DscProperty(Mandatory)]\n    [string] $HostName\n\n    <#\n    .DESCRIPTION\n\n    Desired value for the VMHost DNS Ipv6VirtualNicDevice.\n    #>\n    [DscProperty()]\n    [string] $Ipv6VirtualNicDevice\n\n    <#\n    .DESCRIPTION\n\n    Domain in which to search for hosts, placed in order of preference.\n    #>\n    [DscProperty()]\n    [string[]] $SearchDomain\n\n    <#\n    .DESCRIPTION\n\n    Desired value for the VMHost DNS VirtualNicDevice.\n    #>\n    [DscProperty()]\n    [string] $VirtualNicDevice\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateDns($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $vmHostDnsConfig = $vmHost.ExtensionData.Config.Network.DnsConfig\n\n            $result = !((\n                $this.ShouldUpdateDscResourceSetting('Dhcp', $vmHostDnsConfig.Dhcp, $this.Dhcp),\n                $this.ShouldUpdateDscResourceSetting('DomainName', $vmHostDnsConfig.DomainName, $this.DomainName),\n                $this.ShouldUpdateDscResourceSetting('HostName', $vmHostDnsConfig.HostName, $this.HostName),\n                $this.ShouldUpdateDscResourceSetting('Ipv6VirtualNicDevice', $vmHostDnsConfig.Ipv6VirtualNicDevice, $this.Ipv6VirtualNicDevice),\n                $this.ShouldUpdateDscResourceSetting('VirtualNicDevice', $vmHostDnsConfig.VirtualNicDevice, $this.VirtualNicDevice),\n                $this.ShouldUpdateArraySetting('Address', $vmHostDnsConfig.Address, $this.Address),\n                $this.ShouldUpdateArraySetting('SearchDomain', $vmHostDnsConfig.SearchDomain, $this.SearchDomain)\n            ) -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostDnsSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostDnsSettings]::new()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostDnsConfig = $vmHost.ExtensionData.Config.Network.DnsConfig\n\n            $result.Name = $vmHost.Name\n            $result.Server = $this.Server\n            $result.Address = $vmHostDnsConfig.Address\n            $result.Dhcp = $vmHostDnsConfig.Dhcp\n            $result.DomainName = $vmHostDnsConfig.DomainName\n            $result.HostName = $vmHostDnsConfig.HostName\n            $result.Ipv6VirtualNicDevice = $vmHostDnsConfig.Ipv6VirtualNicDevice\n            $result.SearchDomain = $vmHostDnsConfig.SearchDomain\n            $result.VirtualNicDevice = $vmHostDnsConfig.VirtualNicDevice\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the DNS Config of the VMHost with the Desired DNS Config.\n    #>\n    [void] UpdateDns($vmHost) {\n        $dnsConfigArgs = @{\n            Address = $this.Address\n            Dhcp = $this.Dhcp\n            DomainName = $this.DomainName\n            HostName = $this.HostName\n            Ipv6VirtualNicDevice = $this.Ipv6VirtualNicDevice\n            SearchDomain = $this.SearchDomain\n            VirtualNicDevice = $this.VirtualNicDevice\n        }\n\n        $dnsConfig = New-DNSConfig @dnsConfigArgs\n\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $vmHost.ExtensionData.ConfigManager.NetworkSystem\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $networkSystem = Get-View @getViewParams\n\n        try {\n            Update-DNSConfig -NetworkSystem $networkSystem -DnsConfig $dnsConfig\n        }\n        catch {\n            throw \"The DNS Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostFirewallRuleset : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the firewall ruleset.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the firewall ruleset should be enabled or disabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the firewall ruleset allows connections from any IP address.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllIP\n\n    <#\n    .DESCRIPTION\n\n    Specifies the list of IP addresses. All IPv4 addresses are specified using dotted decimal format. For example '192.0.20.10'.\n    IPv6 addresses are 128-bit addresses represented as eight fields of up to four hexadecimal digits. A colon separates each field (:).\n    For example 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol '::' to represent multiple 16-bit groups of contiguous 0's only once in an address.\n    #>\n    [DscProperty()]\n    [string[]] $IPAddresses\n\n    hidden [string] $ModifyVMHostFirewallRulesetStateMessage = \"Modifying the state of firewall ruleset {0} on VMHost {1}.\"\n    hidden [string] $ModifyVMHostFirewallRulesetAllowedIPAddressesListMessage = \"Modifying the allowed IP addresses list of firewall ruleset {0} on VMHost {1}.\"\n\n    hidden [string] $CouldNotRetrieveFirewallSystemOfVMHostMessage = \"Could not retrieve the FirewallSystem managed object of VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveFirewallRulesetMessage = \"Could not retrieve firewall ruleset {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyVMHostFirewallRulesetStateMessage = \"Could not modify the state of firewall ruleset {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyVMHostFirewallRulesetAllowedIPAddressesListMessage = \"Could not modify the allowed IP addresses list of firewall ruleset {0} on VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $vmHostFirewallRuleset = $this.GetVMHostFirewallRuleset()\n\n            if ($this.ShouldModifyVMHostFirewallRulesetState($vmHostFirewallRuleset)) {\n                $this.ModifyVMHostFirewallRulesetState($vmHostFirewallRuleset)\n            }\n\n            if ($this.ShouldModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallRuleset)) {\n                $vmHostFirewallSystem = $this.GetVMHostFirewallSystem()\n                $this.ModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallSystem, $vmHostFirewallRuleset)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $vmHostFirewallRuleset = $this.GetVMHostFirewallRuleset()\n\n            $result = !($this.ShouldModifyVMHostFirewallRulesetState($vmHostFirewallRuleset) -or $this.ShouldModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallRuleset))\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostFirewallRuleset] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostFirewallRuleset]::new()\n\n            $this.RetrieveVMHost()\n\n            $vmHostFirewallRuleset = $this.GetVMHostFirewallRuleset()\n\n            $this.PopulateResult($result, $vmHostFirewallRuleset)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the FirewallSystem of the specified VMHost.\n    #>\n    [PSObject] GetVMHostFirewallSystem() {\n        try {\n            $firewallSystem = Get-View -Server $this.Connection -Id $this.VMHost.ExtensionData.ConfigManager.FirewallSystem -ErrorAction Stop -Verbose:$false\n            return $firewallSystem\n        }\n        catch {\n            throw ($this.CouldNotRetrieveFirewallSystemOfVMHostMessage -f $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the firewall ruleset with the specified name on the specified VMHost.\n    #>\n    [PSObject] GetVMHostFirewallRuleset() {\n        try {\n            $vmHostFirewallRuleset = Get-VMHostFirewallException -Server $this.Connection -Name $this.Name -VMHost $this.VMHost -ErrorAction Stop -Verbose:$false\n            return $vmHostFirewallRuleset\n        }\n        catch {\n            throw ($this.CouldNotRetrieveFirewallRulesetMessage -f $this.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed string array containing IP networks in the following format: '10.20.120.12/22' to HostFirewallRulesetIpNetwork array,\n    where the 'Network' is '10.23.120.12' and the 'PrefixLength' is '22'.\n    #>\n    [array] ConvertIPNetworksToHostFirewallRulesetIpNetworks($ipNetworks) {\n        $hostFirewallRulesetIpNetworks = @()\n\n        foreach ($ipNetwork in $ipNetworks) {\n            $ipNetworkParts = $ipNetwork -Split '/'\n\n            $hostFirewallRulesetIpNetwork = New-Object -TypeName VMware.Vim.HostFirewallRulesetIpNetwork\n            $hostFirewallRulesetIpNetwork.Network = $ipNetworkParts[0]\n            $hostFirewallRulesetIpNetwork.PrefixLength = $ipNetworkParts[1]\n\n            $hostFirewallRulesetIpNetworks += $hostFirewallRulesetIpNetwork\n        }\n\n        return $hostFirewallRulesetIpNetworks\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed HostFirewallRulesetIpNetwork array containing IP networks in the following format: 'Network' = '10.23.120.12' and 'PrefixLength' = '22' to string array,\n    where each IP network is in the following format: '10.23.120.12/22'.\n    #>\n    [array] ConvertHostFirewallRulesetIpNetworksToIPNetworks($hostFirewallRulesetIpNetworks) {\n        $ipNetworks = @()\n\n        foreach ($hostFirewallRulesetIpNetwork in $hostFirewallRulesetIpNetworks) {\n            $ipNetwork = $hostFirewallRulesetIpNetwork.Network + '/' + $hostFirewallRulesetIpNetwork.PrefixLength\n            $ipNetworks += $ipNetwork\n        }\n\n        return $ipNetworks\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the current firewall ruleset state (enabled or disabled) is equal to the desired firewall ruleset state.\n    #>\n    [bool] ShouldModifyVMHostFirewallRulesetState($vmHostFirewallRuleset) {\n        return $this.ShouldUpdateDscResourceSetting('Enabled', $vmHostFirewallRuleset.Enabled, $this.Enabled)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the current firewall ruleset IP addresses allowed list is equal to the desired firewall ruleset IP addresses allowed list.\n    #>\n    [bool] ShouldModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallRuleset) {\n        $vmHostFirewallRulesetAllowedHosts = $vmHostFirewallRuleset.ExtensionData.AllowedHosts\n\n        $shouldModifyVMHostFirewallRulesetAllowedIPAddressesList = @(\n            $this.ShouldUpdateDscResourceSetting('AllIP', $vmHostFirewallRulesetAllowedHosts.AllIp, $this.AllIP)\n        )\n\n        if ($null -ne $this.IPAddresses) {\n            $desiredIPAddresses = $this.IPAddresses -NotMatch '/'\n            $desiredIPNetworks = $this.IPAddresses -Match '/'\n\n            $shouldModifyVMHostFirewallRulesetAllowedIPAddressesList += $this.ShouldUpdateArraySetting(\n                'IPAddresses',\n                $vmHostFirewallRulesetAllowedHosts.IpAddress,\n                $desiredIPAddresses\n            )\n            $shouldModifyVMHostFirewallRulesetAllowedIPAddressesList += $this.ShouldUpdateArraySetting(\n                'IPNetworks',\n                $this.ConvertHostFirewallRulesetIpNetworksToIPNetworks($vmHostFirewallRulesetAllowedHosts.IpNetwork),\n                $desiredIPNetworks\n            )\n        }\n\n        return ($shouldModifyVMHostFirewallRulesetAllowedIPAddressesList -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the firewall ruleset state depending on the specified value (enables or disables the firewall ruleset).\n    #>\n    [void] ModifyVMHostFirewallRulesetState($vmHostFirewallRuleset) {\n        $setVMHostFirewallExceptionParams = @{\n            Exception = $vmHostFirewallRuleset\n            Enabled = $this.Enabled\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostFirewallRulesetStateMessage, @($vmHostFirewallRuleset.Name, $this.VMHost.Name))\n\n            Set-VMHostFirewallException @setVMHostFirewallExceptionParams\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostFirewallRulesetStateMessage -f $vmHostFirewallRuleset.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the firewall ruleset IP addresses allowed list.\n    #>\n    [void] ModifyVMHostFirewallRulesetAllowedIPAddressesList($vmHostFirewallSystem, $vmHostFirewallRuleset) {\n        $vmHostFirewallRulesetSpec = New-Object -TypeName VMware.Vim.HostFirewallRulesetRulesetSpec\n        $vmHostFirewallRulesetSpec.AllowedHosts = New-Object -TypeName VMware.Vim.HostFirewallRulesetIpList\n\n        if ($null -ne $this.AllIP) { $vmHostFirewallRulesetSpec.AllowedHosts.AllIp = $this.AllIP }\n\n        if ($null -ne $this.IPAddresses) {\n            $desiredIPAddresses = $this.IPAddresses -NotMatch '/'\n            $desiredIPNetworks = $this.IPAddresses -Match '/'\n\n            $vmHostFirewallRulesetSpec.AllowedHosts.IpAddress = $desiredIPAddresses\n            $vmHostFirewallRulesetSpec.AllowedHosts.IpNetwork = $this.ConvertIPNetworksToHostFirewallRulesetIpNetworks($desiredIPNetworks)\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyVMHostFirewallRulesetAllowedIPAddressesListMessage, @($vmHostFirewallRuleset.Name, $this.VMHost.Name))\n\n            Update-VMHostFirewallRuleset -VMHostFirewallSystem $vmHostFirewallSystem -VMHostFirewallRulesetId $vmHostFirewallRuleset.ExtensionData.Key -VMHostFirewallRulesetSpec $vmHostFirewallRulesetSpec\n        }\n        catch {\n            throw ($this.CouldNotModifyVMHostFirewallRulesetAllowedIPAddressesListMessage -f $vmHostFirewallRuleset.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostFirewallRuleset) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Name = $vmHostFirewallRuleset.Name\n        $result.Enabled = $vmHostFirewallRuleset.Enabled\n\n        $vmHostFirewallRulesetAllowedHosts = $vmHostFirewallRuleset.ExtensionData.AllowedHosts\n        $result.AllIP = $vmHostFirewallRulesetAllowedHosts.AllIp\n        $result.IPAddresses = $vmHostFirewallRulesetAllowedHosts.IpAddress + $this.ConvertHostFirewallRulesetIpNetworksToIPNetworks($vmHostFirewallRulesetAllowedHosts.IpNetwork)\n    }\n}\n\n[DscResource()]\nclass VMHostIScsiHba : VMHostIScsiHbaBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name for the VMHost Host Bus Adapter device.\n    #>\n    [DscProperty()]\n    [string] $IScsiName\n\n    hidden [string] $ConfigureIScsiHbaMessage = \"Configuring iSCSI Host Bus Adapter {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotConfigureIScsiHbaMessage = \"Could not configure iSCSI Host Bus Adapter {0} from VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $iScsiHba = $this.GetIScsiHba($this.Name)\n\n            $this.ConfigureIScsiHba($iScsiHba)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $iScsiHba = $this.GetIScsiHba($this.Name)\n\n            $shouldConfigureiScsiHba = @(\n                $this.ShouldModifyCHAPSettings($iScsiHba.AuthenticationProperties),\n                $this.ShouldUpdateDscResourceSetting('IScsiName', $iScsiHba.IScsiName, $this.IScsiName)\n            )\n            $result = !($shouldConfigureiScsiHba -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIScsiHba] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostIScsiHba]::new()\n\n            $this.RetrieveVMHost()\n\n            $iScsiHba = $this.GetIScsiHba($this.Name)\n\n            $this.PopulateResult($result, $iScsiHba)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Configures the CHAP properties and the iScsi name of the specified iSCSI Host Bus Adapter.\n    #>\n    [void] ConfigureIScsiHba($iScsiHba) {\n        $setVMHostHbaParams = @{\n            IScsiHba = $iScsiHba\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        $this.PopulateCmdletParametersWithCHAPSettings($setVMHostHbaParams)\n        if (![string]::IsNullOrEmpty($this.IScsiName)) { $setVMHostHbaParams.IScsiName = $this.IScsiName }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ConfigureIScsiHbaMessage, @($iScsiHba.Device, $this.VMHost.Name))\n\n            Set-VMHostHba @setVMHostHbaParams\n        }\n        catch {\n            throw ($this.CouldNotConfigureIScsiHbaMessage -f $iScsiHba.Device, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $iScsiHba) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Name = $iScsiHba.Device\n        $result.IScsiName = $iScsiHba.IScsiName\n        $result.ChapType = $iScsiHba.AuthenticationProperties.ChapType.ToString()\n        $result.ChapName = [string] $iScsiHba.AuthenticationProperties.ChapName\n        $result.MutualChapEnabled = $iScsiHba.AuthenticationProperties.MutualChapEnabled\n        $result.MutualChapName = [string] $iScsiHba.AuthenticationProperties.MutualChapName\n        $result.Force = $this.Force\n    }\n}\n\n[DscResource()]\nclass VMHostIScsiHbaTarget : VMHostIScsiHbaBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the address of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [string] $Address\n\n    <#\n    .DESCRIPTION\n\n    Specifies the TCP port of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [int] $Port\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the iSCSI Host Bus Adapter of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [string] $IScsiHbaName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the iSCSI Host Bus Adapter target.\n    #>\n    [DscProperty(Key)]\n    [IScsiHbaTargetType] $TargetType\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the iSCSI Host Bus Adapter target should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the iSCSI name of the iSCSI Host Bus Adapter target. It is required for Static iSCSI Host Bus Adapter targets.\n    #>\n    [DscProperty()]\n    [string] $IScsiName\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the CHAP setting is inherited from the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritChap\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the Mutual CHAP setting is inherited from the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritMutualChap\n\n    <#\n    .DESCRIPTION\n\n    Specifies the <Address>:<Port> that uniquely identifies an iSCSI Host Bus Adapter target.\n    #>\n    hidden [string] $IPEndPoint\n\n    hidden [string] $CreateIScsiHbaTargetMessage = \"Creating iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}.\"\n    hidden [string] $ModifyIScsiHbaTargetMessage = \"Modifying CHAP settings of iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}.\"\n    hidden [string] $RemoveIScsiHbaTargetMessage = \"Removing iSCSI Host Bus Adapter target with IP address {0} from iSCSI Host Bus Adapter device {1}.\"\n\n    hidden [string] $CouldNotCreateIScsiHbaTargetMessage = \"Could not create iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyIScsiHbaTargetMessage = \"Could not modify CHAP settings of iSCSI Host Bus Adapter target with IP address {0} on iSCSI Host Bus Adapter device {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveIScsiHbaTargetMessage = \"Could not remove iSCSI Host Bus Adapter target with IP address {0} from iSCSI Host Bus Adapter device {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $this.IPEndPoint = $this.Address + ':' + $this.Port.ToString()\n\n            $iScsiHba = $this.GetIScsiHba($this.IScsiHbaName)\n            $iScsiHbaTarget = $this.GetIScsiHbaTarget($iScsiHba)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $iScsiHbaTarget) {\n                    $this.NewIScsiHbaTarget($iScsiHba)\n                }\n                else {\n                    $this.ModifyIScsiHbaTarget($iScsiHbaTarget)\n                }\n            }\n            else {\n                if ($null -ne $iScsiHbaTarget) {\n                    $this.RemoveIScsiHbaTarget($iScsiHbaTarget)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n            $this.IPEndPoint = $this.Address + ':' + $this.Port.ToString()\n\n            $iScsiHba = $this.GetIScsiHba($this.IScsiHbaName)\n            $iScsiHbaTarget = $this.GetIScsiHbaTarget($iScsiHba)\n\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $iScsiHbaTarget) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyCHAPSettings($iScsiHbaTarget.AuthenticationProperties, $this.InheritChap, $this.InheritMutualChap)\n                }\n            }\n            else {\n                $result = ($null -eq $iScsiHbaTarget)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIScsiHbaTarget] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostIScsiHbaTarget]::new()\n\n            $this.RetrieveVMHost()\n            $this.IPEndPoint = $this.Address + ':' + $this.Port.ToString()\n\n            $iScsiHba = $this.GetIScsiHba($this.IScsiHbaName)\n            $iScsiHbaTarget = $this.GetIScsiHbaTarget($iScsiHba)\n\n            $this.PopulateResult($result, $iScsiHbaTarget)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the iSCSI Host Bus Adapter target with the specified IPEndPoint for the specified iSCSI Host Bus Adapter if it exists.\n    #>\n    [PSObject] GetIScsiHbaTarget($iScsiHba) {\n        $getIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            IScsiHba = $iScsiHba\n            IPEndPoint = $this.IPEndPoint\n            Type = $this.TargetType.ToString()\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        return Get-IScsiHbaTarget @getIScsiHbaTargetParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new iSCSI Host Bus Adapter target of the specified type with the specified address for the specified iSCSI Host Bus Adapter.\n    #>\n    [void] NewIScsiHbaTarget($iScsiHba) {\n        $newIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            Address = $this.Address\n            Port = $this.Port\n            IScsiHba = $iScsiHba\n            Type = $this.TargetType.ToString()\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($this.TargetType -eq [IScsiHbaTargetType]::Static) { $newIScsiHbaTargetParams.IScsiName = $this.IScsiName }\n        $this.PopulateCmdletParametersWithCHAPSettings($newIScsiHbaTargetParams, $this.InheritChap, $this.InheritMutualChap)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateIScsiHbaTargetMessage, @($this.IPEndPoint, $this.IScsiHbaName))\n\n            New-IScsiHbaTarget @newIScsiHbaTargetParams\n        }\n        catch {\n            throw ($this.CouldNotCreateIScsiHbaTargetMessage -f $this.IPEndPoint, $this.IScsiHbaName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the CHAP settings of the specified iSCSI Host Bus Adapter target.\n    #>\n    [void] ModifyIScsiHbaTarget($iScsiHbaTarget) {\n        $setIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            Target = $iScsiHbaTarget\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        $this.PopulateCmdletParametersWithCHAPSettings($setIScsiHbaTargetParams, $this.InheritChap, $this.InheritMutualChap)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyIScsiHbaTargetMessage, @($this.IPEndPoint, $this.IScsiHbaName))\n\n            Set-IScsiHbaTarget @setIScsiHbaTargetParams\n        }\n        catch {\n            throw ($this.CouldNotModifyIScsiHbaTargetMessage -f $this.IPEndPoint, $this.IScsiHbaName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified iSCSI Host Bus Adapter target from its iSCSI Host Bus Adapter.\n    #>\n    [void] RemoveIScsiHbaTarget($iScsiHbaTarget) {\n        $removeIScsiHbaTargetParams = @{\n            Server = $this.Connection\n            Target = $iScsiHbaTarget\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveIScsiHbaTargetMessage, @($this.IPEndPoint, $this.IScsiHbaName))\n\n            Remove-IScsiHbaTarget @removeIScsiHbaTargetParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveIScsiHbaTargetMessage -f $this.IPEndPoint, $this.IScsiHbaName, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $iScsiHbaTarget) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.IScsiHbaName = $this.IScsiHbaName\n        $result.Force = $this.Force\n\n        if ($null -ne $iScsiHbaTarget) {\n            $result.Address = $iScsiHbaTarget.Address\n            $result.Port = $iScsiHbaTarget.Port\n            $result.TargetType = $iScsiHbaTarget.Type.ToString()\n            $result.IScsiName = $iScsiHbaTarget.IScsiName\n            $result.InheritChap = $iScsiHbaTarget.AuthenticationProperties.ChapInherited\n            $result.ChapType = $iScsiHbaTarget.AuthenticationProperties.ChapType.ToString()\n            $result.ChapName = [string] $iScsiHbaTarget.AuthenticationProperties.ChapName\n            $result.InheritMutualChap = $iScsiHbaTarget.AuthenticationProperties.MutualChapInherited\n            $result.MutualChapEnabled = $iScsiHbaTarget.AuthenticationProperties.MutualChapEnabled\n            $result.MutualChapName = [string] $iScsiHbaTarget.AuthenticationProperties.MutualChapName\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.Address = $this.Address\n            $result.Port = $this.Port\n            $result.TargetType = $this.TargetType\n            $result.IScsiName = $this.IScsiName\n            $result.InheritChap = $this.InheritChap\n            $result.ChapType = $this.ChapType\n            $result.ChapName = $this.ChapName\n            $result.InheritMutualChap = $this.InheritMutualChap\n            $result.MutualChapEnabled = $this.MutualChapEnabled\n            $result.MutualChapName = $this.MutualChapName\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostIScsiHbaVMKernelNic : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Key)]\n    [string] $IScsiHbaName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the VMKernel Network Adapters that should be bound/unbound\n    to/from the specified iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $VMKernelNicNames\n\n    <#\n    .DESCRIPTION\n\n    Value indicating if the VMKernel Network Adapters should be bound/unbound\n    to/from the specified iSCSI Host Bus Adapter.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to bind VMKernel Network Adapters to iSCSI Host Bus Adapter\n    when VMKernel Network Adapters aren't compatible for iSCSI multipathing.\n    Specifies whether to unbind VMKernel Network Adapters from iSCSI Host Bus Adapter\n    when there're active sessions using the VMKernel Network Adapters.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $IScsiDeviceType = 'iSCSI'\n\n    hidden [string] $RetrieveIScsiHbaMessage = \"Retrieving iSCSI Host Bus Adapter {0} from VMHost {1}.\"\n    hidden [string] $RetrieveEsxCliInterfaceMessage = \"Retrieving EsxCli interface for VMHost {0}.\"\n    hidden [string] $RetrieveVMKernelNicsMessage = \"Retrieving VMKernel Network Adapters {0} from VMHost {1}.\"\n\n    hidden [string] $VMKernelNicAlreadyBoundMessage = \"VMKernel Network Adapter {0} is already bound to iSCSI Host Bus Adapter {1} and will be ignored.\"\n    hidden [string] $VMKernelNicAlreadyUnboundMessage = \"VMKernel Network Adapter {0} is already unbound from iSCSI Host Bus Adapter {1} and will be ignored.\"\n\n    hidden [string] $VMKernelNicBindMessage = \"Binding VMKernel Network Adapter {0} to iSCSI Host Bus Adapter {1}.\"\n    hidden [string] $VMKernelNicUnbindMessage = \"Unbinding VMKernel Network Adapter {0} from iSCSI Host Bus Adapter {1}.\"\n\n    hidden [string] $CouldNotRetrieveIScsiHbaMessage = \"Could not retrieve iSCSI Host Bus Adapter {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveEsxCliInterfaceMessage = \"Could not retrieve EsxCli interface for VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveVMKernelNicMessage = \"VMKernel Network Adapter {0} could not be retrieved from VMHost {1} and will be ignored.\"\n\n    hidden [string] $CouldNotBindVMKernelNicMessage = \"Could not bind VMKernel Network Adapter {0} to iSCSI Host Bus Adapter {1}. For more information: {2}\"\n    hidden [string] $CouldNotUnbindVMKernelNicMessage = \"Could not unbind VMKernel Network Adapter {0} from iSCSI Host Bus Adapter {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $esxCli = $this.GetEsxCli()\n            $iScsiHba = $this.GetIScsiHba()\n\n            $vmKernelNics = $this.GetVMKernelNetworkAdapters()\n            $filteredVMKernelNics = $this.GetFilteredVMKernelNetworkAdapters($esxCli, $iScsiHba, $vmKernelNics)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $this.BindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $filteredVMKernelNics)\n            }\n            else {\n                $this.UnbindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $filteredVMKernelNics)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $esxCli = $this.GetEsxCli()\n            $iScsiHba = $this.GetIScsiHba()\n            $vmKernelNics = $this.GetVMKernelNetworkAdapters()\n\n            $result = !$this.ShouldUpdateIScsiHbaBoundNics($esxCli, $iScsiHba, $vmKernelNics)\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIScsiHbaVMKernelNic] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $result = [VMHostIScsiHbaVMKernelNic]::new()\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $esxCli = $this.GetEsxCli()\n            $iScsiHba = $this.GetIScsiHba()\n\n            $this.PopulateResult($result, $esxCli, $iScsiHba)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the EsxCli version 2 interface to ESXCLI for the specified VMHost.\n    #>\n    [PSObject] GetEsxCli() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveEsxCliInterfaceMessage, @($this.VMHost.Name))\n\n            $getEsxCliParams = @{\n                Server = $this.Connection\n                VMHost = $this.VMHost\n                V2 = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            return Get-EsxCli @getEsxCliParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveEsxCliInterfaceMessage -f $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the iSCSI Host Bus Adapter with the specified name from the specified VMHost.\n    If the iSCSI Host Bus Adapter is not found, it throws an exception.\n    #>\n    [PSObject] GetIScsiHba() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveIScsiHbaMessage, @($this.IScsiHbaName, $this.VMHost.Name))\n\n            $getVMHostHbaParams = @{\n                Server = $this.Connection\n                VMHost = $this.VMHost\n                Device = $this.IScsiHbaName\n                Type = $this.IScsiDeviceType\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VMHostHba @getVMHostHbaParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveIScsiHbaMessage -f $this.IScsiHbaName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel Network Adapters with the specified names from the specified VMHost.\n    For every VMKernel Network Adapter that doesn't exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetVMKernelNetworkAdapters() {\n        $vmKernelNics = @()\n\n        $this.WriteLogUtil('Verbose', $this.RetrieveVMKernelNicsMessage, @(($this.VMKernelNicNames -Join ', '), $this.VMHost.Name))\n\n        $getVMHostNetworkAdapterParams = @{\n            Server = $this.Connection\n            VMHost = $this.VMHost\n            VMKernel = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n        $retrievedVMKernelNics = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n\n        foreach ($vmKernelNicName in $this.VMKernelNicNames) {\n            $vmKernelNic = $retrievedVMKernelNics | Where-Object -FilterScript { $_.Name -eq $vmKernelNicName }\n            if ($null -eq $vmKernelNic) {\n                $this.WriteLogUtil('Warning', $this.CouldNotRetrieveVMKernelNicMessage, @($vmKernelNicName, $this.VMHost.Name))\n            }\n            else {\n                $vmKernelNics += $vmKernelNic\n            }\n        }\n\n        return $vmKernelNics\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the filtered VMKernel Network Adapters based on the value of the Ensure property.\n    If Ensure is set to 'Present', it returns only those VMKernel Network Adapters that are currently not bound\n    to the iSCSI Host Bus Adapter. The other VMKernel Network Adapters in the array are ignored because they're already bound\n    to the iSCSI Host Bus Adapter. If Ensure is set to 'Absent', it returns only these VMKernel Network Adapters that are currently\n    bound to the iSCSI Host Bus Adapter. The other VMKernel Network Adapters in the array are ignored because they're not bound to the\n    iSCSI Host Bus Adapter. In both cases a warning message is shown to the user when a specific VMKernel Network Adapter is ignored.\n    #>\n    [array] GetFilteredVMKernelNetworkAdapters($esxCli, $iScsiHba, $vmKernelNics) {\n        $filteredVMKernelNics = @()\n\n        $boundVMKernelNics = Get-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device\n        foreach ($vmKernelNic in $vmKernelNics) {\n            $boundVMKernelNic = $boundVMKernelNics | Where-Object -FilterScript { $_.Vmknic -eq $vmKernelNic.Name }\n            if ($this.Ensure -eq [Ensure]::Present -and $null -ne $boundVMKernelNic) {\n                $this.WriteLogUtil('Warning', $this.VMKernelNicAlreadyBoundMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                continue\n            }\n            elseif ($this.Ensure -eq [Ensure]::Absent -and $null -eq $boundVMKernelNic) {\n                $this.WriteLogUtil('Warning', $this.VMKernelNicAlreadyUnboundMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                continue\n            }\n\n            $filteredVMKernelNics += $vmKernelNic\n        }\n\n        return $filteredVMKernelNics\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if VMKernel Network Adapters should be bound/unbound to/from the specified iSCSI Host Bus Adapter.\n    If Ensure is set to 'Present', checks if all passed VMKernel Network Adapters are bound to the specified iSCSI Host Bus Adapter.\n    If Ensure is set to 'Absent', checks if all passed VMKernel Network Adapters are unbound from the specified iSCSI Host Bus Adapter.\n    #>\n    [bool] ShouldUpdateIScsiHbaBoundNics($esxCli, $iScsiHba, $vmKernelNics) {\n        $result = $false\n\n        $boundVMKernelNics = Get-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device\n        foreach ($vmKernelNic in $vmKernelNics) {\n            $boundVMKernelNic = $boundVMKernelNics | Where-Object -FilterScript { $_.Vmknic -eq $vmKernelNic.Name }\n            if ($this.Ensure -eq [Ensure]::Present -and $null -eq $boundVMKernelNic) {\n                $result = $true\n                break\n            }\n            elseif ($this.Ensure -eq [Ensure]::Absent -and $null -ne $boundVMKernelNic) {\n                $result = $true\n                break\n            }\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Binds the specified VMKernel Network Adapters to the specified iSCSI Host Bus Adapter.\n    #>\n    [void] BindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $vmKernelNics) {\n        foreach ($vmKernelNic in $vmKernelNics) {\n            try {\n                $this.WriteLogUtil('Verbose', $this.VMKernelNicBindMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                Update-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device -VMKernelNicName $vmKernelNic.Name -Operation 'Add' -Force $this.Force\n            }\n            catch {\n                throw ($this.CouldNotBindVMKernelNicMessage -f $vmKernelNic.Name, $iScsiHba.Device, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Unbinds the specified VMKernel Network Adapters from the specified iSCSI Host Bus Adapter.\n    #>\n    [void] UnbindVMKernelNicsToIScsiHba($esxCli, $iScsiHba, $vmKernelNics) {\n        foreach ($vmKernelNic in $vmKernelNics) {\n            try {\n                $this.WriteLogUtil('Verbose', $this.VMKernelNicUnbindMessage, @($vmKernelNic.Name, $iScsiHba.Device))\n                Update-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device -VMKernelNicName $vmKernelNic.Name -Operation 'Remove' -Force $this.Force\n            }\n            catch {\n                throw ($this.CouldNotUnbindVMKernelNicMessage -f $vmKernelNic.Name, $iScsiHba.Device, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $esxCli, $iScsiHba) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.IScsiHbaName = $iScsiHba.Device\n        $result.Force = $this.Force\n\n        $boundVMKernelNics = Get-IScsiHbaBoundNics -EsxCli $esxCli -IScsiHbaName $iScsiHba.Device\n        if ($boundVMKernelNics.Length -gt 0) {\n            $result.Ensure = [Ensure]::Present\n            $result.VMKernelNicNames = $boundVMKernelNics.Vmknic\n        }\n        else {\n            $result.Ensure = [Ensure]::Absent\n            $result.VMKernelNicNames = $this.VMKernelNicNames\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostNtpSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    List of domain name or IP address of the desired NTP Servers.\n    #>\n    [DscProperty()]\n    [string[]] $NtpServer\n\n    <#\n    .DESCRIPTION\n\n    Desired Policy of the VMHost 'ntpd' service activation.\n    #>\n    [DscProperty()]\n    [ServicePolicy] $NtpServicePolicy = [ServicePolicy]::Unset\n\n    hidden [string] $ServiceId = 'ntpd'\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostNtpServer($vmHost)\n            $this.UpdateVMHostNtpServicePolicy($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $vmHostNtpConfig = $vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n            $vmHostServices = $vmHost.ExtensionData.Config.Service\n            $vmHostNtpService = $vmHostServices.Service | Where-Object -FilterScript { $_.Key -eq $this.ServiceId }\n\n            $result = !((\n                $this.ShouldUpdateArraySetting('NtpServer', $vmHostNtpConfig.Server, $this.NtpServer),\n                $this.ShouldUpdateDscResourceSetting('NtpServicePolicy', $vmHostNtpService.Policy.ToString(), $this.NtpServicePolicy.ToString())\n            ) -Contains $true)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostNtpSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostNtpSettings]::new()\n\n            $vmHost = $this.GetVMHost()\n\n            $vmHostNtpConfig = $vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n            $vmHostServices = $vmHost.ExtensionData.Config.Service\n            $vmHostNtpService = $vmHostServices.Service | Where-Object -FilterScript { $_.Key -eq $this.ServiceId }\n\n            $result.Name = $vmHost.Name\n            $result.Server = $this.Server\n            $result.NtpServer = $vmHostNtpConfig.Server\n            $result.NtpServicePolicy = $vmHostNtpService.Policy\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMHost NTP Server with the desired NTP Server array.\n    #>\n    [void] UpdateVMHostNtpServer($vmHost) {\n        $vmHostNtpConfig = $vmHost.ExtensionData.Config.DateTimeInfo.NtpConfig\n        if (!$this.ShouldUpdateArraySetting('NtpServer', $vmHostNtpConfig.Server, $this.NtpServer)) {\n            return\n        }\n\n        $dateTimeConfig = New-DateTimeConfig -NtpServer $this.NtpServer\n\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $vmHost.ExtensionData.ConfigManager.DateTimeSystem\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $dateTimeSystem = Get-View @getViewParams\n\n        Update-DateTimeConfig -DateTimeSystem $dateTimeSystem -DateTimeConfig $dateTimeConfig\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the VMHost 'ntpd' Service Policy with the desired Service Policy.\n    #>\n    [void] UpdateVMHostNtpServicePolicy($vmHost) {\n        $vmHostServices = $vmHost.ExtensionData.Config.Service\n        $vmHostNtpService = $vmHostServices.Service | Where-Object -FilterScript { $_.Key -eq $this.ServiceId }\n        if (!$this.ShouldUpdateDscResourceSetting('NtpServicePolicy', $vmHostNtpService.Policy.ToString(), $this.NtpServicePolicy.ToString())) {\n            return\n        }\n\n        $getViewParams = @{\n            Server = $this.Connection\n            Id = $vmHost.ExtensionData.ConfigManager.ServiceSystem\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $serviceSystem = Get-View @getViewParams\n\n        Update-ServicePolicy -ServiceSystem $serviceSystem -ServiceId $this.ServiceId -ServicePolicyValue $this.NtpServicePolicy.ToString().ToLower()\n    }\n}\n\n[DscResource()]\nclass VMHostPciPassthrough : VMHostRestartBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Id of the PCI Device, composed of \"bus:slot.function\".\n    #>\n    [DscProperty(Key)]\n    [string] $Id\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether passThru has been configured for this device.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Enabled\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPciPassthruSystem = $this.GetVMHostPciPassthruSystem($vmHost)\n            $pciDevice = $this.GetPCIDevice($vmHostPciPassthruSystem)\n\n            $this.EnsurePCIDeviceIsPassthruCapable($pciDevice)\n            $this.EnsureVMHostIsInMaintenanceMode($vmHost)\n\n            $this.UpdatePciPassthruConfiguration($vmHostPciPassthruSystem)\n            $this.RestartVMHost($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPciPassthruSystem = $this.GetVMHostPciPassthruSystem($vmHost)\n\n            $pciDevice = $this.GetPCIDevice($vmHostPciPassthruSystem)\n            $this.EnsurePCIDeviceIsPassthruCapable($pciDevice)\n\n            $result = !$this.ShouldUpdateDscResourceSetting('Enabled', $pciDevice.PassthruEnabled, $this.Enabled)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostPciPassthrough] Get() {\n        try {\n            $result = [VMHostPciPassthrough]::new()\n            $result.Server = $this.Server\n            $result.RestartTimeoutMinutes = $this.RestartTimeoutMinutes\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPciPassthruSystem = $this.GetVMHostPciPassthruSystem($vmHost)\n\n            $pciDevice = $this.GetPCIDevice($vmHostPciPassthruSystem)\n            $this.EnsurePCIDeviceIsPassthruCapable($pciDevice)\n\n            $result.Name = $vmHost.Name\n            $result.Id = $pciDevice.Id\n            $result.Enabled = $pciDevice.PassthruEnabled\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the PciPassthruSystem of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostPciPassthruSystem($vmHost) {\n        try {\n            $vmHostPciPassthruSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.PciPassthruSystem -ErrorAction Stop\n            return $vmHostPciPassthruSystem\n        }\n        catch {\n            throw \"Could not retrieve the PciPassthruSystem of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the PCI Device with the specified Id from the server.\n    #>\n    [PSObject] GetPCIDevice($vmHostPciPassthruSystem) {\n        $pciDevice = $vmHostPciPassthruSystem.PciPassthruInfo | Where-Object { $_.Id -eq $this.Id }\n        if ($null -eq $pciDevice) {\n            throw \"The specified PCI Device $($this.Id) does not exist for VMHost $($this.Name).\"\n        }\n\n        return $pciDevice\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified PCIDevice is Passthrough capable and if not, throws an exception.\n    #>\n    [void] EnsurePCIDeviceIsPassthruCapable($pciDevice) {\n        if (!$pciDevice.PassthruCapable) {\n            throw \"Cannot configure PCI-Passthrough on incapable device $($pciDevice.Id).\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the specified PCI Device by changing its Passthru Enabled value.\n    #>\n    [void] UpdatePciPassthruConfiguration($vmHostPciPassthruSystem) {\n        $vmHostPciPassthruConfig = New-Object VMware.Vim.HostPciPassthruConfig\n\n        $vmHostPciPassthruConfig.Id = $this.Id\n        $vmHostPciPassthruConfig.PassthruEnabled = $this.Enabled\n\n        try {\n            Update-PassthruConfig -VMHostPciPassthruSystem $vmHostPciPassthruSystem -VMHostPciPassthruConfig $vmHostPciPassthruConfig\n        }\n        catch {\n            throw \"The Update operation of PCI Device $($this.Id) failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostPermission : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Entity to which the Permission applies.\n    #>\n    [DscProperty(Key)]\n    [string] $EntityName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the location of the Entity with name specified in 'EntityName' key property. Location consists of 0 or more Inventory Items.\n    When the Entity is a Datacenter, a VMHost or a Datastore, the property is ignored. If the Entity is a Virtual Machine, a Resource Pool or a vApp and empty location\n    is passed, the Entity should be located in the Root Resource Pool of the VMHost. Inventory Item names in the location are separated by '/'.\n    Example location for a Datastore Inventory Item: ''. Example location for a Virtual Machine Inventory Item: 'MyResourcePoolOne/MyResourcePoolTwo/MyvApp'.\n    #>\n    [DscProperty(Key)]\n    [string] $EntityLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies the type of the Entity of the Permission. Valid Entity types are: 'Datacenter', 'VMHost', 'Datastore', 'VM', 'ResourcePool' and 'VApp'.\n    #>\n    [DscProperty(Key)]\n    [EntityType] $EntityType\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the User to which the Permission applies. If the User is a Domain User, the Principal name should be in one of the\n    following formats: '<Domain Name>/<User name>' or '<User name>@<Domain Name>'. Example Principal name for Domain User: 'MyDomain/MyDomainUser' or 'MyDomainUser@MyDomain'.\n    #>\n    [DscProperty(Key)]\n    [string] $PrincipalName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Role to which the Permission applies.\n    #>\n    [DscProperty(Key)]\n    [string] $RoleName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Permission should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to propagate the Permission to the child Inventory Items.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Propagate\n\n    hidden [string] $CreatePermissionMessage = \"Creating Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}.\"\n    hidden [string] $ModifyPermissionMessage = \"Modifying Permission for Entity {0} and Principal {1} on VMHost {2}.\"\n    hidden [string] $RemovePermissionMessage = \"Removing Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}.\"\n\n    hidden [string] $CouldNotRetrieveRootResourcePoolMessage = \"Could not retrieve Root Resource Pool from VMHost {0}. For more information: {1}\"\n    hidden [string] $InvalidEntityLocationMessage = \"Location {0} for Entity {1} on VMHost {2} is not valid.\"\n    hidden [string] $CouldNotIdentifyVMMessage = \"Could not uniquely identify VM with name {0} on VMHost {1}. {2} VMs with this name exist on the VMHost.\"\n    hidden [string] $CouldNotFindEntityMessage = \"Entity {0} of type {1} was not found on VMHost {2}.\"\n    hidden [string] $CouldNotRetrievePrincipalMessage = \"Could not retrieve Principal {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveRoleMessage = \"Could not retrieve Role from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreatePermissionMessage = \"Could not create Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}. For more information: {4}\"\n    hidden [string] $CouldNotModifyPermissionMessage = \"Could not modify Permission for Entity {0} and Principal {1} on VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotRemovePermissionMessage = \"Could not remove Permission for Entity {0}, Principal {1} and Role {2} on VMHost {3}. For more information: {4}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $foundEntityLocation = $this.GetEntityLocation()\n            $entity = $this.GetEntity($foundEntityLocation)\n            $vmHostPrincipal = $this.GetVMHostPrincipal()\n\n            $vmHostPermission = $this.GetVMHostPermission($entity, $vmHostPrincipal)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostPermission) {\n                    $this.NewVMHostPermission($entity, $vmHostPrincipal)\n                }\n                else {\n                    $this.ModifyVMHostPermission($vmHostPermission)\n                }\n            }\n            else {\n                if ($null -ne $vmHostPermission) {\n                    $this.RemoveVMHostPermission($vmHostPermission)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $foundEntityLocation = $this.GetEntityLocation()\n            $entity = $this.GetEntity($foundEntityLocation)\n            $vmHostPrincipal = $this.GetVMHostPrincipal()\n\n            $vmHostPermission = $this.GetVMHostPermission($entity, $vmHostPrincipal)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostPermission) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyVMHostPermission($vmHostPermission)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostPermission)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostPermission] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostPermission]::new()\n\n            $this.EnsureConnectionIsESXi()\n\n            $foundEntityLocation = $this.GetEntityLocation()\n            $entity = $this.GetEntity($foundEntityLocation)\n            $vmHostPrincipal = $this.GetVMHostPrincipal()\n\n            $vmHostPermission = $this.GetVMHostPermission($entity, $vmHostPrincipal)\n            $this.PopulateResult($result, $vmHostPermission)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Root Resource Pool from the VMHost.\n    #>\n    [PSObject] GetRootResourcePool() {\n        try {\n            $vmHost = Get-VMHost -Server $this.Connection -ErrorAction Stop -Verbose:$false\n            $rootResourcePool = Get-ResourcePool -Server $this.Connection -ErrorAction Stop -Verbose:$false |\n                                Where-Object -FilterScript { $_.ParentId -eq $vmHost.Id }\n\n            return $rootResourcePool\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRootResourcePoolMessage -f $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the location of the Entity with the specified name on the VMHost if it exists. For VMs, Resource Pools and vApps\n    if Ensure is 'Present' and the location is not found, an exception is thrown. If Ensure is 'Absent' and the location is not found, $null is returned.\n    #>\n    [PSObject] GetEntityLocation() {\n        $foundEntityLocation = $null\n\n        if (\n            $this.EntityType -eq [EntityType]::Datacenter -or\n            $this.EntityType -eq [EntityType]::VMHost -or\n            $this.EntityType -eq [EntityType]::Datastore\n        ) {\n            # The location is not needed to identify the Entity when it is a Datacenter, VMHost or a Datastore.\n            $foundEntityLocation = $null\n        }\n        else {\n            $rootResourcePool = $this.GetRootResourcePool()\n\n            if ([string]::IsNullOrEmpty($this.EntityLocation)) {\n                # Special case where the Entity location does not contain any Inventory Items. So the Root Resource Pool is the location for the Entity.\n                $foundEntityLocation = $rootResourcePool\n            }\n            elseif ($this.EntityLocation -NotMatch '/') {\n                # Special case where the Entity location is just one Resource Pool or vApp. On VMHosts the vApps are also retrieved with the Get-ResourcePool cmdlet.\n                $foundEntityLocation = Get-ResourcePool -Server $this.Connection -Name $this.EntityLocation -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false |\n                                       Where-Object -FilterScript { $_.ParentId -eq $rootResourcePool.Id }\n            }\n            else {\n                $entityLocationItems = $this.EntityLocation -Split '/'\n\n                # Reverses the Entity location items so that we can start from the bottom and go to the top of the Inventory.\n                [array]::Reverse($entityLocationItems)\n\n                $entityLocationName = $entityLocationItems[0]\n                $foundEntityLocations = Get-Inventory -Server $this.Connection -Name $entityLocationName -Location $rootResourcePool -ErrorAction SilentlyContinue -Verbose:$false\n\n                # Removes the name of the Entity location from the Entity location items array as we already retrieved it.\n                $entityLocationItems = $entityLocationItems[1..($entityLocationItems.Length - 1)]\n\n                <#\n                For every found Entity Location with the specified name we start to go up through the parents to check if the Entity Location is valid.\n                If one of the Parents does not meet the criteria of the Entity location, we continue with the next found Entity location.\n                If we find a valid Entity location we stop iterating through the Entity locations and mark it as the found Entity location.\n                #>\n                foreach ($entityLocation in $foundEntityLocations) {\n                    $foundEntityLocationAsViewObject = Get-View -Server $this.Connection -Id $entityLocation.Id -Verbose:$false -Property Parent\n                    $validEntityLocation = $true\n\n                    foreach ($entityLocationItem in $entityLocationItems) {\n                        $foundEntityLocationAsViewObject = Get-View -Server $this.Connection -Id $foundEntityLocationAsViewObject.Parent -Verbose:$false -Property Name, Parent\n                        if ($foundEntityLocationAsViewObject.Name -ne $entityLocationItem) {\n                            $validEntityLocation = $false\n                            break\n                        }\n                    }\n\n                    if ($validEntityLocation) {\n                        $foundEntityLocation = $entityLocation\n                        break\n                    }\n                }\n            }\n\n            $exceptionMessage = $this.InvalidEntityLocationMessage -f $this.EntityLocation, $this.EntityName, $this.Connection.Name\n            $this.EnsureCorrectBehaviourIfTheEntityIsNotFound($foundEntityLocation, $exceptionMessage)\n        }\n\n        return $foundEntityLocation\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Entity with the specified name from the specified location on the VMHost if it exists. For VMs, Resource Pools and vApps\n    if Ensure is 'Present' and the Entity is not found, an exception is thrown. If Ensure is 'Absent' and the Entity is not found, $null is returned.\n    #>\n    [PSObject] GetEntity($entityLocation) {\n        $entity = $null\n\n        if ($this.EntityType -eq [EntityType]::Datacenter) {\n            # Each VMHost has only one Datacenter, so the name is not needed to retrieve it.\n            $entity = Get-Datacenter -Server $this.Connection -ErrorAction SilentlyContinue -Verbose:$false\n        }\n        elseif ($this.EntityType -eq [EntityType]::VMHost) {\n            # If the Entity is a VMHost, the Entity name and location are ignored because the Connection is directly to an ESXi host.\n            $entity = Get-VMHost -Server $this.Connection -ErrorAction SilentlyContinue -Verbose:$false\n        }\n        elseif ($this.EntityType -eq [EntityType]::Datastore) {\n            # If the Entity is a Datastore, the Entity location is ignored because the name uniquely identifies the Datastore.\n            $entity = Get-Datastore -Server $this.Connection -Name $this.EntityName -ErrorAction SilentlyContinue -Verbose:$false\n        }\n        elseif ($this.EntityType -eq [EntityType]::VM) {\n            <#\n            If the Entity is a VM, the Entity location is either a Resource Pool or a vApp where the VM is placed. If the VMHost is managed by a vCenter,\n            there is a special case where two VMs could be created with the same name on the same VMHost but on different vCenter folders. And this way the\n            VM could not be uniquely identified on the VMHost.\n            #>\n            $entity = Get-VM -Server $this.Connection -Name $this.EntityName -Location $entityLocation -ErrorAction SilentlyContinue -Verbose:$false\n\n            # Only throw an exception if Ensure is 'Present', otherwise ignore that multiple VMs were found.\n            if ($entity.Length -gt 1 -and $this.Ensure -eq [Ensure]::Present) {\n                throw ($this.CouldNotIdentifyVMMessage -f $this.EntityName, $this.Connection.Name, $entity.Length)\n            }\n        }\n        else {\n            <#\n            If the Entity is a Resource Pool or vApp, the Entity location is either a Resource Pool or a vApp where the Entity is placed. For a specific Resource Pool\n            or vApp, the name does not uniquely identify the Entity because there can be other Resource Pools or vApps below in the hierarchy with the same name placed in the\n            Entity location. So additional filtering is needed to verify that the Entity is directly placed in the specified Entity location.\n            #>\n            $entity = Get-ResourcePool -Server $this.Connection -Name $this.EntityName -Location $entityLocation -ErrorAction SilentlyContinue -Verbose:$false |\n                      Where-Object -FilterScript { $_.ParentId -eq $entityLocation.Id }\n        }\n\n        $exceptionMessage = $this.CouldNotFindEntityMessage -f $this.EntityName, $this.EntityType.ToString(), $this.Connection.Name\n        $this.EnsureCorrectBehaviourIfTheEntityIsNotFound($entity, $exceptionMessage)\n\n        return $entity\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Principal with the specified name from the VMHost if it exists.\n    If the name contains '\\' or '@', it means that the Principal is part of a Domain, so the search for the Principal should be done by filtering by Domain.\n    If Ensure is 'Present' and the Principal is not found, an exception is thrown. If Ensure is 'Absent' and the Principal is not found, $null is returned.\n    #>\n    [PSObject] GetVMHostPrincipal() {\n        $getVIAccountParams = @{\n            Server = $this.Connection\n            Verbose = $false\n        }\n\n        # If the Principal is a Domain User, we should extact the Domain and User names from the Principal name.\n        if ($this.PrincipalName -Match '\\\\') {\n            $principalNameParts = $this.PrincipalName -Split '\\\\'\n            $domainName = $principalNameParts[0]\n            $username = $principalNameParts[1]\n\n            $getVIAccountParams.Domain = $domainName\n            $getVIAccountParams.User = $true\n            $getVIAccountParams.Id = $username\n        }\n        elseif ($this.PrincipalName -Match '@') {\n            $principalNameParts = $this.PrincipalName -Split '@'\n            $username = $principalNameParts[0]\n            $domainName = $principalNameParts[1]\n\n            $getVIAccountParams.Domain = $domainName\n            $getVIAccountParams.User = $true\n            $getVIAccountParams.Id = $username\n        }\n        else {\n            $getVIAccountParams.Id = $this.PrincipalName\n        }\n\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            $getVIAccountParams.ErrorAction = 'SilentlyContinue'\n            return Get-VIAccount @getVIAccountParams\n        }\n        else {\n            try {\n                $getVIAccountParams.ErrorAction = 'Stop'\n                $vmHostPrincipal = Get-VIAccount @getVIAccountParams\n\n                return $vmHostPrincipal\n            }\n            catch {\n                throw ($this.CouldNotRetrievePrincipalMessage -f $this.PrincipalName, $this.Connection.Name, $_.Exception.Message)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Permission applied to the specified Entity and Principal from the VMHost if it exists.\n    If one of the Entity and Principal parameters is $null, $null is returned.\n    #>\n    [PSObject] GetVMHostPermission($entity, $vmHostPrincipal) {\n        if ($null -eq $entity -or $null -eq $vmHostPrincipal) {\n            return $null\n        }\n\n        return Get-VIPermission -Server $this.Connection -Entity $entity -Principal $vmHostPrincipal -ErrorAction SilentlyContinue -Verbose:$false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Role with the specified name from the VMHost if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVMHostRole() {\n        try {\n            $vmHostRole = Get-VIRole -Server $this.Connection -Name $this.RoleName -ErrorAction Stop -Verbose:$false\n            return $vmHostRole\n        }\n        catch {\n            throw ($this.CouldNotRetrieveRoleMessage -f $this.RoleName, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures the correct behaviour if the Entity is not found based on the passed Ensure value.\n    If Ensure is 'Present' and the Entity is not found, the method should throw an exception.\n    #>\n    [void] EnsureCorrectBehaviourIfTheEntityIsNotFound($entity, $exceptionMessage) {\n        if ($null -eq $entity) {\n            if ($this.Ensure -eq [Ensure]::Present) {\n                throw $exceptionMessage\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified Permission should be modified. The Permission should be modified if the desired Role is different\n    from the current one or if the Propagate behaviour should be different.\n    #>\n    [bool] ShouldModifyVMHostPermission($vmHostPermission) {\n        $shouldModifyVMHostPermission = @(\n            $this.ShouldUpdateDscResourceSetting('RoleName', [string] $vmHostPermission.Role, $this.RoleName),\n            $this.ShouldUpdateDscResourceSetting('Propagate', $vmHostPermission.Propagate, $this.Propagate)\n        )\n\n        return ($shouldModifyVMHostPermission -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Permission and applies it to the specified Entity, Principal and Role.\n    #>\n    [void] NewVMHostPermission($entity, $vmHostPrincipal) {\n        $vmHostRole = $this.GetVMHostRole()\n        $newVIPermissionParams = @{\n            Server = $this.Connection\n            Entity = $entity\n            Principal = $vmHostPrincipal\n            Role = $vmHostRole\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Propagate) {\n            $newVIPermissionParams.Propagate = $this.Propagate\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreatePermissionMessage, @($entity.Name, $vmHostPrincipal.Name, $vmHostRole.Name, $this.Connection.Name))\n\n            New-VIPermission @newVIPermissionParams\n        }\n        catch {\n            throw ($this.CouldNotCreatePermissionMessage -f $entity.Name, $vmHostPrincipal.Name, $vmHostRole.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the properties of the specified Permission. Changes the Role if the desired one is not the same as the current one.\n    It also changes the propagate behaviour of the Permission if the 'Propagate' property is specified.\n    #>\n    [void] ModifyVMHostPermission($vmHostPermission) {\n        $setVIPermissionParams = @{\n            Server = $this.Connection\n            Permission = $vmHostPermission\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($vmHostPermission.Role -ne $this.RoleName) {\n            $vmHostRole = $this.GetVMHostRole()\n            $setVIPermissionParams.Role = $vmHostRole\n        }\n\n        if ($null -ne $this.Propagate) {\n            $setVIPermissionParams.Propagate = $this.Propagate\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyPermissionMessage, @($vmHostPermission.Entity.Name, $vmHostPermission.Principal, $this.Connection.Name))\n\n            Set-VIPermission @setVIPermissionParams\n        }\n        catch {\n            throw ($this.CouldNotModifyPermissionMessage -f $vmHostPermission.Entity.Name, $vmHostPermission.Principal, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Permission.\n    #>\n    [void] RemoveVMHostPermission($vmHostPermission) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemovePermissionMessage, @($vmHostPermission.Entity.Name, $vmHostPermission.Principal, $vmHostPermission.Role, $this.Connection.Name))\n\n            $vmHostPermission | Remove-VIPermission -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotRemovePermissionMessage -f $vmHostPermission.Entity.Name, $vmHostPermission.Principal, $vmHostPermission.Role, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostPermission) {\n        $result.Server = $this.Connection.Name\n        $result.EntityLocation = $this.EntityLocation\n        $result.EntityType = $this.EntityType\n\n        if ($null -ne $vmHostPermission) {\n            $result.EntityName = $vmHostPermission.Entity.Name\n            $result.PrincipalName = $vmHostPermission.Principal\n            $result.RoleName = $vmHostPermission.Role\n            $result.Ensure = [Ensure]::Present\n            $result.Propagate = $vmHostPermission.Propagate\n        }\n        else {\n            $result.EntityName = $this.EntityName\n            $result.PrincipalName = $this.PrincipalName\n            $result.RoleName = $this.RoleName\n            $result.Ensure = [Ensure]::Absent\n            $result.Propagate = $this.Propagate\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostPowerPolicy : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Power Management Policy for the specified VMHost.\n    #>\n    [DscProperty(Mandatory)]\n    [PowerPolicy] $PowerPolicy\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostPowerSystem = $this.GetVMHostPowerSystem($vmHost)\n\n            $this.UpdatePowerPolicy($vmHostPowerSystem)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $currentPowerPolicy = $vmHost.ExtensionData.Config.PowerSystemInfo.CurrentPolicy\n\n            $result = !$this.ShouldUpdateDscResourceSetting('PowerPolicy', $currentPowerPolicy.Key, $this.PowerPolicy)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostPowerPolicy] Get() {\n        try {\n            $result = [VMHostPowerPolicy]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $currentPowerPolicy = $vmHost.ExtensionData.Config.PowerSystemInfo.CurrentPolicy\n\n            $result.Name = $vmHost.Name\n            $result.PowerPolicy = $currentPowerPolicy.Key\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Power System of the specified VMHost from the server.\n    #>\n    [PSObject] GetVMHostPowerSystem($vmHost) {\n        try {\n            $vmHostPowerSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.PowerSystem -ErrorAction Stop\n            return $vmHostPowerSystem\n        }\n        catch {\n            throw \"Could not retrieve the Power System of VMHost $($vmHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Power Management Policy of the specified VMHost.\n    #>\n    [void] UpdatePowerPolicy($vmHostPowerSystem) {\n        try {\n            Update-PowerPolicy -VMHostPowerSystem $vmHostPowerSystem -PowerPolicy $this.PowerPolicy\n        }\n        catch {\n            throw \"The Power Policy of VMHost $($this.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostRole : BaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Role on the VMHost.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the Role on the VMHost should be present or absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the ids of the Privileges for the Role on the VMHost. The Privilege ids should be in the following format: '<Privilege Group id>.<Privilege Item id>'.\n    Exampe Privilege id: 'VirtualMachine.Inventory.Create' where 'VirtualMachine.Inventory' is the Privilege Group id and 'Create' is the id of the Privilege item.\n    #>\n    [DscProperty()]\n    [string[]] $PrivilegeIds\n\n    hidden [string] $CreateRoleMessage = \"Creating Role {0} on VMHost {1}.\"\n    hidden [string] $CreateRoleWithPrivilegesMessage = \"Creating Role {0} with Privileges {1} on VMHost {2}.\"\n    hidden [string] $ModifyPrivilegesOfRoleMessage = \"Modifying Privileges of Role {0} on VMHost {1}.\"\n    hidden [string] $RemoveRoleMessage = \"Removing Role {0} on VMHost {1}.\"\n\n    hidden [string] $CouldNotFindPrivilegeMessage = \"The passed Privilege {0} was not found and it will be ignored.\"\n    hidden [string] $CouldNotRetrieveRolePrivilegesMessage = \"Could not retrieve Privilege {0} of Role {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreateRoleMessage = \"Could not create Role {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreateRoleWithPrivilegesMessage = \"Could not create Role {0} with Privileges {1} on VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotModifyPrivilegesOfRoleMessage = \"Could not modify Privileges of Role {0} on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRemoveRoleMessage = \"Could not remove Role {0} on VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $vmHostRole = $this.GetVMHostRole()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $desiredPrivileges = $this.GetPrivileges()\n\n                if ($null -eq $vmHostRole) {\n                    if ($desiredPrivileges.Length -gt 0) {\n                        $this.NewVMHostRole($desiredPrivileges)\n                    }\n                    else {\n                        $this.NewVMHostRole()\n                    }\n                }\n                else {\n                    $currentPrivileges = $this.GetRolePrivileges($vmHostRole, $desiredPrivileges)\n                    $this.ModifyPrivilegesOfVMHostRole($vmHostRole, $currentPrivileges, $desiredPrivileges)\n                }\n            }\n            else {\n                if ($null -ne $vmHostRole) {\n                    $this.RemoveVMHostRole($vmHostRole)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsESXi()\n\n            $vmHostRole = $this.GetVMHostRole()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostRole) {\n                    $result = $false\n                }\n                else {\n                    $desiredPrivileges = $this.GetPrivileges()\n                    $desiredPrivilegeIds = if ($desiredPrivileges.Length -eq 0) { $null } else { $desiredPrivileges.Id }\n\n                    $result = !$this.ShouldUpdateArraySetting('PrivilegeList', $vmHostRole.PrivilegeList, $desiredPrivilegeIds)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostRole)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostRole] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostRole]::new()\n\n            $this.EnsureConnectionIsESXi()\n\n            $vmHostRole = $this.GetVMHostRole()\n            $this.PopulateResult($result, $vmHostRole)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Role with the specified name on the VMHost if it exists, otherwise returns $null.\n    #>\n    [PSObject] GetVMHostRole() {\n        return Get-VIRole -Server $this.Connection -Name $this.Name -ErrorAction SilentlyContinue -Verbose:$false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Privileges with the specified ids on the VMHost if they exist.\n    For every Privilege that does not exist, a warning message is shown to the user without throwing an exception.\n    #>\n    [array] GetPrivileges() {\n        $privileges = @()\n\n        foreach ($privilegeId in $this.PrivilegeIds) {\n            $privilege = Get-VIPrivilege -Server $this.Connection -Id $privilegeId -ErrorAction SilentlyContinue -Verbose:$false\n            if ($null -eq $privilege) {\n                $this.WriteLogUtil('Warning', $this.CouldNotFindPrivilegeMessage, @($privilegeId))\n            }\n            else {\n                $privileges += $privilege\n            }\n        }\n\n        return $privileges\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Privileges of the Role on the VMHost.\n    #>\n    [array] GetRolePrivileges($vmHostRole, $desiredPrivileges) {\n        $rolePrivileges = @()\n\n        foreach ($privilegeId in $vmHostRole.PrivilegeList) {\n            <#\n            Here we can check if the desired Privilege list already contains the Role Privilege and this way\n            we can skip the server call because the Privilege object is already available in the array of Privileges.\n            #>\n            if ($desiredPrivileges.Length -gt 0 -and $desiredPrivileges.Id.Contains($privilegeId)) {\n                $rolePrivileges += ($desiredPrivileges | Where-Object -FilterScript { $_.Id -eq $privilegeId })\n            }\n            else {\n                try {\n                    $rolePrivilige = Get-VIPrivilege -Server $this.Connection -Id $privilegeId -ErrorAction Stop -Verbose:$false\n                    $rolePrivileges += $rolePrivilige\n                }\n                catch {\n                    throw ($this.CouldNotRetrieveRolePrivilegesMessage -f $privilegeId, $vmHostRole.Name, $_.Exception.Message)\n                }\n            }\n        }\n\n        return $rolePrivileges\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Role with the specified name on the VMHost.\n    #>\n    [void] NewVMHostRole() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateRoleMessage, @($this.Name, $this.Connection.Name))\n\n            New-VIRole -Server $this.Connection -Name $this.Name -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotCreateRoleMessage -f $this.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Role with the specified name on the VMHost and applies the provided Privileges.\n    #>\n    [void] NewVMHostRole($desiredPrivileges) {\n        $desiredPrivilegeIds = [string]::Join(', ', $desiredPrivileges.Id)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateRoleWithPrivilegesMessage, @($this.Name, $desiredPrivilegeIds, $this.Connection.Name))\n\n            New-VIRole -Server $this.Connection -Name $this.Name -Privilege $desiredPrivileges -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotCreateRoleWithPrivilegesMessage -f $this.Name, $desiredPrivilegeIds, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the Privileges of the Role on the VMHost. The 'Set-VIRole' cmdlet has two parameters for Privileges - 'AddPrivilege' and 'RemovePrivilege'.\n    So based on the provided desired Privileges we need to add those of them that are not yet Privileges of the Role and also remove existing ones\n    from the Privilege list of the Role because they are not specified as desired.\n    #>\n    [void] ModifyPrivilegesOfVMHostRole($vmHostRole, $currentPrivileges, $desiredPrivileges) {\n        $setVIRoleParams = @{\n            Server = $this.Connection\n            Role = $vmHostRole\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n        $privilegesToAdd = @()\n        $privilegesToRemove = @()\n\n        <#\n        If the Role does not have Privileges, it means that all desired Privileges need to be marked as Privileges to add.\n        Otherwise Privileges to add are those that are not present in the Privilege list of the Role and Privileges\n        to remove are those that are not present in the desired Privilege list.\n        #>\n        if ($currentPrivileges.Length -eq 0) {\n            $privilegesToAdd = $desiredPrivileges\n        }\n        else {\n            $privilegesToAdd = $desiredPrivileges | Where-Object -FilterScript { $currentPrivileges -NotContains $_ }\n            $privilegesToRemove = $currentPrivileges | Where-Object -FilterScript { $desiredPrivileges -NotContains $_ }\n        }\n\n        <#\n        If the Privileges to add array is empty, it means that only removal of Privileges is needed. Otherwise, we first add\n        all the specified Privileges that are not present in the list of Privileges of the Role and after that check if there are\n        Privileges to remove from that list. The 'AddPrivilege' entry needs to be removed from the params hashtable because 'AddPrivilege'\n        and 'RemovePrivilege' parameters of 'Set-VIRole' cmdlet are in different parameter sets, so two cmdlet invocations need to be made.\n        #>\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyPrivilegesOfRoleMessage, @($vmHostRole.Name, $this.Connection.Name))\n\n            if ($privilegesToAdd.Length -eq 0) {\n                $setVIRoleParams.RemovePrivilege = $privilegesToRemove\n                Set-VIRole @setVIRoleParams\n            }\n            else {\n                $setVIRoleParams.AddPrivilege = $privilegesToAdd\n                Set-VIRole @setVIRoleParams\n\n                if ($privilegesToRemove.Length -gt 0) {\n                    $setVIRoleParams.Remove('AddPrivilege')\n                    $setVIRoleParams.RemovePrivilege = $privilegesToRemove\n\n                    Set-VIRole @setVIRoleParams\n                }\n            }\n        }\n        catch {\n            throw ($this.CouldNotModifyPrivilegesOfRoleMessage -f $vmHostRole.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Role on the VMHost. All Permissions associated with the Role will be removed as well.\n    #>\n    [void] RemoveVMHostRole($vmHostRole) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveRoleMessage, @($vmHostRole.Name, $this.Connection.Name))\n\n            $vmHostRole | Remove-VIRole -Server $this.Connection -Force -Confirm:$false -ErrorAction Stop -Verbose:$false\n        }\n        catch {\n            throw ($this.CouldNotRemoveRoleMessage -f $vmHostRole.Name, $this.Connection.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostRole) {\n        $result.Server = $this.Connection.Name\n\n        if ($null -ne $vmHostRole) {\n            $result.Name = $vmHostRole.Name\n            $result.Ensure = [Ensure]::Present\n            $result.PrivilegeIds = $vmHostRole.PrivilegeList\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.PrivilegeIds = $this.PrivilegeIds\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostSatpClaimRule : EsxCliBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Value indicating if the SATP Claim Rule should be Present or Absent.\n    #>\n    [DscProperty(Mandatory)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Name of the SATP Claim Rule.\n    #>\n    [DscProperty(Key)]\n    [string] $RuleName\n\n    <#\n    .DESCRIPTION\n\n    PSP options for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $PSPOptions\n\n    <#\n    .DESCRIPTION\n\n    Transport Property of the Satp Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Transport\n\n    <#\n    .DESCRIPTION\n\n    Description string to set when adding the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Description\n\n    <#\n    .DESCRIPTION\n\n    Vendor string to set when adding the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Vendor\n\n    <#\n    .DESCRIPTION\n\n    System default rule added at boot time.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Boot\n\n    <#\n    .DESCRIPTION\n\n    Claim type for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Type\n\n    <#\n    .DESCRIPTION\n\n    Device of the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Device\n\n    <#\n    .DESCRIPTION\n\n    Driver string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Driver\n\n    <#\n    .DESCRIPTION\n\n    Claim option string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $ClaimOptions\n\n    <#\n    .DESCRIPTION\n\n    Default PSP for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Psp\n\n    <#\n    .DESCRIPTION\n\n    Option string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Options\n\n    <#\n    .DESCRIPTION\n\n    Model string for the SATP Claim Rule.\n    #>\n    [DscProperty()]\n    [string] $Model\n\n    <#\n    .DESCRIPTION\n\n    Value, which ignores validity checks and install the rule anyway.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.GetEsxCli($vmHost)\n            $satpClaimRule = $this.GetSatpClaimRule()\n            $satpClaimRulePresent = ($null -ne $satpClaimRule)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if (!$satpClaimRulePresent) {\n                    $this.AddSatpClaimRule()\n                }\n            }\n            else {\n                if ($satpClaimRulePresent) {\n                    $this.RemoveSatpClaimRule()\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.GetEsxCli($vmHost)\n            $satpClaimRule = $this.GetSatpClaimRule()\n            $satpClaimRulePresent = ($null -ne $satpClaimRule)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = $satpClaimRulePresent\n            }\n            else {\n                $result = -not $satpClaimRulePresent\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostSatpClaimRule] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSatpClaimRule]::new()\n\n            $result.Server = $this.Server\n            $result.RuleName = $this.RuleName\n            $result.Boot = $this.Boot\n            $result.Type = $this.Type\n            $result.Force = $this.Force\n\n            $vmHost = $this.GetVMHost()\n            $result.Name = $vmHost.Name\n\n            $this.GetEsxCli($vmHost)\n            $satpClaimRule = $this.GetSatpClaimRule()\n            $satpClaimRulePresent = ($null -ne $satpClaimRule)\n\n            if (!$satpClaimRulePresent) {\n                $result.Ensure = \"Absent\"\n                $result.Psp = $this.Psp\n                $this.PopulateResult($result, $this)\n            }\n            else {\n                $result.Ensure = \"Present\"\n                $result.Psp = $satpClaimRule.DefaultPSP\n                $this.PopulateResult($result, $satpClaimRule)\n            }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the desired SATP Claim Rule is equal to the passed SATP Claim Rule.\n    #>\n    [bool] Equals($satpClaimRule) {\n        if ($this.RuleName -ne $satpClaimRule.Name) {\n            return $false\n        }\n\n        <#\n            For every optional property we check if it is not passed(if it is null), because\n            all properties on the server, which are not set are returned as empty strings and\n            if we compare null with empty string the equality will fail.\n        #>\n\n        if ($null -ne $this.PSPOptions -and $this.PSPOptions -ne $satpClaimRule.PSPOptions) {\n            return $false\n        }\n\n        if ($null -ne $this.Transport -and $this.Transport -ne $satpClaimRule.Transport) {\n            return $false\n        }\n\n        if ($null -ne $this.Description -and $this.Description -ne $satpClaimRule.Description) {\n            return $false\n        }\n\n        if ($null -ne $this.Vendor -and $this.Vendor -ne $satpClaimRule.Vendor) {\n            return $false\n        }\n\n        if ($null -ne $this.Device -and $this.Device -ne $satpClaimRule.Device) {\n            return $false\n        }\n\n        if ($null -ne $this.Driver -and $this.Driver -ne $satpClaimRule.Driver) {\n            return $false\n        }\n\n        if ($null -ne $this.ClaimOptions -and $this.ClaimOptions -ne $satpClaimRule.ClaimOptions) {\n            return $false\n        }\n\n        if ($null -ne $this.Psp -and $this.Psp -ne $satpClaimRule.DefaultPSP) {\n            return $false\n        }\n\n        if ($null -ne $this.Options -and $this.Options -ne $satpClaimRule.Options) {\n            return $false\n        }\n\n        if ($null -ne $this.Model -and $this.Model -ne $satpClaimRule.Model) {\n            return $false\n        }\n\n        return $true\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the desired SatpClaimRule if the Rule is present on the server, otherwise returns $null.\n    #>\n    [PSObject] GetSatpClaimRule() {\n        $foundSatpClaimRule = $null\n        $satpClaimRules = Get-SATPClaimRules -EsxCli $this.EsxCli\n\n        foreach ($satpClaimRule in $satpClaimRules) {\n            if ($this.Equals($satpClaimRule)) {\n                $foundSatpClaimRule = $satpClaimRule\n                break\n            }\n        }\n\n        return $foundSatpClaimRule\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the SATP Claim Rule properties from the server.\n    #>\n    [void] PopulateResult($result, $satpClaimRule) {\n        $result.PSPoptions = $satpClaimRule.PSPOptions\n        $result.Transport = $satpClaimRule.Transport\n        $result.Description = $satpClaimRule.Description\n        $result.Vendor = $satpClaimRule.Vendor\n        $result.Device = $satpClaimRule.Device\n        $result.Driver = $satpClaimRule.Driver\n        $result.ClaimOptions = $satpClaimRule.ClaimOptions\n        $result.Options = $satpClaimRule.Options\n        $result.Model = $satpClaimRule.Model\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the arguments for the Add and Remove operations of SATP Claim Rule with the specified properties from the user.\n    #>\n    [void] PopulateSatpArgs($satpArgs) {\n        $satpArgs.satp = $this.RuleName\n        $satpArgs.pspoption = $this.PSPoptions\n        $satpArgs.transport = $this.Transport\n        $satpArgs.description = $this.Description\n        $satpArgs.vendor = $this.Vendor\n        $satpArgs.type = $this.Type\n        $satpArgs.device = $this.Device\n        $satpArgs.driver = $this.Driver\n        $satpArgs.claimoption = $this.ClaimOptions\n        $satpArgs.psp = $this.Psp\n        $satpArgs.option = $this.Options\n        $satpArgs.model = $this.Model\n\n        if ($null -ne $this.Boot) { $satpArgs.boot = $this.Boot }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Installs the new SATP Claim Rule with the specified properties from the user.\n    #>\n    [void] AddSatpClaimRule() {\n        $satpArgs = Add-CreateArgs -EsxCli $this.EsxCli\n        if ($null -ne $this.Force) { $satpArgs.force = $this.Force }\n\n        $this.PopulateSatpArgs($satpArgs)\n\n        try {\n            Add-SATPClaimRule -EsxCli $this.EsxCli -SatpArgs $satpArgs\n        }\n        catch {\n            throw \"EsxCLI command for adding satp rule failed with the following exception: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Uninstalls the SATP Claim Rule with the specified properties from the user.\n    #>\n    [void] RemoveSatpClaimRule() {\n        $satpArgs = Remove-CreateArgs -EsxCli $this.EsxCli\n\n        $this.PopulateSatpArgs($satpArgs)\n\n        try {\n            Remove-SATPClaimRule -EsxCli $this.EsxCli -SatpArgs $satpArgs\n        }\n        catch {\n            throw \"EsxCLI command for removing satp rule failed with the following exception: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostScsiLun : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the canonical name of the SCSI device. An example of a SCSI canonical name is 'vmhba0:0:0:0'.\n    #>\n    [DscProperty(Key)]\n    [string] $CanonicalName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the policy that the Lun must use when choosing a path. The following values are valid:\n    Fixed - uses the preferred SCSI Lun path whenever possible.\n    RoundRobin - load balance.\n    MostRecentlyUsed - uses the most recently used SCSI Lun path.\n    Unknown\n    #>\n    [DscProperty()]\n    [MultipathPolicy] $MultipathPolicy = [MultipathPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the preferred SCSI Lun path to access the SCSI Lun.\n    #>\n    [DscProperty()]\n    [string] $PreferredScsiLunPathName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum number of I/O blocks to be issued on a given path before the system tries to select a different path. Modifying this setting affects all SCSI Lun devices that are connected to the same VMHost.\n    The default value is 2048. Setting this parameter to zero (0) disables switching based on blocks.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BlocksToSwitchPath\n\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum number of I/O requests to be issued on a given path before the system tries to select a different path. Modifying this setting affects all SCSI Lun devices that are connected to the same VMHost.\n    The default value is 50. Setting this parameter to zero (0) disables switching based on commands. This parameter is not supported on vCenter Server 4.x.\n    #>\n    [DscProperty()]\n    [nullable[int]] $CommandsToSwitchPath\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to remove all partitions from the SCSI disk.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DeletePartitions\n\n    <#\n    .DESCRIPTION\n\n    Marks the SCSI disk as local or remote. If the value is $true, the SCSI disk is local. If the value is $false, the SCSI disk is remote.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IsLocal\n\n    <#\n    .DESCRIPTION\n\n    Marks the SCSI disk as an SSD or HDD. If the value is $true, the SCSI disk is SSD type. If the value is $false, the SCSI disk is HDD type.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $IsSsd\n\n    hidden [string] $ModifyScsiLunConfigurationMessage = \"Modifying the configuration of SCSI device {0} from VMHost {1}.\"\n\n    hidden [string] $CouldNotRetrieveScsiLunMessage = \"Could not retrieve SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveScsiLunPathMessage = \"Could not retrieve SCSI Lun path {0} to SCSI device {1} from VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotRetrievePreferredScsiLunPathMessage = \"Could not retrieve the preferred SCSI Lun path to SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveScsiLunDiskInformationMessage = \"Could not retrieve SCSI Lun disk information for SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotModifyScsiLunConfigurationMessage = \"Could not modify the configuration of SCSI device {0} from VMHost {1}. For more information: {2}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n\n            $this.ModifyScsiLunConfiguration($scsiLun)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n\n            $result = !$this.ShouldModifyScsiLunConfiguration($scsiLun)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostScsiLun] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostScsiLun]::new()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n\n            $this.PopulateResult($result, $scsiLun)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI device with the specified canonical name from the specified VMHost if it exists.\n    #>\n    [PSObject] GetScsiLun() {\n        try {\n            $scsiLun = Get-ScsiLun -Server $this.Connection -VmHost $this.VMHost -CanonicalName $this.CanonicalName -ErrorAction Stop -Verbose:$false\n            return $scsiLun\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunMessage -f $this.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI Lun path with the specified name to the specified SCSI device if it exists.\n    #>\n    [PSObject] GetScsiLunPath($scsiLun) {\n        try {\n            $scsiLunPath = Get-ScsiLunPath -Name $this.PreferredScsiLunPathName -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n            return $scsiLunPath\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunPathMessage -f $this.PreferredScsiLunPathName, $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the preferred SCSI Lun path to the specified SCSI device.\n    #>\n    [PSObject] GetPreferredScsiLunPath($scsiLun) {\n        try {\n            # For each SCSI device there is only one SCSI Lun path which is preferred.\n            $preferredScsiLunPath = Get-ScsiLunPath -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false |\n                                    Where-Object -FilterScript { $_.Preferred }\n            return $preferredScsiLunPath\n        }\n        catch {\n            throw ($this.CouldNotRetrievePreferredScsiLunPathMessage -f $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves SCSI Lun disk information for the specified SCSI device.\n    #>\n    [PSObject] GetVMHostDisk($scsiLun) {\n        try {\n            $vmHostDisk = Get-VMHostDisk -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n            return $vmHostDisk\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunDiskInformationMessage -f $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the SCSI device configuration should be modified.\n    #>\n    [bool] ShouldModifyScsiLunConfiguration($scsiLun) {\n        $shouldModifyScsiLunConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('MultipathPolicy', [string] $scsiLun.MultipathPolicy, $this.MultipathPolicy.ToString()),\n            $this.ShouldUpdateDscResourceSetting('IsLocal', $scsiLun.IsLocal, $this.IsLocal),\n            $this.ShouldUpdateDscResourceSetting('IsSsd', $scsiLun.IsSsd, $this.IsSsd)\n        )\n\n        # 'BlocksToSwitchPath' and 'CommandsToSwitchPath' properties should determine the Desired State only when the desired Multipath policy is 'Round Robin'.\n        if ($this.MultipathPolicy -eq [MultipathPolicy]::RoundRobin) {\n            $shouldModifyScsiLunConfiguration += $this.ShouldUpdateDscResourceSetting(\n                'BlocksToSwitchPath',\n                [int] $scsiLun.BlocksToSwitchPath,\n                $this.BlocksToSwitchPath\n            )\n            $shouldModifyScsiLunConfiguration += $this.ShouldUpdateDscResourceSetting(\n                'CommandsToSwitchPath',\n                [int] $scsiLun.CommandsToSwitchPath,\n                $this.CommandsToSwitchPath\n            )\n        }\n\n        if (![string]::IsNullOrEmpty($this.PreferredScsiLunPathName) -and $this.MultipathPolicy -eq [MultipathPolicy]::Fixed) {\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            # If the found SCSI Lun path is not preferred, the SCSI device is not in a desired state.\n            $shouldModifyScsiLunConfiguration += !$scsiLunPath.Preferred\n        }\n\n        # If the VMHost disk has existing partitions and 'DeletePartitions' is specified, the SCSI device is not in a desired state.\n        if ($null -ne $this.DeletePartitions -and $this.DeletePartitions) {\n            $vmHostDisk = $this.GetVMHostDisk($scsiLun)\n            $shouldModifyScsiLunConfiguration += ($null -ne $vmHostDisk.ExtensionData.Spec.Partition)\n        }\n\n        return ($shouldModifyScsiLunConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Modifies the configuration of the specified SCSI device.\n    #>\n    [void] ModifyScsiLunConfiguration($scsiLun) {\n        $setScsiLunParams = @{\n            ScsiLun = $scsiLun\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($this.MultipathPolicy -ne [MultipathPolicy]::Unset) { $setScsiLunParams.MultipathPolicy = $this.MultipathPolicy.ToString() }\n        if ($null -ne $this.IsLocal) { $setScsiLunParams.IsLocal = $this.IsLocal }\n        if ($null -ne $this.IsSsd) { $setScsiLunParams.IsSsd = $this.IsSsd }\n\n        # 'BlocksToSwitchPath' and 'CommandsToSwitchPath' parameters should be passed to the cmdlet only if the desired Multipath policy is 'Round Robin'.\n        if ($this.MultipathPolicy -eq [MultipathPolicy]::RoundRobin) {\n            if ($null -ne $this.BlocksToSwitchPath) { $setScsiLunParams.BlocksToSwitchPath = $this.BlocksToSwitchPath }\n            if ($null -ne $this.CommandsToSwitchPath) { $setScsiLunParams.CommandsToSwitchPath = $this.CommandsToSwitchPath }\n        }\n\n        if ($null -ne $this.DeletePartitions) {\n            # Force should be specified to avoid the user being asked for confirmation when deleting disk partitions.\n            $setScsiLunParams.DeletePartitions = $this.DeletePartitions\n            $setScsiLunParams.Force = $true\n        }\n\n        if (![string]::IsNullOrEmpty($this.PreferredScsiLunPathName) -and $this.MultipathPolicy -eq [MultipathPolicy]::Fixed) {\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n            $setScsiLunParams.PreferredPath = $scsiLunPath\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ModifyScsiLunConfigurationMessage, @($scsiLun.CanonicalName, $this.VMHost.Name))\n\n            Set-ScsiLun @setScsiLunParams\n        }\n        catch {\n            throw ($this.CouldNotModifyScsiLunConfigurationMessage -f $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $scsiLun) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.CanonicalName = $scsiLun.CanonicalName\n        $result.MultipathPolicy = $scsiLun.MultipathPolicy.ToString()\n        $result.BlocksToSwitchPath = [int] $scsiLun.BlocksToSwitchPath\n        $result.CommandsToSwitchPath = [int] $scsiLun.CommandsToSwitchPath\n        $result.IsLocal = $scsiLun.IsLocal\n        $result.IsSsd = $scsiLun.IsSsd\n\n        $preferredScsiLunPath = $this.GetPreferredScsiLunPath($scsiLun)\n        $result.PreferredScsiLunPathName = $preferredScsiLunPath.Name\n        $result.DeletePartitions = $this.DeletePartitions\n    }\n}\n\n[DscResource()]\nclass VMHostScsiLunPath : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the SCSI Lun path to the specified SCSI device in 'ScsiLunCanonicalName' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the canonical name of the SCSI device for the specified SCSI Lun path in 'Name' key property.\n    #>\n    [DscProperty(Key)]\n    [string] $ScsiLunCanonicalName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the SCSI Lun path should be active.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Active\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the SCSI Lun path should be preferred. Only one SCSI Lun path can be preferred, so when a SCSI Lun path is made preferred, the preference is removed from the previously preferred SCSI Lun path.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Preferred\n\n    hidden [string] $ActiveScsiLunPathState = 'Active'\n\n    hidden [string] $ConfigureScsiLunPathMessage = \"Configuring SCSI Lun path {0} to SCSI device {1} from VMHost {2}.\"\n\n    hidden [string] $CouldNotRetrieveScsiLunMessage = \"Could not retrieve SCSI device {0} from VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotRetrieveScsiLunPathMessage = \"Could not retrieve SCSI Lun path {0} to SCSI device {1} from VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotConfigureScsiLunPathMessage = \"Could not configure SCSI Lun path {0} to SCSI device {1} from VMHost {2}. For more information: {3}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            $this.ConfigureScsiLunPath($scsiLunPath)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            $result = !$this.ShouldConfigureScsiLunPath($scsiLunPath)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostScsiLunPath] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostScsiLunPath]::new()\n\n            $this.RetrieveVMHost()\n\n            $scsiLun = $this.GetScsiLun()\n            $scsiLunPath = $this.GetScsiLunPath($scsiLun)\n\n            $this.PopulateResult($result, $scsiLunPath)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI device with the specified canonical name from the specified VMHost if it exists.\n    #>\n    [PSObject] GetScsiLun() {\n        try {\n            $scsiLun = Get-ScsiLun -Server $this.Connection -VmHost $this.VMHost -CanonicalName $this.ScsiLunCanonicalName -ErrorAction Stop -Verbose:$false\n            return $scsiLun\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunMessage -f $this.ScsiLunCanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the SCSI Lun path with the specified name to the specified SCSI device if it exists.\n    #>\n    [PSObject] GetScsiLunPath($scsiLun) {\n        try {\n            $scsiLunPath = Get-ScsiLunPath -Name $this.Name -ScsiLun $scsiLun -ErrorAction Stop -Verbose:$false\n            return $scsiLunPath\n        }\n        catch {\n            throw ($this.CouldNotRetrieveScsiLunPathMessage -f $this.Name, $scsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the SCSI Lun path should be configured depending on the desired 'Active' and 'Preferred' values.\n    #>\n    [bool] ShouldConfigureScsiLunPath($scsiLunPath) {\n        $shouldConfigureScsiLunPath = @(\n            $this.ShouldUpdateDscResourceSetting('Preferred', $scsiLunPath.Preferred, $this.Preferred)\n        )\n\n        if ($null -ne $this.Active) {\n            $currentScsiLunPathState = $scsiLunPath.State.ToString()\n            if ($this.Active) {\n                $shouldConfigureScsiLunPath += ($currentScsiLunPathState -ne $this.ActiveScsiLunPathState)\n            }\n            else {\n                $shouldConfigureScsiLunPath += ($currentScsiLunPathState -eq $this.ActiveScsiLunPathState)\n            }\n        }\n\n        return ($shouldConfigureScsiLunPath -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Configures the SCSI Lun path with the specified name with the desired 'Active' and 'Preferred' values.\n    #>\n    [void] ConfigureScsiLunPath($scsiLunPath) {\n        $setScsiLunPathParams = @{\n            ScsiLunPath = $scsiLunPath\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        if ($null -ne $this.Active) { $setScsiLunPathParams.Active = $this.Active }\n        if ($null -ne $this.Preferred) { $setScsiLunPathParams.Preferred = $this.Preferred }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ConfigureScsiLunPathMessage, @($scsiLunPath.Name, $scsiLunPath.ScsiLun.CanonicalName, $this.VMHost.Name))\n\n            Set-ScsiLunPath @setScsiLunPathParams\n        }\n        catch {\n            throw ($this.CouldNotConfigureScsiLunPathMessage -f $scsiLunPath.Name, $scsiLunPath.ScsiLun.CanonicalName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $scsiLunPath) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.Name = $scsiLunPath.Name\n        $result.ScsiLunCanonicalName = $scsiLunPath.ScsiLun.CanonicalName\n        $result.Active = if ($scsiLunPath.State.ToString() -eq $this.ActiveScsiLunPathState) { $true } else { $false }\n        $result.Preferred = $scsiLunPath.Preferred\n    }\n}\n\n[DscResource()]\nclass VMHostService : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The key value of the service.\n    #>\n    [DscProperty(Key)]\n    [string] $Key\n\n    <#\n    .DESCRIPTION\n\n    The state of the service after a VMHost reboot.\n    #>\n    [DscProperty()]\n    [ServicePolicy] $Policy = [ServicePolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    The current state of the service.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Running\n\n    <#\n    .DESCRIPTION\n\n    Host Service Label.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string] $Label\n\n    <#\n    .DESCRIPTION\n\n    Host Service Required flag.\n    #>\n    [DscProperty(NotConfigurable)]\n    [bool] $Required\n\n    <#\n    .DESCRIPTION\n\n    Firewall rules for the service.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string[]] $Ruleset\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostService($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateVMHostService($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostService] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostService]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostService should to be updated.\n    #>\n    [bool] ShouldUpdateVMHostService($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vmHostCurrentService = Get-VMHostService -Server $this.Connection -VMHost $vmHost | Where-Object { $_.Key -eq $this.Key }\n\n        $shouldUpdateVMHostService = @(\n            $this.ShouldUpdateDscResourceSetting('Policy', [string] $vmHostCurrentService.Policy, $this.Policy.ToString()),\n            $this.ShouldUpdateDscResourceSetting('Running', $vmHostCurrentService.Running, $this.Running)\n        )\n\n        return ($shouldUpdateVMHostService -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the VMHostService.\n    #>\n    [void] UpdateVMHostService($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vmHostCurrentService = Get-VMHostService -Server $this.Connection -VMHost $vmHost | Where-Object { $_.Key -eq $this.Key }\n\n        if ($this.ShouldUpdateDscResourceSetting('Policy', [string] $vmHostCurrentService.Policy, $this.Policy.ToString())) {\n            Set-VMHostService -HostService $vmHostCurrentService -Policy $this.Policy.ToString() -Confirm:$false\n        }\n\n        if ($this.ShouldUpdateDscResourceSetting('Running', $vmHostCurrentService.Running, $this.Running)) {\n            if ($vmHostCurrentService.Running) {\n                Stop-VMHostService -HostService $vmHostCurrentService -Confirm:$false\n            }\n            else {\n                Start-VMHostService -HostService $vmHostCurrentService -Confirm:$false\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMHostService from the server.\n    #>\n    [void] PopulateResult($vmHost, $vmHostService) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vmHostCurrentService = Get-VMHostService -Server $this.Connection -VMHost $vmHost | Where-Object { $_.Key -eq $this.Key }\n        $vmHostService.Name = $vmHost.Name\n        $vmHostService.Server = $this.Server\n        $vmHostService.Key = $vmHostCurrentService.Key\n        $vmHostService.Policy = $vmHostCurrentService.Policy\n        $vmHostService.Running = $vmHostCurrentService.Running\n        $vmHostService.Label = $vmHostCurrentService.Label\n        $vmHostService.Required = $vmHostCurrentService.Required\n        $vmHostService.Ruleset = $vmHostCurrentService.Ruleset\n    }\n}\n\n[DscResource()]\nclass VMHostSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Motd Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Motd\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Motd content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $MotdClear\n\n    <#\n    .DESCRIPTION\n\n    Issue Advanced Setting value.\n    #>\n    [DscProperty()]\n    [string] $Issue\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the Issue content should be cleared.\n    #>\n    [DscProperty()]\n    [bool] $IssueClear\n\n    hidden [string] $IssueSettingName = \"Config.Etc.issue\"\n    hidden [string] $MotdSettingName = \"Config.Etc.motd\"\n\n    [void] Set() {\n    \ttry {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateVMHostSettings($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostSettings] Get() {\n    \ttry {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSettings]::new()\n            $result.Server = $this.Server\n\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if at least one Advanced Setting value should be updated.\n    #>\n    [bool] ShouldUpdateVMHostSettings($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \t$vmHostCurrentAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost\n\n    \t$currentMotd = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n        $currentIssue = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $motdDesiredValue = if ($this.MotdClear) { [string]::Empty } else { $this.Motd }\n        $issueDesiredValue = if ($this.IssueClear) { [string]::Empty } else { $this.Issue }\n\n    \t$shouldUpdateVMHostSettings = @(\n            $this.ShouldUpdateDscResourceSetting('Motd', $currentMotd.Value, $motdDesiredValue),\n            $this.ShouldUpdateDscResourceSetting('Issue', $currentIssue.Value, $issueDesiredValue)\n        )\n\n        return ($shouldUpdateVMHostSettings -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Sets the desired value for the Advanced Setting, if update of the Advanced Setting value is needed.\n    #>\n  \t[void] SetAdvancedSetting($advancedSettingName, $advancedSetting, $advancedSettingDesiredValue, $advancedSettingCurrentValue, $clearValue) {\n    \t$this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \tif ($clearValue) {\n      \t    if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, [string]::Empty)) {\n                Set-AdvancedSetting -AdvancedSetting $advancedSetting -Value [string]::Empty -Confirm:$false\n      \t    }\n    \t}\n    \telse {\n      \t    if ($this.ShouldUpdateDscResourceSetting($advancedSettingName, $advancedSettingCurrentValue, $advancedSettingDesiredValue)) {\n                Set-AdvancedSetting -AdvancedSetting $advancedSetting -Value $advancedSettingDesiredValue -Confirm:$false\n      \t    }\n    \t}\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs update on those Advanced Settings values that needs to be updated.\n    #>\n    [void] UpdateVMHostSettings($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \t$vmHostCurrentAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost\n\n    \t$currentMotd = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n    \t$currentIssue = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n    \t$this.SetAdvancedSetting('Motd', $currentMotd, $this.Motd, $currentMotd.Value, $this.MotdClear)\n        $this.SetAdvancedSetting('Issue', $currentIssue, $this.Issue, $currentIssue.Value, $this.IssueClear)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the advanced settings from the server.\n    #>\n    [void] PopulateResult($vmHost, $result) {\n    \t$this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n    \t$vmHostCurrentAdvancedSettings = Get-AdvancedSetting -Server $this.Connection -Entity $vmHost\n\n    \t$currentMotd = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.MotdSettingName }\n    \t$currentIssue = $vmHostCurrentAdvancedSettings | Where-Object { $_.Name -eq $this.IssueSettingName }\n\n        $result.Name = $vmHost.Name\n    \t$result.Motd = $currentMotd.Value\n        $result.Issue = $currentIssue.Value\n    }\n}\n\n[DscResource()]\nclass VMHostStorage : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies whether the software iSCSI is enabled on the VMHost storage.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Enabled\n\n    hidden [string] $RetrieveVMHostStorageMessage = \"Retrieving VMHost storage for VMHost {0}.\"\n    hidden [string] $ConfigureVMHostStorageMessage = \"Configuring VMHost storage for VMHost {0}.\"\n\n    hidden [string] $CouldNotRetrieveVMHostStorageMessage = \"Could not retrieve VMHost storage for VMHost {0}. For more information: {1}\"\n    hidden [string] $CouldNotConfigureVMHostStorageMessage = \"Could not configure VMHost storage for VMHost {0}. For more information: {1}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostStorage = $this.GetVMHostStorage($vmHost)\n            $this.ConfigureVMHostStorage($vmHostStorage)\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostStorage = $this.GetVMHostStorage($vmHost)\n\n            $result = !$this.ShouldConfigureVMHostStorage($vmHostStorage)\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostStorage] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n            $result = [VMHostStorage]::new()\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostStorage = $this.GetVMHostStorage($vmHost)\n\n            $this.PopulateResult($result, $vmHostStorage)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMHost storage for the specified VMHost.\n    #>\n    [PSObject] GetVMHostStorage($vmHost) {\n        $getVMHostStorageParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVMHostStorageMessage, @($vmHost.Name))\n            return Get-VMHostStorage @getVMHostStorageParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVMHostStorageMessage -f $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost storage should be configured - whether to\n    enable or disable the software iSCSI support.\n    #>\n    [bool] ShouldConfigureVMHostStorage($vmHostStorage) {\n        return $this.ShouldUpdateDscResourceSetting('Enabled', $vmHostStorage.SoftwareIScsiEnabled, $this.Enabled)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Configures the VMHost storage - enables or disables the software iSCSI support.\n    #>\n    [void] ConfigureVMHostStorage($vmHostStorage) {\n        $setVMHostStorageParams = @{\n            VMHostStorage = $vmHostStorage\n            SoftwareIScsiEnabled = $this.Enabled\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.ConfigureVMHostStorageMessage, @($vmHostStorage.VMHost.Name))\n            Set-VMHostStorage @setVMHostStorageParams\n        }\n        catch {\n            throw ($this.CouldNotConfigureVMHostStorageMessage -f $vmHostStorage.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostStorage) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHostStorage.VMHost.Name\n        $result.Enabled = $vmHostStorage.SoftwareIScsiEnabled\n    }\n}\n\n[DscResource()]\nclass VMHostSyslog : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The remote host(s) to send logs to.\n    #>\n    [DscProperty()]\n    [string] $Loghost\n\n    <#\n    .DESCRIPTION\n\n    Verify remote SSL certificates against the local CA Store.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $CheckSslCerts\n\n    <#\n    .DESCRIPTION\n\n    Default network retry timeout in seconds if a remote server fails to respond.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DefaultTimeout\n\n    <#\n    .DESCRIPTION\n\n    Message queue capacity after which messages are dropped.\n    #>\n    [DscProperty()]\n    [nullable[long]] $QueueDropMark\n\n    <#\n    .DESCRIPTION\n\n    The directory to output local logs to.\n    #>\n    [DscProperty()]\n    [string] $Logdir\n\n    <#\n    .DESCRIPTION\n\n    Place logs in a unique subdirectory of logdir, based on hostname.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $LogdirUnique\n\n    <#\n    .DESCRIPTION\n\n    Default number of rotated local logs to keep.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DefaultRotate\n\n    <#\n    .DESCRIPTION\n\n    Default size of local logs before rotation, in KiB.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DefaultSize\n\n    <#\n    .DESCRIPTION\n\n    Number of rotated dropped log files to keep.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DropLogRotate\n\n    <#\n    .DESCRIPTION\n\n    Size of dropped log file before rotation, in KiB.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DropLogSize\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateVMHostSyslog($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateVMHostSyslog($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostSyslog] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSyslog]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.PopulateResult($vmHost, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if VMHostSyslog needs to be updated.\n    #>\n    [bool] ShouldUpdateVMHostSyslog($VMHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $esxcli = Get-Esxcli -Server $this.Connection -VMHost $vmHost -V2\n        $current = Get-VMHostSyslogConfig -EsxCLi $esxcli\n\n        $shouldUpdateVMHostSyslog = @(\n            $this.ShouldUpdateDscResourceSetting('LogHost', [string] $current.RemoteHost, $this.LogHost),\n            $this.ShouldUpdateDscResourceSetting('CheckSslCerts', $current.EnforceSSLCertificates, $this.CheckSslCerts),\n            $this.ShouldUpdateDscResourceSetting('DefaultTimeout', $current.DefaultNetworkRetryTimeout, $this.DefaultTimeout),\n            $this.ShouldUpdateDscResourceSetting('QueueDropMark', $current.MessageQueueDropMark, $this.QueueDropMark),\n            $this.ShouldUpdateDscResourceSetting('Logdir', [string] $current.LocalLogOutput, $this.Logdir),\n            $this.ShouldUpdateDscResourceSetting('LogdirUnique', [System.Convert]::ToBoolean($current.LogToUniqueSubdirectory), $this.LogdirUnique),\n            $this.ShouldUpdateDscResourceSetting('DefaultRotate', $current.LocalLoggingDefaultRotations, $this.DefaultRotate),\n            $this.ShouldUpdateDscResourceSetting('DefaultSize', $current.LocalLoggingDefaultRotationSize, $this.DefaultSize),\n            $this.ShouldUpdateDscResourceSetting('DropLogRotate', $current.DroppedLogFileRotations, $this.DropLogRotate),\n            $this.ShouldUpdateDscResourceSetting('DropLogSize', $current.DroppedLogFileRotationSize, $this.DropLogSize)\n        )\n\n        return ($shouldUpdateVMHostSyslog -contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the VMHostSyslog.\n    #>\n    [void] UpdateVMHostSyslog($VMHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $esxcli = Get-Esxcli -Server $this.Connection -VMHost $vmHost -V2\n\n        $vmHostSyslogConfig = @{\n            queuedropmark = $this.QueueDropMark\n            defaultrotate = $this.DefaultRotate\n            droplogrotate = $this.DropLogRotate\n        }\n\n        if ($null -ne $this.CheckSslCerts) { $vmHostSyslogConfig.checksslcerts = $this.CheckSslCerts }\n        if ($null -ne $this.DefaultTimeout) { $vmHostSyslogConfig.defaulttimeout = $this.DefaultTimeout }\n        if (![string]::IsNullOrEmpty($this.Logdir)) { $vmHostSyslogConfig.logdir = $this.Logdir }\n        if ($null -ne $this.LogdirUnique) { $vmHostSyslogConfig.logdirunique = $this.LogdirUnique }\n        if ($null -ne $this.DefaultSize) { $vmHostSyslogConfig.defaultsize = $this.DefaultSize }\n        if ($null -ne $this.DropLogSize) { $vmHostSyslogConfig.droplogsize = $this.DropLogSize }\n        if (![string]::IsNullOrEmpty($this.LogHost)) { $vmHostSyslogConfig.loghost = $this.Loghost }\n\n        Set-VMHostSyslogConfig -EsxCli $esxcli -VMHostSyslogConfig $vmHostSyslogConfig\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the VMHostService from the server.\n    #>\n    [void] PopulateResult($VMHost, $syslog) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $esxcli = Get-Esxcli -Server $this.Connection -VMHost $vmHost -V2\n        $currentVMHostSyslog = Get-VMHostSyslogConfig -EsxCLi $esxcli\n\n        $syslog.Server = $this.Server\n        $syslog.Name = $VMHost.Name\n        $syslog.Loghost = $currentVMHostSyslog.RemoteHost\n        $syslog.CheckSslCerts = [System.Convert]::ToBoolean($currentVMHostSyslog.EnforceSSLCertificates)\n        $syslog.DefaultTimeout = [long] $currentVMHostSyslog.DefaultNetworkRetryTimeout\n        $syslog.QueueDropMark = [long] $currentVMHostSyslog.MessageQueueDropMark\n        $syslog.Logdir = $currentVMHostSyslog.LocalLogOutput\n        $syslog.LogdirUnique = [System.Convert]::ToBoolean($currentVMHostSyslog.LogToUniqueSubdirectory)\n        $syslog.DefaultRotate = [long] $currentVMHostSyslog.LocalLoggingDefaultRotations\n        $syslog.DefaultSize = [long] $currentVMHostSyslog.LocalLoggingDefaultRotationSize\n        $syslog.DropLogRotate = [long] $currentVMHostSyslog.DroppedLogFileRotations\n        $syslog.DropLogSize = [long] $currentVMHostSyslog.DroppedLogFileRotationSize\n    }\n}\n\n[DscResource()]\nclass VMHostTpsSettings : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Share Scan Time Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareScanTime\n\n    <#\n    .DESCRIPTION\n\n    Share Scan GHz Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareScanGHz\n\n    <#\n    .DESCRIPTION\n\n    Share Rate Max Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareRateMax\n\n    <#\n    .DESCRIPTION\n\n    Share Force Salting Advanced Setting value.\n    #>\n    [DscProperty()]\n    [nullable[int]] $ShareForceSalting\n\n    hidden [string] $TpsSettingsName = \"Mem.Sh*\"\n    hidden [string] $MemValue = \"Mem.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $this.UpdateTpsSettings($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n\n            $result = !$this.ShouldUpdateTpsSettings($vmHost)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostTpsSettings] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostTpsSettings]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $result.Name = $vmHost.Name\n\n            $tpsSettings = $this.GetTpsAdvancedSettings($vmHost)\n\n            $vmHostTpsSettingsDscResourcePropertyNames = $this.GetType().GetProperties().Name\n            foreach ($tpsSetting in $tpsSettings) {\n                $tpsSettingName = $tpsSetting.Name.TrimStart($this.MemValue)\n                if ($vmHostTpsSettingsDscResourcePropertyNames -Contains $tpsSettingName) {\n                    $result.$tpsSettingName = $tpsSetting.Value\n                }\n            }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Tps advanced settings for the specified VMHost from the server.\n    #>\n    [PSObject] GetTpsAdvancedSettings($vmHost) {\n        $getAdvancedSettingParams = @{\n            Server = $this.Connection\n            Entity = $vmHost\n            Name = $this.TpsSettingsName\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        return Get-AdvancedSetting @getAdvancedSettingParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value, indicating if update operation should be performed on at least one of the TPS Settings.\n    #>\n    [bool] ShouldUpdateTpsSettings($vmHost) {\n        $tpsSettings = $this.GetTpsAdvancedSettings($vmHost)\n\n        foreach ($tpsSetting in $tpsSettings) {\n            $tpsSettingName = $tpsSetting.Name.TrimStart($this.MemValue)\n\n            if ($null -ne $this.$tpsSettingName -and $this.$tpsSettingName -ne $tpsSetting.Value) {\n                $this.WriteLogUtil('Verbose', $this.SettingIsNotInDesiredStateMessage, @($tpsSettingName, $tpsSetting.Value, $this.$tpsSettingName))\n\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the needed TPS Settings with the specified values.\n    #>\n    [void] UpdateTpsSettings($vmHost) {\n        $tpsSettings = $this.GetTpsAdvancedSettings($vmHost)\n\n        foreach ($tpsSetting in $tpsSettings) {\n            $tpsSettingName = $tpsSetting.Name.TrimStart($this.MemValue)\n\n            if ($null -eq $this.$tpsSettingName -or $this.$tpsSettingName -eq $tpsSetting.Value) {\n                continue\n            }\n\n            $setAdvancedSettingParams = @{\n                AdvancedSetting = $tpsSetting\n                Value = $this.$tpsSettingName\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Set-AdvancedSetting @setAdvancedSettingParams\n        }\n    }\n}\n\n[DscResource()]\nclass NfsDatastore : DatastoreBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Nfs Host for the Datastore.\n    #>\n    [DscProperty(Mandatory)]\n    [string[]] $NfsHost\n\n    <#\n    .DESCRIPTION\n\n    Specifies the access mode for the Nfs Datastore. Valid access modes are 'ReadWrite' and 'ReadOnly'.\n    The default access mode is 'ReadWrite'.\n    #>\n    [DscProperty()]\n    [AccessMode] $AccessMode = [AccessMode]::ReadWrite\n\n    <#\n    .DESCRIPTION\n\n    Specifies the authentication method for the Nfs Datastore. Valid authentication methods are 'AUTH_SYS' and 'Kerberos'.\n    The default authentication method is 'AUTH_SYS'.\n    #>\n    [DscProperty()]\n    [AuthenticationMethod] $AuthenticationMethod = [AuthenticationMethod]::AUTH_SYS\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $datastore = $this.NewNfsDatastore()\n                }\n\n                if ($this.ShouldModifyDatastore($datastore)) {\n                    $this.ModifyDatastore($datastore)\n                }\n            }\n            else {\n                if ($null -ne $datastore) {\n                    $this.RemoveDatastore($datastore)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDatastore($datastore)\n                }\n            }\n            else {\n                $result = ($null -eq $datastore)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [NfsDatastore] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [NfsDatastore]::new()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.PopulateResultForNfsDatastore($result, $datastore)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Nfs Datastore with the specified name on the VMHost.\n    #>\n    [PSObject] NewNfsDatastore() {\n        $newDatastoreParams = @{\n            Nfs = $true\n            NfsHost = $this.NfsHost\n        }\n\n        if ($this.AccessMode -eq [AccessMode]::ReadOnly) { $newDatastoreParams.ReadOnly = $true }\n        if ($this.AuthenticationMethod -eq [AuthenticationMethod]::Kerberos) { $newDatastoreParams.Kerberos = $true }\n\n        return $this.NewDatastore($newDatastoreParams)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResultForNfsDatastore($result, $datastore) {\n        if ($null -ne $datastore) {\n            $result.NfsHost = $datastore.RemoteHost\n            $result.Path = $datastore.RemotePath\n            $result.AccessMode = [AccessMode] $datastore.ExtensionData.Host.MountInfo.AccessMode\n            $result.AuthenticationMethod = $datastore.AuthenticationMethod.ToString()\n        }\n        else {\n            $result.NfsHost = $this.NfsHost\n            $result.Path = $this.Path\n            $result.AccessMode = $this.AccessMode\n            $result.AuthenticationMethod = $this.AuthenticationMethod\n        }\n\n        $this.PopulateResult($result, $datastore)\n    }\n}\n\n[DscResource()]\nclass VmfsDatastore : DatastoreBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the maximum file size of Vmfs in megabytes (MB). If no value is specified, the maximum file size for the current system platform is used.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BlockSizeMB\n\n    hidden [string] $CouldNotCreateVmfsDatastoreWithTheSpecifiedNameMessage = \"Could not create Vmfs Datastore {0} on VMHost {1} because there is another Vmfs Datastore with the same name on vCenter Server {2}.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.ValidateVmfsDatastoreCreation($datastore)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $datastore = $this.NewVmfsDatastore()\n                }\n\n                if ($this.ShouldModifyDatastore($datastore)) {\n                    $this.ModifyDatastore($datastore)\n                }\n            }\n            else {\n                if ($null -ne $datastore) {\n                    $this.RemoveDatastore($datastore)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.ValidateVmfsDatastoreCreation($datastore)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $datastore) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldModifyDatastore($datastore)\n                }\n            }\n            else {\n                $result = ($null -eq $datastore)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VmfsDatastore] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VmfsDatastore]::new()\n\n            $this.RetrieveVMHost()\n\n            $datastore = $this.GetDatastore()\n            $this.ValidateVmfsDatastoreCreation($datastore)\n\n            $this.PopulateResultForVmfsDatastore($result, $datastore)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if a Vmfs Datastore with the specified name can be created on the vCenter Server.\n    #>\n    [void] ValidateVmfsDatastoreCreation($datastore) {\n        <#\n            If the established connection is to a vCenter Server, Ensure is 'Present' and the Vmfs Datastore does not exist on the specified VMHost,\n            we need to check if there is a Vmfs Datastore with the same name on the vCenter Server.\n        #>\n        if ($this.Connection.ProductLine -eq $this.vCenterProductId -and $this.Ensure -eq [Ensure]::Present -and $null -eq $datastore) {\n            $getDatastoreParams = @{\n                Server = $this.Connection\n                Name = $this.Name\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n\n            <#\n                If there is another Vmfs Datastore with the same name on the vCenter Server but on a different VMHost, we need to inform the user that\n                the Vmfs Datastore cannot be created with the specified name. vCenter Server accepts multiple Vmfs Datastore creations with the same name\n                but changes the names internally to avoid name duplication. vCenter Server appends '(<index>)' to the Vmfs Datastore name.\n            #>\n            $datastoreInvCenter = Get-Datastore @getDatastoreParams\n            if ($null -ne $datastoreInvCenter) {\n                throw ($this.CouldNotCreateVmfsDatastoreWithTheSpecifiedNameMessage -f $this.Name, $this.VMHost.Name, $this.Connection.Name)\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Vmfs Datastore with the specified name on the VMHost.\n    #>\n    [PSObject] NewVmfsDatastore() {\n        $newDatastoreParams = @{\n            Vmfs = $true\n        }\n\n        if ($null -ne $this.BlockSizeMB) { $newDatastoreParams.BlockSizeMB = $this.BlockSizeMB }\n\n        return $this.NewDatastore($newDatastoreParams)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResultForVmfsDatastore($result, $datastore) {\n        if ($null -ne $datastore) {\n            $result.BlockSizeMB = $datastore.ExtensionData.Info.Vmfs.BlockSizeMB\n            $result.Path = $datastore.ExtensionData.Info.Vmfs.Extent | Where-Object -FilterScript { $_.DiskName -eq $this.Path } | Select-Object -ExpandProperty DiskName\n        }\n        else {\n            $result.BlockSizeMB = $this.BlockSizeMB\n            $result.Path = $this.Path\n        }\n\n        $this.PopulateResult($result, $datastore)\n    }\n}\n\n[DscResource()]\nclass VMHostVssPortGroup : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Name of the Virtual Switch associated with the Port Group.\n    The Virtual Switch must be a Standard Virtual Switch.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $VssName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the VLAN ID for ports using this Port Group. The following values are valid:\n    0 - specifies that you do not want to associate the Port Group with a VLAN.\n    1 to 4094 - specifies a VLAN ID for the Port Group.\n    4095 - specifies that the Port Group should use trunk mode, which allows the guest operating system to manage its own VLAN tags.\n    #>\n    [DscProperty()]\n    [nullable[int]] $VLanId\n\n    hidden [int] $VLanIdMaxValue = 4095\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $portGroup = $this.GetVirtualPortGroup($virtualSwitch)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $portGroup) {\n                    $this.AddVirtualPortGroup($virtualSwitch)\n                }\n                else {\n                    $this.UpdateVirtualPortGroup($portGroup)\n                }\n            }\n            else {\n                if ($null -ne $portGroup) {\n                    $this.RemoveVirtualPortGroup($portGroup)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $portGroup = $this.GetVirtualPortGroup($virtualSwitch)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $portGroup) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateDscResourceSetting('VLanId', $portGroup.VLanId, $this.VLanId)\n                }\n            }\n            else {\n                $result = ($null -eq $portGroup)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroup] Get() {\n        try {\n            $result = [VMHostVssPortGroup]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $portGroup = $this.GetVirtualPortGroup($virtualSwitch)\n\n            $result.VMHostName = $this.VMHost.Name\n            $this.PopulateResult($portGroup, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Switch with the specified name from the server if it exists.\n    The Virtual Switch must be a Standard Virtual Switch. If the Virtual Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVirtualSwitch() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            return Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction SilentlyContinue\n        }\n        else {\n            try {\n                $virtualSwitch = Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction Stop\n                return $virtualSwitch\n            }\n            catch {\n                throw \"Could not retrieve Virtual Switch $($this.VssName) of VMHost $($this.VMHost.Name). For more information: $($_.Exception.Message)\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group with the specified Name, available on the specified Virtual Switch and VMHost from the server if it exists,\n    otherwise returns $null.\n    #>\n    [PSObject] GetVirtualPortGroup($virtualSwitch) {\n        if ($null -eq $virtualSwitch) {\n            <#\n            If the Virtual Switch is $null, it means that Ensure was set to 'Absent' and\n            the Port Group does not exist for the specified Virtual Switch.\n            #>\n            return $null\n        }\n\n        return Get-VirtualPortGroup -Server $this.Connection -Name $this.Name -VirtualSwitch $virtualSwitch -VMHost $this.VMHost -ErrorAction SilentlyContinue\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the passed VLanId value is in the range [0, 4095].\n    #>\n    [void] EnsureVLanIdValueIsValid() {\n        if ($this.VLanId -lt 0 -or $this.VLanId -gt $this.VLanIdMaxValue) {\n            throw \"The passed VLanId value $($this.VLanId) is not valid. The valid values are in the following range: [0, $($this.VLanIdMaxValue)].\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Port Group parameters.\n    #>\n    [hashtable] GetPortGroupParams() {\n        $portGroupParams = @{}\n\n        $portGroupParams.Confirm = $false\n        $portGroupParams.ErrorAction = 'Stop'\n\n        if ($null -ne $this.VLanId) {\n            $this.EnsureVLanIdValueIsValid()\n            $portGroupParams.VLanId = $this.VLanId\n        }\n\n        return $portGroupParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Port Group available on the specified Virtual Switch.\n    #>\n    [void] AddVirtualPortGroup($virtualSwitch) {\n        $portGroupParams = $this.GetPortGroupParams()\n\n        $portGroupParams.Server = $this.Connection\n        $portGroupParams.Name = $this.Name\n        $portGroupParams.VirtualSwitch = $virtualSwitch\n\n        try {\n            New-VirtualPortGroup @portGroupParams\n        }\n        catch {\n            throw \"Cannot create Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Port Group by changing its VLanId value.\n    #>\n    [void] UpdateVirtualPortGroup($portGroup) {\n        $portGroupParams = $this.GetPortGroupParams()\n\n        try {\n            $portGroup | Set-VirtualPortGroup @portGroupParams\n        }\n        catch {\n            throw \"Cannot update Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the specified Port Group available on the Virtual Switch. All VMs connected to the Port Group must be PoweredOff to successfully remove the Port Group.\n    If one or more of the VMs are PoweredOn, the removal would not be successful because the Port Group is used by the VMs.\n    #>\n    [void] RemoveVirtualPortGroup($portGroup) {\n        try {\n            $portGroup | Remove-VirtualPortGroup -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw \"Cannot remove Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Port Group from the server.\n    #>\n    [void] PopulateResult($portGroup, $result) {\n        if ($null -ne $portGroup) {\n            $result.Name = $portGroup.Name\n            $result.VssName = $portGroup.VirtualSwitchName\n            $result.Ensure = [Ensure]::Present\n            $result.VLanId = $portGroup.VLanId\n        }\n        else {\n            $result.Name = $this.Name\n            $result.VssName = $this.VssName\n            $result.Ensure = [Ensure]::Absent\n            $result.VLanId = $this.VLanId\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssPortGroupSecurity : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies whether promiscuous mode is enabled for the corresponding Virtual Port Group.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllowPromiscuous\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the AllowPromiscuous setting is inherited from the parent Standard Virtual Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllowPromiscuousInherited\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether forged transmits are enabled for the corresponding Virtual Port Group.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ForgedTransmits\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the ForgedTransmits setting is inherited from the parent Standard Virtual Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ForgedTransmitsInherited\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether MAC address changes are enabled for the corresponding Virtual Port Group.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MacChanges\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the MacChanges setting is inherited from the parent Standard Virtual Switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MacChangesInherited\n\n    hidden [string] $AllowPromiscuousSettingName = 'AllowPromiscuous'\n    hidden [string] $AllowPromiscuousInheritedSettingName = 'AllowPromiscuousInherited'\n    hidden [string] $ForgedTransmitsSettingName = 'ForgedTransmits'\n    hidden [string] $ForgedTransmitsInheritedSettingName = 'ForgedTransmitsInherited'\n    hidden [string] $MacChangesSettingName = 'MacChanges'\n    hidden [string] $MacChangesInheritedSettingName = 'MacChangesInherited'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            $virtualPortGroupSecurityPolicy = $this.GetVirtualPortGroupSecurityPolicy($virtualPortGroup)\n\n            $this.UpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $result = $null\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result = $true\n            }\n            else {\n                $virtualPortGroupSecurityPolicy = $this.GetVirtualPortGroupSecurityPolicy($virtualPortGroup)\n                $result = !$this.ShouldUpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroupSecurity] Get() {\n        try {\n            $result = [VMHostVssPortGroupSecurity]::new()\n            $result.Server = $this.Server\n            $result.Ensure = $this.Ensure\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $result.VMHostName = $this.VMHost.Name\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result.Name = $this.Name\n                return $result\n            }\n\n            $virtualPortGroupSecurityPolicy = $this.GetVirtualPortGroupSecurityPolicy($virtualPortGroup)\n            $result.Name = $virtualPortGroup.Name\n\n            $this.PopulateResult($virtualPortGroupSecurityPolicy, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group Security Policy from the server.\n    #>\n    [PSObject] GetVirtualPortGroupSecurityPolicy($virtualPortGroup) {\n        try {\n            $virtualPortGroupSecurityPolicy = Get-SecurityPolicy -Server $this.Connection -VirtualPortGroup $virtualPortGroup -ErrorAction Stop\n            return $virtualPortGroupSecurityPolicy\n        }\n        catch {\n            throw \"Could not retrieve Virtual Port Group $($this.PortGroup) Security Policy. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Security Policy of the specified Virtual Port Group should be updated.\n    #>\n    [bool] ShouldUpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy) {\n        $shouldUpdateVirtualPortGroupSecurityPolicy = @(\n            $this.ShouldUpdateDscResourceSetting('AllowPromiscuous', $virtualPortGroupSecurityPolicy.AllowPromiscuous, $this.AllowPromiscuous),\n            $this.ShouldUpdateDscResourceSetting('AllowPromiscuousInherited', $virtualPortGroupSecurityPolicy.AllowPromiscuousInherited, $this.AllowPromiscuousInherited),\n            $this.ShouldUpdateDscResourceSetting('ForgedTransmits', $virtualPortGroupSecurityPolicy.ForgedTransmits, $this.ForgedTransmits),\n            $this.ShouldUpdateDscResourceSetting('ForgedTransmitsInherited', $virtualPortGroupSecurityPolicy.ForgedTransmitsInherited, $this.ForgedTransmitsInherited),\n            $this.ShouldUpdateDscResourceSetting('MacChanges', $virtualPortGroupSecurityPolicy.MacChanges, $this.MacChanges),\n            $this.ShouldUpdateDscResourceSetting('MacChangesInherited', $virtualPortGroupSecurityPolicy.MacChangesInherited, $this.MacChangesInherited)\n        )\n\n        return ($shouldUpdateVirtualPortGroupSecurityPolicy -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Security Policy of the specified Virtual Port Group.\n    #>\n    [void] UpdateVirtualPortGroupSecurityPolicy($virtualPortGroupSecurityPolicy) {\n        $securityPolicyParams = @{}\n        $securityPolicyParams.VirtualPortGroupPolicy = $virtualPortGroupSecurityPolicy\n\n        $this.PopulatePolicySetting($securityPolicyParams, $this.AllowPromiscuousSettingName, $this.AllowPromiscuous, $this.AllowPromiscuousInheritedSettingName, $this.AllowPromiscuousInherited)\n        $this.PopulatePolicySetting($securityPolicyParams, $this.ForgedTransmitsSettingName, $this.ForgedTransmits, $this.ForgedTransmitsInheritedSettingName, $this.ForgedTransmitsInherited)\n        $this.PopulatePolicySetting($securityPolicyParams, $this.MacChangesSettingName, $this.MacChanges, $this.MacChangesInheritedSettingName, $this.MacChangesInherited)\n\n        try {\n            Set-SecurityPolicy @securityPolicyParams\n        }\n        catch {\n            throw \"Cannot update Security Policy of Virtual Port Group $($this.PortGroup). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security Policy of the specified Virtual Port Group from the server.\n    #>\n    [void] PopulateResult($virtualPortGroupSecurityPolicy, $result) {\n        $result.AllowPromiscuous = $virtualPortGroupSecurityPolicy.AllowPromiscuous\n        $result.AllowPromiscuousInherited = $virtualPortGroupSecurityPolicy.AllowPromiscuousInherited\n        $result.ForgedTransmits = $virtualPortGroupSecurityPolicy.ForgedTransmits\n        $result.ForgedTransmitsInherited = $virtualPortGroupSecurityPolicy.ForgedTransmitsInherited\n        $result.MacChanges = $virtualPortGroupSecurityPolicy.MacChanges\n        $result.MacChangesInherited = $virtualPortGroupSecurityPolicy.MacChangesInherited\n    }\n}\n\n[DscResource()]\nclass VMHostVssPortGroupShaping : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not traffic shaper is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    The average bandwidth in bits per second if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $AverageBandwidth\n\n    <#\n    .DESCRIPTION\n\n    The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $PeakBandwidth\n\n    <#\n    .DESCRIPTION\n\n    The maximum burst size allowed in bytes if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $BurstSize\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $this.GetVMHostNetworkSystem()\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $this.UpdateVirtualPortGroupShapingPolicy($virtualPortGroup)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $result = $null\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result = $true\n            }\n            else {\n                $result = !$this.ShouldUpdateVirtualPortGroupShapingPolicy($virtualPortGroup)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroupShaping] Get() {\n        try {\n            $result = [VMHostVssPortGroupShaping]::new()\n            $result.Server = $this.Server\n            $result.Ensure = $this.Ensure\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $result.VMHostName = $this.VMHost.Name\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result.Name = $this.Name\n                return $result\n            }\n\n            $result.Name = $virtualPortGroup.Name\n            $this.PopulateResult($virtualPortGroup, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Shaping Policy of the specified Virtual Port Group should be updated.\n    #>\n    [bool] ShouldUpdateVirtualPortGroupShapingPolicy($virtualPortGroup) {\n        $shapingPolicy = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy\n\n        $shouldUpdateVirtualPortGroupShapingPolicy = @(\n            $this.ShouldUpdateDscResourceSetting('Enabled', $shapingPolicy.Enabled, $this.Enabled),\n            $this.ShouldUpdateDscResourceSetting('AverageBandwidth', $shapingPolicy.AverageBandwidth, $this.AverageBandwidth),\n            $this.ShouldUpdateDscResourceSetting('PeakBandwidth', $shapingPolicy.PeakBandwidth, $this.PeakBandwidth),\n            $this.ShouldUpdateDscResourceSetting('BurstSize', $shapingPolicy.BurstSize, $this.BurstSize)\n        )\n\n        return ($shouldUpdateVirtualPortGroupShapingPolicy -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Shaping Policy of the specified Virtual Port Group.\n    #>\n    [void] UpdateVirtualPortGroupShapingPolicy($virtualPortGroup) {\n        $virtualPortGroupSpec = New-Object VMware.Vim.HostPortGroupSpec\n\n        $virtualPortGroupSpec.Name = $virtualPortGroup.Name\n        $virtualPortGroupSpec.VswitchName = $virtualPortGroup.VirtualSwitchName\n        $virtualPortGroupSpec.VlanId = $virtualPortGroup.VLanId\n\n        $virtualPortGroupSpec.Policy = New-Object VMware.Vim.HostNetworkPolicy\n        $virtualPortGroupSpec.Policy.ShapingPolicy = New-Object VMware.Vim.HostNetworkTrafficShapingPolicy\n\n        if ($null -ne $this.Enabled) { $virtualPortGroupSpec.Policy.ShapingPolicy.Enabled = $this.Enabled }\n        if ($null -ne $this.AverageBandwidth) { $virtualPortGroupSpec.Policy.ShapingPolicy.AverageBandwidth = $this.AverageBandwidth }\n        if ($null -ne $this.PeakBandwidth) { $virtualPortGroupSpec.Policy.ShapingPolicy.PeakBandwidth = $this.PeakBandwidth }\n        if ($null -ne $this.BurstSize) { $virtualPortGroupSpec.Policy.ShapingPolicy.BurstSize = $this.BurstSize }\n\n        try {\n            Update-VirtualPortGroup -VMHostNetworkSystem $this.VMHostNetworkSystem -VirtualPortGroupName $virtualPortGroup.Name -Spec $virtualPortGroupSpec\n        }\n        catch {\n            throw \"Cannot update Shaping Policy of Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Shaping Policy of the specified Virtual Port Group from the server.\n    #>\n    [void] PopulateResult($virtualPortGroup, $result) {\n        $result.Enabled = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.Enabled\n        $result.AverageBandwidth = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.AverageBandwidth\n        $result.PeakBandwidth = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.PeakBandwidth\n        $result.BurstSize = $virtualPortGroup.ExtensionData.Spec.Policy.ShapingPolicy.BurstSize\n    }\n}\n\n[DscResource()]\nclass VMHostVssPortGroupTeaming : VMHostVssPortGroupBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies how a physical adapter is returned to active duty after recovering from a failure.\n    If the value is $true, the adapter is returned to active duty immediately on recovery, displacing the standby adapter that took over its slot, if any.\n    If the value is $false, a failed adapter is left inactive even after recovery until another active adapter fails, requiring its replacement.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $FailbackEnabled\n\n    <#\n    .DESCRIPTION\n\n    Determines how network traffic is distributed between the network adapters assigned to a switch. The following values are valid:\n    LoadBalanceIP - Route based on IP hash. Choose an uplink based on a hash of the source and destination IP addresses of each packet.\n    For non-IP packets, whatever is at those offsets is used to compute the hash.\n    LoadBalanceSrcMac - Route based on source MAC hash. Choose an uplink based on a hash of the source Ethernet.\n    LoadBalanceSrcId - Route based on the originating port ID. Choose an uplink based on the virtual port where the traffic entered the virtual switch.\n    ExplicitFailover - Always use the highest order uplink from the list of Active adapters that passes failover detection criteria.\n    #>\n    [DscProperty()]\n    [LoadBalancingPolicy] $LoadBalancingPolicy = [LoadBalancingPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the adapters you want to continue to use when the network adapter connectivity is available and active.\n    #>\n    [DscProperty()]\n    [string[]] $ActiveNic\n\n    <#\n    .DESCRIPTION\n\n    Specifies the adapters you want to use if one of the active adapter's connectivity is unavailable.\n    #>\n    [DscProperty()]\n    [string[]] $StandbyNic\n\n    <#\n    .DESCRIPTION\n\n    Specifies the adapters you do not want to use.\n    #>\n    [DscProperty()]\n    [string[]] $UnusedNic\n\n    <#\n    .DESCRIPTION\n\n    Specifies how to reroute traffic in the event of an adapter failure. The following values are valid:\n    LinkStatus - Relies solely on the link status that the network adapter provides. This option detects failures, such as cable pulls and physical switch power failures,\n    but not configuration errors, such as a physical switch port being blocked by spanning tree or misconfigured to the wrong VLAN or cable pulls on the other side of a physical switch.\n    BeaconProbing - Sends out and listens for beacon probes on all NICs in the team and uses this information, in addition to link status, to determine link failure.\n    This option detects many of the failures mentioned above that are not detected by link status alone.\n    #>\n    [DscProperty()]\n    [NetworkFailoverDetectionPolicy] $NetworkFailoverDetectionPolicy = [NetworkFailoverDetectionPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Indicates that whenever a virtual NIC is connected to the virtual switch or whenever that virtual NIC's traffic is routed over a different physical NIC in the team because of a\n    failover event, a notification is sent over the network to update the lookup tables on the physical switches.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $NotifySwitches\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the FailbackEnabled parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritFailback\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the values of the ActiveNic, StandbyNic, and UnusedNic parameters are inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritFailoverOrder\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the LoadBalancingPolicy parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritLoadBalancingPolicy\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the NetworkFailoverDetectionPolicy parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritNetworkFailoverDetectionPolicy\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the value of the NotifySwitches parameter is inherited from the virtual switch.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $InheritNotifySwitches\n\n    hidden [string] $FailbackEnabledSettingName = 'FailbackEnabled'\n    hidden [string] $InheritFailbackSettingName = 'InheritFailback'\n    hidden [string] $LoadBalancingPolicySettingName = 'LoadBalancingPolicy'\n    hidden [string] $InheritLoadBalancingPolicySettingName = 'InheritLoadBalancingPolicy'\n    hidden [string] $NetworkFailoverDetectionPolicySettingName = 'NetworkFailoverDetectionPolicy'\n    hidden [string] $InheritNetworkFailoverDetectionPolicySettingName = 'InheritNetworkFailoverDetectionPolicy'\n    hidden [string] $NotifySwitchesSettingName = 'NotifySwitches'\n    hidden [string] $InheritNotifySwitchesSettingName = 'InheritNotifySwitches'\n    hidden [string] $MakeNicActiveSettingName = 'MakeNicActive'\n    hidden [string] $MakeNicStandbySettingName = 'MakeNicStandby'\n    hidden [string] $MakeNicUnusedSettingName = 'MakeNicUnused'\n    hidden [string] $InheritFailoverOrderSettingName = 'InheritFailoverOrder'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            $virtualPortGroupTeamingPolicy = $this.GetVirtualPortGroupTeamingPolicy($virtualPortGroup)\n\n            $this.UpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n\n            $result = $null\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result = $true\n            }\n            else {\n                $virtualPortGroupTeamingPolicy = $this.GetVirtualPortGroupTeamingPolicy($virtualPortGroup)\n                $result = !$this.ShouldUpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssPortGroupTeaming] Get() {\n        try {\n            $result = [VMHostVssPortGroupTeaming]::new()\n            $result.Server = $this.Server\n            $result.Ensure = $this.Ensure\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $result.VMHostName = $this.VMHost.Name\n\n            $virtualPortGroup = $this.GetVirtualPortGroup()\n            if ($null -eq $virtualPortGroup) {\n                # If the Port Group is $null, it means that Ensure is 'Absent' and the Port Group does not exist.\n                $result.Name = $this.Name\n                return $result\n            }\n\n            $virtualPortGroupTeamingPolicy = $this.GetVirtualPortGroupTeamingPolicy($virtualPortGroup)\n            $result.Name = $virtualPortGroup.Name\n\n            $this.PopulateResult($virtualPortGroupTeamingPolicy, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Port Group Teaming Policy from the server.\n    #>\n    [PSObject] GetVirtualPortGroupTeamingPolicy($virtualPortGroup) {\n        try {\n            $virtualPortGroupTeamingPolicy = Get-NicTeamingPolicy -Server $this.Connection -VirtualPortGroup $virtualPortGroup -ErrorAction Stop\n            return $virtualPortGroupTeamingPolicy\n        }\n        catch {\n            throw \"Could not retrieve Virtual Port Group $($this.Name) Teaming Policy. For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Teaming Policy of the specified Virtual Port Group should be updated.\n    #>\n    [bool] ShouldUpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy) {\n        $shouldUpdateVirtualPortGroupTeamingPolicy = @(\n            $this.ShouldUpdateDscResourceSetting('FailbackEnabled', $virtualPortGroupTeamingPolicy.FailbackEnabled, $this.FailbackEnabled),\n            $this.ShouldUpdateDscResourceSetting('NotifySwitches', $virtualPortGroupTeamingPolicy.NotifySwitches, $this.NotifySwitches),\n            $this.ShouldUpdateDscResourceSetting('InheritFailback', $virtualPortGroupTeamingPolicy.IsFailbackInherited, $this.InheritFailback),\n            $this.ShouldUpdateDscResourceSetting('InheritFailoverOrder', $virtualPortGroupTeamingPolicy.IsFailoverOrderInherited, $this.InheritFailoverOrder),\n            $this.ShouldUpdateDscResourceSetting('InheritLoadBalancingPolicy', $virtualPortGroupTeamingPolicy.IsLoadBalancingInherited, $this.InheritLoadBalancingPolicy),\n            $this.ShouldUpdateDscResourceSetting(\n                'InheritNetworkFailoverDetectionPolicy',\n                $virtualPortGroupTeamingPolicy.IsNetworkFailoverDetectionInherited,\n                $this.InheritNetworkFailoverDetectionPolicy\n            ),\n            $this.ShouldUpdateDscResourceSetting('InheritNotifySwitches', $virtualPortGroupTeamingPolicy.IsNotifySwitchesInherited, $this.InheritNotifySwitches),\n            $this.ShouldUpdateDscResourceSetting('LoadBalancingPolicy', [string] $virtualPortGroupTeamingPolicy.LoadBalancingPolicy, $this.LoadBalancingPolicy.ToString()),\n            $this.ShouldUpdateDscResourceSetting(\n                'NetworkFailoverDetectionPolicy',\n                [string] $virtualPortGroupTeamingPolicy.NetworkFailoverDetectionPolicy,\n                $this.NetworkFailoverDetectionPolicy.ToString()\n            ),\n            $this.ShouldUpdateArraySetting('ActiveNic', $virtualPortGroupTeamingPolicy.ActiveNic, $this.ActiveNic),\n            $this.ShouldUpdateArraySetting('StandbyNic', $virtualPortGroupTeamingPolicy.StandbyNic, $this.StandbyNic),\n            $this.ShouldUpdateArraySetting('UnusedNic', $virtualPortGroupTeamingPolicy.UnusedNic, $this.UnusedNic)\n        )\n\n        return ($shouldUpdateVirtualPortGroupTeamingPolicy -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the specified Enum Policy Setting. If the Inherited Setting is passed and set to $true,\n    the Policy Setting should not be populated because \"Parameters of the form \"XXX\" and \"InheritXXX\" are mutually exclusive.\"\n    If the Inherited Setting is set to $false, both parameters can be populated.\n    #>\n    [void] PopulateEnumPolicySetting($policyParams, $policySettingName, $policySetting, $policySettingInheritedName, $policySettingInherited) {\n        if ($policySetting -ne 'Unset') {\n            if ($null -eq $policySettingInherited -or !$policySettingInherited) {\n                $policyParams.$policySettingName = $policySetting\n            }\n        }\n\n        if ($null -ne $policySettingInherited) { $policyParams.$policySettingInheritedName = $policySettingInherited }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the specified Array Policy Setting. If the Inherited Setting is passed and set to $true,\n    the Policy Setting should not be populated because \"Parameters of the form \"XXX\" and \"InheritXXX\" are mutually exclusive.\"\n    If the Inherited Setting is set to $false, both parameters can be populated.\n    #>\n    [void] PopulateArrayPolicySetting($policyParams, $policySettingName, $policySetting, $policySettingInheritedName, $policySettingInherited) {\n        if ($null -ne $policySetting -and $policySetting.Length -gt 0) {\n            if ($null -eq $policySettingInherited -or !$policySettingInherited) {\n                $policyParams.$policySettingName = $policySetting\n            }\n        }\n\n        if ($null -ne $policySettingInherited) { $policyParams.$policySettingInheritedName = $policySettingInherited }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Teaming Policy of the specified Virtual Port Group.\n    #>\n    [void] UpdateVirtualPortGroupTeamingPolicy($virtualPortGroupTeamingPolicy) {\n        $teamingPolicyParams = @{}\n        $teamingPolicyParams.VirtualPortGroupPolicy = $virtualPortGroupTeamingPolicy\n\n        $this.PopulatePolicySetting($teamingPolicyParams, $this.FailbackEnabledSettingName, $this.FailbackEnabled, $this.InheritFailbackSettingName, $this.InheritFailback)\n        $this.PopulatePolicySetting($teamingPolicyParams, $this.NotifySwitchesSettingName, $this.NotifySwitches, $this.InheritNotifySwitchesSettingName, $this.InheritNotifySwitches)\n\n        $this.PopulateEnumPolicySetting($teamingPolicyParams, $this.LoadBalancingPolicySettingName, $this.LoadBalancingPolicy.ToString(), $this.InheritLoadBalancingPolicySettingName, $this.InheritLoadBalancingPolicy)\n        $this.PopulateEnumPolicySetting($teamingPolicyParams, $this.NetworkFailoverDetectionPolicySettingName, $this.NetworkFailoverDetectionPolicy.ToString(), $this.InheritNetworkFailoverDetectionPolicySettingName, $this.InheritNetworkFailoverDetectionPolicy)\n\n        $this.PopulateArrayPolicySetting($teamingPolicyParams, $this.MakeNicActiveSettingName, $this.ActiveNic, $this.InheritFailoverOrderSettingName, $this.InheritFailoverOrder)\n        $this.PopulateArrayPolicySetting($teamingPolicyParams, $this.MakeNicStandbySettingName, $this.StandbyNic, $this.InheritFailoverOrderSettingName, $this.InheritFailoverOrder)\n        $this.PopulateArrayPolicySetting($teamingPolicyParams, $this.MakeNicUnusedSettingName, $this.UnusedNic, $this.InheritFailoverOrderSettingName, $this.InheritFailoverOrder)\n\n        try {\n            Set-NicTeamingPolicy @teamingPolicyParams\n        }\n        catch {\n            throw \"Cannot update Teaming Policy of Virtual Port Group $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Teaming Policy of the specified Virtual Port Group from the server.\n    #>\n    [void] PopulateResult($virtualPortGroupTeamingPolicy, $result) {\n        $result.FailbackEnabled = $virtualPortGroupTeamingPolicy.FailbackEnabled\n        $result.NotifySwitches = $virtualPortGroupTeamingPolicy.NotifySwitches\n        $result.LoadBalancingPolicy = $virtualPortGroupTeamingPolicy.LoadBalancingPolicy.ToString()\n        $result.NetworkFailoverDetectionPolicy = $virtualPortGroupTeamingPolicy.NetworkFailoverDetectionPolicy.ToString()\n        $result.ActiveNic = $virtualPortGroupTeamingPolicy.ActiveNic\n        $result.StandbyNic = $virtualPortGroupTeamingPolicy.StandbyNic\n        $result.UnusedNic = $virtualPortGroupTeamingPolicy.UnusedNic\n        $result.InheritFailback = $virtualPortGroupTeamingPolicy.IsFailbackInherited\n        $result.InheritNotifySwitches = $virtualPortGroupTeamingPolicy.IsNotifySwitchesInherited\n        $result.InheritLoadBalancingPolicy = $virtualPortGroupTeamingPolicy.IsLoadBalancingInherited\n        $result.InheritNetworkFailoverDetectionPolicy = $virtualPortGroupTeamingPolicy.IsNetworkFailoverDetectionInherited\n        $result.InheritFailoverOrder = $virtualPortGroupTeamingPolicy.IsFailoverOrderInherited\n    }\n}\n\n[DscResource()]\nclass VMHostAcceptanceLevel : EsxCliBaseDSC {\n    VMHostAcceptanceLevel() {\n        $this.EsxCliCommand = 'software.acceptance'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the acceptance level of the VMHost. Valid values are VMwareCertified, VMwareAccepted, PartnerSupported and CommunitySupported.\n    #>\n    [DscProperty(Mandatory)]\n    [AcceptanceLevel] $Level\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            # The 'Level' value needs to be converted to a string type before being passed to the base class method.\n            $modifyVMHostAcceptanceLevelMethodArguments = @{\n                level = $this.Level.ToString()\n            }\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName, $modifyVMHostAcceptanceLevelMethodArguments)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldUpdateDscResourceSetting('Level', [string] $esxCliGetMethodResult, $this.Level.ToString())\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostAcceptanceLevel] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostAcceptanceLevel]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.Level = $esxCliGetMethodResult\n    }\n}\n\n[DscResource()]\nclass VMHostDCUIKeyboard : EsxCliBaseDSC {\n    VMHostDCUIKeyboard() {\n        $this.EsxCliCommand = 'system.settings.keyboard.layout'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Direct Console User Interface Keyboard Layout.\n    #>\n    [DscProperty(Mandatory)]\n    [string] $Layout\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldUpdateDscResourceSetting('Layout', [string] $esxCliGetMethodResult, $this.Layout)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostDCUIKeyboard] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostDCUIKeyboard]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n        $result.Layout = $esxCliGetMethodResult\n    }\n}\n\n[DscResource()]\nclass VMHostNetworkCoreDump : EsxCliBaseDSC {\n    VMHostNetworkCoreDump() {\n        $this.EsxCliCommand = 'system.coredump.network'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to enable network coredump.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies the active interface to be used for the network coredump.\n    #>\n    [DscProperty()]\n    [string] $InterfaceName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IP address of the coredump server (IPv4 or IPv6).\n    #>\n    [DscProperty()]\n    [string] $ServerIp\n\n    <#\n    .DESCRIPTION\n\n    Specifies the port on which the coredump server is listening.\n    #>\n    [DscProperty()]\n    [nullable[long]] $ServerPort\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            <#\n            The 'Enable' argument of the 'set' method of the command should be passed separately from the other method arguments.\n            So if any of the other method arguments is passed, the method of the command should be invoked twice - the first time\n            without 'Enable' and the second time only with 'Enable' argument.\n            #>\n            if ($null -ne $this.Enable) {\n                if (![string]::IsNullOrEmpty($this.InterfaceName) -or ![string]::IsNullOrEmpty($this.ServerIp) -or $null -ne $this.ServerPort) {\n                    <#\n                    The desired 'Enable' value must be set to $null, so that the base class can ignore it when constructing the arguments of the method of the command.\n                    The value is stored in a separate variable, so that it can be used when the second invocation of the command method occurs.\n                    #>\n                    $enableArgumentDesiredValue = $this.Enable\n                    $this.Enable = $null\n\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n\n                    # The property value is restored to its initial value.\n                    $this.Enable = $enableArgumentDesiredValue\n\n                    # All property values except the desired 'Enable' value should be set to $null, because the command method was invoked with them already and their values are not needed.\n                    $this.InterfaceName = $null\n                    $this.ServerIp = $null\n                    $this.ServerPort = $null\n\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n                }\n                else {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n                }\n            }\n            else {\n                $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMHostNetworkCoreDumpConfiguration($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [VMHostNetworkCoreDump] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostNetworkCoreDump]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMHost network coredump configuration should be modified.\n    #>\n    [bool] ShouldModifyVMHostNetworkCoreDumpConfiguration($esxCliGetMethodResult) {\n        $shouldModifyVMHostNetworkCoreDumpConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('Enable', [System.Convert]::ToBoolean($esxCliGetMethodResult.Enabled), $this.Enable),\n            $this.ShouldUpdateDscResourceSetting('InterfaceName', [string] $esxCliGetMethodResult.HostVNic, $this.InterfaceName),\n            $this.ShouldUpdateDscResourceSetting('ServerIp', [string] $esxCliGetMethodResult.NetworkServerIP, $this.ServerIp),\n            $this.ShouldUpdateDscResourceSetting('ServerPort', [long] $esxCliGetMethodResult.NetworkServerPort, $this.ServerPort)\n        )\n\n        return ($shouldModifyVMHostNetworkCoreDumpConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.Enable = [System.Convert]::ToBoolean($esxCliGetMethodResult.Enabled)\n        $result.InterfaceName = $esxCliGetMethodResult.HostVNic\n        $result.ServerIp = $esxCliGetMethodResult.NetworkServerIP\n        $result.ServerPort = [long] $esxCliGetMethodResult.NetworkServerPort\n    }\n}\n\n[DscResource()]\nclass VMHostSharedSwapSpace : EsxCliBaseDSC {\n    VMHostSharedSwapSpace() {\n        $this.EsxCliCommand = 'sched.swap.system'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies if the Datastore option should be enabled or not.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DatastoreEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore used by the Datastore option.\n    #>\n    [DscProperty()]\n    [string] $DatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the order of the Datastore option in the preference of the options of the system-wide shared swap space.\n    #>\n    [DscProperty()]\n    [nullable[long]] $DatastoreOrder\n\n    <#\n    .DESCRIPTION\n\n    Specifies if the host cache option should be enabled or not.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HostCacheEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the order of the host cache option in the preference of the options of the system-wide shared swap space.\n    #>\n    [DscProperty()]\n    [nullable[long]] $HostCacheOrder\n\n    <#\n    .DESCRIPTION\n\n    Specifies if the host local swap option should be enabled or not.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HostLocalSwapEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies the order of the host local swap option in the preference of the options of the system-wide shared swap space.\n    #>\n    [DscProperty()]\n    [nullable[long]] $HostLocalSwapOrder\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $modifyVMHostSharedSwapSpaceMethodArguments = @{}\n            if ($null -ne $this.DatastoreName) { $modifyVMHostSharedSwapSpaceMethodArguments.datastorename = $this.DatastoreName }\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName, $modifyVMHostSharedSwapSpaceMethodArguments)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifySystemWideSharedSwapSpaceConfiguration($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    [VMHostSharedSwapSpace] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, ($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSharedSwapSpace]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, ($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the system-wide shared swap space configuration should be modified.\n    #>\n    [bool] ShouldModifySystemWideSharedSwapSpaceConfiguration($esxCliGetMethodResult) {\n        $shouldModifySystemWideSharedSwapSpaceConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting('DatastoreEnabled', [System.Convert]::ToBoolean($esxCliGetMethodResult.DatastoreEnabled), $this.DatastoreEnabled),\n            $this.ShouldUpdateDscResourceSetting('DatastoreName', [string] $esxCliGetMethodResult.DatastoreName, $this.DatastoreName),\n            $this.ShouldUpdateDscResourceSetting('DatastoreOrder', [long] $esxCliGetMethodResult.DatastoreOrder, $this.DatastoreOrder),\n            $this.ShouldUpdateDscResourceSetting('HostCacheEnabled', [System.Convert]::ToBoolean($esxCliGetMethodResult.HostcacheEnabled), $this.HostCacheEnabled),\n            $this.ShouldUpdateDscResourceSetting('HostCacheOrder', [long] $esxCliGetMethodResult.HostcacheOrder, $this.HostCacheOrder),\n            $this.ShouldUpdateDscResourceSetting('HostLocalSwapOrder', [long] $esxCliGetMethodResult.HostlocalswapOrder, $this.HostLocalSwapOrder),\n            $this.ShouldUpdateDscResourceSetting(\n                'HostLocalSwapEnabled',\n                [System.Convert]::ToBoolean($esxCliGetMethodResult.HostlocalswapEnabled),\n                $this.HostLocalSwapEnabled\n            )\n        )\n\n        return ($shouldModifySystemWideSharedSwapSpaceConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.DatastoreEnabled = [System.Convert]::ToBoolean($esxCliGetMethodResult.DatastoreEnabled)\n        $result.DatastoreName = $esxCliGetMethodResult.DatastoreName\n        $result.DatastoreOrder = [long] $esxCliGetMethodResult.DatastoreOrder\n        $result.HostCacheEnabled = [System.Convert]::ToBoolean($esxCliGetMethodResult.HostcacheEnabled)\n        $result.HostCacheOrder = [long] $esxCliGetMethodResult.HostcacheOrder\n        $result.HostLocalSwapEnabled = [System.Convert]::ToBoolean($esxCliGetMethodResult.HostlocalswapEnabled)\n        $result.HostLocalSwapOrder = [long] $esxCliGetMethodResult.HostlocalswapOrder\n    }\n}\n\n[DscResource()]\nclass VMHostSNMPAgent : EsxCliBaseDSC {\n    VMHostSNMPAgent() {\n        $this.EsxCliCommand = 'system.snmp'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the default authentication protocol. Valid values are none, MD5, SHA1.\n    #>\n    [DscProperty()]\n    [string] $Authentication\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to ten communities each no more than 64 characters. Format is: 'community1[,community2,...]'. This overwrites previous settings.\n    #>\n    [DscProperty()]\n    [string] $Communities\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to start or stop the SNMP service.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies the SNMPv3 engine id. Must be between 10 and 32 hexadecimal characters. 0x or 0X are stripped if found as well as colons (:).\n    #>\n    [DscProperty()]\n    [string] $EngineId\n\n    <#\n    .DESCRIPTION\n\n    Specifies where to source hardware events - IPMI sensors or CIM Indications. Valid values are indications and sensors.\n    #>\n    [DscProperty()]\n    [string] $Hwsrc\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to support large storage for 'hrStorageAllocationUnits' * 'hrStorageSize'. Controls how the agent reports 'hrStorageAllocationUnits', 'hrStorageSize' and 'hrStorageUsed' in 'hrStorageTable'.\n    Setting this directive to $true to support large storage with small allocation units, the agent re-calculates these values so they all fit into 'int' and 'hrStorageAllocationUnits' * 'hrStorageSize' gives real size\n    of the storage. Setting this directive to $false turns off this calculation and the agent reports real 'hrStorageAllocationUnits', but it might report wrong 'hrStorageSize' for large storage because the value won't fit\n    into 'int'.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $LargeStorage\n\n    <#\n    .DESCRIPTION\n\n    Specifies the SNMP agent syslog logging level. Valid values are debug, info, warning and error.\n    #>\n    [DscProperty()]\n    [string] $LogLevel\n\n    <#\n    .DESCRIPTION\n\n    Specifies a comma separated list of trap oids for traps not to be sent by the SNMP agent. Use the property 'reset' to clear this setting.\n    #>\n    [DscProperty()]\n    [string] $NoTraps\n\n    <#\n    .DESCRIPTION\n\n    Specifies the UDP port to poll SNMP agent on. The default is 'udp/161'. May not use ports 32768 to 40959.\n    #>\n    [DscProperty()]\n    [nullable[long]] $Port\n\n    <#\n    .DESCRIPTION\n\n    Specifies the default privacy protocol. Valid values are none and AES128.\n    #>\n    [DscProperty()]\n    [string] $Privacy\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to five inform user ids. Format is: 'user/auth-proto/-|auth-hash/priv-proto/-|priv-hash/engine-id[,...]', where user is 32 chars max. 'auth-proto' is 'none', 'MD5' or 'SHA1',\n    'priv-proto' is 'none' or 'AES'. '-' indicates no hash. 'engine-id' is hex string '0x0-9a-f' up to 32 chars max.\n    #>\n    [DscProperty()]\n    [string] $RemoteUsers\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to return SNMP agent configuration to factory defaults.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Reset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the System contact as presented in 'sysContact.0'. Up to 255 characters.\n    #>\n    [DscProperty()]\n    [string] $SysContact\n\n    <#\n    .DESCRIPTION\n\n    Specifies the System location as presented in 'sysLocation.0'. Up to 255 characters.\n    #>\n    [DscProperty()]\n    [string] $SysLocation\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to three targets to send SNMPv1 traps to. Format is: 'ip-or-hostname[@port]/community[,...]'. The default port is 'udp/162'.\n    #>\n    [DscProperty()]\n    [string] $Targets\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to five local users. Format is: 'user/-|auth-hash/-|priv-hash/model[,...]', where user is 32 chars max. '-' indicates no hash. Model is one of 'none', 'auth' or 'priv'.\n    #>\n    [DscProperty()]\n    [string] $Users\n\n    <#\n    .DESCRIPTION\n\n    Specifies up to three SNMPv3 notification targets. Format is: 'ip-or-hostname[@port]/remote-user/security-level/trap|inform[,...]'.\n    #>\n    [DscProperty()]\n    [string] $V3Targets\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $modifyVMHostSNMPAgentMethodArguments = @{}\n            if ($null -ne $this.NoTraps) { $modifyVMHostSNMPAgentMethodArguments.notraps = $this.NoTraps }\n            if ($null -ne $this.SysContact) { $modifyVMHostSNMPAgentMethodArguments.syscontact = $this.SysContact }\n            if ($null -ne $this.SysLocation) { $modifyVMHostSNMPAgentMethodArguments.syslocation = $this.SysLocation }\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName, $modifyVMHostSNMPAgentMethodArguments)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMHostSNMPAgent($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostSNMPAgent] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSNMPAgent]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMHost SNMP Agent should be modified.\n    #>\n    [bool] ShouldModifyVMHostSNMPAgent($esxCliGetMethodResult) {\n        $shouldModifyVMHostSNMPAgent = @(\n            $this.ShouldUpdateDscResourceSetting('Authentication', [string] $esxCliGetMethodResult.authentication, $this.Authentication),\n            $this.ShouldUpdateDscResourceSetting('Communities', [string] $esxCliGetMethodResult.communities, $this.Communities),\n            $this.ShouldUpdateDscResourceSetting('Enable', [System.Convert]::ToBoolean($esxCliGetMethodResult.enable), $this.Enable),\n            $this.ShouldUpdateDscResourceSetting('EngineId', [string] $esxCliGetMethodResult.engineid, $this.EngineId),\n            $this.ShouldUpdateDscResourceSetting('Hwsrc', [string] $esxCliGetMethodResult.hwsrc, $this.Hwsrc),\n            $this.ShouldUpdateDscResourceSetting('LargeStorage', [System.Convert]::ToBoolean($esxCliGetMethodResult.largestorage), $this.LargeStorage),\n            $this.ShouldUpdateDscResourceSetting('LogLevel', [string] $esxCliGetMethodResult.loglevel, $this.LogLevel),\n            $this.ShouldUpdateDscResourceSetting('NoTraps', [string] $esxCliGetMethodResult.notraps, $this.NoTraps),\n            $this.ShouldUpdateDscResourceSetting('Port', [int] $esxCliGetMethodResult.port, $this.Port),\n            $this.ShouldUpdateDscResourceSetting('Privacy', [string] $esxCliGetMethodResult.privacy, $this.Privacy),\n            $this.ShouldUpdateDscResourceSetting('RemoteUsers', [string] $esxCliGetMethodResult.remoteusers, $this.RemoteUsers),\n            $this.ShouldUpdateDscResourceSetting('SysContact', [string] $esxCliGetMethodResult.syscontact, $this.SysContact),\n            $this.ShouldUpdateDscResourceSetting('SysLocation', [string] $esxCliGetMethodResult.syslocation, $this.SysLocation),\n            $this.ShouldUpdateDscResourceSetting('Targets', [string] $esxCliGetMethodResult.targets, $this.Targets),\n            $this.ShouldUpdateDscResourceSetting('Users', [string] $esxCliGetMethodResult.users, $this.Users),\n            $this.ShouldUpdateDscResourceSetting('V3Targets', [string] $esxCliGetMethodResult.v3targets, $this.V3Targets),\n            $this.ShouldUpdateDscResourceSetting('Reset', $false, $this.Reset)\n        )\n\n        return ($shouldModifyVMHostSNMPAgent -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Reset = $this.Reset\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n        $result.Authentication = $esxCliGetMethodResult.authentication\n        $result.Communities = $esxCliGetMethodResult.communities\n        $result.Enable = [System.Convert]::ToBoolean($esxCliGetMethodResult.enable)\n        $result.EngineId = $esxCliGetMethodResult.engineid\n        $result.Hwsrc = $esxCliGetMethodResult.hwsrc\n        $result.LargeStorage = [System.Convert]::ToBoolean($esxCliGetMethodResult.largestorage)\n        $result.LogLevel = $esxCliGetMethodResult.loglevel\n        $result.NoTraps = $esxCliGetMethodResult.notraps\n        $result.Port = [int] $esxCliGetMethodResult.port\n        $result.Privacy = $esxCliGetMethodResult.privacy\n        $result.RemoteUsers = $esxCliGetMethodResult.remoteusers\n        $result.SysContact = $esxCliGetMethodResult.syscontact\n        $result.SysLocation = $esxCliGetMethodResult.syslocation\n        $result.Targets = $esxCliGetMethodResult.targets\n        $result.Users = $esxCliGetMethodResult.users\n        $result.V3Targets = $esxCliGetMethodResult.v3targets\n    }\n}\n\n[DscResource()]\nclass VMHostSoftwareDevice : EsxCliBaseDSC {\n    VMHostSoftwareDevice() {\n        $this.EsxCliCommand = 'device.software'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the device identifier from the device specification for the software device driver. Valid input is in reverse domain name format (e.g. com.company.device...).\n    #>\n    [DscProperty(Key)]\n    [string] $DeviceIdentifier\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the software device should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the unique number to address this instance of the device, if multiple instances of the same device identifier are added. Valid values are integer in the range 0-31. Default is 0.\n    #>\n    [DscProperty()]\n    [nullable[long]] $InstanceAddress\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $softwareDevice = $this.GetVMHostSoftwareDevice()\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $softwareDevice) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliAddMethodName)\n                }\n            }\n            else {\n                if ($null -ne $softwareDevice) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliRemoveMethodName)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $result = $this.IsVMHostSoftwareDeviceInDesiredState()\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostSoftwareDevice] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostSoftwareDevice]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Software device with the specified id and instance address if it exists.\n    #>\n    [PSObject] GetVMHostSoftwareDevice() {\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n        $softwareDeviceInstanceAddress = if ($null -ne $this.InstanceAddress) { $this.InstanceAddress } else { 0 }\n        $softwareDevice = $esxCliListMethodResult | Where-Object -FilterScript { $_.DeviceID -eq $this.DeviceIdentifier -and [long] $_.Instance -eq $softwareDeviceInstanceAddress }\n\n        return $softwareDevice\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Software device is in a Desired State depending on the value of the 'Ensure' property.\n    #>\n    [bool] IsVMHostSoftwareDeviceInDesiredState() {\n        $softwareDevice = $this.GetVMHostSoftwareDevice()\n\n        $result = $false\n        if ($this.Ensure -eq [Ensure]::Present) {\n            $result = ($null -ne $softwareDevice)\n        }\n        else {\n            $result = ($null -eq $softwareDevice)\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n\n        $softwareDevice = $this.GetVMHostSoftwareDevice()\n        if ($null -ne $softwareDevice) {\n            $result.DeviceIdentifier = $softwareDevice.DeviceID\n            $result.InstanceAddress = [long] $softwareDevice.Instance\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.DeviceIdentifier = $this.DeviceIdentifier\n            $result.InstanceAddress = $this.InstanceAddress\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVMKernelActiveDumpFile : EsxCliBaseDSC {\n    VMHostVMKernelActiveDumpFile() {\n        $this.EsxCliCommand = 'system.coredump.file'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the VMKernel dump file should be enabled or disabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to select the best available file using the smart selection algorithm. Can only be used when 'Enabled' property is specified with '$true' value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Smart\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMKernelDumpFile($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelActiveDumpFile] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelActiveDumpFile]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMKernel dump file should be modified.\n    #>\n    [bool] ShouldModifyVMKernelDumpFile($esxCliGetMethodResult) {\n        $result = $null\n\n        if ($null -ne $this.Enable) {\n            if ($this.Enable) { $result = [string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n            else { $result = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n        }\n        else {\n            $result = $false\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Smart = $this.Smart\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n        $result.Enable = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active)\n    }\n}\n\n[DscResource()]\nclass VMHostVMKernelActiveDumpPartition : EsxCliBaseDSC {\n    VMHostVMKernelActiveDumpPartition() {\n        $this.EsxCliCommand = 'system.coredump.partition'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the VMKernel dump partition should be enabled or disabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enable\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to select the best available partition using the smart selection algorithm. Can only be used when 'Enabled' property is specified with '$true' value.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Smart\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n\n            $result = !$this.ShouldModifyVMKernelDumpPartition($esxCliGetMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelActiveDumpPartition] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelActiveDumpPartition]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the VMKernel dump partition should be modified.\n    #>\n    [bool] ShouldModifyVMKernelDumpPartition($esxCliGetMethodResult) {\n        $result = $null\n\n        if ($null -ne $this.Enable) {\n            if ($this.Enable) { $result = [string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n            else { $result = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active) }\n        }\n        else {\n            $result = $false\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Smart = $this.Smart\n\n        $esxCliGetMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliGetMethodName)\n        $result.Enable = ![string]::IsNullOrEmpty($esxCliGetMethodResult.Active)\n    }\n}\n\n[DscResource()]\nclass VMHostVMKernelDumpFile : EsxCliBaseDSC {\n    VMHostVMKernelDumpFile() {\n        $this.EsxCliCommand = 'system.coredump.file'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Datastore for the dump file.\n    #>\n    [DscProperty(Key)]\n    [string] $DatastoreName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the file name of the dump file.\n    #>\n    [DscProperty(Key)]\n    [string] $FileName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the VMKernel dump Vmfs file should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the size in MB of the dump file. If not provided, a default size for the current machine is calculated.\n    #>\n    [DscProperty()]\n    [nullable[long]] $Size\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to deactivate and unconfigure the dump file being removed. This option is required if the file is active.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    hidden [string] $CouldNotRetrieveFileSystemsInformationMessage = \"Could not retrieve information about File Systems on VMHost {0}. For more information: {1}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $addVMKernelDumpFileMethodArguments = @{\n                    datastore = $this.DatastoreName\n                    file = $this.FileName\n                }\n\n                $this.ExecuteEsxCliModifyMethod($this.EsxCliAddMethodName, $addVMKernelDumpFileMethodArguments)\n            }\n            else {\n                $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n                $vmKernelDumpFile = $this.GetVMKernelDumpFile($esxCliListMethodResult)\n                $removeVMKernelDumpFileMethodArguments = @{\n                    file = $vmKernelDumpFile.Path\n                }\n\n                $this.ExecuteEsxCliModifyMethod($this.EsxCliRemoveMethodName, $removeVMKernelDumpFileMethodArguments)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n            $vmKernelDumpFile = $this.GetVMKernelDumpFile($esxCliListMethodResult)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($vmKernelDumpFile.Count -ne 0)\n            }\n            else {\n                $result = ($vmKernelDumpFile.Count -eq 0)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelDumpFile] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelDumpFile]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Translates the Datastore name from a volume UUID to volume name, if required.\n    #>\n    [string] TranslateDatastoreName($datastoreName) {\n        $foundDatastoreName = $null\n        $fileSystemsList = $null\n\n        try {\n            $fileSystemsList = Invoke-EsxCliCommandMethod -EsxCli $this.EsxCli -EsxCliCommandMethod 'storage.filesystem.list.Invoke({0})' -EsxCliCommandMethodArguments @{}\n        }\n        catch {\n            throw ($this.CouldNotRetrieveFileSystemsInformationMessage -f $this.Name, $_.Exception.Message)\n        }\n\n        foreach ($fileSystem in $fileSystemsList) {\n            if ($fileSystem.UUID -eq $datastoreName) {\n                $foundDatastoreName = $fileSystem.VolumeName\n                break\n            }\n\n            if ($fileSystem.VolumeName -eq $datastoreName) {\n                $foundDatastoreName = $fileSystem.VolumeName\n                break\n            }\n        }\n\n        return $foundDatastoreName\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the name of the specified dump file.\n    #>\n    [string] GetDumpFileName($dumpFile) {\n        $fileParts = $dumpFile -Split '\\.'\n        return $fileParts[0]\n    }\n\n    <#\n    .DESCRIPTION\n\n    Converts the passed bytes value to MB value.\n    #>\n    [double] ConvertBytesValueToMBValue($bytesValue) {\n        return [Math]::Round($bytesValue / 1MB)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel dump file if it exists.\n    #>\n    [PSObject] GetVMKernelDumpFile($esxCliListMethodResult) {\n        $foundDumpFile = @{}\n        $result = @()\n\n        foreach ($dumpFile in $esxCliListMethodResult) {\n            $dumpFileParts = $dumpFile.Path -Split '/'\n            $dumpFileDatastoreName = $this.TranslateDatastoreName($dumpFileParts[3])\n            $dumpFileName = $this.GetDumpFileName($dumpFileParts[5])\n\n            $result += ($this.DatastoreName -eq $dumpFileDatastoreName)\n            $result += ($this.FileName -eq $dumpFileName)\n\n            if ($null -ne $this.Size) {\n                $result += ($this.Size -eq $this.ConvertBytesValueToMBValue($dumpFile.Size))\n            }\n\n            if ($result -NotContains $false) {\n                $foundDumpFile.Path = $dumpFile.Path\n                $foundDumpFile.Datastore = $dumpFileDatastoreName\n                $foundDumpFile.File = $dumpFileName\n                $foundDumpFile.Size = $this.ConvertBytesValueToMBValue($dumpFile.Size)\n\n                break\n            }\n\n            $result = @()\n        }\n\n        return $foundDumpFile\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Force = $this.Force\n\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n        $vmKernelDumpFile = $this.GetVMKernelDumpFile($esxCliListMethodResult)\n\n        if ($vmKernelDumpFile.Count -ne 0) {\n            $result.DatastoreName = $vmKernelDumpFile.Datastore\n            $result.FileName = $vmKernelDumpFile.File\n            $result.Size = $vmKernelDumpFile.Size\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.DatastoreName = $this.DatastoreName\n            $result.FileName = $this.FileName\n            $result.Size = $this.Size\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVMKernelModule : EsxCliBaseDSC {\n    VMHostVMKernelModule() {\n        $this.EsxCliCommand = 'system.module'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VMKernel module.\n    #>\n    [DscProperty(Key)]\n    [string] $Module\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the module should be enabled or disabled.\n    #>\n    [DscProperty(Mandatory)]\n    [bool] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to skip the VMkernel module validity checks.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.ExecuteEsxCliModifyMethod($this.EsxCliSetMethodName)\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n            $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n\n            $result = !$this.ShouldModifyVMKernelModule($esxCliListMethodResult)\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVMKernelModule] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVMKernelModule]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMKernel module should be modified.\n    #>\n    [bool] ShouldModifyVMKernelModule($esxCliListMethodResult) {\n        $vmKernelModule = $esxCliListMethodResult | Where-Object -FilterScript { $_.Name -eq $this.Module }\n        return $this.ShouldUpdateDscResourceSetting('Enabled', [System.Convert]::ToBoolean($vmKernelModule.IsEnabled), $this.Enabled)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Force = $this.Force\n\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n        $vmKernelModule = $esxCliListMethodResult | Where-Object -FilterScript { $_.Name -eq $this.Module }\n\n        $result.Module = $vmKernelModule.Name\n        $result.Enabled = [System.Convert]::ToBoolean($vmKernelModule.IsEnabled)\n    }\n}\n\n[DscResource()]\nclass VMHostvSANNetworkConfiguration : EsxCliBaseDSC {\n    VMHostvSANNetworkConfiguration() {\n        $this.EsxCliCommand = 'vsan.network.ip'\n    }\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the interface.\n    #>\n    [DscProperty(Key)]\n    [string] $InterfaceName\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the IP interface of the vSAN network configuration should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv4 multicast address for the agent group.\n    #>\n    [DscProperty()]\n    [string] $AgentMcAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv6 multicast address for the agent group.\n    #>\n    [DscProperty()]\n    [string] $AgentV6McAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the multicast address port for the agent group.\n    #>\n    [DscProperty()]\n    [nullable[long]] $AgentMcPort\n\n    <#\n    .DESCRIPTION\n\n    Specifies the unicast address port for the VMHost unicast channel.\n    #>\n    [DscProperty()]\n    [nullable[long]] $HostUcPort\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv4 multicast address for the master group.\n    #>\n    [DscProperty()]\n    [string] $MasterMcAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the IPv6 multicast address for the master group.\n    #>\n    [DscProperty()]\n    [string] $MasterV6McAddr\n\n    <#\n    .DESCRIPTION\n\n    Specifies the multicast address port for the master group.\n    #>\n    [DscProperty()]\n    [nullable[long]] $MasterMcPort\n\n    <#\n    .DESCRIPTION\n\n    Specifies the time-to-live for multicast packets.\n    #>\n    [DscProperty()]\n    [nullable[long]] $MulticastTtl\n\n    <#\n    .DESCRIPTION\n\n    Specifies the network transmission type of the vSAN traffic through a virtual network adapter. Supported values are vsan and witness. Type 'vsan' means general vSAN transmission, which is used for both\n    data and witness transmission, if there is no virtual adapter configured with 'witness' traffic type; Type 'witness' indicates that, vSAN vmknic is used for vSAN witness transmission.\n    Once a virtual adapter is configured with 'witness' traffic type, vSAN witness data transmission will stop using virtual adapter with 'vsan' traffic type, and use first dicovered virtual adapter with 'witness' traffic type.\n    Multiple traffic types can be provided in format -T type1 -T type2. Default value is 'vsan', if the property is not specified.\n    #>\n    [DscProperty()]\n    [string[]] $TrafficType\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether to notify vSAN subsystem of the removal of the IP Interface, even if is not configured.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Force\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $vSanNetworkConfigurationIPInterface = $this.GetvSanNetworkConfigurationIPInterface()\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vSanNetworkConfigurationIPInterface) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliAddMethodName)\n                }\n            }\n            else {\n                if ($null -ne $vSanNetworkConfigurationIPInterface) {\n                    $this.ExecuteEsxCliModifyMethod($this.EsxCliRemoveMethodName)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $result = $this.IsvSanNetworkConfigurationIPInterfaceInDesiredState()\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostvSANNetworkConfiguration] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostvSANNetworkConfiguration]::new()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetEsxCli($vmHost)\n\n            $this.PopulateResult($result, $vmHost)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the IP interface with the specified name of the vSAN network configuration.\n    #>\n    [PSObject] GetvSanNetworkConfigurationIPInterface() {\n        <#\n        The 'list' method of the command is not on the same element as the 'add' and 'remove' methods. So the different methods\n        need to be executed with different commands.\n        #>\n        $initialEsxCliCommand = $this.EsxCliCommand\n        $this.EsxCliCommand = 'vsan.network'\n\n        $esxCliListMethodResult = $this.ExecuteEsxCliRetrievalMethod($this.EsxCliListMethodName)\n\n        # The command needs to be restored to its initial value, so that it can be used by the 'add' and 'remove' methods.\n        $this.EsxCliCommand = $initialEsxCliCommand\n\n        return ($esxCliListMethodResult | Where-Object -FilterScript { $_.VmkNicName -eq $this.InterfaceName })\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the vSan network configuration IP interface is in a Desired State depending on the value of the 'Ensure' property.\n    #>\n    [bool] IsvSanNetworkConfigurationIPInterfaceInDesiredState() {\n        $vSanNetworkConfigurationIPInterface = $this.GetvSanNetworkConfigurationIPInterface()\n\n        $result = $false\n        if ($this.Ensure -eq [Ensure]::Present) {\n            $result = ($null -ne $vSanNetworkConfigurationIPInterface)\n        }\n        else {\n            $result = ($null -eq $vSanNetworkConfigurationIPInterface)\n        }\n\n        return $result\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHost) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $vmHost.Name\n        $result.Force = $this.Force\n\n        $vSanNetworkConfigurationIPInterface = $this.GetvSanNetworkConfigurationIPInterface()\n        if ($null -ne $vSanNetworkConfigurationIPInterface) {\n            $result.InterfaceName = $vSanNetworkConfigurationIPInterface.VmkNicName\n            $result.AgentMcAddr = $vSanNetworkConfigurationIPInterface.AgentGroupMulticastAddress\n            $result.AgentMcPort = [long] $vSanNetworkConfigurationIPInterface.AgentGroupMulticastPort\n            $result.AgentV6McAddr = $vSanNetworkConfigurationIPInterface.AgentGroupIPv6MulticastAddress\n            $result.HostUcPort = [long] $vSanNetworkConfigurationIPInterface.HostUnicastChannelBoundPort\n            $result.MasterMcAddr = $vSanNetworkConfigurationIPInterface.MasterGroupMulticastAddress\n            $result.MasterMcPort = [long] $vSanNetworkConfigurationIPInterface.MasterGroupMulticastPort\n            $result.MasterV6McAddr = $vSanNetworkConfigurationIPInterface.MasterGroupIPv6MulticastAddress\n            $result.MulticastTtl = [long] $vSanNetworkConfigurationIPInterface.MulticastTTL\n            $result.TrafficType = $vSanNetworkConfigurationIPInterface.TrafficType\n            $result.Ensure = [Ensure]::Present\n        }\n        else {\n            $result.InterfaceName = $this.InterfaceName\n            $result.AgentMcAddr = $this.AgentMcAddr\n            $result.AgentMcPort = $this.AgentMcPort\n            $result.AgentV6McAddr = $this.AgentV6McAddr\n            $result.HostUcPort = $this.HostUcPort\n            $result.MasterMcAddr = $this.MasterMcAddr\n            $result.MasterMcPort = $this.MasterMcPort\n            $result.MasterV6McAddr = $this.MasterV6McAddr\n            $result.MulticastTtl = $this.MulticastTtl\n            $result.TrafficType = $this.TrafficType\n            $result.Ensure = [Ensure]::Absent\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVDSwitchMigration : VMHostNetworkMigrationBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the vSphere Distributed Switch to which the VMHost and its Network should be part of.\n    VMHost Network consists of the passed Physical Network Adapters, VMKernel Network Adapters and Port Groups.\n    #>\n    [DscProperty(Key)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Port Groups to which the specified VMKernel Network Adapters should be attached. Accepts either one Port Group\n    or the same number of Port Groups as the number of VMKernel Network Adapters specified. If one Port Group is specified, all Adapters are attached to that Port Group.\n    If the same number of Port Groups as the number of VMKernel Network Adapters are specified, the first Adapter is attached to the first Port Group,\n    the second Adapter to the second Port Group, and so on.\n    #>\n    [DscProperty()]\n    [string[]] $PortGroupNames\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the user wants to migrate only the Physical Network\n    Adapters when no VMKernel Network Adapters are specified. Migrating a\n    Physical Network Adapter that takes care of the Management traffic without a\n    VMKernel Network Adapter could result in an ESXi network connectivity loss.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MigratePhysicalNicsOnly\n\n    hidden [string] $RetrieveVDSwitchMessage = \"Retrieving VDSwitch {0} from vCenter {1}.\"\n    hidden [string] $RetrieveStandardPortGroupMessage = \"Retrieving Standard Port Group {0} located on VMHost {1}.\"\n    hidden [string] $CreateVDPortGroupMessage = \"Creating VDPortGroup {0} on VDSwitch {1}{2}\"\n    hidden [string] $AddVDSwitchToVMHostMessage = \"Adding VDSwitch {0} to VMHost {1}.\"\n    hidden [string] $AddPhysicalNicsToVDSwitchMessage = \"Migrating Physical Network Adapters {0} to VDSwitch {1}.\"\n    hidden [string] $AddPhysicalNicsAndVMKernelNicsToVDSwitchMessage = \"Migrating Physical Network Adapters {0} and VMKernel Network Adapters {1} to VDSwitch {2}.\"\n\n    hidden [string] $MigratePhysicalNicsOnlyNotSpecified = \"When migrating Physical Network Adapters without VMKernel Network Adapters, the MigratePhysicalNicsOnly parameter should be specified in order for the migration to occur.\"\n\n    hidden [string] $CouldNotRetrieveVDSwitchMessage = \"Could not retrieve VDSwitch {0}. For more information: {1}\"\n    hidden [string] $CouldNotRetrieveStandardPortGroupMessage = \"Could not retrieve Standard Port Group {0} located on VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotCreateVDPortGroupMessage = \"Could not create VDPortGroup {0} on VDSwitch {1}. For more information: {2}\"\n    hidden [string] $CouldNotAddVDSwitchToVMHostMessage = \"Could not add VDSwitch {0} to VMHost {1}. For more information: {2}\"\n    hidden [string] $CouldNotAddPhysicalNicsToVDSwitchMessage = \"Could not migrate Physical Network Adapters {0} to VDSwitch {1}. For more information: {2}\"\n    hidden [string] $CouldNotAddPhysicalNicsAndVMKernelNicsToVDSwitchMessage = \"Could not migrate Physical Network Adapters {0} and VMKernel Network Adapters {1} to VDSwitch {2}. For more information: {3}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $distributedSwitch = $this.GetDistributedSwitch()\n\n            if (!$this.IsVMHostAddedToDistributedSwitch($distributedSwitch)) {\n                $this.AddVMHostToDistributedSwitch($distributedSwitch)\n            }\n\n            $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n            if ($this.VMkernelNicNames.Length -eq 0) {\n                $this.AddPhysicalNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $distributedSwitch)\n            }\n            else {\n                $vmKernelNetworkAdapters = $this.GetVMKernelNetworkAdapters()\n                $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n                $this.AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $distributedSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $distributedSwitch = $this.GetDistributedSwitch()\n\n            $result = $null\n\n            if (!$this.IsVMHostAddedToDistributedSwitch($distributedSwitch)) {\n                $result = $false\n            }\n\n            # The $null checks ensure that the desired state has not been determined yet from the previous statements.\n            if ($null -eq $result -and $this.ShouldAddPhysicalNetworkAdaptersToDistributedSwitch($distributedSwitch)) {\n                $result = $false\n            }\n\n            if ($null -eq $result -and $this.VMkernelNicNames.Length -eq 0 -and $this.PortGroupNames.Length -eq 0) {\n                $result = $true\n            }\n            elseif ($null -eq $result) {\n                $result = !$this.ShouldAddVMKernelNetworkAdaptersAndPortGroupsToDistributedSwitch($distributedSwitch)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVDSwitchMigration] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVDSwitchMigration]::new()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $distributedSwitch = $this.GetDistributedSwitch()\n\n            $this.PopulateResult($distributedSwitch, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Distributed Switch with the specified name from the server if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetDistributedSwitch() {\n        <#\n        The Verbose logic here is needed to suppress the Exporting and Importing of the\n        cmdlets from the VMware.VimAutomation.Vds Module.\n        #>\n        $savedVerbosePreference = $global:VerbosePreference\n        $global:VerbosePreference = 'SilentlyContinue'\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveVDSwitchMessage, @($this.VdsName, $this.Connection.Name))\n\n            $getVDSwitchParams = @{\n                Server = $this.Connection\n                Name = $this.VdsName\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VDSwitch @getVDSwitchParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveVDSwitchMessage -f $this.VdsName, $_.Exception.Message)\n        }\n        finally {\n            $global:VerbosePreference = $savedVerbosePreference\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Standard Port Group with the specified name if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetStandardPortGroup($standardPortGroupName) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.RetrieveStandardPortGroupMessage, @($standardPortGroupName, $this.VMHost.Name))\n            $getVirtualPortGroupParams = @{\n                Server = $this.Connection\n                Name = $standardPortGroupName\n                VMHost = $this.VMHost\n                Standard = $true\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            return Get-VirtualPortGroup @getVirtualPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotRetrieveStandardPortGroupMessage -f $standardPortGroupName, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a hashtable containing the parameters for the Add-VDSwitchPhysicalNetworkAdapter cmdlet.\n    #>\n    [hashtable] GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNics) {\n        return @{\n            Server = $this.Connection\n            DistributedSwitch = $distributedSwitch\n            VMHostPhysicalNic = $physicalNics\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a hashtable containing the parameters for the Add-VDSwitchPhysicalNetworkAdapter cmdlet.\n    #>\n    [hashtable] GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNics, $vmKernelNics, $portGroups) {\n        $addVDSwitchPhysicalNetworkAdapterParams = $this.GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNics)\n\n        $addVDSwitchPhysicalNetworkAdapterParams.VMHostVirtualNic = $vmKernelNics\n        $addVDSwitchPhysicalNetworkAdapterParams.VirtualNicPortgroup = $portGroups\n\n        return $addVDSwitchPhysicalNetworkAdapterParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost is part of the Distributed Switch.\n    #>\n    [bool] IsVMHostAddedToDistributedSwitch($distributedSwitch) {\n        $addedVMHost = $this.VMHost.ExtensionData.Config.Network.ProxySwitch | Where-Object -FilterScript { $_.DvsName -eq $distributedSwitch.Name }\n        return ($null -ne $addedVMHost)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed Physical Network Adapters are added to the Distributed Switch.\n    #>\n    [bool] ShouldAddPhysicalNetworkAdaptersToDistributedSwitch($distributedSwitch) {\n        $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n        if ($physicalNetworkAdapters.Length -eq 0) {\n            throw 'At least one Physical Network Adapter needs to be specified.'\n        }\n\n        if ($null -eq $distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec) {\n            # No Physical Network Adapters are added to the Distributed Switch.\n            return $true\n        }\n\n        foreach ($physicalNetworkAdapter in $physicalNetworkAdapters) {\n            $addedPhysicalNetworkAdapter = $distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec | Where-Object -FilterScript { $_.PNicDevice -eq $physicalNetworkAdapter.Name }\n            if ($null -eq $addedPhysicalNetworkAdapter) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed VMKernel Network Adapters and Port Groups are added to the Distributed Switch.\n    #>\n    [bool] ShouldAddVMKernelNetworkAdaptersAndPortGroupsToDistributedSwitch($distributedSwitch) {\n        $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n        if ($this.PortGroupNames.Length -eq 1) {\n            $portGroupName = $this.PortGroupNames[0]\n\n            foreach ($vmKernelNetworkAdapterName in $this.VMKernelNicNames) {\n                $getVMHostNetworkAdapterParams = @{\n                    Server = $this.Connection\n                    Name = $vmKernelNetworkAdapterName\n                    VMHost = $this.VMHost\n                    VirtualSwitch = $distributedSwitch\n                    PortGroup = $portGroupName\n                    VMKernel = $true\n                    ErrorAction = 'SilentlyContinue'\n                    Verbose = $false\n                }\n\n                $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n                if ($null -eq $vmKernelNetworkAdapter) {\n                    return $true\n                }\n            }\n        }\n        else {\n            for ($i = 0; $i -lt $this.VMKernelNicNames.Length; $i++) {\n                $vmKernelNetworkAdapterName = $this.VMKernelNicNames[$i]\n                $portGroupName = $this.PortGroupNames[$i]\n\n                $getVMHostNetworkAdapterParams = @{\n                    Server = $this.Connection\n                    Name = $vmKernelNetworkAdapterName\n                    VMHost = $this.VMHost\n                    VirtualSwitch = $distributedSwitch\n                    PortGroup = $portGroupName\n                    VMKernel = $true\n                    ErrorAction = 'SilentlyContinue'\n                    Verbose = $false\n                }\n\n                $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n                if ($null -eq $vmKernelNetworkAdapter) {\n                    return $true\n                }\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified Distributed Port Groups exist. If a Distributed Port Group is specified and does not exist,\n    it is created on the specified Distributed Switch.\n    #>\n    [array] EnsureDistributedPortGroupsExist($distributedSwitch, $vmKernelNetworkAdapters) {\n        $portGroups = @()\n        foreach ($distributedPortGroupName in $this.PortGroupNames) {\n            $getVDPortGroupParams = @{\n                Server = $this.Connection\n                Name = $distributedPortGroupName\n                VDSwitch = $distributedSwitch\n                ErrorAction = 'SilentlyContinue'\n                Verbose = $false\n            }\n            $distributedPortGroup = Get-VDPortgroup @getVDPortGroupParams\n            if ($null -eq $distributedPortGroup) {\n                $distributedPortGroup = $this.CreateDistributedPortGroup($distributedPortGroupName, $distributedSwitch, $vmKernelNetworkAdapters)\n            }\n\n            $portGroups += $distributedPortGroup\n        }\n\n        return $portGroups\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the passed VMKernel Network Adapter names and Port Group names count meets the following criteria:\n    If at least one VMKernel Network Adapter is specified, one of the following requirements should be met:\n    1. The number of specified Port Groups should be equal to the number of specified VMKernel Network Adapters.\n    2. Only one Port Group is passed.\n    If no VMKernel Network Adapter names are passed, no Port Group names should be passed as well.\n    #>\n    [void] EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect() {\n        if ($this.VMkernelNicNames.Length -gt 0) {\n            if ($this.PortGroupNames.Length -eq 0 -or ($this.VMkernelNicNames.Length -ne $this.PortGroupNames.Length -and $this.PortGroupNames.Length -ne 1)) {\n                throw \"$($this.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($this.PortGroupNames.Length) Port Groups specified which is not valid.\"\n            }\n        }\n        else {\n            if ($this.PortGroupNames.Length -ne 0) {\n                throw \"$($this.PortGroupNames.Length) Port Groups specified and no VMKernel Network Adapters specified which is not valid.\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Distributed Port Group with the specified name on the specified Distributed Switch.\n    If a Standard Port Group with the same name exists on the Standard Switch from which the VMKernel Network Adapters are migrated\n    and the Standard Port Group is associated with a VLAN, the new Distributed Port Group is created with the same VLAN to avoid\n    any network misconfigurations due to VLANs not configured correctly.\n    #>\n    [PSObject] CreateDistributedPortGroup($distributedPortGroupName, $distributedSwitch, $vmKernelNetworkAdapters) {\n        try {\n            $createVDPortGroupMessageEnd = \".\"\n            $newVDPortGroupParams = @{\n                Server = $this.Connection\n                Name = $distributedPortGroupName\n                VDSwitch = $distributedSwitch\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n\n            $vmKernelNetworkAdapterOfStandardPortGroup = $vmKernelNetworkAdapters | Where-Object -FilterScript { $_.PortGroupName -eq $distributedPortGroupName }\n            if ($null -ne $vmKernelNetworkAdapterOfStandardPortGroup) {\n                $standardPortGroup = $this.GetStandardPortGroup($distributedPortGroupName)\n\n                # The VLAN for Distributed Port Groups is valid only in the specified range.\n                if ($standardPortGroup.VLanId -In 1..4094) {\n                    $newVDPortGroupParams.VlanId = $standardPortGroup.VLanId\n                    $createVDPortGroupMessageEnd = \" with VLAN ID $($standardPortGroup.VLanId).\"\n                }\n            }\n\n            $this.WriteLogUtil('Verbose', $this.CreateVDPortGroupMessage, @($distributedPortGroupName, $distributedSwitch.Name, $createVDPortGroupMessageEnd))\n            return New-VDPortgroup @newVDPortGroupParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVDPortGroupMessage -f $distributedPortGroupName, $distributedSwitch.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the VMHost to the specified Distributed Switch.\n    #>\n    [void] AddVMHostToDistributedSwitch($distributedSwitch) {\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddVDSwitchToVMHostMessage, @($distributedSwitch.Name, $this.VMHost.Name))\n\n            $addVDSwitchVMHostParams = @{\n                Server = $this.Connection\n                VDSwitch = $distributedSwitch\n                VMHost = $this.VMHost\n                Confirm = $false\n                ErrorAction = 'Stop'\n                Verbose = $false\n            }\n            Add-VDSwitchVMHost @addVDSwitchVMHostParams\n        }\n        catch {\n            throw ($this.CouldNotAddVDSwitchToVMHostMessage -f $distributedSwitch.Name, $this.VMHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters to the specified Distributed Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $distributedSwitch) {\n        if ($null -eq $this.MigratePhysicalNicsOnly -or !$this.MigratePhysicalNicsOnly) {\n            $this.WriteLogUtil('Warning', $this.MigratePhysicalNicsOnlyNotSpecified)\n\n            return\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddPhysicalNicsToVDSwitchMessage, @(\n                ($physicalNetworkAdapters.Name -Join ', '),\n                $distributedSwitch.Name\n            ))\n\n            $addVDSwitchPhysicalNetworkAdapterParams = $this.GetAddVDSwitchPhysicalNetworkAdapterParams($distributedSwitch, $physicalNetworkAdapters)\n\n            Add-VDSwitchPhysicalNetworkAdapter @addVDSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw (\n                $this.CouldNotAddPhysicalNicsToVDSwitchMessage -f @(\n                    ($physicalNetworkAdapters.Name -Join ', '),\n                    $distributedSwitch.Name,\n                    $_.Exception.Message\n                )\n            )\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters and VMKernel Network Adapters to the specified Distributed Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToDistributedSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $distributedSwitch) {\n        $portGroups = $this.EnsureDistributedPortGroupsExist($distributedSwitch, $vmKernelNetworkAdapters)\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.AddPhysicalNicsAndVMKernelNicsToVDSwitchMessage, @(\n                ($physicalNetworkAdapters.Name -Join ', '),\n                ($vmKernelNetworkAdapters.Name -Join ', '),\n                $distributedSwitch.Name\n            ))\n\n            $addVDSwitchPhysicalNetworkAdapterParams = $this.GetAddVDSwitchPhysicalNetworkAdapterParams(\n                $distributedSwitch,\n                $physicalNetworkAdapters,\n                $vmKernelNetworkAdapters,\n                $portGroups\n            )\n\n            Add-VDSwitchPhysicalNetworkAdapter @addVDSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw (\n                $this.CouldNotAddPhysicalNicsAndVMKernelNicsToVDSwitchMessage -f @(\n                    ($physicalNetworkAdapters.Name -Join ', '),\n                    ($vmKernelNetworkAdapters.Name -Join ', '),\n                    $distributedSwitch.Name,\n                    $_.Exception.Message\n                )\n            )\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($distributedSwitch, $result) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.VdsName = $distributedSwitch.Name\n\n        if ($null -eq $distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec) {\n            $result.PhysicalNicNames = @()\n        }\n        else {\n            $result.PhysicalNicNames = [string[]]($distributedSwitch.ExtensionData.Config.Host.Config.Backing.PnicSpec | Select-Object -ExpandProperty PNicDevice)\n        }\n\n        $result.VMkernelNicNames = @()\n        $result.PortGroupNames = @()\n\n        if ($this.VMKernelNicNames.Length -eq 0) {\n            return\n        }\n\n        $getVMHostNetworkAdapterParams = @{\n            Server = $this.Connection\n            VMHost = $this.VMHost\n            VirtualSwitch = $distributedSwitch\n            VMKernel = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n        $vmKernelNetworkAdapters = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams | Where-Object -FilterScript { $this.VMKernelNicNames.Contains($_.Name) }\n\n        foreach ($vmKernelNetworkAdapter in $vmKernelNetworkAdapters) {\n            $result.VMkernelNicNames += $vmKernelNetworkAdapter.Name\n            $result.PortGroupNames += $vmKernelNetworkAdapter.PortGroupName\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssMigration : VMHostNetworkMigrationBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Standard Switch to which the passed Physical Network Adapters, VMKernel Network Adapters and Port Groups should be part of.\n    #>\n    [DscProperty(Key)]\n    [string] $VssName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the names of the Port Groups to which the specified VMKernel Network Adapters should be attached. Accepts the same number of\n    Port Groups as the number of VMKernel Network Adapters specified. The first Adapter is attached to the first Port Group,\n    the second Adapter to the second Port Group, and so on.\n    #>\n    [DscProperty()]\n    [string[]] $PortGroupNames\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $standardSwitch = $this.GetStandardSwitch()\n\n            $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n            if ($this.VMkernelNicNames.Length -eq 0) {\n                $this.AddPhysicalNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $standardSwitch)\n            }\n            else {\n                $vmKernelNetworkAdapters = $this.GetVMKernelNetworkAdapters()\n                $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n                $this.AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $standardSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $standardSwitch = $this.GetStandardSwitch()\n\n            if ($this.ShouldAddPhysicalNetworkAdaptersToStandardSwitch($standardSwitch)) {\n                return $false\n            }\n\n            if ($this.VMkernelNicNames.Length -eq 0 -and $this.PortGroupNames.Length -eq 0) {\n                return $true\n            }\n            else {\n                return !$this.ShouldAddVMKernelNetworkAdaptersAndPortGroupsToStandardSwitch($standardSwitch)\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssMigration] Get() {\n        try {\n            $result = [VMHostVssMigration]::new()\n\n            $this.ConnectVIServer()\n            $this.EnsureConnectionIsvCenter()\n\n            $this.RetrieveVMHost()\n            $standardSwitch = $this.GetStandardSwitch()\n\n            $this.PopulateResult($standardSwitch, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Standard Switch with the specified name from the specified VMHost if it exists.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetStandardSwitch() {\n        try {\n            $standardSwitch = Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction Stop\n            return $standardSwitch\n        }\n        catch {\n            throw \"Could not retrieve Standard Switch $($this.VssName). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed Physical Network Adapters are added to the Standard Switch.\n    #>\n    [bool] ShouldAddPhysicalNetworkAdaptersToStandardSwitch($standardSwitch) {\n        $physicalNetworkAdapters = $this.GetPhysicalNetworkAdapters()\n        if ($physicalNetworkAdapters.Length -eq 0) {\n            throw 'At least one Physical Network Adapter needs to be specified.'\n        }\n\n        if ($null -eq $standardSwitch.Nic) {\n            # No Physical Network Adapters are added to the Standard Switch.\n            return $true\n        }\n\n        foreach ($physicalNetworkAdapter in $physicalNetworkAdapters) {\n            $addedPhysicalNetworkAdapter = $standardSwitch.Nic | Where-Object -FilterScript { $_ -eq $physicalNetworkAdapter.Name }\n            if ($null -eq $addedPhysicalNetworkAdapter) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if all passed VMKernel Network Adapters and Port Groups are added to the Standard Switch.\n    #>\n    [bool] ShouldAddVMKernelNetworkAdaptersAndPortGroupsToStandardSwitch($standardSwitch) {\n        $this.EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect()\n\n        for ($i = 0; $i -lt $this.VMKernelNicNames.Length; $i++) {\n            $vmKernelNetworkAdapterName = $this.VMKernelNicNames[$i]\n\n            $getVMHostNetworkAdapterParams = @{\n                Server = $this.Connection\n                Name = $vmKernelNetworkAdapterName\n                VMHost = $this.VMHost\n                VirtualSwitch = $standardSwitch\n                VMKernel = $true\n                ErrorAction = 'SilentlyContinue'\n            }\n\n            if ($this.PortGroupNames.Length -gt 0) {\n                $getVMHostNetworkAdapterParams.PortGroup = $this.PortGroupNames[$i]\n            }\n\n            $vmKernelNetworkAdapter = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n            if ($null -eq $vmKernelNetworkAdapter) {\n                return $true\n            }\n        }\n\n        return $false\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the passed VMKernel Network Adapter names and Port Group names count meets the following criteria:\n    If VMKernel Network Adapter names are passed, the following requirements should be met:\n    No Port Group names are passed or the number of Port Group names is the same as the number of VMKernel Network Adapter names.\n    If no VMKernel Network Adapter names are passed, no Port Group names should be passed as well.\n    #>\n    [void] EnsureVMKernelNetworkAdapterAndPortGroupNamesCountIsCorrect() {\n        if ($this.VMKernelNicNames.Length -gt 0) {\n            if ($this.PortGroupNames.Length -gt 0 -and $this.VMkernelNicNames.Length -ne $this.PortGroupNames.Length) {\n                throw \"$($this.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($this.PortGroupNames.Length) Port Groups specified which is not valid.\"\n            }\n        }\n        else {\n            if ($this.PortGroupNames.Length -gt 0) {\n                throw \"$($this.VMKernelNicNames.Length) VMKernel Network Adapters specified and $($this.PortGroupNames.Length) Port Groups specified which is not valid.\"\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Ensures that the specified Standard Port Groups exist. If a Standard Port Group is specified and does not exist,\n    it is created on the specified Standard Switch.\n    #>\n    [void] EnsureStandardPortGroupsExist($standardSwitch) {\n        foreach ($standardPortGroupName in $this.PortGroupNames) {\n            $standardPortGroup = Get-VirtualPortGroup -Server $this.Connection -Name $standardPortGroupName -VirtualSwitch $standardSwitch -Standard -ErrorAction SilentlyContinue\n            if ($null -eq $standardPortGroup) {\n                try {\n                    New-VirtualPortGroup -Server $this.Connection -Name $standardPortGroupName -VirtualSwitch $standardSwitch -Confirm:$false -ErrorAction Stop\n                }\n                catch {\n                    throw \"Cannot create Standard Port Group $standardPortGroupName on Standard Switch $($standardSwitch.Name). For more information: $($_.Exception.Message)\"\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters to the specified Standard Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $standardSwitch) {\n        try {\n            $addVirtualSwitchPhysicalNetworkAdapterParams = @{\n                Server = $this.Connection\n                VirtualSwitch = $standardSwitch\n                VMHostPhysicalNic = $physicalNetworkAdapters\n                Confirm = $false\n                ErrorAction = 'Stop'\n            }\n\n            Add-VirtualSwitchPhysicalNetworkAdapter @addVirtualSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw \"Could not migrate Physical Network Adapters $($physicalNetworkAdapters) to Standard Switch $($standardSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Adds the Physical Network Adapters and VMKernel Network Adapters to the specified Standard Switch.\n    #>\n    [void] AddPhysicalNetworkAdaptersAndVMKernelNetworkAdaptersToStandardSwitch($physicalNetworkAdapters, $vmKernelNetworkAdapters, $standardSwitch) {\n        $this.EnsureStandardPortGroupsExist($standardSwitch)\n\n        try {\n            $addVirtualSwitchPhysicalNetworkAdapterParams = @{\n                Server = $this.Connection\n                VirtualSwitch = $standardSwitch\n                VMHostPhysicalNic = $physicalNetworkAdapters\n                VMHostVirtualNic = $vmKernelNetworkAdapters\n                Confirm = $false\n                ErrorAction = 'Stop'\n            }\n\n            if ($this.PortGroupNames.Length -gt 0) {\n                $addVirtualSwitchPhysicalNetworkAdapterParams.VirtualNicPortgroup = $this.PortGroupNames\n            }\n\n            Add-VirtualSwitchPhysicalNetworkAdapter @addVirtualSwitchPhysicalNetworkAdapterParams\n        }\n        catch {\n            throw \"Could not migrate Physical Network Adapters $($physicalNetworkAdapters) and VMKernel Network Adapters $($vmKernelNetworkAdapters) to Standard Switch $($standardSwitch.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method.\n    #>\n    [void] PopulateResult($standardSwitch, $result) {\n        $result.Server = $this.Connection.Name\n        $result.VMHostName = $this.VMHost.Name\n        $result.VssName = $standardSwitch.Name\n        $result.PhysicalNicNames = $standardSwitch.Nic\n        $result.VMkernelNicNames = @()\n        $result.PortGroupNames = @()\n\n        if ($this.VMKernelNicNames.Length -eq 0) {\n            return\n        }\n\n        $vmKernelNetworkAdapters = Get-VMHostNetworkAdapter -Server $this.Connection -VMHost $this.VMHost -VirtualSwitch $standardSwitch -VMKernel -ErrorAction SilentlyContinue |\n                                   Where-Object -FilterScript { $this.VMKernelNicNames.Contains($_.Name) }\n\n        foreach ($vmKernelNetworkAdapter in $vmKernelNetworkAdapters) {\n            $result.VMkernelNicNames += $vmKernelNetworkAdapter.Name\n            $result.PortGroupNames += $vmKernelNetworkAdapter.PortGroupName\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostPhysicalNic : VMHostEntityBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Name of the Physical Network Adapter which is going to be configured.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Indicates whether the link is capable of full-duplex. The valid values are Full, Half and Unset.\n    #>\n    [DscProperty()]\n    [Duplex] $Duplex = [Duplex]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the bit rate of the link.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BitRatePerSecMb\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the host network adapter speed/duplex settings are configured automatically.\n    If the property is passed, the Duplex and BitRatePerSecMb properties will be ignored.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AutoNegotiate\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n            $physicalNetworkAdapter = $this.GetPhysicalNetworkAdapter()\n\n            $this.UpdatePhysicalNetworkAdapter($physicalNetworkAdapter)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n            $physicalNetworkAdapter = $this.GetPhysicalNetworkAdapter()\n\n            return !$this.ShouldUpdatePhysicalNetworkAdapter($physicalNetworkAdapter)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostPhysicalNic] Get() {\n        try {\n            $result = [VMHostPhysicalNic]::new()\n            $result.Server = $this.Server\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n            $physicalNetworkAdapter = $this.GetPhysicalNetworkAdapter()\n\n            $result.VMHostName = $this.VMHost.Name\n            $result.Name = $physicalNetworkAdapter.Name\n\n            $this.PopulateResult($physicalNetworkAdapter, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Physical Network Adapter with the specified name from the server if it exists.\n    The Network Adapter must be a Physical Network Adapter. If the Physical Network Adapter does not exist, it throws an exception.\n    #>\n    [PSObject] GetPhysicalNetworkAdapter() {\n        try {\n            $physicalNetworkAdapter = Get-VMHostNetworkAdapter -Server $this.Connection -Name $this.Name -VMHost $this.VMHost -Physical -ErrorAction Stop\n            return $physicalNetworkAdapter\n        }\n        catch {\n            throw \"Could not retrieve Physical Network Adapter $($this.Name) of VMHost $($this.VMHost.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Physical Network Adapter should be updated.\n    #>\n    [bool] ShouldUpdatePhysicalNetworkAdapter($physicalNetworkAdapter) {\n        $shouldUpdatePhysicalNetworkAdapter = @(\n            $this.ShouldUpdateDscResourceSetting('BitRatePerSecMb', $physicalNetworkAdapter.BitRatePerSec, $this.BitRatePerSecMb)\n        )\n\n        <#\n        The Duplex value on the server is stored as boolean indicating if the link is capable of full-duplex.\n        So mapping between the enum and boolean values needs to be performed for comparison purposes.\n        #>\n        if ($this.Duplex -ne [Duplex]::Unset) {\n            if ($physicalNetworkAdapter.FullDuplex) {\n                $shouldUpdatePhysicalNetworkAdapter += ($this.Duplex -ne [Duplex]::Full)\n            }\n            else {\n                $shouldUpdatePhysicalNetworkAdapter += ($this.Duplex -ne [Duplex]::Half)\n            }\n        }\n\n        <#\n        If the network adapter speed/duplex settings are configured automatically, the Link Speed\n        property is $null on the server.\n        #>\n        if ($null -ne $this.AutoNegotiate) {\n            if ($this.AutoNegotiate) {\n                $shouldUpdatePhysicalNetworkAdapter += ($null -ne $physicalNetworkAdapter.ExtensionData.Spec.LinkSpeed)\n            }\n            else {\n                $shouldUpdatePhysicalNetworkAdapter += ($null -eq $physicalNetworkAdapter.ExtensionData.Spec.LinkSpeed)\n            }\n        }\n\n        return ($shouldUpdatePhysicalNetworkAdapter -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update operation on the specified Physical Network Adapter.\n    #>\n    [void] UpdatePhysicalNetworkAdapter($physicalNetworkAdapter) {\n        $physicalNetworkAdapterParams = @{}\n\n        $physicalNetworkAdapterParams.PhysicalNic = $physicalNetworkAdapter\n        $physicalNetworkAdapterParams.Confirm = $false\n        $physicalNetworkAdapterParams.ErrorAction = 'Stop'\n\n        if ($null -ne $this.AutoNegotiate -and $this.AutoNegotiate) {\n            $physicalNetworkAdapterParams.AutoNegotiate = $this.AutoNegotiate\n        }\n        else {\n            if ($this.Duplex -ne [Duplex]::Unset) { $physicalNetworkAdapterParams.Duplex = $this.Duplex.ToString() }\n            if ($null -ne $this.BitRatePerSecMb) { $physicalNetworkAdapterParams.BitRatePerSecMb = $this.BitRatePerSecMb }\n        }\n\n        try {\n            Set-VMHostNetworkAdapter @physicalNetworkAdapterParams\n        }\n        catch {\n            throw \"Cannot update Physical Network Adapter $($physicalNetworkAdapter.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Physical Network Adapter from the server.\n    #>\n    [void] PopulateResult($physicalNetworkAdapter, $result) {\n        <#\n        AutoNegotiate property is not present on the server, so it should be populated\n        with the value provided by user.\n        #>\n        $result.AutoNegotiate = $this.AutoNegotiate\n        $result.BitRatePerSecMb = $physicalNetworkAdapter.BitRatePerSec\n\n        if ($physicalNetworkAdapter.FullDuplex) {\n            $result.Duplex = [Duplex]::Full\n        }\n        else {\n            $result.Duplex = [Duplex]::Half\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVdsNic : VMHostNicBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VMKernel NIC connected\n    to the specified Distributed Port Group on the specified VDSwitch.\n    #>\n    [DscProperty(Key)]\n    [string] $Name\n\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the VDSwitch to which the\n    VMKernel NIC is added.\n    #>\n    [DscProperty(Key)]\n    [string] $VdsName\n\n    <#\n    .DESCRIPTION\n\n    Specifies the instance of the 'InventoryUtil' class that is used\n    for Inventory operations.\n    #>\n    hidden [InventoryUtil] $InventoryUtil\n\n    hidden [string] $VMHostIsNotAddedToVDSwitchMessage = \"VMHost {0} should be added to VDSwitch {1} before configuring the VMKernel NIC.\"\n    hidden [string] $CouldNotFindVMKernelNICMessage = \"VMKernel NIC {0} connected to Distributed Port Group {1} on VDSwitch {2} could not be found.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.InitInventoryUtil()\n\n            $this.RetrieveVMHost()\n            $vdSwitch = $this.InventoryUtil.GetVDSwitch($this.VdsName)\n            $this.EnsureVMHostIsAddedToTheVDSwitch($vdSwitch)\n\n            $vmKernelNic = $this.GetVMKernelNic($vdSwitch)\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $this.UpdateVMHostNetworkAdapter($vmKernelNic)\n            }\n            else {\n                if ($null -ne $vmKernelNic) {\n                    $this.RemoveVMHostNetworkAdapter($vmKernelNic)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.InitInventoryUtil()\n\n            $this.RetrieveVMHost()\n            $vdSwitch = $this.InventoryUtil.GetVDSwitch($this.VdsName)\n            $this.EnsureVMHostIsAddedToTheVDSwitch($vdSwitch)\n\n            $vmKernelNic = $this.GetVMKernelNic($vdSwitch)\n            $result = $null\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = !$this.ShouldUpdateVMHostNetworkAdapter($vmKernelNic)\n            }\n            else {\n                $result = ($null -eq $vmKernelNic)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostVdsNic] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVdsNic]::new()\n\n            $this.EnsureConnectionIsvCenter()\n\n            $this.InitInventoryUtil()\n\n            $this.RetrieveVMHost()\n            $vdSwitch = $this.InventoryUtil.GetVDSwitch($this.VdsName)\n            $this.EnsureVMHostIsAddedToTheVDSwitch($vdSwitch)\n\n            $vmKernelNic = $this.GetVMKernelNic($vdSwitch)\n            if ($null -eq $vmKernelNic) {\n                $result.VdsName = $this.VdsName\n                $result.Name = $this.Name\n            }\n            else {\n                $result.VdsName = $vdSwitch.Name\n                $result.Name = $vmKernelNic.Name\n            }\n\n            $this.PopulateResult($vmKernelNic, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Initializes an instance of the 'InventoryUtil' class.\n    #>\n    [void] InitInventoryUtil() {\n        if ($null -eq $this.InventoryUtil) {\n            $this.InventoryUtil = [InventoryUtil]::new($this.Connection, $this.Ensure)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the VMKernel NIC connected to the specified Distributed Port Group and added\n    to the specified VDSwitch from the server if it exists,\n    otherwise the method returns $null.\n    #>\n    [PSObject] GetVMKernelNic($vdSwitch) {\n        if ($null -eq $vdSwitch) {\n            <#\n                If the VDSwitch is $null, it means that Ensure was set to 'Absent' and\n                the VMKernel NIC is not added to the specified VDSwitch.\n            #>\n            return $null\n        }\n\n        $getVMHostNetworkAdapterParams = @{\n            Server = $this.Connection\n            VMHost = $this.VMHost\n            Name = $this.Name\n            VirtualSwitch = $vdSwitch\n            PortGroup = $this.PortGroupName\n            VMKernel = $true\n            ErrorAction = 'SilentlyContinue'\n            Verbose = $false\n        }\n\n        $vmKernelNic = Get-VMHostNetworkAdapter @getVMHostNetworkAdapterParams\n        if ($this.Ensure -eq [Ensure]::Present -and $null -eq $vmKernelNic) {\n            throw ($this.CouldNotFindVMKernelNICMessage -f $this.Name, $this.PortGroupName, $vdSwitch.Name)\n        }\n\n        return $vmKernelNic\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the specified VMHost is part of the specified VDSwitch\n    and if not, throws an exception.\n    #>\n    [void] EnsureVMHostIsAddedToTheVDSwitch($vdSwitch) {\n        if ($null -eq $vdSwitch) {\n            <#\n                If the VDSwitch is $null, it means that Ensure was set to 'Absent' and\n                the VMKernel NIC does not exist for the specified VDSwitch.\n                So there is no need to ensure that the VMHost is part of the VDSwitch.\n            #>\n            return\n        }\n\n        $whereObjectParams = @{\n            FilterScript = {\n                $_.DvsName -eq $vdSwitch.Name\n            }\n        }\n\n        $addedVMHost = $this.VMHost.ExtensionData.Config.Network.ProxySwitch | Where-Object @whereObjectParams\n        if ($null -eq $addedVMHost) {\n            throw ($this.VMHostIsNotAddedToVDSwitchMessage -f $this.VMHost.Name, $vdSwitch.Name)\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssNic : VMHostNicBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the name of the Virtual Switch to which the VMKernel Network Adapter should be connected.\n    #>\n    [DscProperty(Key)]\n    [string] $VssName\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $vmHostNetworkAdapter = $this.GetVMHostNetworkAdapter($virtualSwitch)\n\n            if ($null -ne $vmHostNetworkAdapter) {\n                <#\n                Here the retrieval of the VMKernel is done for the second time because retrieving it\n                by Virtual Switch and Port Group produces errors when trying to update or delete it.\n                The errors do not occur when the retrieval is done by Name.\n                #>\n                $vmHostNetworkAdapter = Get-VMHostNetworkAdapter -Server $this.Connection -Name $vmHostNetworkAdapter.Name -VMHost $this.VMHost -VMKernel\n            }\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostNetworkAdapter) {\n                    $vmHostNetworkAdapter = $this.AddVMHostNetworkAdapter($virtualSwitch, $null)\n                }\n\n                if ($this.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)) {\n                    $this.UpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n                }\n            }\n            else {\n                if ($null -ne $vmHostNetworkAdapter) {\n                    $this.RemoveVMHostNetworkAdapter($vmHostNetworkAdapter)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $vmHostNetworkAdapter = $this.GetVMHostNetworkAdapter($virtualSwitch)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostNetworkAdapter) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateVMHostNetworkAdapter($vmHostNetworkAdapter)\n                }\n            }\n            else {\n                $result = ($null -eq $vmHostNetworkAdapter)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssNic] Get() {\n        try {\n            $result = [VMHostVssNic]::new()\n\n            $this.ConnectVIServer()\n            $this.RetrieveVMHost()\n\n            $virtualSwitch = $this.GetVirtualSwitch()\n            $vmHostNetworkAdapter = $this.GetVMHostNetworkAdapter($virtualSwitch)\n\n            $result.VssName = $virtualSwitch.Name\n            $this.PopulateResult($vmHostNetworkAdapter, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Virtual Switch with the specified name from the server if it exists.\n    The Virtual Switch must be a Standard Virtual Switch. If the Virtual Switch does not exist and Ensure is set to 'Absent', $null is returned.\n    Otherwise it throws an exception.\n    #>\n    [PSObject] GetVirtualSwitch() {\n        if ($this.Ensure -eq [Ensure]::Absent) {\n            return Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction SilentlyContinue\n        }\n        else {\n            try {\n                $virtualSwitch = Get-VirtualSwitch -Server $this.Connection -Name $this.VssName -VMHost $this.VMHost -Standard -ErrorAction Stop\n                return $virtualSwitch\n            }\n            catch {\n                throw \"Could not retrieve Virtual Switch $($this.VssName) of VMHost $($this.VMHost.Name). For more information: $($_.Exception.Message)\"\n            }\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostIPRoute : VMHostBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the gateway IPv4/IPv6 address of the route.\n    #>\n    [DscProperty(Key)]\n    [string] $Gateway\n\n    <#\n    .DESCRIPTION\n\n    Specifies the destination IPv4/IPv6 address of the route.\n    #>\n    [DscProperty(Key)]\n    [string] $Destination\n\n    <#\n    .DESCRIPTION\n\n    Specifies the prefix length of the destination IP address. For IPv4, the valid values are from 0 to 32, and for IPv6 - from 0 to 128.\n    #>\n    [DscProperty(Key)]\n    [int] $PrefixLength\n\n    <#\n    .DESCRIPTION\n\n    Specifies whether the IPv4/IPv6 route should be present or absent.\n    #>\n    [DscProperty(Mandatory = $true)]\n    [Ensure] $Ensure\n\n    hidden [string] $CreateVMHostIPRouteMessage = \"Creating IP Route with Gateway address {0} and Destination address {1} on VMHost {2}.\"\n    hidden [string] $RemoveVMHostIPRouteMessage = \"Removing IP Route with Gateway address {0} and Destination address {1} on VMHost {2}.\"\n\n    hidden [string] $CouldNotCreateVMHostIPRouteMessage = \"Could not create IP Route with Gateway address {0} and Destination address {1} on VMHost {2}. For more information: {3}\"\n    hidden [string] $CouldNotRemoveVMHostIPRouteMessage = \"Could not remove IP Route with Gateway address {0} and Destination address {1} on VMHost {2}. For more information: {3}\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.SetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostIPRoute = $this.GetVMHostIPRoute($vmHost)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $vmHostIPRoute) {\n                    $this.NewVMHostIPRoute($vmHost)\n                }\n            }\n            else {\n                if ($null -ne $vmHostIPRoute) {\n                    $this.RemoveVMHostIPRoute($vmHostIPRoute)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.SetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.TestMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostIPRoute = $this.GetVMHostIPRoute($vmHost)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vmHostIPRoute)\n            }\n            else {\n                $result = ($null -eq $vmHostIPRoute)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.TestMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    [VMHostIPRoute] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', $this.GetMethodStartMessage, @($this.DscResourceName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostIPRoute]::new()\n\n            $vmHost = $this.GetVMHost()\n            $vmHostIPRoute = $this.GetVMHostIPRoute($vmHost)\n\n            $this.PopulateResult($result, $vmHostIPRoute)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n\n            $this.WriteLogUtil('Verbose', $this.GetMethodEndMessage, @($this.DscResourceName))\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the configured IPv4/IPv6 route with the specified Gateway and Destination addresses if it exists.\n    #>\n    [PSObject] GetVMHostIPRoute($vmHost) {\n        return (Get-VMHostRoute -Server $this.Connection -VMHost $vmHost -ErrorAction SilentlyContinue -Verbose:$false |\n                Where-Object -FilterScript { $_.Gateway -eq $this.Gateway -and $_.Destination -eq $this.Destination -and $_.PrefixLength -eq $this.PrefixLength })\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new IP route with the specified Gateway and Destination addresses.\n    #>\n    [void] NewVMHostIPRoute($vmHost) {\n        $newVMHostRouteParams = @{\n            Server = $this.Connection\n            VMHost = $vmHost\n            Gateway = $this.Gateway\n            Destination = $this.Destination\n            PrefixLength = $this.PrefixLength\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.CreateVMHostIPRouteMessage, @($this.Gateway, $this.Destination, $vmHost.Name))\n\n            New-VMHostRoute @newVMHostRouteParams\n        }\n        catch {\n            throw ($this.CouldNotCreateVMHostIPRouteMessage -f $this.Gateway, $this.Destination, $vmHost.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the IP route with the specified Gateway and Destination addresses.\n    #>\n    [void] RemoveVMHostIPRoute($vmHostIPRoute) {\n        $removeVMHostRouteParams = @{\n            VMHostRoute = $vmHostIPRoute\n            Confirm = $false\n            ErrorAction = 'Stop'\n            Verbose = $false\n        }\n\n        try {\n            $this.WriteLogUtil('Verbose', $this.RemoveVMHostIPRouteMessage, @($this.Gateway, $this.Destination, $this.Name))\n\n            Remove-VMHostRoute @removeVMHostRouteParams\n        }\n        catch {\n            throw ($this.CouldNotRemoveVMHostIPRouteMessage -f $this.Gateway, $this.Destination, $this.Name, $_.Exception.Message)\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get method.\n    #>\n    [void] PopulateResult($result, $vmHostIPRoute) {\n        $result.Server = $this.Connection.Name\n        $result.Name = $this.Name\n\n        if ($null -ne $vmHostIPRoute) {\n            $result.Ensure = [Ensure]::Present\n            $result.Gateway = $vmHostIPRoute.Gateway\n            $result.Destination = $vmHostIPRoute.Destination\n            $result.PrefixLength = $vmHostIPRoute.PrefixLength\n        }\n        else {\n            $result.Ensure = [Ensure]::Absent\n            $result.Gateway = $this.Gateway\n            $result.Destination = $this.Destination\n            $result.PrefixLength = $this.PrefixLength\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostGraphics : VMHostGraphicsBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the default graphics type for the specified VMHost.\n    #>\n    [DscProperty(Mandatory)]\n    [GraphicsType] $GraphicsType\n\n    <#\n    .DESCRIPTION\n\n    Specifies the policy for assigning shared passthrough VMs to a host graphics device.\n    #>\n    [DscProperty(Mandatory)]\n    [SharedPassthruAssignmentPolicy] $SharedPassthruAssignmentPolicy\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            $this.EnsureVMHostIsInMaintenanceMode($vmHost)\n            $this.UpdateGraphicsConfiguration($vmHostGraphicsManager)\n            $this.RestartVMHost($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            return !$this.ShouldUpdateGraphicsConfiguration($vmHostGraphicsManager)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostGraphics] Get() {\n        try {\n            $result = [VMHostGraphics]::new()\n            $result.Server = $this.Server\n            $result.RestartTimeoutMinutes = $this.RestartTimeoutMinutes\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            $result.Name = $vmHost.Name\n            $result.GraphicsType = $vmHostGraphicsManager.GraphicsConfig.HostDefaultGraphicsType\n            $result.SharedPassthruAssignmentPolicy = $vmHostGraphicsManager.GraphicsConfig.SharedPassthruAssignmentPolicy\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Graphics Configuration needs to be updated with the desired values.\n    #>\n    [bool] ShouldUpdateGraphicsConfiguration($vmHostGraphicsManager) {\n        $shouldUpdateGraphicsConfiguration = @(\n            $this.ShouldUpdateDscResourceSetting(\n                'GraphicsType',\n                [string] $vmHostGraphicsManager.GraphicsConfig.HostDefaultGraphicsType,\n                $this.GraphicsType.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'SharedPassthruAssignmentPolicy',\n                [string] $vmHostGraphicsManager.GraphicsConfig.SharedPassthruAssignmentPolicy,\n                $this.SharedPassthruAssignmentPolicy.ToString()\n            )\n        )\n\n        return ($shouldUpdateGraphicsConfiguration -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Graphics Configuration of the specified VMHost.\n    #>\n    [void] UpdateGraphicsConfiguration($vmHostGraphicsManager) {\n        $vmHostGraphicsConfig = New-Object VMware.Vim.HostGraphicsConfig\n\n        $vmHostGraphicsConfig.HostDefaultGraphicsType = $this.ConvertEnumValueToServerValue($this.GraphicsType)\n        $vmHostGraphicsConfig.SharedPassthruAssignmentPolicy = $this.ConvertEnumValueToServerValue($this.SharedPassthruAssignmentPolicy)\n\n        try {\n            Update-GraphicsConfig -VMHostGraphicsManager $vmHostGraphicsManager -VMHostGraphicsConfig $vmHostGraphicsConfig\n        }\n        catch {\n            throw \"The Graphics Configuration of VMHost $($this.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostGraphicsDevice : VMHostGraphicsBaseDSC {\n    <#\n    .DESCRIPTION\n\n    Specifies the Graphics device identifier (ex. PCI ID).\n    #>\n    [DscProperty(Key)]\n    [string] $Id\n\n    <#\n    .DESCRIPTION\n\n    Specifies the graphics type for the specified Device in 'Id' property.\n    #>\n    [DscProperty(Mandatory)]\n    [GraphicsType] $GraphicsType\n\n    [void] Set() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n\n            $this.EnsureVMHostIsInMaintenanceMode($vmHost)\n            $this.UpdateGraphicsConfiguration($vmHostGraphicsManager)\n            $this.RestartVMHost($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n    \ttry {\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n            $foundDevice = $this.GetGraphicsDevice($vmHostGraphicsManager)\n\n            $result = !$this.ShouldUpdateDscResourceSetting(\n                'GraphicsType',\n                [string] $foundDevice.GraphicsType,\n                $this.GraphicsType.ToString()\n            )\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostGraphicsDevice] Get() {\n        try {\n            $result = [VMHostGraphicsDevice]::new()\n            $result.Server = $this.Server\n            $result.RestartTimeoutMinutes = $this.RestartTimeoutMinutes\n\n            $this.ConnectVIServer()\n            $vmHost = $this.GetVMHost()\n            $vmHostGraphicsManager = $this.GetVMHostGraphicsManager($vmHost)\n            $foundDevice = $this.GetGraphicsDevice($vmHostGraphicsManager)\n\n            $result.Name = $vmHost.Name\n            $result.Id = $foundDevice.DeviceId\n            $result.GraphicsType = $foundDevice.GraphicsType\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Retrieves the Graphics Device with the specified Id from the server.\n    #>\n    [PSObject] GetGraphicsDevice($vmHostGraphicsManager) {\n        $foundDevice = $vmHostGraphicsManager.GraphicsConfig.DeviceType | Where-Object { $_.DeviceId -eq $this.Id }\n        if ($null -eq $foundDevice) {\n            throw \"Device $($this.Id) was not found in the available Graphics devices.\"\n        }\n\n        return $foundDevice\n    }\n\n    <#\n    .DESCRIPTION\n\n    Performs an update on the Graphics Configuration of the specified VMHost by changing the Graphics Type for the\n    specified Device.\n    #>\n    [void] UpdateGraphicsConfiguration($vmHostGraphicsManager) {\n        $vmHostGraphicsConfig = New-Object VMware.Vim.HostGraphicsConfig\n\n        $vmHostGraphicsConfig.HostDefaultGraphicsType = $vmHostGraphicsManager.GraphicsConfig.HostDefaultGraphicsType\n        $vmHostGraphicsConfig.SharedPassthruAssignmentPolicy = $vmHostGraphicsManager.GraphicsConfig.SharedPassthruAssignmentPolicy\n        $vmHostGraphicsConfig.DeviceType = @()\n\n        $vmHostGraphicsConfigDeviceType = New-Object VMware.Vim.HostGraphicsConfigDeviceType\n        $vmHostGraphicsConfigDeviceType.DeviceId = $this.Id\n        $vmHostGraphicsConfigDeviceType.GraphicsType = $this.ConvertEnumValueToServerValue($this.GraphicsType)\n\n        $vmHostGraphicsConfig.DeviceType += $vmHostGraphicsConfigDeviceType\n\n        try {\n            Update-GraphicsConfig -VMHostGraphicsManager $vmHostGraphicsManager -VMHostGraphicsConfig $vmHostGraphicsConfig\n        }\n        catch {\n            throw \"The Graphics Configuration of VMHost $($this.Name) could not be updated: $($_.Exception.Message)\"\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVss : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The maximum transmission unit (MTU) associated with this virtual switch in bytes.\n    #>\n    [DscProperty()]\n    [nullable[int]] $Mtu\n\n    <#\n    .DESCRIPTION\n\n    The virtual switch key.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string] $Key\n\n    <#\n    .DESCRIPTION\n\n    The number of ports that this virtual switch currently has.\n    #>\n    [DscProperty(NotConfigurable)]\n    [int] $NumPorts\n\n    <#\n    .DESCRIPTION\n\n    The number of ports that are available on this virtual switch.\n    #>\n    [DscProperty(NotConfigurable)]\n    [int] $NumPortsAvailable\n\n    <#\n    .DESCRIPTION\n\n    The set of physical network adapters associated with this bridge.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string[]] $Pnic\n\n    <#\n    .DESCRIPTION\n\n    The list of port groups configured for this virtual switch.\n    #>\n    [DscProperty(NotConfigurable)]\n    [string[]] $PortGroup\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n            \n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVss($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $result = ($null -eq $vss)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVss] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VMHostVss]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.Key) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVss should be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssTest = @(\n            $this.ShouldUpdateDscResourceSetting('VssName', $vss.Name, $this.VssName),\n            $this.ShouldUpdateDscResourceSetting('Mtu', $vss.Mtu, $this.Mtu)\n        )\n\n        return ($vssTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVss($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssConfigArgs = @{\n            Name = $this.VssName\n            Mtu = $this.Mtu\n        }\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($null -ne $vss) {\n                if ($this.Equals($vss)) {\n                    return\n                }\n                $vssConfigArgs.Add('Operation', 'edit')\n            }\n            else {\n                $vssConfigArgs.Add('Operation', 'add')\n            }\n        }\n        else {\n            if ($null -eq $vss) {\n                return\n            }\n            $vssConfigArgs.Add('Operation', 'remove')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssConfig $vssConfigArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the virtual switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSS) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSS.Key = $currentVss.Key\n            $vmHostVSS.Mtu = $currentVss.Mtu\n            $vmHostVSS.VssName = $currentVss.Name\n            $vmHostVSS.NumPortsAvailable = $currentVss.NumPortsAvailable\n            $vmHostVSS.Pnic = $currentVss.Pnic\n            $vmHostVSS.PortGroup = $currentVss.PortGroup\n        }\n        else{\n            $vmHostVSS.Key = [string]::Empty\n            $vmHostVSS.Mtu = $this.Mtu\n            $vmHostVSS.VssName = $this.VssName\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssBridge : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The list of keys of the physical network adapters to be bridged.\n    #>\n    [DscProperty()]\n    [string[]] $NicDevice\n\n    <#\n    .DESCRIPTION\n\n    The beacon configuration to probe for the validity of a link.\n    If this is set, beacon probing is configured and will be used.\n    If this is not set, beacon probing is disabled.\n    Determines how often, in seconds, a beacon should be sent.\n    #>\n    [DscProperty()]\n    [nullable[int]] $BeaconInterval\n\n    <#\n    .DESCRIPTION\n\n    The link discovery protocol, whether to advertise or listen.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolOperation] $LinkDiscoveryProtocolOperation = [LinkDiscoveryProtocolOperation]::Unset\n\n    <#\n    .DESCRIPTION\n\n    The link discovery protocol type.\n    #>\n    [DscProperty()]\n    [LinkDiscoveryProtocolProtocol] $LinkDiscoveryProtocolProtocol = [LinkDiscoveryProtocolProtocol]::Unset\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssBridge($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.NicDevice = @()\n                $this.BeaconInterval = 0\n                $this.LinkDiscoveryProtocolProtocol = [LinkDiscoveryProtocolProtocol]::Unset\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssBridge] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VMHostVssBridge]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssBridge should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssBridgeTest = @(\n            $this.ShouldUpdateArraySetting('NicDevice', $vss.Spec.Bridge.NicDevice, $this.NicDevice),\n            $this.ShouldUpdateDscResourceSetting('BeaconInterval', $vss.Spec.Bridge.Beacon.Interval, $this.BeaconInterval),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocolProtocol',\n                [string] $vss.Spec.Bridge.LinkDiscoveryProtocolConfig.Protocol,\n                $this.LinkDiscoveryProtocolProtocol.ToString()\n            ),\n            $this.ShouldUpdateDscResourceSetting(\n                'LinkDiscoveryProtocolOperation',\n                [string] $vss.Spec.Bridge.LinkDiscoveryProtocolConfig.Operation,\n                $this.LinkDiscoveryProtocolOperation.ToString()\n            )\n        )\n\n        return ($vssBridgeTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Bridge configuration of the virtual switch.\n    #>\n    [void] UpdateVssBridge($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssBridgeArgs = @{\n            Name = $this.VssName\n            NicDevice = $this.NicDevice\n        }\n\n        # The Bridge configuration of the Standard Switch should be populated only when the Nic devices are passed.\n        if ($this.NicDevice.Count -gt 0) {\n            if ($null -ne $this.BeaconInterval) { $vssBridgeArgs.BeaconInterval = $this.BeaconInterval }\n            if ($this.LinkDiscoveryProtocolProtocol -ne [LinkDiscoveryProtocolProtocol]::Unset) {\n                $vssBridgeArgs.Add('LinkDiscoveryProtocolProtocol', $this.LinkDiscoveryProtocolProtocol.ToString())\n                $vssBridgeArgs.Add('LinkDiscoveryProtocolOperation', $this.LinkDiscoveryProtocolOperation.ToString())\n            }\n        }\n\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n        }\n        else {\n            $vssBridgeArgs.NicDevice = @()\n        }\n        $vssBridgeArgs.Add('Operation', 'edit')\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssBridgeConfig $vssBridgeArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Bridge Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Bridge settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSBridge) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSBridge.VssName = $currentVss.Name\n            $vmHostVSSBridge.NicDevice = $currentVss.Spec.Bridge.NicDevice\n            $vmHostVSSBridge.BeaconInterval = $currentVss.Spec.Bridge.Beacon.Interval\n\n            if ($null -ne $currentVss.Spec.Bridge.linkDiscoveryProtocolConfig) {\n                $vmHostVSSBridge.LinkDiscoveryProtocolOperation = $currentVss.Spec.Bridge.LinkDiscoveryProtocolConfig.Operation.ToString()\n                $vmHostVSSBridge.LinkDiscoveryProtocolProtocol = $currentVss.Spec.Bridge.LinkDiscoveryProtocolConfig.Protocol.ToString()\n            }\n        }\n        else {\n            $vmHostVSSBridge.VssName = $this.VssName\n            $vmHostVSSBridge.NicDevice = $this.NicDevice\n            $vmHostVSSBridge.BeaconInterval = $this.BeaconInterval\n            $vmHostVSSBridge.LinkDiscoveryProtocolOperation = $this.LinkDiscoveryProtocolOperation\n            $vmHostVSSBridge.LinkDiscoveryProtocolProtocol = $this.LinkDiscoveryProtocolProtocol\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssSecurity : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not all traffic is seen on the port.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $AllowPromiscuous\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not the virtual network adapter should be\n    allowed to send network traffic with a different MAC address than that of\n    the virtual network adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $ForgedTransmits\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not the Media Access Control (MAC) address\n    can be changed.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $MacChanges\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssSecurity($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.AllowPromiscuous = $false\n                $this.ForgedTransmits = $true\n                $this.MacChanges = $true\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssSecurity] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n            \n            $this.ConnectVIServer()\n\n            $result = [VMHostVssSecurity]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssSecurity should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssSecurityTest = @(\n            $this.ShouldUpdateDscResourceSetting('AllowPromiscuous', $vss.Spec.Policy.Security.AllowPromiscuous, $this.AllowPromiscuous),\n            $this.ShouldUpdateDscResourceSetting('ForgedTransmits', $vss.Spec.Policy.Security.ForgedTransmits, $this.ForgedTransmits),\n            $this.ShouldUpdateDscResourceSetting('MacChanges', $vss.Spec.Policy.Security.MacChanges, $this.MacChanges)\n        )\n\n        return ($vssSecurityTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVssSecurity($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssSecurityArgs = @{\n            Name = $this.VssName\n            AllowPromiscuous = $this.AllowPromiscuous\n            ForgedTransmits = $this.ForgedTransmits\n            MacChanges = $this.MacChanges\n        }\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n            $vssSecurityArgs.Add('Operation', 'edit')\n        }\n        else {\n            $vssSecurityArgs.AllowPromiscuous = $false\n            $vssSecurityArgs.ForgedTransmits = $true\n            $vssSecurityArgs.MacChanges = $true\n            $vssSecurityArgs.Add('Operation', 'edit')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssSecurityConfig $vssSecurityArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Security Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSSecurity) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSSecurity.VssName = $currentVss.Name\n            $vmHostVSSSecurity.AllowPromiscuous = $currentVss.Spec.Policy.Security.AllowPromiscuous\n            $vmHostVSSSecurity.ForgedTransmits = $currentVss.Spec.Policy.Security.ForgedTransmits\n            $vmHostVSSSecurity.MacChanges = $currentVss.Spec.Policy.Security.MacChanges\n        }\n        else {\n            $vmHostVSSSecurity.VssName = $this.VssName\n            $vmHostVSSSecurity.AllowPromiscuous = $this.AllowPromiscuous\n            $vmHostVSSSecurity.ForgedTransmits = $this.ForgedTransmits\n            $vmHostVSSSecurity.MacChanges = $this.MacChanges\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssShaping : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The average bandwidth in bits per second if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $AverageBandwidth\n\n    <#\n    .DESCRIPTION\n\n    The maximum burst size allowed in bytes if shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $BurstSize\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not traffic shaper is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $Enabled\n\n    <#\n    .DESCRIPTION\n\n    The peak bandwidth during bursts in bits per second if traffic shaping is enabled on the port.\n    #>\n    [DscProperty()]\n    [nullable[long]] $PeakBandwidth\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssShaping($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.AverageBandwidth = 100000\n                $this.BurstSize = 100000\n                $this.Enabled = $false\n                $this.PeakBandwidth = 100000\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssShaping] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVssShaping]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssShaping should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssShapingTest = @(\n            $this.ShouldUpdateDscResourceSetting('AverageBandwidth', $vss.Spec.Policy.ShapingPolicy.AverageBandwidth, $this.AverageBandwidth),\n            $this.ShouldUpdateDscResourceSetting('BurstSize', $vss.Spec.Policy.ShapingPolicy.BurstSize, $this.BurstSize),\n            $this.ShouldUpdateDscResourceSetting('Enabled', $vss.Spec.Policy.ShapingPolicy.Enabled, $this.Enabled),\n            $this.ShouldUpdateDscResourceSetting('PeakBandwidth', $vss.Spec.Policy.ShapingPolicy.PeakBandwidth, $this.PeakBandwidth)\n        )\n\n        return ($vssShapingTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVssShaping($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssShapingArgs = @{\n            Name = $this.VssName\n            AverageBandwidth = $this.AverageBandwidth\n            BurstSize = $this.BurstSize\n            Enabled = $this.Enabled\n            PeakBandwidth = $this.PeakBandwidth\n        }\n        $vss = $this.GetVss()\n\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n            $vssShapingArgs.Add('Operation', 'edit')\n        }\n        else {\n            $vssShapingArgs.AverageBandwidth = 100000\n            $vssShapingArgs.BurstSize = 100000\n            $vssShapingArgs.Enabled = $false\n            $vssShapingArgs.PeakBandwidth = 100000\n            $vssShapingArgs.Add('Operation', 'edit')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssShapingConfig $vssShapingArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Shaping Policy Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSShaping) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSShaping.VssName = $currentVss.Name\n            $vmHostVSSShaping.AverageBandwidth = $currentVss.Spec.Policy.ShapingPolicy.AverageBandwidth\n            $vmHostVSSShaping.BurstSize = $currentVss.Spec.Policy.ShapingPolicy.BurstSize\n            $vmHostVSSShaping.Enabled = $currentVss.Spec.Policy.ShapingPolicy.Enabled\n            $vmHostVSSShaping.PeakBandwidth = $currentVss.Spec.Policy.ShapingPolicy.PeakBandwidth\n        }\n        else {\n            $vmHostVSSShaping.VssName = $this.Name\n            $vmHostVSSShaping.AverageBandwidth = $this.AverageBandwidth\n            $vmHostVSSShaping.BurstSize = $this.BurstSize\n            $vmHostVSSShaping.Enabled = $this.Enabled\n            $vmHostVSSShaping.PeakBandwidth = $this.PeakBandwidth\n        }\n    }\n}\n\n[DscResource()]\nclass VMHostVssTeaming : VMHostVssBaseDSC {\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not to enable beacon probing\n    as a method to validate the link status of a physical network adapter.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $CheckBeacon\n\n    <#\n    .DESCRIPTION\n\n    List of active network adapters used for load balancing.\n    #>\n    [DscProperty()]\n    [string[]] $ActiveNic\n\n    <#\n    .DESCRIPTION\n\n    Standby network adapters used for failover.\n    #>\n    [DscProperty()]\n    [string[]] $StandbyNic\n\n    <#\n    .DESCRIPTION\n\n    Flag to specify whether or not to notify the physical switch if a link fails.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $NotifySwitches\n\n    <#\n    .DESCRIPTION\n\n    Network adapter teaming policy.\n    #>\n    [DscProperty()]\n    [NicTeamingPolicy] $Policy = [NicTeamingPolicy]::Unset\n\n    <#\n    .DESCRIPTION\n\n    The flag to indicate whether or not to use a rolling policy when restoring links.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $RollingOrder\n\n    hidden [string] $PhysicalNicNotInBridgeMessage = \"Physical network adapter {0} is not in the bridge with standard switch {1}.\"\n\n    [void] Set() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $this.UpdateVssTeaming($vmHost)\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n            $vss = $this.GetVss()\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                $result = ($null -ne $vss -and $this.Equals($vss))\n            }\n            else {\n                $this.CheckBeacon = $false\n                $this.ActiveNic = @()\n                $this.StandbyNic = @()\n                $this.NotifySwitches = $true\n                $this.Policy = [NicTeamingPolicy]::Loadbalance_srcid\n                $this.RollingOrder = $false\n\n                $result = ($null -eq $vss -or $this.Equals($vss))\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [VMHostVssTeaming] Get() {\n        try {\n            $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n            $this.ConnectVIServer()\n\n            $result = [VMHostVssTeaming]::new()\n            $result.Server = $this.Server\n\n            $vmHost = $this.GetVMHost()\n            $this.GetNetworkSystem($vmHost)\n\n            $result.Name = $vmHost.Name\n            $this.PopulateResult($vmHost, $result)\n\n            $result.Ensure = if ([string]::Empty -ne $result.VssName) { 'Present' } else { 'Absent' }\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns a boolean value indicating if the VMHostVssTeaming should to be updated.\n    #>\n    [bool] Equals($vss) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $vssTeamingTest = @(\n            $this.ShouldUpdateDscResourceSetting('CheckBeacon', $vss.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon, $this.CheckBeacon),\n            $this.ShouldUpdateDscResourceSetting('NotifySwitches', $vss.Spec.Policy.NicTeaming.NotifySwitches, $this.NotifySwitches),\n            $this.ShouldUpdateDscResourceSetting('RollingOrder', $vss.Spec.Policy.NicTeaming.RollingOrder, $this.RollingOrder),\n            $this.ShouldUpdateDscResourceSetting('Policy', [string] $vss.Spec.Policy.NicTeaming.Policy, $this.Policy.ToString().ToLower()),\n            $this.ShouldUpdateArraySetting('ActiveNic', $vss.Spec.Policy.NicTeaming.NicOrder.ActiveNic, $this.ActiveNic),\n            $this.ShouldUpdateArraySetting('StandbyNic', $vss.Spec.Policy.NicTeaming.NicOrder.StandbyNic, $this.StandbyNic)\n        )\n\n        return ($vssTeamingTest -NotContains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Validates that all provided physical network adapters: (ActiveNic and StandbyNic) are in the bridge\n    with the specified standard switch.\n    #>\n    [void] ValidatePhysicalNetworkAdapters() {\n        $physicalNics = $this.ActiveNic + $this.StandbyNic\n\n        if ($physicalNics.Length -gt 0) {\n            $standardSwitch = $this.GetVss()\n            foreach ($physicalNic in $physicalNics) {\n                if (!($standardSwitch.Spec.Bridge.NicDevice -Contains $physicalNic)) {\n                    throw ($this.PhysicalNicNotInBridgeMessage -f $physicalNic, $standardSwitch.Name)\n                }\n            }\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the configuration of the virtual switch.\n    #>\n    [void] UpdateVssTeaming($vmHost) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $this.ValidatePhysicalNetworkAdapters()\n\n        $vssTeamingArgs = @{\n            Name = $this.VssName\n            ActiveNic = $this.ActiveNic\n            StandbyNic = $this.StandbyNic\n            NotifySwitches = $this.NotifySwitches\n            RollingOrder = $this.RollingOrder\n        }\n\n        if ($null -ne $this.CheckBeacon) { $vssTeamingArgs.CheckBeacon = $this.CheckBeacon }\n        if ($this.Policy -ne [NicTeamingPolicy]::Unset) { $vssTeamingArgs.Policy = $this.Policy.ToString().ToLower() }\n\n        $vss = $this.GetVss()\n        if ($this.Ensure -eq 'Present') {\n            if ($this.Equals($vss)) {\n                return\n            }\n            $vssTeamingArgs.Add('Operation', 'edit')\n        }\n        else {\n            $vssTeamingArgs.CheckBeacon = $false\n            $vssTeamingArgs.ActiveNic = @()\n            $vssTeamingArgs.StandbyNic = @()\n            $vssTeamingArgs.NotifySwitches = $true\n            $vssTeamingArgs.Policy = ([NicTeamingPolicy]::Loadbalance_srcid).ToString().ToLower()\n            $vssTeamingArgs.RollingOrder = $false\n            $vssTeamingArgs.Add('Operation', 'edit')\n        }\n\n        try {\n            Update-Network -NetworkSystem $this.vmHostNetworkSystem -VssTeamingConfig $vssTeamingArgs -ErrorAction Stop\n        }\n        catch {\n            throw \"The Virtual Switch Teaming Policy Config could not be updated: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Security settings of the Virtual Switch.\n    #>\n    [void] PopulateResult($vmHost, $vmHostVSSTeaming) {\n        $this.WriteLogUtil('Verbose', \"{0} Entering {1}\", @((Get-Date), (Get-PSCallStack)[0].FunctionName))\n\n        $currentVss = $this.GetVss()\n\n        if ($null -ne $currentVss) {\n            $vmHostVSSTeaming.VssName = $currentVss.Name\n            $vmHostVSSTeaming.CheckBeacon = $currentVss.Spec.Policy.NicTeaming.FailureCriteria.CheckBeacon\n            $vmHostVSSTeaming.ActiveNic = $currentVss.Spec.Policy.NicTeaming.NicOrder.ActiveNic\n            $vmHostVSSTeaming.StandbyNic = $currentVss.Spec.Policy.NicTeaming.NicOrder.StandbyNic\n            $vmHostVSSTeaming.NotifySwitches = $currentVss.Spec.Policy.NicTeaming.NotifySwitches\n            $vmHostVSSTeaming.Policy = [NicTeamingPolicy]$currentVss.Spec.Policy.NicTeaming.Policy\n            $vmHostVSSTeaming.RollingOrder = $currentVss.Spec.Policy.NicTeaming.RollingOrder\n        }\n        else {\n            $vmHostVSSTeaming.VssName = $this.Name\n            $vmHostVSSTeaming.CheckBeacon = $this.CheckBeacon\n            $vmHostVSSTeaming.ActiveNic = $this.ActiveNic\n            $vmHostVSSTeaming.StandbyNic = $this.StandbyNic\n            $vmHostVSSTeaming.NotifySwitches = $this.NotifySwitches\n            $vmHostVSSTeaming.Policy = $this.Policy\n            $vmHostVSSTeaming.RollingOrder = $this.RollingOrder\n        }\n    }\n}\n\n[DscResource()]\nclass DrsCluster : DatacenterInventoryBaseDSC {\n    DrsCluster() {\n        $this.InventoryItemFolderType = [FolderType]::Host\n    }\n\n    <#\n    .DESCRIPTION\n\n    Indicates that VMware DRS (Distributed Resource Scheduler) is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $DrsEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies a DRS (Distributed Resource Scheduler) automation level. The valid values are FullyAutomated, Manual, PartiallyAutomated, Disabled and Unset.\n    #>\n    [DscProperty()]\n    [DrsAutomationLevel] $DrsAutomationLevel = [DrsAutomationLevel]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Threshold for generated ClusterRecommendations. DRS generates only those recommendations that are above the specified vmotionRate. Ratings vary from 1 to 5.\n    This setting applies to Manual, PartiallyAutomated, and FullyAutomated DRS Clusters.\n    #>\n    [DscProperty()]\n    [nullable[int]] $DrsMigrationThreshold\n\n    <#\n    .DESCRIPTION\n\n    For availability, distributes a more even number of virtual machines across hosts.\n    #>\n    [DscProperty()]\n    [nullable[int]] $DrsDistribution\n\n    <#\n    .DESCRIPTION\n\n    Load balance based on consumed memory of virtual machines rather than active memory.\n    This setting is recommended for clusters where host memory is not over-committed.\n    #>\n    [DscProperty()]\n    [nullable[int]] $MemoryLoadBalancing\n\n    <#\n    .DESCRIPTION\n\n    Controls CPU over-commitment in the cluster.\n    Min value is 0 and Max value is 500.\n    #>\n    [DscProperty()]\n    [nullable[int]] $CPUOverCommitment\n\n    hidden [string] $DrsEnabledConfigPropertyName = 'Enabled'\n    hidden [string] $DrsAutomationLevelConfigPropertyName = 'DefaultVmBehavior'\n    hidden [string] $DrsMigrationThresholdConfigPropertyName = 'VmotionRate'\n    hidden [string] $DrsDistributionSettingName = 'LimitVMsPerESXHostPercent'\n    hidden [string] $MemoryLoadBalancingSettingName = 'PercentIdleMBInMemDemand'\n    hidden [string] $CPUOverCommitmentSettingName = 'MaxVcpusPerClusterPct'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $this.AddCluster($clusterLocation)\n                }\n                else {\n                    $this.UpdateCluster($cluster)\n                }\n            }\n            else {\n                if ($null -ne $cluster) {\n                    $this.RemoveCluster($cluster)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateCluster($cluster)\n                }\n            }\n            else {\n                $result = ($null -eq $cluster)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [DrsCluster] Get() {\n        try {\n            $result = [DrsCluster]::new()\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $this.PopulateResult($cluster, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Cluster should be updated.\n    #>\n    [bool] ShouldUpdateCluster($cluster) {\n        $drsConfig = $cluster.ExtensionData.ConfigurationEx.DrsConfig\n\n        $currentDrsDistributionOption = ($drsConfig.Option | Where-Object -FilterScript { $_.Key -eq $this.DrsDistributionSettingName }).Value\n        $currentMemoryLoadBalancingOption = ($drsConfig.Option | Where-Object -FilterScript { $_.Key -eq $this.MemoryLoadBalancingSettingName }).Value\n        $currentCPUOverCommitmentOption = ($drsConfig.Option | Where-Object -FilterScript { $_.Key -eq $this.CPUOverCommitmentSettingName }).Value\n\n        $shouldUpdateCluster = @(\n            $this.ShouldUpdateDscResourceSetting('DrsEnabled', $drsConfig.Enabled, $this.DrsEnabled),\n            $this.ShouldUpdateDscResourceSetting('DrsAutomationLevel', [string] $drsConfig.DefaultVmBehavior, $this.DrsAutomationLevel.ToString()),\n            $this.ShouldUpdateDscResourceSetting('DrsMigrationThreshold', $drsConfig.VmotionRate, $this.DrsMigrationThreshold),\n            $this.ShouldUpdateDscResourceSetting('DrsDistribution', $currentDrsDistributionOption, $this.DrsDistribution),\n            $this.ShouldUpdateDscResourceSetting('MemoryLoadBalancing', $currentMemoryLoadBalancingOption, $this.MemoryLoadBalancing),\n            $this.ShouldUpdateDscResourceSetting('CPUOverCommitment', $currentCPUOverCommitmentOption, $this.CPUOverCommitment)\n        )\n\n        return ($shouldUpdateCluster -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the DrsConfig property with the desired value.\n    #>\n    [void] PopulateDrsConfigProperty($drsConfig, $propertyName, $propertyValue) {\n        <#\n            Special case where the passed property value is enum type. These type of properties\n            should be populated only when their value is not equal to Unset.\n            Unset means that the property was not specified in the Configuration.\n        #>\n        if ($propertyValue -is [DrsAutomationLevel]) {\n            if ($propertyValue -ne [DrsAutomationLevel]::Unset) {\n                $drsConfig.$propertyName = $propertyValue.ToString()\n            }\n        }\n        elseif ($null -ne $propertyValue) {\n            $drsConfig.$propertyName = $propertyValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the Option array for the DrsConfig with the specified options in the Configuration.\n    #>\n    [PSObject] GetOptionsForDrsConfig($allOptions) {\n        $drsConfigOptions = @()\n\n        foreach ($key in $allOptions.Keys) {\n            if ($null -ne $allOptions.$key) {\n                $option = New-Object VMware.Vim.OptionValue\n\n                $option.Key = $key\n                $option.Value = $allOptions.$key.ToString()\n\n                $drsConfigOptions += $option\n            }\n        }\n\n        return $drsConfigOptions\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Cluster Spec with the specified values in the Configuration.\n    #>\n    [PSObject] GetPopulatedClusterSpec() {\n        $clusterSpec = New-Object VMware.Vim.ClusterConfigSpecEx\n        $clusterSpec.DrsConfig = New-Object VMware.Vim.ClusterDrsConfigInfo\n\n        $this.PopulateDrsConfigProperty($clusterSpec.DrsConfig, $this.DrsEnabledConfigPropertyName, $this.DrsEnabled)\n        $this.PopulateDrsConfigProperty($clusterSpec.DrsConfig, $this.DrsAutomationLevelConfigPropertyName, $this.DrsAutomationLevel)\n        $this.PopulateDrsConfigProperty($clusterSpec.DrsConfig, $this.DrsMigrationThresholdConfigPropertyName, $this.DrsMigrationThreshold)\n\n        $allOptions = [ordered] @{\n            $this.DrsDistributionSettingName = $this.DrsDistribution\n            $this.MemoryLoadBalancingSettingName = $this.MemoryLoadBalancing\n            $this.CPUOverCommitmentSettingName = $this.CPUOverCommitment\n        }\n\n        $clusterSpec.DrsConfig.Option = $this.GetOptionsForDrsConfig($allOptions)\n\n        return $clusterSpec\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Cluster with the specified properties at the specified location.\n    #>\n    [void] AddCluster($clusterLocation) {\n        $clusterSpec = $this.GetPopulatedClusterSpec()\n\n        try {\n            Add-Cluster -Folder $clusterLocation.ExtensionData -Name $this.Name -Spec $clusterSpec\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Cluster with the specified properties.\n    #>\n    [void] UpdateCluster($cluster) {\n        $clusterSpec = $this.GetPopulatedClusterSpec()\n\n        try {\n            Update-ClusterComputeResource -ClusterComputeResource $cluster.ExtensionData -Spec $clusterSpec\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Cluster from the specified Datacenter.\n    #>\n    [void] RemoveCluster($cluster) {\n        try {\n            Remove-ClusterComputeResource -ClusterComputeResource $cluster.ExtensionData\n        }\n        catch {\n            throw \"Server operation failed with the following error: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Cluster from the server.\n    #>\n    [void] PopulateResult($cluster, $result) {\n        if ($null -ne $cluster) {\n            $drsConfig = $cluster.ExtensionData.ConfigurationEx.DrsConfig\n\n            $result.Name = $cluster.Name\n            $result.Ensure = [Ensure]::Present\n            $result.DrsEnabled = $drsConfig.Enabled\n\n            if ($null -eq $drsConfig.DefaultVmBehavior) {\n                $result.DrsAutomationLevel = [DrsAutomationLevel]::Unset\n            }\n            else {\n                $result.DrsAutomationLevel = $drsConfig.DefaultVmBehavior.ToString()\n            }\n\n            $result.DrsMigrationThreshold = $drsConfig.VmotionRate\n\n            if ($null -ne $drsConfig.Option) {\n                $options = $drsConfig.Option\n\n                $result.DrsDistribution = ($options | Where-Object { $_.Key -eq $this.DrsDistributionSettingName }).Value\n                $result.MemoryLoadBalancing = ($options | Where-Object { $_.Key -eq $this.MemoryLoadBalancingSettingName }).Value\n                $result.CPUOverCommitment = ($options | Where-Object { $_.Key -eq $this.CPUOverCommitmentSettingName }).Value\n            }\n            else {\n                $result.DrsDistribution = $null\n                $result.MemoryLoadBalancing = $null\n                $result.CPUOverCommitment = $null\n            }\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.DrsEnabled = $this.DrsEnabled\n            $result.DrsAutomationLevel = $this.DrsAutomationLevel\n            $result.DrsMigrationThreshold = $this.DrsMigrationThreshold\n            $result.DrsDistribution = $this.DrsDistribution\n            $result.MemoryLoadBalancing = $this.MemoryLoadBalancing\n            $result.CPUOverCommitment = $this.CPUOverCommitment\n        }\n    }\n}\n\n[DscResource()]\nclass HACluster : DatacenterInventoryBaseDSC {\n    HACluster() {\n        $this.InventoryItemFolderType = [FolderType]::Host\n    }\n\n    <#\n    .DESCRIPTION\n\n    Indicates that VMware HA (High Availability) is enabled.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HAEnabled\n\n    <#\n    .DESCRIPTION\n\n    Indicates that virtual machines cannot be powered on if they violate availability constraints.\n    #>\n    [DscProperty()]\n    [nullable[bool]] $HAAdmissionControlEnabled\n\n    <#\n    .DESCRIPTION\n\n    Specifies a configured failover level.\n    This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines.\n    The valid values range from 1 to 4.\n    #>\n    [DscProperty()]\n    [nullable[int]] $HAFailoverLevel\n\n    <#\n    .DESCRIPTION\n\n    Indicates that the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource.\n    The valid values are PowerOff, DoNothing, Shutdown and Unset.\n    #>\n    [DscProperty()]\n    [HAIsolationResponse] $HAIsolationResponse = [HAIsolationResponse]::Unset\n\n    <#\n    .DESCRIPTION\n\n    Specifies the cluster HA restart priority. The valid values are Disabled, Low, Medium, High and Unset.\n    VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts.\n    #>\n    [DscProperty()]\n    [HARestartPriority] $HARestartPriority = [HARestartPriority]::Unset\n\n    hidden [string] $HAEnabledParameterName = 'HAEnabled'\n    hidden [string] $HAAdmissionControlEnabledParameterName = 'HAAdmissionControlEnabled'\n    hidden [string] $HAFailoverLevelParameterName = 'HAFailoverLevel'\n    hidden [string] $HAIsolationResponseParameterName = 'HAIsolationResponse'\n    hidden [string] $HARestartPriorityParemeterName = 'HARestartPriority'\n\n    [void] Set() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $this.AddCluster($clusterLocation)\n                }\n                else {\n                    $this.UpdateCluster($cluster)\n                }\n            }\n            else {\n                if ($null -ne $cluster) {\n                    $this.RemoveCluster($cluster)\n                }\n            }\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [bool] Test() {\n        try {\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $result = $null\n            if ($this.Ensure -eq [Ensure]::Present) {\n                if ($null -eq $cluster) {\n                    $result = $false\n                }\n                else {\n                    $result = !$this.ShouldUpdateCluster($cluster)\n                }\n            }\n            else {\n                $result = ($null -eq $cluster)\n            }\n\n            $this.WriteDscResourceState($result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    [HACluster] Get() {\n        try {\n            $result = [HACluster]::new()\n            $result.Server = $this.Server\n            $result.Location = $this.Location\n            $result.DatacenterName = $this.DatacenterName\n            $result.DatacenterLocation = $this.DatacenterLocation\n\n            $this.ConnectVIServer()\n\n            $datacenter = $this.GetDatacenter()\n            $datacenterFolderName = \"$($this.InventoryItemFolderType)Folder\"\n            $clusterLocation = $this.GetInventoryItemLocationInDatacenter($datacenter, $datacenterFolderName)\n            $cluster = $this.GetInventoryItem($clusterLocation)\n\n            $this.PopulateResult($cluster, $result)\n\n            return $result\n        }\n        finally {\n            $this.DisconnectVIServer()\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Checks if the Cluster should be updated.\n    #>\n    [bool] ShouldUpdateCluster($cluster) {\n        $shouldUpdateCluster = @(\n            $this.ShouldUpdateDscResourceSetting('HAEnabled', $cluster.HAEnabled, $this.HAEnabled),\n            $this.ShouldUpdateDscResourceSetting('HAAdmissionControlEnabled', $cluster.HAAdmissionControlEnabled, $this.HAAdmissionControlEnabled),\n            $this.ShouldUpdateDscResourceSetting('HAFailoverLevel', $cluster.HAFailoverLevel, $this.HAFailoverLevel),\n            $this.ShouldUpdateDscResourceSetting('HAIsolationResponse', [string] $cluster.HAIsolationResponse, $this.HAIsolationResponse.ToString()),\n            $this.ShouldUpdateDscResourceSetting('HARestartPriority', [string] $cluster.HARestartPriority, $this.HARestartPriority.ToString())\n        )\n\n        return ($shouldUpdateCluster -Contains $true)\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the parameters for the New-Cluster and Set-Cluster cmdlets.\n    #>\n    [void] PopulateClusterParams($clusterParams, $parameter, $desiredValue) {\n        <#\n            Special case where the desired value is enum type. These type of properties\n            should be added as parameters to the cmdlet only when their value is not equal to Unset.\n            Unset means that the property was not specified in the Configuration.\n        #>\n        if ($desiredValue -is [HAIsolationResponse] -or $desiredValue -is [HARestartPriority]) {\n            if ($desiredValue -ne 'Unset') {\n                $clusterParams.$parameter = $desiredValue.ToString()\n            }\n\n            return\n        }\n\n        if ($null -ne $desiredValue) {\n            $clusterParams.$parameter = $desiredValue\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Returns the populated Cluster parameters.\n    #>\n    [hashtable] GetClusterParams() {\n        $clusterParams = @{}\n\n        $clusterParams.Server = $this.Connection\n        $clusterParams.Confirm = $false\n        $clusterParams.ErrorAction = 'Stop'\n\n        $this.PopulateClusterParams($clusterParams, $this.HAEnabledParameterName, $this.HAEnabled)\n\n        # High Availability settings cannot be passed to the cmdlets if 'HAEnabled' is $false.\n        if ($null -eq $this.HAEnabled -or $this.HAEnabled) {\n            $this.PopulateClusterParams($clusterParams, $this.HAAdmissionControlEnabledParameterName, $this.HAAdmissionControlEnabled)\n            $this.PopulateClusterParams($clusterParams, $this.HAFailoverLevelParameterName, $this.HAFailoverLevel)\n            $this.PopulateClusterParams($clusterParams, $this.HAIsolationResponseParameterName, $this.HAIsolationResponse)\n            $this.PopulateClusterParams($clusterParams, $this.HARestartPriorityParemeterName, $this.HARestartPriority)\n        }\n\n        return $clusterParams\n    }\n\n    <#\n    .DESCRIPTION\n\n    Creates a new Cluster with the specified properties at the specified location.\n    #>\n    [void] AddCluster($clusterLocation) {\n        $clusterParams = $this.GetClusterParams()\n        $clusterParams.Name = $this.Name\n        $clusterParams.Location = $clusterLocation\n\n        try {\n            New-Cluster @clusterParams\n        }\n        catch {\n            throw \"Cannot create Cluster $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Updates the Cluster with the specified properties.\n    #>\n    [void] UpdateCluster($cluster) {\n        $clusterParams = $this.GetClusterParams()\n\n        try {\n            $cluster | Set-Cluster @clusterParams\n        }\n        catch {\n            throw \"Cannot update Cluster $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Removes the Cluster from the specified Datacenter.\n    #>\n    [void] RemoveCluster($cluster) {\n        try {\n            $cluster | Remove-Cluster -Server $this.Connection -Confirm:$false -ErrorAction Stop\n        }\n        catch {\n            throw \"Cannot remove Cluster $($this.Name). For more information: $($_.Exception.Message)\"\n        }\n    }\n\n    <#\n    .DESCRIPTION\n\n    Populates the result returned from the Get() method with the values of the Cluster from the server.\n    #>\n    [void] PopulateResult($cluster, $result) {\n        if ($null -ne $cluster) {\n            $result.Name = $cluster.Name\n            $result.Ensure = [Ensure]::Present\n            $result.HAEnabled = $cluster.HAEnabled\n            $result.HAAdmissionControlEnabled = $cluster.HAAdmissionControlEnabled\n            $result.HAFailoverLevel = $cluster.HAFailoverLevel\n            $result.HAIsolationResponse = $cluster.HAIsolationResponse.ToString()\n            $result.HARestartPriority = $cluster.HARestartPriority.ToString()\n        }\n        else {\n            $result.Name = $this.Name\n            $result.Ensure = [Ensure]::Absent\n            $result.HAEnabled = $this.HAEnabled\n            $result.HAAdmissionControlEnabled = $this.HAAdmissionControlEnabled\n            $result.HAFailoverLevel = $this.HAFailoverLevel\n            $result.HAIsolationResponse = $this.HAIsolationResponse\n            $result.HARestartPriority = $this.HARestartPriority\n        }\n    }\n}\n"
  },
  {
    "path": "VMware.PSDesiredStateConfiguration.md",
    "content": "## Getting Started\n\n**VMware.PSDesiredStateConfiguration** module provides a set of cmdlets to compile and execute a **DSC Configuration** without using the **DSC Local Configuration Manager**. Compiled **DSC Configurations** are stored in memory as **PowerShell** objects.\n\n**Start-VmwDscConfiguration**, **Get-VmwDscConfiguration** and **Test-VmwDscConfiguration** cmdlets use the **Invoke-DSCResource** cmdlet from the **PSDesiredStateConfiguration** module to execute the compiled **DSC Configurations**.\n\nThe **VMware.PSDesiredStateConfiguration** module provides a cross platform support on **MacOS** and **Linux**. The module is also designed to work with the existing **DSC Resources** from the **VMware.vSphereDSC** module.\n\nThe module also exposes **vSphereNodes**, which represent connections to **vCenter Servers**.\nFor more information on **vSphereNodes**, please read here [vSphere Nodes](https://github.com/vmware/dscr-for-vmware/blob/master/Documentation/vSphereNodes.md).\n\n## Requirements\n\nThe following table describes the required dependencies for running the **VMware.PSDesiredStateConfiguration** module.\n\n **Required dependency**   | **Minimum version**\n-------------------------- | -------------------\n`PowerShell`               | **5.1 or 7.0**\n\nThe module also has additional requirements, depending on the **PowerShell** version, on which it is used.\n\n### PowerShell 7.0 requirements\n\n---\n**VMware.PSDesiredStateConfiguration** uses the **Invoke-DscResource** cmdlet from the **PSDesiredStateConfiguration** module to process individual **DSC Resources**. In **PowerShell 7.0** the **Invoke-DscResource** cmdlet is an experimental feature.\nThe **Invoke-DscResource** cmdlet can be enabled with the following command:\n\n```powershell\nEnable-ExperimentalFeature PSDesiredStateConfiguration.InvokeDscResource\n```\n\nAfter executing the command you must restart your **PowerShell** session. The command needs to be run only once and the cmdlet will be available.\nTo check if the **Invoke-DscResource** cmdlet has been enabled correctly run the following command:\n\n```powershell\nGet-Module 'PSDesiredStateConfiguration' -ListAvailable | Select-Object -ExpandProperty ExportedCommands\n```\n### Important\n\nWhen using **PowerShell 7.0** please keep in mind the list of [Known Limitations](https://github.com/vmware/dscr-for-vmware/blob/master/LIMITATIONS.md).\n\n---\n### PowerShell 5.1 requirements\n\nFor **PowerShell 5.1** you need to enable Windows Remote Management.\nFor information on how to enable it read here: [WinRM guide](https://docs.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management).\n\n## Installing the VMware.PSDesiredStateConfiguration Module\n\nThere are two ways to install the **VMware.PSDesiredStateConfiguration** Module: Download it from the **PowerShell Gallery** or download it from the [Releases page](https://github.com/vmware/dscr-for-vmware/releases).\n\n### PowerShell Gallery\n\n```powershell\n Install-Module -Name VMware.PSDesiredStateConfiguration\n```\n\n### Download it from [Releases](https://github.com/vmware/dscr-for-vmware/releases)\n\n1. Copy the **VMware.PSDesiredStateConfiguration** Module to one of the system **PowerShell** module directories. For more information on installing **PowerShell** Modules, please visit [Installing a PowerShell Module](https://docs.microsoft.com/en-us/powershell/scripting/developer/module/installing-a-powershell-module?view=powershell-7).\n2. In **PowerShell** import the **VMware.PSDesiredStateConfiguration** module:\n   ```powershell\n    Import-Module -Name 'VMware.PSDesiredStateConfiguration'\n   ```\n\n   To check if the module was successfully installed:\n   ```powershell\n    Get-Module -Name 'VMware.PSDesiredStateConfiguration'\n   ```\n\n## Overview\n\nThe **VMware.PSDesiredStateConfiguration** module works with **PowerShell** script files that contain **DSC Configurations** and the general workflow for creating **VmwDscConfiguration** objects is:\n\n- Compiles **DSC Configurations** defined in a **PowerShell** script file and transforms the given **DSC Configurations** into **VmwDscConfiguration** objects. The **VmwDscConfiguration** object contains the name of the **DSC Configuration** and an array of **DSC Nodes**.\n\n- All **DSC Resources** which are not defined inside a **Node** will get bundled into a default **localhost** **Node**. Each **Node** contains the name of the **Node** and an array of **DSC Resources**.\n\n- Each **DSC Resource** object contains an **InstanceName** for the name of the **DSC Resource** given in the **DSC Configuration**, a **ResourceType** which display the type of the **DSC Resource**, a **ModuleName** which displays the module of the **DSC Resource** and a **Property** which is a hashtable of properties which are unique for a given **DSC Resource**. Example **VmwDscConfiguration** object from a given **DSC Configuration**:\n\n    ```powershell\n    $Credential = Get-Credential\n\n    Configuration Datacenter_Config {\n        Import-DscResource -ModuleName VMware.vSphereDSC\n\n        Node localhost {\n            Datacenter MyDatacenter {\n                Server = '10.23.112.235'\n                Credential = $Credential\n                Name = 'MyDatacenter'\n                Location = ''\n                Ensure = 'Present'\n            }\n        }\n    }\n\n    # The compiled Datacenter_Config DSC Configuration as VmwDscConfiguration object.\n    [VmwDscConfiguration] @{\n        InstanceName = 'Datacenter_Config'\n        Nodes = @(\n            [VmwDscNode] @{\n                InstanceName = 'localhost'\n                Resources = @(\n                    [VmwDscResource] @{\n                        InstanceName = 'MyDatacenter'\n                        ResourceType = 'Datacenter'\n                        ModuleName = 'VMware.vSphereDSC'\n                        Property = @{\n                            Server = '10.23.112.235'\n                            Credential = System.Management.Automation.PSCredential\n                            Name = 'MyDatacenter'\n                            Location = ''\n                            Ensure = 'Present'\n                        }\n                    }\n                )\n            }\n        )\n    }\n    ```\n\n    Note: This step does not require a configured **LCM** and does not generate a **MOF** file.\n\n- The resulting **VmwDscConfiguration** objects generated by the **New-VmwDscConfiguration** cmdlet are used by the **Start, Get and Test-VmwDscConfiguration** cmdlets.\n\n## Cmdlet Guide\n\n### New-VmwDscConfiguration\n\nCompiles a **DSC Configuration** into a **VmwDscConfiguration** object, which contains the name of the **DSC Configuration** and the **DSC Resources** defined in it.\n\n#### Parameters\n\n#### Mandatory\n\n- **Path** - A file path of a file that contains **DSC Configurations**. The file can contain multiple **DSC Configurations** and for each one, a separate **VmwDscConfiguration** object is created. If **ConfigurationData** hashtable is defined in the provided file, it is passed to each **DSC Configuration** defined in the file.\n\n#### Optional\n\n- **ConfigurationName** - The name of the **DSC Configuration** which should be compiled into a **VmwDscConfiguration** object. This parameter is applicable only when multiple **DSC Configurations** are defined in the file and only one specific **DSC Configuration** should be compiled. If not specified, all **DSC Configurations** in the file are compiled and returned as **VmwDscConfiguration** objects.\n\n- **Parameters** - The parameters of the file that contains the **DSC Configurations** as a hashtable where each key is the parameter name and each value is the parameter value.\n\n#### Examples\n\n#### **Parameters** example:\n\nThe following **DSC Configuration** depends on a **Server** and **Credential** parameters:\n\n```powershell\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [System.Management.Automation.PSCredential]\n    $Credential\n)\n\nConfiguration Datacenter_Config {\n    Param(\n        [string]\n        $Server,\n\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node localhost {\n        Datacenter MyDatacenter {\n            Server = $Server\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\nIn order to supply the required **Server** and **Credential** parameters of the **DSC Configuration** we use the **Parameters** parameter.\n\n```powershell\n$Credential = Get-Credential\n\n$newVmwDscConfigParams = @{\n    Path = '.\\Datacenter_Config.ps1'\n    Parameters = @{\n        Server = '10.23.112.235'\n        Credential = $Credential\n    }\n}\n\n$dscConfiguration = New-VmwDscConfiguration @newVmwDscConfigParams\n```\n\n#### ConfigurationData example:\n\nThe following **DSC Configuration** depends on a **Server** and **Credential** parameters that are specified in the **ConfigurationData** hashtable:\n\n```powershell\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [string]\n    $Server,\n\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [System.Management.Automation.PSCredential]\n    $Credential\n)\n\n$script:configurationData = @{\n    AllNodes = @(\n        @{\n            NodeName = 'localhost'\n            Server = $Server\n            Credential = $Credential\n        }\n    )\n}\n\nConfiguration Datacenter_Config {\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node $AllNodes.NodeName {\n        Datacenter MyDatacenter {\n            Server = $AllNodes.Server\n            Credential = $AllNodes.Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n}\n```\n\nIn order to supply the required **Server** and **Credential** parameters of the **ConfigurationData** hashtable we use the **Parameters** parameter.\n\n```powershell\n$Credential = Get-Credential\n\n$newVmwDscConfigParams = @{\n    Path = '.\\Datacenter_Config.ps1'\n    Parameters = @{\n        Server = '10.23.112.235'\n        Credential = $Credential\n    }\n}\n\n$dscConfiguration = New-VmwDscConfiguration @newVmwDscConfigParams\n```\n\n---\n### Start, Test and Get-VmwDscConfiguration\n\nThese cmdlets work with the **VmwDscConfiguration** object created by the **New-VmwDscConfiguration** cmdlet and apply the **Set, Test, Get methods** to the compiled **DSC Configuration**.\n\n#### Parameters\n\n#### Mandatory\n\n- **Configuration** - A **VmwDscConfiguration** object compiled by the **New-VmwDscConfiguration** cmdlet.\n\n#### Optional\n\n- **ConnectionFilter** - An array of **Node** names on which the **DSC Configuration** should be executed. **Nodes** that are not in the list will be skipped. **Node** names can be strings or **VIServer** objects.\n\n---\n#### Examples\n\n#### Example with the [VMHostNtpSettings Resource](https://github.com/vmware/dscr-for-vmware/wiki/VMHostNtpSettings) from the **VMware.vSphereDSC** module\n\n1. Use the following **VNware.vSphereDSC DSC Configuration**:\n\n    ```powershell\n    Configuration VMHostNtpSettings_Config {\n        Import-DscResource -ModuleName VMware.vSphereDSC\n\n        $Password = $Password | ConvertTo-SecureString -AsPlainText -Force\n        $Credential = New-Object System.Management.Automation.PSCredential($User, $Password)\n\n        VMHostNtpSettings vmHostNtpSettings {\n            Name = $Name\n            Server = $Server\n            Credential = $Credential\n            NtpServer = @(\"0.bg.pool.ntp.org\", \"1.bg.pool.ntp.org\", \"2.bg.pool.ntp.org\")\n            NtpServicePolicy = \"automatic\"\n        }\n    }\n    ```\n\n2. You need to compile the **DSC Configuration** to a **VmwDscConfiguration** object:\n\n    ```powershell\n    $newVmwDscConfigParams = @{\n        Path = '.\\VMHostNtpSettings_Config.ps1'\n        ConfigurationName = 'VMHostNtpSettings_Config'\n        Parameters = @{\n            Server = '10.23.112.235'\n            User = 'Admin'\n            Password = 'AdminPass'\n            Name = '10.23.112.236'\n        }\n    }\n\n    $dscConfiguration = New-VmwDscConfiguration @newVmwDscConfigParams\n    ```\n\n3. To test if the **NTP Settings** are in the desired state:\n\n    ```powershell\n    Test-VmwDscConfiguration -Configuration $dscConfiguration\n    ```\n\n    This will return a boolean result that shows if the state is desired or not. If you want a detailed result in which every **DSC Resource** state is shown you can use the optional **-Detailed** switch of the **Test-VmwDscConfiguration** cmdlet:\n\n    ```powershell\n    Test-VmwDscConfiguration -Configuration $dscConfiguration -Detailed\n    ```\n\n    The resulting object will contain an **InDesiredState** flag which shows the overall state of the **DSC Configuration**, a **ResourcesInDesiredState** array of **DSC Resources** in desired state and a **ResourcesNotInDesiredState** array of **DSC Resources** not in desired state.\n\n    **Test-VmwDscConfiguration** also remembers the last run **DSC Configuration** so you can use the **-ExecuteLastConfiguration** flag to invoke it:\n\n    ```powershell\n    Test-VmwDscConfiguration -ExecuteLastConfiguration\n    ```\n\n4. To Apply the **NTP Configuration**:\n\n    ```powershell\n    Start-VmwDscConfiguration -Configuration $dscConfiguration\n    ```\n\n5. To get the current sate of the **DSC Configuration**:\n\n    ```powershell\n    Get-VmwDscConfiguration -Configuration $dscConfiguration\n    ```\n\n    **Get-VmwDscConfiguration** also remembers the last run configuration so you can use the **-ExecuteLastConfiguration** flag to invoke it:\n\n    ```powershell\n    Get-VmwDscConfiguration -ExecuteLastConfiguration\n    ```\n\n#### Example with the ConnectionFilter parameter\n\nThe following configuration has multiple **Nodes**. Only the **Nodes** specified in the **ConnectionFilter** will be executed.\n\n```powershell\nParam(\n    [Parameter(Mandatory = $true)]\n    [ValidateNotNullOrEmpty()]\n    [System.Management.Automation.PSCredential]\n    $Credential\n)\n\nConfiguration Datacenter_Config {\n    Param(\n        [System.Management.Automation.PSCredential]\n        $Credential\n    )\n\n    Import-DscResource -ModuleName VMware.vSphereDSC\n\n    Node 10.23.112.235 {\n        Datacenter MyDatacenter {\n            Server = '10.23.112.235'\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n\n    Node 10.23.112.237 {\n        Datacenter MyDatacenter {\n            Server = '10.23.112.237'\n            Credential = $Credential\n            Name = 'MyDatacenter'\n            Location = ''\n            Ensure = 'Present'\n        }\n    }\n}\n\n$Credential = Get-Credential\n\n$newVmwDscConfigParams = @{\n    Path = '.\\Datacenter_Config.ps1'\n    Parameters = @{\n        Credential = $Credential\n    }\n}\n\n$dscConfiguration = New-VmwDscConfiguration @newVmwDscConfigParams\n\n$startVmwDscConfigParams = @{\n    Configuration = $dscConfiguration\n    ConnectionFilter = '10.23.112.237'\n}\n\n$result = Start-VmwDscConfiguration @startVmwDscConfigParams\n```\n"
  },
  {
    "path": "VMware.vSphereDSC.md",
    "content": "## Getting Started\n\n## Requirements\n\n**VMware.vSphereDSC** module contains Microsoft PowerShell Desired State Configuration Resources.\nThe following table describes the required dependencies for running VMware.vSphereDSC Resources.\n\n **Required dependency**   | **Minimum version**\n-------------------------- | -------------------\n`PowerShell`               | 5.1 or 7.0\n`PowerCLI`                 | 10.1.1\n\nFor information on how to install PowerShell, please visit [Installing Windows PowerShell](https://docs.microsoft.com/en-us/skypeforbusiness/set-up-your-computer-for-windows-powershell/download-and-install-windows-powershell-5-1).\n\nFor information on how to install PowerCLI, please visit the [PowerCLI Blog](https://blogs.vmware.com/PowerCLI/2018/02/powercli-10.html).\n\nYou also need to configure the DSC LCM on a Windows machine where the resources will run. For more information on how to configure it, please visit [Desired State Configuration Quick Start](https://docs.microsoft.com/en-us/powershell/scripting/dsc/quickstarts/website-quickstart?view=powershell-5.1)\n\n## Installing the VMware.vSphereDSC Resources\n\nThere are two ways to install the **VMware.vSphereDSC** Module: Download it from the **PowerShell Gallery** or download it from the [Releases page](https://github.com/vmware/dscr-for-vmware/releases).\n\n### PowerShell Gallery\n\n```powershell\n Install-Module -Name VMware.vSphereDSC\n```\n\n### Download it from [Releases](https://github.com/vmware/dscr-for-vmware/releases)\n\n1. Copy the **VMware.vSphereDSC** Module to one of the system **PowerShell** module directories. For more information on installing **PowerShell** Modules, please visit [Installing a PowerShell Module](https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-5.1).\n2. In **PowerShell** import the **VMware.vSphereDSC** Module:\n   ```\n    Import-Module -Name 'VMware.vSphereDSC'\n   ```\n\n   To check if the module was successfully installed:\n   ```\n    Get-DscResource -Module 'VMware.vSphereDSC'\n   ```\n\n## Applying VMware.vSphereDSC Resource Configuration\n\n# Configuring PowerCLI\n\nTo configure PowerCLI you can use the **PowerCLISettings DSC Resource** and specify which settings you want to be configured. For more information on the available settings, please visit the wiki page of the [PowerCLISettings DSC Resource](https://github.com/vmware/dscr-for-vmware/wiki/PowerCLISettings).\n\n## Documentation and Examples\n\n# Example\n\nThe following example uses [VMHostNtpSettings Resource](https://github.com/vmware/dscr-for-vmware/wiki/VMHostNtpSettings) and configures the NTP Server and the 'ntpd' Service Policy.\n\n1. You need to compile the [Configuration File](https://github.com/vmware/dscr-for-vmware/blob/master/Source/VMware.vSphereDSC/Configurations/PowerShell/ESXiConfigs/VMHostNtpSettings_Config.ps1) to [MOF](https://docs.microsoft.com/en-us/windows/desktop/wmisdk/managed-object-format--mof-):\n   ```\n    $ntpConfigPath = Join-Path (Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Configurations') 'ESXiConfigs')'VMHostNtpSettings_Config.ps1'\n    . $ntpConfigPath -Name '<VMHost Name>' -Server 'Server Name>' -User '<User Name>' -Password '<Password for User>'\n   ```\n2. To Test if the NTP Settings are in the desired state:\n   ```\n    Test-DscConfiguration -ComputerName <The name of the machine on which you are applying your configuration> -Path .\\VMHostNtpSettings_Config\\\n   ```\n3. To Apply the NTP Configuration:\n   ```\n    Start-DscConfiguration -ComputerName <The name of the machine on which you are applying your configuration> -Path .\\VMHostNtpSettings_Config\\ -Wait -Force\n   ```\n4. To get the latest applied configuration on your machine:\n   ```\n    Get-DscConfiguration\n   ```\n\nIf you want to apply other configurations, you just need to compile the configuration file and pass the path of the created MOF file to the DSC cmdlets.\n\nFor more information about the DSC cmdlets please visit the [PSDesiredStateConfiguration](https://docs.microsoft.com/en-us/powershell/module/psdesiredstateconfiguration/?view=powershell-5.1).\n\nFor a full list of resources in VMware.vSphereDSC and examples on their use, check out\nthe [Desired State Configuration Resources for VMware wiki](https://github.com/vmware/dscr-for-vmware/wiki).\n\nExamples with Chef, Puppet and Ansible can be found [here](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations).\n"
  }
]